summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
commit6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac (patch)
tree2e8bb660c908b54914abd562af8aafa4a486c846
parenta61c8728b379057fe7f0a0d86fe0b037598229dd (diff)
less TCHARs:
- TCHAR is replaced with wchar_t everywhere; - LPGENT replaced with either LPGENW or LPGEN; - fixes for ANSI plugins that improperly used _t functions; - TCHAR *t removed from MAllStrings; - ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz* git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--include/m_acc.h2
-rw-r--r--include/m_clc.h5
-rw-r--r--include/m_core.h2
-rw-r--r--include/m_hotkeys.h4
-rw-r--r--include/m_langpack.h9
-rw-r--r--include/m_metacontacts.h3
-rw-r--r--include/m_options.h22
-rw-r--r--include/m_popup.h2
-rw-r--r--include/m_system.h1
-rw-r--r--include/m_system_cpp.h24
-rw-r--r--libs/libcurl/src/curl_memory.h8
-rw-r--r--libs/libcurl/src/curl_ntlm_msgs.c22
-rw-r--r--libs/libcurl/src/curl_schannel.c10
-rw-r--r--libs/libcurl/src/http_negotiate_sspi.c6
-rw-r--r--libs/libcurl/src/memdebug.h8
-rw-r--r--libs/libcurl/src/socks_sspi.c4
-rw-r--r--libs/libevent/src/evdns.c2
-rw-r--r--libs/libevent/src/evutil.c11
-rw-r--r--libs/libevent/src/util-internal.h8
-rw-r--r--libs/libjson/src/libJSON.cpp10
-rw-r--r--libs/zlib/src/ioapi.c14
-rw-r--r--libs/zlib/src/ioapi.h2
-rw-r--r--libs/zlib/src/iowin32.c4
-rw-r--r--plugins/AVS/src/acc.cpp6
-rw-r--r--plugins/AVS/src/acc.h4
-rw-r--r--plugins/AVS/src/cache.cpp8
-rw-r--r--plugins/AVS/src/image_utils.cpp10
-rw-r--r--plugins/AVS/src/image_utils.h6
-rw-r--r--plugins/AVS/src/main.cpp10
-rw-r--r--plugins/AVS/src/options.cpp18
-rw-r--r--plugins/AVS/src/poll.cpp2
-rw-r--r--plugins/AVS/src/services.cpp46
-rw-r--r--plugins/AVS/src/stdafx.h12
-rw-r--r--plugins/AVS/src/utils.cpp22
-rw-r--r--plugins/AddContactPlus/src/addcontact.cpp28
-rw-r--r--plugins/AddContactPlus/src/main.cpp6
-rw-r--r--plugins/Alarms/src/alarm_win.cpp34
-rw-r--r--plugins/Alarms/src/alarms.cpp6
-rw-r--r--plugins/Alarms/src/frame.cpp10
-rw-r--r--plugins/Alarms/src/options.cpp6
-rw-r--r--plugins/Alarms/src/stdafx.h8
-rw-r--r--plugins/AssocMgr/src/assoclist.cpp42
-rw-r--r--plugins/AssocMgr/src/assoclist.h4
-rw-r--r--plugins/AssocMgr/src/dde.cpp30
-rw-r--r--plugins/AssocMgr/src/main.cpp8
-rw-r--r--plugins/AssocMgr/src/reg.cpp146
-rw-r--r--plugins/AssocMgr/src/reg.h24
-rw-r--r--plugins/AssocMgr/src/test.cpp16
-rw-r--r--plugins/AssocMgr/src/utils.cpp4
-rw-r--r--plugins/AssocMgr/src/utils.h4
-rw-r--r--plugins/AuthState/src/main.cpp6
-rw-r--r--plugins/AutoRun/src/main.cpp12
-rw-r--r--plugins/AutoShutdown/src/cpuusage.cpp2
-rw-r--r--plugins/AutoShutdown/src/frame.cpp10
-rw-r--r--plugins/AutoShutdown/src/options.cpp6
-rw-r--r--plugins/AutoShutdown/src/settingsdlg.cpp18
-rw-r--r--plugins/AutoShutdown/src/shutdownsvc.cpp60
-rw-r--r--plugins/AutoShutdown/src/utils.cpp16
-rw-r--r--plugins/AutoShutdown/src/utils.h6
-rw-r--r--plugins/AutoShutdown/src/watcher.cpp6
-rw-r--r--plugins/AvatarHistory/src/AvatarDlg.cpp50
-rw-r--r--plugins/AvatarHistory/src/AvatarHistory.cpp30
-rw-r--r--plugins/AvatarHistory/src/options.cpp8
-rw-r--r--plugins/AvatarHistory/src/popup.cpp14
-rw-r--r--plugins/AvatarHistory/src/popup.h12
-rw-r--r--plugins/AvatarHistory/src/stdafx.h16
-rw-r--r--plugins/AvatarHistory/src/utils.cpp40
-rw-r--r--plugins/BASS_interface/src/Main.cpp10
-rw-r--r--plugins/BasicHistory/src/BasicHistory.cpp12
-rw-r--r--plugins/BasicHistory/src/BinaryExport.h2
-rw-r--r--plugins/BasicHistory/src/DatExport.cpp2
-rw-r--r--plugins/BasicHistory/src/DatExport.h2
-rw-r--r--plugins/BasicHistory/src/EventList.cpp28
-rw-r--r--plugins/BasicHistory/src/EventList.h20
-rw-r--r--plugins/BasicHistory/src/ExportManager.cpp28
-rw-r--r--plugins/BasicHistory/src/ExportManager.h2
-rw-r--r--plugins/BasicHistory/src/HistoryWindow.cpp52
-rw-r--r--plugins/BasicHistory/src/IExport.h2
-rw-r--r--plugins/BasicHistory/src/IImport.h2
-rw-r--r--plugins/BasicHistory/src/Options.cpp196
-rw-r--r--plugins/BasicHistory/src/Options.h2
-rw-r--r--plugins/BasicHistory/src/PlainHtmlExport.cpp6
-rw-r--r--plugins/BasicHistory/src/PlainHtmlExport.h2
-rw-r--r--plugins/BasicHistory/src/RichHtmlExport.cpp28
-rw-r--r--plugins/BasicHistory/src/RichHtmlExport.h2
-rw-r--r--plugins/BasicHistory/src/Scheduler.cpp60
-rw-r--r--plugins/BasicHistory/src/Searcher.cpp20
-rw-r--r--plugins/BasicHistory/src/Searcher.h6
-rw-r--r--plugins/BasicHistory/src/TxtExport.cpp2
-rw-r--r--plugins/BasicHistory/src/TxtExport.h2
-rw-r--r--plugins/Boltun/src/Engine/Mind.cpp130
-rw-r--r--plugins/Boltun/src/Engine/Mind.h38
-rw-r--r--plugins/Boltun/src/Engine/TalkEngine.cpp160
-rw-r--r--plugins/Boltun/src/Engine/TalkEngine.h44
-rw-r--r--plugins/Boltun/src/Engine/UnrecentChooser.cpp10
-rw-r--r--plugins/Boltun/src/Engine/UnrecentChooser.h16
-rw-r--r--plugins/Boltun/src/Engine/ValueChooser.h2
-rw-r--r--plugins/Boltun/src/Engine/WordsList.cpp48
-rw-r--r--plugins/Boltun/src/Engine/WordsList.h18
-rw-r--r--plugins/Boltun/src/actionQueue.cpp6
-rw-r--r--plugins/Boltun/src/actionQueue.h2
-rw-r--r--plugins/Boltun/src/boltun.cpp56
-rw-r--r--plugins/Boltun/src/config.cpp22
-rw-r--r--plugins/Boltun/src/config.h8
-rw-r--r--plugins/Boltun/src/stdafx.h12
-rw-r--r--plugins/BossKeyPlus/src/BossKey.cpp42
-rw-r--r--plugins/BossKeyPlus/src/Options.cpp20
-rw-r--r--plugins/BossKeyPlus/src/stdafx.h4
-rw-r--r--plugins/BuddyExpectator/src/BuddyExpectator.cpp54
-rw-r--r--plugins/BuddyExpectator/src/options.cpp22
-rw-r--r--plugins/BuddyPounce/src/dialog.cpp48
-rw-r--r--plugins/BuddyPounce/src/main.cpp14
-rw-r--r--plugins/BuddyPounce/src/stdafx.h4
-rw-r--r--plugins/CSList/src/cslist.cpp46
-rw-r--r--plugins/CSList/src/stdafx.h38
-rw-r--r--plugins/CSList/src/strpos.h8
-rw-r--r--plugins/ChangeKeyboardLayout/src/hook_events.cpp4
-rw-r--r--plugins/ChangeKeyboardLayout/src/options.cpp8
-rw-r--r--plugins/ChangeKeyboardLayout/src/text_operations.cpp60
-rw-r--r--plugins/ClientChangeNotify/src/CString.cpp6
-rw-r--r--plugins/ClientChangeNotify/src/CString.h7
-rw-r--r--plugins/ClientChangeNotify/src/ClientChangeNotify.cpp22
-rw-r--r--plugins/ClientChangeNotify/src/Misc.h8
-rw-r--r--plugins/ClientChangeNotify/src/OptDlg.cpp18
-rw-r--r--plugins/ClientChangeNotify/src/Options.cpp8
-rw-r--r--plugins/ClientChangeNotify/src/Options.h4
-rw-r--r--plugins/ClientChangeNotify/src/pcre.cpp8
-rw-r--r--plugins/Clist_blind/src/clcopts.cpp48
-rw-r--r--plugins/Clist_blind/src/clcpaint.cpp6
-rw-r--r--plugins/Clist_blind/src/cluiopts.cpp2
-rw-r--r--plugins/Clist_blind/src/contact.cpp6
-rw-r--r--plugins/Clist_blind/src/init.cpp82
-rw-r--r--plugins/Clist_modern/src/cluiframes.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_aniavatars.cpp16
-rw-r--r--plugins/Clist_modern/src/modern_cachefuncs.cpp42
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp26
-rw-r--r--plugins/Clist_modern/src/modern_clc.h6
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp10
-rw-r--r--plugins/Clist_modern/src/modern_clcopts.cpp142
-rw-r--r--plugins/Clist_modern/src/modern_clcpaint.cpp56
-rw-r--r--plugins/Clist_modern/src/modern_clcpaint.h4
-rw-r--r--plugins/Clist_modern/src/modern_clcutils.cpp22
-rw-r--r--plugins/Clist_modern/src/modern_clist.h10
-rw-r--r--plugins/Clist_modern/src/modern_clistevents.cpp16
-rw-r--r--plugins/Clist_modern/src/modern_clistmenus.cpp18
-rw-r--r--plugins/Clist_modern/src/modern_clistmod.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clistopts.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_clistsettings.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp50
-rw-r--r--plugins/Clist_modern/src/modern_commonprototypes.h20
-rw-r--r--plugins/Clist_modern/src/modern_effectenum.h6
-rw-r--r--plugins/Clist_modern/src/modern_gdiplus.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_global_structure.h2
-rw-r--r--plugins/Clist_modern/src/modern_keyboard.cpp12
-rw-r--r--plugins/Clist_modern/src/modern_rowheight_funcs.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_rowtemplateopt.cpp8
-rw-r--r--plugins/Clist_modern/src/modern_skinbutton.cpp12
-rw-r--r--plugins/Clist_modern/src/modern_skinengine.cpp88
-rw-r--r--plugins/Clist_modern/src/modern_skinengine.h8
-rw-r--r--plugins/Clist_modern/src/modern_skinopt.cpp76
-rw-r--r--plugins/Clist_modern/src/modern_skinselector.cpp8
-rw-r--r--plugins/Clist_modern/src/modern_skinselector.h2
-rw-r--r--plugins/Clist_modern/src/modern_statusbar.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_statusbar_options.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_tbbutton.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_toolbar.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_utils.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_viewmodebar.cpp30
-rw-r--r--plugins/Clist_modern/src/stdafx.h4
-rw-r--r--plugins/Clist_ng/SRC/clcopts.cpp10
-rw-r--r--plugins/Clist_nicer/src/CLCButton.cpp4
-rw-r--r--plugins/Clist_nicer/src/clc.h14
-rw-r--r--plugins/Clist_nicer/src/clcitems.cpp26
-rw-r--r--plugins/Clist_nicer/src/clcopts.cpp18
-rw-r--r--plugins/Clist_nicer/src/clcpaint.cpp12
-rw-r--r--plugins/Clist_nicer/src/clcutils.cpp24
-rw-r--r--plugins/Clist_nicer/src/clistevents.cpp8
-rw-r--r--plugins/Clist_nicer/src/clistmenus.cpp2
-rw-r--r--plugins/Clist_nicer/src/clui.cpp62
-rw-r--r--plugins/Clist_nicer/src/cluiframes.cpp6
-rw-r--r--plugins/Clist_nicer/src/cluiopts.cpp2
-rw-r--r--plugins/Clist_nicer/src/cluiservices.cpp6
-rw-r--r--plugins/Clist_nicer/src/config.cpp14
-rw-r--r--plugins/Clist_nicer/src/config.h10
-rw-r--r--plugins/Clist_nicer/src/contact.cpp8
-rw-r--r--plugins/Clist_nicer/src/coolsblib.cpp2
-rw-r--r--plugins/Clist_nicer/src/extBackg.cpp12
-rw-r--r--plugins/Clist_nicer/src/extBackg.h6
-rw-r--r--plugins/Clist_nicer/src/groupmenu.cpp4
-rw-r--r--plugins/Clist_nicer/src/init.cpp6
-rw-r--r--plugins/Clist_nicer/src/statusbar.cpp2
-rw-r--r--plugins/Clist_nicer/src/viewmodes.cpp18
-rw-r--r--plugins/Cln_skinedit/src/main.cpp2
-rw-r--r--plugins/CmdLine/src/mimcmd_handlers.cpp2
-rw-r--r--plugins/ConnectionNotify/src/ConnectionNotify.cpp36
-rw-r--r--plugins/ConnectionNotify/src/debug.cpp2
-rw-r--r--plugins/ConnectionNotify/src/debug.h3
-rw-r--r--plugins/ConnectionNotify/src/filter.cpp2
-rw-r--r--plugins/ConnectionNotify/src/netstat.cpp14
-rw-r--r--plugins/ConnectionNotify/src/netstat.h10
-rw-r--r--plugins/ConnectionNotify/src/pid2name.cpp4
-rw-r--r--plugins/ConnectionNotify/src/pid2name.h2
-rw-r--r--plugins/ConnectionNotify/src/stdafx.h2
-rw-r--r--plugins/Console/src/Console.cpp96
-rw-r--r--plugins/ContactsPlus/src/main.cpp2
-rw-r--r--plugins/ContactsPlus/src/receive.cpp40
-rw-r--r--plugins/ContactsPlus/src/receive.h6
-rw-r--r--plugins/ContactsPlus/src/send.cpp10
-rw-r--r--plugins/ContactsPlus/src/utils.cpp30
-rw-r--r--plugins/ContactsPlus/src/utils.h6
-rw-r--r--plugins/CrashDumper/src/crshdmp.cpp18
-rw-r--r--plugins/CrashDumper/src/dumper.cpp68
-rw-r--r--plugins/CrashDumper/src/exhndlr.cpp2
-rw-r--r--plugins/CrashDumper/src/stdafx.h10
-rw-r--r--plugins/CrashDumper/src/ui.cpp4
-rw-r--r--plugins/CrashDumper/src/upload.cpp2
-rw-r--r--plugins/CrashDumper/src/utils.cpp22
-rw-r--r--plugins/Db3x_mmap/src/database.cpp8
-rw-r--r--plugins/Db3x_mmap/src/dbheaders.cpp8
-rw-r--r--plugins/Db3x_mmap/src/dbintf.cpp2
-rw-r--r--plugins/Db3x_mmap/src/dbintf.h10
-rw-r--r--plugins/Db3x_mmap/src/dbtool/modulechain.cpp4
-rw-r--r--plugins/Db3x_mmap/src/init.cpp8
-rw-r--r--plugins/Db3x_mmap/src/ui.cpp12
-rw-r--r--plugins/DbChecker/src/main.cpp2
-rw-r--r--plugins/DbChecker/src/openerror.cpp2
-rw-r--r--plugins/DbChecker/src/progress.cpp6
-rw-r--r--plugins/DbChecker/src/selectdb.cpp48
-rw-r--r--plugins/DbChecker/src/stdafx.h10
-rw-r--r--plugins/DbChecker/src/worker.cpp8
-rw-r--r--plugins/DbEditorPP/src/copymodule.cpp2
-rw-r--r--plugins/DbEditorPP/src/deletemodule.cpp8
-rw-r--r--plugins/DbEditorPP/src/exportimport.cpp38
-rw-r--r--plugins/DbEditorPP/src/findwindow.cpp32
-rw-r--r--plugins/DbEditorPP/src/main.cpp18
-rw-r--r--plugins/DbEditorPP/src/main_window.cpp6
-rw-r--r--plugins/DbEditorPP/src/moduletree.cpp18
-rw-r--r--plugins/DbEditorPP/src/renamemodule.cpp2
-rw-r--r--plugins/DbEditorPP/src/settinglist.cpp84
-rw-r--r--plugins/DbEditorPP/src/settingsdlg.cpp16
-rw-r--r--plugins/DbEditorPP/src/stdafx.h12
-rw-r--r--plugins/DbEditorPP/src/watchedvars.cpp14
-rw-r--r--plugins/Db_autobackups/src/backup.cpp56
-rw-r--r--plugins/Db_autobackups/src/main.cpp6
-rw-r--r--plugins/Db_autobackups/src/options.cpp40
-rw-r--r--plugins/Db_autobackups/src/options.h2
-rw-r--r--plugins/Db_autobackups/src/stdafx.h4
-rw-r--r--plugins/Dbx_mdb/src/dbintf.cpp4
-rw-r--r--plugins/Dbx_mdb/src/ui.cpp2
-rw-r--r--plugins/Dropbox/src/dropbox.cpp4
-rw-r--r--plugins/Dropbox/src/dropbox.h10
-rw-r--r--plugins/Dropbox/src/dropbox_options.cpp8
-rw-r--r--plugins/Dropbox/src/dropbox_services.cpp6
-rw-r--r--plugins/Dropbox/src/dropbox_transfers.cpp10
-rw-r--r--plugins/Dropbox/src/dropbox_utils.cpp16
-rw-r--r--plugins/Dropbox/src/file_transfer.h42
-rw-r--r--plugins/Dropbox/src/stdafx.h1
-rw-r--r--plugins/Exchange/src/MirandaExchange.cpp40
-rw-r--r--plugins/Exchange/src/dlg_handlers.cpp12
-rw-r--r--plugins/Exchange/src/emails.cpp32
-rw-r--r--plugins/Exchange/src/emails.h16
-rw-r--r--plugins/Exchange/src/hooked_events.cpp6
-rw-r--r--plugins/Exchange/src/utils.cpp28
-rw-r--r--plugins/Exchange/src/utils.h6
-rw-r--r--plugins/ExternalAPI/m_folders.h2
-rw-r--r--plugins/FTPFileYM/src/dialog.cpp6
-rw-r--r--plugins/FTPFileYM/src/dialog.h8
-rw-r--r--plugins/FTPFileYM/src/ftpfile.cpp14
-rw-r--r--plugins/FTPFileYM/src/job_delete.cpp2
-rw-r--r--plugins/FTPFileYM/src/job_generic.cpp20
-rw-r--r--plugins/FTPFileYM/src/job_generic.h14
-rw-r--r--plugins/FTPFileYM/src/job_packer.cpp18
-rw-r--r--plugins/FTPFileYM/src/job_packer.h2
-rw-r--r--plugins/FTPFileYM/src/job_upload.cpp10
-rw-r--r--plugins/FTPFileYM/src/manager.cpp2
-rw-r--r--plugins/FTPFileYM/src/manager.h2
-rw-r--r--plugins/FTPFileYM/src/mir_db.cpp6
-rw-r--r--plugins/FTPFileYM/src/mir_db.h6
-rw-r--r--plugins/FTPFileYM/src/options.cpp8
-rw-r--r--plugins/FTPFileYM/src/serverlist.h2
-rw-r--r--plugins/FTPFileYM/src/utils.cpp20
-rw-r--r--plugins/FTPFileYM/src/utils.h10
-rw-r--r--plugins/FavContacts/src/contact_cache.cpp18
-rw-r--r--plugins/FavContacts/src/contact_cache.h4
-rw-r--r--plugins/FavContacts/src/favlist.h10
-rw-r--r--plugins/FavContacts/src/http_api.cpp2
-rw-r--r--plugins/FavContacts/src/menu.cpp22
-rw-r--r--plugins/FavContacts/src/services.cpp38
-rw-r--r--plugins/FileAsMessage/src/main.cpp4
-rw-r--r--plugins/FingerprintNG/src/finger_groups.h52
-rw-r--r--plugins/FingerprintNG/src/fingerprint.cpp34
-rw-r--r--plugins/FingerprintNG/src/masks.cpp210
-rw-r--r--plugins/FingerprintNG/src/options.cpp4
-rw-r--r--plugins/FloatingContacts/src/bitmap_funcs.cpp2
-rw-r--r--plugins/FloatingContacts/src/bitmap_funcs.h2
-rw-r--r--plugins/FloatingContacts/src/filedrop.cpp2
-rw-r--r--plugins/FloatingContacts/src/fltcont.h3
-rw-r--r--plugins/FloatingContacts/src/main.cpp34
-rw-r--r--plugins/FloatingContacts/src/options.cpp4
-rw-r--r--plugins/FloatingContacts/src/thumbs.cpp4
-rw-r--r--plugins/FloatingContacts/src/thumbs.h4
-rw-r--r--plugins/Folders/src/dlg_handlers.cpp16
-rw-r--r--plugins/Folders/src/folderItem.cpp10
-rw-r--r--plugins/Folders/src/folderItem.h16
-rw-r--r--plugins/Folders/src/services.cpp16
-rw-r--r--plugins/Folders/src/services.h8
-rw-r--r--plugins/Folders/src/utils.cpp14
-rw-r--r--plugins/Folders/src/utils.h6
-rw-r--r--plugins/GmailNotifier/src/options.cpp2
-rw-r--r--plugins/HTTPServer/src/Glob.h2
-rw-r--r--plugins/HTTPServer/src/GuiElements.cpp52
-rw-r--r--plugins/HTTPServer/src/main.cpp34
-rw-r--r--plugins/HistoryLinkListPlus/src/linklist.cpp2
-rw-r--r--plugins/HistoryLinkListPlus/src/linklist_dlg.cpp22
-rw-r--r--plugins/HistoryLinkListPlus/src/linklist_fct.cpp125
-rw-r--r--plugins/HistoryLinkListPlus/src/stdafx.h6
-rw-r--r--plugins/HistoryStats/src/_consts.h112
-rw-r--r--plugins/HistoryStats/src/bandctrl.cpp2
-rw-r--r--plugins/HistoryStats/src/bandctrl.h2
-rw-r--r--plugins/HistoryStats/src/bandctrldefs.h4
-rw-r--r--plugins/HistoryStats/src/bandctrlimpl.cpp6
-rw-r--r--plugins/HistoryStats/src/bandctrlimpl.h2
-rw-r--r--plugins/HistoryStats/src/canvas.cpp4
-rw-r--r--plugins/HistoryStats/src/canvas.h2
-rw-r--r--plugins/HistoryStats/src/column.h16
-rw-r--r--plugins/HistoryStats/src/column_chatduration.cpp20
-rw-r--r--plugins/HistoryStats/src/column_chatduration.h6
-rw-r--r--plugins/HistoryStats/src/column_events.cpp34
-rw-r--r--plugins/HistoryStats/src/column_events.h6
-rw-r--r--plugins/HistoryStats/src/column_group.h6
-rw-r--r--plugins/HistoryStats/src/column_inout.cpp56
-rw-r--r--plugins/HistoryStats/src/column_inout.h6
-rw-r--r--plugins/HistoryStats/src/column_inoutgraph.cpp16
-rw-r--r--plugins/HistoryStats/src/column_inoutgraph.h6
-rw-r--r--plugins/HistoryStats/src/column_nick.h6
-rw-r--r--plugins/HistoryStats/src/column_protocol.h6
-rw-r--r--plugins/HistoryStats/src/column_rank.h6
-rw-r--r--plugins/HistoryStats/src/column_split.cpp72
-rw-r--r--plugins/HistoryStats/src/column_split.h6
-rw-r--r--plugins/HistoryStats/src/column_splittimeline.cpp68
-rw-r--r--plugins/HistoryStats/src/column_splittimeline.h6
-rw-r--r--plugins/HistoryStats/src/column_timeline.cpp52
-rw-r--r--plugins/HistoryStats/src/column_timeline.h6
-rw-r--r--plugins/HistoryStats/src/column_wordcount.cpp16
-rw-r--r--plugins/HistoryStats/src/column_wordcount.h6
-rw-r--r--plugins/HistoryStats/src/column_words.cpp16
-rw-r--r--plugins/HistoryStats/src/column_words.h6
-rw-r--r--plugins/HistoryStats/src/dlgfilterwords.cpp28
-rw-r--r--plugins/HistoryStats/src/dlgoption.cpp18
-rw-r--r--plugins/HistoryStats/src/dlgoption.h10
-rw-r--r--plugins/HistoryStats/src/dlgoption_subcolumns.cpp18
-rw-r--r--plugins/HistoryStats/src/dlgoption_subglobal.cpp18
-rw-r--r--plugins/HistoryStats/src/dlgoption_suboutput.cpp104
-rw-r--r--plugins/HistoryStats/src/iconlib.cpp48
-rw-r--r--plugins/HistoryStats/src/iconlib.h4
-rw-r--r--plugins/HistoryStats/src/main.cpp14
-rw-r--r--plugins/HistoryStats/src/message.cpp24
-rw-r--r--plugins/HistoryStats/src/message.h2
-rw-r--r--plugins/HistoryStats/src/mirandasettings.cpp10
-rw-r--r--plugins/HistoryStats/src/mirandasettings.h10
-rw-r--r--plugins/HistoryStats/src/mu_common.cpp26
-rw-r--r--plugins/HistoryStats/src/mu_common.h12
-rw-r--r--plugins/HistoryStats/src/optionsctrl.cpp52
-rw-r--r--plugins/HistoryStats/src/optionsctrl.h26
-rw-r--r--plugins/HistoryStats/src/optionsctrldefs.h32
-rw-r--r--plugins/HistoryStats/src/optionsctrlimpl.cpp26
-rw-r--r--plugins/HistoryStats/src/optionsctrlimpl.h56
-rw-r--r--plugins/HistoryStats/src/optionsctrlimpl_button.cpp4
-rw-r--r--plugins/HistoryStats/src/optionsctrlimpl_check.cpp2
-rw-r--r--plugins/HistoryStats/src/optionsctrlimpl_color.cpp4
-rw-r--r--plugins/HistoryStats/src/optionsctrlimpl_combo.cpp6
-rw-r--r--plugins/HistoryStats/src/optionsctrlimpl_datetime.cpp4
-rw-r--r--plugins/HistoryStats/src/optionsctrlimpl_edit.cpp10
-rw-r--r--plugins/HistoryStats/src/optionsctrlimpl_group.cpp2
-rw-r--r--plugins/HistoryStats/src/optionsctrlimpl_item.cpp4
-rw-r--r--plugins/HistoryStats/src/optionsctrlimpl_radio.cpp2
-rw-r--r--plugins/HistoryStats/src/settings.cpp24
-rw-r--r--plugins/HistoryStats/src/settings.h26
-rw-r--r--plugins/HistoryStats/src/settingsserializer.cpp2
-rw-r--r--plugins/HistoryStats/src/settingsserializer.h2
-rw-r--r--plugins/HistoryStats/src/settingstree.cpp24
-rw-r--r--plugins/HistoryStats/src/settingstree.h20
-rw-r--r--plugins/HistoryStats/src/statistic.cpp32
-rw-r--r--plugins/HistoryStats/src/statistic.h2
-rw-r--r--plugins/HistoryStats/src/stdafx.h1
-rw-r--r--plugins/HistoryStats/src/utf8buffer.h10
-rw-r--r--plugins/HistoryStats/src/utils.cpp102
-rw-r--r--plugins/HistoryStats/src/utils.h28
-rw-r--r--plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp4
-rw-r--r--plugins/IEHistory/src/IEHistory.cpp4
-rw-r--r--plugins/IEHistory/src/dlgHandlers.cpp12
-rw-r--r--plugins/IEHistory/src/events.cpp2
-rw-r--r--plugins/IEHistory/src/utils.cpp12
-rw-r--r--plugins/IEHistory/src/utils.h2
-rw-r--r--plugins/IEView/src/HTMLBuilder.cpp2
-rw-r--r--plugins/IEView/src/Options.cpp24
-rw-r--r--plugins/IEView/src/TemplateHTMLBuilder.cpp30
-rw-r--r--plugins/IEView/src/external_funcs.cpp14
-rw-r--r--plugins/IEView/src/ieview_main.cpp2
-rw-r--r--plugins/IgnoreState/src/main.cpp16
-rw-r--r--plugins/IgnoreState/src/stdafx.h2
-rw-r--r--plugins/Import/src/import.cpp92
-rw-r--r--plugins/Import/src/miranda.cpp20
-rw-r--r--plugins/Import/src/stdafx.h6
-rw-r--r--plugins/Import/src/utils.cpp4
-rw-r--r--plugins/Import/src/wizard.cpp2
-rw-r--r--plugins/KeyboardNotify/src/EnumProc.cpp12
-rw-r--r--plugins/KeyboardNotify/src/EnumProc.h2
-rw-r--r--plugins/KeyboardNotify/src/flash.cpp88
-rw-r--r--plugins/KeyboardNotify/src/flash.h8
-rw-r--r--plugins/KeyboardNotify/src/keyboard.cpp4
-rw-r--r--plugins/KeyboardNotify/src/main.cpp24
-rw-r--r--plugins/KeyboardNotify/src/options.cpp100
-rw-r--r--plugins/KeyboardNotify/src/utils.cpp4
-rw-r--r--plugins/KeyboardNotify/src/utils.h2
-rw-r--r--plugins/ListeningTo/src/listeningto.cpp98
-rw-r--r--plugins/ListeningTo/src/options.cpp16
-rw-r--r--plugins/ListeningTo/src/options.h10
-rw-r--r--plugins/ListeningTo/src/players/foobar.cpp2
-rw-r--r--plugins/ListeningTo/src/players/generic.cpp12
-rw-r--r--plugins/ListeningTo/src/players/itunes.cpp14
-rw-r--r--plugins/ListeningTo/src/players/itunes.h2
-rw-r--r--plugins/ListeningTo/src/players/player.h6
-rw-r--r--plugins/ListeningTo/src/players/watrack.cpp6
-rw-r--r--plugins/ListeningTo/src/players/winamp.cpp2
-rw-r--r--plugins/ListeningTo/src/players/wmp.cpp6
-rw-r--r--plugins/ListeningTo/src/stdafx.h8
-rw-r--r--plugins/LotusNotify/src/LotusNotify.cpp156
-rw-r--r--plugins/LotusNotify/src/LotusNotify.h2
-rw-r--r--plugins/LotusNotify/src/lotusnotes.cpp2
-rw-r--r--plugins/LotusNotify/src/lotusnotes.h2
-rw-r--r--plugins/MenuItemEx/src/main.cpp96
-rw-r--r--plugins/MenuItemEx/src/options.cpp2
-rw-r--r--plugins/MessageState/src/messagestate.cpp12
-rw-r--r--plugins/MimCmd/src/commands.cpp14
-rw-r--r--plugins/MirFox/src/MirandaOptions.cpp12
-rw-r--r--plugins/MirFox/src/MirandaUtils.cpp6
-rw-r--r--plugins/MirFox/src/MirfoxData.cpp6
-rw-r--r--plugins/MirFox/src/MirfoxData.h8
-rw-r--r--plugins/MirLua/Modules/WinAPI/src/stdafx.h1
-rw-r--r--plugins/MirLua/Modules/WinAPI/src/winapi.cpp12
-rw-r--r--plugins/MirLua/Modules/m_variables/src/main.cpp2
-rw-r--r--plugins/MirLua/src/m_core.cpp2
-rw-r--r--plugins/MirLua/src/m_genmenu.cpp2
-rw-r--r--plugins/MirLua/src/m_icolib.cpp8
-rw-r--r--plugins/MirLua/src/m_options.cpp12
-rw-r--r--plugins/MirLua/src/main.cpp4
-rw-r--r--plugins/MirLua/src/mlua.cpp2
-rw-r--r--plugins/MirLua/src/mlua_icons.cpp14
-rw-r--r--plugins/MirLua/src/mlua_options.cpp14
-rw-r--r--plugins/MirLua/src/mlua_script.cpp12
-rw-r--r--plugins/MirLua/src/mlua_script.h10
-rw-r--r--plugins/MirLua/src/mlua_script_loader.cpp8
-rw-r--r--plugins/MirLua/src/mlua_script_loader.h2
-rw-r--r--plugins/MirOTR/src/dialogs.cpp124
-rw-r--r--plugins/MirOTR/src/dllmain.cpp2
-rw-r--r--plugins/MirOTR/src/language.h182
-rw-r--r--plugins/MirOTR/src/mirotrmenu.cpp22
-rw-r--r--plugins/MirOTR/src/options.cpp130
-rw-r--r--plugins/MirOTR/src/options.h6
-rw-r--r--plugins/MirOTR/src/otr.cpp50
-rw-r--r--plugins/MirOTR/src/otr.h2
-rw-r--r--plugins/MirOTR/src/svcs_menu.cpp38
-rw-r--r--plugins/MirOTR/src/svcs_proto.cpp6
-rw-r--r--plugins/MirOTR/src/svcs_srmm.cpp8
-rw-r--r--plugins/MirOTR/src/utils.cpp80
-rw-r--r--plugins/MirOTR/src/utils.h20
-rw-r--r--plugins/MirandaG15/src/CAppletManager.cpp18
-rw-r--r--plugins/MirandaG15/src/CAppletManager.h2
-rw-r--r--plugins/MirandaG15/src/CChatScreen.cpp2
-rw-r--r--plugins/MirandaG15/src/CContactList.cpp4
-rw-r--r--plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp12
-rw-r--r--plugins/MirandaG15/src/LCDFramework/CLCDLabel.cpp2
-rw-r--r--plugins/MirandaG15/src/LCDFramework/CLCDTextLog.cpp2
-rw-r--r--plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp2
-rw-r--r--plugins/MirandaG15/src/LCDFramework/debug.cpp4
-rw-r--r--plugins/MirandaG15/src/LCDFramework/debug.h2
-rw-r--r--plugins/MirandaG15/src/LCDFramework/misc.cpp6
-rw-r--r--plugins/MirandaG15/src/LCDFramework/misc.h8
-rw-r--r--plugins/MirandaG15/src/LCDFramework/stdafx.h1
-rw-r--r--plugins/MirandaG15/src/StdAfx.h1
-rw-r--r--plugins/MobileState/src/clients.h2
-rw-r--r--plugins/MobileState/src/main.cpp4
-rw-r--r--plugins/ModernOpt/src/modernopt.cpp20
-rw-r--r--plugins/ModernOpt/src/modernopt.h4
-rw-r--r--plugins/ModernOpt/src/mopt_selector.cpp36
-rw-r--r--plugins/MsgPopup/src/main.cpp6
-rwxr-xr-xplugins/Msg_Export/src/FileViewer.cpp42
-rwxr-xr-xplugins/Msg_Export/src/FileViewer.h2
-rwxr-xr-xplugins/Msg_Export/src/options.cpp38
-rwxr-xr-xplugins/Msg_Export/src/utils.cpp154
-rwxr-xr-xplugins/Msg_Export/src/utils.h14
-rw-r--r--plugins/MyDetails/src/data.cpp48
-rw-r--r--plugins/MyDetails/src/data.h50
-rw-r--r--plugins/MyDetails/src/frame.cpp46
-rw-r--r--plugins/MyDetails/src/mydetails.cpp10
-rw-r--r--plugins/MyDetails/src/options.cpp4
-rw-r--r--plugins/MyDetails/src/services.cpp24
-rw-r--r--plugins/NewAwaySysMod/src/AwayOpt.cpp36
-rw-r--r--plugins/NewAwaySysMod/src/AwaySys.cpp24
-rw-r--r--plugins/NewAwaySysMod/src/CString.cpp6
-rw-r--r--plugins/NewAwaySysMod/src/CString.h7
-rw-r--r--plugins/NewAwaySysMod/src/Client.cpp4
-rw-r--r--plugins/NewAwaySysMod/src/ContactList.cpp2
-rw-r--r--plugins/NewAwaySysMod/src/GroupCheckbox.cpp4
-rw-r--r--plugins/NewAwaySysMod/src/MsgEventAdded.cpp2
-rw-r--r--plugins/NewAwaySysMod/src/MsgTree.cpp4
-rw-r--r--plugins/NewAwaySysMod/src/Notification.cpp6
-rw-r--r--plugins/NewAwaySysMod/src/Options.cpp8
-rw-r--r--plugins/NewAwaySysMod/src/Options.h4
-rw-r--r--plugins/NewAwaySysMod/src/Properties.cpp16
-rw-r--r--plugins/NewAwaySysMod/src/ReadAwayMsg.cpp8
-rw-r--r--plugins/NewAwaySysMod/src/Services.cpp4
-rw-r--r--plugins/NewAwaySysMod/src/SetAwayMsg.cpp34
-rw-r--r--plugins/NewAwaySysMod/src/stdafx.h15
-rw-r--r--plugins/NewEventNotify/src/menuitem.cpp2
-rw-r--r--plugins/NewEventNotify/src/popup.cpp52
-rw-r--r--plugins/NewXstatusNotify/src/indsnd.cpp32
-rw-r--r--plugins/NewXstatusNotify/src/indsnd.h2
-rw-r--r--plugins/NewXstatusNotify/src/main.cpp100
-rw-r--r--plugins/NewXstatusNotify/src/options.cpp34
-rw-r--r--plugins/NewXstatusNotify/src/options.h26
-rw-r--r--plugins/NewXstatusNotify/src/popup.cpp12
-rw-r--r--plugins/NewXstatusNotify/src/popup.h18
-rw-r--r--plugins/NewXstatusNotify/src/stdafx.h22
-rw-r--r--plugins/NewXstatusNotify/src/utils.cpp14
-rw-r--r--plugins/NewXstatusNotify/src/utils.h8
-rw-r--r--plugins/NewXstatusNotify/src/xstatus.cpp56
-rw-r--r--plugins/NewXstatusNotify/src/xstatus.h12
-rw-r--r--plugins/New_GPG/src/globals.h2
-rwxr-xr-xplugins/New_GPG/src/gpg_wrapper.cpp10
-rw-r--r--plugins/New_GPG/src/init.cpp12
-rw-r--r--plugins/New_GPG/src/jabber_account.cpp4
-rw-r--r--plugins/New_GPG/src/jabber_account.h6
-rw-r--r--plugins/New_GPG/src/log.cpp2
-rw-r--r--plugins/New_GPG/src/log.h4
-rwxr-xr-xplugins/New_GPG/src/main.cpp162
-rwxr-xr-xplugins/New_GPG/src/messages.cpp32
-rwxr-xr-xplugins/New_GPG/src/options.cpp80
-rwxr-xr-xplugins/New_GPG/src/utilities.cpp128
-rw-r--r--plugins/New_GPG/src/utilities.h10
-rw-r--r--plugins/NewsAggregator/Src/Authentication.cpp12
-rw-r--r--plugins/NewsAggregator/Src/CheckFeed.cpp62
-rw-r--r--plugins/NewsAggregator/Src/ExportImport.cpp70
-rw-r--r--plugins/NewsAggregator/Src/Menus.cpp18
-rw-r--r--plugins/NewsAggregator/Src/NewsAggregator.cpp6
-rw-r--r--plugins/NewsAggregator/Src/Options.cpp40
-rw-r--r--plugins/NewsAggregator/Src/Services.cpp10
-rw-r--r--plugins/NewsAggregator/Src/Utils.cpp48
-rw-r--r--plugins/NewsAggregator/Src/stdafx.h18
-rw-r--r--plugins/NoHistory/src/dllmain.cpp8
-rw-r--r--plugins/NoHistory/src/options.cpp6
-rw-r--r--plugins/Non-IM Contact/src/contactinfo.cpp12
-rw-r--r--plugins/Non-IM Contact/src/dialog.cpp6
-rw-r--r--plugins/Non-IM Contact/src/files.cpp4
-rw-r--r--plugins/Non-IM Contact/src/main.cpp2
-rw-r--r--plugins/NotesAndReminders/src/globals.h2
-rw-r--r--plugins/NotesAndReminders/src/hotkeys.cpp10
-rw-r--r--plugins/NotesAndReminders/src/main.cpp32
-rw-r--r--plugins/NotesAndReminders/src/notes.cpp58
-rw-r--r--plugins/NotesAndReminders/src/options.cpp319
-rw-r--r--plugins/NotesAndReminders/src/reminders.cpp10
-rw-r--r--plugins/NotifyAnything/src/main.cpp140
-rw-r--r--plugins/NotifyAnything/src/options.cpp10
-rw-r--r--plugins/NotifyAnything/src/stdafx.h4
-rw-r--r--plugins/Nudge/src/main.cpp28
-rw-r--r--plugins/Nudge/src/nudge.cpp16
-rw-r--r--plugins/Nudge/src/nudge.h6
-rw-r--r--plugins/Nudge/src/options.cpp4
-rw-r--r--plugins/Nudge/src/stdafx.h2
-rw-r--r--plugins/OpenFolder/src/openFolder.cpp10
-rw-r--r--plugins/OpenSSL/src/ssl_openssl.cpp2
-rw-r--r--plugins/OpenSSL/src/stdafx.h1
-rw-r--r--plugins/PackUpdater/Src/Events.cpp4
-rw-r--r--plugins/PackUpdater/Src/Notifications.cpp16
-rw-r--r--plugins/PackUpdater/Src/Notifications.h6
-rw-r--r--plugins/PackUpdater/Src/Options.cpp8
-rw-r--r--plugins/PackUpdater/Src/PackUpdater.cpp8
-rw-r--r--plugins/PackUpdater/Src/Utils.cpp20
-rw-r--r--plugins/PackUpdater/Src/stdafx.h20
-rw-r--r--plugins/PasteIt/src/Options.cpp70
-rw-r--r--plugins/PasteIt/src/PasteIt.cpp16
-rw-r--r--plugins/PasteIt/src/PasteToWeb.h6
-rw-r--r--plugins/PasteIt/src/PasteToWeb1.h2
-rw-r--r--plugins/PasteIt/src/PasteToWeb2.h2
-rw-r--r--plugins/Ping/src/log.cpp18
-rw-r--r--plugins/Ping/src/menu.cpp6
-rw-r--r--plugins/Ping/src/options.cpp12
-rw-r--r--plugins/Ping/src/pinggraph.cpp6
-rw-r--r--plugins/Ping/src/pingthread.cpp22
-rw-r--r--plugins/Ping/src/stdafx.h10
-rw-r--r--plugins/Ping/src/utils.cpp2
-rw-r--r--plugins/Ping/src/utils.h2
-rw-r--r--plugins/PluginUpdater/pu_stub/pu_stub.cpp59
-rw-r--r--plugins/PluginUpdater/src/DlgListNew.cpp62
-rw-r--r--plugins/PluginUpdater/src/DlgUpdate.cpp82
-rw-r--r--plugins/PluginUpdater/src/Events.cpp2
-rw-r--r--plugins/PluginUpdater/src/Notifications.cpp2
-rw-r--r--plugins/PluginUpdater/src/Notifications.h6
-rw-r--r--plugins/PluginUpdater/src/Options.cpp26
-rw-r--r--plugins/PluginUpdater/src/PluginUpdater.cpp2
-rw-r--r--plugins/PluginUpdater/src/Services.cpp2
-rw-r--r--plugins/PluginUpdater/src/Utils.cpp52
-rw-r--r--plugins/PluginUpdater/src/checksum.cpp4
-rw-r--r--plugins/PluginUpdater/src/stdafx.h30
-rw-r--r--plugins/PluginUpdater/src/unzipfile.cpp16
-rw-r--r--plugins/Popup/src/bitmap_funcs.cpp18
-rw-r--r--plugins/Popup/src/bitmap_funcs.h10
-rw-r--r--plugins/Popup/src/config.cpp10
-rw-r--r--plugins/Popup/src/config.h4
-rw-r--r--plugins/Popup/src/font.cpp32
-rw-r--r--plugins/Popup/src/font.h37
-rw-r--r--plugins/Popup/src/formula.cpp10
-rw-r--r--plugins/Popup/src/formula.h14
-rw-r--r--plugins/Popup/src/main.cpp18
-rw-r--r--plugins/Popup/src/notifications.cpp9
-rw-r--r--plugins/Popup/src/opt_adv.cpp6
-rw-r--r--plugins/Popup/src/opt_class.cpp26
-rw-r--r--plugins/Popup/src/opt_gen.cpp40
-rw-r--r--plugins/Popup/src/opt_skins.cpp34
-rw-r--r--plugins/Popup/src/opt_skins.h2
-rw-r--r--plugins/Popup/src/opttree.cpp22
-rw-r--r--plugins/Popup/src/popup_gdiplus.cpp6
-rw-r--r--plugins/Popup/src/popup_gdiplus.h6
-rw-r--r--plugins/Popup/src/popup_thread.cpp2
-rw-r--r--plugins/Popup/src/popup_wnd2.cpp30
-rw-r--r--plugins/Popup/src/popup_wnd2.h18
-rw-r--r--plugins/Popup/src/services.cpp12
-rw-r--r--plugins/Popup/src/skin.cpp38
-rw-r--r--plugins/Popup/src/stdafx.h3
-rw-r--r--plugins/ProfileManager/src/pmanagerEx.cpp8
-rw-r--r--plugins/QuickContacts/src/options.cpp4
-rw-r--r--plugins/QuickContacts/src/quickcontacts.cpp80
-rw-r--r--plugins/QuickMessages/src/Utils.cpp78
-rw-r--r--plugins/QuickMessages/src/Utils.h22
-rw-r--r--plugins/QuickMessages/src/main.cpp30
-rw-r--r--plugins/QuickMessages/src/options.cpp28
-rw-r--r--plugins/QuickReplies/src/events.cpp2
-rw-r--r--plugins/Quotes/src/CreateFilePath.cpp10
-rw-r--r--plugins/Quotes/src/Forex.cpp28
-rw-r--r--plugins/Quotes/src/HTTPSession.cpp2
-rw-r--r--plugins/Quotes/src/ImportExport.cpp8
-rw-r--r--plugins/Quotes/src/Locale.cpp2
-rw-r--r--plugins/Quotes/src/Log.cpp2
-rw-r--r--plugins/Quotes/src/OptionDukasCopy.cpp2
-rw-r--r--plugins/Quotes/src/QuoteChart.cpp6
-rw-r--r--plugins/Quotes/src/QuoteInfoDlg.cpp4
-rw-r--r--plugins/Quotes/src/QuotesProviderBase.cpp34
-rw-r--r--plugins/Quotes/src/QuotesProviderDukasCopy.cpp2
-rw-r--r--plugins/Quotes/src/QuotesProviderFinance.cpp2
-rw-r--r--plugins/Quotes/src/QuotesProviderGoogle.cpp2
-rw-r--r--plugins/Quotes/src/QuotesProviderGoogleFinance.cpp16
-rw-r--r--plugins/Quotes/src/QuotesProviderVisitorFormater.cpp54
-rw-r--r--plugins/Quotes/src/QuotesProviderVisitorFormater.h4
-rw-r--r--plugins/Quotes/src/QuotesProviderVisitorTendency.cpp24
-rw-r--r--plugins/Quotes/src/QuotesProviderVisitorTendency.h4
-rw-r--r--plugins/Quotes/src/QuotesProviderYahoo.cpp10
-rw-r--r--plugins/Quotes/src/SettingsDlg.cpp20
-rw-r--r--plugins/Quotes/src/WinCtrlHelper.cpp2
-rw-r--r--plugins/Quotes/src/WinCtrlHelper.h2
-rw-r--r--plugins/Quotes/src/stdafx.h4
-rw-r--r--plugins/RecentContacts/src/RecentContacts.cpp8
-rw-r--r--plugins/RemovePersonalSettings/src/rps.cpp6
-rw-r--r--plugins/RemovePersonalSettings/src/stdafx.h4
-rw-r--r--plugins/SMS/src/SMSConstans.h6
-rw-r--r--plugins/SMS/src/SMS_svc.cpp4
-rw-r--r--plugins/SMS/src/functions.cpp14
-rw-r--r--plugins/SMS/src/options.cpp2
-rw-r--r--plugins/SMS/src/receive.cpp6
-rw-r--r--plugins/SMS/src/senddlg.cpp28
-rw-r--r--plugins/Scriver/src/chat/chat.h10
-rw-r--r--plugins/Scriver/src/chat/main.cpp2
-rw-r--r--plugins/Scriver/src/chat/manager.cpp4
-rw-r--r--plugins/Scriver/src/chat/options.cpp136
-rw-r--r--plugins/Scriver/src/chat/tools.cpp14
-rw-r--r--plugins/Scriver/src/chat/window.cpp62
-rw-r--r--plugins/Scriver/src/globals.cpp32
-rw-r--r--plugins/Scriver/src/infobar.cpp8
-rw-r--r--plugins/Scriver/src/input.cpp10
-rw-r--r--plugins/Scriver/src/msgdialog.cpp52
-rw-r--r--plugins/Scriver/src/msglog.cpp16
-rw-r--r--plugins/Scriver/src/msgoptions.cpp90
-rw-r--r--plugins/Scriver/src/msgs.cpp11
-rw-r--r--plugins/Scriver/src/msgs.h8
-rw-r--r--plugins/Scriver/src/msgtimedout.cpp4
-rw-r--r--plugins/Scriver/src/msgwindow.cpp20
-rw-r--r--plugins/Scriver/src/msgwindow.h8
-rw-r--r--plugins/Scriver/src/sendqueue.cpp2
-rw-r--r--plugins/Scriver/src/sendqueue.h2
-rw-r--r--plugins/Scriver/src/utils.cpp36
-rw-r--r--plugins/Scriver/src/utils.h10
-rw-r--r--plugins/SecureIM/src/loadicons.cpp8
-rw-r--r--plugins/SecureIM/src/main.cpp2
-rw-r--r--plugins/SecureIM/src/options.cpp14
-rw-r--r--plugins/SeenPlugin/src/file.cpp10
-rw-r--r--plugins/SeenPlugin/src/history.cpp6
-rw-r--r--plugins/SeenPlugin/src/main.cpp8
-rw-r--r--plugins/SeenPlugin/src/missed.cpp4
-rw-r--r--plugins/SeenPlugin/src/options.cpp16
-rw-r--r--plugins/SeenPlugin/src/stdafx.h2
-rw-r--r--plugins/SeenPlugin/src/userinfo.cpp2
-rw-r--r--plugins/SeenPlugin/src/utils.cpp58
-rw-r--r--plugins/SendScreenshotPlus/src/CSend.cpp50
-rw-r--r--plugins/SendScreenshotPlus/src/CSend.h24
-rw-r--r--plugins/SendScreenshotPlus/src/CSendDropbox.cpp2
-rw-r--r--plugins/SendScreenshotPlus/src/CSendEmail.cpp32
-rw-r--r--plugins/SendScreenshotPlus/src/CSendFTPFile.cpp4
-rw-r--r--plugins/SendScreenshotPlus/src/CSendFile.cpp2
-rw-r--r--plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp6
-rw-r--r--plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp4
-rw-r--r--plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp2
-rw-r--r--plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp4
-rw-r--r--plugins/SendScreenshotPlus/src/Main.cpp24
-rw-r--r--plugins/SendScreenshotPlus/src/UAboutForm.cpp20
-rw-r--r--plugins/SendScreenshotPlus/src/UMainForm.cpp62
-rw-r--r--plugins/SendScreenshotPlus/src/UMainForm.h8
-rw-r--r--plugins/SendScreenshotPlus/src/Utils.cpp32
-rw-r--r--plugins/SendScreenshotPlus/src/Utils.h38
-rw-r--r--plugins/SendScreenshotPlus/src/ctrl_button.cpp10
-rw-r--r--plugins/SendScreenshotPlus/src/dlg_msgbox.cpp36
-rw-r--r--plugins/Sessions/Src/Main.cpp18
-rw-r--r--plugins/Sessions/Src/Options.cpp4
-rw-r--r--plugins/Sessions/Src/Utils.cpp10
-rw-r--r--plugins/Sessions/Src/Utils.h4
-rw-r--r--plugins/Sessions/Src/stdafx.h2
-rw-r--r--plugins/ShellExt/src/main.cpp10
-rw-r--r--plugins/ShellExt/src/options.cpp12
-rw-r--r--plugins/ShellExt/src/shlcom.cpp4
-rw-r--r--plugins/ShellExt/src/utils.cpp4
-rw-r--r--plugins/SimpleAR/src/Main.cpp50
-rw-r--r--plugins/SimpleAR/src/Options.cpp14
-rw-r--r--plugins/SimpleAR/src/stdafx.h2
-rw-r--r--plugins/SimpleStatusMsg/src/awaymsg.cpp44
-rw-r--r--plugins/SimpleStatusMsg/src/main.cpp170
-rw-r--r--plugins/SimpleStatusMsg/src/msgbox.cpp66
-rw-r--r--plugins/SimpleStatusMsg/src/options.cpp32
-rw-r--r--plugins/SimpleStatusMsg/src/simplestatusmsg.h4
-rw-r--r--plugins/SimpleStatusMsg/src/utils.cpp2
-rw-r--r--plugins/SkypeStatusChange/src/main.cpp6
-rw-r--r--plugins/SkypeStatusChange/src/options.cpp2
-rw-r--r--plugins/SkypeStatusChange/src/stdafx.h1
-rw-r--r--plugins/SmileyAdd/src/SmileyBase.cpp8
-rw-r--r--plugins/SmileyAdd/src/SmileyBase.h6
-rw-r--r--plugins/SmileyAdd/src/customsmiley.cpp22
-rw-r--r--plugins/SmileyAdd/src/customsmiley.h10
-rw-r--r--plugins/SmileyAdd/src/download.cpp10
-rw-r--r--plugins/SmileyAdd/src/general.cpp22
-rw-r--r--plugins/SmileyAdd/src/imagecache.cpp2
-rw-r--r--plugins/SmileyAdd/src/options.cpp12
-rw-r--r--plugins/SmileyAdd/src/richcall.cpp2
-rw-r--r--plugins/SmileyAdd/src/services.cpp6
-rw-r--r--plugins/SmileyAdd/src/smileyroutines.cpp26
-rw-r--r--plugins/SmileyAdd/src/smileyroutines.h4
-rw-r--r--plugins/SmileyAdd/src/smileys.cpp46
-rw-r--r--plugins/SmileyAdd/src/smileys.h4
-rw-r--r--plugins/SmileyAdd/src/smltool.cpp2
-rw-r--r--plugins/SmileyAdd/src/stdafx.h6
-rw-r--r--plugins/Spamotron/src/bayes.cpp14
-rw-r--r--plugins/Spamotron/src/options.cpp76
-rw-r--r--plugins/Spamotron/src/popups.cpp12
-rw-r--r--plugins/Spamotron/src/spamotron.cpp26
-rw-r--r--plugins/Spamotron/src/stdafx.h42
-rw-r--r--plugins/Spamotron/src/utils.cpp120
-rw-r--r--plugins/SpellChecker/src/RichEdit.cpp20
-rw-r--r--plugins/SpellChecker/src/RichEdit.h10
-rw-r--r--plugins/SpellChecker/src/ardialog.cpp20
-rw-r--r--plugins/SpellChecker/src/ardialog.h6
-rw-r--r--plugins/SpellChecker/src/autoreplace.cpp48
-rw-r--r--plugins/SpellChecker/src/autoreplace.h22
-rw-r--r--plugins/SpellChecker/src/dictionary.cpp132
-rw-r--r--plugins/SpellChecker/src/dictionary.h28
-rw-r--r--plugins/SpellChecker/src/options.cpp28
-rw-r--r--plugins/SpellChecker/src/options.h2
-rw-r--r--plugins/SpellChecker/src/spellchecker.cpp30
-rw-r--r--plugins/SpellChecker/src/stdafx.h18
-rw-r--r--plugins/SpellChecker/src/utils.cpp152
-rw-r--r--plugins/SplashScreen/src/bitmap_funcs.cpp6
-rw-r--r--plugins/SplashScreen/src/bitmap_funcs.h6
-rw-r--r--plugins/SplashScreen/src/debug.h18
-rw-r--r--plugins/SplashScreen/src/main.cpp50
-rw-r--r--plugins/SplashScreen/src/options.cpp40
-rw-r--r--plugins/SplashScreen/src/services.cpp6
-rw-r--r--plugins/SplashScreen/src/splash.cpp12
-rw-r--r--plugins/SplashScreen/src/stdafx.h8
-rw-r--r--plugins/StartupSilence/src/main.cpp8
-rw-r--r--plugins/StartupSilence/src/stdafx.h11
-rw-r--r--plugins/StatusChange/src/main.cpp4
-rw-r--r--plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp4
-rw-r--r--plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp2
-rw-r--r--plugins/StatusPlugins/AdvancedAutoAway/options.cpp2
-rw-r--r--plugins/StatusPlugins/KeepStatus/keepstatus.cpp20
-rw-r--r--plugins/StatusPlugins/KeepStatus/options.cpp12
-rw-r--r--plugins/StatusPlugins/StartupStatus/options.cpp28
-rw-r--r--plugins/StatusPlugins/StartupStatus/profiles.cpp18
-rw-r--r--plugins/StatusPlugins/StartupStatus/startupstatus.cpp4
-rw-r--r--plugins/StatusPlugins/StartupStatus/startupstatus.h6
-rw-r--r--plugins/StatusPlugins/commonstatus.cpp22
-rw-r--r--plugins/StatusPlugins/commonstatus.h3
-rw-r--r--plugins/StatusPlugins/confirmdialog.cpp32
-rwxr-xr-xplugins/StopSpamMod/src/init.cpp14
-rwxr-xr-xplugins/StopSpamMod/src/options.cpp22
-rwxr-xr-xplugins/StopSpamMod/src/stopspam.cpp34
-rwxr-xr-xplugins/StopSpamMod/src/stopspam.h10
-rwxr-xr-xplugins/StopSpamMod/src/utilities.cpp56
-rwxr-xr-xplugins/StopSpamMod/src/utilities.h20
-rw-r--r--plugins/StopSpamPlus/src/options.cpp4
-rw-r--r--plugins/StopSpamPlus/src/services.cpp6
-rw-r--r--plugins/StopSpamPlus/src/stdafx.h4
-rw-r--r--plugins/StopSpamPlus/src/stopspam.cpp2
-rw-r--r--plugins/StopSpamPlus/src/utils.cpp6
-rw-r--r--plugins/TabSRMM/src/TSButton.cpp2
-rw-r--r--plugins/TabSRMM/src/buttonsbar.cpp46
-rw-r--r--plugins/TabSRMM/src/chat/chat.h16
-rw-r--r--plugins/TabSRMM/src/chat/log.cpp68
-rw-r--r--plugins/TabSRMM/src/chat/main.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/manager.cpp12
-rw-r--r--plugins/TabSRMM/src/chat/muchighlight.cpp20
-rw-r--r--plugins/TabSRMM/src/chat/muchighlight.h10
-rw-r--r--plugins/TabSRMM/src/chat/options.cpp304
-rw-r--r--plugins/TabSRMM/src/chat/services.cpp16
-rw-r--r--plugins/TabSRMM/src/chat/tools.cpp30
-rw-r--r--plugins/TabSRMM/src/chat/window.cpp86
-rw-r--r--plugins/TabSRMM/src/contactcache.cpp22
-rw-r--r--plugins/TabSRMM/src/contactcache.h22
-rw-r--r--plugins/TabSRMM/src/container.cpp44
-rw-r--r--plugins/TabSRMM/src/containeroptions.cpp26
-rw-r--r--plugins/TabSRMM/src/controls.cpp14
-rw-r--r--plugins/TabSRMM/src/controls.h2
-rw-r--r--plugins/TabSRMM/src/eventpopups.cpp48
-rw-r--r--plugins/TabSRMM/src/functions.h24
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp38
-rw-r--r--plugins/TabSRMM/src/globals.cpp8
-rw-r--r--plugins/TabSRMM/src/globals.h2
-rw-r--r--plugins/TabSRMM/src/infopanel.cpp44
-rw-r--r--plugins/TabSRMM/src/infopanel.h6
-rw-r--r--plugins/TabSRMM/src/mim.cpp54
-rw-r--r--plugins/TabSRMM/src/mim.h4
-rw-r--r--plugins/TabSRMM/src/modplus.cpp20
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp44
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp140
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.h6
-rw-r--r--plugins/TabSRMM/src/msglog.cpp98
-rw-r--r--plugins/TabSRMM/src/msgoptions.cpp30
-rw-r--r--plugins/TabSRMM/src/msgs.cpp32
-rw-r--r--plugins/TabSRMM/src/msgs.h36
-rw-r--r--plugins/TabSRMM/src/nen.h2
-rw-r--r--plugins/TabSRMM/src/selectcontainer.cpp28
-rw-r--r--plugins/TabSRMM/src/sendlater.cpp32
-rw-r--r--plugins/TabSRMM/src/sendlater.h2
-rw-r--r--plugins/TabSRMM/src/sendqueue.cpp24
-rw-r--r--plugins/TabSRMM/src/sendqueue.h4
-rw-r--r--plugins/TabSRMM/src/sidebar.cpp12
-rw-r--r--plugins/TabSRMM/src/sidebar.h2
-rw-r--r--plugins/TabSRMM/src/srmm.cpp6
-rw-r--r--plugins/TabSRMM/src/stdafx.h4
-rw-r--r--plugins/TabSRMM/src/taskbar.cpp2
-rw-r--r--plugins/TabSRMM/src/taskbar.h4
-rw-r--r--plugins/TabSRMM/src/templates.cpp14
-rw-r--r--plugins/TabSRMM/src/themeio.cpp24
-rw-r--r--plugins/TabSRMM/src/themes.cpp112
-rw-r--r--plugins/TabSRMM/src/themes.h38
-rw-r--r--plugins/TabSRMM/src/translator.cpp194
-rw-r--r--plugins/TabSRMM/src/trayicon.cpp18
-rw-r--r--plugins/TabSRMM/src/typingnotify.cpp28
-rw-r--r--plugins/TabSRMM/src/userprefs.cpp2
-rw-r--r--plugins/TabSRMM/src/utils.cpp106
-rw-r--r--plugins/TabSRMM/src/utils.h20
-rw-r--r--plugins/TipperYM/src/bitmap_func.cpp2
-rw-r--r--plugins/TipperYM/src/message_pump.cpp8
-rw-r--r--plugins/TipperYM/src/mir_smileys.cpp20
-rw-r--r--plugins/TipperYM/src/mir_smileys.h6
-rw-r--r--plugins/TipperYM/src/options.cpp70
-rw-r--r--plugins/TipperYM/src/options.h60
-rw-r--r--plugins/TipperYM/src/popwin.cpp94
-rw-r--r--plugins/TipperYM/src/popwin.h8
-rw-r--r--plugins/TipperYM/src/preset_items.cpp70
-rw-r--r--plugins/TipperYM/src/preset_items.h8
-rw-r--r--plugins/TipperYM/src/skin_parser.cpp136
-rw-r--r--plugins/TipperYM/src/skin_parser.h2
-rw-r--r--plugins/TipperYM/src/stdafx.h8
-rw-r--r--plugins/TipperYM/src/str_utils.cpp28
-rw-r--r--plugins/TipperYM/src/str_utils.h26
-rw-r--r--plugins/TipperYM/src/subst.cpp134
-rw-r--r--plugins/TipperYM/src/subst.h22
-rw-r--r--plugins/TipperYM/src/tipper.cpp62
-rw-r--r--plugins/TipperYM/src/translations.cpp112
-rw-r--r--plugins/TipperYM/src/translations.h6
-rw-r--r--plugins/Toaster/src/options.cpp4
-rw-r--r--plugins/Toaster/src/structs.h8
-rw-r--r--plugins/TooltipNotify/src/Tooltip.cpp6
-rw-r--r--plugins/TooltipNotify/src/Tooltip.h6
-rw-r--r--plugins/TooltipNotify/src/TooltipNotify.cpp56
-rw-r--r--plugins/TooltipNotify/src/TooltipNotify.h4
-rw-r--r--plugins/TooltipNotify/src/Utils.cpp8
-rw-r--r--plugins/TooltipNotify/src/Utils.h2
-rw-r--r--plugins/TopToolBar/src/stdafx.h6
-rw-r--r--plugins/TopToolBar/src/toolbarwnd.cpp2
-rw-r--r--plugins/TopToolBar/src/topbutton.cpp2
-rw-r--r--plugins/TopToolBar/src/ttbopt.cpp8
-rw-r--r--plugins/TrafficCounter/src/TrafficCounter.cpp56
-rw-r--r--plugins/TrafficCounter/src/misc.cpp44
-rw-r--r--plugins/TrafficCounter/src/misc.h10
-rw-r--r--plugins/TrafficCounter/src/options.cpp24
-rw-r--r--plugins/TrafficCounter/src/opttree.cpp28
-rw-r--r--plugins/TrafficCounter/src/opttree.h2
-rw-r--r--plugins/TrafficCounter/src/statistics.cpp8
-rw-r--r--plugins/TrafficCounter/src/stdafx.h6
-rw-r--r--plugins/TrafficCounter/src/vars.cpp12
-rw-r--r--plugins/TranslitSwitcher/src/Layoutproc.cpp330
-rw-r--r--plugins/TranslitSwitcher/src/TranslitSwitcher.cpp12
-rw-r--r--plugins/UserGuide/src/main.cpp16
-rw-r--r--plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp6
-rw-r--r--plugins/UserInfoEx/src/classMAnnivDate.cpp36
-rw-r--r--plugins/UserInfoEx/src/classMAnnivDate.h2
-rw-r--r--plugins/UserInfoEx/src/classMTime.cpp6
-rw-r--r--plugins/UserInfoEx/src/classMTime.h1
-rw-r--r--plugins/UserInfoEx/src/classPsTree.cpp10
-rw-r--r--plugins/UserInfoEx/src/classPsTreeItem.cpp26
-rw-r--r--plugins/UserInfoEx/src/ctrl_annivedit.cpp10
-rw-r--r--plugins/UserInfoEx/src/ctrl_button.cpp10
-rw-r--r--plugins/UserInfoEx/src/ctrl_contact.cpp58
-rw-r--r--plugins/UserInfoEx/src/ctrl_edit.cpp28
-rw-r--r--plugins/UserInfoEx/src/dlg_anniversarylist.cpp26
-rw-r--r--plugins/UserInfoEx/src/dlg_msgbox.cpp36
-rw-r--r--plugins/UserInfoEx/src/dlg_propsheet.cpp42
-rw-r--r--plugins/UserInfoEx/src/dlg_propsheet.h2
-rw-r--r--plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp4
-rw-r--r--plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp16
-rw-r--r--plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp2
-rw-r--r--plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp6
-rw-r--r--plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp6
-rw-r--r--plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp10
-rw-r--r--plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp34
-rw-r--r--plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp2
-rw-r--r--plugins/UserInfoEx/src/mir_icolib.cpp22
-rw-r--r--plugins/UserInfoEx/src/mir_icolib.h10
-rw-r--r--plugins/UserInfoEx/src/psp_about.cpp4
-rw-r--r--plugins/UserInfoEx/src/psp_anniversary.cpp10
-rw-r--r--plugins/UserInfoEx/src/psp_contact.cpp4
-rw-r--r--plugins/UserInfoEx/src/psp_options.cpp18
-rw-r--r--plugins/UserInfoEx/src/psp_origin.cpp4
-rw-r--r--plugins/UserInfoEx/src/psp_profile.cpp20
-rw-r--r--plugins/UserInfoEx/src/svc_email.cpp4
-rw-r--r--plugins/UserInfoEx/src/svc_refreshci.cpp26
-rw-r--r--plugins/UserInfoEx/src/svc_reminder.cpp6
-rw-r--r--plugins/UserInfoEx/src/svc_timezone_old.cpp2
-rw-r--r--plugins/Variables/src/contact.cpp20
-rw-r--r--plugins/Variables/src/contact.h2
-rw-r--r--plugins/Variables/src/help.cpp44
-rw-r--r--plugins/Variables/src/options.cpp6
-rw-r--r--plugins/Variables/src/parse_alias.cpp38
-rw-r--r--plugins/Variables/src/parse_alias.h8
-rw-r--r--plugins/Variables/src/parse_external.cpp34
-rw-r--r--plugins/Variables/src/parse_inet.cpp12
-rw-r--r--plugins/Variables/src/parse_logic.cpp44
-rw-r--r--plugins/Variables/src/parse_math.cpp36
-rw-r--r--plugins/Variables/src/parse_metacontacts.cpp12
-rw-r--r--plugins/Variables/src/parse_miranda.cpp102
-rw-r--r--plugins/Variables/src/parse_regexp.cpp10
-rw-r--r--plugins/Variables/src/parse_str.cpp272
-rw-r--r--plugins/Variables/src/parse_system.cpp158
-rw-r--r--plugins/Variables/src/parse_variables.cpp10
-rw-r--r--plugins/Variables/src/parse_variables.h4
-rw-r--r--plugins/Variables/src/stdafx.h22
-rw-r--r--plugins/Variables/src/tokenregister.cpp22
-rw-r--r--plugins/Variables/src/variables.cpp56
-rwxr-xr-xplugins/Watrack_MPD/src/init.cpp2
-rwxr-xr-xplugins/Watrack_MPD/src/options.cpp10
-rwxr-xr-xplugins/Watrack_MPD/src/stdafx.h2
-rwxr-xr-xplugins/Watrack_MPD/src/utilities.cpp4
-rwxr-xr-xplugins/Watrack_MPD/src/utilities.h2
-rw-r--r--plugins/Weather/src/stdafx.h104
-rw-r--r--plugins/Weather/src/weather.cpp6
-rw-r--r--plugins/Weather/src/weather_addstn.cpp90
-rw-r--r--plugins/Weather/src/weather_contacts.cpp46
-rw-r--r--plugins/Weather/src/weather_conv.cpp118
-rw-r--r--plugins/Weather/src/weather_data.cpp56
-rw-r--r--plugins/Weather/src/weather_http.cpp8
-rw-r--r--plugins/Weather/src/weather_info.cpp36
-rw-r--r--plugins/Weather/src/weather_ini.cpp34
-rw-r--r--plugins/Weather/src/weather_mwin.cpp16
-rw-r--r--plugins/Weather/src/weather_opt.cpp54
-rw-r--r--plugins/Weather/src/weather_popup.cpp28
-rw-r--r--plugins/Weather/src/weather_svcs.cpp22
-rw-r--r--plugins/Weather/src/weather_update.cpp38
-rw-r--r--plugins/Weather/src/weather_userinfo.cpp10
-rw-r--r--plugins/WebView/src/main.cpp30
-rw-r--r--plugins/WebView/src/stdafx.h1
-rw-r--r--plugins/WebView/src/webview.cpp12
-rw-r--r--plugins/WebView/src/webview.h7
-rw-r--r--plugins/WebView/src/webview_alerts.cpp34
-rw-r--r--plugins/WebView/src/webview_datawnd.cpp10
-rw-r--r--plugins/WebView/src/webview_getdata.cpp10
-rw-r--r--plugins/WebView/src/webview_opts.cpp80
-rw-r--r--plugins/WebView/src/webview_services.cpp92
-rw-r--r--plugins/WhenWasIt/src/WhenWasIt.cpp6
-rw-r--r--plugins/WhenWasIt/src/dlg_handlers.cpp86
-rw-r--r--plugins/WhenWasIt/src/hooked_events.cpp4
-rw-r--r--plugins/WhenWasIt/src/icons.cpp6
-rw-r--r--plugins/WhenWasIt/src/notifiers.cpp36
-rw-r--r--plugins/WhenWasIt/src/notifiers.h4
-rw-r--r--plugins/WhenWasIt/src/services.cpp68
-rw-r--r--plugins/WhenWasIt/src/services.h10
-rw-r--r--plugins/WhenWasIt/src/utils.cpp12
-rw-r--r--plugins/WhenWasIt/src/utils.h8
-rw-r--r--plugins/WhoUsesMyFiles/src/stdafx.h4
-rw-r--r--plugins/WhoUsesMyFiles/src/wumf.cpp4
-rw-r--r--plugins/WhoUsesMyFiles/src/wumfplug.cpp14
-rw-r--r--plugins/WinterSpeak/src/DialogConfigEngine.cpp2
-rw-r--r--plugins/WinterSpeak/src/EventInformation.cpp12
-rw-r--r--plugins/WinterSpeak/src/UserInformation.cpp16
-rw-r--r--plugins/WinterSpeak/src/main.cpp8
-rw-r--r--plugins/XSoundNotify/src/dialog.cpp24
-rw-r--r--plugins/XSoundNotify/src/options.cpp28
-rw-r--r--plugins/XSoundNotify/src/stdafx.h6
-rw-r--r--plugins/XSoundNotify/src/xsn_main.cpp10
-rw-r--r--plugins/YAMN/src/account.cpp38
-rw-r--r--plugins/YAMN/src/browser/badconnect.cpp12
-rw-r--r--plugins/YAMN/src/browser/mailbrowser.cpp40
-rw-r--r--plugins/YAMN/src/debug.cpp10
-rw-r--r--plugins/YAMN/src/debug.h2
-rw-r--r--plugins/YAMN/src/main.cpp28
-rw-r--r--plugins/YAMN/src/proto/pop3/pop3comm.cpp76
-rw-r--r--plugins/YAMN/src/proto/pop3/pop3opt.cpp14
-rw-r--r--plugins/YAMN/src/protoplugin.cpp6
-rw-r--r--plugins/YAMN/src/stdafx.h16
-rw-r--r--plugins/YAMN/src/synchro.cpp12
-rw-r--r--plugins/YAPP/src/message_pump.h4
-rw-r--r--plugins/YAPP/src/popwin.cpp12
-rw-r--r--plugins/YAPP/src/services.cpp6
-rw-r--r--plugins/YAPP/src/yapp.cpp34
-rw-r--r--plugins/YAPP/src/yapp_history.h4
-rw-r--r--plugins/YAPP/src/yapp_history_dlg.cpp66
-rw-r--r--plugins/YARelay/src/main.cpp16
-rw-r--r--plugins/YARelay/src/options.cpp2
-rw-r--r--plugins/YARelay/src/stdafx.h2
-rw-r--r--plugins/YahooGroups/src/hooked_events.cpp4
-rw-r--r--plugins/YahooGroups/src/utils.cpp26
-rw-r--r--plugins/YahooGroups/src/utils.h10
-rw-r--r--plugins/ZeroNotification/src/main.cpp6
-rw-r--r--plugins/ZeroNotification/src/stdafx.h4
-rw-r--r--plugins/ZeroSwitch/src/stdafx.h1
-rw-r--r--plugins/helpers/gen_helpers.cpp30
-rw-r--r--plugins/mTextControl/src/FormattedTextDraw.cpp10
-rw-r--r--plugins/mTextControl/src/FormattedTextDraw.h2
-rw-r--r--plugins/mTextControl/src/fancy_rtf.cpp18
-rw-r--r--plugins/mTextControl/src/richeditutils.cpp2
-rw-r--r--plugins/mTextControl/src/stdafx.h6
-rw-r--r--plugins/mTextControl/src/textcontrol.cpp6
-rw-r--r--plugins/wbOSD/src/events.cpp16
-rw-r--r--plugins/wbOSD/src/options.cpp8
-rw-r--r--plugins/wbOSD/src/stdafx.h4
-rw-r--r--plugins/wbOSD/src/wbOSD.cpp6
-rw-r--r--protocols/AimOscar/src/aim.cpp2
-rw-r--r--protocols/AimOscar/src/avatars.cpp16
-rw-r--r--protocols/AimOscar/src/avatars.h2
-rw-r--r--protocols/AimOscar/src/chat.cpp12
-rw-r--r--protocols/AimOscar/src/conv.cpp8
-rw-r--r--protocols/AimOscar/src/conv.h2
-rw-r--r--protocols/AimOscar/src/file.cpp20
-rw-r--r--protocols/AimOscar/src/links.cpp46
-rw-r--r--protocols/AimOscar/src/popup.cpp6
-rw-r--r--protocols/AimOscar/src/proto.cpp28
-rwxr-xr-xprotocols/AimOscar/src/proto.h26
-rw-r--r--protocols/AimOscar/src/server.cpp18
-rw-r--r--protocols/AimOscar/src/services.cpp12
-rw-r--r--protocols/AimOscar/src/theme.cpp8
-rwxr-xr-xprotocols/AimOscar/src/ui.cpp20
-rwxr-xr-xprotocols/AimOscar/src/utility.cpp20
-rwxr-xr-xprotocols/AimOscar/src/utility.h2
-rw-r--r--protocols/Dummy/src/dummy_proto.cpp14
-rw-r--r--protocols/Dummy/src/dummy_proto.h4
-rw-r--r--protocols/Dummy/src/main.cpp2
-rw-r--r--protocols/Dummy/src/stdafx.h1
-rw-r--r--protocols/EmLanProto/src/mlan.cpp10
-rw-r--r--protocols/FacebookRM/src/avatars.cpp20
-rw-r--r--protocols/FacebookRM/src/chat.cpp18
-rw-r--r--protocols/FacebookRM/src/client.h4
-rw-r--r--protocols/FacebookRM/src/communication.cpp20
-rw-r--r--protocols/FacebookRM/src/contacts.cpp6
-rw-r--r--protocols/FacebookRM/src/dialogs.cpp8
-rw-r--r--protocols/FacebookRM/src/entities.h14
-rw-r--r--protocols/FacebookRM/src/events.cpp6
-rw-r--r--protocols/FacebookRM/src/json.cpp12
-rw-r--r--protocols/FacebookRM/src/main.cpp2
-rw-r--r--protocols/FacebookRM/src/messages.cpp4
-rw-r--r--protocols/FacebookRM/src/process.cpp24
-rw-r--r--protocols/FacebookRM/src/proto.cpp70
-rw-r--r--protocols/FacebookRM/src/proto.h20
-rw-r--r--protocols/GTalkExt/src/avatar.cpp8
-rw-r--r--protocols/GTalkExt/src/handlers.cpp24
-rw-r--r--protocols/GTalkExt/src/inbox.cpp4
-rw-r--r--protocols/GTalkExt/src/notifications.cpp6
-rw-r--r--protocols/GTalkExt/src/options.cpp28
-rw-r--r--protocols/GTalkExt/src/options.h6
-rw-r--r--protocols/GTalkExt/src/stdafx.h1
-rw-r--r--protocols/GTalkExt/src/tipper_items.cpp4
-rw-r--r--protocols/Gadu-Gadu/src/avatar.cpp28
-rw-r--r--protocols/Gadu-Gadu/src/core.cpp118
-rw-r--r--protocols/Gadu-Gadu/src/dialogs.cpp30
-rw-r--r--protocols/Gadu-Gadu/src/filetransfer.cpp20
-rw-r--r--protocols/Gadu-Gadu/src/gg.cpp26
-rw-r--r--protocols/Gadu-Gadu/src/gg.h8
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.cpp22
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.h56
-rw-r--r--protocols/Gadu-Gadu/src/groupchat.cpp34
-rw-r--r--protocols/Gadu-Gadu/src/image.cpp70
-rw-r--r--protocols/Gadu-Gadu/src/import.cpp56
-rw-r--r--protocols/Gadu-Gadu/src/links.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/oauth.cpp4
-rw-r--r--protocols/Gadu-Gadu/src/ownerinfo.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/popups.cpp12
-rw-r--r--protocols/Gadu-Gadu/src/services.cpp30
-rw-r--r--protocols/Gadu-Gadu/src/sessions.cpp14
-rw-r--r--protocols/Gadu-Gadu/src/token.cpp4
-rw-r--r--protocols/Gadu-Gadu/src/userutils.cpp8
-rw-r--r--protocols/IRCG/src/clist.cpp10
-rw-r--r--protocols/IRCG/src/commandmonitor.cpp232
-rw-r--r--protocols/IRCG/src/input.cpp127
-rw-r--r--protocols/IRCG/src/irc_dlg.h6
-rw-r--r--protocols/IRCG/src/irclib.cpp54
-rw-r--r--protocols/IRCG/src/irclib.h14
-rw-r--r--protocols/IRCG/src/ircproto.cpp50
-rw-r--r--protocols/IRCG/src/main.cpp2
-rw-r--r--protocols/IRCG/src/options.cpp156
-rw-r--r--protocols/IRCG/src/output.cpp14
-rw-r--r--protocols/IRCG/src/scripting.cpp14
-rw-r--r--protocols/IRCG/src/services.cpp154
-rw-r--r--protocols/IRCG/src/stdafx.h106
-rw-r--r--protocols/IRCG/src/tools.cpp78
-rw-r--r--protocols/IRCG/src/userinfo.cpp22
-rw-r--r--protocols/IRCG/src/windows.cpp128
-rw-r--r--protocols/IcqOscarJ/src/cookies.h2
-rw-r--r--protocols/IcqOscarJ/src/db.cpp2
-rw-r--r--protocols/IcqOscarJ/src/dlgproc.cpp4
-rw-r--r--protocols/IcqOscarJ/src/editlist.cpp2
-rw-r--r--protocols/IcqOscarJ/src/editstring.cpp2
-rw-r--r--protocols/IcqOscarJ/src/fam_01service.cpp2
-rw-r--r--protocols/IcqOscarJ/src/fam_03buddy.cpp2
-rw-r--r--protocols/IcqOscarJ/src/fam_04message.cpp24
-rw-r--r--protocols/IcqOscarJ/src/fam_0alookup.cpp10
-rw-r--r--protocols/IcqOscarJ/src/fam_15icqserver.cpp18
-rw-r--r--protocols/IcqOscarJ/src/icq_avatar.cpp52
-rw-r--r--protocols/IcqOscarJ/src/icq_avatar.h8
-rw-r--r--protocols/IcqOscarJ/src/icq_filerequests.cpp8
-rw-r--r--protocols/IcqOscarJ/src/icq_opts.cpp28
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.cpp50
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.h40
-rw-r--r--protocols/IcqOscarJ/src/icq_servlist.cpp4
-rw-r--r--protocols/IcqOscarJ/src/icq_uploadui.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_xstatus.cpp16
-rw-r--r--protocols/IcqOscarJ/src/icqosc_svcs.cpp22
-rw-r--r--protocols/IcqOscarJ/src/init.cpp2
-rw-r--r--protocols/IcqOscarJ/src/log.cpp2
-rw-r--r--protocols/IcqOscarJ/src/loginpassword.cpp2
-rw-r--r--protocols/IcqOscarJ/src/oscar_filetransfer.cpp20
-rw-r--r--protocols/IcqOscarJ/src/stdpackets.cpp2
-rw-r--r--protocols/IcqOscarJ/src/userinfotab.cpp6
-rw-r--r--protocols/IcqOscarJ/src/utilities.cpp32
-rw-r--r--protocols/IcqOscarJ/src/utilities.h2
-rw-r--r--protocols/JabberG/src/jabber.cpp20
-rw-r--r--protocols/JabberG/src/jabber_adhoc.cpp48
-rw-r--r--protocols/JabberG/src/jabber_agent.cpp14
-rw-r--r--protocols/JabberG/src/jabber_api.cpp6
-rw-r--r--protocols/JabberG/src/jabber_archive.cpp20
-rw-r--r--protocols/JabberG/src/jabber_bookmarks.cpp18
-rw-r--r--protocols/JabberG/src/jabber_byte.cpp42
-rw-r--r--protocols/JabberG/src/jabber_byte.h18
-rw-r--r--protocols/JabberG/src/jabber_caps.cpp148
-rw-r--r--protocols/JabberG/src/jabber_caps.h32
-rw-r--r--protocols/JabberG/src/jabber_captcha.cpp4
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp222
-rw-r--r--protocols/JabberG/src/jabber_console.cpp16
-rw-r--r--protocols/JabberG/src/jabber_disco.cpp84
-rw-r--r--protocols/JabberG/src/jabber_disco.h58
-rw-r--r--protocols/JabberG/src/jabber_events.cpp12
-rw-r--r--protocols/JabberG/src/jabber_file.cpp26
-rw-r--r--protocols/JabberG/src/jabber_filterlist.cpp16
-rw-r--r--protocols/JabberG/src/jabber_form.cpp58
-rw-r--r--protocols/JabberG/src/jabber_frame.cpp18
-rw-r--r--protocols/JabberG/src/jabber_ft.cpp38
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp134
-rw-r--r--protocols/JabberG/src/jabber_ibb.cpp8
-rw-r--r--protocols/JabberG/src/jabber_ibb.h6
-rw-r--r--protocols/JabberG/src/jabber_icolib.cpp44
-rw-r--r--protocols/JabberG/src/jabber_icolib.h2
-rw-r--r--protocols/JabberG/src/jabber_iq.cpp34
-rw-r--r--protocols/JabberG/src/jabber_iq.h32
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp68
-rw-r--r--protocols/JabberG/src/jabber_iqid.cpp192
-rw-r--r--protocols/JabberG/src/jabber_iqid_muc.cpp22
-rw-r--r--protocols/JabberG/src/jabber_libstr.cpp2
-rw-r--r--protocols/JabberG/src/jabber_list.cpp44
-rw-r--r--protocols/JabberG/src/jabber_list.h22
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp26
-rw-r--r--protocols/JabberG/src/jabber_message_handlers.cpp12
-rw-r--r--protocols/JabberG/src/jabber_message_manager.cpp4
-rw-r--r--protocols/JabberG/src/jabber_message_manager.h2
-rw-r--r--protocols/JabberG/src/jabber_misc.cpp64
-rw-r--r--protocols/JabberG/src/jabber_notes.cpp74
-rw-r--r--protocols/JabberG/src/jabber_notes.h28
-rw-r--r--protocols/JabberG/src/jabber_opt.cpp562
-rw-r--r--protocols/JabberG/src/jabber_opttree.cpp12
-rw-r--r--protocols/JabberG/src/jabber_opttree.h6
-rw-r--r--protocols/JabberG/src/jabber_password.cpp4
-rw-r--r--protocols/JabberG/src/jabber_privacy.cpp110
-rw-r--r--protocols/JabberG/src/jabber_privacy.h32
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.cpp86
-rw-r--r--protocols/JabberG/src/jabber_proto.h154
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp50
-rw-r--r--protocols/JabberG/src/jabber_rc.h26
-rw-r--r--protocols/JabberG/src/jabber_search.cpp94
-rw-r--r--protocols/JabberG/src/jabber_search.h30
-rw-r--r--protocols/JabberG/src/jabber_secur.cpp30
-rw-r--r--protocols/JabberG/src/jabber_secur.h18
-rw-r--r--protocols/JabberG/src/jabber_svc.cpp90
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp170
-rw-r--r--protocols/JabberG/src/jabber_treelist.cpp12
-rw-r--r--protocols/JabberG/src/jabber_userinfo.cpp54
-rw-r--r--protocols/JabberG/src/jabber_util.cpp194
-rw-r--r--protocols/JabberG/src/jabber_vcard.cpp46
-rw-r--r--protocols/JabberG/src/jabber_ws.cpp2
-rw-r--r--protocols/JabberG/src/jabber_xml.cpp56
-rw-r--r--protocols/JabberG/src/jabber_xml.h36
-rw-r--r--protocols/JabberG/src/jabber_xstatus.cpp470
-rw-r--r--protocols/JabberG/src/jabber_xstatus.h28
-rw-r--r--protocols/JabberG/src/stdafx.h106
-rw-r--r--protocols/MRA/src/Mra.cpp2
-rw-r--r--protocols/MRA/src/MraAdvancedSearch.cpp56
-rw-r--r--protocols/MRA/src/MraAvatars.cpp8
-rw-r--r--protocols/MRA/src/MraConstans.h4
-rw-r--r--protocols/MRA/src/MraFilesQueue.cpp2
-rw-r--r--protocols/MRA/src/MraIcons.cpp10
-rw-r--r--protocols/MRA/src/MraPopUp.cpp18
-rw-r--r--protocols/MRA/src/MraProto.cpp24
-rw-r--r--protocols/MRA/src/MraProto.h18
-rw-r--r--protocols/MRA/src/Mra_functions.cpp26
-rw-r--r--protocols/MRA/src/Mra_menus.cpp14
-rw-r--r--protocols/MRA/src/Mra_options.cpp18
-rw-r--r--protocols/MRA/src/Mra_proto.cpp26
-rw-r--r--protocols/MRA/src/Mra_svcs.cpp102
-rw-r--r--protocols/MSN/src/msn.cpp2
-rw-r--r--protocols/MSN/src/msn_auth.cpp4
-rw-r--r--protocols/MSN/src/msn_avatar.cpp6
-rw-r--r--protocols/MSN/src/msn_chat.cpp58
-rw-r--r--protocols/MSN/src/msn_commands.cpp38
-rw-r--r--protocols/MSN/src/msn_ftold.cpp2
-rw-r--r--protocols/MSN/src/msn_libstr.cpp18
-rw-r--r--protocols/MSN/src/msn_links.cpp28
-rw-r--r--protocols/MSN/src/msn_lists.cpp12
-rw-r--r--protocols/MSN/src/msn_mail.cpp16
-rw-r--r--protocols/MSN/src/msn_menu.cpp6
-rw-r--r--protocols/MSN/src/msn_misc.cpp74
-rw-r--r--protocols/MSN/src/msn_natdetect.cpp2
-rw-r--r--protocols/MSN/src/msn_opts.cpp16
-rw-r--r--protocols/MSN/src/msn_p2p.cpp30
-rw-r--r--protocols/MSN/src/msn_proto.cpp54
-rw-r--r--protocols/MSN/src/msn_proto.h52
-rw-r--r--protocols/MSN/src/msn_skypeab.cpp16
-rw-r--r--protocols/MSN/src/msn_soapstore.cpp4
-rw-r--r--protocols/MSN/src/msn_ssl.cpp2
-rw-r--r--protocols/MSN/src/msn_std.cpp6
-rw-r--r--protocols/MSN/src/msn_svcs.cpp24
-rw-r--r--protocols/MSN/src/msn_threads.cpp2
-rw-r--r--protocols/MSN/src/stdafx.h20
-rw-r--r--protocols/MinecraftDynmap/src/dialogs.cpp2
-rw-r--r--protocols/MinecraftDynmap/src/main.cpp2
-rw-r--r--protocols/MinecraftDynmap/src/proto.cpp12
-rw-r--r--protocols/MinecraftDynmap/src/proto.h2
-rw-r--r--protocols/Omegle/src/chat.cpp10
-rw-r--r--protocols/Omegle/src/communication.cpp12
-rw-r--r--protocols/Omegle/src/dialogs.cpp2
-rw-r--r--protocols/Omegle/src/main.cpp2
-rw-r--r--protocols/Omegle/src/messages.cpp2
-rw-r--r--protocols/Omegle/src/proto.cpp20
-rw-r--r--protocols/Omegle/src/proto.h12
-rw-r--r--protocols/Sametime/src/conference.cpp30
-rw-r--r--protocols/Sametime/src/files.cpp16
-rw-r--r--protocols/Sametime/src/messaging.cpp4
-rw-r--r--protocols/Sametime/src/options.cpp18
-rw-r--r--protocols/Sametime/src/sametime.cpp2
-rw-r--r--protocols/Sametime/src/sametime_proto.cpp18
-rw-r--r--protocols/Sametime/src/sametime_proto.h28
-rw-r--r--protocols/Sametime/src/sametime_session.cpp14
-rw-r--r--protocols/Sametime/src/userlist.cpp16
-rw-r--r--protocols/Sametime/src/utils.cpp10
-rw-r--r--protocols/SkypeWeb/src/skype_avatars.cpp22
-rw-r--r--protocols/SkypeWeb/src/skype_chatrooms.cpp40
-rw-r--r--protocols/SkypeWeb/src/skype_db.h4
-rw-r--r--protocols/SkypeWeb/src/skype_dialogs.cpp2
-rw-r--r--protocols/SkypeWeb/src/skype_events.cpp4
-rw-r--r--protocols/SkypeWeb/src/skype_files.cpp6
-rw-r--r--protocols/SkypeWeb/src/skype_icons.cpp20
-rw-r--r--protocols/SkypeWeb/src/skype_login.cpp2
-rw-r--r--protocols/SkypeWeb/src/skype_menus.cpp10
-rw-r--r--protocols/SkypeWeb/src/skype_messages.cpp10
-rw-r--r--protocols/SkypeWeb/src/skype_options.cpp6
-rw-r--r--protocols/SkypeWeb/src/skype_popups.cpp10
-rw-r--r--protocols/SkypeWeb/src/skype_profile.cpp8
-rw-r--r--protocols/SkypeWeb/src/skype_proto.cpp18
-rw-r--r--protocols/SkypeWeb/src/skype_proto.h40
-rw-r--r--protocols/SkypeWeb/src/skype_search.cpp4
-rw-r--r--protocols/SkypeWeb/src/skype_utils.cpp26
-rw-r--r--protocols/SkypeWeb/src/skype_utils.h4
-rw-r--r--protocols/SkypeWeb/src/stdafx.h1
-rw-r--r--protocols/Steam/src/stdafx.h1
-rw-r--r--protocols/Steam/src/steam_avatars.cpp12
-rw-r--r--protocols/Steam/src/steam_contacts.cpp24
-rw-r--r--protocols/Steam/src/steam_events.cpp8
-rw-r--r--protocols/Steam/src/steam_history.cpp10
-rw-r--r--protocols/Steam/src/steam_login.cpp2
-rw-r--r--protocols/Steam/src/steam_menus.cpp8
-rw-r--r--protocols/Steam/src/steam_options.cpp2
-rw-r--r--protocols/Steam/src/steam_polling.cpp4
-rw-r--r--protocols/Steam/src/steam_proto.cpp26
-rw-r--r--protocols/Steam/src/steam_proto.h16
-rw-r--r--protocols/Steam/src/steam_utils.cpp6
-rw-r--r--protocols/Tlen/src/stdafx.h22
-rw-r--r--protocols/Tlen/src/tlen.cpp2
-rw-r--r--protocols/Tlen/src/tlen_avatar.cpp16
-rw-r--r--protocols/Tlen/src/tlen_avatar.h2
-rw-r--r--protocols/Tlen/src/tlen_file.cpp6
-rw-r--r--protocols/Tlen/src/tlen_iqid.cpp30
-rw-r--r--protocols/Tlen/src/tlen_opt.cpp24
-rw-r--r--protocols/Tlen/src/tlen_p2p_new.cpp6
-rw-r--r--protocols/Tlen/src/tlen_picture.cpp4
-rw-r--r--protocols/Tlen/src/tlen_svc.cpp28
-rw-r--r--protocols/Tlen/src/tlen_thread.cpp4
-rw-r--r--protocols/Tlen/src/tlen_userinfo.cpp2
-rw-r--r--protocols/Tlen/src/tlen_ws.cpp2
-rw-r--r--protocols/Tox/src/stdafx.h1
-rw-r--r--protocols/Tox/src/tox_accounts.cpp4
-rw-r--r--protocols/Tox/src/tox_avatars.cpp16
-rw-r--r--protocols/Tox/src/tox_chatrooms.cpp2
-rw-r--r--protocols/Tox/src/tox_contacts.cpp6
-rw-r--r--protocols/Tox/src/tox_icons.cpp12
-rw-r--r--protocols/Tox/src/tox_menus.cpp10
-rw-r--r--protocols/Tox/src/tox_multimedia.cpp20
-rw-r--r--protocols/Tox/src/tox_multimedia.h2
-rw-r--r--protocols/Tox/src/tox_network.cpp6
-rw-r--r--protocols/Tox/src/tox_options.cpp26
-rw-r--r--protocols/Tox/src/tox_profile.cpp12
-rw-r--r--protocols/Tox/src/tox_proto.cpp14
-rw-r--r--protocols/Tox/src/tox_proto.h40
-rw-r--r--protocols/Tox/src/tox_search.cpp4
-rw-r--r--protocols/Tox/src/tox_services.cpp2
-rw-r--r--protocols/Tox/src/tox_transfer.cpp28
-rw-r--r--protocols/Tox/src/tox_transfer.h12
-rw-r--r--protocols/Tox/src/tox_utils.cpp36
-rw-r--r--protocols/Twitter/src/StringUtil.cpp6
-rw-r--r--protocols/Twitter/src/StringUtil.h6
-rw-r--r--protocols/Twitter/src/chat.cpp12
-rw-r--r--protocols/Twitter/src/connection.cpp6
-rw-r--r--protocols/Twitter/src/contacts.cpp20
-rw-r--r--protocols/Twitter/src/main.cpp2
-rw-r--r--protocols/Twitter/src/oauth.cpp2
-rw-r--r--protocols/Twitter/src/proto.cpp24
-rw-r--r--protocols/Twitter/src/proto.h8
-rw-r--r--protocols/Twitter/src/stdafx.h3
-rw-r--r--protocols/Twitter/src/theme.cpp4
-rw-r--r--protocols/Twitter/src/twitter.h2
-rw-r--r--protocols/Twitter/src/ui.cpp16
-rw-r--r--protocols/Twitter/src/utility.cpp8
-rw-r--r--protocols/Twitter/src/utility.h4
-rw-r--r--protocols/VKontakte/src/main.cpp2
-rw-r--r--protocols/VKontakte/src/misc.cpp30
-rw-r--r--protocols/VKontakte/src/stdafx.h1
-rw-r--r--protocols/VKontakte/src/vk.h2
-rw-r--r--protocols/VKontakte/src/vk_avatars.cpp18
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp48
-rw-r--r--protocols/VKontakte/src/vk_dialogs.cpp2
-rw-r--r--protocols/VKontakte/src/vk_dialogs.h8
-rw-r--r--protocols/VKontakte/src/vk_feed.cpp8
-rw-r--r--protocols/VKontakte/src/vk_files.cpp4
-rw-r--r--protocols/VKontakte/src/vk_messages.cpp4
-rw-r--r--protocols/VKontakte/src/vk_options.cpp34
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp58
-rw-r--r--protocols/VKontakte/src/vk_proto.h22
-rw-r--r--protocols/VKontakte/src/vk_search.cpp44
-rw-r--r--protocols/VKontakte/src/vk_status.cpp2
-rw-r--r--protocols/VKontakte/src/vk_struct.cpp12
-rw-r--r--protocols/VKontakte/src/vk_struct.h30
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp6
-rw-r--r--protocols/VKontakte/src/vk_wallpost.cpp2
-rw-r--r--protocols/WhatsApp/src/WhatsAPI++/MediaUploader.cpp2
-rw-r--r--protocols/WhatsApp/src/avatars.cpp30
-rw-r--r--protocols/WhatsApp/src/chat.cpp42
-rw-r--r--protocols/WhatsApp/src/contacts.cpp14
-rw-r--r--protocols/WhatsApp/src/dialogs.cpp26
-rw-r--r--protocols/WhatsApp/src/entities.h6
-rw-r--r--protocols/WhatsApp/src/main.cpp2
-rw-r--r--protocols/WhatsApp/src/media.cpp6
-rw-r--r--protocols/WhatsApp/src/messages.cpp6
-rw-r--r--protocols/WhatsApp/src/proto.cpp36
-rw-r--r--protocols/WhatsApp/src/proto.h28
-rw-r--r--protocols/WhatsApp/src/utils.cpp14
-rw-r--r--protocols/WhatsApp/src/utils.h8
-rw-r--r--protocols/Yahoo/src/avatar.cpp32
-rw-r--r--protocols/Yahoo/src/chat.cpp32
-rw-r--r--protocols/Yahoo/src/file_transfer.cpp26
-rw-r--r--protocols/Yahoo/src/links.cpp32
-rw-r--r--protocols/Yahoo/src/main.cpp2
-rw-r--r--protocols/Yahoo/src/options.cpp10
-rw-r--r--protocols/Yahoo/src/proto.cpp14
-rw-r--r--protocols/Yahoo/src/proto.h32
-rw-r--r--protocols/Yahoo/src/search.cpp22
-rw-r--r--protocols/Yahoo/src/services.cpp2
-rw-r--r--protocols/Yahoo/src/user_info.cpp2
-rw-r--r--protocols/Yahoo/src/util.cpp10
-rw-r--r--protocols/Yahoo/src/yahoo.cpp30
-rw-r--r--src/core/stdauth/src/auth.cpp2
-rw-r--r--src/core/stdauth/src/authdialogs.cpp38
-rw-r--r--src/core/stdauth/src/stdafx.h1
-rw-r--r--src/core/stdautoaway/src/autoaway.cpp2
-rw-r--r--src/core/stdautoaway/src/stdafx.h1
-rw-r--r--src/core/stdaway/src/awaymsg.cpp10
-rw-r--r--src/core/stdaway/src/sendmsg.cpp42
-rw-r--r--src/core/stdaway/src/stdafx.h1
-rw-r--r--src/core/stdchat/src/main.cpp14
-rw-r--r--src/core/stdchat/src/manager.cpp2
-rw-r--r--src/core/stdchat/src/options.cpp192
-rw-r--r--src/core/stdchat/src/stdafx.h10
-rw-r--r--src/core/stdchat/src/tools.cpp16
-rw-r--r--src/core/stdchat/src/window.cpp46
-rw-r--r--src/core/stdclist/src/clcfonts.cpp34
-rw-r--r--src/core/stdclist/src/clcopts.cpp48
-rw-r--r--src/core/stdclist/src/clcpaint.cpp2
-rw-r--r--src/core/stdclist/src/cluiopts.cpp2
-rw-r--r--src/core/stdclist/src/contact.cpp52
-rw-r--r--src/core/stdcrypt/src/stdafx.h1
-rw-r--r--src/core/stdemail/src/stdafx.h1
-rw-r--r--src/core/stdfile/src/file.cpp36
-rw-r--r--src/core/stdfile/src/file.h26
-rw-r--r--src/core/stdfile/src/fileexistsdlg.cpp32
-rw-r--r--src/core/stdfile/src/fileopts.cpp32
-rw-r--r--src/core/stdfile/src/filerecvdlg.cpp80
-rw-r--r--src/core/stdfile/src/filesenddlg.cpp32
-rw-r--r--src/core/stdfile/src/filexferdlg.cpp108
-rw-r--r--src/core/stdfile/src/stdafx.h1
-rw-r--r--src/core/stdhelp/src/about.cpp6
-rw-r--r--src/core/stdhelp/src/help.cpp2
-rw-r--r--src/core/stdhelp/src/stdafx.h1
-rw-r--r--src/core/stdidle/src/stdafx.h1
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp60
-rw-r--r--src/core/stdmsg/src/msglog.cpp44
-rw-r--r--src/core/stdmsg/src/msgoptions.cpp64
-rw-r--r--src/core/stdmsg/src/msgs.cpp8
-rw-r--r--src/core/stdmsg/src/msgs.h4
-rw-r--r--src/core/stdssl/src/netlibssl.cpp8
-rw-r--r--src/core/stduihist/src/history.cpp30
-rw-r--r--src/core/stduihist/src/stdafx.h1
-rw-r--r--src/core/stduserinfo/src/contactinfo.cpp14
-rw-r--r--src/core/stduserinfo/src/stdafx.h1
-rw-r--r--src/core/stduserinfo/src/stdinfo.cpp8
-rw-r--r--src/core/stduserinfo/src/userinfo.cpp36
-rw-r--r--src/core/stduseronline/src/stdafx.h1
-rw-r--r--src/core/stduseronline/src/useronline.cpp2
-rw-r--r--src/mir_app/src/BaseExtraIcon.cpp6
-rw-r--r--src/mir_app/src/CallbackExtraIcon.cpp2
-rw-r--r--src/mir_app/src/ExtraIcon.h14
-rw-r--r--src/mir_app/src/ExtraIconGroup.cpp2
-rw-r--r--src/mir_app/src/FontOptions.cpp44
-rw-r--r--src/mir_app/src/FontService.cpp8
-rw-r--r--src/mir_app/src/FontService.h10
-rw-r--r--src/mir_app/src/IcoLib.h10
-rw-r--r--src/mir_app/src/IcolibExtraIcon.cpp2
-rw-r--r--src/mir_app/src/addcontact.cpp6
-rw-r--r--src/mir_app/src/button.cpp6
-rw-r--r--src/mir_app/src/chat.h30
-rw-r--r--src/mir_app/src/chat_clist.cpp16
-rw-r--r--src/mir_app/src/chat_log.cpp28
-rw-r--r--src/mir_app/src/chat_manager.cpp80
-rw-r--r--src/mir_app/src/chat_opts.cpp64
-rw-r--r--src/mir_app/src/chat_rtf.cpp70
-rw-r--r--src/mir_app/src/chat_svc.cpp4
-rw-r--r--src/mir_app/src/chat_tools.cpp130
-rw-r--r--src/mir_app/src/clc.cpp8
-rw-r--r--src/mir_app/src/clc.h18
-rw-r--r--src/mir_app/src/clcfiledrop.cpp14
-rw-r--r--src/mir_app/src/clcitems.cpp34
-rw-r--r--src/mir_app/src/clcmsgs.cpp8
-rw-r--r--src/mir_app/src/clcutils.cpp24
-rw-r--r--src/mir_app/src/clistcore.cpp2
-rw-r--r--src/mir_app/src/clistgroups.cpp60
-rw-r--r--src/mir_app/src/clistmod.cpp32
-rw-r--r--src/mir_app/src/clistsettings.cpp6
-rw-r--r--src/mir_app/src/clisttray.cpp24
-rw-r--r--src/mir_app/src/clui.cpp24
-rw-r--r--src/mir_app/src/cluiservices.cpp8
-rw-r--r--src/mir_app/src/contacts.cpp38
-rw-r--r--src/mir_app/src/database.cpp144
-rw-r--r--src/mir_app/src/dbini.cpp50
-rw-r--r--src/mir_app/src/dbintf.cpp2
-rw-r--r--src/mir_app/src/dbutils.cpp6
-rw-r--r--src/mir_app/src/descbutton.cpp4
-rw-r--r--src/mir_app/src/dll_sniffer.cpp2
-rw-r--r--src/mir_app/src/enterstring.cpp10
-rw-r--r--src/mir_app/src/extraicons.cpp4
-rw-r--r--src/mir_app/src/filter.cpp12
-rw-r--r--src/mir_app/src/filter.h20
-rw-r--r--src/mir_app/src/findadd.cpp52
-rw-r--r--src/mir_app/src/genmenu.h4
-rw-r--r--src/mir_app/src/headerbar.cpp4
-rw-r--r--src/mir_app/src/hotkey_opts.cpp26
-rw-r--r--src/mir_app/src/hotkeys.cpp2
-rw-r--r--src/mir_app/src/icolib.cpp26
-rw-r--r--src/mir_app/src/keyboard.cpp10
-rw-r--r--src/mir_app/src/langpack.cpp4
-rw-r--r--src/mir_app/src/langpack.h6
-rw-r--r--src/mir_app/src/lpopts.cpp14
-rw-r--r--src/mir_app/src/menu_clist.cpp44
-rw-r--r--src/mir_app/src/menu_options.cpp12
-rw-r--r--src/mir_app/src/menu_utils.cpp70
-rw-r--r--src/mir_app/src/meta_addto.cpp14
-rw-r--r--src/mir_app/src/meta_edit.cpp24
-rw-r--r--src/mir_app/src/meta_menu.cpp14
-rw-r--r--src/mir_app/src/meta_services.cpp6
-rw-r--r--src/mir_app/src/meta_utils.cpp6
-rw-r--r--src/mir_app/src/metacontacts.h2
-rw-r--r--src/mir_app/src/miranda.cpp8
-rw-r--r--src/mir_app/src/miranda.h8
-rw-r--r--src/mir_app/src/movetogroup.cpp16
-rw-r--r--src/mir_app/src/netlib.h4
-rw-r--r--src/mir_app/src/netliblog.cpp24
-rw-r--r--src/mir_app/src/netlibopts.cpp4
-rw-r--r--src/mir_app/src/netlibsecurity.cpp22
-rw-r--r--src/mir_app/src/newplugins.cpp52
-rw-r--r--src/mir_app/src/options.cpp96
-rw-r--r--src/mir_app/src/options_ei.cpp2
-rw-r--r--src/mir_app/src/path.cpp70
-rw-r--r--src/mir_app/src/pluginopts.cpp24
-rw-r--r--src/mir_app/src/plugins.h16
-rw-r--r--src/mir_app/src/profilemanager.cpp62
-rw-r--r--src/mir_app/src/profilemanager.h18
-rw-r--r--src/mir_app/src/proto_internal.cpp40
-rw-r--r--src/mir_app/src/proto_opts.cpp24
-rw-r--r--src/mir_app/src/proto_ui.cpp18
-rw-r--r--src/mir_app/src/proto_utils.cpp28
-rw-r--r--src/mir_app/src/protocols.cpp24
-rw-r--r--src/mir_app/src/searchresults.cpp28
-rw-r--r--src/mir_app/src/services.cpp10
-rw-r--r--src/mir_app/src/skin.h6
-rw-r--r--src/mir_app/src/skin2opts.cpp54
-rw-r--r--src/mir_app/src/skinicons.cpp22
-rw-r--r--src/mir_app/src/sounds.cpp30
-rw-r--r--src/mir_app/src/srmm_statusicon.cpp2
-rw-r--r--src/mir_app/src/xmlApi.cpp4
-rw-r--r--src/mir_app/src/xmlParser.cpp6
-rw-r--r--src/mir_app/src/xmlParser.h4
-rw-r--r--src/mir_core/src/bitmaps.cpp8
-rw-r--r--src/mir_core/src/cmdline.cpp8
-rw-r--r--src/mir_core/src/hyperlink.cpp4
-rw-r--r--src/mir_core/src/icons.cpp14
-rw-r--r--src/mir_core/src/langpack.cpp68
-rw-r--r--src/mir_core/src/logger.cpp18
-rw-r--r--src/mir_core/src/miranda.cpp6
-rw-r--r--src/mir_core/src/miranda.h2
-rw-r--r--src/mir_core/src/openurl.cpp6
-rw-r--r--src/mir_core/src/timezones.cpp28
-rw-r--r--src/mir_core/src/ui_utils.cpp82
-rw-r--r--src/mir_core/src/utils.cpp2
-rw-r--r--src/mir_core/src/winver.cpp6
-rw-r--r--src/miranda32/src/miranda.cpp16
-rw-r--r--src/miranda32/src/stdafx.h2
-rw-r--r--utils/mir_buffer.h32
-rw-r--r--utils/mir_fonts.cpp12
-rw-r--r--utils/mir_options.cpp39
-rw-r--r--utils/mir_options.h2
-rw-r--r--utils/mir_smileys.cpp25
-rw-r--r--utils/std_string_utils.cpp16
-rw-r--r--utils/std_string_utils.h4
-rw-r--r--utils/utf8_helpers.h54
1572 files changed, 18142 insertions, 18225 deletions
diff --git a/include/m_acc.h b/include/m_acc.h
index 0881098274..93be99d204 100644
--- a/include/m_acc.h
+++ b/include/m_acc.h
@@ -22,7 +22,7 @@ Boston, MA 02111-1307, USA.
# define __M_ACC_H__
-#define AVATAR_CONTROL_CLASS _T( "MAvatarControlClass" ) // Class of the control
+#define AVATAR_CONTROL_CLASS L"MAvatarControlClass" // Class of the control
// Sets the contact that this avatar represents. This invalidates
diff --git a/include/m_clc.h b/include/m_clc.h
index 90cf424c22..7357e2fb1a 100644
--- a/include/m_clc.h
+++ b/include/m_clc.h
@@ -25,9 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef M_CLC_H__
#define M_CLC_H__ 1
-//This module is new in 0.1.2.1
-
-#define CLISTCONTROL_CLASS "CListControl"
+#define CLISTCONTROL_CLASS "CListControl"
+#define CLISTCONTROL_CLASSW L"CListControl"
//styles
#define CLS_MANUALUPDATE 0x0001 //todo
diff --git a/include/m_core.h b/include/m_core.h
index f4c6fcaea0..dfbea3077f 100644
--- a/include/m_core.h
+++ b/include/m_core.h
@@ -429,13 +429,11 @@ __forceinline char* lrtrimp(char *str) { return ltrimp(rtrim(str)); };
typedef union {
char *a; // utf8 or ansi strings
- TCHAR *t; // strings of TCHARs
wchar_t *w; // strings of WCHARs
} MAllStrings;
typedef union {
char **a; // array of utf8 or ansi strings
- TCHAR **t; // array of strings of TCHARs
wchar_t **w; // array of strings of WCHARs
} MAllStringArray;
diff --git a/include/m_hotkeys.h b/include/m_hotkeys.h
index 8c5dc4fd8c..a732dda242 100644
--- a/include/m_hotkeys.h
+++ b/include/m_hotkeys.h
@@ -41,11 +41,11 @@ typedef struct
const char *pszName; /* name to refer to hotkey when playing and in db */
union {
const char *pszDescription; /* description for options dialog */
- const TCHAR *ptszDescription;
+ const wchar_t *ptszDescription;
};
union {
const char *pszSection; /* section name used to group sounds (NULL is acceptable) */
- const TCHAR *ptszSection;
+ const wchar_t *ptszSection;
};
const char *pszService; /* Service to call when HotKey Pressed */
WORD DefHotKey; /* default hot key for action */
diff --git a/include/m_langpack.h b/include/m_langpack.h
index 25cd934944..c158bc89ea 100644
--- a/include/m_langpack.h
+++ b/include/m_langpack.h
@@ -51,14 +51,13 @@ EXTERN_C MIR_CORE_DLL(void) TranslateDialog_LP(HWND hDlg, int hLang);
#define Translate(s) TranslateA_LP(s, hLangpack)
#define TranslateW(s) TranslateW_LP(s, hLangpack)
+#define TranslateT(s) TranslateW_LP(_A2W(s), hLangpack)
#define TranslateDialogDefault(h) TranslateDialog_LP(h,hLangpack)
#ifdef _UNICODE
- #define TranslateT(s) TranslateW_LP(_T(s),hLangpack)
#define TranslateTS(s) TranslateW_LP(s,hLangpack)
#define TranslateTH(l,s) TranslateW_LP(s,l)
#else
- #define TranslateT(s) TranslateA_LP(s,hLangpack)
#define TranslateTS(s) TranslateA_LP(s,hLangpack)
#define TranslateTH(l,s) TranslateA_LP(s,l)
#endif
@@ -70,11 +69,7 @@ EXTERN_C MIR_CORE_DLL(void) TranslateDialog_LP(HWND hDlg, int hLang);
#define LPGEN(s) s
#define LPGENW(s) L ## s
-#ifdef _UNICODE
- #define LPGENT(s) _T(s)
-#else
- #define LPGENT(s) s
-#endif
+
//Those macros do NOTHING. They are just markers for lpgen.pl.
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/include/m_metacontacts.h b/include/m_metacontacts.h
index 6eab3200ac..272abb61e2 100644
--- a/include/m_metacontacts.h
+++ b/include/m_metacontacts.h
@@ -27,7 +27,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_core.h>
// standard module for all mc-related information
-#define META_PROTO "MetaContacts"
+#define META_PROTO "MetaContacts"
+#define META_PROTOW L"MetaContacts"
//gets the handle for the 'most online' contact
//wParam=(HANDLE)hMetaContact
diff --git a/include/m_options.h b/include/m_options.h
index 8ebefb40e8..50dd7e1627 100644
--- a/include/m_options.h
+++ b/include/m_options.h
@@ -59,28 +59,28 @@ DLUs.
typedef struct {
int position; //a position number, lower numbers are topmost
union {
- char* pszTitle; // [TRANSLATED-BY-CORE]
- TCHAR* ptszTitle;
+ char *pszTitle; // [TRANSLATED-BY-CORE]
+ wchar_t *pwszTitle;
};
DLGPROC pfnDlgProc;
char *pszTemplate;
HINSTANCE hInstance;
- HICON hIcon; //v0.1.0.1+
+ HICON hIcon;
union {
- char* pszGroup; //v0.1.0.1+ [TRANSLATED-BY-CORE]
- TCHAR* ptszGroup; //v0.1.0.1+
+ char *pszGroup;
+ wchar_t *pwszGroup;
};
- int groupPosition; //v0.1.0.1+
- HICON hGroupIcon; //v0.1.0.1+
- DWORD flags; //v0.1.2.1+
+ int groupPosition;
+ HICON hGroupIcon;
+ DWORD flags;
union {
- char* pszTab; //v0.6.0.0+ [TRANSLATED-BY-CORE]
- TCHAR* ptszTab; //v0.6.0.0+
+ char *pszTab;
+ wchar_t *pwszTab;
};
union {
- LPARAM dwInitParam; //v0.8.0.0+ a value to pass to lParam of WM_INITDIALOG message
+ LPARAM dwInitParam; // a value to pass to lParam of WM_INITDIALOG message
class CDlgBase *pDialog;
};
int hLangpack;
diff --git a/include/m_popup.h b/include/m_popup.h
index a418066a60..87d69bb297 100644
--- a/include/m_popup.h
+++ b/include/m_popup.h
@@ -691,12 +691,10 @@ typedef struct {
union {
const char *pszTitle;
const wchar_t *pwszTitle;
- const TCHAR *ptszTitle;
};
union {
const char *pszText;
const wchar_t *pwszText;
- const TCHAR *ptszText;
};
void *PluginData;
MCONTACT hContact;
diff --git a/include/m_system.h b/include/m_system.h
index 3adb87982f..da061c8c13 100644
--- a/include/m_system.h
+++ b/include/m_system.h
@@ -47,7 +47,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define NEWSTR_ALLOCA(A) (A == NULL)?NULL:strcpy((char*)alloca(strlen(A)+1), A)
#define NEWWSTR_ALLOCA(A) ((A==NULL)?NULL:wcscpy((wchar_t*)alloca(sizeof(wchar_t)*(wcslen(A)+1)),A))
-#define NEWTSTR_ALLOCA(A) (A == NULL)?NULL:_tcscpy((TCHAR*)alloca((_tcslen(A)+1)* sizeof(TCHAR)), A)
#include <m_core.h>
diff --git a/include/m_system_cpp.h b/include/m_system_cpp.h
index 95d9c35e50..1f60a5c399 100644
--- a/include/m_system_cpp.h
+++ b/include/m_system_cpp.h
@@ -30,13 +30,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#if defined(__cplusplus)
-#if defined(_STRING_)
-namespace std
-{
- typedef basic_string<TCHAR, char_traits<TCHAR>, allocator<TCHAR> > tstring;
-}
-#endif
-
///////////////////////////////////////////////////////////////////////////////
// mir_ptr - automatic pointer for buffers, allocated using mir_alloc/mir_calloc
@@ -58,7 +51,7 @@ public:
};
typedef mir_ptr<char> ptrA;
-typedef mir_ptr<TCHAR> ptrT;
+typedef mir_ptr<wchar_t> ptrT;
typedef mir_ptr<WCHAR> ptrW;
///////////////////////////////////////////////////////////////////////////////
@@ -272,24 +265,27 @@ template<class T> struct OBJLIST : public LIST<T>
__inline T& operator[](int idx) const { return *this->items[idx]; }
};
-class _A2T : public ptrT
+#define __A2W(s) L ## s
+#define _A2W(s) __A2W(s)
+
+class _A2T : public ptrW
{
public:
- __inline _A2T(const char* s) : ptrT(mir_a2t(s)) {}
- __inline _A2T(const char* s, int cp) : ptrT(mir_a2t_cp(s, cp)) {}
+ __inline _A2T(const char* s) : ptrW(mir_a2u(s)) {}
+ __inline _A2T(const char* s, int cp) : ptrW(mir_a2u_cp(s, cp)) {}
};
class _T2A : public ptrA
{
public:
- __forceinline _T2A(const TCHAR* s) : ptrA(mir_t2a(s)) {}
- __forceinline _T2A(const TCHAR* s, int cp) : ptrA(mir_t2a_cp(s, cp)) {}
+ __forceinline _T2A(const wchar_t* s) : ptrA(mir_u2a(s)) {}
+ __forceinline _T2A(const wchar_t* s, int cp) : ptrA(mir_u2a_cp(s, cp)) {}
};
class T2Utf : public ptrA
{
public:
- __forceinline T2Utf(const TCHAR *str) : ptrA(mir_utf8encodeT(str)) {}
+ __forceinline T2Utf(const wchar_t *str) : ptrA(mir_utf8encodeW(str)) {}
__forceinline operator BYTE* () const { return (BYTE*)data; }
#ifdef _XSTRING_
std::string str() const { return std::string(data); }
diff --git a/libs/libcurl/src/curl_memory.h b/libs/libcurl/src/curl_memory.h
index e3cdc721c4..adc45cd639 100644
--- a/libs/libcurl/src/curl_memory.h
+++ b/libs/libcurl/src/curl_memory.h
@@ -119,11 +119,11 @@ extern curl_wcsdup_callback Curl_cwcsdup;
# define wcsdup(ptr) Curl_cwcsdup(ptr)
# undef _wcsdup
# define _wcsdup(ptr) Curl_cwcsdup(ptr)
-# undef _tcsdup
-# define _tcsdup(ptr) Curl_cwcsdup(ptr)
+# undef wcsdup
+# define wcsdup(ptr) Curl_cwcsdup(ptr)
# else
-# undef _tcsdup
-# define _tcsdup(ptr) Curl_cstrdup(ptr)
+# undef wcsdup
+# define wcsdup(ptr) Curl_cstrdup(ptr)
# endif
#endif
diff --git a/libs/libcurl/src/curl_ntlm_msgs.c b/libs/libcurl/src/curl_ntlm_msgs.c
index 125ce6e496..bc88feadb6 100644
--- a/libs/libcurl/src/curl_ntlm_msgs.c
+++ b/libs/libcurl/src/curl_ntlm_msgs.c
@@ -371,9 +371,9 @@ CURLcode Curl_ntlm_create_type1_message(const char *userp,
if(!useranddomain.tchar_ptr)
return CURLE_OUT_OF_MEMORY;
- user.const_tchar_ptr = _tcschr(useranddomain.const_tchar_ptr, TEXT('\\'));
+ user.const_tchar_ptr = wcschr(useranddomain.const_tchar_ptr, TEXT('\\'));
if(!user.const_tchar_ptr)
- user.const_tchar_ptr = _tcschr(useranddomain.const_tchar_ptr, TEXT('/'));
+ user.const_tchar_ptr = wcschr(useranddomain.const_tchar_ptr, TEXT('/'));
if(user.tchar_ptr) {
domain.tchar_ptr = useranddomain.tchar_ptr;
@@ -387,22 +387,22 @@ CURLcode Curl_ntlm_create_type1_message(const char *userp,
}
/* setup ntlm identity's user and length */
- dup_user.tchar_ptr = _tcsdup(user.tchar_ptr);
+ dup_user.tchar_ptr = wcsdup(user.tchar_ptr);
if(!dup_user.tchar_ptr) {
Curl_unicodefree(useranddomain.tchar_ptr);
return CURLE_OUT_OF_MEMORY;
}
ntlm->identity.User = dup_user.tbyte_ptr;
- ntlm->identity.UserLength = curlx_uztoul(_tcslen(dup_user.tchar_ptr));
+ ntlm->identity.UserLength = curlx_uztoul(wcslen(dup_user.tchar_ptr));
dup_user.tchar_ptr = NULL;
/* setup ntlm identity's domain and length */
- dup_domain.tchar_ptr = malloc(sizeof(TCHAR) * (domlen + 1));
+ dup_domain.tchar_ptr = malloc(sizeof(wchar_t) * (domlen + 1));
if(!dup_domain.tchar_ptr) {
Curl_unicodefree(useranddomain.tchar_ptr);
return CURLE_OUT_OF_MEMORY;
}
- _tcsncpy(dup_domain.tchar_ptr, domain.tchar_ptr, domlen);
+ wcsncpy(dup_domain.tchar_ptr, domain.tchar_ptr, domlen);
*(dup_domain.tchar_ptr + domlen) = TEXT('\0');
ntlm->identity.Domain = dup_domain.tbyte_ptr;
ntlm->identity.DomainLength = curlx_uztoul(domlen);
@@ -414,14 +414,14 @@ CURLcode Curl_ntlm_create_type1_message(const char *userp,
passwd.tchar_ptr = Curl_convert_UTF8_to_tchar((char *)passwdp);
if(!passwd.tchar_ptr)
return CURLE_OUT_OF_MEMORY;
- dup_passwd.tchar_ptr = _tcsdup(passwd.tchar_ptr);
+ dup_passwd.tchar_ptr = wcsdup(passwd.tchar_ptr);
if(!dup_passwd.tchar_ptr) {
Curl_unicodefree(passwd.tchar_ptr);
return CURLE_OUT_OF_MEMORY;
}
ntlm->identity.Password = dup_passwd.tbyte_ptr;
ntlm->identity.PasswordLength =
- curlx_uztoul(_tcslen(dup_passwd.tchar_ptr));
+ curlx_uztoul(wcslen(dup_passwd.tchar_ptr));
dup_passwd.tchar_ptr = NULL;
Curl_unicodefree(passwd.tchar_ptr);
@@ -433,7 +433,7 @@ CURLcode Curl_ntlm_create_type1_message(const char *userp,
ntlm->p_identity = NULL;
status = s_pSecFn->AcquireCredentialsHandle(NULL,
- (TCHAR *) TEXT("NTLM"),
+ (wchar_t *) TEXT("NTLM"),
SECPKG_CRED_OUTBOUND, NULL,
ntlm->p_identity, NULL, NULL,
&ntlm->handle, &tsDummy);
@@ -448,7 +448,7 @@ CURLcode Curl_ntlm_create_type1_message(const char *userp,
buf.pvBuffer = ntlmbuf;
status = s_pSecFn->InitializeSecurityContext(&ntlm->handle, NULL,
- (TCHAR *) TEXT(""),
+ (wchar_t *) TEXT(""),
ISC_REQ_CONFIDENTIALITY |
ISC_REQ_REPLAY_DETECT |
ISC_REQ_CONNECTION,
@@ -624,7 +624,7 @@ CURLcode Curl_ntlm_create_type3_message(struct SessionHandle *data,
status = s_pSecFn->InitializeSecurityContext(&ntlm->handle,
&ntlm->c_handle,
- (TCHAR *) TEXT(""),
+ (wchar_t *) TEXT(""),
ISC_REQ_CONFIDENTIALITY |
ISC_REQ_REPLAY_DETECT |
ISC_REQ_CONNECTION,
diff --git a/libs/libcurl/src/curl_schannel.c b/libs/libcurl/src/curl_schannel.c
index 68139db586..e137e05c5a 100644
--- a/libs/libcurl/src/curl_schannel.c
+++ b/libs/libcurl/src/curl_schannel.c
@@ -120,7 +120,7 @@ schannel_connect_step1(struct connectdata *conn, int sockindex)
#ifdef ENABLE_IPV6
struct in6_addr addr6;
#endif
- TCHAR *host_name;
+ wchar_t *host_name;
CURLcode code;
infof(data, "schannel: SSL/TLS connection with %s port %hu (step 1/3)\n",
@@ -197,7 +197,7 @@ schannel_connect_step1(struct connectdata *conn, int sockindex)
memset(connssl->cred, 0, sizeof(struct curl_schannel_cred));
/* http://msdn.microsoft.com/en-us/library/windows/desktop/aa374716.aspx */
- sspi_status = s_pSecFn->AcquireCredentialsHandle(NULL, (TCHAR *)UNISP_NAME,
+ sspi_status = s_pSecFn->AcquireCredentialsHandle(NULL, (wchar_t *)UNISP_NAME,
SECPKG_CRED_OUTBOUND, NULL, &schannel_cred, NULL, NULL,
&connssl->cred->cred_handle, &connssl->cred->time_stamp);
@@ -288,7 +288,7 @@ schannel_connect_step2(struct connectdata *conn, int sockindex)
SecBuffer inbuf[2];
SecBufferDesc inbuf_desc;
SECURITY_STATUS sspi_status = SEC_E_OK;
- TCHAR *host_name;
+ wchar_t *host_name;
CURLcode code;
bool doread;
@@ -1075,7 +1075,7 @@ int Curl_schannel_shutdown(struct connectdata *conn, int sockindex)
SecBuffer outbuf;
SecBufferDesc outbuf_desc;
CURLcode code;
- TCHAR *host_name;
+ wchar_t *host_name;
DWORD dwshut = SCHANNEL_SHUTDOWN;
InitSecBuffer(&Buffer, SECBUFFER_TOKEN, &dwshut, sizeof(dwshut));
@@ -1257,7 +1257,7 @@ static CURLcode verify_certificate(struct connectdata *conn, int sockindex)
if(result == CURLE_OK) {
if(data->set.ssl.verifyhost) {
- TCHAR cert_hostname_buff[128];
+ wchar_t cert_hostname_buff[128];
xcharp_u hostname;
xcharp_u cert_hostname;
DWORD len;
diff --git a/libs/libcurl/src/http_negotiate_sspi.c b/libs/libcurl/src/http_negotiate_sspi.c
index 1381d5292d..997e161165 100644
--- a/libs/libcurl/src/http_negotiate_sspi.c
+++ b/libs/libcurl/src/http_negotiate_sspi.c
@@ -91,7 +91,7 @@ int Curl_input_negotiate(struct connectdata *conn, bool proxy,
SecBuffer in_sec_buff;
unsigned long context_attributes;
TimeStamp lifetime;
- TCHAR *sname;
+ wchar_t *sname;
int ret;
size_t len = 0, input_token_len = 0;
bool gss = FALSE;
@@ -138,7 +138,7 @@ int Curl_input_negotiate(struct connectdata *conn, bool proxy,
if(!neg_ctx->output_token) {
PSecPkgInfo SecurityPackage;
- ret = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT("Negotiate"),
+ ret = s_pSecFn->QuerySecurityPackageInfo((wchar_t *) TEXT("Negotiate"),
&SecurityPackage);
if(ret != SEC_E_OK)
return -1;
@@ -168,7 +168,7 @@ int Curl_input_negotiate(struct connectdata *conn, bool proxy,
neg_ctx->status =
s_pSecFn->AcquireCredentialsHandle(NULL,
- (TCHAR *) TEXT("Negotiate"),
+ (wchar_t *) TEXT("Negotiate"),
SECPKG_CRED_OUTBOUND, NULL, NULL,
NULL, NULL, neg_ctx->credentials,
&lifetime);
diff --git a/libs/libcurl/src/memdebug.h b/libs/libcurl/src/memdebug.h
index bd565c8dcf..c5bee0d865 100644
--- a/libs/libcurl/src/memdebug.h
+++ b/libs/libcurl/src/memdebug.h
@@ -95,11 +95,11 @@ CURL_EXTERN int curl_fclose(FILE *file, int line, const char *source);
# define wcsdup(ptr) curl_dowcsdup(ptr, __LINE__, __FILE__)
# undef _wcsdup
# define _wcsdup(ptr) curl_dowcsdup(ptr, __LINE__, __FILE__)
-# undef _tcsdup
-# define _tcsdup(ptr) curl_dowcsdup(ptr, __LINE__, __FILE__)
+# undef wcsdup
+# define wcsdup(ptr) curl_dowcsdup(ptr, __LINE__, __FILE__)
# else
-# undef _tcsdup
-# define _tcsdup(ptr) curl_dostrdup(ptr, __LINE__, __FILE__)
+# undef wcsdup
+# define wcsdup(ptr) curl_dostrdup(ptr, __LINE__, __FILE__)
# endif
#endif
diff --git a/libs/libcurl/src/socks_sspi.c b/libs/libcurl/src/socks_sspi.c
index 0313de3334..ed5024cd27 100644
--- a/libs/libcurl/src/socks_sspi.c
+++ b/libs/libcurl/src/socks_sspi.c
@@ -141,7 +141,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
cred_handle.dwUpper = 0;
status = s_pSecFn->AcquireCredentialsHandle(NULL,
- (TCHAR *) TEXT("Kerberos"),
+ (wchar_t *) TEXT("Kerberos"),
SECPKG_CRED_OUTBOUND,
NULL,
NULL,
@@ -160,7 +160,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
/* As long as we need to keep sending some context info, and there's no */
/* errors, keep sending it... */
for(;;) {
- TCHAR *sname;
+ wchar_t *sname;
sname = Curl_convert_UTF8_to_tchar(service_name);
if(!sname)
diff --git a/libs/libevent/src/evdns.c b/libs/libevent/src/evdns.c
index c4112330a9..f087962336 100644
--- a/libs/libevent/src/evdns.c
+++ b/libs/libevent/src/evdns.c
@@ -3773,7 +3773,7 @@ load_nameservers_with_getnetworkparams(struct evdns_base *base)
}
static int
-config_nameserver_from_reg_key(struct evdns_base *base, HKEY key, const TCHAR *subkey)
+config_nameserver_from_reg_key(struct evdns_base *base, HKEY key, const wchar_t *subkey)
{
char *buf;
DWORD bufsz = 0, type = 0;
diff --git a/libs/libevent/src/evutil.c b/libs/libevent/src/evutil.c
index 495bfcc029..0ea9bc7521 100644
--- a/libs/libevent/src/evutil.c
+++ b/libs/libevent/src/evutil.c
@@ -34,7 +34,6 @@
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#include <io.h>
-#include <tchar.h>
#include <process.h>
#undef _WIN32_WINNT
/* For structs needed by GetAdaptersAddresses */
@@ -2472,15 +2471,15 @@ evutil_hex_char_to_int_(char c)
#ifdef _WIN32
HMODULE
-evutil_load_windows_system_library_(const TCHAR *library_name)
+evutil_load_windows_system_library_(const wchar_t *library_name)
{
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
unsigned n;
n = GetSystemDirectory(path, MAX_PATH);
- if (n == 0 || n + _tcslen(library_name) + 2 >= MAX_PATH)
+ if (n == 0 || n + wcslen(library_name) + 2 >= MAX_PATH)
return 0;
- _tcscat(path, TEXT("\\"));
- _tcscat(path, library_name);
+ wcscat(path, TEXT("\\"));
+ wcscat(path, library_name);
return LoadLibrary(path);
}
#endif
diff --git a/libs/libevent/src/util-internal.h b/libs/libevent/src/util-internal.h
index a6318f2890..61db4e9aca 100644
--- a/libs/libevent/src/util-internal.h
+++ b/libs/libevent/src/util-internal.h
@@ -52,11 +52,11 @@ extern "C" {
/* If we need magic to say "inline", get it for free internally. */
#ifdef EVENT__inline
-#if(_MSC_VER < 1900)
+#if(_MSC_VER < 1900)
#define inline __inline
-#else
+#else
#define inline EVENT__inline
-#endif
+#endif
#endif
@@ -398,7 +398,7 @@ void evutil_free_secure_rng_globals_(void);
void evutil_free_globals_(void);
#ifdef _WIN32
-HMODULE evutil_load_windows_system_library_(const TCHAR *library_name);
+HMODULE evutil_load_windows_system_library_(const wchar_t *library_name);
#endif
#ifndef EV_SIZE_FMT
diff --git a/libs/libjson/src/libJSON.cpp b/libs/libjson/src/libJSON.cpp
index 255e3b1d06..a14c7865e2 100644
--- a/libs/libjson/src/libJSON.cpp
+++ b/libs/libjson/src/libJSON.cpp
@@ -53,7 +53,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern JSONNode nullNode;
-inline TCHAR* toCString(const json_string & str)
+inline wchar_t* toCString(const json_string & str)
{
return mir_utf8decodeT( str.c_str());
}
@@ -102,7 +102,7 @@ LIBJSON_DLL(JSONNode*) json_parse(const json_char *json) {
return 0;
}
-LIBJSON_DLL(TCHAR*) json_strip_white_space(const json_char *json) {
+LIBJSON_DLL(wchar_t*) json_strip_white_space(const json_char *json) {
JSON_ASSERT_SAFE(json, JSON_TEXT("null ptr to json_strip_white_space"), return 0;);
return toCString(JSONWorker::RemoveWhiteSpaceAndComments(json));
}
@@ -277,7 +277,7 @@ LIBJSON_DLL(const json_char*) json_name(const JSONNode *node) {
}
#endif
-LIBJSON_DLL(TCHAR*) json_as_string(const JSONNode *node) {
+LIBJSON_DLL(wchar_t*) json_as_string(const JSONNode *node) {
JSON_ASSERT_SAFE(node, JSON_TEXT("null node to json_as_string"), return toCString(EMPTY_CSTRING););
return toCString(node->as_string());
}
@@ -325,12 +325,12 @@ LIBJSON_DLL(JSONNode*) json_as_array(const JSONNode *node) {
#endif
#ifdef JSON_WRITER
- LIBJSON_DLL(TCHAR*) json_write(const JSONNode *node) {
+ LIBJSON_DLL(wchar_t*) json_write(const JSONNode *node) {
JSON_ASSERT_SAFE(node, JSON_TEXT("null node to json_write"), return toCString(EMPTY_CSTRING););
return toCString(node->write());
}
- LIBJSON_DLL(TCHAR*) json_write_formatted(const JSONNode *node) {
+ LIBJSON_DLL(wchar_t*) json_write_formatted(const JSONNode *node) {
JSON_ASSERT_SAFE(node, JSON_TEXT("null node to json_write_formatted"), return toCString(EMPTY_CSTRING););
return toCString(node->write_formatted());
}
diff --git a/libs/zlib/src/ioapi.c b/libs/zlib/src/ioapi.c
index de9151aae5..815c9035c4 100644
--- a/libs/zlib/src/ioapi.c
+++ b/libs/zlib/src/ioapi.c
@@ -33,7 +33,7 @@ voidpf call_zopen64(const zlib_filefunc64_32_def* pfilefunc, const void*filename
if (pfilefunc->zfile_func64.zopen64_file != NULL)
return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque, filename, mode);
else {
- return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque, (const TCHAR*)filename, mode);
+ return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque, (const wchar_t*)filename, mode);
}
}
@@ -81,7 +81,7 @@ void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filef
-static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const TCHAR* filename, int mode));
+static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const wchar_t* filename, int mode));
static uLong ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size));
static uLong ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream));
@@ -89,10 +89,10 @@ static long ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPO
static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream));
static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream));
-static voidpf ZCALLBACK fopen_file_func(voidpf opaque, const TCHAR* filename, int mode)
+static voidpf ZCALLBACK fopen_file_func(voidpf opaque, const wchar_t* filename, int mode)
{
FILE* file = NULL;
- const TCHAR* mode_fopen = NULL;
+ const wchar_t* mode_fopen = NULL;
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER) == ZLIB_FILEFUNC_MODE_READ)
mode_fopen = L"rb";
else
@@ -103,14 +103,14 @@ static voidpf ZCALLBACK fopen_file_func(voidpf opaque, const TCHAR* filename, in
mode_fopen = L"wb";
if ((filename != NULL) && (mode_fopen != NULL))
- file = _tfopen(filename, mode_fopen);
+ file = _wfopen(filename, mode_fopen);
return file;
}
static voidpf ZCALLBACK fopen64_file_func(voidpf opaque, const void* filename, int mode)
{
FILE* file = NULL;
- const TCHAR* mode_fopen = NULL;
+ const wchar_t* mode_fopen = NULL;
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER) == ZLIB_FILEFUNC_MODE_READ)
mode_fopen = L"rb";
else
@@ -121,7 +121,7 @@ static voidpf ZCALLBACK fopen64_file_func(voidpf opaque, const void* filename, i
mode_fopen = L"wb";
if ((filename != NULL) && (mode_fopen != NULL))
- file = _tfopen((const TCHAR*)filename, mode_fopen);
+ file = _wfopen((const wchar_t*)filename, mode_fopen);
return file;
}
diff --git a/libs/zlib/src/ioapi.h b/libs/zlib/src/ioapi.h
index 20cacd9427..7dda60e52a 100644
--- a/libs/zlib/src/ioapi.h
+++ b/libs/zlib/src/ioapi.h
@@ -133,7 +133,7 @@ extern "C" {
-typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const TCHAR* filename, int mode));
+typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const wchar_t* filename, int mode));
typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
diff --git a/libs/zlib/src/iowin32.c b/libs/zlib/src/iowin32.c
index 8b4ea93970..dbca36fb19 100644
--- a/libs/zlib/src/iowin32.c
+++ b/libs/zlib/src/iowin32.c
@@ -32,7 +32,7 @@
#endif
#endif
-voidpf ZCALLBACK win32_open_file_func OF((voidpf opaque, const TCHAR* filename, int mode));
+voidpf ZCALLBACK win32_open_file_func OF((voidpf opaque, const wchar_t* filename, int mode));
uLong ZCALLBACK win32_read_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size));
uLong ZCALLBACK win32_write_file_func OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
ZPOS64_T ZCALLBACK win32_tell64_file_func OF((voidpf opaque, voidpf stream));
@@ -155,7 +155,7 @@ voidpf ZCALLBACK win32_open64_file_funcW(voidpf opaque, const void* filename, in
return win32_build_iowin(hFile);
}
-voidpf ZCALLBACK win32_open_file_func(voidpf opaque, const TCHAR* filename, int mode)
+voidpf ZCALLBACK win32_open_file_func(voidpf opaque, const wchar_t* filename, int mode)
{
const char* mode_fopen = NULL;
DWORD dwDesiredAccess, dwCreationDisposition, dwShareMode, dwFlagsAndAttributes;
diff --git a/plugins/AVS/src/acc.cpp b/plugins/AVS/src/acc.cpp
index 6fc63c6838..96935ace4f 100644
--- a/plugins/AVS/src/acc.cpp
+++ b/plugins/AVS/src/acc.cpp
@@ -43,7 +43,7 @@ typedef struct
COLORREF bkgColor;
COLORREF avatarBorderColor;
int avatarRoundCornerRadius;
- TCHAR noAvatarText[128];
+ wchar_t noAvatarText[128];
BOOL respectHidden;
BOOL resizeIfSmaller;
BOOL fAero;
@@ -347,7 +347,7 @@ static void NotifyAvatarChange(HWND hwnd)
SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)&pshn);
}
-static void DrawText(HDC hdc, HFONT hFont, const RECT &rc, const TCHAR *text)
+static void DrawText(HDC hdc, HFONT hFont, const RECT &rc, const wchar_t *text)
{
HGDIOBJ oldFont = SelectObject(hdc, hFont);
@@ -469,7 +469,7 @@ static LRESULT CALLBACK ACCWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
return TRUE;
case AVATAR_SETNOAVATARTEXT:
- mir_tstrncpy(data->noAvatarText, TranslateTS((TCHAR*)lParam), _countof(data->noAvatarText));
+ mir_tstrncpy(data->noAvatarText, TranslateTS((wchar_t*)lParam), _countof(data->noAvatarText));
Invalidate(hwnd);
return TRUE;
diff --git a/plugins/AVS/src/acc.h b/plugins/AVS/src/acc.h
index 356a09dea3..9917156385 100644
--- a/plugins/AVS/src/acc.h
+++ b/plugins/AVS/src/acc.h
@@ -21,8 +21,8 @@ Boston, MA 02111-1307, USA.
#ifndef __ACC_H__
# define __ACC_H__
-static INT_PTR avSetAvatar(MCONTACT hContact, TCHAR *tszPath);
-INT_PTR avSetMyAvatar(char *szProto, TCHAR *tszPath);
+static INT_PTR avSetAvatar(MCONTACT hContact, wchar_t *tszPath);
+INT_PTR avSetMyAvatar(char *szProto, wchar_t *tszPath);
int LoadACC();
diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp
index 5c0d9fcef4..c4702ae89c 100644
--- a/plugins/AVS/src/cache.cpp
+++ b/plugins/AVS/src/cache.cpp
@@ -129,7 +129,7 @@ void NotifyMetaAware(MCONTACT hContact, CacheNode *node, AVATARCACHEENTRY *ace)
cacn.cbSize = sizeof(CONTACTAVATARCHANGEDNOTIFICATION);
cacn.hContact = hContact;
cacn.format = node->pa_format;
- _tcsncpy_s(cacn.filename, node->szFilename, _TRUNCATE);
+ wcsncpy_s(cacn.filename, node->szFilename, _TRUNCATE);
// Get hash
char *szProto = GetContactProto(hContact);
@@ -137,12 +137,12 @@ void NotifyMetaAware(MCONTACT hContact, CacheNode *node, AVATARCACHEENTRY *ace)
DBVARIANT dbv = { 0 };
if (!db_get_s(hContact, szProto, "AvatarHash", &dbv)) {
if (dbv.type == DBVT_TCHAR)
- _tcsncpy_s(cacn.hash, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(cacn.hash, dbv.ptszVal, _TRUNCATE);
else if (dbv.type == DBVT_ASCIIZ)
- _tcsncpy_s(cacn.hash, _A2T(dbv.pszVal), _TRUNCATE);
+ wcsncpy_s(cacn.hash, _A2T(dbv.pszVal), _TRUNCATE);
else if (dbv.type == DBVT_BLOB) {
ptrA szHash(mir_base64_encode(dbv.pbVal, dbv.cpbVal));
- _tcsncpy_s(cacn.hash, _A2T(szHash), _TRUNCATE);
+ wcsncpy_s(cacn.hash, _A2T(szHash), _TRUNCATE);
}
db_free(&dbv);
}
diff --git a/plugins/AVS/src/image_utils.cpp b/plugins/AVS/src/image_utils.cpp
index c478f8bd3e..61c548c96b 100644
--- a/plugins/AVS/src/image_utils.cpp
+++ b/plugins/AVS/src/image_utils.cpp
@@ -159,7 +159,7 @@ void SetHIMETRICtoDP(HDC hdc, SIZE* sz)
sz->cy = pt.y;
}
-HBITMAP BmpFilterLoadBitmap(BOOL *bIsTransparent, const TCHAR *ptszFilename)
+HBITMAP BmpFilterLoadBitmap(BOOL *bIsTransparent, const wchar_t *ptszFilename)
{
if (fei == NULL)
return 0;
@@ -203,14 +203,14 @@ static HWND hwndClui = 0;
// PNG and BMP will be saved as 32bit images, jpg as 24bit with default quality (75)
// returns 1 on success, 0 on failure
-int BmpFilterSaveBitmap(HBITMAP hBmp, const TCHAR *ptszFile, int flags)
+int BmpFilterSaveBitmap(HBITMAP hBmp, const wchar_t *ptszFile, int flags)
{
if (fei == NULL)
return -1;
- TCHAR tszFilename[MAX_PATH];
+ wchar_t tszFilename[MAX_PATH];
if (!PathToAbsoluteT(ptszFile, tszFilename))
- _tcsncpy_s(tszFilename, ptszFile, _TRUNCATE);
+ wcsncpy_s(tszFilename, ptszFile, _TRUNCATE);
if (mir_tstrlen(tszFilename) <= 4)
return -1;
@@ -551,7 +551,7 @@ BOOL MakeTransparentBkg(MCONTACT hContact, HBITMAP *hBitmap)
/////////////////////////////////////////////////////////////////////////////////////////
// Other utils
-int SaveAvatar(const char *protocol, const TCHAR *tszFileName)
+int SaveAvatar(const char *protocol, const wchar_t *tszFileName)
{
INT_PTR result = CallProtoService(protocol, PS_SETMYAVATAR, 0, (LPARAM)tszFileName);
if (result == CALLSERVICE_NOTFOUND)
diff --git a/plugins/AVS/src/image_utils.h b/plugins/AVS/src/image_utils.h
index b61f05b883..cf4529321e 100644
--- a/plugins/AVS/src/image_utils.h
+++ b/plugins/AVS/src/image_utils.h
@@ -1,8 +1,8 @@
#ifndef __IMAGE_UTILS_H__
# define __IMAGE_UTILS_H__
-HBITMAP BmpFilterLoadBitmap(BOOL *bIsTransparent, const TCHAR *ptszFilename);
-int BmpFilterSaveBitmap(HBITMAP hBmp, const TCHAR *ptszFile, int flags);
+HBITMAP BmpFilterLoadBitmap(BOOL *bIsTransparent, const wchar_t *ptszFilename);
+int BmpFilterSaveBitmap(HBITMAP hBmp, const wchar_t *ptszFile, int flags);
HBITMAP CopyBitmapTo32(HBITMAP hBitmap);
@@ -11,6 +11,6 @@ BOOL MakeTransparentBkg(MCONTACT hContact, HBITMAP *hBitmap);
HBITMAP MakeGrayscale(HBITMAP hBitmap);
DWORD GetImgHash(HBITMAP hBitmap);
-int SaveAvatar(const char* protocol, const TCHAR* tszFileName);
+int SaveAvatar(const char* protocol, const wchar_t* tszFileName);
#endif // __IMAGE_UTILS_H__
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp
index 8a9bc4170a..516d6a204b 100644
--- a/plugins/AVS/src/main.cpp
+++ b/plugins/AVS/src/main.cpp
@@ -32,7 +32,7 @@ bool g_shutDown = false;
int hLangpack;
-TCHAR g_szDataPath[MAX_PATH]; // user datae path (read at startup only)
+wchar_t g_szDataPath[MAX_PATH]; // user datae path (read at startup only)
BOOL g_AvatarHistoryAvail = FALSE;
HWND hwndSetMyAvatar = 0;
@@ -144,7 +144,7 @@ static void LoadProtoInfo(PROTOCOLDESCRIPTOR *proto)
char protoName[MAX_PATH];
mir_snprintf(protoName, "Global avatar for %s accounts", proto->szName);
- TCHAR protoNameTmp[MAX_PATH];
+ wchar_t protoNameTmp[MAX_PATH];
mir_sntprintf(protoNameTmp, TranslateT("Global avatar for %s accounts"), _A2T(proto->szName));
protoPicCacheEntry *pce = new protoPicCacheEntry;
if (CreateAvatarInCache(0, pce, protoName) != 1)
@@ -322,7 +322,7 @@ void InternalDrawAvatar(AVATARDRAWREQUEST *r, HBITMAP hbm, LONG bmWidth, LONG bm
static int ModulesLoaded(WPARAM, LPARAM)
{
- TCHAR szEventName[100];
+ wchar_t szEventName[100];
mir_sntprintf(szEventName, L"avs_loaderthread_%d", GetCurrentThreadId());
hLoaderEvent = CreateEvent(NULL, TRUE, FALSE, szEventName);
@@ -381,8 +381,8 @@ static int LoadAvatarModule()
InitServices();
InitPolls();
- _tcsncpy_s(g_szDataPath, _countof(g_szDataPath), VARST(L"%miranda_userdata%\\"), _TRUNCATE);
- _tcslwr(g_szDataPath);
+ wcsncpy_s(g_szDataPath, _countof(g_szDataPath), VARST(L"%miranda_userdata%\\"), _TRUNCATE);
+ wcslwr(g_szDataPath);
return 0;
}
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp
index 2a438acebe..7254543bb3 100644
--- a/plugins/AVS/src/options.cpp
+++ b/plugins/AVS/src/options.cpp
@@ -99,7 +99,7 @@ static void RemoveProtoPic(const char *szProto)
static void SetProtoPic(char *szProto)
{
- TCHAR FileName[MAX_PATH], filter[256];
+ wchar_t FileName[MAX_PATH], filter[256];
Bitmap_GetFilter(filter, _countof(filter));
OPENFILENAME ofn = { 0 };
@@ -116,10 +116,10 @@ static void SetProtoPic(char *szProto)
if (!GetOpenFileName(&ofn))
return;
- if (_taccess(FileName, 4) == -1)
+ if (_waccess(FileName, 4) == -1)
return;
- TCHAR szNewPath[MAX_PATH];
+ wchar_t szNewPath[MAX_PATH];
PathToRelativeT(FileName, szNewPath, g_szDataPath);
db_set_ts(NULL, PPICT_MODULE, szProto, szNewPath);
@@ -387,7 +387,7 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar
DBVARIANT dbv;
if (!db_get_ts(NULL, PPICT_MODULE, g_selectedProto, &dbv)) {
if (!PathIsAbsoluteT(VARST(dbv.ptszVal))) {
- TCHAR szFinalPath[MAX_PATH];
+ wchar_t szFinalPath[MAX_PATH];
mir_sntprintf(szFinalPath, L"%%miranda_path%%\\%s", dbv.ptszVal);
SetDlgItemText(hwndDlg, IDC_PROTOAVATARNAME, szFinalPath);
}
@@ -488,7 +488,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
TranslateDialogDefault(hwndDlg);
if (hContact) {
- TCHAR szTitle[512];
+ wchar_t szTitle[512];
mir_sntprintf(szTitle, TranslateT("Set avatar options for %s"), pcli->pfnGetContactDisplayName(hContact, 0));
SetWindowText(hwndDlg, szTitle);
}
@@ -660,7 +660,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
case DM_SETAVATARNAME:
{
- TCHAR szFinalName[MAX_PATH];
+ wchar_t szFinalName[MAX_PATH];
DBVARIANT dbv = { 0 };
BYTE is_locked = db_get_b(hContact, "ContactPhoto", "Locked", 0);
@@ -744,7 +744,7 @@ static INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wPa
HWND protopic = GetDlgItem(hwndDlg, IDC_PROTOPIC);
SendMessage(protopic, AVATAR_SETCONTACT, 0, (LPARAM)hContact);
SendMessage(protopic, AVATAR_SETAVATARBORDERCOLOR, 0, (LPARAM)GetSysColor(COLOR_BTNSHADOW));
- SendMessage(protopic, AVATAR_SETNOAVATARTEXT, 0, (LPARAM)LPGENT("Contact has no avatar"));
+ SendMessage(protopic, AVATAR_SETNOAVATARTEXT, 0, (LPARAM)LPGENW("Contact has no avatar"));
SendMessage(protopic, AVATAR_RESPECTHIDDEN, 0, (LPARAM)FALSE);
SendMessage(protopic, AVATAR_SETRESIZEIFSMALLER, 0, (LPARAM)FALSE);
}
@@ -986,7 +986,7 @@ static INT_PTR CALLBACK DlgProcAvatarProtoInfo(HWND hwndDlg, UINT msg, WPARAM wP
{
HWND protopic = GetDlgItem(hwndDlg, IDC_PROTOPIC);
SendMessage(protopic, AVATAR_SETAVATARBORDERCOLOR, 0, (LPARAM)GetSysColor(COLOR_BTNSHADOW));
- SendMessage(protopic, AVATAR_SETNOAVATARTEXT, 0, (LPARAM)LPGENT("No avatar"));
+ SendMessage(protopic, AVATAR_SETNOAVATARTEXT, 0, (LPARAM)LPGENW("No avatar"));
SendMessage(protopic, AVATAR_SETRESIZEIFSMALLER, 0, (LPARAM)FALSE);
HWND hwndList = GetDlgItem(hwndDlg, IDC_PROTOCOLS);
@@ -1082,7 +1082,7 @@ static INT_PTR CALLBACK DlgProcAvatarProtoInfo(HWND hwndDlg, UINT msg, WPARAM wP
char description[256];
CallProtoService(proto, PS_GETNAME, _countof(description), (LPARAM)description);
- TCHAR *descr = mir_a2t(description);
+ wchar_t *descr = mir_a2t(description);
if (MessageBox(hwndDlg, TranslateT("Are you sure you want to remove your avatar?"), descr, MB_YESNO) == IDYES)
avSetMyAvatar(proto, L"");
mir_free(descr);
diff --git a/plugins/AVS/src/poll.cpp b/plugins/AVS/src/poll.cpp
index a713a71935..226bb12278 100644
--- a/plugins/AVS/src/poll.cpp
+++ b/plugins/AVS/src/poll.cpp
@@ -44,7 +44,7 @@ static void RequestThread(void *vParam);
extern HANDLE hShutdownEvent;
extern int DeleteAvatar(MCONTACT hContact);
-extern void MakePathRelative(MCONTACT hContact, TCHAR *path);
+extern void MakePathRelative(MCONTACT hContact, wchar_t *path);
int Proto_GetDelayAfterFail(const char *proto);
BOOL Proto_IsFetchingWhenProtoNotVisibleAllowed(const char *proto);
BOOL Proto_IsFetchingWhenContactOfflineAllowed(const char *proto);
diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp
index 058f377e99..79a21f3b8a 100644
--- a/plugins/AVS/src/services.cpp
+++ b/plugins/AVS/src/services.cpp
@@ -115,10 +115,10 @@ UINT_PTR CALLBACK OpenFileSubclass(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
return FALSE;
}
-static INT_PTR avSetAvatar(MCONTACT hContact, TCHAR *tszPath)
+static INT_PTR avSetAvatar(MCONTACT hContact, wchar_t *tszPath)
{
- TCHAR FileName[MAX_PATH];
- TCHAR *szFinalName;
+ wchar_t FileName[MAX_PATH];
+ wchar_t *szFinalName;
BYTE locking_request;
if (hContact == NULL || fei == NULL)
@@ -127,7 +127,7 @@ static INT_PTR avSetAvatar(MCONTACT hContact, TCHAR *tszPath)
int is_locked = db_get_b(hContact, "ContactPhoto", "Locked", 0);
if (tszPath == NULL) {
- TCHAR filter[256];
+ wchar_t filter[256];
Bitmap_GetFilter(filter, _countof(filter));
OPENFILENAME ofn = { 0 };
@@ -155,11 +155,11 @@ static INT_PTR avSetAvatar(MCONTACT hContact, TCHAR *tszPath)
else szFinalName = tszPath;
// filename is now set, check it and perform all needed action
- if (_taccess(szFinalName, 4) == -1)
+ if (_waccess(szFinalName, 4) == -1)
return 0;
// file exists...
- TCHAR szBackupName[MAX_PATH];
+ wchar_t szBackupName[MAX_PATH];
PathToRelativeT(szFinalName, szBackupName, g_szDataPath);
db_set_ts(hContact, "ContactPhoto", "Backup", szBackupName);
@@ -179,7 +179,7 @@ INT_PTR SetAvatar(WPARAM wParam, LPARAM lParam)
INT_PTR SetAvatarW(WPARAM wParam, LPARAM lParam)
{
- return avSetAvatar(wParam, (TCHAR*)lParam);
+ return avSetAvatar(wParam, (wchar_t*)lParam);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -333,12 +333,12 @@ static UINT_PTR CALLBACK SetMyAvatarHookProc(HWND hwnd, UINT msg, WPARAM, LPARAM
struct SaveProtocolData
{
DWORD max_size;
- TCHAR image_file_name[MAX_PATH];
+ wchar_t image_file_name[MAX_PATH];
BOOL saved;
BOOL need_smaller_size;
int width;
int height;
- TCHAR temp_file[MAX_PATH];
+ wchar_t temp_file[MAX_PATH];
HBITMAP hBmpProto;
};
@@ -369,7 +369,7 @@ void SaveImage(SaveProtocolData &d, char *protocol, int format)
else d.saved = TRUE;
}
-static int SetProtoMyAvatar(char *protocol, HBITMAP hBmp, TCHAR *originalFilename, int originalFormat, BOOL square, BOOL grow)
+static int SetProtoMyAvatar(char *protocol, HBITMAP hBmp, wchar_t *originalFilename, int originalFormat, BOOL square, BOOL grow)
{
if (!ProtoServiceExists(protocol, PS_SETMYAVATAR))
return -1;
@@ -491,10 +491,10 @@ static int SetProtoMyAvatar(char *protocol, HBITMAP hBmp, TCHAR *originalFilenam
return ret;
}
-static int InternalSetMyAvatar(char *protocol, TCHAR *szFinalName, SetMyAvatarHookData &data, BOOL allAcceptXML, BOOL allAcceptSWF)
+static int InternalSetMyAvatar(char *protocol, wchar_t *szFinalName, SetMyAvatarHookData &data, BOOL allAcceptXML, BOOL allAcceptSWF)
{
int format = ProtoGetAvatarFormat(szFinalName);
- if (format == PA_FORMAT_UNKNOWN || _taccess(szFinalName, 4) == -1)
+ if (format == PA_FORMAT_UNKNOWN || _waccess(szFinalName, 4) == -1)
return -3;
// file exists...
@@ -547,14 +547,14 @@ static int InternalSetMyAvatar(char *protocol, TCHAR *szFinalName, SetMyAvatarHo
db_set_b(NULL, AVS_MODULE, "GlobalUserAvatarNotConsistent", 1);
else {
// Copy avatar file to store as global one
- TCHAR globalFile[1024];
+ wchar_t globalFile[1024];
BOOL saved = TRUE;
if (FoldersGetCustomPathT(hGlobalAvatarFolder, globalFile, _countof(globalFile), L"")) {
mir_sntprintf(globalFile, L"%s%s", g_szDataPath, L"GlobalAvatar");
CreateDirectory(globalFile, NULL);
}
- TCHAR *ext = _tcsrchr(szFinalName, _T('.')); // Can't be NULL here
+ wchar_t *ext = wcsrchr(szFinalName, '.'); // Can't be NULL here
if (format == PA_FORMAT_XML || format == PA_FORMAT_SWF) {
mir_sntprintf(globalFile, L"%s\\my_global_avatar%s", globalFile, ext);
CopyFile(szFinalName, globalFile, FALSE);
@@ -588,7 +588,7 @@ static int InternalSetMyAvatar(char *protocol, TCHAR *szFinalName, SetMyAvatarHo
}
if (saved) {
- TCHAR relFile[1024];
+ wchar_t relFile[1024];
if (PathToRelativeT(globalFile, relFile, g_szDataPath))
db_set_ts(NULL, AVS_MODULE, "GlobalUserAvatarFile", relFile);
else
@@ -608,10 +608,10 @@ static int InternalSetMyAvatar(char *protocol, TCHAR *szFinalName, SetMyAvatarHo
return ret;
}
-INT_PTR avSetMyAvatar(char* protocol, TCHAR* tszPath)
+INT_PTR avSetMyAvatar(char* protocol, wchar_t* tszPath)
{
- TCHAR FileName[MAX_PATH];
- TCHAR *szFinalName = NULL;
+ wchar_t FileName[MAX_PATH];
+ wchar_t *szFinalName = NULL;
BOOL allAcceptXML;
BOOL allAcceptSWF;
@@ -664,7 +664,7 @@ INT_PTR avSetMyAvatar(char* protocol, TCHAR* tszPath)
CMString filter;
FilterGetStrings(filter, allAcceptXML, allAcceptSWF);
- TCHAR inipath[1024];
+ wchar_t inipath[1024];
FoldersGetCustomPathT(hMyAvatarsFolder, inipath, _countof(inipath), L".");
OPENFILENAME ofn = { 0 };
@@ -683,11 +683,11 @@ INT_PTR avSetMyAvatar(char* protocol, TCHAR* tszPath)
ofn.lpstrDefExt = L"";
ofn.hInstance = g_hInst;
- TCHAR title[256];
+ wchar_t title[256];
if (protocol == NULL)
mir_sntprintf(title, TranslateT("Set my avatar"));
else {
- TCHAR* prototmp = mir_a2t(protocol);
+ wchar_t* prototmp = mir_a2t(protocol);
mir_sntprintf(title, TranslateT("Set my avatar for %s"), prototmp);
mir_free(prototmp);
}
@@ -698,7 +698,7 @@ INT_PTR avSetMyAvatar(char* protocol, TCHAR* tszPath)
szFinalName = FileName;
}
- else szFinalName = (TCHAR*)tszPath;
+ else szFinalName = (wchar_t*)tszPath;
// filename is now set, check it and perform all needed action
if (szFinalName[0] == '\0')
@@ -714,7 +714,7 @@ static INT_PTR SetMyAvatar(WPARAM wParam, LPARAM lParam)
static INT_PTR SetMyAvatarW(WPARAM wParam, LPARAM lParam)
{
- return avSetMyAvatar((char*)wParam, (TCHAR*)lParam);
+ return avSetMyAvatar((char*)wParam, (wchar_t*)lParam);
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/AVS/src/stdafx.h b/plugins/AVS/src/stdafx.h
index adf9f0db73..0a5beda25a 100644
--- a/plugins/AVS/src/stdafx.h
+++ b/plugins/AVS/src/stdafx.h
@@ -85,7 +85,7 @@ struct protoPicCacheEntry : public avatarCacheEntry, public MZeroedObject
void clear();
char* szProtoname;
- TCHAR* tszAccName;
+ wchar_t* tszAccName;
};
extern OBJLIST<protoPicCacheEntry> g_ProtoPictures, g_MyAvatars;
@@ -109,7 +109,7 @@ extern FI_INTERFACE *fei;
void mir_sleep(int time);
extern bool g_shutDown;
-extern TCHAR g_szDataPath[]; // user datae path (read at startup only)
+extern wchar_t g_szDataPath[]; // user datae path (read at startup only)
extern BOOL g_AvatarHistoryAvail;
extern HWND hwndSetMyAvatar;
@@ -120,11 +120,11 @@ extern HANDLE hGlobalAvatarFolder;
extern HANDLE hLoaderEvent, hShutdownEvent;
extern HANDLE hEventChanged, hEventContactAvatarChanged, hMyAvatarChanged;
-int GetFileHash(TCHAR* filename);
-DWORD GetFileSize(TCHAR *szFilename);
+int GetFileHash(wchar_t* filename);
+DWORD GetFileSize(wchar_t *szFilename);
void MakePathRelative(MCONTACT hContact);
-void MakePathRelative(MCONTACT hContact, TCHAR *dest);
-void MyPathToAbsolute(const TCHAR *ptszPath, TCHAR *ptszDest);
+void MakePathRelative(MCONTACT hContact, wchar_t *dest);
+void MyPathToAbsolute(const wchar_t *ptszPath, wchar_t *ptszDest);
HBITMAP LoadPNG(struct avatarCacheEntry *ace, char *szFilename);
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp
index 4e7603c396..c46fff6a58 100644
--- a/plugins/AVS/src/utils.cpp
+++ b/plugins/AVS/src/utils.cpp
@@ -28,7 +28,7 @@ void mir_sleep(int time)
/////////////////////////////////////////////////////////////////////////////////////////
// substitutes variables and passes our own data path as base
-void MyPathToAbsolute(const TCHAR *ptszPath, TCHAR *ptszDest)
+void MyPathToAbsolute(const wchar_t *ptszPath, wchar_t *ptszDest)
{
PathToAbsoluteT(VARST(ptszPath), ptszDest, g_szDataPath);
}
@@ -37,9 +37,9 @@ void MyPathToAbsolute(const TCHAR *ptszPath, TCHAR *ptszDest)
// convert the avatar image path to a relative one...
// given: contact handle, path to image
-void MakePathRelative(MCONTACT hContact, TCHAR *path)
+void MakePathRelative(MCONTACT hContact, wchar_t *path)
{
- TCHAR szFinalPath[MAX_PATH];
+ wchar_t szFinalPath[MAX_PATH];
szFinalPath[0] = '\0';
size_t result = PathToRelativeT(path, szFinalPath, g_szDataPath);
@@ -68,7 +68,7 @@ void MakePathRelative(MCONTACT hContact)
int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto)
{
ptrT tszValue;
- TCHAR tszFilename[MAX_PATH]; tszFilename[0] = 0;
+ wchar_t tszFilename[MAX_PATH]; tszFilename[0] = 0;
ace->hbmPic = 0;
ace->dwFlags = 0;
@@ -139,8 +139,8 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto)
if (mir_tstrlen(tszFilename) < 4)
return -1;
- _tcsncpy_s(tszFilename, VARST(tszFilename), _TRUNCATE);
- if (_taccess(tszFilename, 4) == -1)
+ wcsncpy_s(tszFilename, VARST(tszFilename), _TRUNCATE);
+ if (_waccess(tszFilename, 4) == -1)
return -2;
BOOL isTransparentImage = 0;
@@ -149,7 +149,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto)
ace->bmHeight = 0;
ace->bmWidth = 0;
ace->lpDIBSection = NULL;
- _tcsncpy(ace->szFilename, tszFilename, MAX_PATH);
+ wcsncpy(ace->szFilename, tszFilename, MAX_PATH);
ace->szFilename[MAX_PATH - 1] = 0;
if (ace->hbmPic == 0)
return -1;
@@ -230,7 +230,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto)
#define TOPBIT (1 << (WIDTH - 1)) /* MSB */
#define WIDTH 32
-int GetFileHash(TCHAR* filename)
+int GetFileHash(wchar_t* filename)
{
HANDLE hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
if (hFile == INVALID_HANDLE_VALUE)
@@ -435,7 +435,7 @@ void DeleteGlobalUserAvatar()
if (db_get_ts(NULL, AVS_MODULE, "GlobalUserAvatarFile", &dbv))
return;
- TCHAR szFilename[MAX_PATH];
+ wchar_t szFilename[MAX_PATH];
MyPathToAbsolute(dbv.ptszVal, szFilename);
db_free(&dbv);
@@ -457,8 +457,8 @@ void SetIgnoreNotify(char *protocol, BOOL ignore)
///////////////////////////////////////////////////////////////////////////////////////////////////////
-DWORD GetFileSize(TCHAR *szFilename)
+DWORD GetFileSize(wchar_t *szFilename)
{
struct _stat info;
- return (_tstat(szFilename, &info) == -1) ? 0 : info.st_size;
+ return (_wstat(szFilename, &info) == -1) ? 0 : info.st_size;
}
diff --git a/plugins/AddContactPlus/src/addcontact.cpp b/plugins/AddContactPlus/src/addcontact.cpp
index 85a990612d..424976f0b0 100644
--- a/plugins/AddContactPlus/src/addcontact.cpp
+++ b/plugins/AddContactPlus/src/addcontact.cpp
@@ -61,7 +61,7 @@ void AddContactDlgOpts(HWND hdlg, const char* szProto, BOOL bAuthOptsOnly = FALS
char* szUniqueId = (char*)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDTEXT, 0);
if (szUniqueId) {
size_t cbLen = mir_strlen(szUniqueId) + 2;
- TCHAR* pszUniqueId = (TCHAR*)mir_alloc(cbLen * sizeof(TCHAR));
+ wchar_t* pszUniqueId = (wchar_t*)mir_alloc(cbLen * sizeof(wchar_t));
mir_sntprintf(pszUniqueId, cbLen, L"%S:", szUniqueId);
SetDlgItemText(hdlg, IDC_IDLABEL, pszUniqueId);
mir_free(pszUniqueId);
@@ -169,7 +169,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM)
HookEventMessage(ME_SKIN2_ICONSCHANGED, hdlg, DM_ADDCONTACT_CHANGEICONS);
HookEventMessage(ME_PROTO_ACCLISTCHANGED, hdlg, DM_ADDCONTACT_CHANGEACCLIST);
{
- TCHAR *szGroup;
+ wchar_t *szGroup;
for (int i = 1; (szGroup = Clist_GroupGetName(i, NULL)) != NULL; i++) {
int id = SendDlgItemMessage(hdlg, IDC_GROUP, CB_ADDSTRING, 0, (LPARAM)szGroup);
SendDlgItemMessage(hdlg, IDC_GROUP, CB_SETITEMDATA, (WPARAM)id, (LPARAM)i);
@@ -195,7 +195,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM)
switch (LOWORD(wparam)) {
case IDC_USERID:
if (HIWORD(wparam) == EN_CHANGE) {
- TCHAR szUserId[256];
+ wchar_t szUserId[256];
if (GetDlgItemText(hdlg, IDC_USERID, szUserId, _countof(szUserId))) {
if (!IsWindowEnabled(GetDlgItem(hdlg, IDOK)))
EnableWindow(GetDlgItem(hdlg, IDOK), TRUE);
@@ -233,12 +233,12 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM)
case IDOK:
{
- TCHAR szUserId[256];
+ wchar_t szUserId[256];
GetDlgItemText(hdlg, IDC_USERID, szUserId, _countof(szUserId));
if (*rtrimt(szUserId) == 0 ||
- (strstr(acs->proto, "GG") && _tcstoul(szUserId, NULL, 10) > INT_MAX) || // Gadu-Gadu protocol
- ((CallProtoService(acs->proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_NUMERICUSERID) && !_tcstoul(szUserId, NULL, 10)))
+ (strstr(acs->proto, "GG") && wcstoul(szUserId, NULL, 10) > INT_MAX) || // Gadu-Gadu protocol
+ ((CallProtoService(acs->proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_NUMERICUSERID) && !wcstoul(szUserId, NULL, 10)))
{
MessageBox(NULL,
TranslateT("The contact cannot be added to your contact list. Please make sure the contact ID is entered correctly."),
@@ -248,7 +248,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM)
PROTOSEARCHRESULT *psr;
if (strstr(acs->proto, "TLEN")) { // Tlen protocol
- if (_tcschr(szUserId, '@') == NULL) {
+ if (wcschr(szUserId, '@') == NULL) {
MessageBox(NULL,
TranslateT("The contact cannot be added to your contact list. Please make sure the contact ID is entered correctly."),
TranslateT("Add contact"), MB_OK | MB_ICONWARNING | MB_SETFOREGROUND | MB_TOPMOST);
@@ -264,7 +264,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM)
}
psr->flags = PSR_TCHAR;
- psr->id.t = mir_tstrdup(szUserId);
+ psr->id.w = mir_tstrdup(szUserId);
acs->psr = psr;
MCONTACT hContact = (MCONTACT)CallProtoService(acs->proto, PS_ADDTOLIST, IsDlgButtonChecked(hdlg, IDC_ADDTEMP) ? PALF_TEMPORARY : 0, (LPARAM)acs->psr);
@@ -275,7 +275,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM)
break;
}
- TCHAR szHandle[256];
+ wchar_t szHandle[256];
if (GetDlgItemText(hdlg, IDC_MYHANDLE, szHandle, _countof(szHandle)))
db_set_ts(hContact, "CList", "MyHandle", szHandle);
@@ -296,7 +296,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM)
if (flags & PF4_NOCUSTOMAUTH)
ProtoChainSend(hContact, PSS_AUTHREQUEST, 0, 0);
else {
- TCHAR tszReason[512];
+ wchar_t tszReason[512];
GetDlgItemText(hdlg, IDC_AUTHREQ, tszReason, _countof(tszReason));
ProtoChainSend(hContact, PSS_AUTHREQUEST, 0, (LPARAM)tszReason);
}
@@ -339,10 +339,10 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM)
if (acs) {
db_set_s(NULL, "AddContact", "LastProto", acs->proto);
if (acs->psr) {
- mir_free(acs->psr->nick.t);
- mir_free(acs->psr->firstName.t);
- mir_free(acs->psr->lastName.t);
- mir_free(acs->psr->email.t);
+ mir_free(acs->psr->nick.w);
+ mir_free(acs->psr->firstName.w);
+ mir_free(acs->psr->lastName.w);
+ mir_free(acs->psr->email.w);
mir_free(acs->psr);
}
delete acs;
diff --git a/plugins/AddContactPlus/src/main.cpp b/plugins/AddContactPlus/src/main.cpp
index fe3cb37dbe..2e9191ba85 100644
--- a/plugins/AddContactPlus/src/main.cpp
+++ b/plugins/AddContactPlus/src/main.cpp
@@ -97,7 +97,7 @@ static int OnAccListChanged(WPARAM, LPARAM)
mi.position = 500020001;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = icon.hIcolib;
- mi.name.t = LPGENT("&Add contact...");
+ mi.name.w = LPGENW("&Add contact...");
mi.pszService = MS_ADDCONTACTPLUS_SHOW;
hMainMenuItem = Menu_AddMainMenuItem(&mi);
}
@@ -129,8 +129,8 @@ static int OnModulesLoaded(WPARAM, LPARAM)
HOTKEYDESC hkd = { sizeof(hkd) };
hkd.dwFlags = HKD_TCHAR;
hkd.pszName = "AddContactPlus_OpenDialog";
- hkd.ptszDescription = LPGENT("Open add contact dialog");
- hkd.ptszSection = LPGENT("Main");
+ hkd.ptszDescription = LPGENW("Open add contact dialog");
+ hkd.ptszSection = LPGENW("Main");
hkd.pszService = MS_ADDCONTACTPLUS_SHOW;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, 'C') | HKF_MIRANDA_LOCAL;
Hotkey_Register(&hkd);
diff --git a/plugins/Alarms/src/alarm_win.cpp b/plugins/Alarms/src/alarm_win.cpp
index d211b0c43b..f39333767d 100644
--- a/plugins/Alarms/src/alarm_win.cpp
+++ b/plugins/Alarms/src/alarm_win.cpp
@@ -266,16 +266,16 @@ INT_PTR CALLBACK DlgProcAlarm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
#define AddItem(x) \
mii.wID++; \
- mii.dwTypeData = TranslateT(x); \
+ mii.dwTypeData = TranslateW(x); \
mii.cch = ( UINT )mir_tstrlen(mii.dwTypeData); \
InsertMenuItem(hMenu, mii.wID, FALSE, &mii);
- AddItem(LPGEN("5 mins"));
- AddItem(LPGEN("15 mins"));
- AddItem(LPGEN("30 mins"));
- AddItem(LPGEN("1 hour"));
- AddItem(LPGEN("1 day"));
- AddItem(LPGEN("1 week"));
+ AddItem(LPGENW("5 mins"));
+ AddItem(LPGENW("15 mins"));
+ AddItem(LPGENW("30 mins"));
+ AddItem(LPGENW("1 hour"));
+ AddItem(LPGENW("1 day"));
+ AddItem(LPGENW("1 week"));
TPMPARAMS tpmp = { 0 };
tpmp.cbSize = sizeof(tpmp);
@@ -350,31 +350,31 @@ int ReloadFonts(WPARAM, LPARAM)
int AlarmWinModulesLoaded(WPARAM, LPARAM)
{
title_font_id.cbSize = sizeof(FontIDT);
- mir_tstrcpy(title_font_id.group, LPGENT("Alarms"));
- mir_tstrcpy(title_font_id.name, LPGENT("Title"));
+ mir_tstrcpy(title_font_id.group, LPGENW("Alarms"));
+ mir_tstrcpy(title_font_id.name, LPGENW("Title"));
mir_strcpy(title_font_id.dbSettingsGroup, MODULE);
mir_strcpy(title_font_id.prefix, "FontTitle");
- mir_tstrcpy(title_font_id.backgroundGroup, LPGENT("Alarms"));
- mir_tstrcpy(title_font_id.backgroundName, LPGENT("Background"));
+ mir_tstrcpy(title_font_id.backgroundGroup, LPGENW("Alarms"));
+ mir_tstrcpy(title_font_id.backgroundName, LPGENW("Background"));
title_font_id.flags = 0;
title_font_id.order = 0;
FontRegisterT(&title_font_id);
window_font_id.cbSize = sizeof(FontIDT);
- mir_tstrcpy(window_font_id.group, LPGENT("Alarms"));
- mir_tstrcpy(window_font_id.name, LPGENT("Window"));
+ mir_tstrcpy(window_font_id.group, LPGENW("Alarms"));
+ mir_tstrcpy(window_font_id.name, LPGENW("Window"));
mir_strcpy(window_font_id.dbSettingsGroup, MODULE);
mir_strcpy(window_font_id.prefix, "FontWindow");
- mir_tstrcpy(window_font_id.backgroundGroup, LPGENT("Alarms"));
- mir_tstrcpy(window_font_id.backgroundName, LPGENT("Background"));
+ mir_tstrcpy(window_font_id.backgroundGroup, LPGENW("Alarms"));
+ mir_tstrcpy(window_font_id.backgroundName, LPGENW("Background"));
window_font_id.flags = 0;
window_font_id.order = 1;
FontRegisterT(&window_font_id);
bk_colour_id.cbSize = sizeof(ColourIDT);
mir_strcpy(bk_colour_id.dbSettingsGroup, MODULE);
- mir_tstrcpy(bk_colour_id.group, LPGENT("Alarms"));
- mir_tstrcpy(bk_colour_id.name, LPGENT("Background"));
+ mir_tstrcpy(bk_colour_id.group, LPGENW("Alarms"));
+ mir_tstrcpy(bk_colour_id.name, LPGENW("Background"));
mir_strcpy(bk_colour_id.setting, "BkColour");
bk_colour_id.defcolour = GetSysColor(COLOR_3DFACE);
bk_colour_id.flags = 0;
diff --git a/plugins/Alarms/src/alarms.cpp b/plugins/Alarms/src/alarms.cpp
index facf4c926a..e5b80405c2 100644
--- a/plugins/Alarms/src/alarms.cpp
+++ b/plugins/Alarms/src/alarms.cpp
@@ -17,7 +17,7 @@ There is no warranty.
#define WMP_PAUSE 32808
#define WMP_NEXT 0x497B
-TCHAR szGamePrefix[] = COMMANDPREFIX;
+wchar_t szGamePrefix[] = COMMANDPREFIX;
CLIST_INTERFACE *pcli;
HINSTANCE hInst;
@@ -65,10 +65,10 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
return DefWindowProc(hWnd, message, wParam, lParam);
}
-void ShowPopup(MCONTACT hContact, const TCHAR *msg)
+void ShowPopup(MCONTACT hContact, const wchar_t *msg)
{
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
- TCHAR *lpzContactName = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *lpzContactName = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0);
POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact; //Be sure to use a GOOD handle, since this will not be checked.
diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp
index 941f69cb2c..a010c5b19d 100644
--- a/plugins/Alarms/src/frame.cpp
+++ b/plugins/Alarms/src/frame.cpp
@@ -138,7 +138,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
GetTextExtentPoint32(dis->hDC,alarm.szTitle,(int)mir_tstrlen(alarm.szTitle),&textSize);
- TCHAR buff[100];
+ wchar_t buff[100];
if (min >= 60)
mir_sntprintf(buff, TranslateT("%dh %dm"), min / 60, min % 60);
else
@@ -148,12 +148,12 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
if (textSize.cx > (dis->rcItem.right - dis->rcItem.left) - (GetSystemMetrics(SM_CXSMICON) + 4) - timeSize.cx - 2 - 4) {
// need elipsis
- TCHAR titlebuff[512];
+ wchar_t titlebuff[512];
size_t len = mir_tstrlen(alarm.szTitle);
if (len > 511) len = 511;
while(len > 0 && textSize.cx > (dis->rcItem.right - dis->rcItem.left) - (GetSystemMetrics(SM_CXSMICON) + 4) - timeSize.cx - 2 - 4) {
len--;
- _tcsncpy(titlebuff, alarm.szTitle, len);
+ wcsncpy(titlebuff, alarm.szTitle, len);
titlebuff[len] = 0;
mir_tstrcat(titlebuff, L"...");
GetTextExtentPoint32(dis->hDC,titlebuff,(int)mir_tstrlen(titlebuff),&textSize);
@@ -453,7 +453,7 @@ void FixMainMenu()
Menu_EnableItem(hMenuShowReminders, false);
else
Menu_ModifyItem(hMenuShowReminders,
- ReminderFrameVisible() ? LPGENT("Hide reminders") : LPGENT("Show reminders"), INVALID_HANDLE_VALUE, 0);
+ ReminderFrameVisible() ? LPGENW("Hide reminders") : LPGENW("Show reminders"), INVALID_HANDLE_VALUE, 0);
}
}
@@ -542,7 +542,7 @@ int CreateFrame()
CreateServiceFunction(MODULE "/ShowHideReminders", ShowHideMenuFunc);
CMenuItem mi;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Alarms"), 0);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Alarms"), 0);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "8A3C1906-4809-4EE8-A32A-858003A2AAA7");
SET_UID(mi, 0x27556ea9, 0xfa19, 0x4c2e, 0xb0, 0xc9, 0x48, 0x2, 0x5c, 0x17, 0xba, 0x5);
diff --git a/plugins/Alarms/src/options.cpp b/plugins/Alarms/src/options.cpp
index 847f377ec5..d92f7a6685 100644
--- a/plugins/Alarms/src/options.cpp
+++ b/plugins/Alarms/src/options.cpp
@@ -26,7 +26,7 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{
ALARM *add_edit_alarm = (ALARM *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
SYSTEMTIME temp_time;
- TCHAR buff[MAX_PATH];
+ wchar_t buff[MAX_PATH];
BOOL bChecked;
switch (msg) {
@@ -43,7 +43,7 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SendDlgItemMessage(hwndDlg, IDC_DAY, CB_SETCURSEL, 0, 0);
for (int i = 1; i <= 31; i++)
- SendDlgItemMessage(hwndDlg, IDC_DAYNUM, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)_itot(i, buff, 10));
+ SendDlgItemMessage(hwndDlg, IDC_DAYNUM, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)_itow(i, buff, 10));
SendDlgItemMessage(hwndDlg, IDC_DAYNUM, CB_SETCURSEL, 0, 0);
@@ -576,7 +576,7 @@ void AddMenuItem()
CMenuItem mi;
if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Alarms"), mi.position);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Alarms"), mi.position);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "24F03563-01BE-4118-8297-E94375A783E7");
}
diff --git a/plugins/Alarms/src/stdafx.h b/plugins/Alarms/src/stdafx.h
index ade5b17c78..c9d5be5729 100644
--- a/plugins/Alarms/src/stdafx.h
+++ b/plugins/Alarms/src/stdafx.h
@@ -35,14 +35,14 @@ extern HANDLE hTopToolbarButton;
typedef struct ALARM_tag {
unsigned short id;
- TCHAR *szTitle;
- TCHAR *szDesc;
+ wchar_t *szTitle;
+ wchar_t *szDesc;
Occurrence occurrence;
BOOL snoozer;
SYSTEMTIME time;
unsigned short action;
- TCHAR *szCommand;
- TCHAR *szCommandParams;
+ wchar_t *szCommand;
+ wchar_t *szCommandParams;
BYTE sound_num;
int flags;
} ALARM;
diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp
index 59d85c22be..7713166680 100644
--- a/plugins/AssocMgr/src/assoclist.cpp
+++ b/plugins/AssocMgr/src/assoclist.cpp
@@ -32,14 +32,14 @@ static HANDLE hServiceAddFile, hServiceRemoveFile, hServiceAddUrl, hServiceRemov
typedef struct
{
char *pszClassName; // class name as used in registry and db
- TCHAR *pszDescription;
+ wchar_t *pszDescription;
HINSTANCE hInstance; // allowed to be NULL for miranda32.exe
WORD nIconResID;
char *pszService;
WORD flags; // set of FTDF_* and UTDF_* flags
char *pszFileExt; // file type: NULL for url type
char *pszMimeType; // file type: allowed to be NULL
- TCHAR *pszVerbDesc; // file type: allowed to be NULL
+ wchar_t *pszVerbDesc; // file type: allowed to be NULL
} ASSOCDATA;
static ASSOCDATA *pAssocList; // protected by csAssocList
@@ -58,7 +58,7 @@ static BOOL IsAssocEnabled(const ASSOCDATA *assoc)
static void SetAssocEnabled(const ASSOCDATA *assoc, BOOL fEnabled)
{
char szSetting[MAXMODULELABELLENGTH];
- TCHAR szDLL[MAX_PATH], szBuf[MAX_PATH];
+ wchar_t szDLL[MAX_PATH], szBuf[MAX_PATH];
mir_snprintf(szSetting, "enabled_%s", assoc->pszClassName);
db_set_b(NULL, "AssocMgr", szSetting, (BYTE)fEnabled);
// dll name for uninstall
@@ -87,7 +87,7 @@ void CleanupAssocEnabledSettings(void)
DBVARIANT dbv;
int i;
HANDLE hFile;
- TCHAR szDLL[MAX_PATH];
+ wchar_t szDLL[MAX_PATH];
char szSetting[MAXMODULELABELLENGTH];
// delete old enabled_* settings if associated plugin no longer present
@@ -264,9 +264,9 @@ static int ReplaceImageListAssocIcon(HIMAGELIST himl, const ASSOCDATA *assoc, in
// the return value does not need to be freed
// this function assumes it has got the csAssocList mutex
-static TCHAR* GetAssocTypeDesc(const ASSOCDATA *assoc)
+static wchar_t* GetAssocTypeDesc(const ASSOCDATA *assoc)
{
- static TCHAR szDesc[32];
+ static wchar_t szDesc[32];
if (assoc->pszFileExt == NULL)
mir_sntprintf(szDesc, L"%hs:", assoc->pszClassName);
else
@@ -283,7 +283,7 @@ static BOOL IsAssocRegistered(const ASSOCDATA *assoc)
fUseMainCmdLine = (assoc->pszService == NULL);
// class
- TCHAR *pszRunCmd = MakeRunCommand(fUseMainCmdLine, !fUseMainCmdLine);
+ wchar_t *pszRunCmd = MakeRunCommand(fUseMainCmdLine, !fUseMainCmdLine);
if (pszRunCmd != NULL)
fSuccess = IsRegClass(assoc->pszClassName, pszRunCmd);
mir_free(pszRunCmd); // does NULL check
@@ -299,7 +299,7 @@ static BOOL IsAssocRegistered(const ASSOCDATA *assoc)
static BOOL EnsureAssocRegistered(const ASSOCDATA *assoc)
{
BOOL fSuccess = FALSE, fIsUrl, fUseMainCmdLine;
- TCHAR *pszIconLoc, *pszRunCmd, *pszDdeCmd, *pszAppFileName;
+ wchar_t *pszIconLoc, *pszRunCmd, *pszDdeCmd, *pszAppFileName;
fIsUrl = (assoc->pszFileExt == NULL);
fUseMainCmdLine = (assoc->pszService == NULL);
@@ -344,13 +344,13 @@ static BOOL EnsureAssocRegistered(const ASSOCDATA *assoc)
static BOOL UnregisterAssoc(const ASSOCDATA *assoc)
{
BOOL fIsUrl, fUseMainCmdLine;
- TCHAR *pszAppFileName;
+ wchar_t *pszAppFileName;
fIsUrl = (assoc->pszFileExt == NULL);
fUseMainCmdLine = (assoc->pszService == NULL);
// class might have been registered by another instance
- TCHAR *pszRunCmd = MakeRunCommand(fUseMainCmdLine, !fUseMainCmdLine);
+ wchar_t *pszRunCmd = MakeRunCommand(fUseMainCmdLine, !fUseMainCmdLine);
if (pszRunCmd != NULL && !IsRegClass(assoc->pszClassName, pszRunCmd)) {
mir_free(pszRunCmd);
return TRUE; // succeed anyway
@@ -393,7 +393,7 @@ typedef struct
// ownership of pszClassName, pszFileExt, pszVerbDesc and pszMimeType is transfered
// to the storage list on success
-static BOOL AddNewAssocItem_Worker(char *pszClassName, const TYPEDESCHEAD *tdh, char *pszFileExt, TCHAR *pszVerbDesc, char *pszMimeType)
+static BOOL AddNewAssocItem_Worker(char *pszClassName, const TYPEDESCHEAD *tdh, char *pszFileExt, wchar_t *pszVerbDesc, char *pszMimeType)
{
ASSOCDATA *pAssocListBuf, *assoc;
@@ -486,7 +486,7 @@ static INT_PTR ServiceAddNewFileType(WPARAM, LPARAM lParam)
char *pszFileExt = mir_strdup(ftd->pszFileExt);
char *pszClassName = MakeFileClassName(ftd->pszFileExt);
if (pszFileExt != NULL && pszClassName != NULL) {
- TCHAR *pszVerbDesc = s2t(ftd->ptszVerbDesc, ftd->flags&FTDF_UNICODE, TRUE); // does NULL check
+ wchar_t *pszVerbDesc = s2t(ftd->ptszVerbDesc, ftd->flags&FTDF_UNICODE, TRUE); // does NULL check
char *pszMimeType = mir_strdup(ftd->pszMimeType); // does NULL check
if (AddNewAssocItem_Worker(pszClassName, (TYPEDESCHEAD*)ftd, pszFileExt, pszVerbDesc, pszMimeType))
// no need to free pszClassName, pszFileExt, pszVerbDesc and pszMimeType,
@@ -546,7 +546,7 @@ static INT_PTR ServiceRemoveUrlType(WPARAM, LPARAM lParam)
/************************* Open Handler ***************************/
-static BOOL InvokeHandler_Worker(const char *pszClassName, const TCHAR *pszParam, INT_PTR *res)
+static BOOL InvokeHandler_Worker(const char *pszClassName, const wchar_t *pszParam, INT_PTR *res)
{
void *pvParam;
char *pszService;
@@ -578,13 +578,13 @@ static BOOL InvokeHandler_Worker(const char *pszClassName, const TCHAR *pszParam
return TRUE;
}
-INT_PTR InvokeFileHandler(const TCHAR *pszFileName)
+INT_PTR InvokeFileHandler(const wchar_t *pszFileName)
{
char *pszClassName, *pszFileExt;
INT_PTR res = CALLSERVICE_NOTFOUND;
// find extension
- TCHAR *p = (TCHAR*)_tcsrchr(pszFileName, _T('.'));
+ wchar_t *p = (wchar_t*)wcsrchr(pszFileName, '.');
if (p != NULL) {
pszFileExt = t2a(p);
if (pszFileExt != NULL) {
@@ -603,7 +603,7 @@ INT_PTR InvokeFileHandler(const TCHAR *pszFileName)
return res;
}
-INT_PTR InvokeUrlHandler(const TCHAR *pszUrl)
+INT_PTR InvokeUrlHandler(const wchar_t *pszUrl)
{
char *pszClassName, *pszProtoPrefix, *p;
INT_PTR res = CALLSERVICE_NOTFOUND;
@@ -611,7 +611,7 @@ INT_PTR InvokeUrlHandler(const TCHAR *pszUrl)
// find prefix
pszProtoPrefix = t2a(pszUrl);
if (pszProtoPrefix != NULL) {
- p = strchr(pszProtoPrefix, _T(':'));
+ p = strchr(pszProtoPrefix, ':');
if (p != NULL) {
*(++p) = 0; // remove trailing :
// class name
@@ -743,7 +743,7 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara
CheckDlgButton(hwndDlg, IDC_ONLYWHILERUNNING, (BOOL)db_get_b(NULL, "AssocMgr", "OnlyWhileRunning", SETTING_ONLYWHILERUNNING_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
// autostart
- TCHAR *pszRunCmd = MakeRunCommand(TRUE, TRUE);
+ wchar_t *pszRunCmd = MakeRunCommand(TRUE, TRUE);
if (pszRunCmd != NULL) {
CheckDlgButton(hwndDlg, IDC_AUTOSTART, IsRegRunEntry(L"MirandaNG", pszRunCmd) ? BST_CHECKED : BST_UNCHECKED);
mir_free(pszRunCmd);
@@ -892,7 +892,7 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara
PostMessage(hwndDlg, M_REFRESH_ICONS, 0, 0);
// autostart
- TCHAR *pszRunCmd = MakeRunCommand(TRUE, TRUE);
+ wchar_t *pszRunCmd = MakeRunCommand(TRUE, TRUE);
fRegFailed = FALSE;
if (pszRunCmd != NULL) {
fEnabled = IsDlgButtonChecked(hwndDlg, IDC_AUTOSTART);
@@ -953,7 +953,7 @@ void InitAssocList(void)
// register open-with app
{
- TCHAR *pszAppFileName, *pszIconLoc, *pszRunCmd;
+ wchar_t *pszAppFileName, *pszIconLoc, *pszRunCmd;
pszIconLoc = MakeIconLocation(NULL, 0);
// miranda32.exe
@@ -1025,7 +1025,7 @@ void UninitAssocList(void)
// unregister open-with app
if (fOnlyWhileRunning) {
- TCHAR *pszAppFileName;
+ wchar_t *pszAppFileName;
// miranda32.exe
pszAppFileName = MakeAppFileName(TRUE);
if (pszAppFileName != NULL)
diff --git a/plugins/AssocMgr/src/assoclist.h b/plugins/AssocMgr/src/assoclist.h
index 5e8806b828..fafbbdf097 100644
--- a/plugins/AssocMgr/src/assoclist.h
+++ b/plugins/AssocMgr/src/assoclist.h
@@ -26,8 +26,8 @@ void CleanupMimeTypeAddedSettings(void);
/* Assoc List Utils */
BOOL IsRegisteredAssocItem(const char *pszClassName);
/* Open Handler */
-INT_PTR InvokeFileHandler(const TCHAR *pszFileName);
-INT_PTR InvokeUrlHandler(const TCHAR *pszUrl);
+INT_PTR InvokeFileHandler(const wchar_t *pszFileName);
+INT_PTR InvokeUrlHandler(const wchar_t *pszUrl);
/* Misc */
void InitAssocList(void);
void UninitAssocList(void);
diff --git a/plugins/AssocMgr/src/dde.cpp b/plugins/AssocMgr/src/dde.cpp
index 35fd6a9e28..aca64350e7 100644
--- a/plugins/AssocMgr/src/dde.cpp
+++ b/plugins/AssocMgr/src/dde.cpp
@@ -32,7 +32,7 @@ static HANDLE hHookModulesLoaded, hHookPreShutdown;
// pszFilePath needs to be allocated using mir_alloc()
static void __stdcall FileActionAsync(void *param)
{
- TCHAR *pszFilePath = (TCHAR*)param;
+ wchar_t *pszFilePath = (wchar_t*)param;
/* invoke main handler */
switch (InvokeFileHandler(pszFilePath)) { /* pszFilePath is always a long path name */
case 0: /* success */ break;
@@ -48,7 +48,7 @@ static void __stdcall FileActionAsync(void *param)
// pszUrl needs to be allocated using mir_alloc()
static void __stdcall UrlActionAsync(void *param)
{
- TCHAR *pszUrl = (TCHAR*)param;
+ wchar_t *pszUrl = (wchar_t*)param;
/* invoke main handler */
switch (InvokeUrlHandler(pszUrl)) {
case 0: /* success */ break;
@@ -68,16 +68,16 @@ static void __stdcall UrlActionAsync(void *param)
// returned pointer points into a substring of ppszString
// returns an empty string if the string does not have enough arguments
-static TCHAR* GetExecuteParam(TCHAR **ppszString)
+static wchar_t* GetExecuteParam(wchar_t **ppszString)
{
- bool fQuoted = (**ppszString == _T('"'));
- TCHAR *pszParam = *ppszString;
+ bool fQuoted = (**ppszString == '"');
+ wchar_t *pszParam = *ppszString;
if (fQuoted)
pszParam++;
- TCHAR *p = _tcschr(pszParam, (TCHAR)(fQuoted ? _T('"') : _T(',')));
+ wchar_t *p = wcschr(pszParam, (wchar_t)(fQuoted ? '"' : ','));
if (p != NULL) {
*(p++) = 0;
- if (fQuoted && *p == _T(',')) p++;
+ if (fQuoted && *p == ',') p++;
}
else p = &pszParam[mir_tstrlen(pszParam)];
*ppszString = p;
@@ -108,10 +108,10 @@ static LRESULT CALLBACK DdeMessageWindow(HWND hwnd, UINT msg, WPARAM wParam, LPA
if (UnpackDDElParam(msg, lParam, NULL, (PUINT_PTR)&hCommand)) {
/* ANSI execute command can't happen for shell */
if (IsWindowUnicode((HWND)wParam)) {
- TCHAR *pszCommand = (TCHAR*)GlobalLock(hCommand);
+ wchar_t *pszCommand = (wchar_t*)GlobalLock(hCommand);
if (pszCommand != NULL) {
- TCHAR *pszAction = GetExecuteParam(&pszCommand);
- TCHAR *pszArg = GetExecuteParam(&pszCommand);
+ wchar_t *pszAction = GetExecuteParam(&pszCommand);
+ wchar_t *pszArg = GetExecuteParam(&pszCommand);
if (pszArg != NULL) {
/* we are inside miranda here, we make it async so the shell does
* not timeout regardless what the plugins try to do. */
@@ -161,14 +161,14 @@ static LRESULT CALLBACK DdeMessageWindow(HWND hwnd, UINT msg, WPARAM wParam, LPA
}
// CloseHandle() the return value
-static HANDLE StartupMainProcess(TCHAR *pszDatabasePath)
+static HANDLE StartupMainProcess(wchar_t *pszDatabasePath)
{
- TCHAR *p, szPath[MAX_PATH];
+ wchar_t *p, szPath[MAX_PATH];
/* we are inside RunDll32 here */
if (!GetModuleFileName(hInst, szPath, _countof(szPath))) return NULL;
- p = _tcsrchr(szPath, _T('\\'));
- if (p != NULL) { *p = 0; p = _tcsrchr(szPath, _T('\\')); }
+ p = wcsrchr(szPath, '\\');
+ if (p != NULL) { *p = 0; p = wcsrchr(szPath, '\\'); }
if (p == NULL) return NULL;
mir_tstrcpy(++p, L"miranda32.exe");
@@ -187,7 +187,7 @@ extern "C" {
#endif
// entry point for RunDll32, this is also WaitForDDEW
- __declspec(dllexport) void CALLBACK WaitForDDE(HWND, HINSTANCE, TCHAR *pszCmdLine, int)
+ __declspec(dllexport) void CALLBACK WaitForDDE(HWND, HINSTANCE, wchar_t *pszCmdLine, int)
{
HANDLE pHandles[2];
DWORD dwTick;
diff --git a/plugins/AssocMgr/src/main.cpp b/plugins/AssocMgr/src/main.cpp
index 516a933cec..4f0c116c36 100644
--- a/plugins/AssocMgr/src/main.cpp
+++ b/plugins/AssocMgr/src/main.cpp
@@ -45,13 +45,13 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
return TRUE;
}
-static void InstallFile(const TCHAR *pszFileName,const TCHAR *pszDestSubDir)
+static void InstallFile(const wchar_t *pszFileName,const wchar_t *pszDestSubDir)
{
- TCHAR szFileFrom[MAX_PATH+1],szFileTo[MAX_PATH+1];
+ wchar_t szFileFrom[MAX_PATH+1],szFileTo[MAX_PATH+1];
if (!GetModuleFileName(hInst, szFileFrom, _countof(szFileFrom) - (int)mir_tstrlen(pszFileName)))
return;
- TCHAR *p = _tcsrchr(szFileFrom,_T('\\'));
+ wchar_t *p = wcsrchr(szFileFrom,'\\');
if (p != NULL)
*(++p) = 0;
mir_tstrcat(szFileFrom,pszFileName); /* buffer safe */
@@ -63,7 +63,7 @@ static void InstallFile(const TCHAR *pszFileName,const TCHAR *pszDestSubDir)
if (!GetModuleFileName(NULL, szFileTo, _countof(szFileTo)-(int)mir_tstrlen(pszDestSubDir)-(int)mir_tstrlen(pszFileName)))
return;
- p = _tcsrchr(szFileTo,_T('\\'));
+ p = wcsrchr(szFileTo,'\\');
if (p)
*(++p)=0;
mir_tstrcat(szFileTo,pszDestSubDir); /* buffer safe */
diff --git a/plugins/AssocMgr/src/reg.cpp b/plugins/AssocMgr/src/reg.cpp
index 6822fdbddc..3f079b7810 100644
--- a/plugins/AssocMgr/src/reg.cpp
+++ b/plugins/AssocMgr/src/reg.cpp
@@ -29,7 +29,7 @@ extern HINSTANCE hInst;
static __inline LONG regchk(LONG res, const char *pszFunc, const void *pszInfo, BOOL fInfoUnicode, const char *pszFile, unsigned int nLine)
{
if (res != ERROR_SUCCESS && res != ERROR_FILE_NOT_FOUND && res != ERROR_NO_MORE_ITEMS) {
- TCHAR szMsg[1024], *pszInfo2;
+ wchar_t szMsg[1024], *pszInfo2;
char *pszErr;
pszErr = GetWinErrorDescription(res);
pszInfo2 = s2t(pszInfo, fInfoUnicode, FALSE); /* does NULL check */
@@ -123,13 +123,13 @@ static BOOL IsFileClassName(char *pszClassName, char **ppszFileExt)
}
// mir_free() the return value
-TCHAR *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile)
+wchar_t *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile)
{
- TCHAR szDbFile[MAX_PATH], szExe[MAX_PATH], *pszFmt;
+ wchar_t szDbFile[MAX_PATH], szExe[MAX_PATH], *pszFmt;
if (fFixedDbProfile) {
if ( CallService(MS_DB_GETPROFILENAMET, _countof(szDbFile), (LPARAM)szDbFile))
return NULL;
- TCHAR *p = _tcsrchr(szDbFile, '.');
+ wchar_t *p = wcsrchr(szDbFile, '.');
if (p)
*p = 0;
}
@@ -148,31 +148,31 @@ TCHAR *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile)
GetShortPathName(szExe, szExe, _countof(szExe));
/* surround by quotes if failed */
size_t len = mir_tstrlen(szExe);
- if ( _tcschr(szExe,_T(' ')) != NULL && (len+2) < _countof(szExe)) {
- memmove(szExe, szExe+1, (len+1)*sizeof(TCHAR));
- szExe[len+2] = szExe[0] = _T('\"');
+ if ( wcschr(szExe,' ') != NULL && (len+2) < _countof(szExe)) {
+ memmove(szExe, szExe+1, (len+1)*sizeof(wchar_t));
+ szExe[len+2] = szExe[0] = '\"';
szExe[len+3] = 0;
}
}
- TCHAR tszBuffer[1024];
+ wchar_t tszBuffer[1024];
mir_sntprintf(tszBuffer, pszFmt, szExe, szDbFile);
return mir_tstrdup(tszBuffer);
}
-static BOOL IsValidRunCommand(const TCHAR *pszRunCmd)
+static BOOL IsValidRunCommand(const wchar_t *pszRunCmd)
{
- TCHAR *buf,*pexe,*pargs;
- TCHAR szFullExe[MAX_PATH],*pszFilePart;
- buf=mir_tstrcpy((TCHAR*)_alloca((mir_tstrlen(pszRunCmd)+1)*sizeof(TCHAR)),pszRunCmd);
+ wchar_t *buf,*pexe,*pargs;
+ wchar_t szFullExe[MAX_PATH],*pszFilePart;
+ buf=mir_tstrcpy((wchar_t*)_alloca((mir_tstrlen(pszRunCmd)+1)*sizeof(wchar_t)),pszRunCmd);
/* split into executable path and arguments */
- if (buf[0]==_T('\"')) {
- pargs=_tcschr(&buf[1],_T('\"'));
+ if (buf[0]=='\"') {
+ pargs=wcschr(&buf[1],'\"');
if (pargs!=NULL) *(pargs++)=0;
pexe=&buf[1];
- if (*pargs==_T(' ')) ++pargs;
+ if (*pargs==' ') ++pargs;
} else {
- pargs=_tcschr(buf,_T(' '));
+ pargs=wcschr(buf,' ');
if (pargs!=NULL) *pargs=0;
pexe=buf;
}
@@ -180,12 +180,12 @@ static BOOL IsValidRunCommand(const TCHAR *pszRunCmd)
if (pszFilePart!=NULL)
if (!mir_tstrcmpi(pszFilePart,L"rundll32.exe") || !mir_tstrcmpi(pszFilePart,L"rundll.exe")) {
/* split into dll path and arguments */
- if (pargs[0]==_T('\"')) {
+ if (pargs[0]=='\"') {
++pargs;
- pexe=_tcschr(&pargs[1],_T('\"'));
+ pexe=wcschr(&pargs[1],'\"');
if (pexe!=NULL) *pexe=0;
} else {
- pexe=_tcschr(pargs,_T(','));
+ pexe=wcschr(pargs,',');
if (pexe!=NULL) *pexe=0;
}
return SearchPath(NULL,pargs,L".dll",0,NULL,NULL)!=0;
@@ -196,12 +196,12 @@ static BOOL IsValidRunCommand(const TCHAR *pszRunCmd)
}
// mir_free() the return value
-TCHAR *MakeIconLocation(HMODULE hModule,WORD nIconResID)
+wchar_t *MakeIconLocation(HMODULE hModule,WORD nIconResID)
{
- TCHAR szModule[MAX_PATH],*pszIconLoc=NULL;
+ wchar_t szModule[MAX_PATH],*pszIconLoc=NULL;
int cch;
if ((cch=GetModuleFileName(hModule,szModule,_countof(szModule))) != 0) {
- pszIconLoc=(TCHAR*)mir_alloc((cch+=8)*sizeof(TCHAR));
+ pszIconLoc=(wchar_t*)mir_alloc((cch+=8)*sizeof(wchar_t));
if (pszIconLoc!=NULL)
mir_sntprintf(pszIconLoc, cch, L"%s,%i", szModule, -(int)nIconResID); /* id may be 0, buffer safe */
}
@@ -209,11 +209,11 @@ TCHAR *MakeIconLocation(HMODULE hModule,WORD nIconResID)
}
// mir_free() the return value
-TCHAR *MakeAppFileName(BOOL fMirExe)
+wchar_t *MakeAppFileName(BOOL fMirExe)
{
- TCHAR szExe[MAX_PATH],*psz;
+ wchar_t szExe[MAX_PATH],*psz;
if (GetModuleFileName(fMirExe?NULL:hInst,szExe,_countof(szExe))) {
- psz=_tcsrchr(szExe,_T('\\'));
+ psz=wcsrchr(szExe,'\\');
if (psz!=NULL) ++psz;
else psz=szExe;
return mir_tstrdup(psz);
@@ -223,15 +223,15 @@ TCHAR *MakeAppFileName(BOOL fMirExe)
/************************* Helpers ********************************/
-static LONG DeleteRegSubTree(HKEY hKey,const TCHAR *pszSubKey)
+static LONG DeleteRegSubTree(HKEY hKey,const wchar_t *pszSubKey)
{
LONG res;
DWORD nMaxSubKeyLen,cchSubKey;
- TCHAR *pszSubKeyBuf;
+ wchar_t *pszSubKeyBuf;
HKEY hSubKey;
if ((res=RegOpenKeyEx(hKey,pszSubKey,0,KEY_QUERY_VALUE|KEY_ENUMERATE_SUB_KEYS|DELETE,&hSubKey))==ERROR_SUCCESS) {
if ((res=RegQueryInfoKey(hSubKey,NULL,NULL,NULL,NULL,&nMaxSubKeyLen,NULL,NULL,NULL,NULL,NULL,NULL))==ERROR_SUCCESS) {
- pszSubKeyBuf=(TCHAR*)mir_alloc((nMaxSubKeyLen+1)*sizeof(TCHAR));
+ pszSubKeyBuf=(wchar_t*)mir_alloc((nMaxSubKeyLen+1)*sizeof(wchar_t));
if (pszSubKeyBuf==NULL) res=ERROR_NOT_ENOUGH_MEMORY;
while(!res) {
cchSubKey=nMaxSubKeyLen+1;
@@ -248,42 +248,42 @@ static LONG DeleteRegSubTree(HKEY hKey,const TCHAR *pszSubKey)
}
// hMainKey must have been opened with KEY_CREATE_SUB_KEY access right
-static LONG SetRegSubKeyStrDefValue(HKEY hMainKey,const TCHAR *pszSubKey,const TCHAR *pszVal)
+static LONG SetRegSubKeyStrDefValue(HKEY hMainKey,const wchar_t *pszSubKey,const wchar_t *pszVal)
{
HKEY hSubKey;
LONG res=RegCreateKeyEx(hMainKey,pszSubKey,0,NULL,0,KEY_SET_VALUE|KEY_QUERY_VALUE,NULL,&hSubKey,NULL);
if (!res) {
- res=RegSetValueEx(hSubKey,NULL,0,REG_SZ,(BYTE*)pszVal,(int)(mir_tstrlen(pszVal)+1)*sizeof(TCHAR));
+ res=RegSetValueEx(hSubKey,NULL,0,REG_SZ,(BYTE*)pszVal,(int)(mir_tstrlen(pszVal)+1)*sizeof(wchar_t));
RegCloseKey(hSubKey);
}
return res;
}
// hKey must have been opened with KEY_SET_VALUE access right
-static void SetRegStrPrefixValue(HKEY hKey,const TCHAR *pszValPrefix,const TCHAR *pszVal)
+static void SetRegStrPrefixValue(HKEY hKey,const wchar_t *pszValPrefix,const wchar_t *pszVal)
{
- size_t dwSize = (mir_tstrlen(pszVal)+mir_tstrlen(pszValPrefix)+1)*sizeof(TCHAR);
- TCHAR *pszStr = (TCHAR*)_alloca(dwSize);
+ size_t dwSize = (mir_tstrlen(pszVal)+mir_tstrlen(pszValPrefix)+1)*sizeof(wchar_t);
+ wchar_t *pszStr = (wchar_t*)_alloca(dwSize);
mir_tstrcat(mir_tstrcpy(pszStr, pszValPrefix), pszVal); /* buffer safe */
RegSetValueEx(hKey, NULL, 0, REG_SZ, (BYTE*)pszStr, (int)dwSize);
}
// hKey must have been opened with KEY_QUERY_VALUE access right
// mir_free() the return value
-static TCHAR *GetRegStrValue(HKEY hKey,const TCHAR *pszValName)
+static wchar_t *GetRegStrValue(HKEY hKey,const wchar_t *pszValName)
{
- TCHAR *pszVal,*pszVal2;
+ wchar_t *pszVal,*pszVal2;
DWORD dwSize,dwType;
/* get size */
- if (!RegQueryValueEx(hKey,pszValName,NULL,NULL,NULL,&dwSize) && dwSize>sizeof(TCHAR)) {
- pszVal=(TCHAR*)mir_alloc(dwSize+sizeof(TCHAR));
+ if (!RegQueryValueEx(hKey,pszValName,NULL,NULL,NULL,&dwSize) && dwSize>sizeof(wchar_t)) {
+ pszVal=(wchar_t*)mir_alloc(dwSize+sizeof(wchar_t));
if (pszVal!=NULL) {
/* get value */
if (!RegQueryValueEx(hKey,pszValName,NULL,&dwType,(BYTE*)pszVal,&dwSize)) {
- pszVal[dwSize/sizeof(TCHAR)]=0;
+ pszVal[dwSize/sizeof(wchar_t)]=0;
if (dwType==REG_EXPAND_SZ) {
dwSize=MAX_PATH;
- pszVal2=(TCHAR*)mir_alloc(dwSize*sizeof(TCHAR));
+ pszVal2=(wchar_t*)mir_alloc(dwSize*sizeof(wchar_t));
if (ExpandEnvironmentStrings(pszVal,pszVal2,dwSize)) {
mir_free(pszVal);
return pszVal2;
@@ -299,10 +299,10 @@ static TCHAR *GetRegStrValue(HKEY hKey,const TCHAR *pszValName)
}
// hKey must have been opened with KEY_QUERY_VALUE access right
-static BOOL IsRegStrValue(HKEY hKey,const TCHAR *pszValName,const TCHAR *pszCmpVal)
+static BOOL IsRegStrValue(HKEY hKey,const wchar_t *pszValName,const wchar_t *pszCmpVal)
{
BOOL fSame=FALSE;
- TCHAR *pszVal=GetRegStrValue(hKey,pszValName);
+ wchar_t *pszVal=GetRegStrValue(hKey,pszValName);
if (pszVal!=NULL) {
fSame=!mir_tstrcmp(pszVal,pszCmpVal);
mir_free(pszVal);
@@ -311,11 +311,11 @@ static BOOL IsRegStrValue(HKEY hKey,const TCHAR *pszValName,const TCHAR *pszCmpV
}
// hKey must have been opened with KEY_QUERY_VALUE access right
-static BOOL IsRegStrValueA(HKEY hKey,const TCHAR *pszValName,const char *pszCmpVal)
+static BOOL IsRegStrValueA(HKEY hKey,const wchar_t *pszValName,const char *pszCmpVal)
{
BOOL fSame=FALSE;
char *pszValA;
- TCHAR *pszVal=GetRegStrValue(hKey,pszValName);
+ wchar_t *pszVal=GetRegStrValue(hKey,pszValName);
if (pszVal!=NULL) {
pszValA=t2a(pszVal);
if (pszValA!=NULL)
@@ -373,7 +373,7 @@ static void BackupRegTree_Worker(HKEY hKey,const char *pszSubKey,struct BackupRe
DWORD index,cchName,dwType,cbData;
BYTE *pData;
char *pszName;
- register TCHAR *ptszName;
+ register wchar_t *ptszName;
DWORD nDbPrefixLen;
if ((res=RegOpenKeyExA(hKey,pszSubKey,0,KEY_QUERY_VALUE|KEY_ENUMERATE_SUB_KEYS,&hKey))==ERROR_SUCCESS) {
if ((res=RegQueryInfoKey(hKey,NULL,NULL,NULL,NULL,&nMaxSubKeyLen,NULL,NULL,&nMaxValNameLen,&nMaxValSize,NULL,NULL))==ERROR_SUCCESS) {
@@ -472,7 +472,7 @@ static LONG RestoreRegTree(HKEY hKey,const char *pszSubKey,const char *pszDbPref
/* key hierachy */
pkeys=mir_strcpy((char*)_alloca(mir_strlen(pszSuffix)+1),pszSuffix);
pnext=pkeys;
- while((pnext=strchr(pnext+1,_T('\\')))!=NULL) pslash=pnext;
+ while((pnext=strchr(pnext+1,'\\'))!=NULL) pslash=pnext;
if (pslash!=NULL) {
/* create subkey */
*(pslash++)=0;
@@ -581,7 +581,7 @@ void CleanupRegTreeBackupSettings(void)
// pszIconLoc, pszVerbDesc and pszDdeCmd are allowed to be NULL
// call GetLastError() on error to get more error details
-BOOL AddRegClass(const char *pszClassName,const TCHAR *pszTypeDescription,const TCHAR *pszIconLoc,const TCHAR *pszAppName,const TCHAR *pszRunCmd,const TCHAR *pszDdeCmd,const TCHAR *pszDdeApp,const TCHAR *pszDdeTopic,const TCHAR *pszVerbDesc,BOOL fBrowserAutoOpen,BOOL fUrlProto,BOOL fIsShortcut)
+BOOL AddRegClass(const char *pszClassName,const wchar_t *pszTypeDescription,const wchar_t *pszIconLoc,const wchar_t *pszAppName,const wchar_t *pszRunCmd,const wchar_t *pszDdeCmd,const wchar_t *pszDdeApp,const wchar_t *pszDdeTopic,const wchar_t *pszVerbDesc,BOOL fBrowserAutoOpen,BOOL fUrlProto,BOOL fIsShortcut)
{
LONG res;
HKEY hRootKey,hClassKey,hShellKey,hVerbKey,hDdeKey;
@@ -601,7 +601,7 @@ BOOL AddRegClass(const char *pszClassName,const TCHAR *pszTypeDescription,const
if (fUrlProto) BackupRegTree(hRootKey,pszClassName,"bak_");
/* type description */
if (fUrlProto) SetRegStrPrefixValue(hClassKey,L"URL:",pszTypeDescription);
- else RegSetValueEx(hClassKey,NULL,0,REG_SZ,(BYTE*)pszTypeDescription,(int)(mir_tstrlen(pszTypeDescription)+1)*sizeof(TCHAR));
+ else RegSetValueEx(hClassKey,NULL,0,REG_SZ,(BYTE*)pszTypeDescription,(int)(mir_tstrlen(pszTypeDescription)+1)*sizeof(wchar_t));
/* default icon */
if (pszIconLoc!=NULL) SetRegSubKeyStrDefValue(hClassKey,L"DefaultIcon",pszIconLoc);
/* url protocol */
@@ -624,21 +624,21 @@ BOOL AddRegClass(const char *pszClassName,const TCHAR *pszTypeDescription,const
/* shell */
if ((res=RegCreateKeyEx(hClassKey,L"shell",0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hShellKey,NULL))==ERROR_SUCCESS) {
/* default verb (when empty "open" is used) */
- RegSetValueEx(hShellKey,NULL,0,REG_SZ,(BYTE*)L"open",5*sizeof(TCHAR));
+ RegSetValueEx(hShellKey,NULL,0,REG_SZ,(BYTE*)L"open",5*sizeof(wchar_t));
/* verb */
if ((res=RegCreateKeyEx(hShellKey,L"open",0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY|DELETE,NULL,&hVerbKey,NULL))==ERROR_SUCCESS) {
/* verb description */
if (pszVerbDesc==NULL) RegDeleteValue(hVerbKey,NULL);
- else RegSetValueEx(hVerbKey,NULL,0,REG_SZ,(BYTE*)pszVerbDesc,(int)(mir_tstrlen(pszVerbDesc)+1)*sizeof(TCHAR));
+ else RegSetValueEx(hVerbKey,NULL,0,REG_SZ,(BYTE*)pszVerbDesc,(int)(mir_tstrlen(pszVerbDesc)+1)*sizeof(wchar_t));
/* friendly appname (mui string) */
- RegSetValueEx(hVerbKey,L"FriendlyAppName",0,REG_SZ,(BYTE*)pszAppName,(int)(mir_tstrlen(pszAppName)+1)*sizeof(TCHAR));
+ RegSetValueEx(hVerbKey,L"FriendlyAppName",0,REG_SZ,(BYTE*)pszAppName,(int)(mir_tstrlen(pszAppName)+1)*sizeof(wchar_t));
/* command */
SetRegSubKeyStrDefValue(hVerbKey,L"command",pszRunCmd);
/* ddeexec */
if (pszDdeCmd!=NULL) {
if (!RegCreateKeyEx(hVerbKey,L"ddeexec",0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY|DELETE,NULL,&hDdeKey,NULL)) {
/* command */
- RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(int)(mir_tstrlen(pszDdeCmd)+1)*sizeof(TCHAR));
+ RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(int)(mir_tstrlen(pszDdeCmd)+1)*sizeof(wchar_t));
/* application */
SetRegSubKeyStrDefValue(hDdeKey,L"application",pszDdeApp);
/* topic */
@@ -679,7 +679,7 @@ BOOL RemoveRegClass(const char *pszClassName)
{
LONG res;
HKEY hRootKey,hClassKey,hShellKey,hVerbKey;
- TCHAR *ptszClassName,*ptszPrevRunCmd;
+ wchar_t *ptszClassName,*ptszPrevRunCmd;
/* try to open interactive user's classes key */
if (RegOpenKeyEx(HKEY_CURRENT_USER,L"Software\\Classes",0,DELETE,&hRootKey))
@@ -729,7 +729,7 @@ BOOL RemoveRegClass(const char *pszClassName)
* registered and thus be overwritten by multiple applications.
*/
-BOOL IsRegClass(const char *pszClassName,const TCHAR *pszRunCmd)
+BOOL IsRegClass(const char *pszClassName,const wchar_t *pszRunCmd)
{
BOOL fSuccess=FALSE;
HKEY hClassKey,hShellKey,hVerbKey,hCmdKey;
@@ -766,7 +766,7 @@ HICON LoadRegClassSmallIcon(const char *pszClassName)
{
HICON hIcon=NULL;
HKEY hClassKey,hIconKey;
- TCHAR *pszIconLoc,*p;
+ wchar_t *pszIconLoc,*p;
/* using the merged view classes key for reading */
/* class */
@@ -776,10 +776,10 @@ HICON LoadRegClassSmallIcon(const char *pszClassName)
/* extract icon */
pszIconLoc=GetRegStrValue(hIconKey,NULL);
if (pszIconLoc!=NULL) {
- p=_tcsrchr(pszIconLoc,_T(','));
+ p=wcsrchr(pszIconLoc,',');
if (p!=NULL) {
*(p++)=0;
- ExtractIconEx(pszIconLoc,_ttoi(p),NULL,&hIcon,1);
+ ExtractIconEx(pszIconLoc,_wtoi(p),NULL,&hIcon,1);
}
mir_free(pszIconLoc);
}
@@ -822,7 +822,7 @@ BOOL AddRegFileExt(const char *pszFileExt,const char *pszClassName,const char *p
/* remove any no-open flag */
RegDeleteValue(hExtKey,L"NoOpen");
/* open with progids */
- TCHAR *pszPrevClass=GetRegStrValue(hExtKey,NULL);
+ wchar_t *pszPrevClass=GetRegStrValue(hExtKey,NULL);
if (pszPrevClass!=NULL && !IsRegStrValueA(hExtKey,NULL,pszClassName))
if (!RegCreateKeyEx(hExtKey,L"OpenWithProgids",0,NULL,0,KEY_SET_VALUE,NULL,&hOpenWithKey,NULL)) {
/* previous class (backup) */
@@ -835,7 +835,7 @@ BOOL AddRegFileExt(const char *pszFileExt,const char *pszClassName,const char *p
/* mime type e.g. "application/x-icq" */
if (pszMimeType!=NULL) RegSetValueExA(hExtKey, "Content Type", 0, REG_SZ, (BYTE*)pszMimeType, (int)mir_strlen(pszMimeType)+1);
/* perceived type e.g. text (WinXP+) */
- if (fIsText) RegSetValueEx(hExtKey,L"PerceivedType",0,REG_SZ,(BYTE*)L"text",5*sizeof(TCHAR));
+ if (fIsText) RegSetValueEx(hExtKey,L"PerceivedType",0,REG_SZ,(BYTE*)L"text",5*sizeof(wchar_t));
RegCloseKey(hExtKey);
}
@@ -848,7 +848,7 @@ void RemoveRegFileExt(const char *pszFileExt,const char *pszClassName)
{
HKEY hRootKey,hExtKey,hSubKey;
DWORD nOpenWithCount;
- TCHAR *pszPrevClassName=NULL;
+ wchar_t *pszPrevClassName=NULL;
BOOL fRestored=FALSE;
/* try to open interactive user's classes key */
@@ -980,7 +980,7 @@ void RemoveRegMimeType(const char *pszMimeType,const char *pszFileExt)
*/
// pszDdeCmd is allowed to be NULL
-void AddRegOpenWith(const TCHAR *pszAppFileName,BOOL fAllowOpenWith,const TCHAR *pszAppName,const TCHAR *pszIconLoc,const TCHAR *pszRunCmd,const TCHAR *pszDdeCmd,const TCHAR *pszDdeApp,const TCHAR *pszDdeTopic)
+void AddRegOpenWith(const wchar_t *pszAppFileName,BOOL fAllowOpenWith,const wchar_t *pszAppName,const wchar_t *pszIconLoc,const wchar_t *pszRunCmd,const wchar_t *pszDdeCmd,const wchar_t *pszDdeApp,const wchar_t *pszDdeTopic)
{
HKEY hRootKey,hAppsKey,hExeKey,hShellKey,hVerbKey,hDdeKey;
@@ -993,7 +993,7 @@ void AddRegOpenWith(const TCHAR *pszAppFileName,BOOL fAllowOpenWith,const TCHAR
/* filename */
if (!RegCreateKeyEx(hAppsKey,pszAppFileName,0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hExeKey,NULL)) {
/* appname */
- RegSetValueEx(hExeKey,NULL,0,REG_SZ,(BYTE*)pszAppName,(int)(mir_tstrlen(pszAppName)+1)*sizeof(TCHAR));
+ RegSetValueEx(hExeKey,NULL,0,REG_SZ,(BYTE*)pszAppName,(int)(mir_tstrlen(pszAppName)+1)*sizeof(wchar_t));
/* no open-with flag */
if (fAllowOpenWith) RegDeleteValue(hExeKey,L"NoOpenWith");
else RegSetValueEx(hExeKey,L"NoOpenWith",0,REG_SZ,NULL,0);
@@ -1002,18 +1002,18 @@ void AddRegOpenWith(const TCHAR *pszAppFileName,BOOL fAllowOpenWith,const TCHAR
/* shell */
if (!RegCreateKeyEx(hExeKey,L"shell",0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hShellKey,NULL)) {
/* default verb (when empty "open" is used) */
- RegSetValueEx(hShellKey,NULL,0,REG_SZ,(BYTE*)L"open",5*sizeof(TCHAR));
+ RegSetValueEx(hShellKey,NULL,0,REG_SZ,(BYTE*)L"open",5*sizeof(wchar_t));
/* verb */
if (!RegCreateKeyEx(hShellKey,L"open",0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hVerbKey,NULL)) {
/* friendly appname (mui string) */
- RegSetValueEx(hVerbKey,L"FriendlyAppName",0,REG_SZ,(BYTE*)pszAppName,(int)(mir_tstrlen(pszAppName)+1)*sizeof(TCHAR));
+ RegSetValueEx(hVerbKey,L"FriendlyAppName",0,REG_SZ,(BYTE*)pszAppName,(int)(mir_tstrlen(pszAppName)+1)*sizeof(wchar_t));
/* command */
SetRegSubKeyStrDefValue(hVerbKey,L"command",pszRunCmd);
/* ddeexec */
if (pszDdeCmd!=NULL)
if (!RegCreateKeyEx(hVerbKey,L"ddeexec",0,NULL,0,KEY_SET_VALUE|KEY_CREATE_SUB_KEY,NULL,&hDdeKey,NULL)) {
/* command */
- RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(int)(mir_tstrlen(pszDdeCmd)+1)*sizeof(TCHAR));
+ RegSetValueEx(hDdeKey,NULL,0,REG_SZ,(BYTE*)pszDdeCmd,(int)(mir_tstrlen(pszDdeCmd)+1)*sizeof(wchar_t));
/* application */
SetRegSubKeyStrDefValue(hDdeKey,L"application",pszDdeApp);
/* topic */
@@ -1033,7 +1033,7 @@ void AddRegOpenWith(const TCHAR *pszAppFileName,BOOL fAllowOpenWith,const TCHAR
RegCloseKey(hRootKey);
}
-void RemoveRegOpenWith(const TCHAR *pszAppFileName)
+void RemoveRegOpenWith(const wchar_t *pszAppFileName)
{
HKEY hRootKey,hAppsKey,hExeKey,hShellKey,hVerbKey,hDdeKey;
@@ -1084,7 +1084,7 @@ void RemoveRegOpenWith(const TCHAR *pszAppFileName)
* Tell the "Open With..." dialog we support a given file extension.
*/
-void AddRegOpenWithExtEntry(const TCHAR *pszAppFileName,const char *pszFileExt,const TCHAR *pszFileDesc)
+void AddRegOpenWithExtEntry(const wchar_t *pszAppFileName,const char *pszFileExt,const wchar_t *pszFileDesc)
{
HKEY hRootKey,hAppsKey,hExeKey,hTypesKey;
@@ -1098,10 +1098,10 @@ void AddRegOpenWithExtEntry(const TCHAR *pszAppFileName,const char *pszFileExt,c
if (!RegOpenKeyEx(hAppsKey,pszAppFileName,0,KEY_CREATE_SUB_KEY,&hExeKey)) {
/* supported types */
if (!RegCreateKeyEx(hExeKey,L"SupportedTypes",0,NULL,0,KEY_SET_VALUE,NULL,&hTypesKey,NULL)) {
- TCHAR *ptszFileExt;
+ wchar_t *ptszFileExt;
ptszFileExt=a2t(pszFileExt);
if (ptszFileExt!=NULL)
- RegSetValueEx(hTypesKey,ptszFileExt,0,REG_SZ,(BYTE*)pszFileDesc,(int)(mir_tstrlen(pszFileDesc)+1)*sizeof(TCHAR));
+ RegSetValueEx(hTypesKey,ptszFileExt,0,REG_SZ,(BYTE*)pszFileDesc,(int)(mir_tstrlen(pszFileDesc)+1)*sizeof(wchar_t));
mir_free(ptszFileExt); /* does NULL check */
RegCloseKey(hTypesKey);
}
@@ -1114,7 +1114,7 @@ void AddRegOpenWithExtEntry(const TCHAR *pszAppFileName,const char *pszFileExt,c
RegCloseKey(hRootKey);
}
-void RemoveRegOpenWithExtEntry(const TCHAR *pszAppFileName,const char *pszFileExt)
+void RemoveRegOpenWithExtEntry(const wchar_t *pszAppFileName,const char *pszFileExt)
{
HKEY hRootKey,hAppsKey,hExeKey,hTypesKey;
@@ -1146,7 +1146,7 @@ void RemoveRegOpenWithExtEntry(const TCHAR *pszAppFileName,const char *pszFileEx
* Add Miranda to the autostart list in the registry.
*/
-BOOL AddRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd)
+BOOL AddRegRunEntry(const wchar_t *pszAppName,const wchar_t *pszRunCmd)
{
BOOL fSuccess=FALSE;
HKEY hRunKey;
@@ -1154,13 +1154,13 @@ BOOL AddRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd)
/* run */
if (!RegCreateKeyEx(HKEY_CURRENT_USER,L"Software\\Microsoft\\Windows\\CurrentVersion\\Run",0,NULL,0,KEY_SET_VALUE,NULL,&hRunKey,NULL)) {
/* appname */
- fSuccess=!RegSetValueEx(hRunKey,pszAppName,0,REG_SZ,(BYTE*)pszRunCmd,(int)(mir_tstrlen(pszRunCmd)+1)*sizeof(TCHAR));
+ fSuccess=!RegSetValueEx(hRunKey,pszAppName,0,REG_SZ,(BYTE*)pszRunCmd,(int)(mir_tstrlen(pszRunCmd)+1)*sizeof(wchar_t));
RegCloseKey(hRunKey);
}
return fSuccess;
}
-BOOL RemoveRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd)
+BOOL RemoveRegRunEntry(const wchar_t *pszAppName,const wchar_t *pszRunCmd)
{
HKEY hRunKey;
@@ -1179,7 +1179,7 @@ BOOL RemoveRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd)
* Check if the autostart item belongs to the current instance of Miranda.
*/
-BOOL IsRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd)
+BOOL IsRegRunEntry(const wchar_t *pszAppName,const wchar_t *pszRunCmd)
{
BOOL fState=FALSE;
HKEY hRunKey;
diff --git a/plugins/AssocMgr/src/reg.h b/plugins/AssocMgr/src/reg.h
index f593221b8e..69e3810ecd 100644
--- a/plugins/AssocMgr/src/reg.h
+++ b/plugins/AssocMgr/src/reg.h
@@ -22,9 +22,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* Backup to DB */
void CleanupRegTreeBackupSettings(void);
/* Class */
-BOOL AddRegClass(const char *pszClassName,const TCHAR *pszTypeDescription,const TCHAR *pszIconLoc,const TCHAR *pszAppName,const TCHAR *pszRunCmd,const TCHAR *pszDdeCmd,const TCHAR *pszDdeApp,const TCHAR *pszDdeTopic,const TCHAR *pszVerbDesc,BOOL fBrowserAutoOpen,BOOL fUrlProto,BOOL fIsShortcut);
+BOOL AddRegClass(const char *pszClassName,const wchar_t *pszTypeDescription,const wchar_t *pszIconLoc,const wchar_t *pszAppName,const wchar_t *pszRunCmd,const wchar_t *pszDdeCmd,const wchar_t *pszDdeApp,const wchar_t *pszDdeTopic,const wchar_t *pszVerbDesc,BOOL fBrowserAutoOpen,BOOL fUrlProto,BOOL fIsShortcut);
BOOL RemoveRegClass(const char *pszClassName);
-BOOL IsRegClass(const char *pszClassName,const TCHAR *pszRunCmd);
+BOOL IsRegClass(const char *pszClassName,const wchar_t *pszRunCmd);
HICON LoadRegClassSmallIcon(const char *pszClassName);
/* Extension */
BOOL AddRegFileExt(const char *pszFileExt,const char *pszClassName,const char *pszMimeType,BOOL fIsText);
@@ -34,18 +34,18 @@ BOOL IsRegFileExt(const char *pszFileExt,const char *pszClassName);
BOOL AddRegMimeType(const char *pszMimeType,const char *pszFileExt);
void RemoveRegMimeType(const char *pszMimeType,const char *pszFileExt);
/* Open-With App */
-void AddRegOpenWith(const TCHAR *pszAppFileName,BOOL fAllowOpenWith,const TCHAR *pszAppName,const TCHAR *pszIconLoc,const TCHAR *pszRunCmd,const TCHAR *pszDdeCmd,const TCHAR *pszDdeApp,const TCHAR *pszDdeTopic);
-void RemoveRegOpenWith(const TCHAR *pszAppFileName);
-void AddRegOpenWithExtEntry(const TCHAR *pszAppFileName,const char *pszFileExt,const TCHAR *pszFileDesc);
-void RemoveRegOpenWithExtEntry(const TCHAR *pszAppFileName,const char *pszFileExt);
+void AddRegOpenWith(const wchar_t *pszAppFileName,BOOL fAllowOpenWith,const wchar_t *pszAppName,const wchar_t *pszIconLoc,const wchar_t *pszRunCmd,const wchar_t *pszDdeCmd,const wchar_t *pszDdeApp,const wchar_t *pszDdeTopic);
+void RemoveRegOpenWith(const wchar_t *pszAppFileName);
+void AddRegOpenWithExtEntry(const wchar_t *pszAppFileName,const char *pszFileExt,const wchar_t *pszFileDesc);
+void RemoveRegOpenWithExtEntry(const wchar_t *pszAppFileName,const char *pszFileExt);
/* Autostart */
-BOOL AddRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd);
-BOOL RemoveRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd);
-BOOL IsRegRunEntry(const TCHAR *pszAppName,const TCHAR *pszRunCmd);
+BOOL AddRegRunEntry(const wchar_t *pszAppName,const wchar_t *pszRunCmd);
+BOOL RemoveRegRunEntry(const wchar_t *pszAppName,const wchar_t *pszRunCmd);
+BOOL IsRegRunEntry(const wchar_t *pszAppName,const wchar_t *pszRunCmd);
/* Strings */
char *MakeFileClassName(const char *pszFileExt);
char *MakeUrlClassName(const char *pszUrl);
-TCHAR *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile);
-TCHAR *MakeIconLocation(HMODULE hModule,WORD nIconResID);
-TCHAR *MakeAppFileName(BOOL fMirExe); \ No newline at end of file
+wchar_t *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile);
+wchar_t *MakeIconLocation(HMODULE hModule,WORD nIconResID);
+wchar_t *MakeAppFileName(BOOL fMirExe);
diff --git a/plugins/AssocMgr/src/test.cpp b/plugins/AssocMgr/src/test.cpp
index 0980a3cd2d..f0d60e6276 100644
--- a/plugins/AssocMgr/src/test.cpp
+++ b/plugins/AssocMgr/src/test.cpp
@@ -36,7 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern HINSTANCE hInst;
/* a copy of those in m_assocmgr.h, as we did not #include those helpers */
-__inline static int AssocMgr_AddNewFileTypeT(const char *ext, const char *mime, const TCHAR *desc, const TCHAR *verb, HINSTANCE hinst, UINT iconid, const char *service, DWORD flags)
+__inline static int AssocMgr_AddNewFileTypeT(const char *ext, const char *mime, const wchar_t *desc, const wchar_t *verb, HINSTANCE hinst, UINT iconid, const char *service, DWORD flags)
{
FILETYPEDESC ftd;
ftd.cbSize = sizeof(FILETYPEDESC);
@@ -117,7 +117,7 @@ static int ServiceParseAimLink(WPARAM, LPARAM lParam)
acs.psr = &psr;
memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
psr.cbSize = sizeof(PROTOSEARCHRESULT);
- psr.nick.t = sn;
+ psr.nick.w = sn;
CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
}
return 0;
@@ -311,7 +311,7 @@ static void MessageIcqUser(ICQFILEINFO *info)
static int IcqOpenFile(WPARAM wParam, LPARAM lParam)
{
- TCHAR *pszFile = (TCHAR*)lParam; /* TCHAR is specified on AssocMgr_AddNewFileTypeT() */
+ wchar_t *pszFile = (wchar_t*)lParam; /* wchar_t is specified on AssocMgr_AddNewFileTypeT() */
FILE *fp;
ICQFILEINFO info;
char line[4096], *sep;
@@ -331,7 +331,7 @@ static int IcqOpenFile(WPARAM wParam, LPARAM lParam)
LastName=
*/
if (pszFile == NULL) return 1; /* sanity check */
- fp = _tfopen(pszFile, L"rt");
+ fp = _wfopen(pszFile, L"rt");
if (fp == NULL) return 1; /* open failed */
info.type = 0;
while (!feof(fp)) {
@@ -438,7 +438,7 @@ static int ServiceParseYmsgrLink(WPARAM wParam, LPARAM lParam)
acs.psr = &psr;
memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
psr.cbSize = sizeof(PROTOSEARCHRESULT);
- psr.nick.t = id;
+ psr.nick.w = id;
CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
}
return 0;
@@ -553,8 +553,8 @@ static int ServiceParseMsnimLink(WPARAM wParam, LPARAM lParam)
acs.psr = &psr;
memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
psr.cbSize = sizeof(PROTOSEARCHRESULT);
- psr.nick.t = email;
- psr.email.t = email;
+ psr.nick.w = email;
+ psr.email.w = email;
CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
}
return 0;
@@ -749,7 +749,7 @@ static int ServiceParseXmppURI(WPARAM wParam, LPARAM lParam)
acs.psr = &psr;
memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
psr.cbSize = sizeof(PROTOSEARCHRESULT);
- psr.nick.t = jid;
+ psr.nick.w = jid;
CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
}
return 0;
diff --git a/plugins/AssocMgr/src/utils.cpp b/plugins/AssocMgr/src/utils.cpp
index 7f8ec8fbf2..494dd298c5 100644
--- a/plugins/AssocMgr/src/utils.cpp
+++ b/plugins/AssocMgr/src/utils.cpp
@@ -65,7 +65,7 @@ char* u2a(const WCHAR *pszUnicode,BOOL fMirCp)
}
// mir_free() the return value
-TCHAR* s2t(const void *pszStr,DWORD fUnicode,BOOL fMirCp)
+wchar_t* s2t(const void *pszStr,DWORD fUnicode,BOOL fMirCp)
{
if(fUnicode) return mir_wstrdup((WCHAR*)pszStr);
@@ -74,7 +74,7 @@ TCHAR* s2t(const void *pszStr,DWORD fUnicode,BOOL fMirCp)
}
// mir_free() the return value
-void* t2s(const TCHAR *pszStr,DWORD fUnicode,BOOL fMirCp)
+void* t2s(const wchar_t *pszStr,DWORD fUnicode,BOOL fMirCp)
{
if (!fUnicode) return (void*)u2a(pszStr,fMirCp);
diff --git a/plugins/AssocMgr/src/utils.h b/plugins/AssocMgr/src/utils.h
index e795450cc5..3db6bf09e6 100644
--- a/plugins/AssocMgr/src/utils.h
+++ b/plugins/AssocMgr/src/utils.h
@@ -22,8 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* String Conv */
WCHAR* a2u(const char *pszAnsi,BOOL fMirCp);
char* u2a(const WCHAR *pszUnicode,BOOL fMirCp);
-TCHAR* s2t(const void *pszStr,DWORD fUnicode,BOOL fMirCp);
-void* t2s(const TCHAR *pszStr,DWORD fUnicode,BOOL fMirCp);
+wchar_t* s2t(const void *pszStr,DWORD fUnicode,BOOL fMirCp);
+void* t2s(const wchar_t *pszStr,DWORD fUnicode,BOOL fMirCp);
#define t2a(s) u2a(s,FALSE)
#define a2t(s) a2u(s,FALSE)
diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp
index 08e9f96cb1..e5eef4db77 100644
--- a/plugins/AuthState/src/main.cpp
+++ b/plugins/AuthState/src/main.cpp
@@ -143,9 +143,9 @@ int onPrebuildContactMenu(WPARAM hContact, LPARAM)
return 0;
if (db_get_b((MCONTACT)hContact, "AuthState", "ShowIcons", 1))
- Menu_ModifyItem(hUserMenu, LPGENT("Disable AuthState icons"));
+ Menu_ModifyItem(hUserMenu, LPGENW("Disable AuthState icons"));
else
- Menu_ModifyItem(hUserMenu, LPGENT("Enable AuthState icons"));
+ Menu_ModifyItem(hUserMenu, LPGENW("Enable AuthState icons"));
Menu_ShowItem(hUserMenu, db_get_b((MCONTACT)hContact, proto, "Auth", 0) || db_get_b((MCONTACT)hContact, proto, "Grant", 0) || !db_get_dw((MCONTACT)hContact, proto, "ServerId", 0));
return 0;
@@ -181,7 +181,7 @@ extern "C" int __declspec(dllexport) Load(void)
SET_UID(mi, 0xc5a784ea, 0x8b07, 0x4b95, 0xa2, 0xb2, 0x84, 0x9d, 0x87, 0x43, 0x7e, 0xda);
mi.position = -1999901005;
mi.flags = CMIF_TCHAR;
- mi.name.t = LPGENT("Enable AuthState icons");
+ mi.name.w = LPGENW("Enable AuthState icons");
mi.pszService = "AuthState/MenuItem";
hUserMenu = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/AutoRun/src/main.cpp b/plugins/AutoRun/src/main.cpp
index 8d0a3109eb..7781742096 100644
--- a/plugins/AutoRun/src/main.cpp
+++ b/plugins/AutoRun/src/main.cpp
@@ -24,13 +24,13 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
return TRUE;
}
-void GetProfilePath(TCHAR *res, size_t resLen)
+void GetProfilePath(wchar_t *res, size_t resLen)
{
- TCHAR dbname[MAX_PATH], exename[MAX_PATH];
+ wchar_t dbname[MAX_PATH], exename[MAX_PATH];
CallService(MS_DB_GETPROFILENAMET, _countof(dbname), (LPARAM)dbname);
GetModuleFileName(NULL, exename, _countof(exename));
- TCHAR *p = _tcsrchr(dbname, '.');
+ wchar_t *p = wcsrchr(dbname, '.');
if (p) *p = 0;
mir_sntprintf(res, resLen, L"\"%s\" \"/profile:%s\"", exename, dbname);
@@ -43,9 +43,9 @@ static void SetAutorun(BOOL autorun)
switch (autorun) {
case TRUE:
if ( RegCreateKeyEx(ROOT_KEY, SUB_KEY, 0, NULL, 0, KEY_CREATE_SUB_KEY|KEY_SET_VALUE,NULL,&hKey,&dw) == ERROR_SUCCESS) {
- TCHAR result[MAX_PATH];
+ wchar_t result[MAX_PATH];
GetProfilePath(result, _countof(result));
- RegSetValueEx(hKey, L"MirandaNG", 0, REG_SZ, (BYTE*)result, sizeof(TCHAR)*(DWORD)mir_tstrlen(result));
+ RegSetValueEx(hKey, L"MirandaNG", 0, REG_SZ, (BYTE*)result, sizeof(wchar_t)*(DWORD)mir_tstrlen(result));
RegCloseKey(hKey);
}
break;
@@ -64,7 +64,7 @@ static BOOL CmpCurrentAndRegistry()
if ( RegOpenKeyEx(ROOT_KEY, SUB_KEY, 0, KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS)
return FALSE;
- TCHAR result[MAX_PATH], dbpath[MAX_PATH];
+ wchar_t result[MAX_PATH], dbpath[MAX_PATH];
DWORD dwBufLen = MAX_PATH;
if ( RegQueryValueEx(hKey, L"MirandaNG", NULL, NULL, (LPBYTE)dbpath, &dwBufLen) != ERROR_SUCCESS)
return FALSE;
diff --git a/plugins/AutoShutdown/src/cpuusage.cpp b/plugins/AutoShutdown/src/cpuusage.cpp
index 7ca145d875..d5cfa13b05 100644
--- a/plugins/AutoShutdown/src/cpuusage.cpp
+++ b/plugins/AutoShutdown/src/cpuusage.cpp
@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define Li2Double(x) ((double)((x).HighPart)*4.294967296E9+(double)((x).LowPart))
-static BOOL WinNT_PerfStatsSwitch(TCHAR *pszServiceName, BOOL fDisable)
+static BOOL WinNT_PerfStatsSwitch(wchar_t *pszServiceName, BOOL fDisable)
{
HKEY hKeyServices, hKeyService, hKeyPerf;
DWORD dwData, dwDataSize;
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp
index 0f76cb66fa..972102796f 100644
--- a/plugins/AutoShutdown/src/frame.cpp
+++ b/plugins/AutoShutdown/src/frame.cpp
@@ -327,7 +327,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
dat->flags |= FWPDF_PAUSEDSHOWN;
}
else {
- TCHAR szOutput[256];
+ wchar_t szOutput[256];
if (dat->fTimeFlags&SDWTF_ST_TIME)
GetFormatedDateTime(szOutput, _countof(szOutput), dat->settingLastTime, TRUE);
else GetFormatedCountdown(szOutput, _countof(szOutput), dat->countdown);
@@ -414,7 +414,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
HDC hdc;
SIZE size;
HFONT hFontPrev = NULL;
- TCHAR szOutput[256];
+ wchar_t szOutput[256];
dat->flags &= ~FWPDF_TIMEISCLIPPED;
if (GetWindowText(dat->hwndTime, szOutput, _countof(szOutput)))
if (GetClientRect(dat->hwndTime, &rc)) {
@@ -464,7 +464,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
else if ((HWND)wParam == dat->hwndIcon)
ttdi->lpszText = TranslateT("Automatic shutdown");
else {
- TCHAR szTime[_countof(ttdi->szText)];
+ wchar_t szTime[_countof(ttdi->szText)];
if (dat->fTimeFlags&SDWTF_ST_TIME)
GetFormatedDateTime(szTime, _countof(szTime), dat->settingLastTime, FALSE);
else GetFormatedCountdown(szTime, _countof(szTime), dat->countdown);
@@ -556,9 +556,9 @@ static int FrameModulesLoaded(WPARAM, LPARAM)
LOGFONT lf;
/* built-in font module is not available before this hook */
COLORREF clr = GetDefaultColor(FRAMEELEMENT_TEXT);
- FontService_RegisterFont("AutoShutdown", "CountdownFont", LPGENT("Automatic shutdown"), LPGENT("Countdown on frame"), LPGENT("Automatic shutdown"), LPGENT("Background"), 0, FALSE, GetDefaultFont(&lf), clr);
+ FontService_RegisterFont("AutoShutdown", "CountdownFont", LPGENW("Automatic shutdown"), LPGENW("Countdown on frame"), LPGENW("Automatic shutdown"), LPGENW("Background"), 0, FALSE, GetDefaultFont(&lf), clr);
clr = GetDefaultColor(FRAMEELEMENT_BKGRND);
- FontService_RegisterColor("AutoShutdown", "BkgColor", LPGENT("Automatic shutdown"), LPGENT("Background"), clr);
+ FontService_RegisterColor("AutoShutdown", "BkgColor", LPGENW("Automatic shutdown"), LPGENW("Background"), clr);
if (!IsThemeActive()) {
/* progressbar color can only be changed with classic theme */
clr = GetDefaultColor(FRAMEELEMENT_BAR);
diff --git a/plugins/AutoShutdown/src/options.cpp b/plugins/AutoShutdown/src/options.cpp
index 9dc562eed4..358f3e04af 100644
--- a/plugins/AutoShutdown/src/options.cpp
+++ b/plugins/AutoShutdown/src/options.cpp
@@ -110,9 +110,9 @@ static int ShutdownOptInit(WPARAM wParam, LPARAM)
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SHUTDOWN);
odp.position = 900000002;
- odp.ptszGroup = LPGENT("Events"); /* autotranslated */
- odp.ptszTitle = LPGENT("Automatic shutdown"); /* autotranslated */
- odp.ptszTab = LPGENT("Automatic shutdown"); /* autotranslated, can be made a tab */
+ odp.pwszGroup = LPGENW("Events"); /* autotranslated */
+ odp.pwszTitle = LPGENW("Automatic shutdown"); /* autotranslated */
+ odp.pwszTab = LPGENW("Automatic shutdown"); /* autotranslated, can be made a tab */
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pfnDlgProc = ShutdownOptDlgProc;
Options_AddPage(wParam, &odp);
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp
index 594c008a54..33a4e647c4 100644
--- a/plugins/AutoShutdown/src/settingsdlg.cpp
+++ b/plugins/AutoShutdown/src/settingsdlg.cpp
@@ -30,7 +30,7 @@ static HWND hwndSettingsDlg;
extern HINSTANCE hInst;
const DWORD unitValues[] = { 1,60,60 * 60,60 * 60 * 24,60 * 60 * 24 * 7,60 * 60 * 24 * 31 };
-const TCHAR *unitNames[] = { LPGENT("Second(s)"), LPGENT("Minute(s)"), LPGENT("Hour(s)"), LPGENT("Day(s)"), LPGENT("Week(s)"), LPGENT("Month(s)") };
+const wchar_t *unitNames[] = { LPGENW("Second(s)"), LPGENW("Minute(s)"), LPGENW("Hour(s)"), LPGENW("Day(s)"), LPGENW("Week(s)"), LPGENW("Month(s)") };
/************************* Dialog *************************************/
@@ -47,7 +47,7 @@ static BOOL CALLBACK DisplayCpuUsageProc(BYTE nCpuUsage, LPARAM lParam)
if (!IsWindow((HWND)lParam))
return FALSE; /* stop poll thread */
- TCHAR str[64];
+ wchar_t str[64];
mir_sntprintf(str, TranslateT("(current: %u%%)"), nCpuUsage);
SetWindowText((HWND)lParam, str);
return TRUE;
@@ -152,7 +152,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
SendMessage(hwndCombo, CB_INITSTORAGE, SDSDT_MAX, SDSDT_MAX * 32);
for (BYTE shutdownType = 1; shutdownType <= SDSDT_MAX; ++shutdownType)
if (ServiceIsTypeEnabled(shutdownType, 0)) {
- TCHAR *pszText = (TCHAR*)ServiceGetTypeDescription(shutdownType, GSTDF_TCHAR); /* never fails */
+ wchar_t *pszText = (wchar_t*)ServiceGetTypeDescription(shutdownType, GSTDF_TCHAR); /* never fails */
int index = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)pszText);
if (index != LB_ERR) {
SendMessage(hwndCombo, CB_SETITEMDATA, index, (LPARAM)shutdownType);
@@ -241,7 +241,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
case M_UPDATE_SHUTDOWNDESC: /* lParam=(LPARAM)(HWND)hwndCombo */
{
BYTE shutdownType = (BYTE)SendMessage((HWND)lParam, CB_GETITEMDATA, SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0), 0);
- SetDlgItemText(hwndDlg, IDC_TEXT_SHUTDOWNTYPE, (TCHAR*)ServiceGetTypeDescription(shutdownType, GSTDF_LONGDESC | GSTDF_TCHAR));
+ SetDlgItemText(hwndDlg, IDC_TEXT_SHUTDOWNTYPE, (wchar_t*)ServiceGetTypeDescription(shutdownType, GSTDF_LONGDESC | GSTDF_TCHAR));
}
return TRUE;
@@ -352,7 +352,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
{
HWND hwndEdit = GetDlgItem(hwndDlg, IDC_EDIT_MESSAGE);
int len = GetWindowTextLength(hwndEdit) + 1;
- TCHAR *pszText = (TCHAR*)mir_alloc(len*sizeof(TCHAR));
+ wchar_t *pszText = (wchar_t*)mir_alloc(len*sizeof(wchar_t));
if (pszText != NULL && GetWindowText(hwndEdit, pszText, len + 1)) {
TrimString(pszText);
db_set_ts(NULL, "AutoShutdown", "Message", pszText);
@@ -453,23 +453,23 @@ void SetShutdownMenuItem(bool fActive)
mi.position = 2001090000;
if (fActive) {
mi.hIcolibItem = iconList[1].hIcolib;
- mi.name.t = LPGENT("Stop automatic &shutdown");
+ mi.name.w = LPGENW("Stop automatic &shutdown");
}
else {
mi.hIcolibItem = iconList[2].hIcolib;
- mi.name.t = LPGENT("Automatic &shutdown...");
+ mi.name.w = LPGENW("Automatic &shutdown...");
}
mi.pszService = "AutoShutdown/MenuCommand";
mi.flags = CMIF_TCHAR;
if (hMainMenuItem != NULL)
- Menu_ModifyItem(hMainMenuItem, mi.name.t, mi.hIcolibItem);
+ Menu_ModifyItem(hMainMenuItem, mi.name.w, mi.hIcolibItem);
else
hMainMenuItem = Menu_AddMainMenuItem(&mi);
/* tray menu */
mi.position = 899999;
if (hTrayMenuItem != NULL)
- Menu_ModifyItem(hTrayMenuItem, mi.name.t, mi.hIcolibItem);
+ Menu_ModifyItem(hTrayMenuItem, mi.name.w, mi.hIcolibItem);
else
hTrayMenuItem = Menu_AddTrayMenuItem(&mi);
}
diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp
index 7a6dafb468..b77aab3558 100644
--- a/plugins/AutoShutdown/src/shutdownsvc.cpp
+++ b/plugins/AutoShutdown/src/shutdownsvc.cpp
@@ -30,20 +30,20 @@ static HANDLE hEventOkToShutdown,hEventShutdown;
/************************* Utils **************************************/
-TCHAR *desc[] =
+wchar_t *desc[] =
{
- LPGENT("Miranda NG is going to be automatically closed in %u second(s)."),
- LPGENT("All Miranda NG protocols are going to be set to offline in %u second(s)."),
- LPGENT("You will be logged off automatically in %u second(s)."),
- LPGENT("The computer will automatically be restarted in %u second(s)."),
- LPGENT("The computer will automatically be set to standby mode in %u second(s)."),
- LPGENT("The computer will automatically be set to hibernate mode in %u second(s)."),
- LPGENT("The workstation will automatically get locked in %u second(s)."),
- LPGENT("All dial-up connections will be closed in %u second(s)."),
- LPGENT("The computer will automatically be shut down in %u second(s).")
+ LPGENW("Miranda NG is going to be automatically closed in %u second(s)."),
+ LPGENW("All Miranda NG protocols are going to be set to offline in %u second(s)."),
+ LPGENW("You will be logged off automatically in %u second(s)."),
+ LPGENW("The computer will automatically be restarted in %u second(s)."),
+ LPGENW("The computer will automatically be set to standby mode in %u second(s)."),
+ LPGENW("The computer will automatically be set to hibernate mode in %u second(s)."),
+ LPGENW("The workstation will automatically get locked in %u second(s)."),
+ LPGENW("All dial-up connections will be closed in %u second(s)."),
+ LPGENW("The computer will automatically be shut down in %u second(s).")
};
-static BOOL WinNT_SetPrivilege(TCHAR *pszPrivName, BOOL bEnable)
+static BOOL WinNT_SetPrivilege(wchar_t *pszPrivName, BOOL bEnable)
{
BOOL bReturn = FALSE;
HANDLE hToken;
@@ -383,7 +383,7 @@ static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
case M_UPDATE_COUNTDOWN: /* lParam=(WORD)countdown */
{
- TCHAR szText[256];
+ wchar_t szText[256];
mir_sntprintf(szText, TranslateTS(desc[shutdownType - 1]), lParam);
SetDlgItemText(hwndDlg, IDC_TEXT_HEADER, szText);
/* countdown finished */
@@ -451,24 +451,24 @@ INT_PTR ServiceIsTypeEnabled(WPARAM wParam, LPARAM)
return IsShutdownTypeEnabled((BYTE)wParam); /* does shutdownType range check */
}
-const TCHAR *apszShort[] = {
- LPGENT("Close Miranda NG"),LPGENT("Set Miranda NG offline"),LPGENT("Log off user"),
- LPGENT("Restart computer"),LPGENT("Shutdown computer"),LPGENT("Standby mode"),LPGENT("Hibernate mode"),
- LPGENT("Lock workstation"),LPGENT("Hang up dial-up connections"),LPGENT("Close Miranda NG"),
- LPGENT("Set Miranda NG offline"),LPGENT("Log off user"),LPGENT("Restart computer"),LPGENT("Shutdown computer"),
- LPGENT("Standby mode"),LPGENT("Hibernate mode"),LPGENT("Lock workstation"),LPGENT("Hang up dial-up connections")
+const wchar_t *apszShort[] = {
+ LPGENW("Close Miranda NG"),LPGENW("Set Miranda NG offline"),LPGENW("Log off user"),
+ LPGENW("Restart computer"),LPGENW("Shutdown computer"),LPGENW("Standby mode"),LPGENW("Hibernate mode"),
+ LPGENW("Lock workstation"),LPGENW("Hang up dial-up connections"),LPGENW("Close Miranda NG"),
+ LPGENW("Set Miranda NG offline"),LPGENW("Log off user"),LPGENW("Restart computer"),LPGENW("Shutdown computer"),
+ LPGENW("Standby mode"),LPGENW("Hibernate mode"),LPGENW("Lock workstation"),LPGENW("Hang up dial-up connections")
};
-const TCHAR *apszLong[] = {
- LPGENT("Sets all Miranda NG protocols to offline and closes Miranda NG."),
- LPGENT("Sets all Miranda NG protocols to offline."),
- LPGENT("Logs the current Windows user off so that another user can log in."),
- LPGENT("Shuts down Windows and then restarts Windows."),
- LPGENT("Closes all running programs and shuts down Windows to a point at which it is safe to turn off the power."),
- LPGENT("Saves the current Windows session in memory and sets the system to suspend mode."),
- LPGENT("Saves the current Windows session on hard drive, so that the power can be turned off."),
- LPGENT("Locks the computer. To unlock the computer, you must log in."),
- LPGENT("Sets all protocols to offline and closes all RAS connections.")
+const wchar_t *apszLong[] = {
+ LPGENW("Sets all Miranda NG protocols to offline and closes Miranda NG."),
+ LPGENW("Sets all Miranda NG protocols to offline."),
+ LPGENW("Logs the current Windows user off so that another user can log in."),
+ LPGENW("Shuts down Windows and then restarts Windows."),
+ LPGENW("Closes all running programs and shuts down Windows to a point at which it is safe to turn off the power."),
+ LPGENW("Saves the current Windows session in memory and sets the system to suspend mode."),
+ LPGENW("Saves the current Windows session on hard drive, so that the power can be turned off."),
+ LPGENW("Locks the computer. To unlock the computer, you must log in."),
+ LPGENW("Sets all protocols to offline and closes all RAS connections.")
};
INT_PTR ServiceGetTypeDescription(WPARAM wParam, LPARAM lParam)
@@ -476,7 +476,7 @@ INT_PTR ServiceGetTypeDescription(WPARAM wParam, LPARAM lParam)
/* shutdownType range check */
if (!wParam || (BYTE)wParam > SDSDT_MAX) return 0;
/* select description */
- TCHAR *pszDesc = (TCHAR*)((lParam&GSTDF_LONGDESC) ? apszLong : apszShort)[wParam - 1];
+ wchar_t *pszDesc = (wchar_t*)((lParam&GSTDF_LONGDESC) ? apszLong : apszShort)[wParam - 1];
if (!(lParam&GSTDF_UNTRANSLATED)) pszDesc = TranslateTS(pszDesc);
/* convert as needed */
if (!(lParam&GSTDF_UNICODE)) {
@@ -496,7 +496,7 @@ void InitShutdownSvc(void)
{
/* Shutdown Dialog */
hwndShutdownDlg = NULL;
- SkinAddNewSoundExT("AutoShutdown_Countdown", LPGENT("Alerts"), LPGENT("Automatic shutdown countdown"));
+ SkinAddNewSoundExT("AutoShutdown_Countdown", LPGENW("Alerts"), LPGENW("Automatic shutdown countdown"));
/* Events */
hEventOkToShutdown = CreateHookableEvent(ME_AUTOSHUTDOWN_OKTOSHUTDOWN);
diff --git a/plugins/AutoShutdown/src/utils.cpp b/plugins/AutoShutdown/src/utils.cpp
index 4433831a03..ffe41e4a0a 100644
--- a/plugins/AutoShutdown/src/utils.cpp
+++ b/plugins/AutoShutdown/src/utils.cpp
@@ -47,9 +47,9 @@ char* u2a(const WCHAR *pszUnicode)
return psz;
}
-void TrimString(TCHAR *pszStr)
+void TrimString(wchar_t *pszStr)
{
- TCHAR *psz, szChars[] = L" \r\n\t";
+ wchar_t *psz, szChars[] = L" \r\n\t";
for (int i = 0; i < _countof(szChars); ++i) {
/* trim end */
psz = &pszStr[mir_tstrlen(pszStr) - 1];
@@ -60,7 +60,7 @@ void TrimString(TCHAR *pszStr)
/* trim beginning */
for (psz = pszStr; (*psz && *psz == szChars[i]); psz = CharNext(psz))
;
- memmove(pszStr, psz, (mir_tstrlen(psz) + 1)*sizeof(TCHAR));
+ memmove(pszStr, psz, (mir_tstrlen(psz) + 1)*sizeof(wchar_t));
}
}
@@ -158,7 +158,7 @@ BOOL TimeStampToSystemTime(time_t timestamp, SYSTEMTIME *st)
return TRUE;
}
-BOOL GetFormatedCountdown(TCHAR *pszOut, int nSize, time_t countdown)
+BOOL GetFormatedCountdown(wchar_t *pszOut, int nSize, time_t countdown)
{
static BOOL fInited = FALSE;
static int (WINAPI *pfnGetDurationFormat)(LCID, DWORD, const SYSTEMTIME*, double, WCHAR*, WCHAR*, int);
@@ -183,7 +183,7 @@ BOOL GetFormatedCountdown(TCHAR *pszOut, int nSize, time_t countdown)
return StrFromTimeInterval(pszOut, nSize, (countdown > (MAXDWORD / 1000)) ? MAXDWORD : (countdown * 1000), 10) != 0;
}
-BOOL GetFormatedDateTime(TCHAR *pszOut, int nSize, time_t timestamp, BOOL fShowDateEvenToday)
+BOOL GetFormatedDateTime(wchar_t *pszOut, int nSize, time_t timestamp, BOOL fShowDateEvenToday)
{
SYSTEMTIME st, stNow;
LCID locale = Langpack_GetDefaultLocale();
@@ -194,7 +194,7 @@ BOOL GetFormatedDateTime(TCHAR *pszOut, int nSize, time_t timestamp, BOOL fShowD
return GetTimeFormat(locale, ((st.wSecond == 0) ? TIME_NOSECONDS : 0) | TIME_FORCE24HOURFORMAT, &st, NULL, pszOut, nSize) != 0;
/* show both date and time */
{
- TCHAR szDate[128], szTime[128];
+ wchar_t szDate[128], szTime[128];
if (!GetTimeFormat(locale, ((st.wSecond == 0) ? TIME_NOSECONDS : 0) | TIME_FORCE24HOURFORMAT, &st, NULL, szTime, _countof(szTime)))
return FALSE;
if (!GetDateFormat(locale, DATE_SHORTDATE, &st, NULL, szDate, _countof(szDate)))
@@ -212,8 +212,8 @@ void AddHotkey()
hkd.cbSize = sizeof(hkd);
hkd.dwFlags = HKD_TCHAR;
hkd.pszName = "AutoShutdown_Toggle";
- hkd.ptszDescription = LPGENT("Toggle automatic shutdown");
- hkd.ptszSection = LPGENT("Main");
+ hkd.ptszDescription = LPGENW("Toggle automatic shutdown");
+ hkd.ptszSection = LPGENW("Main");
hkd.pszService = "AutoShutdown/MenuCommand";
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, 'T') | HKF_MIRANDA_LOCAL;
hkd.lParam = FALSE;
diff --git a/plugins/AutoShutdown/src/utils.h b/plugins/AutoShutdown/src/utils.h
index 02edb32dda..d3ccaabae7 100644
--- a/plugins/AutoShutdown/src/utils.h
+++ b/plugins/AutoShutdown/src/utils.h
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* String */
WCHAR *a2u(const char *pszAnsi);
char *u2a(const WCHAR *pszUnicode);
-void TrimString(TCHAR *pszStr);
+void TrimString(wchar_t *pszStr);
/* Error Output */
void ShowInfoMessage(BYTE flags,const char *pszTitle,const char *pszTextFmt,...);
@@ -31,8 +31,8 @@ char* GetWinErrorDescription(DWORD dwLastError);
/* Time */
BOOL SystemTimeToTimeStamp(SYSTEMTIME *st,time_t *timestamp);
BOOL TimeStampToSystemTime(time_t timestamp,SYSTEMTIME *st);
-BOOL GetFormatedCountdown(TCHAR *pszOut,int nSize,time_t countdown);
-BOOL GetFormatedDateTime(TCHAR *pszOut,int nSize,time_t timestamp,BOOL fShowDateEvenToday);
+BOOL GetFormatedCountdown(wchar_t *pszOut,int nSize,time_t countdown);
+BOOL GetFormatedDateTime(wchar_t *pszOut,int nSize,time_t timestamp,BOOL fShowDateEvenToday);
/* Skin */
void AddHotkey();
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp
index efb456a82a..65a69c73f9 100644
--- a/plugins/AutoShutdown/src/watcher.cpp
+++ b/plugins/AutoShutdown/src/watcher.cpp
@@ -63,7 +63,7 @@ static void __inline ShutdownAndStopWatcher(void)
/************************* Msg Shutdown *******************************/
// ppBlob might get reallocated, must have been allocated using mir_alloc()
-static TCHAR* GetMessageText(BYTE **ppBlob, DWORD *pcbBlob)
+static wchar_t* GetMessageText(BYTE **ppBlob, DWORD *pcbBlob)
{
(*ppBlob)[*pcbBlob] = 0;
size_t cb = mir_strlen((char*)*ppBlob);
@@ -102,8 +102,8 @@ static int MsgEventAdded(WPARAM, LPARAM hDbEvent)
DBVARIANT dbv;
if (!db_get_ts(NULL, "AutoShutdown", "Message", &dbv)) {
TrimString(dbv.ptszVal);
- TCHAR *pszMsg = GetMessageText(&dbe.pBlob, &dbe.cbBlob);
- if (pszMsg != NULL && _tcsstr(pszMsg, dbv.ptszVal) != NULL)
+ wchar_t *pszMsg = GetMessageText(&dbe.pBlob, &dbe.cbBlob);
+ if (pszMsg != NULL && wcsstr(pszMsg, dbv.ptszVal) != NULL)
ShutdownAndStopWatcher(); /* msg with specified text recvd */
mir_free(dbv.ptszVal); /* does NULL check */
}
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp
index 481fea0fac..623d4a8c0e 100644
--- a/plugins/AvatarHistory/src/AvatarDlg.cpp
+++ b/plugins/AvatarHistory/src/AvatarDlg.cpp
@@ -23,7 +23,7 @@ Avatar History Plugin
HGENMENU hMenu = NULL;
void __cdecl AvatarDialogThread(void *param);
static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
-int ShowSaveDialog(HWND hwnd, TCHAR* fn,MCONTACT hContact = NULL);
+int ShowSaveDialog(HWND hwnd, wchar_t* fn,MCONTACT hContact = NULL);
bool ProtocolEnabled(const char *proto);
int FillAvatarListFromDB(HWND list, MCONTACT hContact);
@@ -31,15 +31,15 @@ int FillAvatarListFromFolder(HWND list, MCONTACT hContact);
int FillAvatarListFromFiles(HWND list, MCONTACT hContact);
int CleanupAvatarPic(HWND hwnd);
bool UpdateAvatarPic(HWND hwnd);
-TCHAR * GetContactFolder(TCHAR *fn, MCONTACT hContact);
-BOOL ResolveShortcut(TCHAR *shortcut, TCHAR *file);
+wchar_t * GetContactFolder(wchar_t *fn, MCONTACT hContact);
+BOOL ResolveShortcut(wchar_t *shortcut, wchar_t *file);
static INT_PTR ShowDialogSvc(WPARAM wParam, LPARAM lParam);
struct AvatarDialogData
{
MCONTACT hContact;
- TCHAR fn[MAX_PATH];
+ wchar_t fn[MAX_PATH];
HWND parent;
};
@@ -61,8 +61,8 @@ public:
}
MEVENT hDbEvent;
- TCHAR *filename;
- TCHAR *filelink;
+ wchar_t *filename;
+ wchar_t *filelink;
};
int OpenAvatarDialog(MCONTACT hContact, char* fn)
@@ -80,7 +80,7 @@ int OpenAvatarDialog(MCONTACT hContact, char* fn)
avdlg->hContact = hContact;
if (fn == NULL)
{
- avdlg->fn[0] = _T('\0');
+ avdlg->fn[0] = '\0';
}
else
{
@@ -133,9 +133,9 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l
else
FillAvatarListFromFiles(hwndList, data->hContact);
- TCHAR *displayName = pcli->pfnGetContactDisplayName(data->hContact, 0);
+ wchar_t *displayName = pcli->pfnGetContactDisplayName(data->hContact, 0);
if (displayName) {
- TCHAR title[MAX_PATH];
+ wchar_t title[MAX_PATH];
mir_sntprintf(title, TranslateT("Avatar History for %s"), displayName);
SetWindowText(hwnd, title);
}
@@ -317,7 +317,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l
case IDC_OPENFOLDER:
if (HIWORD(wParam) == BN_CLICKED && opts.log_per_contact_folders) {
- TCHAR avfolder[MAX_PATH];
+ wchar_t avfolder[MAX_PATH];
MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
GetContactFolder(avfolder, hContact);
ShellExecute(NULL, db_get_b(NULL, MODULE_NAME, "OpenFolderMethod", 0) ? L"explore" : L"open", avfolder, NULL, NULL, SW_SHOWNORMAL);
@@ -352,16 +352,16 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l
}
-int AddFileToList(TCHAR *path,TCHAR *lnk,TCHAR *filename, HWND list)
+int AddFileToList(wchar_t *path,wchar_t *lnk,wchar_t *filename, HWND list)
{
// Add to list
ListEntry *le = new ListEntry();
le->filename = mir_tstrdup(path);
le->filelink = mir_tstrdup(lnk);
- TCHAR *p = _tcschr(filename, _T('.'));
+ wchar_t *p = wcschr(filename, '.');
if (p != NULL)
- p[0] = _T('\0');
+ p[0] = '\0';
int max_pos = SendMessage(list, LB_ADDSTRING, 0, (LPARAM)filename);
SendMessage(list, LB_SETITEMDATA, max_pos, (LPARAM)le);
return max_pos;
@@ -370,7 +370,7 @@ int AddFileToList(TCHAR *path,TCHAR *lnk,TCHAR *filename, HWND list)
int FillAvatarListFromFiles(HWND list, MCONTACT hContact)
{
int max_pos = 0;
- TCHAR dir[MAX_PATH], path[MAX_PATH];
+ wchar_t dir[MAX_PATH], path[MAX_PATH];
WIN32_FIND_DATA finddata;
GetContactFolder(dir, hContact);
@@ -397,7 +397,7 @@ int FillAvatarListFromFiles(HWND list, MCONTACT hContact)
int FillAvatarListFromFolder(HWND list, MCONTACT hContact)
{
int max_pos = 0;
- TCHAR dir[MAX_PATH], path[MAX_PATH];
+ wchar_t dir[MAX_PATH], path[MAX_PATH];
WIN32_FIND_DATA finddata;
GetContactFolder(dir, hContact);
@@ -411,7 +411,7 @@ int FillAvatarListFromFolder(HWND list, MCONTACT hContact)
{
if (finddata.cFileName[0] != '.')
{
- TCHAR lnk[MAX_PATH];
+ wchar_t lnk[MAX_PATH];
mir_sntprintf(lnk, L"%s\\%s", dir, finddata.cFileName);
if (ResolveShortcut(lnk, path))
max_pos = AddFileToList(path,lnk,finddata.cFileName,list);
@@ -435,11 +435,11 @@ int FillAvatarListFromDB(HWND list, MCONTACT hContact)
if (dbei.eventType != EVENTTYPE_AVATAR_CHANGE) continue;
// Get time
- TCHAR date[64];
+ wchar_t date[64];
TimeZone_ToStringT(dbei.timestamp, L"d s", date, _countof(date));
// Get file in disk
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
ptrT tszStoredPath(mir_utf8decodeT((char*)dbei.pBlob));
PathToAbsoluteT(tszStoredPath, path);
@@ -514,7 +514,7 @@ void InitMenuItem()
CMenuItem mi;
SET_UID(mi,0x2fb5c7eb, 0xa606, 0x4145, 0x9e, 0x86, 0x73, 0x88, 0x73, 0x1d, 0xe7, 0x5c);
- mi.name.t = LPGENT("View Avatar History");
+ mi.name.w = LPGENW("View Avatar History");
mi.flags = CMIF_TCHAR;
mi.position = 1000090010;
mi.hIcolibItem = createDefaultOverlayedIcon(FALSE);
@@ -530,9 +530,9 @@ static INT_PTR ShowDialogSvc(WPARAM wParam, LPARAM lParam)
}
-int ShowSaveDialog(HWND hwnd, TCHAR* fn, MCONTACT hContact)
+int ShowSaveDialog(HWND hwnd, wchar_t* fn, MCONTACT hContact)
{
- TCHAR filter[MAX_PATH], file[MAX_PATH];
+ wchar_t filter[MAX_PATH], file[MAX_PATH];
Bitmap_GetFilter(filter, _countof(filter));
OPENFILENAME ofn = { 0 };
@@ -543,11 +543,11 @@ int ShowSaveDialog(HWND hwnd, TCHAR* fn, MCONTACT hContact)
ofn.lpstrFilter = filter;
ofn.nFilterIndex = 1;
- _tcsncpy_s(file, (_tcsrchr(fn, '\\') + 1), _TRUNCATE);
+ wcsncpy_s(file, (wcsrchr(fn, '\\') + 1), _TRUNCATE);
ofn.lpstrFile = file;
- TCHAR *displayName = pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR title[MAX_PATH];
+ wchar_t *displayName = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t title[MAX_PATH];
if (displayName)
{
mir_sntprintf(title, TranslateT("Save Avatar for %s"), displayName);
@@ -559,7 +559,7 @@ int ShowSaveDialog(HWND hwnd, TCHAR* fn, MCONTACT hContact)
}
ofn.nMaxFile = MAX_PATH;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_DONTADDTORECENT;
- ofn.lpstrDefExt = _tcsrchr(fn, '.')+1;
+ ofn.lpstrDefExt = wcsrchr(fn, '.')+1;
DBVARIANT dbvInitDir = {0};
if (!db_get_ts(hContact,MODULE_NAME,"SavedAvatarFolder",&dbvInitDir))
diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp
index 3f833d86f0..46547ae455 100644
--- a/plugins/AvatarHistory/src/AvatarHistory.cpp
+++ b/plugins/AvatarHistory/src/AvatarHistory.cpp
@@ -30,16 +30,16 @@ DWORD mirVer;
HANDLE hFolder = NULL;
-TCHAR profilePath[MAX_PATH]; // database profile path (read at startup only)
-TCHAR basedir[MAX_PATH];
+wchar_t profilePath[MAX_PATH]; // database profile path (read at startup only)
+wchar_t basedir[MAX_PATH];
int hLangpack = 0;
MWindowList hAvatarWindowsList = NULL;
int OptInit(WPARAM wParam,LPARAM lParam);
-TCHAR* GetHistoryFolder(TCHAR *fn);
-TCHAR* GetProtocolFolder(TCHAR *fn, char *proto);
-TCHAR* GetOldStyleAvatarName(TCHAR *fn, MCONTACT hContact);
+wchar_t* GetHistoryFolder(wchar_t *fn);
+wchar_t* GetProtocolFolder(wchar_t *fn, char *proto);
+wchar_t* GetOldStyleAvatarName(wchar_t *fn, MCONTACT hContact);
void InitMenuItem();
@@ -75,9 +75,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
static INT_PTR GetCachedAvatar(WPARAM wParam, LPARAM lParam)
{
- TCHAR hash[128];
+ wchar_t hash[128];
- _tcsncpy_s(hash, (TCHAR*)lParam, _TRUNCATE);
+ wcsncpy_s(hash, (wchar_t*)lParam, _TRUNCATE);
ConvertToFilename(hash, _countof(hash));
return (INT_PTR)GetCachedAvatar((char*)wParam, hash);
}
@@ -145,7 +145,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam)
SkinPlaySound("avatar_changed");
db_set_ts(hContact, "AvatarHistory", "AvatarHash", avatar->hash);
- TCHAR history_filename[MAX_PATH] = L"";
+ wchar_t history_filename[MAX_PATH] = L"";
if (ContactEnabled(hContact, "LogToDisk", AVH_DEF_LOGTODISK)) {
if (!opts.log_store_as_hash) {
@@ -158,7 +158,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam)
MCONTACT hMetaContact = db_mc_getMeta(hContact);
if (hMetaContact && ContactEnabled(hMetaContact, "LogToDisk", AVH_DEF_LOGTOHISTORY)) {
- TCHAR filename[MAX_PATH] = L"";
+ wchar_t filename[MAX_PATH] = L"";
GetOldStyleAvatarName(filename, hMetaContact);
if (CopyImageFile(avatar->filename, filename))
@@ -170,12 +170,12 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam)
}
else {
// See if we already have the avatar
- TCHAR hash[128];
+ wchar_t hash[128];
- _tcsncpy_s(hash, avatar->hash, _TRUNCATE);
+ wcsncpy_s(hash, avatar->hash, _TRUNCATE);
ConvertToFilename(hash, _countof(hash));
- TCHAR *file = GetCachedAvatar(proto, hash);
+ wchar_t *file = GetCachedAvatar(proto, hash);
if (file != NULL) {
mir_tstrncpy(history_filename, file, _countof(history_filename));
@@ -210,7 +210,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam)
ShowPopup(hContact, NULL, opts.popup_changed);
if (ContactEnabled(hContact, "LogToHistory", AVH_DEF_LOGTOHISTORY)) {
- TCHAR rel_path[MAX_PATH];
+ wchar_t rel_path[MAX_PATH];
PathToRelativeT(history_filename, rel_path);
T2Utf blob(rel_path);
@@ -346,8 +346,8 @@ extern "C" __declspec(dllexport) int Load(void)
if (CallService(MS_DB_GETPROFILEPATHT, MAX_PATH, (LPARAM)profilePath) != 0)
mir_tstrcpy(profilePath, L"."); // Failed, use current dir
- SkinAddNewSoundExT("avatar_changed",LPGENT("Avatar History"),LPGENT("Contact changed avatar"));
- SkinAddNewSoundExT("avatar_removed",LPGENT("Avatar History"),LPGENT("Contact removed avatar"));
+ SkinAddNewSoundExT("avatar_changed",LPGENW("Avatar History"),LPGENW("Contact changed avatar"));
+ SkinAddNewSoundExT("avatar_removed",LPGENW("Avatar History"),LPGENW("Contact removed avatar"));
hAvatarWindowsList = WindowList_Create();
diff --git a/plugins/AvatarHistory/src/options.cpp b/plugins/AvatarHistory/src/options.cpp
index 5a30baeacf..976c9174cd 100644
--- a/plugins/AvatarHistory/src/options.cpp
+++ b/plugins/AvatarHistory/src/options.cpp
@@ -148,16 +148,16 @@ int OptInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
- odp.ptszGroup = LPGENT("History"); // group to put your item under
- odp.ptszTitle = LPGENT("Avatar"); // name of the item
+ odp.pwszGroup = LPGENW("History"); // group to put your item under
+ odp.pwszTitle = LPGENW("Avatar"); // name of the item
odp.pfnDlgProc = OptionsDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &odp);
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
- odp.ptszGroup = LPGENT("Popups");
- odp.ptszTitle = LPGENT("Avatar Change");
+ odp.pwszGroup = LPGENW("Popups");
+ odp.pwszTitle = LPGENW("Avatar Change");
odp.pfnDlgProc = PopupsDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPS);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
diff --git a/plugins/AvatarHistory/src/popup.cpp b/plugins/AvatarHistory/src/popup.cpp
index b0ad399afb..2c7bbeef11 100644
--- a/plugins/AvatarHistory/src/popup.cpp
+++ b/plugins/AvatarHistory/src/popup.cpp
@@ -55,25 +55,25 @@ void DeInitPopups()
// Show an error popup
-void ShowErrPopup(const TCHAR *description, const TCHAR *title)
+void ShowErrPopup(const wchar_t *description, const wchar_t *title)
{
ShowPopupEx(NULL, title == NULL ? _T(MODULE_NAME) L" Error" : title, description,
NULL, POPUP_TYPE_ERROR, NULL);
}
-void ShowTestPopup(MCONTACT hContact,const TCHAR *title, const TCHAR *description, const Options *op)
+void ShowTestPopup(MCONTACT hContact,const wchar_t *title, const wchar_t *description, const Options *op)
{
ShowPopupEx(hContact, title, description, NULL, POPUP_TYPE_TEST, op);
}
-void ShowPopup(MCONTACT hContact, const TCHAR *title, const TCHAR *description)
+void ShowPopup(MCONTACT hContact, const wchar_t *title, const wchar_t *description)
{
ShowPopupEx(hContact, title, description, (void*)hContact, POPUP_TYPE_NORMAL, &opts);
}
-void ShowDebugPopup(MCONTACT hContact, const TCHAR *title, const TCHAR *description)
+void ShowDebugPopup(MCONTACT hContact, const wchar_t *title, const wchar_t *description)
{
if (db_get_b(NULL,MODULE_NAME,"Debug",0))
{
@@ -89,7 +89,7 @@ typedef struct
PopupDataType;
// Show an popup
-void ShowPopupEx(MCONTACT hContact, const TCHAR *title, const TCHAR *description,
+void ShowPopupEx(MCONTACT hContact, const wchar_t *title, const wchar_t *description,
void *plugin_data, int type, const Options *op)
{
if (ServiceExists(MS_POPUP_ADDPOPUPT))
@@ -107,7 +107,7 @@ void ShowPopupEx(MCONTACT hContact, const TCHAR *title, const TCHAR *description
if (title != NULL)
mir_tstrncpy(ppd.lptzContactName, title, _countof(ppd.lptzContactName));
else if (hContact != NULL)
- mir_tstrncpy(ppd.lptzContactName, (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0),
+ mir_tstrncpy(ppd.lptzContactName, (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0),
_countof(ppd.lptzContactName));
if (description != NULL)
@@ -174,7 +174,7 @@ void ShowPopupEx(MCONTACT hContact, const TCHAR *title, const TCHAR *description
}
else
{
- MessageBox(NULL, description, title ? title : (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0),
+ MessageBox(NULL, description, title ? title : (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0),
MB_OK);
}
diff --git a/plugins/AvatarHistory/src/popup.h b/plugins/AvatarHistory/src/popup.h
index edc08e5bcb..bc12bfc544 100644
--- a/plugins/AvatarHistory/src/popup.h
+++ b/plugins/AvatarHistory/src/popup.h
@@ -29,9 +29,9 @@ struct Options {
// Popup
BOOL popup_show_changed;
- TCHAR popup_changed[1024];
+ wchar_t popup_changed[1024];
BOOL popup_show_removed;
- TCHAR popup_removed[1024];
+ wchar_t popup_removed[1024];
WORD popup_delay_type;
WORD popup_timeout;
BYTE popup_use_win_colors;
@@ -54,16 +54,16 @@ void DeInitPopups();
#define POPUP_TYPE_ERROR 2
// Show an popup
-void ShowPopup(MCONTACT hContact, const TCHAR *title, const TCHAR *description);
-void ShowDebugPopup(MCONTACT hContact, const TCHAR *title, const TCHAR *description);
+void ShowPopup(MCONTACT hContact, const wchar_t *title, const wchar_t *description);
+void ShowDebugPopup(MCONTACT hContact, const wchar_t *title, const wchar_t *description);
// Show an test
-void ShowTestPopup(MCONTACT hContact,const TCHAR *title, const TCHAR *description, const Options *op);
+void ShowTestPopup(MCONTACT hContact,const wchar_t *title, const wchar_t *description, const Options *op);
// Show an error popup
void ShowErrPopup(const char *description, const char *title = NULL);
-void ShowPopupEx(MCONTACT hContact, const TCHAR *title, const TCHAR *description,
+void ShowPopupEx(MCONTACT hContact, const wchar_t *title, const wchar_t *description,
void *plugin_data, int type, const Options *op);
diff --git a/plugins/AvatarHistory/src/stdafx.h b/plugins/AvatarHistory/src/stdafx.h
index 0c1301278b..42752e9625 100644
--- a/plugins/AvatarHistory/src/stdafx.h
+++ b/plugins/AvatarHistory/src/stdafx.h
@@ -37,7 +37,7 @@ extern DWORD mirVer;
extern MWindowList hAvatarWindowsList;
extern Options opts;
extern HANDLE hFolder;
-extern TCHAR basedir[];
+extern wchar_t basedir[];
#define MODULE_NAME "AvatarHistory"
@@ -51,8 +51,8 @@ extern TCHAR basedir[];
#define AVH_DEF_DEFPOPUPS 0
#define AVH_DEF_SHOWMENU 1
-#define DEFAULT_TEMPLATE_REMOVED LPGENT("removed his/her avatar")
-#define DEFAULT_TEMPLATE_CHANGED LPGENT("changed his/her avatar")
+#define DEFAULT_TEMPLATE_REMOVED LPGENW("removed his/her avatar")
+#define DEFAULT_TEMPLATE_CHANGED LPGENW("changed his/her avatar")
void LoadOptions();
@@ -69,14 +69,14 @@ int OpenAvatarDialog(MCONTACT hContact, char* fn);
// utils
-TCHAR* GetCachedAvatar(char *proto, TCHAR *hash);
+wchar_t* GetCachedAvatar(char *proto, wchar_t *hash);
bool ProtocolEnabled(const char *proto);
bool ContactEnabled(MCONTACT hContact, char *setting, int def);
-BOOL CopyImageFile(TCHAR *old_file, TCHAR *new_file);
-void ConvertToFilename(TCHAR *str, size_t size);
+BOOL CopyImageFile(wchar_t *old_file, wchar_t *new_file);
+void ConvertToFilename(wchar_t *str, size_t size);
-void CreateOldStyleShortcut(MCONTACT hContact, TCHAR *history_filename);
-BOOL CreateShortcut(TCHAR *file, TCHAR *shortcut);
+void CreateOldStyleShortcut(MCONTACT hContact, wchar_t *history_filename);
+BOOL CreateShortcut(wchar_t *file, wchar_t *shortcut);
#define POPUP_ACTION_DONOTHING 0
#define POPUP_ACTION_CLOSEPOPUP 1
diff --git a/plugins/AvatarHistory/src/utils.cpp b/plugins/AvatarHistory/src/utils.cpp
index c062534c32..07ef4f9e97 100644
--- a/plugins/AvatarHistory/src/utils.cpp
+++ b/plugins/AvatarHistory/src/utils.cpp
@@ -59,7 +59,7 @@ BOOL IsUnicodeAscii(const WCHAR * pBuffer, int nSize)
return TRUE;
}
-void ConvertToFilename(TCHAR *str, size_t size)
+void ConvertToFilename(wchar_t *str, size_t size)
{
for(size_t i = 0; i < size && str[i] != '\0'; i++) {
switch(str[i]) {
@@ -77,10 +77,10 @@ void ConvertToFilename(TCHAR *str, size_t size)
}
}
-TCHAR* GetExtension(TCHAR *file)
+wchar_t* GetExtension(wchar_t *file)
{
if (file == NULL) return L"";
- TCHAR *ext = _tcsrchr(file, _T('.'));
+ wchar_t *ext = wcsrchr(file, '.');
if (ext != NULL)
ext++;
else
@@ -89,7 +89,7 @@ TCHAR* GetExtension(TCHAR *file)
return ext;
}
-TCHAR* GetHistoryFolder(TCHAR *fn)
+wchar_t* GetHistoryFolder(wchar_t *fn)
{
if (fn == NULL) return NULL;
FoldersGetCustomPathT(hFolder, fn, MAX_PATH, basedir);
@@ -97,7 +97,7 @@ TCHAR* GetHistoryFolder(TCHAR *fn)
return fn;
}
-TCHAR* GetProtocolFolder(TCHAR *fn, char *proto)
+wchar_t* GetProtocolFolder(wchar_t *fn, char *proto)
{
GetHistoryFolder(fn);
@@ -109,20 +109,20 @@ TCHAR* GetProtocolFolder(TCHAR *fn, char *proto)
return fn;
}
-TCHAR* GetContactFolder(TCHAR *fn, MCONTACT hContact)
+wchar_t* GetContactFolder(wchar_t *fn, MCONTACT hContact)
{
char *proto = GetContactProto(hContact);
GetProtocolFolder(fn, proto);
- TCHAR uin[MAX_PATH];
+ wchar_t uin[MAX_PATH];
ptrT id(Contact_GetInfo(CNF_UNIQUEID, hContact, proto));
- _tcsncpy_s(uin, (id == NULL) ? TranslateT("Unknown UIN") : id, _TRUNCATE);
+ wcsncpy_s(uin, (id == NULL) ? TranslateT("Unknown UIN") : id, _TRUNCATE);
ConvertToFilename(uin, MAX_PATH); //added so that weather id's like "yw/CI0000" work
mir_sntprintf(fn, MAX_PATH, L"%s\\%s", fn, uin);
CreateDirectoryTreeT(fn);
#ifdef DBGPOPUPS
- TCHAR log[1024];
+ wchar_t log[1024];
mir_sntprintf(log, L"Path: %s\nProto: %S\nUIN: %s", fn, proto, uin);
ShowPopup(hContact, L"AVH Debug: GetContactFolder", log);
#endif
@@ -130,7 +130,7 @@ TCHAR* GetContactFolder(TCHAR *fn, MCONTACT hContact)
return fn;
}
-TCHAR* GetOldStyleAvatarName(TCHAR *fn, MCONTACT hContact)
+wchar_t* GetOldStyleAvatarName(wchar_t *fn, MCONTACT hContact)
{
GetContactFolder(fn, hContact);
@@ -144,9 +144,9 @@ TCHAR* GetOldStyleAvatarName(TCHAR *fn, MCONTACT hContact)
return fn;
}
-void CreateOldStyleShortcut(MCONTACT hContact, TCHAR *history_filename)
+void CreateOldStyleShortcut(MCONTACT hContact, wchar_t *history_filename)
{
- TCHAR shortcut[MAX_PATH] = L"";
+ wchar_t shortcut[MAX_PATH] = L"";
GetOldStyleAvatarName(shortcut, hContact);
@@ -163,18 +163,18 @@ void CreateOldStyleShortcut(MCONTACT hContact, TCHAR *history_filename)
}
}
-BOOL CopyImageFile(TCHAR *old_file, TCHAR *new_file)
+BOOL CopyImageFile(wchar_t *old_file, wchar_t *new_file)
{
- TCHAR *ext = GetExtension(old_file);
+ wchar_t *ext = GetExtension(old_file);
mir_sntprintf(new_file, MAX_PATH, L"%s.%s", new_file, ext);
return !CopyFile(old_file, new_file, TRUE);
}
-TCHAR * GetCachedAvatar(char *proto, TCHAR *hash)
+wchar_t * GetCachedAvatar(char *proto, wchar_t *hash)
{
- TCHAR *ret = NULL;
- TCHAR file[1024] = L"";
- TCHAR search[1024] = L"";
+ wchar_t *ret = NULL;
+ wchar_t file[1024] = L"";
+ wchar_t search[1024] = L"";
if (opts.log_keep_same_folder)
GetHistoryFolder(file);
else
@@ -207,7 +207,7 @@ TCHAR * GetCachedAvatar(char *proto, TCHAR *hash)
return ret;
}
-BOOL CreateShortcut(TCHAR *file, TCHAR *shortcut)
+BOOL CreateShortcut(wchar_t *file, wchar_t *shortcut)
{
IShellLink *psl = NULL;
HRESULT hr = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void **) &psl);
@@ -227,7 +227,7 @@ BOOL CreateShortcut(TCHAR *file, TCHAR *shortcut)
return SUCCEEDED(hr);
}
-BOOL ResolveShortcut(TCHAR *shortcut, TCHAR *file)
+BOOL ResolveShortcut(wchar_t *shortcut, wchar_t *file)
{
IShellLink* psl = NULL;
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp
index 442c1cfe36..acef282daf 100644
--- a/plugins/BASS_interface/src/Main.cpp
+++ b/plugins/BASS_interface/src/Main.cpp
@@ -58,7 +58,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
}
#define MAXCHAN 5
-static TCHAR CurrBassPath[MAX_PATH], tmp[MAX_PATH];
+static wchar_t CurrBassPath[MAX_PATH], tmp[MAX_PATH];
static int sndNSnd = 0, sndLimSnd;
static HSTREAM sndSSnd[MAXCHAN] = { 0 };
@@ -76,7 +76,7 @@ HANDLE hBASSFolder = NULL, hPlaySound = NULL;
static int OnPlaySnd(WPARAM wParam, LPARAM lParam)
{
- TCHAR* ptszFile = (TCHAR*)lParam;
+ wchar_t* ptszFile = (wchar_t*)lParam;
SYSTEMTIME systime;
BOOL doPlay = TRUE;
@@ -139,7 +139,7 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
SendDlgItemMessage(hwndDlg, IDC_MAXCHANNEL, CB_RESETCONTENT, 0, 0);
for (int i = 1; i <= MAXCHAN; i++)
- SendDlgItemMessage(hwndDlg, IDC_MAXCHANNEL, CB_ADDSTRING, 0, (LPARAM)_itot(i, tmp, 10));
+ SendDlgItemMessage(hwndDlg, IDC_MAXCHANNEL, CB_ADDSTRING, 0, (LPARAM)_itow(i, tmp, 10));
SendDlgItemMessage(hwndDlg, IDC_MAXCHANNEL, CB_SETCURSEL, sndLimSnd - 1, 0);
@@ -425,7 +425,7 @@ int ReloadColors(WPARAM, LPARAM)
ColourIDT colourid = { 0 };
colourid.cbSize = sizeof(colourid);
mir_tstrcpy(colourid.group, _T(ModuleName));
- mir_tstrcpy(colourid.name, LPGENT("Frame background"));
+ mir_tstrcpy(colourid.name, LPGENW("Frame background"));
clBack = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, 0);
if (hBkgBrush)
@@ -486,7 +486,7 @@ void DeleteFrame()
CallService(MS_CLIST_FRAMES_REMOVEFRAME, (WPARAM)frame_id, 0);
}
-void LoadBassLibrary(const TCHAR *ptszPath)
+void LoadBassLibrary(const wchar_t *ptszPath)
{
hBass = LoadLibrary(ptszPath);
diff --git a/plugins/BasicHistory/src/BasicHistory.cpp b/plugins/BasicHistory/src/BasicHistory.cpp
index 512c21ee8c..91150ad439 100644
--- a/plugins/BasicHistory/src/BasicHistory.cpp
+++ b/plugins/BasicHistory/src/BasicHistory.cpp
@@ -146,7 +146,7 @@ void InitTaskMenuItems()
mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.pszService = MS_HISTORY_EXECUTE_TASK;
mi.root = hTaskMainMenu;
- mi.name.t = (TCHAR*)taskIt->taskName.c_str();
+ mi.name.w = (wchar_t*)taskIt->taskName.c_str();
HGENMENU menu = Menu_AddMainMenuItem(&mi);
Menu_ConfigureItem(menu, MCI_OPT_EXECPARAM, pos++);
taskMenus.push_back(menu);
@@ -205,14 +205,14 @@ int ModulesLoaded(WPARAM, LPARAM)
{
InitMenuItems();
- TCHAR ftpExe[MAX_PATH];
+ wchar_t ftpExe[MAX_PATH];
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PROGRAM_FILES, NULL, SHGFP_TYPE_CURRENT, ftpExe))) {
- _tcscat_s(ftpExe, L"\\WinSCP\\WinSCP.exe");
+ wcscat_s(ftpExe, L"\\WinSCP\\WinSCP.exe");
DWORD atr = GetFileAttributes(ftpExe);
if (atr == INVALID_FILE_ATTRIBUTES || atr & FILE_ATTRIBUTE_DIRECTORY) {
#ifdef _WIN64
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PROGRAM_FILESX86, NULL, SHGFP_TYPE_CURRENT, ftpExe))) {
- _tcscat_s(ftpExe, L"\\WinSCP\\WinSCP.exe");
+ wcscat_s(ftpExe, L"\\WinSCP\\WinSCP.exe");
atr = GetFileAttributes(ftpExe);
if (!(atr == INVALID_FILE_ATTRIBUTES || atr & FILE_ATTRIBUTE_DIRECTORY))
Options::instance->ftpExePathDef = ftpExe;
@@ -222,8 +222,8 @@ int ModulesLoaded(WPARAM, LPARAM)
else Options::instance->ftpExePathDef = ftpExe;
}
- TCHAR *log = L"%miranda_logpath%\\BasicHistory\\ftplog.txt";
- TCHAR *logAbsolute = Utils_ReplaceVarsT(log);
+ wchar_t *log = L"%miranda_logpath%\\BasicHistory\\ftplog.txt";
+ wchar_t *logAbsolute = Utils_ReplaceVarsT(log);
Options::instance->ftpLogPath = logAbsolute;
mir_free(logAbsolute);
Options::instance->Load();
diff --git a/plugins/BasicHistory/src/BinaryExport.h b/plugins/BasicHistory/src/BinaryExport.h
index 94d92c5f1d..917e27787f 100644
--- a/plugins/BasicHistory/src/BinaryExport.h
+++ b/plugins/BasicHistory/src/BinaryExport.h
@@ -25,7 +25,7 @@ class BinaryExport :
public IImport
{
public:
- virtual const TCHAR* GetExt()
+ virtual const wchar_t* GetExt()
{
return L"bin";
}
diff --git a/plugins/BasicHistory/src/DatExport.cpp b/plugins/BasicHistory/src/DatExport.cpp
index 336adcd3e7..92975b61ff 100644
--- a/plugins/BasicHistory/src/DatExport.cpp
+++ b/plugins/BasicHistory/src/DatExport.cpp
@@ -152,7 +152,7 @@ bool DatExport::GetEventList(std::vector<IImport::ExternalMessage>& eventList)
DBEVENTINFO info = {0};
info.cbSize = sizeof(DBEVENTINFO);
info.szModule = GetContactProto(hContact);
- TCHAR _str[MAXSELECTSTR + 8]; // for safety reason
+ wchar_t _str[MAXSELECTSTR + 8]; // for safety reason
std::multimap<DWORD, IImport::ExternalMessage> sortedEvents;
while(dataSize > 0) {
messageHeader.cbSize = 0;
diff --git a/plugins/BasicHistory/src/DatExport.h b/plugins/BasicHistory/src/DatExport.h
index efe071c0ac..81fbdf61a0 100644
--- a/plugins/BasicHistory/src/DatExport.h
+++ b/plugins/BasicHistory/src/DatExport.h
@@ -25,7 +25,7 @@ class DatExport :
public IImport
{
public:
- virtual const TCHAR* GetExt()
+ virtual const wchar_t* GetExt()
{
return L"dat";
}
diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp
index c2ced6267e..eab014339e 100644
--- a/plugins/BasicHistory/src/EventList.cpp
+++ b/plugins/BasicHistory/src/EventList.cpp
@@ -300,7 +300,7 @@ void HistoryEventList::RefreshEventList()
}
}
-bool HistoryEventList::SearchInContact(MCONTACT hContact, TCHAR *strFind, ComparatorInterface* compFun)
+bool HistoryEventList::SearchInContact(MCONTACT hContact, wchar_t *strFind, ComparatorInterface* compFun)
{
InitFilters();
@@ -327,7 +327,7 @@ bool HistoryEventList::SearchInContact(MCONTACT hContact, TCHAR *strFind, Compar
EventIndex ei;
EventData ed;
- TCHAR str[MAXSELECTSTR + 8]; // for safety reason
+ wchar_t str[MAXSELECTSTR + 8]; // for safety reason
for (std::list<EventTempIndex>::iterator itL = tempList.begin(); itL != tempList.end(); ++itL) {
ei.isExternal = itL->isExternal;
ei.hEvent = itL->hEvent;
@@ -343,27 +343,27 @@ bool HistoryEventList::SearchInContact(MCONTACT hContact, TCHAR *strFind, Compar
void HistoryEventList::InitNames()
{
- TCHAR str[200];
+ wchar_t str[200];
if (m_hContact) {
- _tcscpy_s(m_contactName, pcli->pfnGetContactDisplayName(m_hContact, 0));
+ wcscpy_s(m_contactName, pcli->pfnGetContactDisplayName(m_hContact, 0));
mir_sntprintf(str, TranslateT("History for %s"), m_contactName);
}
else {
- _tcscpy_s(m_contactName, TranslateT("System"));
+ wcscpy_s(m_contactName, TranslateT("System"));
mir_sntprintf(str, TranslateT("History"));
}
if (m_isWnd)
SetWindowText(m_hWnd, str);
- _tcscpy_s(m_myName, GetMyName().c_str());
+ wcscpy_s(m_myName, GetMyName().c_str());
}
void HistoryEventList::AddGroup(const EventIndex& ev)
{
EventData data;
GetEventData(ev, data);
- TCHAR eventText[256];
+ wchar_t eventText[256];
int i;
eventText[0] = 0;
TimeZone_PrintTimeStamp(NULL, data.timestamp, L"d t", eventText, 64, 0);
@@ -374,7 +374,7 @@ void HistoryEventList::AddGroup(const EventIndex& ev)
else
user = m_contactName;
GetEventMessage(ev, eventText, 256);
- for (i = 0; eventText[i] != 0 && eventText[i] != _T('\r') && eventText[i] != _T('\n'); ++i);
+ for (i = 0; eventText[i] != 0 && eventText[i] != '\r' && eventText[i] != '\n'; ++i);
eventText[i] = 0;
if (i > Options::instance->groupMessageLen) {
eventText[Options::instance->groupMessageLen - 3] = '.';
@@ -446,15 +446,15 @@ std::wstring HistoryEventList::GetContactId()
return ::GetContactId(m_hContact);
}
-static void GetMessageDescription(DBEVENTINFO *dbei, TCHAR* buf, int cbBuf)
+static void GetMessageDescription(DBEVENTINFO *dbei, wchar_t* buf, int cbBuf)
{
- TCHAR *msg = DbGetEventTextT(dbei, CP_ACP);
- _tcsncpy_s(buf, cbBuf, msg ? msg : TranslateT("Invalid Message"), _TRUNCATE);
+ wchar_t *msg = DbGetEventTextT(dbei, CP_ACP);
+ wcsncpy_s(buf, cbBuf, msg ? msg : TranslateT("Invalid Message"), _TRUNCATE);
buf[cbBuf - 1] = 0;
mir_free(msg);
}
-void HistoryEventList::GetObjectDescription(DBEVENTINFO *dbei, TCHAR* str, int cbStr)
+void HistoryEventList::GetObjectDescription(DBEVENTINFO *dbei, wchar_t* str, int cbStr)
{
GetMessageDescription(dbei, str, cbStr);
}
@@ -599,7 +599,7 @@ void HistoryEventList::AddImporter(MCONTACT hContact, IImport::ImportType type,
{
mir_cslock lck(csEventList);
- TCHAR buf[32];
+ wchar_t buf[32];
mir_sntprintf(buf, L"%016llx", (unsigned long long int)hContact);
ImportDiscData data;
data.file = m_contactFileDir + buf;
@@ -610,7 +610,7 @@ void HistoryEventList::AddImporter(MCONTACT hContact, IImport::ImportType type,
void HistoryEventList::Init()
{
- TCHAR temp[MAX_PATH];
+ wchar_t temp[MAX_PATH];
temp[0] = 0;
GetTempPath(MAX_PATH, temp);
m_contactFileDir = temp;
diff --git a/plugins/BasicHistory/src/EventList.h b/plugins/BasicHistory/src/EventList.h
index 8f4f65089a..52c70e64c1 100644
--- a/plugins/BasicHistory/src/EventList.h
+++ b/plugins/BasicHistory/src/EventList.h
@@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
class ComparatorInterface
{
public:
- virtual bool Compare(const bool isMe, const std::wstring& message, TCHAR *strFind) = 0;
+ virtual bool Compare(const bool isMe, const std::wstring& message, wchar_t *strFind) = 0;
};
class HistoryEventList
@@ -84,8 +84,8 @@ private:
void ImportMessages(const std::vector<IImport::ExternalMessage>& messages);
protected:
- TCHAR m_contactName[256];
- TCHAR m_myName[256];
+ wchar_t m_contactName[256];
+ wchar_t m_myName[256];
bool m_isWnd;
bool m_isFlat;
int m_deltaTime;
@@ -117,7 +117,7 @@ public:
int GetFilterNr();
std::wstring GetFilterName();
void RefreshEventList();
- bool SearchInContact(MCONTACT hContact, TCHAR *strFind, ComparatorInterface* compFun);
+ bool SearchInContact(MCONTACT hContact, wchar_t *strFind, ComparatorInterface* compFun);
std::wstring GetContactName();
std::wstring GetMyName();
std::wstring GetProtocolName();
@@ -129,18 +129,18 @@ public:
static int GetContactMessageNumber(MCONTACT hContact);
static bool IsImportedHistory(MCONTACT hContact);
static void DeleteImporter(MCONTACT hContact);
- static void GetObjectDescription( DBEVENTINFO *dbei, TCHAR* str, int cbStr );
+ static void GetObjectDescription( DBEVENTINFO *dbei, wchar_t* str, int cbStr );
bool GetEventData(const EventIndex& ev, EventData& data);
void GetExtEventDBei(const EventIndex& ev);
HICON GetEventCoreIcon(const EventIndex& ev);
- void GetEventMessage(const EventIndex& ev, TCHAR* message) // must be allocated with MAXSELECTSTR len
+ void GetEventMessage(const EventIndex& ev, wchar_t* message) // must be allocated with MAXSELECTSTR len
{
if (!ev.isExternal)
GetObjectDescription(&m_dbei, message, MAXSELECTSTR);
else
- _tcscpy_s(message, MAXSELECTSTR, m_importedMessages[ev.exIdx].message.c_str());
+ wcscpy_s(message, MAXSELECTSTR, m_importedMessages[ev.exIdx].message.c_str());
}
- void GetEventMessage(const EventIndex& ev, TCHAR* message, int strLen)
+ void GetEventMessage(const EventIndex& ev, wchar_t* message, int strLen)
{
if (!ev.isExternal)
GetObjectDescription(&m_dbei, message, strLen);
@@ -149,12 +149,12 @@ public:
std::wstring& meg = m_importedMessages[ev.exIdx].message;
if ((int)meg.size() >= strLen)
{
- memcpy_s(message, strLen * sizeof(TCHAR), meg.c_str(), (strLen - 1) * sizeof(TCHAR));
+ memcpy_s(message, strLen * sizeof(wchar_t), meg.c_str(), (strLen - 1) * sizeof(wchar_t));
message[strLen - 1] = 0;
}
else
{
- _tcscpy_s(message, strLen, meg.c_str());
+ wcscpy_s(message, strLen, meg.c_str());
}
}
}
diff --git a/plugins/BasicHistory/src/ExportManager.cpp b/plugins/BasicHistory/src/ExportManager.cpp
index d783fde17f..c2168d861c 100644
--- a/plugins/BasicHistory/src/ExportManager.cpp
+++ b/plugins/BasicHistory/src/ExportManager.cpp
@@ -33,23 +33,23 @@ ExportManager::ExportManager(HWND hwnd, MCONTACT hContact, int filter) :
{
}
-std::wstring GetFile(const TCHAR* ext, HWND hwnd, bool open)
+std::wstring GetFile(const wchar_t* ext, HWND hwnd, bool open)
{
- TCHAR filter[512];
+ wchar_t filter[512];
std::locale loc;
- TCHAR extUpper[32];
+ wchar_t extUpper[32];
- _tcscpy_s(extUpper, ext);
+ wcscpy_s(extUpper, ext);
extUpper[0] = std::toupper(ext[0], loc);
mir_sntprintf(filter, TranslateT("%s Files (*.%s)"), extUpper, ext);
size_t len = mir_tstrlen(filter) + 1;
mir_sntprintf(filter + len, _countof(filter) - len, L"*.%s", ext);
len += mir_tstrlen(filter + len);
filter[++len] = 0;
- TCHAR stzFilePath[1024];
- _tcscpy_s(stzFilePath, TranslateT("History"));
- _tcscat_s(stzFilePath, L".");
- _tcscat_s(stzFilePath, ext);
+ wchar_t stzFilePath[1024];
+ wcscpy_s(stzFilePath, TranslateT("History"));
+ wcscat_s(stzFilePath, L".");
+ wcscat_s(stzFilePath, ext);
len = mir_tstrlen(stzFilePath) + 1;
stzFilePath[len] = 0;
OPENFILENAME ofn = {0};
@@ -75,7 +75,7 @@ std::wstring GetFile(const TCHAR* ext, HWND hwnd, bool open)
return L"";
}
-std::wstring ReplaceExt(const std::wstring& file, const TCHAR* ext)
+std::wstring ReplaceExt(const std::wstring& file, const wchar_t* ext)
{
size_t pos = file.find(L"<ext>");
if (pos < file.length()) {
@@ -178,7 +178,7 @@ bool ExportManager::Export(IExport::ExportType type)
return true;
}
-const TCHAR* ExportManager::GetExt(IImport::ImportType type)
+const wchar_t* ExportManager::GetExt(IImport::ImportType type)
{
IImport *imp = NULL;
switch(type) {
@@ -192,7 +192,7 @@ const TCHAR* ExportManager::GetExt(IImport::ImportType type)
return L"";
}
- const TCHAR *ext = imp->GetExt();
+ const wchar_t *ext = imp->GetExt();
delete imp;
return ext;
}
@@ -294,7 +294,7 @@ void ExportManager::AddGroup(bool isMe, const std::wstring &time, const std::wst
return;
m_exp->WriteGroup(isMe, time, user, eventText);
- TCHAR str[MAXSELECTSTR + 8]; // for safety reason
+ wchar_t str[MAXSELECTSTR + 8]; // for safety reason
str[0] = 0;
bool isFirst = true;
bool lastMe = false;
@@ -312,8 +312,8 @@ void ExportManager::AddGroup(bool isMe, const std::wstring &time, const std::wst
if (GetEventData(hDbEvent, data)) {
lastMe = data.isMe;
- TCHAR* formatDate = Options::instance->messagesShowSec ? L"d s" : L"d t";
- TCHAR* longFormatDate = Options::instance->messagesShowSec ? L"d s" : L"d t";
+ wchar_t* formatDate = Options::instance->messagesShowSec ? L"d s" : L"d t";
+ wchar_t* longFormatDate = Options::instance->messagesShowSec ? L"d s" : L"d t";
if (!Options::instance->messagesShowDate) {
if (isFirst) {
isFirst = false;
diff --git a/plugins/BasicHistory/src/ExportManager.h b/plugins/BasicHistory/src/ExportManager.h
index 1cefb47463..73cd4ca1b7 100644
--- a/plugins/BasicHistory/src/ExportManager.h
+++ b/plugins/BasicHistory/src/ExportManager.h
@@ -55,6 +55,6 @@ public:
void DeleteExportedEvents();
int Import(IImport::ImportType type, const std::vector<MCONTACT> &contacts);
bool Import(IImport::ImportType type, std::vector<IImport::ExternalMessage> &eventList, std::wstring *err = NULL, bool *differentContact = NULL, std::vector<MCONTACT> *contacts = NULL);
- static const TCHAR* GetExt(IImport::ImportType type);
+ static const wchar_t* GetExt(IImport::ImportType type);
};
diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp
index ecfe7e8e2b..499488c6e4 100644
--- a/plugins/BasicHistory/src/HistoryWindow.cpp
+++ b/plugins/BasicHistory/src/HistoryWindow.cpp
@@ -388,7 +388,7 @@ INT_PTR HistoryWindow::DeleteAllUserHistory(WPARAM hContact, LPARAM)
}
}
- TCHAR *message = TranslateT("This operation will PERMANENTLY REMOVE all history for this contact.\nAre you sure you want to do this?");
+ wchar_t *message = TranslateT("This operation will PERMANENTLY REMOVE all history for this contact.\nAre you sure you want to do this?");
if (MessageBox(hWnd, message, TranslateT("Are You sure?"), MB_OKCANCEL | MB_ICONERROR) != IDOK)
return FALSE;
@@ -427,7 +427,7 @@ bool HistoryWindow::IsInList(HWND hWnd)
void ClickLink(HWND hwnd, ENLINK *penLink)
{
- TCHAR buf[1024];
+ wchar_t buf[1024];
if (penLink->msg != WM_LBUTTONUP)
return;
@@ -566,14 +566,14 @@ INT_PTR CALLBACK HistoryWindow::DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wP
if (HIWORD(wParam) == BN_CLICKED) {
if (Button_GetCheck(GetDlgItem(hwndDlg, IDC_SHOWHIDE)) & BST_CHECKED) {
SendDlgItemMessage(hwndDlg, IDC_SHOWHIDE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)historyWindow->minusIco);
- SendDlgItemMessage(hwndDlg, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Hide Contacts"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Hide Contacts"), BATF_TCHAR);
historyWindow->isContactList = true;
ShowWindow(GetDlgItem(hwndDlg, IDC_LIST_CONTACTS), SW_SHOW);
ShowWindow(historyWindow->splitterYhWnd, SW_SHOW);
}
else {
SendDlgItemMessage(hwndDlg, IDC_SHOWHIDE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)historyWindow->plusIco);
- SendDlgItemMessage(hwndDlg, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Show Contacts"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show Contacts"), BATF_TCHAR);
historyWindow->isContactList = false;
ShowWindow(GetDlgItem(hwndDlg, IDC_LIST_CONTACTS), SW_HIDE);
ShowWindow(historyWindow->splitterYhWnd, SW_HIDE);
@@ -728,7 +728,7 @@ INT_PTR CALLBACK HistoryWindow::DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wP
TEXTRANGE tr;
tr.chrg.cpMin = iStart;
tr.chrg.cpMax = iEnd;
- tr.lpstrText = new TCHAR[iEnd - iStart + 1];
+ tr.lpstrText = new wchar_t[iEnd - iStart + 1];
SendMessage(historyWindow->editWindow, EM_GETTEXTRANGE, 0, (LPARAM)& tr);
historyWindow->FormatQuote(quote, historyWindow->currentGroup[start], tr.lpstrText);
delete[] tr.lpstrText;
@@ -988,13 +988,13 @@ void HistoryWindow::Initialise()
SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BUTTONSETASFLATBTN, TRUE, 0);
if (m_hContact == NULL || Options::instance->showContacts) {
SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)minusIco);
- SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Hide Contacts"), BATF_TCHAR);
+ SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Hide Contacts"), BATF_TCHAR);
Button_SetCheck(GetDlgItem(m_hWnd, IDC_SHOWHIDE), BST_CHECKED);
isContactList = true;
}
else {
SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)plusIco);
- SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Show Contacts"), BATF_TCHAR);
+ SendDlgItemMessage(m_hWnd, IDC_SHOWHIDE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show Contacts"), BATF_TCHAR);
Button_SetCheck(GetDlgItem(m_hWnd, IDC_SHOWHIDE), BST_UNCHECKED);
ShowWindow(GetDlgItem(m_hWnd, IDC_LIST_CONTACTS), SW_HIDE);
ShowWindow(splitterYhWnd, SW_HIDE);
@@ -1226,21 +1226,21 @@ void HistoryWindow::FillHistoryThread(void* param)
void HistoryWindow::AddGroup(bool, const std::wstring &time, const std::wstring &user, const std::wstring &eventText, int ico)
{
- TCHAR msg[256];
+ wchar_t msg[256];
msg[0] = 0;
if (Options::instance->groupShowTime)
- _tcscpy_s(msg, time.c_str());
+ wcscpy_s(msg, time.c_str());
if (Options::instance->groupShowName) {
if (msg[0] != 0)
- _tcscat_s(msg, L" ");
- _tcscat_s(msg, user.c_str());
+ wcscat_s(msg, L" ");
+ wcscat_s(msg, user.c_str());
}
if (Options::instance->groupShowMessage) {
if (msg[0] != 0)
- _tcscat_s(msg, L" ");
- _tcscat_s(msg, eventText.c_str());
+ wcscat_s(msg, L" ");
+ wcscat_s(msg, eventText.c_str());
}
LVITEM item = { 0 };
@@ -1295,8 +1295,8 @@ void HistoryWindow::SelectEventGroup(int sel)
if (sel < 0 || sel >= (int)m_eventList.size())
return;
- TCHAR _str[MAXSELECTSTR + 8]; // for safety reason
- TCHAR *str = _str + sizeof(int) / sizeof(TCHAR);
+ wchar_t _str[MAXSELECTSTR + 8]; // for safety reason
+ wchar_t *str = _str + sizeof(int) / sizeof(wchar_t);
BSTR pStr = str;
unsigned int *strLen = (unsigned int*)_str;
str[0] = 0;
@@ -1339,9 +1339,9 @@ void HistoryWindow::SelectEventGroup(int sel)
lastMe = data.isMe;
backColor = Options::instance->GetColor(lastMe ? Options::OutBackground : Options::InBackground);
if (Options::instance->messagesShowEvents) {
- str[0] = _T('>');
+ str[0] = '>';
str[1] = 0;
- *strLen = 1 * sizeof(TCHAR);
+ *strLen = 1 * sizeof(wchar_t);
TextSelection->SetStart(MAXLONG);
TextSelection->GetFont(&TextFont);
TextFont->SetBackColor(backColor);
@@ -1360,7 +1360,7 @@ void HistoryWindow::SelectEventGroup(int sel)
ImageDataObject::InsertIcon(RichEditOle, ico, backColor, 16, 16);
}
- TCHAR* formatDate = Options::instance->messagesShowSec ? (isUser ? L"d s " : L"d s\n") : (isUser ? L"d t " : L"d t\n");
+ wchar_t* formatDate = Options::instance->messagesShowSec ? (isUser ? L"d s " : L"d s\n") : (isUser ? L"d t " : L"d t\n");
if (!Options::instance->messagesShowDate) {
if (isFirst) {
isFirst = false;
@@ -1378,7 +1378,7 @@ void HistoryWindow::SelectEventGroup(int sel)
}
TimeZone_PrintTimeStamp(NULL, data.timestamp, formatDate, str, MAXSELECTSTR, 0);
- *strLen = (unsigned int)mir_tstrlen(str) * sizeof(TCHAR);
+ *strLen = (unsigned int)mir_tstrlen(str) * sizeof(wchar_t);
TextSelection->SetStart(MAXLONG);
TextSelection->GetFont(&TextFont);
SetFontFromOptions(TextFont, caps, lastMe ? Options::OutTimestamp : Options::InTimestamp);
@@ -1388,7 +1388,7 @@ void HistoryWindow::SelectEventGroup(int sel)
if (isUser) {
mir_sntprintf(str, MAXSELECTSTR, L"%s\n", (lastMe) ? m_myName : m_contactName);
- *strLen = (unsigned int)mir_tstrlen(str) * sizeof(TCHAR);
+ *strLen = (unsigned int)mir_tstrlen(str) * sizeof(wchar_t);
TextSelection->SetStart(MAXLONG);
TextSelection->GetFont(&TextFont);
SetFontFromOptions(TextFont, caps, lastMe ? Options::OutName : Options::InName);
@@ -1401,9 +1401,9 @@ void HistoryWindow::SelectEventGroup(int sel)
size_t i = strStl.length();
if (i + 1 >= MAXSELECTSTR)
continue;
- str[i++] = _T('\n');
+ str[i++] = '\n';
str[i] = 0;
- *strLen = (unsigned int)i * sizeof(TCHAR);
+ *strLen = (unsigned int)i * sizeof(wchar_t);
TextSelection->SetStart(MAXLONG);
TextSelection->GetFont(&TextFont);
SetFontFromOptions(TextFont, caps, lastMe ? Options::OutMessages : Options::InMessages);
@@ -1944,7 +1944,7 @@ void HistoryWindow::Delete(int what)
if (toDelete == 0)
return;
- TCHAR message[256];
+ wchar_t message[256];
mir_sntprintf(message, TranslateT("Number of history items to delete: %d.\nAre you sure you want to do this?"), toDelete);
if (MessageBox(m_hWnd, message, TranslateT("Are You sure?"), MB_OKCANCEL | MB_ICONERROR) != IDOK)
return;
@@ -1960,7 +1960,7 @@ void HistoryWindow::Delete(int what)
rebuild = (start == 0 && end == currentGroup.size());
if (areImpMessages) {
- TCHAR *ptszMsg = TranslateT("Do you want to delete all imported messages for this contact?\nNote that next scheduler task import this messages again.");
+ wchar_t *ptszMsg = TranslateT("Do you want to delete all imported messages for this contact?\nNote that next scheduler task import this messages again.");
if (MessageBox(m_hWnd, ptszMsg, TranslateT("Are You sure?"), MB_YESNO | MB_ICONERROR) == IDYES) {
HistoryEventList::DeleteImporter(m_hContact);
rebuild = true;
@@ -2030,7 +2030,7 @@ void HistoryWindow::FormatQuote(std::wstring &quote, const MessageData &md, cons
quote += m_myName;
else
quote += m_contactName;
- TCHAR str[32];
+ wchar_t str[32];
TimeZone_PrintTimeStamp(NULL, md.timestamp, L"d t", str, 32, 0);
quote += L", ";
quote += str;
@@ -2046,7 +2046,7 @@ void HistoryWindow::FormatQuote(std::wstring &quote, const MessageData &md, cons
}
f = nf + 1;
- if (msg[nf] == _T('\r') && f < (int)msg.length() && msg[f] == _T('\n'))
+ if (msg[nf] == '\r' && f < (int)msg.length() && msg[f] == '\n')
++f;
}
else if (msg.length() - f > 0) {
diff --git a/plugins/BasicHistory/src/IExport.h b/plugins/BasicHistory/src/IExport.h
index d024a084e4..b9edc83d02 100644
--- a/plugins/BasicHistory/src/IExport.h
+++ b/plugins/BasicHistory/src/IExport.h
@@ -36,7 +36,7 @@ public:
stream = str;
}
- virtual const TCHAR* GetExt() = 0;
+ virtual const wchar_t* GetExt() = 0;
virtual void WriteHeader(const std::wstring &fileName, const std::wstring &filterName, const std::wstring &myName, const std::wstring &myId, const std::wstring &name1, const std::wstring &proto1, const std::wstring &id1, const std::string& baseProto1, const std::wstring& encoding) = 0;
virtual void WriteFooter() = 0;
virtual void WriteGroup(bool isMe, const std::wstring &time, const std::wstring &user, const std::wstring &eventText) = 0;
diff --git a/plugins/BasicHistory/src/IImport.h b/plugins/BasicHistory/src/IImport.h
index 84a65c15f2..6752bf9eef 100644
--- a/plugins/BasicHistory/src/IImport.h
+++ b/plugins/BasicHistory/src/IImport.h
@@ -42,7 +42,7 @@ public:
stream = str;
}
- virtual const TCHAR* GetExt() = 0;
+ virtual const wchar_t* GetExt() = 0;
virtual int IsContactInFile(const std::vector<MCONTACT>& contacts) = 0;
virtual bool GetEventList(std::vector<ExternalMessage>& eventList) = 0;
diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp
index d464b4299c..262b46e47c 100644
--- a/plugins/BasicHistory/src/Options.cpp
+++ b/plugins/BasicHistory/src/Options.cpp
@@ -31,22 +31,22 @@ Options *Options::instance;
struct EventNamesType
{
int id;
- TCHAR* name;
+ wchar_t* name;
}
EventNames[] =
{
- EVENTTYPE_MESSAGE, LPGENT("Message"),
- EVENTTYPE_FILE, LPGENT("File transfer"),
- EVENTTYPE_URL, LPGENT("Link"),
- EVENTTYPE_AUTHREQUEST, LPGENT("Authorization request"),
- EVENTTYPE_ADDED, LPGENT("You were added"),
- EVENTTYPE_CONTACTS, LPGENT("Contacts received"),
- ICQEVENTTYPE_SMS, LPGENT("SMS message")
+ EVENTTYPE_MESSAGE, LPGENW("Message"),
+ EVENTTYPE_FILE, LPGENW("File transfer"),
+ EVENTTYPE_URL, LPGENW("Link"),
+ EVENTTYPE_AUTHREQUEST, LPGENW("Authorization request"),
+ EVENTTYPE_ADDED, LPGENW("You were added"),
+ EVENTTYPE_CONTACTS, LPGENW("Contacts received"),
+ ICQEVENTTYPE_SMS, LPGENW("SMS message")
};
struct TCpTable {
UINT cpId;
- TCHAR *cpName;
+ wchar_t *cpName;
}
cpTable[] = {
{ CP_UTF8, L"UTF-8" },
@@ -123,34 +123,34 @@ int Options::InitOptions(WPARAM wParam, LPARAM)
odp.position = 100000000;
odp.hInstance = hInst;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.ptszTitle = LPGENT("History");
+ odp.pwszTitle = LPGENW("History");
- odp.ptszTab = LPGENT("Group list");
+ odp.pwszTab = LPGENW("Group list");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GROUPLIST);
odp.pfnDlgProc = Options::DlgProcOptsGroupList;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Messages");
+ odp.pwszTab = LPGENW("Messages");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MESSAGES);
odp.pfnDlgProc = Options::DlgProcOptsMessages;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Searching");
+ odp.pwszTab = LPGENW("Searching");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SEARCHING);
odp.pfnDlgProc = Options::DlgProcOptsSearching;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Export");
+ odp.pwszTab = LPGENW("Export");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_EXPORT);
odp.pfnDlgProc = Options::DlgProcOptsExport;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Scheduler");
+ odp.pwszTab = LPGENW("Scheduler");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SCHEDULER);
odp.pfnDlgProc = Options::DlgProcOptsScheduler;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Advanced");
+ odp.pwszTab = LPGENW("Advanced");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MAIN);
odp.pfnDlgProc = Options::DlgProcOptsMain;
Options_AddPage(wParam, &odp);
@@ -158,69 +158,69 @@ int Options::InitOptions(WPARAM wParam, LPARAM)
}
struct FontOptionsList {
- TCHAR* szDescr;
+ wchar_t* szDescr;
COLORREF defColour;
- TCHAR* szDefFace;
+ wchar_t* szDefFace;
BYTE defStyle;
char defSize;
- TCHAR* szBackgroundName;
+ wchar_t* szBackgroundName;
DWORD flags;
};
struct ColorOptionsList {
- TCHAR* tszName;
+ wchar_t* tszName;
COLORREF def;
};
struct HotkeyOptionsList {
const char *pszName;
- const TCHAR *ptszDescription;
- const TCHAR *ptszSection;
+ const wchar_t *ptszDescription;
+ const wchar_t *ptszSection;
const char *pszService;
WORD DefHotKey;
LPARAM lParam;
};
static FontOptionsList g_FontOptionsList[] = {
- {LPGENT(">> Outgoing timestamp"), RGB(0, 0, 0), L"MS Shell Dlg 2", DBFONTF_BOLD, -11, LPGENT("Outgoing background"), FIDF_ALLOWEFFECTS},
- {LPGENT("<< Incoming timestamp"), RGB(0, 0, 0), L"MS Shell Dlg 2", DBFONTF_BOLD, -11, LPGENT("Incoming background"), FIDF_ALLOWEFFECTS},
- {LPGENT(">> Outgoing name"), RGB(100,100,100), L"MS Shell Dlg 2", DBFONTF_BOLD, -11, LPGENT("Outgoing background"), FIDF_ALLOWEFFECTS},
- {LPGENT("<< Incoming name"), RGB(90,160,90), L"MS Shell Dlg 2", DBFONTF_BOLD, -11, LPGENT("Incoming background"), FIDF_ALLOWEFFECTS},
- {LPGENT(">> Outgoing messages"), RGB(0, 0, 0), L"MS Shell Dlg 2", 0, -11, LPGENT("Outgoing background"), FIDF_ALLOWEFFECTS},
- {LPGENT("<< Incoming messages"), RGB(0, 0, 0), L"MS Shell Dlg 2", 0, -11, LPGENT("Incoming background"), FIDF_ALLOWEFFECTS},
- {LPGENT("Group list"), RGB(0, 0, 0), L"MS Shell Dlg 2", 0, -11, LPGENT("Group list background"), FIDF_DISABLESTYLES},
- {LPGENT("Find window"), RGB(0, 0, 0), L"MS Shell Dlg 2", 0, -11, LPGENT("Find window background"), FIDF_DISABLESTYLES},
+ {LPGENW(">> Outgoing timestamp"), RGB(0, 0, 0), L"MS Shell Dlg 2", DBFONTF_BOLD, -11, LPGENW("Outgoing background"), FIDF_ALLOWEFFECTS},
+ {LPGENW("<< Incoming timestamp"), RGB(0, 0, 0), L"MS Shell Dlg 2", DBFONTF_BOLD, -11, LPGENW("Incoming background"), FIDF_ALLOWEFFECTS},
+ {LPGENW(">> Outgoing name"), RGB(100,100,100), L"MS Shell Dlg 2", DBFONTF_BOLD, -11, LPGENW("Outgoing background"), FIDF_ALLOWEFFECTS},
+ {LPGENW("<< Incoming name"), RGB(90,160,90), L"MS Shell Dlg 2", DBFONTF_BOLD, -11, LPGENW("Incoming background"), FIDF_ALLOWEFFECTS},
+ {LPGENW(">> Outgoing messages"), RGB(0, 0, 0), L"MS Shell Dlg 2", 0, -11, LPGENW("Outgoing background"), FIDF_ALLOWEFFECTS},
+ {LPGENW("<< Incoming messages"), RGB(0, 0, 0), L"MS Shell Dlg 2", 0, -11, LPGENW("Incoming background"), FIDF_ALLOWEFFECTS},
+ {LPGENW("Group list"), RGB(0, 0, 0), L"MS Shell Dlg 2", 0, -11, LPGENW("Group list background"), FIDF_DISABLESTYLES},
+ {LPGENW("Find window"), RGB(0, 0, 0), L"MS Shell Dlg 2", 0, -11, LPGENW("Find window background"), FIDF_DISABLESTYLES},
};
static ColorOptionsList g_ColorOptionsList[] = {
- LPGENT("Outgoing background"), RGB(245,245,255),
- LPGENT("Incoming background"), RGB(245,255,245),
- LPGENT("Group list background"), GetSysColor(COLOR_3DFACE),
- LPGENT("Window background"), GetSysColor(COLOR_3DFACE),
- LPGENT("Contact list background"), GetSysColor(COLOR_3DFACE),
- LPGENT("Find window background"), GetSysColor(COLOR_WINDOW),
+ LPGENW("Outgoing background"), RGB(245,245,255),
+ LPGENW("Incoming background"), RGB(245,255,245),
+ LPGENW("Group list background"), GetSysColor(COLOR_3DFACE),
+ LPGENW("Window background"), GetSysColor(COLOR_3DFACE),
+ LPGENW("Contact list background"), GetSysColor(COLOR_3DFACE),
+ LPGENW("Find window background"), GetSysColor(COLOR_WINDOW),
};
static HotkeyOptionsList g_HotkeyOptionsList[] = {
- { "basichistory_hot_showall", LPGENT("Open global history"), LPGENT("History"), MS_HISTORY_SHOWCONTACTHISTORY, HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'H') | HKF_MIRANDA_LOCAL, 0 },
- { "basichistory_hot_find", LPGENT("Find"), LPGENT("History"), 0, HOTKEYCODE(HOTKEYF_CONTROL, 'F'), HISTORY_HK_FIND },
- { "basichistory_hot_findnext", LPGENT("Find Next"), LPGENT("History"), 0, VK_F3, HISTORY_HK_FINDNEXT },
- { "basichistory_hot_findprev", LPGENT("Find Previous"), LPGENT("History"), 0, VK_F2, HISTORY_HK_FINDPREV },
- { "basichistory_hot_matchcase", LPGENT("Switch Match Case"), LPGENT("History"), 0, 0, HISTORY_HK_MATCHCASE },
- { "basichistory_hot_matchwhole", LPGENT("Switch Match Whole Word"), LPGENT("History"), 0, 0, HISTORY_HK_MATCHWHOLE },
- { "basichistory_hot_showcontacts", LPGENT("Show/Hide Contacts"), LPGENT("History"), 0, 0, HISTORY_HK_SHOWCONTACTS },
- { "basichistory_hot_onlyin", LPGENT("Switch Only Incoming Messages"), LPGENT("History"), 0, 0, HISTORY_HK_ONLYIN },
- { "basichistory_hot_onlyout", LPGENT("Switch Only Outgoing Messages"), LPGENT("History"), 0, 0, HISTORY_HK_ONLYOUT },
- { "basichistory_hot_onlygroup", LPGENT("Switch Only Selected Group"), LPGENT("History"), 0, 0, HISTORY_HK_ONLYGROUP },
- { "basichistory_hot_allcontacts", LPGENT("Switch All Contacts"), LPGENT("History"), 0, 0, HISTORY_HK_ALLCONTACTS },
- { "basichistory_hot_delete", LPGENT("Delete"), LPGENT("History"), 0, VK_DELETE, HISTORY_HK_DELETE },
- { "basichistory_hot_exrhtml", LPGENT("Export To Rich Html"), LPGENT("History"), 0, 0, HISTORY_HK_EXRHTML },
- { "basichistory_hot_exphtml", LPGENT("Export To Plain Html"), LPGENT("History"), 0, 0, HISTORY_HK_EXPHTML },
- { "basichistory_hot_extxt", LPGENT("Export To Txt"), LPGENT("History"), 0, 0, HISTORY_HK_EXTXT },
- { "basichistory_hot_exbin", LPGENT("Export To Binary"), LPGENT("History"), 0, 0, HISTORY_HK_EXBIN },
- { "basichistory_hot_impbin", LPGENT("Import From Binary"), LPGENT("History"), 0, 0, HISTORY_HK_IMPBIN },
- { "basichistory_hot_exdat", LPGENT("Export To Dat (mContacts)"), LPGENT("History"), 0, 0, HISTORY_HK_EXDAT },
- { "basichistory_hot_impdat", LPGENT("Import From Dat (mContacts)"), LPGENT("History"), 0, 0, HISTORY_HK_IMPDAT },
+ { "basichistory_hot_showall", LPGENW("Open global history"), LPGENW("History"), MS_HISTORY_SHOWCONTACTHISTORY, HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'H') | HKF_MIRANDA_LOCAL, 0 },
+ { "basichistory_hot_find", LPGENW("Find"), LPGENW("History"), 0, HOTKEYCODE(HOTKEYF_CONTROL, 'F'), HISTORY_HK_FIND },
+ { "basichistory_hot_findnext", LPGENW("Find Next"), LPGENW("History"), 0, VK_F3, HISTORY_HK_FINDNEXT },
+ { "basichistory_hot_findprev", LPGENW("Find Previous"), LPGENW("History"), 0, VK_F2, HISTORY_HK_FINDPREV },
+ { "basichistory_hot_matchcase", LPGENW("Switch Match Case"), LPGENW("History"), 0, 0, HISTORY_HK_MATCHCASE },
+ { "basichistory_hot_matchwhole", LPGENW("Switch Match Whole Word"), LPGENW("History"), 0, 0, HISTORY_HK_MATCHWHOLE },
+ { "basichistory_hot_showcontacts", LPGENW("Show/Hide Contacts"), LPGENW("History"), 0, 0, HISTORY_HK_SHOWCONTACTS },
+ { "basichistory_hot_onlyin", LPGENW("Switch Only Incoming Messages"), LPGENW("History"), 0, 0, HISTORY_HK_ONLYIN },
+ { "basichistory_hot_onlyout", LPGENW("Switch Only Outgoing Messages"), LPGENW("History"), 0, 0, HISTORY_HK_ONLYOUT },
+ { "basichistory_hot_onlygroup", LPGENW("Switch Only Selected Group"), LPGENW("History"), 0, 0, HISTORY_HK_ONLYGROUP },
+ { "basichistory_hot_allcontacts", LPGENW("Switch All Contacts"), LPGENW("History"), 0, 0, HISTORY_HK_ALLCONTACTS },
+ { "basichistory_hot_delete", LPGENW("Delete"), LPGENW("History"), 0, VK_DELETE, HISTORY_HK_DELETE },
+ { "basichistory_hot_exrhtml", LPGENW("Export To Rich Html"), LPGENW("History"), 0, 0, HISTORY_HK_EXRHTML },
+ { "basichistory_hot_exphtml", LPGENW("Export To Plain Html"), LPGENW("History"), 0, 0, HISTORY_HK_EXPHTML },
+ { "basichistory_hot_extxt", LPGENW("Export To Txt"), LPGENW("History"), 0, 0, HISTORY_HK_EXTXT },
+ { "basichistory_hot_exbin", LPGENW("Export To Binary"), LPGENW("History"), 0, 0, HISTORY_HK_EXBIN },
+ { "basichistory_hot_impbin", LPGENW("Import From Binary"), LPGENW("History"), 0, 0, HISTORY_HK_IMPBIN },
+ { "basichistory_hot_exdat", LPGENW("Export To Dat (mContacts)"), LPGENW("History"), 0, 0, HISTORY_HK_EXDAT },
+ { "basichistory_hot_impdat", LPGENW("Import From Dat (mContacts)"), LPGENW("History"), 0, 0, HISTORY_HK_IMPDAT },
};
const int g_fontsSize = _countof(g_FontOptionsList);
@@ -238,26 +238,26 @@ void Options::Load(void)
cid.cbSize = sizeof(ColourIDT);
hid.cbSize = sizeof(HOTKEYDESC);
strncpy_s(fid.dbSettingsGroup, "BasicHistory_Fonts", _TRUNCATE);
- _tcsncpy_s(fid.backgroundGroup, L"History", _TRUNCATE);
- _tcsncpy_s(fid.group, LPGENT("History"), _TRUNCATE);
+ wcsncpy_s(fid.backgroundGroup, L"History", _TRUNCATE);
+ wcsncpy_s(fid.group, LPGENW("History"), _TRUNCATE);
for (int i = 0; i < g_fontsSize; ++i) {
fid.order = i;
- _tcsncpy_s(fid.deffontsettings.szFace, g_FontOptionsList[i].szDefFace, _TRUNCATE);
+ wcsncpy_s(fid.deffontsettings.szFace, g_FontOptionsList[i].szDefFace, _TRUNCATE);
fid.deffontsettings.size = g_FontOptionsList[i].defSize;
fid.deffontsettings.colour = g_FontOptionsList[i].defColour;
fid.deffontsettings.style = g_FontOptionsList[i].defStyle;
fid.deffontsettings.charset = DEFAULT_CHARSET;
mir_snprintf(fid.prefix, _countof(fid.prefix), "Font%d", i);
- _tcsncpy_s(fid.name, g_FontOptionsList[i].szDescr, _TRUNCATE);
- _tcsncpy_s(fid.backgroundName, g_FontOptionsList[i].szBackgroundName, _TRUNCATE);
+ wcsncpy_s(fid.name, g_FontOptionsList[i].szDescr, _TRUNCATE);
+ wcsncpy_s(fid.backgroundName, g_FontOptionsList[i].szBackgroundName, _TRUNCATE);
fid.flags = FIDF_DEFAULTVALID | FIDF_CLASSGENERAL | g_FontOptionsList[i].flags;
FontRegisterT(&fid);
}
strncpy_s(cid.dbSettingsGroup, "BasicHistory_Fonts", _TRUNCATE);
- _tcsncpy_s(cid.group, LPGENT("History"), _TRUNCATE);
+ wcsncpy_s(cid.group, LPGENW("History"), _TRUNCATE);
for (int i = 0; i < g_colorsSize; ++i) {
- _tcsncpy_s(cid.name, g_ColorOptionsList[i].tszName, _TRUNCATE);
+ wcsncpy_s(cid.name, g_ColorOptionsList[i].tszName, _TRUNCATE);
mir_snprintf(cid.setting, _countof(cid.setting), "Color%d", i);
cid.order = i;
cid.defcolour = g_ColorOptionsList[i].def;
@@ -410,8 +410,8 @@ COLORREF Options::GetFont(Fonts fontId, PLOGFONT font)
{
FontIDT fid = {0};
fid.cbSize = sizeof(FontIDT);
- _tcsncpy_s(fid.group, LPGENT("History"), _TRUNCATE);
- _tcsncpy_s(fid.name, g_FontOptionsList[fontId].szDescr, _TRUNCATE);
+ wcsncpy_s(fid.group, LPGENW("History"), _TRUNCATE);
+ wcsncpy_s(fid.name, g_FontOptionsList[fontId].szDescr, _TRUNCATE);
return (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)font);
}
@@ -419,8 +419,8 @@ COLORREF Options::GetColor(Colors colorId)
{
ColourIDT cid = {0};
cid.cbSize = sizeof(ColourIDT);
- _tcsncpy_s(cid.group, LPGENT("History"), _TRUNCATE);
- _tcsncpy_s(cid.name, g_ColorOptionsList[colorId].tszName, _TRUNCATE);
+ wcsncpy_s(cid.group, LPGENW("History"), _TRUNCATE);
+ wcsncpy_s(cid.name, g_ColorOptionsList[colorId].tszName, _TRUNCATE);
return (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, NULL);
}
@@ -721,7 +721,7 @@ void SetEventCB(HWND hwndCB, int eventId)
selCpIdx = i;
if (selCpIdx == -1) {
- TCHAR buf[24];
+ wchar_t buf[24];
mir_sntprintf(buf, L"%d", eventId);
ComboBox_SetText(hwndCB, buf);
}
@@ -732,10 +732,10 @@ int GetEventCB(HWND hwndCB, bool errorReport, int &eventId)
{
int selCpIdx = ComboBox_GetCurSel(hwndCB);
if (selCpIdx < 0) {
- TCHAR text[24];
+ wchar_t text[24];
ComboBox_GetText(hwndCB, text, 24);
- TCHAR * stopOn = NULL;
- long cp = _tcstol(text, &stopOn, 10);
+ wchar_t * stopOn = NULL;
+ long cp = wcstol(text, &stopOn, 10);
if (errorReport && (stopOn == text || *stopOn != '\0' || cp < 0)) {
MessageBox(GetParent(hwndCB), TranslateT("Invalid event number"), TranslateT("Error"), MB_OK | MB_ICONERROR);
SetFocus(hwndCB);
@@ -776,7 +776,7 @@ void ReloadEventLB(HWND hwndLB, const FilterOptions &sel)
selCpIdx = i;
if (selCpIdx == -1) {
- TCHAR buf[24];
+ wchar_t buf[24];
mir_sntprintf(buf, L"%d", *it);
ListBox_AddString(hwndLB, buf);
}
@@ -786,7 +786,7 @@ void ReloadEventLB(HWND hwndLB, const FilterOptions &sel)
bool CheckFile(HWND hwndEdit)
{
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
Edit_GetText(hwndEdit, buf, MAX_PATH);
DWORD atr = GetFileAttributes(buf);
if (atr == INVALID_FILE_ATTRIBUTES || atr & FILE_ATTRIBUTE_DIRECTORY) {
@@ -798,27 +798,27 @@ bool CheckFile(HWND hwndEdit)
return true;
}
-bool OpenFileDlg(HWND hwndDlg, HWND hwndEdit, const TCHAR* defName, const TCHAR* ext, const TCHAR* title, bool open)
+bool OpenFileDlg(HWND hwndDlg, HWND hwndEdit, const wchar_t* defName, const wchar_t* ext, const wchar_t* title, bool open)
{
- TCHAR filter[1024];
+ wchar_t filter[1024];
std::locale loc;
- TCHAR extUpper[32];
- _tcscpy_s(extUpper, ext);
+ wchar_t extUpper[32];
+ wcscpy_s(extUpper, ext);
extUpper[0] = std::toupper(ext[0], loc);
mir_sntprintf(filter, TranslateT("%s Files (*.%s)"), extUpper, ext);
size_t len = mir_tstrlen(filter) + 1;
mir_sntprintf(filter + len, _countof(filter) - len, L"*.%s", ext);
len += mir_tstrlen(filter + len) + 1;
- _tcscpy_s(filter + len, 1024 - len, TranslateT("All Files (*.*)"));
+ wcscpy_s(filter + len, 1024 - len, TranslateT("All Files (*.*)"));
len += mir_tstrlen(filter + len) + 1;
- _tcscpy_s(filter + len, 1024 - len, L"*.*");
+ wcscpy_s(filter + len, 1024 - len, L"*.*");
len += mir_tstrlen(filter + len) + 1;
filter[len] = 0;
- TCHAR stzFilePath[1024];
+ wchar_t stzFilePath[1024];
Edit_GetText(hwndEdit, stzFilePath, 1023);
if (stzFilePath[0] == 0) {
- _tcscpy_s(stzFilePath, defName);
+ wcscpy_s(stzFilePath, defName);
len = mir_tstrlen(stzFilePath) + 1;
stzFilePath[len] = 0;
}
@@ -911,7 +911,7 @@ INT_PTR CALLBACK Options::DlgProcOptsMain(HWND hwndDlg, UINT msg, WPARAM wParam,
switch(LOWORD(wParam)) {
case IDC_ADD_FILTER:
{
- TCHAR name[24];
+ wchar_t name[24];
Edit_GetText(nameFilter, name, 24);
if (name[0] == 0) {
MessageBox(hwndDlg, TranslateT("Enter filter name"), TranslateT("Error"), MB_ICONERROR);
@@ -1079,7 +1079,7 @@ INT_PTR CALLBACK Options::DlgProcOptsMain(HWND hwndDlg, UINT msg, WPARAM wParam,
case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == PSN_APPLY) {
HWND ftp = GetDlgItem(hwndDlg, IDC_WINSCP);
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
Edit_GetText(ftp, buf, MAX_PATH);
if (buf[0] != 0 && !CheckFile(ftp)) {
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -1282,7 +1282,7 @@ void InitCodepageCB(HWND hwndCB, unsigned int codepage, const std::wstring& name
}
if (selCpIdx == -1) {
- TCHAR buf[300];
+ wchar_t buf[300];
mir_sntprintf(buf, L"%d;%s", codepage, name.c_str());
ComboBox_SetText(hwndCB, buf);
}
@@ -1295,18 +1295,18 @@ unsigned int GetCodepageCB(HWND hwndCB, bool errorReport, unsigned int, const st
{
int selCpIdx = ComboBox_GetCurSel(hwndCB);
if (selCpIdx < 0) {
- TCHAR text[128];
+ wchar_t text[128];
ComboBox_GetText(hwndCB, text, 128);
std::wstring str = text;
name = L"";
- size_t pos = str.find_first_of(_T(';'));
+ size_t pos = str.find_first_of(';');
if (pos < str.length()) {
text[pos] = 0;
name = str.substr(pos + 1);
}
- TCHAR * stopOn = NULL;
- long cp = _tcstol(text, &stopOn, 10);
+ wchar_t * stopOn = NULL;
+ long cp = wcstol(text, &stopOn, 10);
if ((pos >= str.length() || name.empty() || stopOn == text || *stopOn != '\0' || cp < 0 || cp > 0xffff)) {
if (errorReport) {
MessageBox(GetParent(hwndCB), TranslateT("You've entered invalid codepage. Select codepage from combo box or enter correct number."), TranslateT("Invalid codepage"), MB_OK | MB_ICONERROR);
@@ -1399,7 +1399,7 @@ INT_PTR CALLBACK Options::DlgProcOptsExport(HWND hwndDlg, UINT msg, WPARAM wPara
return TRUE;
}
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
Edit_GetText(GetDlgItem(hwndDlg, IDC_HTML2EXTCSSFILE), buf, MAX_PATH);
instance->extCssHtml2 = buf;
}
@@ -1696,9 +1696,9 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam,
Edit_LimitText(deltaTime, 4);
SetDlgItemInt(hwndDlg, IDC_TRIGER_DELTA_TIME, to->deltaTime, FALSE);
- TCHAR timeFormat[10];
+ wchar_t timeFormat[10];
if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SSHORTTIME, timeFormat, 10) == 0) {
- TCHAR sep = _T(':');
+ wchar_t sep = ':';
if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STIME, timeFormat, 10) > 0)
sep = timeFormat[0];
mir_sntprintf(timeFormat, L"HH%cmm", sep);
@@ -1747,7 +1747,7 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam,
BOOL isOK = FALSE;
toCp.eventDeltaTime = GetDlgItemInt(hwndDlg, IDC_EVENT_TIME, &isOK, TRUE);
if (!isOK) {
- TCHAR tszBuf[256];
+ wchar_t tszBuf[256];
mir_sntprintf(tszBuf, TranslateT("Invalid '%s' value."), TranslateT("Events older than"));
MessageBox(hwndDlg, tszBuf, TranslateT("Error"), MB_ICONERROR);
break;
@@ -1778,7 +1778,7 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam,
toCp.dayOfMonth = GetDlgItemInt(hwndDlg, IDC_TRIGER_DAY, &isOK, FALSE);
if (!isOK) {
if (toCp.trigerType == TaskOptions::Monthly) {
- TCHAR tszBuf[256];
+ wchar_t tszBuf[256];
mir_sntprintf(tszBuf, TranslateT("Invalid '%s' value."), TranslateT("Day"));
MessageBox(hwndDlg, tszBuf, TranslateT("Error"), MB_ICONERROR);
break;
@@ -1788,7 +1788,7 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam,
toCp.deltaTime = GetDlgItemInt(hwndDlg, IDC_TRIGER_DELTA_TIME, &isOK, FALSE);
if (!isOK) {
if (toCp.trigerType == TaskOptions::DeltaMin || toCp.trigerType == TaskOptions::DeltaHour) {
- TCHAR tszBuf[256];
+ wchar_t tszBuf[256];
mir_sntprintf(tszBuf, TranslateT("Invalid '%s' value."), TranslateT("Delta time"));
MessageBox(hwndDlg, tszBuf, TranslateT("Error"), MB_ICONERROR);
break;
@@ -1802,9 +1802,9 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam,
to->taskName = L"";
if (!IsValidTask(toCp, top->tasks, &err, &errDescr)) {
to->taskName = lastName;
- TCHAR tszBuf[256];
+ wchar_t tszBuf[256];
if (err.empty())
- _tcscpy_s(tszBuf, TranslateT("Some value is invalid"));
+ wcscpy_s(tszBuf, TranslateT("Some value is invalid"));
else if (errDescr.empty())
mir_sntprintf(tszBuf, TranslateT("Invalid '%s' value."), err.c_str());
else
@@ -1868,9 +1868,9 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam,
ShowWindow(GetDlgItem(hwndDlg, IDC_IMPORT_TYPE), showImport);
std::wstring str;
- TCHAR* compressText = TranslateT("Compress output files");
- TCHAR* uploadText = TranslateT("Upload to FTP (WinSCP requred)");
- TCHAR* typeText = TranslateT("Export to");
+ wchar_t* compressText = TranslateT("Compress output files");
+ wchar_t* uploadText = TranslateT("Upload to FTP (WinSCP requred)");
+ wchar_t* typeText = TranslateT("Export to");
if (showFilter == SW_HIDE) {
str = TranslateT("** Use <ext> to insert extension, <contact> to insert contact name");
compressText = TranslateT("Input files are compressed");
diff --git a/plugins/BasicHistory/src/Options.h b/plugins/BasicHistory/src/Options.h
index e74c81ff33..097eec73f7 100644
--- a/plugins/BasicHistory/src/Options.h
+++ b/plugins/BasicHistory/src/Options.h
@@ -114,7 +114,7 @@ struct TaskOptions
dayOfMonth = 1;
deltaTime = 24;
orderNr = 0;
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, buf)))
{
filePath = buf;
diff --git a/plugins/BasicHistory/src/PlainHtmlExport.cpp b/plugins/BasicHistory/src/PlainHtmlExport.cpp
index c98386a056..52bf4fadd7 100644
--- a/plugins/BasicHistory/src/PlainHtmlExport.cpp
+++ b/plugins/BasicHistory/src/PlainHtmlExport.cpp
@@ -73,7 +73,7 @@ void PlainHtmlExport::WriteFooter()
void PlainHtmlExport::WriteGroup(bool, const std::wstring &time, const std::wstring&, const std::wstring&)
{
- TCHAR buf[256];
+ wchar_t buf[256];
EXP_FILE << L"<div class=mes id=session>\n";
mir_sntprintf(buf, TranslateT("Conversation started at %s"), time.c_str());
EXP_FILE << L"<div class=text>" << buf << L"</div>\n";
@@ -82,8 +82,8 @@ void PlainHtmlExport::WriteGroup(bool, const std::wstring &time, const std::wstr
void PlainHtmlExport::WriteMessage(bool isMe, const std::wstring &longDate, const std::wstring &shortDate, const std::wstring &user, const std::wstring &message, const DBEVENTINFO&)
{
- TCHAR *id = isMe ? L"out" : L"inc";
- TCHAR* ev = (isMe ? L"1" : L"0");
+ wchar_t *id = isMe ? L"out" : L"inc";
+ wchar_t* ev = (isMe ? L"1" : L"0");
bool isUrl = false;
std::wstring mes = UrlHighlightHtml(MakeTextHtmled(message), isUrl);
if (isUrl)
diff --git a/plugins/BasicHistory/src/PlainHtmlExport.h b/plugins/BasicHistory/src/PlainHtmlExport.h
index 122e82d808..985e75d410 100644
--- a/plugins/BasicHistory/src/PlainHtmlExport.h
+++ b/plugins/BasicHistory/src/PlainHtmlExport.h
@@ -22,7 +22,7 @@ class PlainHtmlExport :
public IExport
{
public:
- virtual const TCHAR* GetExt()
+ virtual const wchar_t* GetExt()
{
return L"html";
}
diff --git a/plugins/BasicHistory/src/RichHtmlExport.cpp b/plugins/BasicHistory/src/RichHtmlExport.cpp
index 5b030b5721..45bc07ee5b 100644
--- a/plugins/BasicHistory/src/RichHtmlExport.cpp
+++ b/plugins/BasicHistory/src/RichHtmlExport.cpp
@@ -39,19 +39,19 @@ std::wstring MakeTextHtmled(const std::wstring& message, std::queue<std::pair<si
while((find = message.find_first_of(search, start)) < message.length()) {
ret += message.substr(start, find - start);
switch(message[find]) {
- case _T('&'):
+ case '&':
ret += L"&amp;";
break;
- case _T('<'):
+ case '<':
ret += L"&lt;";
break;
- case _T('>'):
+ case '>':
ret += L"&gt;";
break;
- case _T('\t'):
+ case '\t':
ret += L" ";
break;
- case _T('\n'):
+ case '\n':
ret += L"<br>";
break;
}
@@ -257,8 +257,8 @@ void IcoSave(const std::wstring &fileName, HICON hicon)
bool DeleteDirectory(LPCTSTR lpszDir, bool noRecycleBin = true)
{
size_t len = mir_tstrlen(lpszDir);
- TCHAR *pszFrom = new TCHAR[len+2];
- _tcscpy_s(pszFrom, len+2, lpszDir);
+ wchar_t *pszFrom = new wchar_t[len+2];
+ wcscpy_s(pszFrom, len+2, lpszDir);
pszFrom[len] = 0;
pszFrom[len+1] = 0;
@@ -365,8 +365,8 @@ void RichHtmlExport::WriteFooter()
void RichHtmlExport::WriteGroup(bool isMe, const std::wstring &time, const std::wstring&, const std::wstring &eventText)
{
- TCHAR *id = isMe ? L"out" : L"inc";
- TCHAR* ev = (isMe ? L"1" : L"0");
+ wchar_t *id = isMe ? L"out" : L"inc";
+ wchar_t* ev = (isMe ? L"1" : L"0");
if (groupId > 0)
EXP_FILE << L"</div>\n";
@@ -383,9 +383,9 @@ void RichHtmlExport::WriteGroup(bool isMe, const std::wstring &time, const std::
void RichHtmlExport::WriteMessage(bool isMe, const std::wstring &longDate, const std::wstring &shortDate, const std::wstring &user, const std::wstring &message, const DBEVENTINFO&)
{
- TCHAR *id = isMe ? L"out" : L"inc";
- TCHAR* ev = (isMe ? L"1" : L"0");
- TCHAR* ev1 = ev;
+ wchar_t *id = isMe ? L"out" : L"inc";
+ wchar_t* ev = (isMe ? L"1" : L"0");
+ wchar_t* ev1 = ev;
bool isUrl = false;
std::wstring mes = ReplaceSmileys(isMe, message, isUrl);
if (isUrl)
@@ -405,8 +405,8 @@ std::wstring RichHtmlExport::ReplaceSmileys(bool isMe, const std::wstring &msg,
if (!Options::instance->exportHtml2UseSmileys || !g_SmileyAddAvail)
return UrlHighlightHtml(MakeTextHtmled(msg), isUrl);
- TCHAR* msgbuf = new TCHAR[msg.length() + 1];
- memcpy_s(msgbuf, (msg.length() + 1) * sizeof(TCHAR), msg.c_str(), (msg.length() + 1) * sizeof(TCHAR));
+ wchar_t* msgbuf = new wchar_t[msg.length() + 1];
+ memcpy_s(msgbuf, (msg.length() + 1) * sizeof(wchar_t), msg.c_str(), (msg.length() + 1) * sizeof(wchar_t));
SMADD_BATCHPARSE2 sp = {0};
SMADD_BATCHPARSERES *spr;
sp.cbSize = sizeof(sp);
diff --git a/plugins/BasicHistory/src/RichHtmlExport.h b/plugins/BasicHistory/src/RichHtmlExport.h
index e1f31fc15c..6bdcd6e842 100644
--- a/plugins/BasicHistory/src/RichHtmlExport.h
+++ b/plugins/BasicHistory/src/RichHtmlExport.h
@@ -29,7 +29,7 @@ private:
std::unordered_set<std::wstring> smileys;
std::wstring ReplaceSmileys(bool isMe, const std::wstring &msg, bool &isUrl);
public:
- virtual const TCHAR* GetExt()
+ virtual const wchar_t* GetExt()
{
return L"html";
}
diff --git a/plugins/BasicHistory/src/Scheduler.cpp b/plugins/BasicHistory/src/Scheduler.cpp
index 2185cb8212..01176f8b8e 100644
--- a/plugins/BasicHistory/src/Scheduler.cpp
+++ b/plugins/BasicHistory/src/Scheduler.cpp
@@ -44,13 +44,13 @@ void StartThread(bool init);
void StopThread();
bool GetNextExportTime(bool init, time_t now);
bool ExecuteCurrentTask(time_t now);
-void GetZipFileTime(const TCHAR *file, uLong *dt);
-std::wstring ReplaceExt(const std::wstring& file, const TCHAR* ext);
+void GetZipFileTime(const wchar_t *file, uLong *dt);
+std::wstring ReplaceExt(const std::wstring& file, const wchar_t* ext);
bool ZipFiles(const std::wstring& dir, std::wstring zipFilePath, const std::string& password);
bool UnzipFiles(const std::wstring& dir, std::wstring& zipFilePath, const std::string& password);
bool FtpFiles(const std::wstring& dir, const std::wstring& filePath, const std::wstring& ftpName);
bool FtpGetFiles(const std::wstring& dir, const std::list<std::wstring>& files, const std::wstring& ftpName);
-void CreatePath(const TCHAR *szDir);
+void CreatePath(const wchar_t *szDir);
void DoError(const TaskOptions& to, const std::wstring error);
static HANDLE hPopupClass;
@@ -169,7 +169,7 @@ bool IsValidTask(TaskOptions& to, std::list<TaskOptions>* top, std::wstring* err
*errDescr = TranslateT("To create session open WinSCP, click New Session, enter data and save with specific name. Remember if FTP server using password you should save it in WinSCP.");
return false;
}
- if (to.useFtp && (to.filePath.find(_T('\\')) < to.filePath.length() || to.filePath.find(_T(':')) < to.filePath.length() || to.filePath[0] != L'/')) {
+ if (to.useFtp && (to.filePath.find('\\') < to.filePath.length() || to.filePath.find(':') < to.filePath.length() || to.filePath[0] != L'/')) {
if (err != NULL)
*err = TranslateT("Path to file");
if (errDescr != NULL)
@@ -232,9 +232,9 @@ bool DoTask(TaskOptions& to)
std::wstring err;
std::wstring errDescr;
if (!IsValidTask(to, NULL, &err, &errDescr)) {
- TCHAR msg[256];
+ wchar_t msg[256];
if (err.empty())
- _tcscpy_s(msg, TranslateT("Some value is invalid"));
+ wcscpy_s(msg, TranslateT("Some value is invalid"));
else if (errDescr.empty())
mir_sntprintf(msg, TranslateT("Invalid '%s' value."), err.c_str());
else
@@ -280,14 +280,14 @@ bool DoTask(TaskOptions& to)
std::vector<MCONTACT> contacts;
if (to.useFtp || to.compress) {
std::map<std::wstring, bool> existingContacts;
- TCHAR temp[MAX_PATH];
+ wchar_t temp[MAX_PATH];
temp[0] = 0;
GetTempPath(MAX_PATH, temp);
dir = temp;
dir += GetName(filePath);
dir = GetFileName(dir, L"", existingContacts, true);
dir = ReplaceExt(dir, L"");
- size_t pos = dir.find_last_of(_T('.'));
+ size_t pos = dir.find_last_of('.');
if (pos < dir.length())
dir = dir.substr(0, pos);
@@ -295,7 +295,7 @@ bool DoTask(TaskOptions& to)
CreateDirectory(dir.c_str(), NULL);
}
- const TCHAR* ext = ExportManager::GetExt(to.importType);
+ const wchar_t* ext = ExportManager::GetExt(to.importType);
if (to.isSystem) {
std::wstring n = GetFileName(filePath, mExp.GetContactName(), existingContacts1, true);
n = ReplaceExt(n, ext);
@@ -394,7 +394,7 @@ bool DoTask(TaskOptions& to)
if (!errorStr.empty())
errorStr += L"\n";
- TCHAR msg[1024];
+ wchar_t msg[1024];
mir_sntprintf(msg, TranslateT("Incorrect file format: %s."), GetName(*it).c_str());
errorStr += msg;
}
@@ -402,7 +402,7 @@ bool DoTask(TaskOptions& to)
if (!errorStr.empty())
errorStr += L"\n";
- TCHAR msg[1024];
+ wchar_t msg[1024];
mir_sntprintf(msg, TranslateT("Unknown contact in file: %s."), GetName(*it).c_str());
errorStr += msg;
@@ -434,14 +434,14 @@ bool DoTask(TaskOptions& to)
}
else {
filePath = GetName(filePath);
- TCHAR temp[MAX_PATH];
+ wchar_t temp[MAX_PATH];
temp[0] = 0;
GetTempPath(MAX_PATH, temp);
dir = temp;
dir += filePath;
dir = GetFileName(dir, L"", existingContacts, true);
dir = ReplaceExt(dir, L"");
- size_t pos = dir.find_last_of(_T('.'));
+ size_t pos = dir.find_last_of('.');
if (pos < dir.length())
dir = dir.substr(0, pos);
@@ -458,7 +458,7 @@ bool DoTask(TaskOptions& to)
if (!errorStr.empty())
errorStr += L"\n";
- TCHAR msg[1024];
+ wchar_t msg[1024];
mir_sntprintf(msg, TranslateT("Cannot export history for contact: %s."), exp->GetContactName().c_str());
errorStr += msg;
@@ -480,7 +480,7 @@ bool DoTask(TaskOptions& to)
if (!errorStr.empty())
errorStr += L"\n";
- TCHAR msg[1024];
+ wchar_t msg[1024];
mir_sntprintf(msg, TranslateT("Cannot export history for contact: %s."), exp->GetContactName().c_str());
errorStr += msg;
break;
@@ -507,7 +507,7 @@ bool DoTask(TaskOptions& to)
}
else {
zipFilePath = GetName(zipFilePath);
- TCHAR temp[MAX_PATH];
+ wchar_t temp[MAX_PATH];
temp[0] = 0;
GetTempPath(MAX_PATH, temp);
zipDir = temp;
@@ -567,7 +567,7 @@ std::wstring GetFileName(const std::wstring &baseName, std::wstring contactName,
if (!baseName1.empty()) {
std::wstring name = baseName1;
int i = 0;
- TCHAR buf[32];
+ wchar_t buf[32];
std::map<std::wstring, bool>::iterator it = existingContacts.find(name);
while(it != existingContacts.end()) {
_itot_s(++i, buf, 10);
@@ -583,7 +583,7 @@ std::wstring GetFileName(const std::wstring &baseName, std::wstring contactName,
pos = str.find(L"<date>");
if (pos < str.length()) {
- TCHAR time[256];
+ wchar_t time[256];
SYSTEMTIME st;
GetLocalTime(&st);
mir_sntprintf(time, L"%d-%02d-%02d %02d%02d", st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute);
@@ -793,7 +793,7 @@ bool GetNextExportTime(bool init, time_t now)
static void CALLBACK DoTaskFinishInMainAPCFunc(ULONG_PTR dwParam)
{
- TCHAR *item = (TCHAR*) dwParam;
+ wchar_t *item = (wchar_t*) dwParam;
MessageBox(NULL, item, TranslateT("Task finished"), MB_OK | MB_ICONINFORMATION);
delete[] item;
}
@@ -841,7 +841,7 @@ bool ExecuteCurrentTask(time_t now)
if (to.showMBAfterExecute) {
size_t size = to.taskName.size() + 1024;
- TCHAR *name = new TCHAR[size];
+ wchar_t *name = new wchar_t[size];
if (error)
mir_sntprintf(name, size, TranslateT("Task '%s' execution failed"), to.taskName.c_str());
else
@@ -854,7 +854,7 @@ bool ExecuteCurrentTask(time_t now)
return GetNextExportTime(false, now);
}
-void GetZipFileTime(const TCHAR *file, uLong *dt)
+void GetZipFileTime(const wchar_t *file, uLong *dt)
{
FILETIME ftLocal;
WIN32_FIND_DATA ff32;
@@ -868,7 +868,7 @@ void GetZipFileTime(const TCHAR *file, uLong *dt)
/* calculate the CRC32 of a file,
because to encrypt a file, we need known the CRC32 of the file before */
-bool GetFileCrc(const TCHAR *filenameinzip, unsigned char *buf, unsigned long, unsigned long *result_crc)
+bool GetFileCrc(const wchar_t *filenameinzip, unsigned char *buf, unsigned long, unsigned long *result_crc)
{
unsigned long calculate_crc = 0;
bool error = true;
@@ -1128,7 +1128,7 @@ bool FtpFiles(const std::wstring& dir, const std::wstring& filePath, const std::
CreateDirectory(GetDirectoryName(log).c_str(), NULL);
DeleteFile(log.c_str());
- TCHAR cmdLine[MAX_PATH];
+ wchar_t cmdLine[MAX_PATH];
mir_sntprintf(cmdLine, L"\"%s\" /nointeractiveinput /log=\"%s\" /script=script.sc", Options::instance->ftpExePath.c_str(), log.c_str());
STARTUPINFO startupInfo = { 0 };
@@ -1219,7 +1219,7 @@ bool FtpGetFiles(const std::wstring& dir, const std::list<std::wstring>& files,
std::wstring &log = Options::instance->ftpLogPath;
CreateDirectory(GetDirectoryName(log).c_str(), NULL);
DeleteFile(log.c_str());
- TCHAR cmdLine[MAX_PATH];
+ wchar_t cmdLine[MAX_PATH];
mir_sntprintf(cmdLine, L"\"%s\" /nointeractiveinput /log=\"%s\" /script=script.sc", Options::instance->ftpExePath.c_str(), log.c_str());
STARTUPINFO startupInfo = { 0 };
PROCESS_INFORMATION processInfo;
@@ -1243,18 +1243,18 @@ bool FtpGetFiles(const std::wstring& dir, const std::list<std::wstring>& files,
return true;
}
-void CreatePath(const TCHAR *szDir)
+void CreatePath(const wchar_t *szDir)
{
if (!szDir) return;
DWORD dwAttributes;
- TCHAR *pszLastBackslash, szTestDir[MAX_PATH];
+ wchar_t *pszLastBackslash, szTestDir[MAX_PATH];
mir_tstrncpy(szTestDir, szDir, _countof(szTestDir));
if ((dwAttributes = GetFileAttributes(szTestDir)) != INVALID_FILE_ATTRIBUTES && (dwAttributes & FILE_ATTRIBUTE_DIRECTORY))
return;
- pszLastBackslash = _tcsrchr(szTestDir, '\\');
+ pszLastBackslash = wcsrchr(szTestDir, '\\');
if (pszLastBackslash == NULL)
return;
@@ -1282,7 +1282,7 @@ INT_PTR ExecuteTaskService(WPARAM wParam, LPARAM)
void DoError(const TaskOptions& to, const std::wstring _error)
{
- TCHAR msg[256];
+ wchar_t msg[256];
mir_sntprintf(msg, TranslateT("Task '%s' execution failed:"), to.taskName.c_str());
if (Options::instance->schedulerHistoryAlerts) {
std::wstring error = msg;
@@ -1312,8 +1312,8 @@ void DoError(const TaskOptions& to, const std::wstring _error)
else if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
POPUPDATAT ppd = { 0 };
ppd.lchIcon = Skin_LoadIcon(SKINICON_OTHER_HISTORY);
- _tcscpy_s(ppd.lptzContactName, msg);
- _tcscpy_s(ppd.lptzText, _error.c_str());
+ wcscpy_s(ppd.lptzContactName, msg);
+ wcscpy_s(ppd.lptzText, _error.c_str());
CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, 0);
}
}
diff --git a/plugins/BasicHistory/src/Searcher.cpp b/plugins/BasicHistory/src/Searcher.cpp
index bac7c8f37c..a3c8b4f093 100644
--- a/plugins/BasicHistory/src/Searcher.cpp
+++ b/plugins/BasicHistory/src/Searcher.cpp
@@ -61,12 +61,12 @@ void Searcher::ClearFind()
}
}
-inline TCHAR mytoupper(TCHAR a, std::locale* loc)
+inline wchar_t mytoupper(wchar_t a, std::locale* loc)
{
- return std::toupper<TCHAR>(a, *loc);
+ return std::toupper<wchar_t>(a, *loc);
}
-bool Searcher::CompareStr(std::wstring str, TCHAR *strFind)
+bool Searcher::CompareStr(std::wstring str, wchar_t *strFind)
{
std::locale loc;
if (!matchCase)
@@ -89,7 +89,7 @@ bool Searcher::CompareStr(std::wstring str, TCHAR *strFind)
void Searcher::Find()
{
FINDTEXTEX ft;
- TCHAR str[128];
+ wchar_t str[128];
int curSel = 0;
bool isStart = false;
bool finished = false;
@@ -104,7 +104,7 @@ void Searcher::Find()
GetWindowText(context->findWindow, str, _countof(str));
if (!str[0]) {
- TCHAR buf[256];
+ wchar_t buf[256];
mir_sntprintf(buf, TranslateT("\"%s\" not found"), str);
MessageBox(context->m_hWnd, buf, TranslateT("Search"), MB_OK | MB_ICONINFORMATION);
return;
@@ -297,20 +297,20 @@ void Searcher::Find()
SendMessage(context->editWindow,EM_SETOPTIONS,ECOOP_AND,~ECO_NOHIDESEL);
lastFindSelection = -1;
if (isStart) {
- TCHAR buf[256];
+ wchar_t buf[256];
GetWindowText(context->findWindow, str, _countof(str));
mir_sntprintf(buf, TranslateT("\"%s\" not found"), str);
MessageBox(context->m_hWnd, buf, TranslateT("Search"), MB_OK | MB_ICONINFORMATION);
}
- else MessageBox(context->m_hWnd, TranslateTS(onlyGroup ? LPGENT("You have reached the end of the group.") : LPGENT("You have reached the end of the history.")), TranslateT("Search"), MB_OK | MB_ICONINFORMATION);
+ else MessageBox(context->m_hWnd, TranslateTS(onlyGroup ? LPGENW("You have reached the end of the group.") : LPGENW("You have reached the end of the history.")), TranslateT("Search"), MB_OK | MB_ICONINFORMATION);
}
-bool Searcher::IsInSel(int sel, TCHAR *strFind)
+bool Searcher::IsInSel(int sel, wchar_t *strFind)
{
if (sel < 0 || sel >= (int)context->m_eventList.size())
return false;
- TCHAR str[MAXSELECTSTR + 8]; // for safety reason
+ wchar_t str[MAXSELECTSTR + 8]; // for safety reason
HistoryEventList::EventData data;
for (std::deque<HistoryEventList::EventIndex>::iterator it = context->m_eventList[sel].begin(); it != context->m_eventList[sel].end(); ++it) {
HistoryEventList::EventIndex hDbEvent = *it;
@@ -328,7 +328,7 @@ bool Searcher::IsInSel(int sel, TCHAR *strFind)
return false;
}
-bool Searcher::Compare(const bool isMe, const std::wstring& message, TCHAR *strFind)
+bool Searcher::Compare(const bool isMe, const std::wstring& message, wchar_t *strFind)
{
if (onlyIn && isMe || onlyOut && !isMe)
return false;
diff --git a/plugins/BasicHistory/src/Searcher.h b/plugins/BasicHistory/src/Searcher.h
index a3229da1f5..1a76274221 100644
--- a/plugins/BasicHistory/src/Searcher.h
+++ b/plugins/BasicHistory/src/Searcher.h
@@ -31,11 +31,11 @@ private:
bool isFindContactChanged;
bool findBack, matchCase, matchWholeWords, onlyIn, onlyOut, onlyGroup, allUsers, searchForInLG, searchForInMes;
- bool CompareStr(std::wstring str, TCHAR *strFind);
- bool IsInSel(int sel, TCHAR *strFind);
+ bool CompareStr(std::wstring str, wchar_t *strFind);
+ bool IsInSel(int sel, wchar_t *strFind);
public:
Searcher();
- virtual bool Compare(const bool isMe, const std::wstring& message, TCHAR *strFind);
+ virtual bool Compare(const bool isMe, const std::wstring& message, wchar_t *strFind);
void Find();
void ChangeFindDirection(bool isBack);
void ClearFind();
diff --git a/plugins/BasicHistory/src/TxtExport.cpp b/plugins/BasicHistory/src/TxtExport.cpp
index b2f9ddc5c9..89df71c8b3 100644
--- a/plugins/BasicHistory/src/TxtExport.cpp
+++ b/plugins/BasicHistory/src/TxtExport.cpp
@@ -26,7 +26,7 @@ TxtExport::~TxtExport()
void TxtExport::WriteHeader(const std::wstring&, const std::wstring &filterName, const std::wstring &myName, const std::wstring &myId, const std::wstring &name1, const std::wstring &proto1, const std::wstring &id1, const std::string&, const std::wstring&)
{
- TCHAR* start = TranslateT("###");
+ wchar_t* start = TranslateT("###");
EXP_FILE << start << "\n" << start << L" " << TranslateT("History Log") << L"\n";
EXP_FILE << start << L" " << myName;
if (proto1.length() || myId.length())
diff --git a/plugins/BasicHistory/src/TxtExport.h b/plugins/BasicHistory/src/TxtExport.h
index 3147d9024d..6c47a1d50e 100644
--- a/plugins/BasicHistory/src/TxtExport.h
+++ b/plugins/BasicHistory/src/TxtExport.h
@@ -23,7 +23,7 @@ class TxtExport :
public IExport
{
public:
- virtual const TCHAR* GetExt()
+ virtual const wchar_t* GetExt()
{
return L"txt";
}
diff --git a/plugins/Boltun/src/Engine/Mind.cpp b/plugins/Boltun/src/Engine/Mind.cpp
index f9a46df967..120dbc85ef 100644
--- a/plugins/Boltun/src/Engine/Mind.cpp
+++ b/plugins/Boltun/src/Engine/Mind.cpp
@@ -22,8 +22,8 @@
using namespace std;
-typedef vector<tstring> string_vec;
-typedef multimap<tstring, tstring> string_mmap;
+typedef vector<wstring> string_vec;
+typedef multimap<wstring, wstring> string_mmap;
Mind::Mind()
{
@@ -58,51 +58,51 @@ Mind& Mind::operator= (const Mind& mind)
return *this;
}
-inline void format(tstring& s)
+inline void format(wstring& s)
{
int pos = (int)s.length() - 1;
- if (s[pos] == _T('\r'))
+ if (s[pos] == '\r')
s.resize(pos);
}
-void toLowerStr(TCHAR* ch)
+void toLowerStr(wchar_t* ch)
{
CharLower(ch);
}
-vector<tstring> Mind::Parse(tstring s)
+vector<wstring> Mind::Parse(wstring s)
{
int len = (int)s.length() - 1;
- vector <tstring> res;
- while (len != -1 && _istspace(s[len]))
+ vector <wstring> res;
+ while (len != -1 && iswspace(s[len]))
len--;
if (len < 0)
return res;
s.resize(len);
int it = 0;
while (it != len) {
- while (it != len && _istspace(s[it]))
+ while (it != len && iswspace(s[it]))
it++;
if (it == len)
break;
int start = it;
- while (it != len && !_istspace(s[it]))
+ while (it != len && !iswspace(s[it]))
it++;
res.push_back(s.substr(start, it - start));
}
return res;
}
-void Mind::Load(tstring filename)
+void Mind::Load(wstring filename)
{
- basic_ifstream<TCHAR, char_traits<TCHAR> > file;
+ basic_ifstream<wchar_t, char_traits<wchar_t> > file;
locale ulocale(locale(), new MyCodeCvt);
file.imbue(ulocale);
file.open(filename.c_str(), ios_base::in | ios_base::binary);
- tstring s1, st;
- TCHAR *c, *co = NULL;
+ wstring s1, st;
+ wchar_t *c, *co = NULL;
size_t count;
int error = 0;
int line = 1;
@@ -128,10 +128,10 @@ void Mind::Load(tstring filename)
format(st);
count = st.length();
- c = co = new TCHAR[count + 1];
+ c = co = new wchar_t[count + 1];
mir_tstrcpy(c, st.c_str());
size_t pos = 0;
- while (pos < count && _istspace(*c)) {
+ while (pos < count && iswspace(*c)) {
++pos;
++c;
}
@@ -245,9 +245,9 @@ void Mind::Load(tstring filename)
toLowerStr(c);
{
std::transform(s1.begin(), s1.end(), s1.begin(), ::tolower);
- vector<tstring> strs = Parse(s1);
+ vector<wstring> strs = Parse(s1);
data->raliases.insert(make_pair(s1, strs));
- for (vector<tstring>::const_iterator it = strs.begin(); it != strs.end(); ++it)
+ for (vector<wstring>::const_iterator it = strs.begin(); it != strs.end(); ++it)
data->aliases.insert(make_pair(*it, s1));
}
break;
@@ -281,9 +281,9 @@ void Mind::Load(tstring filename)
}
}
-void Mind::Save(tstring filename) const
+void Mind::Save(wstring filename) const
{
- basic_ofstream<TCHAR, char_traits<TCHAR> > file;
+ basic_ofstream<wchar_t, char_traits<wchar_t> > file;
locale ulocale(locale(), new MyCodeCvt);
file.imbue(ulocale);
@@ -291,61 +291,61 @@ void Mind::Save(tstring filename) const
file.open(filename.c_str(), ios_base::out | ios_base::binary);
if (fileTypeMark)
- file << TCHAR(65279);
+ file << wchar_t(65279);
for (string_mmap::iterator it = data->study.begin(); it != data->study.end(); ++it) {
- file << (*it).first << _T('\r') << endl;
- file << (*it).second << _T('\r') << endl;
+ file << (*it).first << '\r' << endl;
+ file << (*it).second << '\r' << endl;
}
- for (multimap<WordsList, tstring>::iterator it = data->keywords.begin(); it != data->keywords.end(); ++it) {
- file << L" (" << (tstring)(*it).first << L")" << _T('\r') << endl;
- file << (*it).second << _T('\r') << endl;
+ for (multimap<WordsList, wstring>::iterator it = data->keywords.begin(); it != data->keywords.end(); ++it) {
+ file << L" (" << (wstring)(*it).first << L")" << '\r' << endl;
+ file << (*it).second << '\r' << endl;
}
- for (multimap<WordsList, tstring>::iterator it = data->qkeywords.begin(); it != data->qkeywords.end(); ++it) {
- file << L" (" << (tstring)(*it).first << L")" << _T('\r') << endl;
- file << (*it).second << _T('\r') << endl;
+ for (multimap<WordsList, wstring>::iterator it = data->qkeywords.begin(); it != data->qkeywords.end(); ++it) {
+ file << L" (" << (wstring)(*it).first << L")" << '\r' << endl;
+ file << (*it).second << '\r' << endl;
}
- for (multimap<WordsList, tstring>::iterator it = data->specialEscapes.begin(); it != data->specialEscapes.end(); ++it) {
- file << L" {" << (tstring)(*it).first << L"}" << _T('\r') << endl;
- file << (*it).second << _T('\r') << endl;
+ for (multimap<WordsList, wstring>::iterator it = data->specialEscapes.begin(); it != data->specialEscapes.end(); ++it) {
+ file << L" {" << (wstring)(*it).first << L"}" << '\r' << endl;
+ file << (*it).second << '\r' << endl;
}
- for (multimap<WordsList, tstring>::iterator it = data->qspecialEscapes.begin(); it != data->qspecialEscapes.end(); ++it) {
- file << L" {" << (tstring)(*it).first << L"}" << _T('\r') << endl;
- file << (*it).second << _T('\r') << endl;
+ for (multimap<WordsList, wstring>::iterator it = data->qspecialEscapes.begin(); it != data->qspecialEscapes.end(); ++it) {
+ file << L" {" << (wstring)(*it).first << L"}" << '\r' << endl;
+ file << (*it).second << '\r' << endl;
}
for (string_mmap::iterator it = data->widelyUsed.begin(); it != data->widelyUsed.end(); ++it) {
- file << L" [" << (*it).first << L"]" << _T('\r') << endl;
- file << (*it).second << _T('\r') << endl;
+ file << L" [" << (*it).first << L"]" << '\r' << endl;
+ file << (*it).second << '\r' << endl;
}
- for (set<tstring>::iterator it = data->question.begin(); it != data->question.end(); ++it) {
- file << L" <QUESTION>" << _T('\r') << endl;
- file << (*it) << _T('\r') << endl;
+ for (set<wstring>::iterator it = data->question.begin(); it != data->question.end(); ++it) {
+ file << L" <QUESTION>" << '\r' << endl;
+ file << (*it) << '\r' << endl;
}
- for (set<tstring>::iterator it = data->special.begin(); it != data->special.end(); ++it) {
- file << L" <IGNORED>" << _T('\r') << endl;
- file << (*it) << _T('\r') << endl;
+ for (set<wstring>::iterator it = data->special.begin(); it != data->special.end(); ++it) {
+ file << L" <IGNORED>" << '\r' << endl;
+ file << (*it) << '\r' << endl;
}
for (string_vec::iterator it = data->escape.begin(); it != data->escape.end(); ++it) {
- file << L" <ESCAPE>" << _T('\r') << endl;
- file << (*it) << _T('\r') << endl;
+ file << L" <ESCAPE>" << '\r' << endl;
+ file << (*it) << '\r' << endl;
}
for (string_vec::iterator it = data->initial.begin(); it != data->initial.end(); ++it) {
- file << L" <INITIAL>" << _T('\r') << endl;
- file << (*it) << _T('\r') << endl;
+ file << L" <INITIAL>" << '\r' << endl;
+ file << (*it) << '\r' << endl;
}
for (string_vec::iterator it = data->failure.begin(); it != data->failure.end(); ++it) {
- file << L" <FAILURE>" << _T('\r') << endl;
- file << (*it) << _T('\r') << endl;
+ file << L" <FAILURE>" << '\r' << endl;
+ file << (*it) << '\r' << endl;
}
for (string_vec::iterator it = data->repeats.begin(); it != data->repeats.end(); ++it) {
- file << L" <REPEAT>" << _T('\r') << endl;
- file << (*it) << _T('\r') << endl;
+ file << L" <REPEAT>" << '\r' << endl;
+ file << (*it) << '\r' << endl;
}
- for (map<tstring, vector<tstring>>::const_iterator it = data->raliases.begin(); it != data->raliases.end(); ++it) {
- tstring s;
- const vector<tstring>& v = (*it).second;
+ for (map<wstring, vector<wstring>>::const_iterator it = data->raliases.begin(); it != data->raliases.end(); ++it) {
+ wstring s;
+ const vector<wstring>& v = (*it).second;
bool first = true;
- for (vector<tstring>::const_iterator it1 = v.begin(); it1 != v.end(); ++it1) {
+ for (vector<wstring>::const_iterator it1 = v.begin(); it1 != v.end(); ++it1) {
if (first) {
first = false;
s = *it1;
@@ -354,17 +354,17 @@ void Mind::Save(tstring filename) const
s += L" " + *it1;
}
}
- file << _T('@') << (*it).first << _T('\r') << endl;
- file << s << _T('\r') << endl;
+ file << '@' << (*it).first << '\r' << endl;
+ file << s << '\r' << endl;
}
}
-void Mind::LoadSmiles(tstring filename)
+void Mind::LoadSmiles(wstring filename)
{
- basic_ifstream<TCHAR, char_traits<TCHAR> > file;
+ basic_ifstream<wchar_t, char_traits<wchar_t> > file;
file.open(filename.c_str());
data->smiles.clear();
- tstring s;
+ wstring s;
unsigned int l = 0;
while (!file.eof()) {
getline(file, s);
@@ -378,14 +378,14 @@ void Mind::LoadSmiles(tstring filename)
void Mind::LoadSmiles(void *smiles, size_t size)
{
data->smiles.clear();
- TCHAR* buf = (TCHAR*)smiles;
+ wchar_t* buf = (wchar_t*)smiles;
unsigned l = 0;
- TCHAR* end = buf + size;
+ wchar_t* end = buf + size;
while (buf != end) {
- TCHAR *lend = buf;
- while (lend != end && *lend != _T('\r'))
+ wchar_t *lend = buf;
+ while (lend != end && *lend != '\r')
lend++;
- tstring s(buf, lend - buf);
+ wstring s(buf, lend - buf);
if ((unsigned)(lend - buf) > l)
l = (int)s.length();
data->smiles.insert(s);
diff --git a/plugins/Boltun/src/Engine/Mind.h b/plugins/Boltun/src/Engine/Mind.h
index d11eb6cd78..2b93c5fdcb 100644
--- a/plugins/Boltun/src/Engine/Mind.h
+++ b/plugins/Boltun/src/Engine/Mind.h
@@ -31,22 +31,22 @@ class Mind;
typedef struct
{
friend class Mind;
- std::vector<std::tstring> initial;
- std::set<std::tstring> question;
- std::set<std::tstring> special;
- std::vector<std::tstring> escape;
- std::vector<std::tstring> failure;
- std::vector<std::tstring> repeats;
+ std::vector<std::wstring> initial;
+ std::set<std::wstring> question;
+ std::set<std::wstring> special;
+ std::vector<std::wstring> escape;
+ std::vector<std::wstring> failure;
+ std::vector<std::wstring> repeats;
unsigned int maxSmileLen;
- std::set<std::tstring> smiles;
- std::multimap<WordsList, std::tstring> keywords;
- std::multimap<WordsList, std::tstring> qkeywords;
- std::multimap<std::tstring, std::tstring> widelyUsed;
- std::multimap<WordsList, std::tstring> specialEscapes;
- std::multimap<WordsList, std::tstring> qspecialEscapes;
- std::multimap<std::tstring, std::tstring> study;
- std::map<std::tstring, std::tstring> aliases;
- std::map<std::tstring, std::vector<std::tstring>> raliases;
+ std::set<std::wstring> smiles;
+ std::multimap<WordsList, std::wstring> keywords;
+ std::multimap<WordsList, std::wstring> qkeywords;
+ std::multimap<std::wstring, std::wstring> widelyUsed;
+ std::multimap<WordsList, std::wstring> specialEscapes;
+ std::multimap<WordsList, std::wstring> qspecialEscapes;
+ std::multimap<std::wstring, std::wstring> study;
+ std::map<std::wstring, std::wstring> aliases;
+ std::map<std::wstring, std::vector<std::wstring>> raliases;
private:
int referenceCount;
} MindData;
@@ -57,7 +57,7 @@ private:
MindData *data;
bool fileTypeMark;
- std::vector<std::tstring> Parse(std::tstring s);
+ std::vector<std::wstring> Parse(std::wstring s);
public:
Mind();
~Mind();
@@ -75,9 +75,9 @@ public:
};
const MindData *GetData() const;
- void Load(std::tstring filename);
- void Save(std::tstring filename) const;
- void LoadSmiles(std::tstring filename);
+ void Load(std::wstring filename);
+ void Save(std::wstring filename) const;
+ void LoadSmiles(std::wstring filename);
void LoadSmiles(void* smiles, size_t size);
};
diff --git a/plugins/Boltun/src/Engine/TalkEngine.cpp b/plugins/Boltun/src/Engine/TalkEngine.cpp
index c5cc859bb3..0f53403003 100644
--- a/plugins/Boltun/src/Engine/TalkEngine.cpp
+++ b/plugins/Boltun/src/Engine/TalkEngine.cpp
@@ -33,12 +33,12 @@
//#define EXCLUDE_SPECIAL_WORDS
#ifdef DEBUG_SHOW_VARIANTS
-extern void AddBotMessage(tstring s);
+extern void AddBotMessage(wstring s);
#endif
using namespace std;
-void TalkBot::UpdateStartChar(tstring &str)
+void TalkBot::UpdateStartChar(wstring &str)
{
if (!makeLowercase)
return;
@@ -46,21 +46,21 @@ void TalkBot::UpdateStartChar(tstring &str)
size_t l = str.length();
if (l) {
// Answers starting with ' ' must remain unchanged.
- if (str[0] == _T(' ')) {
+ if (str[0] == ' ') {
str = str.substr(1);
return;
}
- TCHAR *strl = NEWTSTR_ALLOCA(str.c_str()), *stru = NEWTSTR_ALLOCA(str.c_str());
+ wchar_t *strl = NEWWSTR_ALLOCA(str.c_str()), *stru = NEWWSTR_ALLOCA(str.c_str());
CharLower(strl);
CharUpper(stru);
for (size_t i = 0; i < l; i++) {
- TCHAR cl = strl[i];
- TCHAR cu = stru[i];
+ wchar_t cl = strl[i];
+ wchar_t cu = stru[i];
if (i != l - 1) {
// Do not react to BLONDE ANSWERS
- TCHAR ncl = strl[i+1];
- TCHAR ncu = stru[i+1];
+ wchar_t ncl = strl[i+1];
+ wchar_t ncu = stru[i+1];
if (ncl != ncu && str[i+1] == ncu)
break;
}
@@ -84,27 +84,27 @@ TalkBot::~TalkBot()
delete contactDatas;
}
-tstring TalkBot::GetInitMessage(MCONTACT contact)
+wstring TalkBot::GetInitMessage(MCONTACT contact)
{
ContactData* d = contactDatas->GetData(contact);
- tstring s = d->initial.GetString();
+ wstring s = d->initial.GetString();
contactDatas->PutData(contact);
return s;
}
-tstring TalkBot::ReplaceAliases(const tstring &message)
+wstring TalkBot::ReplaceAliases(const wstring &message)
{
- const TCHAR dividers[] = L" \t\n\r,./?\\|;:'\"~!#^&*()_-+=[{]}—\1";
- tstring sentence = message;
- tstring result;
- map<size_t, tstring> sm;
+ const wchar_t dividers[] = L" \t\n\r,./?\\|;:'\"~!#^&*()_-+=[{]}—\1";
+ wstring sentence = message;
+ wstring result;
+ map<size_t, wstring> sm;
//Find smiles
for (size_t i = 0; i < sentence.length() - 1; i++) {
unsigned max = (int)(sentence.length() - i);
if (max > mind.GetData()->maxSmileLen)
max = mind.GetData()->maxSmileLen;
for (unsigned j = max; j > 0; j--) {
- tstring item = sentence.substr(i, j);
+ wstring item = sentence.substr(i, j);
if (mind.GetData()->smiles.find(item) != mind.GetData()->smiles.end()) {
sm[i] = item;
sentence.replace(i, j, L"\1");
@@ -116,10 +116,10 @@ tstring TalkBot::ReplaceAliases(const tstring &message)
bool hadQuestionSigns = false;
int it = 0;
while (it != len) {
- while (it != len && _tcschr(dividers, sentence[it])) {
- if (sentence[it] == _T('?'))
+ while (it != len && wcschr(dividers, sentence[it])) {
+ if (sentence[it] == '?')
hadQuestionSigns = true;
- map<size_t, tstring>::iterator smit;
+ map<size_t, wstring>::iterator smit;
if (sentence[it] == '\1') {
smit = sm.find(it);
result.append((*smit).second);
@@ -132,17 +132,17 @@ tstring TalkBot::ReplaceAliases(const tstring &message)
break;
int start = it;
while (true) {
- while (it != len && !_tcschr(dividers, sentence[it]))
+ while (it != len && !wcschr(dividers, sentence[it]))
it++;
- if (it == len || sentence[it] != _T('-'))
+ if (it == len || sentence[it] != '-')
break;
//If we have-a-word-with-minus, we shouldn't split it
- if (_tcschr(dividers, sentence[it + 1]))
+ if (wcschr(dividers, sentence[it + 1]))
break;
it += 2;
}
- tstring str = sentence.substr(start, it - start);
- map<tstring, tstring>::const_iterator al = mind.GetData()->aliases.find(str);
+ wstring str = sentence.substr(start, it - start);
+ map<wstring, wstring>::const_iterator al = mind.GetData()->aliases.find(str);
if (al != mind.GetData()->aliases.end())
result.append((*al).second);
else
@@ -151,9 +151,9 @@ tstring TalkBot::ReplaceAliases(const tstring &message)
return result;
}
-tstring TalkBot::AllReplies(const tstring &incomingMessage, ContactData *contactData, Level &maxValue, std::multimap<Level, tstring> &mm)
+wstring TalkBot::AllReplies(const wstring &incomingMessage, ContactData *contactData, Level &maxValue, std::multimap<Level, wstring> &mm)
{
- tstring res;
+ wstring res;
//Part 1
if (FindExact(contactData, incomingMessage, mind.GetData()->widelyUsed, res)) //widelyUsed
{
@@ -170,7 +170,7 @@ tstring TalkBot::AllReplies(const tstring &incomingMessage, ContactData *contact
maxValue = LOOKSLIKE;
}
//Part 3
- vector<tstring> sentences;
+ vector<wstring> sentences;
SplitSectences(incomingMessage, sentences);
ValueChooser<> ch(sentences, true); //Using random order of sentences.
while ((res = ch.GetString()) != L"") {
@@ -197,7 +197,7 @@ tstring TalkBot::AllReplies(const tstring &incomingMessage, ContactData *contact
maxValue = LOOKSLIKE;
}
//Part 6
- vector<tstring> keywords, otherwords;
+ vector<wstring> keywords, otherwords;
bool isQuestion;
SplitAndSortWords(res, keywords, otherwords, isQuestion);
//Part 7, 8
@@ -258,12 +258,12 @@ tstring TalkBot::AllReplies(const tstring &incomingMessage, ContactData *contact
maxValue = FAIL;
}
}
- return tstring();
+ return wstring();
}
-TalkBot::MessageInfo* TalkBot::Reply(MCONTACT contact, tstring incomingMessage, bool saveChoice)
+TalkBot::MessageInfo* TalkBot::Reply(MCONTACT contact, wstring incomingMessage, bool saveChoice)
{
- TCHAR* str = new TCHAR[incomingMessage.length() + 1];
+ wchar_t* str = new wchar_t[incomingMessage.length() + 1];
mir_tstrcpy(str, incomingMessage.c_str());
CharLower(str);
incomingMessage = str;
@@ -274,8 +274,8 @@ TalkBot::MessageInfo* TalkBot::Reply(MCONTACT contact, tstring incomingMessage,
MessageInfo *info;
//only 2-3 repeats
if (contactData->repeatCount < 2 || contactData->repeatCount == 2 && (rand() % 2)) {
- const vector<tstring>& v = mind.GetData()->repeats;
- tstring res = v[rand() % v.size()];
+ const vector<wstring>& v = mind.GetData()->repeats;
+ wstring res = v[rand() % v.size()];
#ifdef DEBUG_PREFIXES
info = new MessageInfo(incomingMessage, L"(repeat_norm) " + res);
#else
@@ -294,10 +294,10 @@ TalkBot::MessageInfo* TalkBot::Reply(MCONTACT contact, tstring incomingMessage,
return info;
}
- multimap<Level, tstring> mm;
+ multimap<Level, wstring> mm;
Level maxValue = NOTHING;
- tstring res = AllReplies(incomingMessage, contactData, maxValue, mm);
+ wstring res = AllReplies(incomingMessage, contactData, maxValue, mm);
if (!res.empty()) {
UpdateStartChar(res);
#ifdef DEBUG_PREFIXES
@@ -328,7 +328,7 @@ TalkBot::MessageInfo* TalkBot::Reply(MCONTACT contact, tstring incomingMessage,
}
//Also does Part 12
- tstring final = ChooseResult(contactData, maxValue, mm);
+ wstring final = ChooseResult(contactData, maxValue, mm);
MessageInfo *info = new MessageInfo(incomingMessage, final);
UpdateStartChar(final);
if (saveChoice)
@@ -337,14 +337,14 @@ TalkBot::MessageInfo* TalkBot::Reply(MCONTACT contact, tstring incomingMessage,
return info;
}
-bool TalkBot::FindExact(ContactData *contactData, const tstring &incomingMessage,
- const multimap<tstring, tstring>& map, tstring& res)
+bool TalkBot::FindExact(ContactData *contactData, const wstring &incomingMessage,
+ const multimap<wstring, wstring> &map, wstring &res)
{
int max = (int)map.count(incomingMessage);
if (!max) {
- TCHAR c = incomingMessage[incomingMessage.length() - 1];
- if (c != _T('?') && c != _T('.') && c != _T('!'))
- return FindExact(contactData, incomingMessage + _T('.'), map, res);
+ wchar_t c = incomingMessage[incomingMessage.length() - 1];
+ if (c != '?' && c != '.' && c != '!')
+ return FindExact(contactData, incomingMessage + L'.', map, res);
return false;
}
pair<mm_cit, mm_cit> range = map.equal_range(incomingMessage);
@@ -372,7 +372,7 @@ void TalkBot::RecordAnswer(ContactData *contactData, const TalkBot::MessageInfo&
contactData->lastMessage = info.Question;
}
-bool TalkBot::FindAny(ValueChooser<> &ch, tstring& res)
+bool TalkBot::FindAny(ValueChooser<> &ch, wstring& res)
{
if (!ch.GetContainer().size())
return false;
@@ -380,23 +380,23 @@ bool TalkBot::FindAny(ValueChooser<> &ch, tstring& res)
return true;
}
-void TalkBot::SplitSectences(const tstring &incomingMessage, vector<tstring>& vec)
+void TalkBot::SplitSectences(const wstring &incomingMessage, vector<wstring>& vec)
{
//FIXME: (THINK ABOUT IT:-))these chars not always mark the end of sentence.
- const TCHAR symbols[] = L".?!";
+ const wchar_t symbols[] = L".?!";
int it = 0, len = (int)incomingMessage.length();
while (it != len) {
- while (it != len && _istspace(incomingMessage[it]))
+ while (it != len && iswspace(incomingMessage[it]))
it++;
int start = it;
while (it != len) {
- if (_tcschr(symbols, incomingMessage[it++])) {
+ if (wcschr(symbols, incomingMessage[it++])) {
//Test for a :-! smile
- if (it > 2 && incomingMessage[it - 1] == _T('!')
- && incomingMessage[it - 2] == _T('-')
- && incomingMessage[it - 3] == _T(':'))
+ if (it > 2 && incomingMessage[it - 1] == '!'
+ && incomingMessage[it - 2] == '-'
+ && incomingMessage[it - 3] == ':')
continue;
- while (it != len && _tcschr(symbols, incomingMessage[it]))
+ while (it != len && wcschr(symbols, incomingMessage[it]))
it++;
break;
}
@@ -406,9 +406,9 @@ void TalkBot::SplitSectences(const tstring &incomingMessage, vector<tstring>& ve
}
#ifdef _DEBUG
-tstring LevelToStr(TalkBot::Level target)
+wstring LevelToStr(TalkBot::Level target)
{
- tstring lev;
+ wstring lev;
switch (target) {
case TalkBot::BEST: lev = L"BEST(0)"; break;
case TalkBot::LOOKSLIKE: lev = L"LOOKSLIKE(1)"; break;
@@ -420,41 +420,41 @@ tstring LevelToStr(TalkBot::Level target)
}
#endif
-tstring TalkBot::ChooseResult(ContactData *contactData, Level maxValue, const multimap<Level, tstring> &mm)
+wstring TalkBot::ChooseResult(ContactData *contactData, Level maxValue, const multimap<Level, wstring> &mm)
{
#ifdef DEBUG_SHOW_VARIANTS
AddBotMessage(L">>Availabe:");
- for (multimap<Level, tstring>::iterator it = mm.begin(); it != mm.end(); it++)
+ for (multimap<Level, wstring>::iterator it = mm.begin(); it != mm.end(); it++)
AddBotMessage(LevelToStr((*it).first) + L": " + (*it).second);
AddBotMessage(L">>Result:");
#endif
if (maxValue == NOTHING)
return L"";
Level target = maxValue;
- typedef multimap<Level, tstring>::const_iterator lt_cit;
+ typedef multimap<Level, wstring>::const_iterator lt_cit;
pair<lt_cit, lt_cit> range = mm.equal_range(target);
for (lt_cit it = range.first; it != range.second; ++it)
contactData->chooser.AddChoice((*it).second);
#ifdef DEBUG_SHOW_LEVEL
- tstring lev = LevelToStr(target);
+ wstring lev = LevelToStr(target);
return lev + L": " + contactData->chooser.Choose();
#else
return contactData->chooser.Choose();
#endif
}
-void TalkBot::FindByKeywords(ContactData *contactData, const vector<tstring> &keywords, tstring& res/*, tstring& ures*/,
+void TalkBot::FindByKeywords(ContactData *contactData, const vector<wstring> &keywords, wstring& res/*, wstring& ures*/,
bool isQuestion)
{
if (keywords.size() == 0)
return;
- const multimap<WordsList, tstring> &keys = isQuestion ? mind.GetData()->qkeywords :
+ const multimap<WordsList, wstring> &keys = isQuestion ? mind.GetData()->qkeywords :
mind.GetData()->keywords;
- for (multimap<WordsList, tstring>::const_iterator it = keys.begin(); it != keys.end(); ++it) {
+ for (multimap<WordsList, wstring>::const_iterator it = keys.begin(); it != keys.end(); ++it) {
float prio;
if ((*it).first.MatchesAll(keywords/*, strict*/, prio))
#ifdef DEBUG_SHOW_SOLUTION_REASON
- contactData->chooser.AddChoice((tstring)(*it).first + L": - " + (*it).second, prio);
+ contactData->chooser.AddChoice((wstring)(*it).first + L": - " + (*it).second, prio);
#else
contactData->chooser.AddChoice((*it).second, prio);
#endif
@@ -462,16 +462,16 @@ void TalkBot::FindByKeywords(ContactData *contactData, const vector<tstring> &ke
res = contactData->chooser.Choose();
}
-bool TalkBot::FindByOthers(ContactData *contactData, const vector<tstring> &otherwords, tstring& res, bool isQuestion)
+bool TalkBot::FindByOthers(ContactData *contactData, const vector<wstring> &otherwords, wstring& res, bool isQuestion)
{
- //vector<tstring> results;
- const multimap<WordsList, tstring> &specs = isQuestion ? mind.GetData()->qspecialEscapes :
+ //vector<wstring> results;
+ const multimap<WordsList, wstring> &specs = isQuestion ? mind.GetData()->qspecialEscapes :
mind.GetData()->specialEscapes;
- for (multimap<WordsList, tstring>::const_iterator it = specs.begin();
+ for (multimap<WordsList, wstring>::const_iterator it = specs.begin();
it != specs.end(); ++it)
if ((*it).first.MatchesAny(otherwords)) {
#ifdef DEBUG_SHOW_SOLUTION_REASON
- contactData->chooser.AddChoice((tstring)(*it).first + L": - " + (*it).second);
+ contactData->chooser.AddChoice((wstring)(*it).first + L": - " + (*it).second);
#else
contactData->chooser.AddChoice((*it).second);
#endif
@@ -487,20 +487,20 @@ const Mind& TalkBot::GetMind() const
return mind;
}
-void TalkBot::SplitAndSortWords(tstring sentence, vector<tstring>& keywords,
- vector<tstring>& otherwords, bool& isQuestion)
+void TalkBot::SplitAndSortWords(wstring sentence, vector<wstring>& keywords,
+ vector<wstring>& otherwords, bool& isQuestion)
{
- const TCHAR dividers[] = L" \t\n\r,./?\\|;:'\"~!#^&*()_-+=[{]}—";
+ const wchar_t dividers[] = L" \t\n\r,./?\\|;:'\"~!#^&*()_-+=[{]}—";
int len = (int)sentence.length();
- vector<tstring> words;
- map<size_t, tstring> sm;
+ vector<wstring> words;
+ map<size_t, wstring> sm;
//Find smiles
for (size_t i = 0; i < sentence.length() - 1; i++) {
unsigned max = (int)(sentence.length() - i);
if (max > mind.GetData()->maxSmileLen)
max = mind.GetData()->maxSmileLen;
for (unsigned j = max; j > 0; j--) {
- tstring item = sentence.substr(i, j);
+ wstring item = sentence.substr(i, j);
if (mind.GetData()->smiles.find(item)
!= mind.GetData()->smiles.end()) {
sm[i] = item;
@@ -512,11 +512,11 @@ void TalkBot::SplitAndSortWords(tstring sentence, vector<tstring>& keywords,
len = (int)sentence.length();
bool hadQuestionSigns = false;
for (int it = 0; it != len;) {
- while (it != len && _tcschr(dividers, sentence[it])) {
- if (sentence[it] == _T('?'))
+ while (it != len && wcschr(dividers, sentence[it])) {
+ if (sentence[it] == '?')
hadQuestionSigns = true;
- map<size_t, tstring>::iterator smit;
- if (_istspace(sentence[it]) && (smit = sm.find(it)) != sm.end())
+ map<size_t, wstring>::iterator smit;
+ if (iswspace(sentence[it]) && (smit = sm.find(it)) != sm.end())
words.push_back((*smit).second);
it++;
}
@@ -526,20 +526,20 @@ void TalkBot::SplitAndSortWords(tstring sentence, vector<tstring>& keywords,
hadQuestionSigns = false;
int start = it;
while (true) {
- while (it != len && !_tcschr(dividers, sentence[it]))
+ while (it != len && !wcschr(dividers, sentence[it]))
it++;
- if (it == len || sentence[it] != _T('-'))
+ if (it == len || sentence[it] != '-')
break;
// If we have-a-word-with-minus, we shouldn't split it
- if (_tcschr(dividers, sentence[it + 1]))
+ if (wcschr(dividers, sentence[it + 1]))
break;
it += 2;
}
- tstring str = sentence.substr(start, it - start);
+ wstring str = sentence.substr(start, it - start);
words.push_back(str);
}
isQuestion = hadQuestionSigns;
- for (vector<tstring>::iterator it = words.begin(); it != words.end(); ++it) {
+ for (vector<wstring>::iterator it = words.begin(); it != words.end(); ++it) {
if (!isQuestion)
if (mind.GetData()->question.find(*it) != mind.GetData()->question.end())
isQuestion = true;
diff --git a/plugins/Boltun/src/Engine/TalkEngine.h b/plugins/Boltun/src/Engine/TalkEngine.h
index c18f3df1c1..7e0539c9e6 100644
--- a/plugins/Boltun/src/Engine/TalkEngine.h
+++ b/plugins/Boltun/src/Engine/TalkEngine.h
@@ -34,14 +34,14 @@ public:
struct MessageInfo
{
private:
- std::tstring Question;
- MessageInfo(std::tstring q, std::tstring a)
+ std::wstring Question;
+ MessageInfo(std::wstring q, std::wstring a)
:Question(q), Answer(a)
{
}
public:
- std::tstring Answer;
- MessageInfo(std::tstring q)
+ std::wstring Answer;
+ MessageInfo(std::wstring q)
:Question(q)
{
}
@@ -52,17 +52,17 @@ private:
{
BEST, LOOKSLIKE/*, LOOKSLIKE2*/, BAD, FAIL, NOTHING
} Level;
- friend std::tstring LevelToStr(TalkBot::Level target);
+ friend std::wstring LevelToStr(TalkBot::Level target);
struct ContactData
{
ValueChooser<> initial;
- //ValueChooser<std::set<std::tstring> > question;
- //ValueChooser<std::set<std::tstring> > special;
+ //ValueChooser<std::set<std::wstring> > question;
+ //ValueChooser<std::set<std::wstring> > special;
ValueChooser<> escape;
ValueChooser<> failure;
UnRecentChooser chooser;
- std::tstring lastMessage;
+ std::wstring lastMessage;
long long lastMessageTime;
int repeatCount;
inline ContactData(const Mind& mind)
@@ -81,22 +81,22 @@ private:
bool beSilent;
bool makeLowercase;
bool understandAlways;
- void UpdateStartChar(std::tstring &str);
- typedef std::multimap<std::tstring, std::tstring>::const_iterator mm_cit;
- bool FindExact(ContactData *contactData, const std::tstring &incomingMessage, const std::multimap<std::tstring, std::tstring> &map, std::tstring &res);
- bool FindAny(ValueChooser<> &ch, std::tstring &res);
- void FindByKeywords(ContactData *contactData, const std::vector<std::tstring> &keywords, std::tstring &res/*, std::tstring& ures*/, bool isQuestion);
- bool FindByOthers(ContactData *contactData, const std::vector<std::tstring> &otherwords, std::tstring &res, bool isQuestion);
- std::tstring AllReplies(const std::tstring &incomingMessage, ContactData *contactData, Level &maxValue, std::multimap<Level, std::tstring> &mm);
- std::tstring ReplaceAliases(const std::tstring &message);
- std::tstring ChooseResult(ContactData *contactData, Level maxValue, const std::multimap<Level, std::tstring> &mm);
+ void UpdateStartChar(std::wstring &str);
+ typedef std::multimap<std::wstring, std::wstring>::const_iterator mm_cit;
+ bool FindExact(ContactData *contactData, const std::wstring &incomingMessage, const std::multimap<std::wstring, std::wstring> &map, std::wstring &res);
+ bool FindAny(ValueChooser<> &ch, std::wstring &res);
+ void FindByKeywords(ContactData *contactData, const std::vector<std::wstring> &keywords, std::wstring &res/*, std::wstring& ures*/, bool isQuestion);
+ bool FindByOthers(ContactData *contactData, const std::vector<std::wstring> &otherwords, std::wstring &res, bool isQuestion);
+ std::wstring AllReplies(const std::wstring &incomingMessage, ContactData *contactData, Level &maxValue, std::multimap<Level, std::wstring> &mm);
+ std::wstring ReplaceAliases(const std::wstring &message);
+ std::wstring ChooseResult(ContactData *contactData, Level maxValue, const std::multimap<Level, std::wstring> &mm);
void RecordAnswer(ContactData *contactData, const TalkBot::MessageInfo &info);
#ifdef _DEBUG
public:
#endif
- void SplitSectences(const std::tstring &incomingMessage, std::vector<std::tstring> &vec);
- void SplitAndSortWords(std::tstring sentence, std::vector<std::tstring> &keywords,
- std::vector<std::tstring>& otherwords, bool& isQuestion);
+ void SplitSectences(const std::wstring &incomingMessage, std::vector<std::wstring> &vec);
+ void SplitAndSortWords(std::wstring sentence, std::vector<std::wstring> &keywords,
+ std::vector<std::wstring>& otherwords, bool& isQuestion);
public:
TalkBot(const Mind& goodMind);
~TalkBot();
@@ -105,8 +105,8 @@ public:
void SetLowercase(const bool isLowercase);
void SetUnderstandAlways(const bool understandAlways);
//const MindData *GetData();
- std::tstring GetInitMessage(MCONTACT contact);
- MessageInfo* Reply(MCONTACT contact, const std::tstring incomingMessage, bool saveChoice);
+ std::wstring GetInitMessage(MCONTACT contact);
+ MessageInfo* Reply(MCONTACT contact, const std::wstring incomingMessage, bool saveChoice);
void AnswerGiven(MCONTACT contact, const MessageInfo &info);
};
diff --git a/plugins/Boltun/src/Engine/UnrecentChooser.cpp b/plugins/Boltun/src/Engine/UnrecentChooser.cpp
index b0b5e1460e..761adf10c4 100644
--- a/plugins/Boltun/src/Engine/UnrecentChooser.cpp
+++ b/plugins/Boltun/src/Engine/UnrecentChooser.cpp
@@ -27,7 +27,7 @@ UnRecentChooser::UnRecentChooser()
{
}
-void UnRecentChooser::AddChoice(tstring value, float prio)
+void UnRecentChooser::AddChoice(wstring value, float prio)
{
if (items.count(value) != 0)
{
@@ -49,9 +49,9 @@ void UnRecentChooser::AddChoice(tstring value, float prio)
}
}
-tstring UnRecentChooser::Choose()
+wstring UnRecentChooser::Choose()
{
- tstring res;
+ wstring res;
//Find answer
if (newItemsPrio != -1)
{
@@ -78,12 +78,12 @@ tstring UnRecentChooser::Choose()
return res;
}
-void UnRecentChooser::SaveChoice(tstring choice)
+void UnRecentChooser::SaveChoice(wstring choice)
{
//Add answer
if (items.find(choice) != items.end())
{
- for (vector<tstring>::iterator it = itemsList.begin(); it != itemsList.end(); ++it)
+ for (vector<wstring>::iterator it = itemsList.begin(); it != itemsList.end(); ++it)
if (*it == choice)
{
itemsList.erase(it);
diff --git a/plugins/Boltun/src/Engine/UnrecentChooser.h b/plugins/Boltun/src/Engine/UnrecentChooser.h
index 72245773de..ff82faf628 100644
--- a/plugins/Boltun/src/Engine/UnrecentChooser.h
+++ b/plugins/Boltun/src/Engine/UnrecentChooser.h
@@ -23,20 +23,20 @@
class UnRecentChooser
{
- std::map<std::tstring, size_t> items;
- std::vector<std::tstring> itemsList;
- std::vector<std::tstring> newItems;
+ std::map<std::wstring, size_t> items;
+ std::vector<std::wstring> itemsList;
+ std::vector<std::wstring> newItems;
float newItemsPrio, maxOldPrio;
- std::map<size_t, std::tstring> oldItems;
- std::map<std::tstring, float> oldPrios;
+ std::map<size_t, std::wstring> oldItems;
+ std::map<std::wstring, float> oldPrios;
size_t last;
int minimum;
static const size_t maxItems = 100;
public:
UnRecentChooser();
- void AddChoice(std::tstring value, float prio = 1.0);
- std::tstring Choose();
- void SaveChoice(std::tstring choice);
+ void AddChoice(std::wstring value, float prio = 1.0);
+ std::wstring Choose();
+ void SaveChoice(std::wstring choice);
};
#endif /* UnRecentChooserH */ \ No newline at end of file
diff --git a/plugins/Boltun/src/Engine/ValueChooser.h b/plugins/Boltun/src/Engine/ValueChooser.h
index f82ceecbea..b65db2acea 100644
--- a/plugins/Boltun/src/Engine/ValueChooser.h
+++ b/plugins/Boltun/src/Engine/ValueChooser.h
@@ -21,7 +21,7 @@
#ifndef StringChooserH
#define StringChooserH
-template<class container = std::vector<std::tstring> >
+template<class container = std::vector<std::wstring> >
class ValueChooser
{
private:
diff --git a/plugins/Boltun/src/Engine/WordsList.cpp b/plugins/Boltun/src/Engine/WordsList.cpp
index b111cc3414..1efbdebc20 100644
--- a/plugins/Boltun/src/Engine/WordsList.cpp
+++ b/plugins/Boltun/src/Engine/WordsList.cpp
@@ -22,17 +22,17 @@
using namespace std;
-WordsList::WordsList(const tstring &data/*, bool allowUnstrict*/)
+WordsList::WordsList(const wstring &data/*, bool allowUnstrict*/)
{
Parse(data/*, allowUnstrict*/);
}
-WordsList::operator tstring() const
+WordsList::operator wstring() const
{
- tstring res;
+ wstring res;
//if (unstrict)
// res = L"~";
- set<tstring>::const_iterator it = words.begin();
+ set<wstring>::const_iterator it = words.begin();
if (!words.empty())
while (true)
{
@@ -47,16 +47,16 @@ WordsList::operator tstring() const
return res;
}
-WordsList& WordsList::operator= (const tstring& s)
+WordsList& WordsList::operator= (const wstring& s)
{
Parse(s);
return *this;
};
-void WordsList::Parse(tstring s/*, bool allowUnstrict*/)
+void WordsList::Parse(wstring s/*, bool allowUnstrict*/)
{
isQuestion = false;
- /*if (allowUnstrict && s.length() && s[0] == _T('~'))
+ /*if (allowUnstrict && s.length() && s[0] == '~')
{
s = s.substr(1, s.npos);
unstrict = true;
@@ -64,7 +64,7 @@ void WordsList::Parse(tstring s/*, bool allowUnstrict*/)
else
unstrict = false;*/
int len = (int)s.length() - 1;
- while (len != -1 && _istspace(s[len]))
+ while (len != -1 && iswspace(s[len]))
len--;
if (len < 0)
return;
@@ -77,22 +77,22 @@ void WordsList::Parse(tstring s/*, bool allowUnstrict*/)
int it = 0;
while (it != len)
{
- while (it != len && _istspace(s[it]))
+ while (it != len && iswspace(s[it]))
it++;
if (it == len)
break;
int start = it;
- while (it != len && !_istspace(s[it]))
+ while (it != len && !iswspace(s[it]))
it++;
words.insert(s.substr(start, it - start));
}
}
-bool WordsList::MatchesAll(const vector<tstring>& s/*, bool& WasStrict*/, float& priority) const
+bool WordsList::MatchesAll(const vector<wstring>& s/*, bool& WasStrict*/, float& priority) const
{
- std::set<tstring> temp;
+ std::set<wstring> temp;
//WasStrict = true;
- for (vector<tstring>::const_iterator it = s.begin(); it != s.end(); ++it)
+ for (vector<wstring>::const_iterator it = s.begin(); it != s.end(); ++it)
{
/* if (words.find(*it) == words.end())
if (unstrict)
@@ -112,27 +112,27 @@ bool WordsList::MatchesAll(const vector<tstring>& s/*, bool& WasStrict*/, float&
return temp.size() == words.size();
}
-bool WordsList::MatchesAny(const vector<tstring>& s) const
+bool WordsList::MatchesAny(const vector<wstring>& s) const
{
- for (vector<tstring>::const_iterator it = s.begin(); it != s.end(); ++it)
+ for (vector<wstring>::const_iterator it = s.begin(); it != s.end(); ++it)
if (words.find(*it) != words.end())
return true;
return false;
}
-vector<tstring> WordsList::ConsistsOf(const set<tstring>& list) const
+vector<wstring> WordsList::ConsistsOf(const set<wstring>& list) const
{
- vector<tstring> res;
- for (set<tstring>::const_iterator it = words.begin(); it != words.end(); ++it)
+ vector<wstring> res;
+ for (set<wstring>::const_iterator it = words.begin(); it != words.end(); ++it)
if (list.find(*it) == list.end())
res.push_back(*it);
return res;
}
-vector<tstring> WordsList::DoesntIncludeAny(const set<tstring>& list) const
+vector<wstring> WordsList::DoesntIncludeAny(const set<wstring>& list) const
{
- vector<tstring> res;
- for (set<tstring>::const_iterator it = words.begin(); it != words.end(); ++it)
+ vector<wstring> res;
+ for (set<wstring>::const_iterator it = words.begin(); it != words.end(); ++it)
if (list.find(*it) != list.end())
res.push_back(*it);
return res;
@@ -140,17 +140,17 @@ vector<tstring> WordsList::DoesntIncludeAny(const set<tstring>& list) const
bool WordsList::operator<(const WordsList& value) const
{
- return (tstring)*this < (tstring)value;
+ return (wstring)*this < (wstring)value;
}
bool WordsList::operator!=(const WordsList& value) const
{
- return (tstring)*this != (tstring)value;
+ return (wstring)*this != (wstring)value;
}
bool WordsList::operator==(const WordsList& value) const
{
- return (tstring)*this == (tstring)value;
+ return (wstring)*this == (wstring)value;
}
size_t WordsList::Size() const
diff --git a/plugins/Boltun/src/Engine/WordsList.h b/plugins/Boltun/src/Engine/WordsList.h
index 4cac8cd969..dfda3b6c91 100644
--- a/plugins/Boltun/src/Engine/WordsList.h
+++ b/plugins/Boltun/src/Engine/WordsList.h
@@ -24,21 +24,21 @@
class WordsList
{
WordsList();
- void Parse(std::tstring s/*, bool allowUnstrict = false*/);
+ void Parse(std::wstring s/*, bool allowUnstrict = false*/);
//bool unstrict;
#ifdef _DEBUG
public:
#endif
- std::set<std::tstring> words;
+ std::set<std::wstring> words;
bool isQuestion;
public:
- WordsList(const std::tstring &data/*, bool allowUnstrict = false*/);
- operator std::tstring() const;
- bool MatchesAll(const std::vector<std::tstring>& s/*, bool& WasStrict*/, float& priority) const;
- bool MatchesAny(const std::vector<std::tstring>& s) const;
- std::vector<std::tstring> ConsistsOf(const std::set<std::tstring>& list) const;
- std::vector<std::tstring> DoesntIncludeAny(const std::set<std::tstring>& list) const;
- WordsList& operator= (const std::tstring& s);
+ WordsList(const std::wstring &data/*, bool allowUnstrict = false*/);
+ operator std::wstring() const;
+ bool MatchesAll(const std::vector<std::wstring>& s/*, bool& WasStrict*/, float& priority) const;
+ bool MatchesAny(const std::vector<std::wstring>& s) const;
+ std::vector<std::wstring> ConsistsOf(const std::set<std::wstring>& list) const;
+ std::vector<std::wstring> DoesntIncludeAny(const std::set<std::wstring>& list) const;
+ WordsList& operator= (const std::wstring& s);
bool operator<(const WordsList& value) const;
bool operator==(const WordsList& value) const;
bool operator!=(const WordsList& value) const;
diff --git a/plugins/Boltun/src/actionQueue.cpp b/plugins/Boltun/src/actionQueue.cpp
index 3d7d322bf9..b7656873cd 100644
--- a/plugins/Boltun/src/actionQueue.cpp
+++ b/plugins/Boltun/src/actionQueue.cpp
@@ -115,7 +115,7 @@ static void StartTyping(MCONTACT hContact, const TalkBot::MessageInfo*)
void DoAnswer(MCONTACT hContact, const TalkBot::MessageInfo *info, bool sticky = false)
{
- if (info->Answer[0] == _T('\0'))
+ if (info->Answer[0] == '\0')
return;
int waitTime, thinkTime = 0;
int defWaitTime = Config.AnswerPauseTime * 1000;
@@ -191,12 +191,12 @@ void DoAnswer(MCONTACT hContact, const TalkBot::MessageInfo *info, bool sticky =
UpdateTimer();
}
-void AnswerToContact(MCONTACT hContact, const TCHAR* messageToAnswer)
+void AnswerToContact(MCONTACT hContact, const wchar_t* messageToAnswer)
{
if (Config.TalkWarnContacts && db_get_b(hContact, BOLTUN_KEY,
DB_CONTACT_WARNED, FALSE) == FALSE)
{
- DoAnswer(hContact, new TalkBot::MessageInfo((const TCHAR*)Config.WarnText), true);
+ DoAnswer(hContact, new TalkBot::MessageInfo((const wchar_t*)Config.WarnText), true);
db_set_b(hContact, BOLTUN_KEY, DB_CONTACT_WARNED, TRUE);
}
else
diff --git a/plugins/Boltun/src/actionQueue.h b/plugins/Boltun/src/actionQueue.h
index 492bdcb24e..953b9a08f3 100644
--- a/plugins/Boltun/src/actionQueue.h
+++ b/plugins/Boltun/src/actionQueue.h
@@ -21,7 +21,7 @@
#ifndef ACTIONQUEUE_H
#define ACTIONQUEUE_H
-void AnswerToContact(MCONTACT hContact, const TCHAR* messageToAnswer);
+void AnswerToContact(MCONTACT hContact, const wchar_t* messageToAnswer);
void StartChatting(MCONTACT hContact);
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp
index 8fb65dd806..100c18b144 100644
--- a/plugins/Boltun/src/boltun.cpp
+++ b/plugins/Boltun/src/boltun.cpp
@@ -30,7 +30,7 @@ TalkBot* bot = NULL;
HINSTANCE hInst;
BOOL blInit = FALSE;
UINT pTimer = 0;
-TCHAR tszPath[MAX_PATH];
+wchar_t tszPath[MAX_PATH];
PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
@@ -63,13 +63,13 @@ void UpdateEngine()
}
}
-TCHAR* GetFullName(const TCHAR *filename)
+wchar_t* GetFullName(const wchar_t *filename)
{
size_t flen = mir_tstrlen(filename);
- TCHAR* fullname = const_cast<TCHAR*>(filename);
- if (!_tcschr(filename, _T(':'))) {
+ wchar_t* fullname = const_cast<wchar_t*>(filename);
+ if (!wcschr(filename, ':')) {
size_t plen = mir_tstrlen(tszPath);
- fullname = new TCHAR[plen + flen + 1];
+ fullname = new wchar_t[plen + flen + 1];
fullname[0] = NULL;
mir_tstrcat(fullname, tszPath);
mir_tstrcat(fullname, filename);
@@ -77,9 +77,9 @@ TCHAR* GetFullName(const TCHAR *filename)
return fullname;
}
-static bool LoadMind(const TCHAR* filename, int &line)
+static bool LoadMind(const wchar_t* filename, int &line)
{
- TCHAR* fullname = GetFullName(filename);
+ wchar_t* fullname = GetFullName(filename);
HCURSOR newCur = LoadCursor(NULL, MAKEINTRESOURCE(IDC_WAIT));
HCURSOR oldCur = SetCursor(newCur);
#ifdef DEBUG_LOAD_TIME
@@ -157,7 +157,7 @@ static bool LoadMind(const TCHAR* filename, int &line)
return true;
}
-/*static bool SaveMind(const TCHAR* filename)
+/*static bool SaveMind(const wchar_t* filename)
{
if (!bot)
return false;
@@ -220,7 +220,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDbEvent)
egt.codepage = CP_ACP;
egt.datatype = DBVT_TCHAR;
egt.dbei = &dbei;
- TCHAR* s = (TCHAR*)(void*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&egt);
+ wchar_t* s = (wchar_t*)(void*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&egt);
free(dbei.pBlob);
if (Config.MarkAsRead)
db_event_markRead(hContact, hDbEvent);
@@ -307,7 +307,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR
Config.AnswerThinkTime = GetDlgItemInt(hwndDlg, IDC_THINKTIME, &bTranslated, FALSE);
if (!bTranslated)
Config.AnswerThinkTime = 4;
- TCHAR c[MAX_WARN_TEXT];
+ wchar_t c[MAX_WARN_TEXT];
bTranslated = GetDlgItemText(hwndDlg, IDC_WARNTXT, c, _countof(c));
if (bTranslated)
Config.WarnText = c;
@@ -359,8 +359,8 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
case IDC_BTNPATH:
{
const size_t fileNameSize = 5000;
- TCHAR *filename = new TCHAR[fileNameSize];
- TCHAR *fullname = GetFullName(Config.MindFileName);
+ wchar_t *filename = new wchar_t[fileNameSize];
+ wchar_t *fullname = GetFullName(Config.MindFileName);
mir_tstrcpy(filename, fullname);
if (fullname != Config.MindFileName)
delete[] fullname;
@@ -369,8 +369,8 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = GetParent(hwndDlg);
- TCHAR *mind = TranslateTS(MIND_FILE_DESC);
- TCHAR *anyfile = TranslateTS(ALL_FILES_DESC);
+ wchar_t *mind = TranslateTS(MIND_FILE_DESC);
+ wchar_t *anyfile = TranslateTS(ALL_FILES_DESC);
CMString filt(FORMAT, MIND_DIALOG_FILTER, mind, anyfile);
filt.Replace('\1', '\0');
@@ -384,12 +384,12 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
break;
}
- TCHAR *origf = filename;
- TCHAR *f = filename;
- TCHAR *p = tszPath;
+ wchar_t *origf = filename;
+ wchar_t *f = filename;
+ wchar_t *p = tszPath;
while (*p && *f) {
- TCHAR p1 = (TCHAR)CharLower((TCHAR*)(long)*p++);
- TCHAR f1 = (TCHAR)CharLower((TCHAR*)(long)*f++);
+ wchar_t p1 = (wchar_t)CharLower((wchar_t*)(long)*p++);
+ wchar_t f1 = (wchar_t)CharLower((wchar_t*)(long)*f++);
if (p1 != f1)
break;
}
@@ -402,11 +402,11 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
case IDC_BTNRELOAD:
{
- const TCHAR *c = Config.MindFileName;
+ const wchar_t *c = Config.MindFileName;
int line;
bTranslated = blInit = LoadMind(c, line);
if (!bTranslated) {
- TCHAR message[5000];
+ wchar_t message[5000];
mir_sntprintf(message, TranslateTS(FAILED_TO_LOAD_BASE), line, c);
MessageBox(NULL, message, TranslateTS(BOLTUN_ERROR), MB_ICONERROR | MB_TASKMODAL | MB_OK);
}
@@ -431,7 +431,7 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
Config.EngineMakeLowerCase = IsDlgButtonChecked(hwndDlg, IDC_ENGINE_LOWERCASE) == BST_CHECKED ? TRUE : FALSE;
Config.EngineUnderstandAlways = IsDlgButtonChecked(hwndDlg, IDC_ENGINE_UNDERSTAND_ALWAYS) == BST_CHECKED ? TRUE : FALSE;
UpdateEngine();
- TCHAR c[MAX_MIND_FILE];
+ wchar_t c[MAX_MIND_FILE];
bTranslated = GetDlgItemText(hwndDlg, IDC_MINDFILE, c, _countof(c));
if (bTranslated)
Config.MindFileName = c;
@@ -536,7 +536,7 @@ extern "C" int __declspec(dllexport) Load(void)
mir_getLP(&pluginInfo);
GetModuleFileName(hInst, tszPath, _countof(tszPath));
- *(_tcsrchr(tszPath, _T('\\')) + 1) = _T('\0');
+ *(wcsrchr(tszPath, '\\') + 1) = '\0';
/*initialize miranda hooks and services on options dialog*/
HookEvent(ME_OPT_INITIALISE, MessageOptInit);
@@ -574,8 +574,8 @@ extern "C" int __declspec(dllexport) Load(void)
int line;
blInit = LoadMind(Config.MindFileName, line);
if (!blInit) {
- TCHAR path[2000];
- mir_sntprintf(path, TranslateTS(FAILED_TO_LOAD_BASE), line, (const TCHAR*)Config.MindFileName);
+ wchar_t path[2000];
+ mir_sntprintf(path, TranslateTS(FAILED_TO_LOAD_BASE), line, (const wchar_t*)Config.MindFileName);
MessageBox(NULL, path, TranslateTS(BOLTUN_ERROR), MB_ICONERROR | MB_TASKMODAL | MB_OK);
}
return 0;
@@ -592,9 +592,9 @@ extern "C" int __declspec(dllexport) Unload(void)
//It seems that it's now a Boltun problem.
//So in case of saving error we will remain silent
#if 0
- TCHAR path[MAX_PATH];
- mir_sntprintf(path, TranslateTS(FAILED_TO_SAVE_BASE), (const TCHAR*)Config.MindFileName);
- TCHAR* err = TranslateTS(BOLTUN_ERROR);
+ wchar_t path[MAX_PATH];
+ mir_sntprintf(path, TranslateTS(FAILED_TO_SAVE_BASE), (const wchar_t*)Config.MindFileName);
+ wchar_t* err = TranslateTS(BOLTUN_ERROR);
MessageBox(NULL, path, err, MB_ICONERROR | MB_TASKMODAL | MB_OK); */
#endif
}
diff --git a/plugins/Boltun/src/config.cpp b/plugins/Boltun/src/config.cpp
index 27aefdf329..dd821a886b 100644
--- a/plugins/Boltun/src/config.cpp
+++ b/plugins/Boltun/src/config.cpp
@@ -36,31 +36,31 @@
#define DB_ENGINE_LOWERCASE "MakeLowerCase"
#define DB_ENGINE_UNDERSTAND_ALWAYS "UnderstandAlways"
-inline TCHAR* GetString(char* key, const TCHAR* def)
+inline wchar_t* GetString(char* key, const wchar_t* def)
{
DBVARIANT dbv;
- TCHAR* val;
+ wchar_t* val;
if (!db_get_ts(NULL, BOLTUN_KEY, key, &dbv))
{
size_t len = mir_wstrlen(dbv.ptszVal) + 1;
- val = new TCHAR[len];
- _tcscpy_s(val, len, dbv.ptszVal);
+ val = new wchar_t[len];
+ wcscpy_s(val, len, dbv.ptszVal);
db_free(&dbv);
}
else
{
size_t len = mir_wstrlen(def) + 1;
- val = new TCHAR[len];
- _tcscpy_s(val, len, def);
+ val = new wchar_t[len];
+ wcscpy_s(val, len, def);
}
return val;
}
-inline const TCHAR* SetString(char* key, const TCHAR* value)
+inline const wchar_t* SetString(char* key, const wchar_t* value)
{
size_t len = mir_tstrlen(value) + 1;
- TCHAR* val = new TCHAR[len];
- _tcscpy_s(val, len, value);
+ wchar_t* val = new wchar_t[len];
+ wcscpy_s(val, len, value);
db_set_ts(NULL, BOLTUN_KEY, key, val);
return val;
}
@@ -80,9 +80,9 @@ inline const TCHAR* SetString(char* key, const TCHAR* value)
return value; }
#define BUILDSTRETTERS(x, str, def) \
- const TCHAR* BoltunConfig::Get##x() { \
+ const wchar_t* BoltunConfig::Get##x() { \
return GetString(str, def); } \
- const TCHAR* BoltunConfig::Set##x(const TCHAR* value) { \
+ const wchar_t* BoltunConfig::Set##x(const wchar_t* value) { \
return SetString(str, value); }
#define BUILDINIT(x) \
diff --git a/plugins/Boltun/src/config.h b/plugins/Boltun/src/config.h
index 3cee967d4f..73587fe3e3 100644
--- a/plugins/Boltun/src/config.h
+++ b/plugins/Boltun/src/config.h
@@ -133,8 +133,8 @@ class BoltunConfig
BUILDDEFETTERS(AnswerThinkTime, int);
BUILDDEFETTERS(PauseDepends, bool);
BUILDDEFETTERS(PauseRandom, bool);
- BUILDDEFETTERS(WarnText, TCHAR*);
- BUILDDEFETTERS(MindFileName, TCHAR*);
+ BUILDDEFETTERS(WarnText, wchar_t*);
+ BUILDDEFETTERS(MindFileName, wchar_t*);
BUILDDEFETTERS(EngineStaySilent, bool);
BUILDDEFETTERS(EngineMakeLowerCase, bool);
BUILDDEFETTERS(EngineUnderstandAlways, bool);
@@ -151,8 +151,8 @@ public:
Property<int, BoltunConfig> AnswerThinkTime;
Property<bool, BoltunConfig> PauseDepends;
Property<bool, BoltunConfig> PauseRandom;
- PtrProperty<TCHAR, BoltunConfig> WarnText;
- PtrProperty<TCHAR, BoltunConfig> MindFileName;
+ PtrProperty<wchar_t, BoltunConfig> WarnText;
+ PtrProperty<wchar_t, BoltunConfig> MindFileName;
Property<bool, BoltunConfig> EngineStaySilent;
Property<bool, BoltunConfig> EngineMakeLowerCase;
Property<bool, BoltunConfig> EngineUnderstandAlways;
diff --git a/plugins/Boltun/src/stdafx.h b/plugins/Boltun/src/stdafx.h
index 77b9614042..a4a084bdf2 100644
--- a/plugins/Boltun/src/stdafx.h
+++ b/plugins/Boltun/src/stdafx.h
@@ -74,20 +74,20 @@
//Plugin name
#define BOLTUN_NAME "Boltun"
-#define MIND_FILE_DESC LPGENT("Mind Files")
-#define ALL_FILES_DESC LPGENT("All Files")
+#define MIND_FILE_DESC LPGENW("Mind Files")
+#define ALL_FILES_DESC LPGENW("All Files")
//UI strings
#define BOLTUN_AUTO_CHAT LPGEN("Boltun/Auto Chat")
#define BOLTUN_NOT_TO_CHAT LPGEN("Boltun/Not to Chat")
#define BOLTUN_START_CHATTING LPGEN("Boltun/Start Chatting")
-#define DEFAULT_WARN_TEXT LPGENT("Hello. I'm Boltun! I'll talk to you, while my owner is away. Please write without mistakes!")
+#define DEFAULT_WARN_TEXT LPGENW("Hello. I'm Boltun! I'll talk to you, while my owner is away. Please write without mistakes!")
// Error messages
-#define BOLTUN_ERROR LPGENT("Boltun Error")
-#define FAILED_TO_LOAD_BASE LPGENT("Failed to load base of remarks. Error at line %d of %s. (Or few lines before).")
-#define FAILED_TO_SAVE_BASE LPGENT("Failed to save base of remarks to %s")
+#define BOLTUN_ERROR LPGENW("Boltun Error")
+#define FAILED_TO_LOAD_BASE LPGENW("Failed to load base of remarks. Error at line %d of %s. (Or few lines before).")
+#define FAILED_TO_SAVE_BASE LPGENW("Failed to save base of remarks to %s")
//Settings tab names
#define TAB_GENERAL LPGEN("General Settings")
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp
index 6a8600b4d1..bd725b6e8b 100644
--- a/plugins/BossKeyPlus/src/BossKey.cpp
+++ b/plugins/BossKeyPlus/src/BossKey.cpp
@@ -35,7 +35,7 @@ HKL oldLangID, oldLayout;
int protoCount, hLangpack;
PROTOACCOUNT **proto;
unsigned *oldStatus;
-TCHAR **oldStatusMsg;
+wchar_t **oldStatusMsg;
BYTE g_bOldSetting;
PFNDwmIsCompositionEnabled dwmIsCompositionEnabled;
@@ -171,7 +171,7 @@ BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM)
if ((g_dwMirandaPID == dwWndPID) && hWnd != g_hDlgPass && IsWindowVisible(hWnd))
{
- TCHAR szTemp[32];
+ wchar_t szTemp[32];
GetClassName(hWnd, szTemp, 32);
if (mir_tstrcmp(szTemp, L"MirandaThumbsWnd") == 0) // hide floating contacts
@@ -194,12 +194,12 @@ BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM)
return true;
}
-TCHAR* GetDefStatusMsg(unsigned uStatus, const char* szProto)
+wchar_t* GetDefStatusMsg(unsigned uStatus, const char* szProto)
{
- return (TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGT, uStatus, (LPARAM)szProto);
+ return (wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, uStatus, (LPARAM)szProto);
}
-void SetStatus(const char* szProto, unsigned status, TCHAR *tszAwayMsg)
+void SetStatus(const char* szProto, unsigned status, wchar_t *tszAwayMsg)
{
if (tszAwayMsg && CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND)
CallProtoService(szProto, PS_SETAWAYMSG, status, (LPARAM)tszAwayMsg);
@@ -207,7 +207,7 @@ void SetStatus(const char* szProto, unsigned status, TCHAR *tszAwayMsg)
CallProtoService(szProto, PS_SETSTATUS, status, 0);
}
-static int ChangeAllProtoStatuses(unsigned statusMode, TCHAR *msg)
+static int ChangeAllProtoStatuses(unsigned statusMode, wchar_t *msg)
{
for (int i = 0; i < protoCount; i++)
{
@@ -221,7 +221,7 @@ static int ChangeAllProtoStatuses(unsigned statusMode, TCHAR *msg)
if (g_wMask & OPT_SETONLINEBACK){ // need to save old statuses & status messages
oldStatus[i] = status;
if (ProtoServiceExists(proto[i]->szModuleName, PS_GETMYAWAYMSG))
- oldStatusMsg[i] = (TCHAR*)CallProtoService(proto[i]->szModuleName, PS_GETMYAWAYMSG, 0, SGMA_TCHAR);
+ oldStatusMsg[i] = (wchar_t*)CallProtoService(proto[i]->szModuleName, PS_GETMYAWAYMSG, 0, SGMA_TCHAR);
else
oldStatusMsg[i] = GetDefStatusMsg(status, proto[i]->szModuleName);
}
@@ -254,11 +254,11 @@ static void CreateTrayIcon(bool create)
NOTIFYICONDATA nim;
DBVARIANT dbVar;
if (!db_get_ts(NULL, MOD_NAME, "ToolTipText", &dbVar)) {
- _tcsncpy_s(nim.szTip, dbVar.ptszVal, _TRUNCATE);
+ wcsncpy_s(nim.szTip, dbVar.ptszVal, _TRUNCATE);
db_free(&dbVar);
}
else
- _tcsncpy_s(nim.szTip, L"Miranda NG", _TRUNCATE);
+ wcsncpy_s(nim.szTip, L"Miranda NG", _TRUNCATE);
nim.cbSize = sizeof(nim);
nim.hWnd = g_hListenWindow;
@@ -321,7 +321,7 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
DBVARIANT dbVar;
if (g_wMask & OPT_USEDEFMSG || db_get_ts(NULL, MOD_NAME, "statmsg", &dbVar))
{
- TCHAR *ptszDefMsg = GetDefStatusMsg(uMode, 0);
+ wchar_t *ptszDefMsg = GetDefStatusMsg(uMode, 0);
ChangeAllProtoStatuses(uMode, ptszDefMsg);
mir_free(ptszDefMsg);
}
@@ -329,7 +329,7 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
{
if (ServiceExists(MS_VARS_FORMATSTRING))
{
- TCHAR *ptszParsed = variables_parse(dbVar.ptszVal, 0, 0);
+ wchar_t *ptszParsed = variables_parse(dbVar.ptszVal, 0, 0);
ChangeAllProtoStatuses(uMode, ptszParsed);
mir_free(ptszParsed);
}
@@ -395,7 +395,7 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
while (pCurWnd != NULL)
{
HWND_ITEM *pNextWnd = pCurWnd->next;
- TCHAR szTemp[32];
+ wchar_t szTemp[32];
GetClassName(pCurWnd->hWnd, szTemp, 32);
if (IsWindow(pCurWnd->hWnd) && mir_tstrcmp(szTemp, L"SysShadow") != 0) // precaution
@@ -458,9 +458,9 @@ INT_PTR BossKeyHideMiranda(WPARAM, LPARAM) // for service :)
return 0;
}
-static TCHAR *HokeyVkToName(WORD vkKey)
+static wchar_t *HokeyVkToName(WORD vkKey)
{
- static TCHAR buf[32] = { 0 };
+ static wchar_t buf[32] = { 0 };
DWORD code = MapVirtualKey(vkKey, 0) << 16;
switch (vkKey)
@@ -495,13 +495,13 @@ static TCHAR *HokeyVkToName(WORD vkKey)
return buf;
}
-static TCHAR *GetBossKeyText(void)
+static wchar_t *GetBossKeyText(void)
{
WORD wHotKey = db_get_w(NULL, "SkinHotKeys", "Hide/Show Miranda", HOTKEYCODE(HOTKEYF_CONTROL, VK_F12));
BYTE key = LOBYTE(wHotKey);
BYTE shift = HIBYTE(wHotKey);
- static TCHAR buf[128] = { 0 };
+ static wchar_t buf[128] = { 0 };
mir_sntprintf(buf, L"%s%s%s%s%s",
(shift & HOTKEYF_CONTROL) ? L"Ctrl + " : L"",
@@ -521,7 +521,7 @@ static IconItem iconList[] =
static int GenMenuInit(WPARAM, LPARAM) // Modify menu item text before to show the main menu
{
if (g_hMenuItem) {
- TCHAR buf[128];
+ wchar_t buf[128];
mir_sntprintf(buf, L"%s [%s]", TranslateT("Hide"), GetBossKeyText());
Menu_ModifyItem(g_hMenuItem, buf);
}
@@ -535,7 +535,7 @@ void BossKeyMenuItemInit(void) // Add menu item
mi.flags = CMIF_TCHAR;
mi.position = 2000100000;
mi.hIcolibItem = IcoLib_GetIcon("hidemim");
- mi.name.t = LPGENT("Hide");
+ mi.name.w = LPGENW("Hide");
mi.pszService = MS_BOSSKEY_HIDE;
g_hMenuItem = Menu_AddMainMenuItem(&mi);
@@ -590,7 +590,7 @@ static int TabsrmmButtonsInit(WPARAM, LPARAM)
bbd.cbSize = sizeof(BBButton);
bbd.pszModuleName = MOD_NAME;
bbd.dwDefPos = 5000;
- bbd.ptszTooltip = LPGENT("Hide Miranda NG");
+ bbd.ptszTooltip = LPGENW("Hide Miranda NG");
bbd.bbbFlags = BBBF_ISRSIDEBUTTON | BBBF_CANBEHIDDEN;
bbd.hIcon = iconList[0].hIcolib;
CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
@@ -598,7 +598,7 @@ static int TabsrmmButtonsInit(WPARAM, LPARAM)
return 0;
}
-static TCHAR *VariablesBossKey(ARGUMENTSINFO *ai) {
+static wchar_t *VariablesBossKey(ARGUMENTSINFO *ai) {
if (ai->cbSize < sizeof(ARGUMENTSINFO)) return NULL;
if (ai->argc != 1) return NULL;
@@ -615,7 +615,7 @@ static int EnumProtos(WPARAM, LPARAM)
delete[] oldStatusMsg;
oldStatus = new unsigned[protoCount];
- oldStatusMsg = new TCHAR*[protoCount];
+ oldStatusMsg = new wchar_t*[protoCount];
for (int i = 0; i < protoCount; i++)
{
oldStatus[i] = 0;
diff --git a/plugins/BossKeyPlus/src/Options.cpp b/plugins/BossKeyPlus/src/Options.cpp
index fc37629d20..fab96b3e27 100644
--- a/plugins/BossKeyPlus/src/Options.cpp
+++ b/plugins/BossKeyPlus/src/Options.cpp
@@ -79,7 +79,7 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam
// status msg, if needed
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_MAINOPT_STATMSG))) { // meaning we should save it
- TCHAR tszMsg[1025];
+ wchar_t tszMsg[1025];
GetDlgItemText(hwndDlg, IDC_MAINOPT_STATMSG, tszMsg, _countof(tszMsg));
if (tszMsg[0] != 0)
db_set_ts(NULL, MOD_NAME, "statmsg", tszMsg);
@@ -115,7 +115,7 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam
BYTE bSelection = (BYTE)SendDlgItemMessage(hwndDlg, IDC_MAINOPT_CHGSTS, CB_GETCURSEL, 0, 0);
WORD wMode = STATUS_ARR_TO_ID[bSelection];
if (IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_USEDEFMSG) == BST_CHECKED) {
- TCHAR *ptszDefMsg = GetDefStatusMsg(wMode, 0);
+ wchar_t *ptszDefMsg = GetDefStatusMsg(wMode, 0);
SetDlgItemText(hwndDlg, IDC_MAINOPT_STATMSG, ptszDefMsg);
if (ptszDefMsg)
mir_free(ptszDefMsg);
@@ -221,8 +221,8 @@ INT_PTR CALLBACK AdvOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
g_fOptionsOpen = true;
minutes = db_get_b(NULL, MOD_NAME, "time", 10);
- TCHAR szMinutes[4] = { 0 };
- _itot(minutes, szMinutes, 10);
+ wchar_t szMinutes[4] = { 0 };
+ _itow(minutes, szMinutes, 10);
SendDlgItemMessage(hwndDlg, IDC_MAINOPT_TIME, EM_LIMITTEXT, 2, 0);
SendDlgItemMessage(hwndDlg, IDC_MAINOPT_SPIN_TIME, UDM_SETRANGE32, 1, (LPARAM)99);
SetDlgItemText(hwndDlg, IDC_MAINOPT_TIME, szMinutes);
@@ -257,9 +257,9 @@ INT_PTR CALLBACK AdvOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
else if (g_hMenuItem != 0)
BossKeyMenuItemUnInit();
- TCHAR szMinutes[4] = { 0 };
+ wchar_t szMinutes[4] = { 0 };
GetDlgItemText(hwndDlg, IDC_MAINOPT_TIME, szMinutes, _countof(szMinutes));
- minutes = _ttoi(szMinutes);
+ minutes = _wtoi(szMinutes);
if (minutes < 1) minutes = 1;
db_set_b(NULL, MOD_NAME, "time", minutes);
db_set_w(NULL, MOD_NAME, "optsmaskadv", wMaskAdv);
@@ -323,15 +323,15 @@ int OptsDlgInit(WPARAM wParam, LPARAM)
optDi.pfnDlgProc = MainOptDlg;
optDi.pszTemplate = MAKEINTRESOURCEA(IDD_OPTDIALOGMAIN);
optDi.hInstance = g_hInstance;
- optDi.ptszTitle = LPGENT("BossKey");
- optDi.ptszGroup = LPGENT("Events");
- optDi.ptszTab = LPGENT("Main");
+ optDi.pwszTitle = LPGENW("BossKey");
+ optDi.pwszGroup = LPGENW("Events");
+ optDi.pwszTab = LPGENW("Main");
optDi.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &optDi);
optDi.pfnDlgProc = AdvOptDlg;
optDi.pszTemplate = MAKEINTRESOURCEA(IDD_OPTDIALOGADV);
- optDi.ptszTab = LPGENT("Advanced");
+ optDi.pwszTab = LPGENW("Advanced");
Options_AddPage(wParam, &optDi);
return 0;
}
diff --git a/plugins/BossKeyPlus/src/stdafx.h b/plugins/BossKeyPlus/src/stdafx.h
index 067b56a694..ea08079f22 100644
--- a/plugins/BossKeyPlus/src/stdafx.h
+++ b/plugins/BossKeyPlus/src/stdafx.h
@@ -88,10 +88,10 @@ int OptsDlgInit(WPARAM wParam, LPARAM lParam);
INT_PTR BossKeyHideMiranda(WPARAM wParam, LPARAM lParam);
void BossKeyMenuItemInit(void);
void BossKeyMenuItemUnInit(void);
-static TCHAR *GetBossKeyText(void);
+static wchar_t *GetBossKeyText(void);
void InitIdleTimer(void);
void UninitIdleTimer(void);
-TCHAR* GetDefStatusMsg(unsigned uMode, const char* szProto);
+wchar_t* GetDefStatusMsg(unsigned uMode, const char* szProto);
// I never really liked STL's vector... hmm this is nicer anyway, more flexible
typedef struct HWND_ITEM_TYPE
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
index 0b5bbc73e8..cc3b479be4 100644
--- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp
+++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
@@ -253,7 +253,7 @@ bool isContactGoneFor(MCONTACT hContact, int days)
return (daysSinceOnline >= days && (daysSinceMessage == -1 || daysSinceMessage >= days));
}
-void ReturnNotify(MCONTACT hContact, TCHAR *message)
+void ReturnNotify(MCONTACT hContact, wchar_t *message)
{
if (db_get_b(hContact, "CList", "NotOnList", 0) == 1 || db_get_b(hContact, "CList", "Hidden", 0) == 1)
return;
@@ -265,8 +265,8 @@ void ReturnNotify(MCONTACT hContact, TCHAR *message)
POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact;
ppd.lchIcon = hIcon;
- _tcsncpy(ppd.lptzContactName, (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
- _tcsncpy(ppd.lptzText, message, MAX_SECONDLINE);
+ wcsncpy(ppd.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzText, message, MAX_SECONDLINE);
if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopupColorBack;
ppd.colorText = options.iPopupColorFore;
@@ -284,15 +284,15 @@ void ReturnNotify(MCONTACT hContact, TCHAR *message)
cle.pszService = "BuddyExpectator/actionReturned";
cle.flags = CLEF_TCHAR;
- TCHAR* nick = (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR tmpMsg[512];
+ wchar_t* nick = (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t tmpMsg[512];
mir_sntprintf(tmpMsg, L"%s %s", nick, message);
cle.ptszTooltip = tmpMsg;
pcli->pfnAddEvent(&cle);
}
}
-void GoneNotify(MCONTACT hContact, TCHAR *message)
+void GoneNotify(MCONTACT hContact, wchar_t *message)
{
if (db_get_b(hContact, "CList", "NotOnList", 0) == 1 || db_get_b(hContact, "CList", "Hidden", 0) == 1)
return;
@@ -302,8 +302,8 @@ void GoneNotify(MCONTACT hContact, TCHAR *message)
POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact;
ppd.lchIcon = hIcon;
- _tcsncpy(ppd.lptzContactName, (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
- _tcsncpy(ppd.lptzText, message, MAX_SECONDLINE);
+ wcsncpy(ppd.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzText, message, MAX_SECONDLINE);
if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopupColorBack;
ppd.colorText = options.iPopupColorFore;
@@ -321,8 +321,8 @@ void GoneNotify(MCONTACT hContact, TCHAR *message)
cle.hIcon = hIcon;
cle.pszService = "BuddyExpectator/actionStillAbsent";
- TCHAR* nick = (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR tmpMsg[512];
+ wchar_t* nick = (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t tmpMsg[512];
mir_sntprintf(tmpMsg, L"%s %s", nick, message);
cle.ptszTooltip = tmpMsg;
cle.flags = CLEF_TCHAR;
@@ -435,9 +435,9 @@ int onPrebuildContactMenu(WPARAM hContact, LPARAM)
return 0;
if (db_get_b(hContact, MODULE_NAME, "MissYou", 0))
- Menu_ModifyItem(hContactMenu, LPGENT("Disable Miss You"), iconList[1].hIcolib);
+ Menu_ModifyItem(hContactMenu, LPGENW("Disable Miss You"), iconList[1].hIcolib);
else
- Menu_ModifyItem(hContactMenu, LPGENT("Enable Miss You"), iconList[2].hIcolib);
+ Menu_ModifyItem(hContactMenu, LPGENW("Enable Miss You"), iconList[2].hIcolib);
Menu_ShowItem(hContactMenu, !db_get_b(hContact, proto, "ChatRoom", 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND));
return 0;
@@ -485,8 +485,8 @@ int SettingChanged(WPARAM hContact, LPARAM lParam)
ppd.lchContact = hContact;
ppd.lchIcon = IcoLib_GetIcon("enabled_icon");
- _tcsncpy(ppd.lptzContactName, (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
- _tcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
+ wcsncpy(ppd.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopupColorBack;
ppd.colorText = options.iPopupColorFore;
@@ -517,17 +517,17 @@ int SettingChanged(WPARAM hContact, LPARAM lParam)
unsigned int AbsencePeriod = db_get_dw(hContact, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod);
if (isContactGoneFor(hContact, AbsencePeriod)) {
- TCHAR* message = TranslateT("has returned after a long absence.");
- TCHAR tmpBuf[251] = { 0 };
+ wchar_t* message = TranslateT("has returned after a long absence.");
+ wchar_t tmpBuf[251] = { 0 };
time_t tmpTime = getLastSeen(hContact);
if (tmpTime != -1) {
- _tcsftime(tmpBuf, 250, TranslateT("has returned after being absent since %#x"), gmtime(&tmpTime));
+ wcsftime(tmpBuf, 250, TranslateT("has returned after being absent since %#x"), gmtime(&tmpTime));
message = tmpBuf;
}
else {
tmpTime = getLastInputMsg(hContact);
if (tmpTime != -1) {
- _tcsftime(tmpBuf, 250, TranslateT("has returned after being absent since %#x"), gmtime(&tmpTime));
+ wcsftime(tmpBuf, 250, TranslateT("has returned after being absent since %#x"), gmtime(&tmpTime));
message = tmpBuf;
}
}
@@ -551,13 +551,13 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
db_set_b(hContact, MODULE_NAME, "StillAbsentNotified", 1);
SkinPlaySound("buddyExpectatorStillAbsent");
- TCHAR* message = TranslateT("has not returned after a long absence.");
+ wchar_t* message = TranslateT("has not returned after a long absence.");
time_t tmpTime;
- TCHAR tmpBuf[251] = { 0 };
+ wchar_t tmpBuf[251] = { 0 };
tmpTime = getLastSeen(hContact);
if (tmpTime != -1)
{
- _tcsftime(tmpBuf, 250, TranslateT("has not returned after being absent since %#x"), gmtime(&tmpTime));
+ wcsftime(tmpBuf, 250, TranslateT("has not returned after being absent since %#x"), gmtime(&tmpTime));
message = tmpBuf;
}
else
@@ -565,7 +565,7 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
tmpTime = getLastInputMsg(hContact);
if (tmpTime != -1)
{
- _tcsftime(tmpBuf, 250, TranslateT("has not returned after being absent since %#x"), gmtime(&tmpTime));
+ wcsftime(tmpBuf, 250, TranslateT("has not returned after being absent since %#x"), gmtime(&tmpTime));
message = tmpBuf;
}
}
@@ -593,10 +593,10 @@ int ModulesLoaded(WPARAM, LPARAM)
HookEvent(ME_USERINFO_INITIALISE, UserinfoInit);
// add sounds support
- SkinAddNewSoundExT("buddyExpectatorReturn", LPGENT("BuddyExpectator"), LPGENT("Contact returned"));
- SkinAddNewSoundExT("buddyExpectatorStillAbsent", LPGENT("BuddyExpectator"), LPGENT("Contact still absent"));
- SkinAddNewSoundExT("buddyExpectatorMissYou", LPGENT("BuddyExpectator"), LPGENT("Miss you event"));
- SkinAddNewSoundExT("buddyExpectatorHide", LPGENT("BuddyExpectator"), LPGENT("Hide contact event"));
+ SkinAddNewSoundExT("buddyExpectatorReturn", LPGENW("BuddyExpectator"), LPGENW("Contact returned"));
+ SkinAddNewSoundExT("buddyExpectatorStillAbsent", LPGENW("BuddyExpectator"), LPGENW("Contact still absent"));
+ SkinAddNewSoundExT("buddyExpectatorMissYou", LPGENW("BuddyExpectator"), LPGENW("Miss you event"));
+ SkinAddNewSoundExT("buddyExpectatorHide", LPGENW("BuddyExpectator"), LPGENW("Hide contact event"));
timer_id = SetTimer(0, 0, 1000 * 60 * 60 * 4, TimerProc); // check every 4 hours
@@ -612,7 +612,7 @@ int ModulesLoaded(WPARAM, LPARAM)
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = iconList[2].hIcolib;
mi.position = 200000;
- mi.name.t = LPGENT("Enable Miss You");
+ mi.name.w = LPGENW("Enable Miss You");
mi.pszService = "BuddyExpectator/actionMissYouClick";
hContactMenu = Menu_AddContactMenuItem(&mi);
}
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp
index 107eae10f4..b0be57b26e 100644
--- a/plugins/BuddyExpectator/src/options.cpp
+++ b/plugins/BuddyExpectator/src/options.cpp
@@ -325,10 +325,10 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP
ppd.lchContact = NULL;
ppd.lchIcon = hIcon;
- _tcsncpy(ppd.lptzContactName, TranslateT("Contact name"), MAX_CONTACTNAME);
- TCHAR szPreviewText[250];
+ wcsncpy(ppd.lptzContactName, TranslateT("Contact name"), MAX_CONTACTNAME);
+ wchar_t szPreviewText[250];
mir_sntprintf(szPreviewText, TranslateT("has returned after being absent since %d days"), rand() % 30);
- _tcsncpy(ppd.lptzText, szPreviewText, MAX_SECONDLINE);
+ wcsncpy(ppd.lptzText, szPreviewText, MAX_SECONDLINE);
// Get current popups colors options
if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP))
@@ -346,7 +346,7 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP
CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, APF_NO_HISTORY);
- _tcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
+ wcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
ppd.lchIcon = IcoLib_GetIcon("enabled_icon");
CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, APF_NO_HISTORY);
@@ -433,15 +433,15 @@ static int OptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
- odp.ptszGroup = LPGENT("Contacts");
+ odp.pwszGroup = LPGENW("Contacts");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONSPANEL);
- odp.ptszTitle = LPGENT("Buddy Expectator");
+ odp.pwszTitle = LPGENW("Buddy Expectator");
odp.pfnDlgProc = OptionsFrameProc;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &odp);
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
- odp.ptszGroup = LPGENT("Popups");
+ odp.pwszGroup = LPGENW("Popups");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPPANEL);
odp.pfnDlgProc = PopupOptionsFrameProc;
Options_AddPage(wParam, &odp);
@@ -456,12 +456,12 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar
case WM_INITDIALOG:
{
time_t tmpTime;
- TCHAR tmpBuf[51] = { 0 };
+ wchar_t tmpBuf[51] = { 0 };
tmpTime = getLastSeen((MCONTACT)lparam);
if (tmpTime == -1)
SetDlgItemText(hdlg, IDC_EDIT_LASTSEEN, TranslateT("not detected"));
else {
- _tcsftime(tmpBuf, 50, L"%#x, %#X", gmtime(&tmpTime));
+ wcsftime(tmpBuf, 50, L"%#x, %#X", gmtime(&tmpTime));
SetDlgItemText(hdlg, IDC_EDIT_LASTSEEN, tmpBuf);
}
@@ -469,7 +469,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar
if (tmpTime == -1)
SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, TranslateT("not found"));
else {
- _tcsftime(tmpBuf, 50, L"%#x, %#X", gmtime(&tmpTime));
+ wcsftime(tmpBuf, 50, L"%#x, %#X", gmtime(&tmpTime));
SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, tmpBuf);
}
@@ -532,7 +532,7 @@ int UserinfoInit(WPARAM wparam, LPARAM lparam)
uip.hInstance = hInst;
uip.pszTemplate = MAKEINTRESOURCEA(IDD_USERINFO);
uip.flags = ODPF_TCHAR;
- uip.ptszTitle = LPGENT("Buddy Expectator");
+ uip.pwszTitle = LPGENW("Buddy Expectator");
uip.pfnDlgProc = UserinfoDlgProc;
UserInfo_AddPage(wparam, &uip);
}
diff --git a/plugins/BuddyPounce/src/dialog.cpp b/plugins/BuddyPounce/src/dialog.cpp
index becca80478..d17340cfb0 100644
--- a/plugins/BuddyPounce/src/dialog.cpp
+++ b/plugins/BuddyPounce/src/dialog.cpp
@@ -15,7 +15,7 @@ void populateContacts(MCONTACT BPhContact, HWND hwnd2CB)
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *szProto = GetContactProto(hContact);
if (szProto && (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM)) {
- TCHAR name[300];
+ wchar_t name[300];
mir_sntprintf(name, L"%s (%s)", pcli->pfnGetContactDisplayName(hContact, 0), _A2T(szProto));
int index = SendMessage(hwnd2CB, CB_ADDSTRING, 0, (LPARAM)name);
SendMessage(hwnd2CB, CB_SETITEMDATA, index, hContact);
@@ -27,7 +27,7 @@ void populateContacts(MCONTACT BPhContact, HWND hwnd2CB)
void saveLastSetting(MCONTACT hContact, HWND hwnd)
{
- TCHAR number[8];//, string[1024];//for sending file name
+ wchar_t number[8];//, string[1024];//for sending file name
switch (db_get_b(hContact, modname, "LastSetting", 2)) { // nothing to do
case 0: // Send If My Status Is...
break;
@@ -38,18 +38,18 @@ void saveLastSetting(MCONTACT hContact, HWND hwnd)
break;
case 3: // Reuse Pounce
GetDlgItemText(hwnd, IDC_SETTINGNUMBER, number, _countof(number));
- db_set_b(hContact, modname, "Reuse", (BYTE)_ttoi(number));
+ db_set_b(hContact, modname, "Reuse", (BYTE)_wtoi(number));
break;
case 4: // Give Up delay
GetDlgItemText(hwnd, IDC_SETTINGNUMBER, number, _countof(number));
- db_set_b(hContact, modname, "GiveUpDays", (BYTE)_ttoi(number));
+ db_set_b(hContact, modname, "GiveUpDays", (BYTE)_wtoi(number));
{
- db_set_dw(hContact, modname, "GiveUpDate", (DWORD)(_ttoi(number)*SECONDSINADAY));
+ db_set_dw(hContact, modname, "GiveUpDate", (DWORD)(_wtoi(number)*SECONDSINADAY));
}
break;
case 5: // confirm window
GetDlgItemText(hwnd, IDC_SETTINGNUMBER, number, _countof(number));
- db_set_w(hContact, modname, "ConfirmTimeout", (WORD)_ttoi(number));
+ db_set_w(hContact, modname, "ConfirmTimeout", (WORD)_wtoi(number));
break;
}
}
@@ -88,7 +88,7 @@ INT_PTR CALLBACK StatusModesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
case IDOK:
case IDCANCEL:
windowInfo *wi = (windowInfo *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- TCHAR type[32];
+ wchar_t type[32];
GetDlgItemText(hwnd, IDC_CHECK1, type, _countof(type));
WORD flag = (IsDlgButtonChecked(hwnd, IDC_CHECK1))
@@ -192,7 +192,7 @@ void deletePounce(MCONTACT hContact)
INT_PTR CALLBACK BuddyPounceSimpleDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- TCHAR msg[1024];
+ wchar_t msg[1024];
switch(uMsg) {
case WM_INITDIALOG:
@@ -222,7 +222,7 @@ INT_PTR CALLBACK BuddyPounceSimpleDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, L
{
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)) + 1;
if (length>1) {
- TCHAR *text = (TCHAR*)_alloca(length*sizeof(TCHAR));
+ wchar_t *text = (wchar_t*)_alloca(length*sizeof(wchar_t));
GetDlgItemText(hwnd, IDC_MESSAGE, text, length);
db_set_ts(hContact, modname, "PounceMsg", text);
}
@@ -242,7 +242,7 @@ INT_PTR CALLBACK BuddyPounceSimpleDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, L
INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
windowInfo *wi = (windowInfo *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- TCHAR msg[1024];
+ wchar_t msg[1024];
switch(uMsg) {
case WM_INITDIALOG:
@@ -283,7 +283,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
MCONTACT hContact = (MCONTACT)SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_GETITEMDATA, SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_GETCURSEL, 0, 0), 0);
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE))+1;
if (length>1) {
- TCHAR *text = (TCHAR*)mir_alloc(length*sizeof(TCHAR));
+ wchar_t *text = (wchar_t*)mir_alloc(length*sizeof(wchar_t));
if (!text) {
msg(TranslateT("Couldn't allocate enough memory"), L"");
break;
@@ -329,7 +329,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
case IDC_SETTINGS:
if (HIWORD(wParam) == LBN_SELCHANGE) {
int item = SendDlgItemMessage(hwnd, IDC_SETTINGS, LB_GETCURSEL, 0, 0);
- TCHAR temp[5];
+ wchar_t temp[5];
saveLastSetting(wi->hContact, hwnd);
hideAll(hwnd);
switch (item) {
@@ -344,7 +344,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
SetDlgItemText(hwnd, IDC_SETTINGMSG, TranslateT("Reuse this message? (0 to use it once)"));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGMSG2), SW_SHOW);
SetDlgItemText(hwnd, IDC_SETTINGMSG2, TranslateT("Times"));
- SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itot(db_get_b(wi->hContact, modname, "Reuse", 0), temp, 10));
+ SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_b(wi->hContact, modname, "Reuse", 0), temp, 10));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGNUMBER), SW_SHOW);
ShowWindow(GetDlgItem(hwnd, IDC_SPIN), SW_SHOW);
break;
@@ -353,7 +353,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
SetDlgItemText(hwnd, IDC_SETTINGMSG, TranslateT("Give up after... (0 to not give up)"));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGMSG2), SW_SHOW);
SetDlgItemText(hwnd, IDC_SETTINGMSG2, TranslateT("Days"));
- SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itot(db_get_b(wi->hContact, modname, "GiveUpDays", 0), temp, 10));
+ SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_b(wi->hContact, modname, "GiveUpDays", 0), temp, 10));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGNUMBER), SW_SHOW);
ShowWindow(GetDlgItem(hwnd, IDC_SPIN), SW_SHOW);
break;
@@ -362,7 +362,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
SetDlgItemText(hwnd, IDC_SETTINGMSG, TranslateT("Show confirmation window? (0 to not Show)"));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGMSG2), SW_SHOW);
SetDlgItemText(hwnd, IDC_SETTINGMSG2, TranslateT("Seconds to wait before sending"));
- SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itot(db_get_w(wi->hContact, modname, "ConfirmTimeout", 0), temp, 10));
+ SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_w(wi->hContact, modname, "ConfirmTimeout", 0), temp, 10));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGNUMBER), SW_SHOW);
ShowWindow(GetDlgItem(hwnd, IDC_SPIN), SW_SHOW);
break;
@@ -377,7 +377,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- TCHAR msg[1024];
+ wchar_t msg[1024];
switch(uMsg) {
case WM_INITDIALOG:
@@ -409,7 +409,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam,
MCONTACT hContact = ((windowInfo *)GetWindowLongPtr(hwnd, GWLP_USERDATA))->hContact;
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE))+1;
if (length > 1) {
- TCHAR *text = (TCHAR*)mir_alloc(length*sizeof(TCHAR));
+ wchar_t *text = (wchar_t*)mir_alloc(length*sizeof(wchar_t));
if (!text) {
msg(TranslateT("Couldn't allocate enough memory"), L"");
break;
@@ -448,7 +448,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam,
if (HIWORD(wParam) == LBN_SELCHANGE) {
windowInfo *wi = (windowInfo *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
int item = SendDlgItemMessage(hwnd, IDC_SETTINGS, LB_GETCURSEL, 0, 0);
- TCHAR temp[5];
+ wchar_t temp[5];
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
saveLastSetting(wi->hContact, hwnd);
hideAll(hwnd);
@@ -464,7 +464,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam,
SetDlgItemText(hwnd, IDC_SETTINGMSG, TranslateT("Reuse this message? (0 to use it once)"));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGMSG2), SW_SHOW);
SetDlgItemText(hwnd, IDC_SETTINGMSG2, TranslateT("Times"));
- SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itot(db_get_b(wi->hContact, modname, "Reuse", 0), temp, 10));
+ SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_b(wi->hContact, modname, "Reuse", 0), temp, 10));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGNUMBER), SW_SHOW);
ShowWindow(GetDlgItem(hwnd, IDC_SPIN), SW_SHOW);
break;
@@ -473,7 +473,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam,
SetDlgItemText(hwnd, IDC_SETTINGMSG, TranslateT("Give up after... (0 to not give up)"));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGMSG2), SW_SHOW);
SetDlgItemText(hwnd, IDC_SETTINGMSG2, TranslateT("Days"));
- SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itot(db_get_b(wi->hContact, modname, "GiveUpDays", 0), temp, 10));
+ SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_b(wi->hContact, modname, "GiveUpDays", 0), temp, 10));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGNUMBER), SW_SHOW);
ShowWindow(GetDlgItem(hwnd, IDC_SPIN), SW_SHOW);
break;
@@ -482,7 +482,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam,
SetDlgItemText(hwnd, IDC_SETTINGMSG, TranslateT("Show confirmation window? (0 to not Show)"));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGMSG2), SW_SHOW);
SetDlgItemText(hwnd, IDC_SETTINGMSG2, TranslateT("Seconds to wait before sending"));
- SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itot(db_get_w(wi->hContact, modname, "ConfirmTimeout", 0), temp, 10));
+ SetDlgItemText(hwnd, IDC_SETTINGNUMBER, _itow(db_get_w(wi->hContact, modname, "ConfirmTimeout", 0), temp, 10));
ShowWindow(GetDlgItem(hwnd, IDC_SETTINGNUMBER), SW_SHOW);
ShowWindow(GetDlgItem(hwnd, IDC_SPIN), SW_SHOW);
break;
@@ -523,7 +523,7 @@ INT_PTR CALLBACK SendPounceDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
case WM_TIMER:
{
- TCHAR message[1024];
+ wchar_t message[1024];
mir_sntprintf(message, TranslateT("Pounce being sent to %s in %d seconds"), pcli->pfnGetContactDisplayName(spdps->hContact, 0), spdps->timer);
SetDlgItemText(hwnd, LBL_CONTACT, message);
}
@@ -580,7 +580,7 @@ INT_PTR CALLBACK PounceSentDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
switch(LOWORD(wParam)) {
case IDOK:
{
- TCHAR text[2048];
+ wchar_t text[2048];
GetDlgItemText(hwnd, IDOK, text, _countof(text));
if (!mir_tstrcmp(text, TranslateT("Retry"))) {
GetDlgItemText(hwnd, IDC_MESSAGE, text, _countof(text));
@@ -599,7 +599,7 @@ INT_PTR CALLBACK PounceSentDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
void CreateMessageAcknowlegedWindow(MCONTACT hContact, int SentSuccess)
{
HWND hwnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CONFIRMSEND), 0, PounceSentDlgProc, hContact);
- TCHAR msg[256];
+ wchar_t msg[256];
if (SentSuccess) {
mir_sntprintf(msg, TranslateT("Message successfully sent to %s"), pcli->pfnGetContactDisplayName(hContact, 0));
SetDlgItemText(hwnd, IDOK, TranslateT("OK"));
diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp
index 3d15dc36be..0d112acef5 100644
--- a/plugins/BuddyPounce/src/main.cpp
+++ b/plugins/BuddyPounce/src/main.cpp
@@ -98,8 +98,8 @@ int BuddyPounceOptInit(WPARAM wParam, LPARAM)
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.ptszGroup = LPGENT("Message sessions");
- odp.ptszTitle = LPGENT("Buddy Pounce");
+ odp.pwszGroup = LPGENW("Message sessions");
+ odp.pwszTitle = LPGENW("Buddy Pounce");
odp.pfnDlgProc = BuddyPounceOptionsDlgProc;
Options_AddPage(wParam, &odp);
return 0;
@@ -142,7 +142,7 @@ int CheckDate(MCONTACT hContact)
return 0;
}
-void SendPounce(TCHAR *text, MCONTACT hContact)
+void SendPounce(wchar_t *text, MCONTACT hContact)
{
if (HANDLE hSendId = (HANDLE)ProtoChainSend(hContact, PSS_MESSAGE, 0, T2Utf(text)))
WindowList_Add(hWindowList, (HWND)hSendId, hContact);
@@ -169,7 +169,7 @@ int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam)
if (CheckDate(hContact)) {
if (db_get_w(hContact, modname, "ConfirmTimeout", 0)) {
SendPounceDlgProcStruct *spdps = (SendPounceDlgProcStruct *)mir_alloc(sizeof(SendPounceDlgProcStruct));
- TCHAR *message = mir_tstrdup(dbv.ptszVal); // will get free()ed in the send confirm window proc
+ wchar_t *message = mir_tstrdup(dbv.ptszVal); // will get free()ed in the send confirm window proc
spdps->hContact = hContact;
spdps->message = message;
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CONFIRMSEND), 0, SendPounceDlgProc, (LPARAM)spdps);
@@ -198,7 +198,7 @@ INT_PTR BuddyPounceMenuCommand(WPARAM hContact, LPARAM)
INT_PTR AddSimpleMessage(WPARAM wParam, LPARAM lParam)
{
MCONTACT hContact = wParam;
- TCHAR* message = (TCHAR*)lParam;
+ wchar_t* message = (wchar_t*)lParam;
db_set_ws(hContact, modname, "PounceMsg", message);
db_set_w(hContact, modname, "SendIfMyStatusIsFLAG", (WORD)db_get_w(NULL, modname, "SendIfMyStatusIsFLAG",1));
db_set_w(hContact, modname, "SendIfTheirStatusIsFLAG", (WORD)db_get_w(NULL, modname, "SendIfTheirStatusIsFLAG",1));
@@ -211,11 +211,11 @@ INT_PTR AddSimpleMessage(WPARAM wParam, LPARAM lParam)
INT_PTR AddToPounce(WPARAM wParam, LPARAM lParam)
{
MCONTACT hContact = wParam;
- TCHAR* message = (TCHAR*)lParam;
+ wchar_t* message = (wchar_t*)lParam;
DBVARIANT dbv;
if (!db_get_ts(hContact, modname, "PounceMsg",&dbv))
{
- TCHAR* newPounce = (TCHAR*)mir_alloc(mir_tstrlen(dbv.ptszVal) + mir_tstrlen(message) + 1);
+ wchar_t* newPounce = (wchar_t*)mir_alloc(mir_tstrlen(dbv.ptszVal) + mir_tstrlen(message) + 1);
if (!newPounce) return 1;
mir_tstrcpy(newPounce, dbv.ptszVal);
mir_tstrcat(newPounce, message);
diff --git a/plugins/BuddyPounce/src/stdafx.h b/plugins/BuddyPounce/src/stdafx.h
index 5174042431..1187a52a6f 100644
--- a/plugins/BuddyPounce/src/stdafx.h
+++ b/plugins/BuddyPounce/src/stdafx.h
@@ -56,7 +56,7 @@ struct SendPounceDlgProcStruct
{
MCONTACT hContact;
int timer;
- TCHAR *message;
+ wchar_t *message;
};
extern HINSTANCE hInst;
@@ -66,7 +66,7 @@ extern HINSTANCE hInst;
//=======================================================
// main.c
-void SendPounce(TCHAR* text, MCONTACT hContact);
+void SendPounce(wchar_t* text, MCONTACT hContact);
//dialog.c
INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp
index 19ea7e1558..77a43eff9f 100644
--- a/plugins/CSList/src/cslist.cpp
+++ b/plugins/CSList/src/cslist.cpp
@@ -84,9 +84,9 @@ static int OnInitOptions(WPARAM wparam, LPARAM)
odp.position = 955000000;
odp.hInstance = g_hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.pszTitle = MODULENAME;
+ odp.pwszTitle = MODULENAME;
odp.pfnDlgProc = CSOptionsProc;
- odp.pszGroup = LPGEN("Status");
+ odp.pwszGroup = L"Status";
odp.flags = ODPF_BOLDGROUPS;
Options_AddPage(wparam, &odp);
return 0;
@@ -124,20 +124,20 @@ extern "C" __declspec(dllexport) int Load()
InitCommonControlsEx(&icc);
// init icons
- TCHAR tszFile[MAX_PATH];
+ wchar_t tszFile[MAX_PATH];
GetModuleFileName(g_hInst, tszFile, MAX_PATH);
SKINICONDESC sid = { 0 };
- sid.defaultFile.t = tszFile;
+ sid.defaultFile.w = tszFile;
sid.flags = SIDF_ALL_TCHAR;
- sid.section.t = _T(MODULENAME);
+ sid.section.w = MODULENAME;
for (int i = 0; i < _countof(forms); i++) {
char szSettingName[64];
mir_snprintf(szSettingName, "%s_%s", MODNAME, forms[i].pszIconIcoLib);
sid.pszName = szSettingName;
- sid.description.t = forms[i].ptszDescr;
+ sid.description.w = forms[i].ptszDescr;
sid.iDefaultIndex = -forms[i].iconNoIcoLib;
forms[i].hIcoLibItem = IcoLib_AddIcon(&sid);
}
@@ -161,13 +161,13 @@ extern "C" __declspec(dllexport) int Unload()
// ====[ FUN ]================================================================
-void RegisterHotkeys(char buf[200], TCHAR* accName, int Number)
+void RegisterHotkeys(char buf[200], wchar_t* accName, int Number)
{
HOTKEYDESC hotkey = { sizeof(hotkey) };
hotkey.dwFlags = HKD_TCHAR;
hotkey.pszName = buf;
hotkey.ptszDescription = accName;
- hotkey.ptszSection = LPGENT("Custom Status List");
+ hotkey.ptszSection = LPGENW("Custom Status List");
hotkey.pszService = buf;
hotkey.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, '0' + Number);
Hotkey_Register(&hotkey);
@@ -240,7 +240,7 @@ void addProtoStatusMenuItem(char *protoName)
CMenuItem mi;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = forms[0].hIcoLibItem;
- mi.name.t = _T(MODULENAME);
+ mi.name.w = MODULENAME;
mi.position = 2000040000;
mi.pszService = buf;
mi.root = hRoot;
@@ -388,15 +388,15 @@ void CSWindow::toggleEmptyListMessage()
BOOL CSWindow::itemPassedFilter(ListItem< StatusItem >* li)
{
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
GetDlgItemText(m_handle, IDC_FILTER_FIELD, filter, _countof(filter));
if (mir_tstrlen(filter))
{
- TCHAR title[EXTRASTATUS_TITLE_LIMIT], message[EXTRASTATUS_MESSAGE_LIMIT];
+ wchar_t title[EXTRASTATUS_TITLE_LIMIT], message[EXTRASTATUS_MESSAGE_LIMIT];
mir_tstrcpy(title, li->m_item->m_tszTitle); mir_tstrcpy(message, li->m_item->m_tszMessage);
- if (strpos(_tcslwr(title), _tcslwr(filter)) == -1)
- if (strpos(_tcslwr(message), _tcslwr(filter)) == -1)
+ if (strpos(wcslwr(title), wcslwr(filter)) == -1)
+ if (strpos(wcslwr(message), wcslwr(filter)) == -1)
return FALSE;
}
@@ -415,7 +415,7 @@ void CSWindow::toggleFilter()
SetFocus(hFilter);
else
{
- TCHAR filterText[255];
+ wchar_t filterText[255];
GetDlgItemText(m_handle, IDC_FILTER_FIELD, filterText, _countof(filterText));
if (filterText[0] != 0)
SetDlgItemText(m_handle, IDC_FILTER_FIELD, TEXT(""));
@@ -484,7 +484,7 @@ void CSAMWindow::setCombo()
db_free(&dbv);
WPARAM iStatus;
- TCHAR tszName[100];
+ wchar_t tszName[100];
CUSTOM_STATUS cs = { sizeof(cs) };
cs.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR;
cs.ptszName = tszName;
@@ -528,13 +528,13 @@ void CSAMWindow::checkFieldLimit(WORD action, WORD item)
if (action == EN_CHANGE)
{
- TCHAR* ptszInputText = (TCHAR*)mir_alloc((limit + 8) * sizeof(TCHAR));
+ wchar_t* ptszInputText = (wchar_t*)mir_alloc((limit + 8) * sizeof(wchar_t));
GetDlgItemText(m_handle, item, ptszInputText, limit + 8);
if (mir_tstrlen(ptszInputText) > limit)
{
- TCHAR tszPopupTip[MAX_PATH];
+ wchar_t tszPopupTip[MAX_PATH];
EDITBALLOONTIP ebt = { 0 };
ebt.cbStruct = sizeof(ebt);
ebt.pszTitle = TranslateT("Warning");
@@ -543,7 +543,7 @@ void CSAMWindow::checkFieldLimit(WORD action, WORD item)
ebt.ttiIcon = TTI_WARNING;
SendDlgItemMessage(m_handle, item, EM_SHOWBALLOONTIP, 0, (LPARAM)&ebt);
- TCHAR* ptszOutputText = (TCHAR*)mir_alloc((limit + 1) * sizeof(TCHAR));
+ wchar_t* ptszOutputText = (wchar_t*)mir_alloc((limit + 1) * sizeof(wchar_t));
GetDlgItemText(m_handle, item, ptszOutputText, limit + 1);
SetDlgItemText(m_handle, item, ptszOutputText);
mir_free(ptszOutputText);
@@ -562,7 +562,7 @@ void CSAMWindow::checkItemValidity()
if (m_item->m_iIcon != cbi.iImage)
m_item->m_iIcon = cbi.iImage, m_bChanged = TRUE;
- TCHAR tszInputMessage[EXTRASTATUS_MESSAGE_LIMIT];
+ wchar_t tszInputMessage[EXTRASTATUS_MESSAGE_LIMIT];
GetDlgItemText(m_handle, IDC_MESSAGE, tszInputMessage, _countof(tszInputMessage));
@@ -571,7 +571,7 @@ void CSAMWindow::checkItemValidity()
return;
WPARAM i = SendMessage(m_hCombo, CB_GETCURSEL, 0, 0) + 1;
- TCHAR tszTitle[100];
+ wchar_t tszTitle[100];
CUSTOM_STATUS cs = { sizeof(cs) };
cs.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR;
@@ -827,7 +827,7 @@ INT_PTR CALLBACK CSWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpa
csw->toggleButtons();
csw->toggleEmptyListMessage();
csw->loadWindowPosition();
- SetWindowText(hwnd, TranslateT(MODULENAME));
+ SetWindowText(hwnd, MODULENAME);
return TRUE;
case WM_COMMAND:
@@ -852,7 +852,7 @@ INT_PTR CALLBACK CSWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpa
case IDC_REMOVE:
if (getByte("ConfirmDeletion", DEFAULT_PLUGIN_CONFIRM_ITEMS_DELETION))
- if (MessageBox(hwnd, TranslateT("Do you really want to delete selected item?"), TranslateT(MODULENAME), MB_YESNO | MB_DEFBUTTON2 | MB_ICONQUESTION) == IDNO)
+ if (MessageBox(hwnd, TranslateT("Do you really want to delete selected item?"), TranslateTS(MODULENAME), MB_YESNO | MB_DEFBUTTON2 | MB_ICONQUESTION) == IDNO)
break;
csw->m_itemslist->m_list->remove(csw->m_listview->getPositionInList());
@@ -893,7 +893,7 @@ INT_PTR CALLBACK CSWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpa
else {
result = MessageBox(hwnd,
TranslateT("Do you want old database entries to be deleted after Import?"),
- TranslateT(MODULENAME), MB_YESNOCANCEL | MB_DEFBUTTON2 | MB_ICONQUESTION);
+ TranslateTS(MODULENAME), MB_YESNOCANCEL | MB_DEFBUTTON2 | MB_ICONQUESTION);
if (result == IDCANCEL)
break;
}
diff --git a/plugins/CSList/src/stdafx.h b/plugins/CSList/src/stdafx.h
index ddea917d2f..a99e42fe2d 100644
--- a/plugins/CSList/src/stdafx.h
+++ b/plugins/CSList/src/stdafx.h
@@ -54,8 +54,8 @@
// ====[ BASIC DEFINITIONS ]==================================================
-#define MODULENAME LPGEN("Custom Status List")
-#define MODNAME "CSList"
+#define MODULENAME LPGENW("Custom Status List")
+#define MODNAME "CSList"
// ====[ LIMITS ]=============================================================
@@ -103,8 +103,8 @@ typedef void(__cdecl *pForAllProtosFunc)(char*, void *);
struct StatusItem // list item structure
{
int m_iIcon;
- TCHAR m_tszTitle[EXTRASTATUS_TITLE_LIMIT];
- TCHAR m_tszMessage[EXTRASTATUS_MESSAGE_LIMIT];
+ wchar_t m_tszTitle[EXTRASTATUS_TITLE_LIMIT];
+ wchar_t m_tszMessage[EXTRASTATUS_MESSAGE_LIMIT];
BOOL m_bFavourite;
StatusItem()
@@ -130,25 +130,25 @@ struct StatusItem // list item structure
static struct CSForm { // icons + buttons
int idc;
- TCHAR* ptszTitle;
- TCHAR* ptszDescr;
+ wchar_t* ptszTitle;
+ wchar_t* ptszDescr;
char * pszIconIcoLib;
int iconNoIcoLib;
HANDLE hIcoLibItem;
} forms[] = {
- { -1, LPGENT("Main Menu"), LPGENT("Main Icon"), "icon", IDI_CSLIST },
- { IDC_ADD, LPGENT("Add new item"), LPGENT("Add"), "add", IDI_ADD },
- { IDC_MODIFY, LPGENT("Modify selected item"), LPGENT("Modify"), "modify", IDI_MODIFY },
- { IDC_REMOVE, LPGENT("Delete selected item"), LPGENT("Remove"), "remove", IDI_REMOVE },
- { IDC_FAVOURITE, LPGENT("Set/unset current item as favorite"), LPGENT("Favorite"), "favourite", IDI_FAVOURITE },
- { IDC_UNDO, LPGENT("Undo changes"), LPGENT("Undo changes"), "undo", IDI_UNDO },
- { IDC_IMPORT, LPGENT("Import statuses from database"), LPGENT("Import"), "import", IDI_IMPORT },
- { IDC_FILTER, LPGENT("Filter list"), LPGENT("Filter"), "filter", IDI_FILTER },
- { IDCLOSE, LPGENT("Close without changing custom status"), LPGENT("No change"), "nochng", IDI_CLOSE },
- { IDC_CANCEL, LPGENT("Clear custom status (reset to None) and close"), LPGENT("Clear"), "clear", IDI_UNSET },
- { IDOK, LPGENT("Set custom status to selected one and close"), LPGENT("Set"), "apply", IDI_APPLY }
+ { -1, LPGENW("Main Menu"), LPGENW("Main Icon"), "icon", IDI_CSLIST },
+ { IDC_ADD, LPGENW("Add new item"), LPGENW("Add"), "add", IDI_ADD },
+ { IDC_MODIFY, LPGENW("Modify selected item"), LPGENW("Modify"), "modify", IDI_MODIFY },
+ { IDC_REMOVE, LPGENW("Delete selected item"), LPGENW("Remove"), "remove", IDI_REMOVE },
+ { IDC_FAVOURITE, LPGENW("Set/unset current item as favorite"), LPGENW("Favorite"), "favourite", IDI_FAVOURITE },
+ { IDC_UNDO, LPGENW("Undo changes"), LPGENW("Undo changes"), "undo", IDI_UNDO },
+ { IDC_IMPORT, LPGENW("Import statuses from database"), LPGENW("Import"), "import", IDI_IMPORT },
+ { IDC_FILTER, LPGENW("Filter list"), LPGENW("Filter"), "filter", IDI_FILTER },
+ { IDCLOSE, LPGENW("Close without changing custom status"), LPGENW("No change"), "nochng", IDI_CLOSE },
+ { IDC_CANCEL, LPGENW("Clear custom status (reset to None) and close"), LPGENW("Clear"), "clear", IDI_UNSET },
+ { IDOK, LPGENW("Set custom status to selected one and close"), LPGENW("Set"), "apply", IDI_APPLY }
};
// ====[ MY BITCHY LIST IMPLEMENTATION x)) ]==================================
@@ -343,7 +343,7 @@ struct CSWindow
HIMAGELIST m_icons;
int m_statusCount;
BOOL m_bSomethingChanged;
- TCHAR* m_filterString;
+ wchar_t* m_filterString;
char * m_protoName;
CSWindow(char *protoName);
@@ -395,7 +395,7 @@ void addProtoStatusMenuItem(char *protoName);
// other functions
void IitIcoLib();
-void RegisterHotkeys(char buf[200], TCHAR* accName, int Number);
+void RegisterHotkeys(char buf[200], wchar_t* accName, int Number);
void SetStatus(WORD code, StatusItem* item, char *protoName);
// ====[ PROCEDURES ]=========================================================
diff --git a/plugins/CSList/src/strpos.h b/plugins/CSList/src/strpos.h
index 210bfddf0a..9ba847a395 100644
--- a/plugins/CSList/src/strpos.h
+++ b/plugins/CSList/src/strpos.h
@@ -32,9 +32,9 @@
*/
-# ifndef TCHAR
-# define TCHAR wchar_t
-# endif /* TCHAR */
+# ifndef wchar_t
+# define wchar_t wchar_t
+# endif /* wchar_t */
# define STRING wchar_t *
@@ -46,7 +46,7 @@ int strpos( STRING haystack, STRING needle )
int position;
#ifdef DEBUG_VERBOSE
- TCHAR lpBuf[1024];
+ wchar_t lpBuf[1024];
#endif /* def DEBUG_VERBOSE */
pDest = (STRING) wcsstr( haystack, needle );
diff --git a/plugins/ChangeKeyboardLayout/src/hook_events.cpp b/plugins/ChangeKeyboardLayout/src/hook_events.cpp
index 35584b5d04..c0d2b34140 100644
--- a/plugins/ChangeKeyboardLayout/src/hook_events.cpp
+++ b/plugins/ChangeKeyboardLayout/src/hook_events.cpp
@@ -8,13 +8,13 @@ INT_PTR APIChangeLayout(WPARAM wParam, LPARAM)
INT_PTR APIGetLayoutOfText(WPARAM, LPARAM lParam)
{
- LPTSTR ptszInText = (TCHAR*)lParam;
+ LPTSTR ptszInText = (wchar_t*)lParam;
return (INT_PTR)GetLayoutOfText(ptszInText);
}
INT_PTR APIChangeTextLayout(WPARAM wParam, LPARAM lParam)
{
- LPTSTR ptszInText = (TCHAR*)wParam;
+ LPTSTR ptszInText = (wchar_t*)wParam;
CKLLayouts *ckllFromToLay = (CKLLayouts*)lParam;
return (INT_PTR)ChangeTextLayout(ptszInText, ckllFromToLay->hklFrom, ckllFromToLay->hklTo, ckllFromToLay->bTwoWay);
diff --git a/plugins/ChangeKeyboardLayout/src/options.cpp b/plugins/ChangeKeyboardLayout/src/options.cpp
index b6f9310819..1f1a5af025 100644
--- a/plugins/ChangeKeyboardLayout/src/options.cpp
+++ b/plugins/ChangeKeyboardLayout/src/options.cpp
@@ -201,7 +201,7 @@ INT_PTR CALLBACK DlgMainProcOptions(HWND hWnd, UINT uiMessage, WPARAM wParam, LP
WriteMainOptions();
- ptszFormLay = (LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR));
+ ptszFormLay = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
GetDlgItemText(hWnd, IDC_EDIT_SET, ptszFormLay, MaxTextSize);
i = SendDlgItemMessage(hWnd, IDC_COMBO_LANG, CB_GETCURSEL, 0, 0);
ptszMemLay = ptszLayStrings[i];
@@ -350,12 +350,12 @@ INT_PTR CALLBACK DlgPopupsProcOptions(HWND hWnd, UINT uiMessage, WPARAM wParam,
case IDC_BUTTON_PREVIEW:
if ((HIWORD(wParam) == BN_CLICKED )) {
- ptszPopupPreviewText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR));
+ ptszPopupPreviewText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
POPUPDATAT_V2 pdtData = { 0 };
pdtData.cbSize = sizeof(pdtData);
- _tcsncpy(pdtData.lptzContactName, TranslateT(ModuleName), MAX_CONTACTNAME);
- _tcsncpy(pdtData.lptzText, L"Ghbdtn? rfr ltkf&", MAX_SECONDLINE);
+ wcsncpy(pdtData.lptzContactName, TranslateT(ModuleName), MAX_CONTACTNAME);
+ wcsncpy(pdtData.lptzText, L"Ghbdtn? rfr ltkf&", MAX_SECONDLINE);
switch(poOptionsTemp.bColourType) {
case PPC_POPUP:
diff --git a/plugins/ChangeKeyboardLayout/src/text_operations.cpp b/plugins/ChangeKeyboardLayout/src/text_operations.cpp
index d66dd38e70..ed1cdf4460 100644
--- a/plugins/ChangeKeyboardLayout/src/text_operations.cpp
+++ b/plugins/ChangeKeyboardLayout/src/text_operations.cpp
@@ -14,7 +14,7 @@ static DWORD CALLBACK EditStreamOutRtf(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG c
{
EditStreamData *esd = (EditStreamData*)dwCookie;
esd->cbBuff += cb;
- esd->pbBuff = (PBYTE)realloc(esd->pbBuff, esd->cbBuff + sizeof(TCHAR));
+ esd->pbBuff = (PBYTE)realloc(esd->pbBuff, esd->cbBuff + sizeof(wchar_t));
memcpy(esd->pbBuff + esd->iCurrent, pbBuff, cb);
esd->iCurrent += cb;
esd->pbBuff[esd->iCurrent] = 0;
@@ -28,8 +28,8 @@ LPTSTR GeTStringFromStreamData(EditStreamData *esd)
{
DWORD i, k;
- LPTSTR ptszOutText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR));
- LPTSTR ptszTemp = (TCHAR*)esd->pbBuff;
+ LPTSTR ptszOutText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
+ LPTSTR ptszTemp = (wchar_t*)esd->pbBuff;
for (i = k = 0; i < mir_tstrlen(ptszTemp); i++) {
if ((ptszTemp[i] == 0x0A) || (ptszTemp[i] == 0x2028))
@@ -52,8 +52,8 @@ BOOL CopyTextToClipboard(LPTSTR ptszText)
return FALSE;
EmptyClipboard();
- HGLOBAL hCopy = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(ptszText) + 1)*sizeof(TCHAR));
- mir_tstrcpy((TCHAR*)GlobalLock(hCopy), ptszText);
+ HGLOBAL hCopy = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(ptszText) + 1)*sizeof(wchar_t));
+ mir_tstrcpy((wchar_t*)GlobalLock(hCopy), ptszText);
GlobalUnlock(hCopy);
SetClipboardData(CF_UNICODETEXT, hCopy);
CloseClipboard();
@@ -69,8 +69,8 @@ LPSTR GetNameOfLayout(HKL hklLayout)
LPTSTR GetShortNameOfLayout(HKL hklLayout)
{
- TCHAR szLI[20];
- LPTSTR ptszLiShort = (LPTSTR)mir_alloc(3*sizeof(TCHAR));
+ wchar_t szLI[20];
+ LPTSTR ptszLiShort = (LPTSTR)mir_alloc(3*sizeof(wchar_t));
DWORD dwLcid = MAKELCID(LOWORD(hklLayout), 0);
GetLocaleInfo(dwLcid, LOCALE_SISO639LANGNAME, szLI, 10);
ptszLiShort[0] = toupper(szLI[0]);
@@ -92,8 +92,8 @@ LPTSTR GenerateLayoutString(HKL hklLayout)
{
BYTE bState[256] = {0};
- LPTSTR ptszLayStr = (LPTSTR)mir_alloc(100 * sizeof(TCHAR));
- LPTSTR ptszTemp = (LPTSTR)mir_alloc(3 * sizeof(TCHAR));
+ LPTSTR ptszLayStr = (LPTSTR)mir_alloc(100 * sizeof(wchar_t));
+ LPTSTR ptszTemp = (LPTSTR)mir_alloc(3 * sizeof(wchar_t));
ptszTemp[0] = 0;
DWORD i;
@@ -138,7 +138,7 @@ LPTSTR GetLayoutString(HKL hklLayout)
LPTSTR ChangeTextCase(LPCTSTR ptszInText)
{
- LPTSTR ptszOutText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR));
+ LPTSTR ptszOutText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
mir_tstrcpy(ptszOutText, ptszInText);
for (DWORD i = 0; i < mir_tstrlen(ptszInText); i++) {
@@ -151,7 +151,7 @@ LPTSTR ChangeTextCase(LPCTSTR ptszInText)
LPTSTR ChangeTextLayout(LPCTSTR ptszInText, HKL hklCurLay, HKL hklToLay, BOOL TwoWay)
{
- LPTSTR ptszOutText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR));
+ LPTSTR ptszOutText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
mir_tstrcpy(ptszOutText, ptszInText);
if (hklCurLay == NULL || hklToLay == NULL)
@@ -189,7 +189,7 @@ HKL GetLayoutOfText(LPCTSTR ptszInText)
DWORD dwMaxSymbols = 0, dwTemp = 0;
for (DWORD j = 0; j < mir_tstrlen(ptszInText); j++)
- if (_tcschr(ptszKeybBuff, ptszInText[j]) != NULL)
+ if (wcschr(ptszKeybBuff, ptszInText[j]) != NULL)
++dwMaxSymbols;
for (DWORD i = 1; i < bLayNum; i++) {
@@ -197,7 +197,7 @@ HKL GetLayoutOfText(LPCTSTR ptszInText)
DWORD dwCountSymbols = 0;
for (DWORD j = 0; j<mir_tstrlen(ptszInText); j++)
- if (_tcschr(ptszKeybBuff, ptszInText[j]) != NULL)
+ if (wcschr(ptszKeybBuff, ptszInText[j]) != NULL)
++dwCountSymbols;
if (dwCountSymbols == dwMaxSymbols)
@@ -240,7 +240,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
if (ServiceExists(MS_HPP_EG_EVENT)) {
// Òî æå ñàìîå äëÿ History++
ieEvent.hwnd = hTextWnd;
- ptszInText = (TCHAR*)CallService(MS_HPP_EG_EVENT, 0, (LPARAM)&ieEvent);
+ ptszInText = (wchar_t*)CallService(MS_HPP_EG_EVENT, 0, (LPARAM)&ieEvent);
if (!IsBadStringPtr(ptszInText, MaxTextSize))
WindowType = WTYPE_HistoryPP;
@@ -250,17 +250,17 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
// Èçâðàùåííîå îïðåäåëåíèå õýíäëà IEView
ieEvent.hwnd = GetParent(GetParent(hTextWnd));
- ptszInText = (TCHAR*)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&ieEvent);
+ ptszInText = (wchar_t*)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&ieEvent);
if (!IsBadStringPtr(ptszInText, MaxTextSize))
WindowType = WTYPE_IEView;
}
if (WindowType == WTYPE_Unknown) {
- ptrT ptszTemp((LPTSTR)mir_alloc(255 * sizeof(TCHAR)));
+ ptrT ptszTemp((LPTSTR)mir_alloc(255 * sizeof(wchar_t)));
i = GetClassName(hTextWnd, ptszTemp, 255);
ptszTemp[i] = 0;
- if (_tcsstr(CharUpper(ptszTemp), L"RICHEDIT") != NULL) {
+ if (wcsstr(CharUpper(ptszTemp), L"RICHEDIT") != NULL) {
WindowType = WTYPE_RichEdit;
SendMessage(hTextWnd, EM_EXGETSEL, 0, (LPARAM)&crSelection);
}
@@ -297,11 +297,11 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
}
}
if (WindowType == WTYPE_Edit) {
- ptrT ptszTemp((LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR)));
- ptszInText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR));
+ ptrT ptszTemp((LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t)));
+ ptszInText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
iRes = GetWindowText(hTextWnd, ptszTemp, MaxTextSize);
if (!IsBadStringPtr(ptszInText, MaxTextSize) && (iRes > 0)) {
- _tcsncpy(ptszInText, &ptszTemp[crSelection.cpMin], crSelection.cpMax - crSelection.cpMin);
+ wcsncpy(ptszInText, &ptszTemp[crSelection.cpMin], crSelection.cpMax - crSelection.cpMin);
ptszInText[crSelection.cpMax - crSelection.cpMin] = 0;
}
else {
@@ -334,7 +334,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
}
}
if (WindowType == WTYPE_Edit) {
- ptszInText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR));
+ ptszInText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
iRes = GetWindowText(hTextWnd, ptszInText, MaxTextSize);
if (!IsBadStringPtr(ptszInText, MaxTextSize) && (iRes > 0)) {
@@ -350,8 +350,8 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
}
// Ïîëó÷àåì òåêóùåå ñëîâî
if (CurrentWord) {
- for (dwStartWord = crSelection.cpMin; (dwStartWord > 0) && (_tcschr(ptszSeparators, ptszInText[dwStartWord - 1]) == NULL); dwStartWord--);
- for (dwEndWord = crSelection.cpMin; (dwEndWord < (mir_tstrlen(ptszInText))) && (_tcschr(ptszSeparators, ptszInText[dwEndWord]) == NULL); dwEndWord++);
+ for (dwStartWord = crSelection.cpMin; (dwStartWord > 0) && (wcschr(ptszSeparators, ptszInText[dwStartWord - 1]) == NULL); dwStartWord--);
+ for (dwEndWord = crSelection.cpMin; (dwEndWord < (mir_tstrlen(ptszInText))) && (wcschr(ptszSeparators, ptszInText[dwEndWord]) == NULL); dwEndWord++);
crTemp.cpMin = dwStartWord;
crTemp.cpMax = dwEndWord;
@@ -374,8 +374,8 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
}
if (WindowType == WTYPE_Edit) {
- ptrT ptszTemp((LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR)));
- _tcsncpy(ptszTemp, &ptszInText[crTemp.cpMin], crTemp.cpMax - crTemp.cpMin);
+ ptrT ptszTemp((LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t)));
+ wcsncpy(ptszTemp, &ptszInText[crTemp.cpMin], crTemp.cpMax - crTemp.cpMin);
ptszTemp[crTemp.cpMax - crTemp.cpMin] = 0;
mir_tstrcpy(ptszInText, ptszTemp);
@@ -403,7 +403,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
// Ëîã Èåâüþ è ÕèñòîðèÏÏ â ðåæèìå ýìóëÿöèè Èåâüþ è ïîëÿ òîëüêî äëÿ ÷òåíèÿ.
if (WindowType != WTYPE_Unknown && !IsBadStringPtr(ptszInText, MaxTextSize))
if (WindowIsReadOnly) {
- ptrT ptszMBox((LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR)));
+ ptrT ptszMBox((LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t)));
ptszMBox[0] = 0;
if (TextOperation == TOT_Layout) {
@@ -445,13 +445,13 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
//-------------------------------Ïîêàæåì ïîïàïû------------------------------------------
if (moOptions.ShowPopup) {
- LPTSTR ptszPopupText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR));
+ LPTSTR ptszPopupText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t));
mir_tstrcpy(ptszPopupText, ptszMBox);
POPUPDATAT_V2 pdtData = { 0 };
pdtData.cbSize = sizeof(pdtData);
- _tcsncpy(pdtData.lptzContactName, TranslateT(ModuleName), MAX_CONTACTNAME);
- _tcsncpy(pdtData.lptzText, ptszPopupText, MAX_SECONDLINE);
+ wcsncpy(pdtData.lptzContactName, TranslateT(ModuleName), MAX_CONTACTNAME);
+ wcsncpy(pdtData.lptzText, ptszPopupText, MAX_SECONDLINE);
switch (poOptions.bColourType) {
case PPC_POPUP:
@@ -510,7 +510,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
SendMessage(hTextWnd, EM_EXSETSEL, 0, (LPARAM)&crSelection);
}
else {
- ptrT ptszTemp((LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR)));
+ ptrT ptszTemp((LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t)));
GetWindowText(hTextWnd, ptszTemp, MaxTextSize);
for (i = crTemp.cpMin; i < crTemp.cpMax; i++)
ptszTemp[i] = ptszOutText[i - crTemp.cpMin];
diff --git a/plugins/ClientChangeNotify/src/CString.cpp b/plugins/ClientChangeNotify/src/CString.cpp
index 8cb1208896..21449ee8e6 100644
--- a/plugins/ClientChangeNotify/src/CString.cpp
+++ b/plugins/ClientChangeNotify/src/CString.cpp
@@ -268,7 +268,7 @@ TString<T>& TString<T>::operator = (const T *pStr)
return *this;
}
-template class TString<TCHAR>;
+template class TString<wchar_t>;
template class TString<char>;
template class TString<WCHAR>;
@@ -278,13 +278,13 @@ CString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting,
return CString(p == NULL ? szDefaultValue : p);
}
-TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue)
+TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue)
{
ptrT p( db_get_tsa(hContact, szModule, szSetting));
return TCString(p == NULL ? szDefaultValue : p);
}
-TCString DBGetContactSettingAsString(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue)
+TCString DBGetContactSettingAsString(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue)
{ // also converts numeric values to a string
DBVARIANT dbv = {0};
int iRes = db_get_ws(hContact, szModule, szSetting, &dbv);
diff --git a/plugins/ClientChangeNotify/src/CString.h b/plugins/ClientChangeNotify/src/CString.h
index 9218a6459d..decedaaac7 100644
--- a/plugins/ClientChangeNotify/src/CString.h
+++ b/plugins/ClientChangeNotify/src/CString.h
@@ -20,7 +20,6 @@
#pragma once
#include <windows.h>
-#include <tchar.h>
#include <crtdbg.h>
#ifdef CHARARRAY_CONVERT
#include "TMyArray.h"
@@ -97,7 +96,7 @@ private:
};
-typedef TString<TCHAR> TCString;
+typedef TString<wchar_t> TCString;
typedef TString<char> CString;
typedef TString<WCHAR> WCString;
@@ -164,9 +163,9 @@ __inline CHARARRAY WCHAR2UTF8(WCString Str)
#undef db_get_s
CString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const char *szDefaultValue);
-TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue);
+TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue);
int db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
-TCString DBGetContactSettingAsString(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue); // also converts numeric values to a string
+TCString DBGetContactSettingAsString(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue); // also converts numeric values to a string
// various string helpers. their return values are valid only while the class is visible
class UTF8Encode
diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp
index dfd08a712c..86cc7fdee5 100644
--- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp
+++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp
@@ -149,11 +149,11 @@ void ShowPopup(SHOWPOPUP_DATA *sd)
{
TCString PopupText;
if (sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_SHOWPREVCLIENT)) {
- mir_sntprintf(PopupText.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("changed client to %s (was %s)"), (const TCHAR*)sd->MirVer, (const TCHAR*)sd->OldMirVer);
+ mir_sntprintf(PopupText.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("changed client to %s (was %s)"), (const wchar_t*)sd->MirVer, (const wchar_t*)sd->OldMirVer);
PopupText.ReleaseBuffer();
}
else {
- mir_sntprintf(PopupText.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("changed client to %s"), (const TCHAR*)sd->MirVer);
+ mir_sntprintf(PopupText.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("changed client to %s"), (const wchar_t*)sd->MirVer);
PopupText.ReleaseBuffer();
}
@@ -168,8 +168,8 @@ void ShowPopup(SHOWPOPUP_DATA *sd)
ppd.lchIcon = Skin_LoadProtoIcon(szProto, db_get_w(sd->hContact, szProto, "Status", ID_STATUS_OFFLINE));
pdata->hIcon = NULL;
}
- _tcsncpy(ppd.lptzContactName, (TCHAR*)pcli->pfnGetContactDisplayName(sd->hContact, 0), _countof(ppd.lptzContactName) - 1);
- _tcsncpy(ppd.lptzText, PopupText, _countof(ppd.lptzText) - 1);
+ wcsncpy(ppd.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(sd->hContact, 0), _countof(ppd.lptzContactName) - 1);
+ wcsncpy(ppd.lptzText, PopupText, _countof(ppd.lptzText) - 1);
ppd.colorBack = (sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_DEFBGCOLOUR) ? 0 : sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_BGCOLOUR));
ppd.colorText = (sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_DEFTEXTCOLOUR) ? 0 : sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_TEXTCOLOUR));
ppd.PluginWindowProc = PopupWndProc;
@@ -244,7 +244,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam)
}
}
}
- if (sd.MirVer == (const TCHAR*)sd.OldMirVer) {
+ if (sd.MirVer == (const wchar_t*)sd.OldMirVer) {
_ASSERT(hContact);
return 0;
}
@@ -257,7 +257,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam)
if (hContact) {
TCString ClientName;
if (PopupOptPage.GetValue(IDC_POPUPOPTDLG_SHOWPREVCLIENT) && sd.OldMirVer.GetLen()) {
- mir_sntprintf(ClientName.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("%s (was %s)"), (const TCHAR*)sd.MirVer, (const TCHAR*)sd.OldMirVer);
+ mir_sntprintf(ClientName.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("%s (was %s)"), (const wchar_t*)sd.MirVer, (const wchar_t*)sd.OldMirVer);
ClientName.ReleaseBuffer();
}
else ClientName = sd.MirVer;
@@ -277,9 +277,9 @@ static int PrebuildMainMenu(WPARAM, LPARAM)
// we have to use ME_CLIST_PREBUILDMAINMENU instead of updating menu items only on settings change, because "popup_enabled" and "popup_disabled" icons are not always available yet in ModulesLoaded
if (bPopupExists) {
if (g_PopupOptPage.GetDBValueCopy(IDC_POPUPOPTDLG_POPUPNOTIFY))
- Menu_ModifyItem(g_hTogglePopupsMenuItem, LPGENT("Disable c&lient change notification"), IcoLib_GetIcon("popup_enabled"));
+ Menu_ModifyItem(g_hTogglePopupsMenuItem, LPGENW("Disable c&lient change notification"), IcoLib_GetIcon("popup_enabled"));
else
- Menu_ModifyItem(g_hTogglePopupsMenuItem, LPGENT("Enable c&lient change notification"), IcoLib_GetIcon("popup_disabled"));
+ Menu_ModifyItem(g_hTogglePopupsMenuItem, LPGENW("Enable c&lient change notification"), IcoLib_GetIcon("popup_disabled"));
}
return 0;
}
@@ -330,12 +330,12 @@ int MirandaLoaded(WPARAM, LPARAM)
CMenuItem mi;
SET_UID(mi, 0xfabb9181, 0xdb92, 0x43f4, 0x86, 0x40, 0xca, 0xb6, 0x4c, 0x93, 0x34, 0x27);
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Popups"), 0);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Popups"), 0);
mi.flags = CMIF_TCHAR;
if (g_PopupOptPage.GetDBValueCopy(IDC_POPUPOPTDLG_POPUPNOTIFY))
- mi.name.t = LPGENT("Disable c&lient change notification");
+ mi.name.w = LPGENW("Disable c&lient change notification");
else
- mi.name.t = LPGENT("Enable c&lient change notification");
+ mi.name.w = LPGENW("Enable c&lient change notification");
mi.pszService = MS_CCN_TOGGLEPOPUPS;
g_hTogglePopupsMenuItem = Menu_AddMainMenuItem(&mi);
diff --git a/plugins/ClientChangeNotify/src/Misc.h b/plugins/ClientChangeNotify/src/Misc.h
index d490677750..7d1b1eb238 100644
--- a/plugins/ClientChangeNotify/src/Misc.h
+++ b/plugins/ClientChangeNotify/src/Misc.h
@@ -20,7 +20,7 @@
#include "stdafx.h"
extern BOOL bPopupExists;
-__inline void ShowMsg(TCHAR *FirstLine, TCHAR *SecondLine = L"", bool IsErrorMsg = false, int Timeout = 0)
+__inline void ShowMsg(wchar_t *FirstLine, wchar_t *SecondLine = L"", bool IsErrorMsg = false, int Timeout = 0)
{
if (bPopupExists)
{
@@ -43,7 +43,7 @@ __inline void ShowLog(TCString &LogFilePath)
INT_PTR Result = (INT_PTR)ShellExecute(NULL, L"open", LogFilePath, NULL, NULL, SW_SHOW);
if (Result <= 32) // Error
{
- TCHAR szError[64];
+ wchar_t szError[64];
mir_sntprintf(szError, TranslateT("Error #%d"), Result);
ShowMsg(szError, TranslateT("Can't open log file ") + LogFilePath, true);
}
@@ -52,10 +52,10 @@ __inline void ShowLog(TCString &LogFilePath)
__inline void RecompileRegexps(TCString IgnoreSubstrings)
{
FreePcreCompileData();
- TCHAR *p = _tcstok(IgnoreSubstrings, L";");
+ wchar_t *p = wcstok(IgnoreSubstrings, L";");
while (p)
{
CompileRegexp(p, p[0] != '/');
- p = _tcstok(NULL, L";");
+ p = wcstok(NULL, L";");
}
}
diff --git a/plugins/ClientChangeNotify/src/OptDlg.cpp b/plugins/ClientChangeNotify/src/OptDlg.cpp
index 4aefc4c519..9ec69fe61c 100644
--- a/plugins/ClientChangeNotify/src/OptDlg.cpp
+++ b/plugins/ClientChangeNotify/src/OptDlg.cpp
@@ -58,17 +58,17 @@ void EnablePopupOptDlgControls()
static struct
{
- TCHAR *Text;
+ wchar_t *Text;
int Action;
}
PopupActions[] =
{
- LPGENT("Open message window"), PCA_OPENMESSAGEWND,
- LPGENT("Close popup"), PCA_CLOSEPOPUP,
- LPGENT("Open contact details window"), PCA_OPENDETAILS,
- LPGENT("Open contact menu"), PCA_OPENMENU,
- LPGENT("Open contact history"), PCA_OPENHISTORY,
- LPGENT("Do nothing"), PCA_DONOTHING
+ LPGENW("Open message window"), PCA_OPENMESSAGEWND,
+ LPGENW("Close popup"), PCA_CLOSEPOPUP,
+ LPGENW("Open contact details window"), PCA_OPENDETAILS,
+ LPGENW("Open contact menu"), PCA_OPENMENU,
+ LPGENW("Open contact history"), PCA_OPENHISTORY,
+ LPGENW("Do nothing"), PCA_DONOTHING
};
INT_PTR CALLBACK PopupOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -163,11 +163,11 @@ int OptionsDlgInit(WPARAM wParam, LPARAM)
if (bPopupExists) {
OPTIONSDIALOGPAGE optDi = { sizeof(optDi) };
optDi.position = 920000000;
- optDi.ptszTitle = LPGENT("ClientChangeNotify");
+ optDi.pwszTitle = LPGENW("ClientChangeNotify");
optDi.pfnDlgProc = PopupOptDlg;
optDi.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPOPTDLG);
optDi.hInstance = g_hInstance;
- optDi.ptszGroup = LPGENT("Popups");
+ optDi.pwszGroup = LPGENW("Popups");
optDi.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &optDi);
}
diff --git a/plugins/ClientChangeNotify/src/Options.cpp b/plugins/ClientChangeNotify/src/Options.cpp
index aea2556676..62463ea611 100644
--- a/plugins/ClientChangeNotify/src/Options.cpp
+++ b/plugins/ClientChangeNotify/src/Options.cpp
@@ -286,7 +286,7 @@ int TreeReadEnum(const char *szSetting, LPARAM lParam)
pItem.Title = db_get_s(NULL, pData->sModule, *pData->sDBSettingPrefix + szSetting, L"");
pItem.User_Str1 = (pData->TreeCtrl->User_Str1_DBName == NULL) ? NULL :
db_get_s(NULL, pData->sModule,
- *pData->sDBSettingPrefix + pData->TreeCtrl->sDBSetting + pData->TreeCtrl->User_Str1_DBName + (szSetting + Len), (TCHAR*)NULL);
+ *pData->sDBSettingPrefix + pData->TreeCtrl->sDBSetting + pData->TreeCtrl->User_Str1_DBName + (szSetting + Len), (wchar_t*)NULL);
}
}
return 0;
@@ -722,7 +722,7 @@ void COptItem_ListCtrl::MemToWnd(HWND hWnd)
SendMessage(hListView, LB_RESETCONTENT, 0, 0);
for (int i = 0; i < m_value.GetSize(); i++)
- SendMessage(hListView, LB_INSERTSTRING, -1, (LPARAM)(TCHAR*)m_value[i].Text);
+ SendMessage(hListView, LB_INSERTSTRING, -1, (LPARAM)(wchar_t*)m_value[i].Text);
SendMessage(hListView, WM_SETREDRAW, true, 0);
COptItem::MemToWnd(hWnd);
@@ -794,7 +794,7 @@ void COptItem_ListCtrl::ModifyItem(HWND hWnd, int ID, CListItem &Item)
int TopIndex = SendMessage(hListView, LB_GETTOPINDEX, 0, 0);
int Res = SendMessage(hListView, LB_DELETESTRING, ID, 0);
_ASSERT(Res != LB_ERR);
- Res = SendMessage(hListView, LB_INSERTSTRING, ID, (LPARAM)(TCHAR*)(Item.Text));
+ Res = SendMessage(hListView, LB_INSERTSTRING, ID, (LPARAM)(wchar_t*)(Item.Text));
_ASSERT(Res != LB_ERR && Res != LB_ERRSPACE);
SendMessage(hListView, LB_SETCURSEL, CurSel, 0);
SendMessage(hListView, LB_SETTOPINDEX, TopIndex, 0);
@@ -808,7 +808,7 @@ CListItem* COptItem_ListCtrl::InsertItem(HWND hWnd, int ID, CListItem &Item)
// ID is position at which to insert the item; -1 = add to the end of the list
{
HWND hListView = GetDlgItem(hWnd, m_dlgItemID);
- int Res = SendMessage(hListView, LB_INSERTSTRING, ID, (LPARAM)(TCHAR*)(Item.Text)); // LB_INSERTSTRING doesn't sort the lists even with LBS_SORT style
+ int Res = SendMessage(hListView, LB_INSERTSTRING, ID, (LPARAM)(wchar_t*)(Item.Text)); // LB_INSERTSTRING doesn't sort the lists even with LBS_SORT style
_ASSERT(Res != LB_ERR && Res != LB_ERRSPACE);
int i = m_value.AddElem(Item);
m_bModified = true;
diff --git a/plugins/ClientChangeNotify/src/Options.h b/plugins/ClientChangeNotify/src/Options.h
index b22a0b902b..aac3e9d1c0 100644
--- a/plugins/ClientChangeNotify/src/Options.h
+++ b/plugins/ClientChangeNotify/src/Options.h
@@ -92,7 +92,7 @@ class COptItem_Edit : public COptItem
{
public:
COptItem_Edit() {}
- COptItem_Edit(int m_dlgItemID, char *szDBSetting, int nMaxLen, TCHAR *szDefValue, int lParam = 0, bool m_bReadOnly = false)
+ COptItem_Edit(int m_dlgItemID, char *szDBSetting, int nMaxLen, wchar_t *szDefValue, int lParam = 0, bool m_bReadOnly = false)
: COptItem(m_dlgItemID, szDBSetting, nMaxLen, lParam, m_bReadOnly), sDefValue(szDefValue)
{}
@@ -323,7 +323,7 @@ class COptItem_StrDBSetting : public COptItem
{
public:
COptItem_StrDBSetting() {}
- COptItem_StrDBSetting(int m_dlgItemID, char *szDBSetting, int nMaxLen, TCHAR *szDefValue, int lParam = 0, bool m_bReadOnly = false) : COptItem(m_dlgItemID, szDBSetting, nMaxLen, lParam, m_bReadOnly), sDefValue(szDefValue) {}
+ COptItem_StrDBSetting(int m_dlgItemID, char *szDBSetting, int nMaxLen, wchar_t *szDefValue, int lParam = 0, bool m_bReadOnly = false) : COptItem(m_dlgItemID, szDBSetting, nMaxLen, lParam, m_bReadOnly), sDefValue(szDefValue) {}
void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { sValue = GetStrDBVal(sModule, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetStrDBVal(sModule, sValue, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
void WndToMem(HWND hWnd) { COptItem::WndToMem(hWnd); }
diff --git a/plugins/ClientChangeNotify/src/pcre.cpp b/plugins/ClientChangeNotify/src/pcre.cpp
index 259e9facdb..c7954f265f 100644
--- a/plugins/ClientChangeNotify/src/pcre.cpp
+++ b/plugins/ClientChangeNotify/src/pcre.cpp
@@ -71,8 +71,8 @@ TCString CompileRegexp(TCString Regexp, int bAddAsUsualSubstring, int ID)
{
TCString OrigRegexp = Regexp;
Regexp = Regexp.Right(Regexp.GetLen() - 1);
- TCHAR *pRegexpEnd = (TCHAR*)Regexp + Regexp.GetLen();
- TCHAR *p = _tcsrchr(Regexp.GetBuffer(), '/');
+ wchar_t *pRegexpEnd = (wchar_t*)Regexp + Regexp.GetLen();
+ wchar_t *p = wcsrchr(Regexp.GetBuffer(), '/');
if (!p)
{
Regexp = OrigRegexp;
@@ -126,7 +126,7 @@ TCString CompileRegexp(TCString Regexp, int bAddAsUsualSubstring, int ID)
PcreCompileData[NewID].pExtra = pcre16_study(PcreCompileData[NewID].pPcre, 0, &Err);
}
else {
- // Result += LogMessage(TranslateT("Syntax error in regexp\n%s\nat offset %d: %s."), (TCHAR*)Regexp, ErrOffs, (TCHAR*)ANSI2TCHAR(Err)) + L"\n\n";
+ // Result += LogMessage(TranslateT("Syntax error in regexp\n%s\nat offset %d: %s."), (wchar_t*)Regexp, ErrOffs, (wchar_t*)ANSI2TCHAR(Err)) + L"\n\n";
PcreCompileData[NewID].Pattern = Regexp;
}
}
@@ -165,7 +165,7 @@ int PcreCheck(TCString Str, int StartingID)
}
} else
{
- if (_tcsstr(Str.ToLower(), PcreCompileData[I].Pattern.ToLower()))
+ if (wcsstr(Str.ToLower(), PcreCompileData[I].Pattern.ToLower()))
{
return PcreCompileData[I].ID;
}
diff --git a/plugins/Clist_blind/src/clcopts.cpp b/plugins/Clist_blind/src/clcopts.cpp
index 36a6dad54c..3a60f5c8cf 100644
--- a/plugins/Clist_blind/src/clcopts.cpp
+++ b/plugins/Clist_blind/src/clcopts.cpp
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-TCHAR* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* setting, TCHAR* out, size_t len, TCHAR *def);
+wchar_t* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* setting, wchar_t* out, size_t len, wchar_t *def);
#define DBFONTF_BOLD 1
#define DBFONTF_ITALIC 2
@@ -55,34 +55,34 @@ static const checkBoxToStyleEx[] = {
struct CheckBoxValues_t
{
DWORD style;
- TCHAR* szDescr;
+ wchar_t* szDescr;
};
static const struct CheckBoxValues_t greyoutValues[] = {
- { GREYF_UNFOCUS, LPGENT("Not focused") },
- { MODEF_OFFLINE, LPGENT("Offline") },
- { PF2_ONLINE, LPGENT("Online") },
- { PF2_SHORTAWAY, LPGENT("Away") },
- { PF2_LONGAWAY, LPGENT("Not available") },
- { PF2_LIGHTDND, LPGENT("Occupied") },
- { PF2_HEAVYDND, LPGENT("Do not disturb")},
- { PF2_FREECHAT, LPGENT("Free for chat") },
- { PF2_INVISIBLE, LPGENT("Invisible") },
- { PF2_OUTTOLUNCH, LPGENT("Out to lunch") },
- { PF2_ONTHEPHONE, LPGENT("On the phone") }
+ { GREYF_UNFOCUS, LPGENW("Not focused") },
+ { MODEF_OFFLINE, LPGENW("Offline") },
+ { PF2_ONLINE, LPGENW("Online") },
+ { PF2_SHORTAWAY, LPGENW("Away") },
+ { PF2_LONGAWAY, LPGENW("Not available") },
+ { PF2_LIGHTDND, LPGENW("Occupied") },
+ { PF2_HEAVYDND, LPGENW("Do not disturb")},
+ { PF2_FREECHAT, LPGENW("Free for chat") },
+ { PF2_INVISIBLE, LPGENW("Invisible") },
+ { PF2_OUTTOLUNCH, LPGENW("Out to lunch") },
+ { PF2_ONTHEPHONE, LPGENW("On the phone") }
};
static const struct CheckBoxValues_t offlineValues[] = {
- { MODEF_OFFLINE, LPGENT("Offline") },
- { PF2_ONLINE, LPGENT("Online") },
- { PF2_SHORTAWAY, LPGENT("Away") },
- { PF2_LONGAWAY, LPGENT("Not available") },
- { PF2_LIGHTDND, LPGENT("Occupied") },
- { PF2_HEAVYDND, LPGENT("Do not disturb")},
- { PF2_FREECHAT, LPGENT("Free for chat") },
- { PF2_INVISIBLE, LPGENT("Invisible") },
- { PF2_OUTTOLUNCH, LPGENT("Out to lunch") },
- { PF2_ONTHEPHONE, LPGENT("On the phone") }
+ { MODEF_OFFLINE, LPGENW("Offline") },
+ { PF2_ONLINE, LPGENW("Online") },
+ { PF2_SHORTAWAY, LPGENW("Away") },
+ { PF2_LONGAWAY, LPGENW("Not available") },
+ { PF2_LIGHTDND, LPGENW("Occupied") },
+ { PF2_HEAVYDND, LPGENW("Do not disturb")},
+ { PF2_FREECHAT, LPGENW("Free for chat") },
+ { PF2_INVISIBLE, LPGENW("Invisible") },
+ { PF2_OUTTOLUNCH, LPGENW("Out to lunch") },
+ { PF2_ONTHEPHONE, LPGENW("On the phone") }
};
static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *values, int nValues, DWORD style)
@@ -118,7 +118,7 @@ static DWORD MakeCheckBoxTreeFlags(HWND hwndTree)
static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TCHAR tmp[1024];
+ wchar_t tmp[1024];
switch (msg) {
case WM_INITDIALOG:
diff --git a/plugins/Clist_blind/src/clcpaint.cpp b/plugins/Clist_blind/src/clcpaint.cpp
index 2371b69626..0c9824e4eb 100644
--- a/plugins/Clist_blind/src/clcpaint.cpp
+++ b/plugins/Clist_blind/src/clcpaint.cpp
@@ -269,7 +269,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
int hottrack = dat->exStyle & CLS_EX_TRACKSELECT && cc->type != CLCIT_DIVIDER && dat->iHotTrack == index;
SIZE textSize, countsSize = { 0 }, spaceSize = { 0 };
int width, checkboxWidth;
- TCHAR *szCounts = NULL;
+ wchar_t *szCounts = NULL;
// alternating grey
if (style & CLS_GREYALTERNATE && index & 1) {
@@ -414,7 +414,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
}
}
else {
- TCHAR *szText = cc->szText;
+ wchar_t *szText = cc->szText;
RECT rc;
rc.left = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace;
rc.top = y + ((dat->rowHeight - fontHeight) >> 1);
@@ -424,7 +424,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
}
if (selected) {
if (cc->type != CLCIT_DIVIDER) {
- TCHAR *szText = cc->szText;
+ wchar_t *szText = cc->szText;
RECT rc;
int qlen = (int)mir_tstrlen(dat->szQuickSearch);
SetTextColor(hdcMem, dat->quickSearchColour);
diff --git a/plugins/Clist_blind/src/cluiopts.cpp b/plugins/Clist_blind/src/cluiopts.cpp
index 4490d55ee2..bccb11eca6 100644
--- a/plugins/Clist_blind/src/cluiopts.cpp
+++ b/plugins/Clist_blind/src/cluiopts.cpp
@@ -167,7 +167,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
db_set_b(NULL, "CLUI", "ClientAreaDrag", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CLIENTDRAG));
db_set_b(NULL, "CList", "Min2Tray", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY));
{
- TCHAR title[256];
+ wchar_t title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
db_set_ts(NULL, "CList", "TitleText", title);
SetWindowText(pcli->hwndContactList, title);
diff --git a/plugins/Clist_blind/src/contact.cpp b/plugins/Clist_blind/src/contact.cpp
index f93b16b71f..3adbd0c4da 100644
--- a/plugins/Clist_blind/src/contact.cpp
+++ b/plugins/Clist_blind/src/contact.cpp
@@ -83,9 +83,9 @@ int CompareContacts(const ClcContact* c1, const ClcContact* c2)
return 2 * (statusa == ID_STATUS_OFFLINE) - 1;
}
- TCHAR namea[128];
- TCHAR *nameb = pcli->pfnGetContactDisplayName(a, 0);
- _tcsncpy_s(namea, nameb, _TRUNCATE);
+ wchar_t namea[128];
+ wchar_t *nameb = pcli->pfnGetContactDisplayName(a, 0);
+ wcsncpy_s(namea, nameb, _TRUNCATE);
namea[ _countof(namea)-1 ] = 0;
nameb = pcli->pfnGetContactDisplayName(b, 0);
diff --git a/plugins/Clist_blind/src/init.cpp b/plugins/Clist_blind/src/init.cpp
index 2bc79bdbed..30ccfa6c0c 100644
--- a/plugins/Clist_blind/src/init.cpp
+++ b/plugins/Clist_blind/src/init.cpp
@@ -176,11 +176,11 @@ extern "C" int __declspec(dllexport) Unload(void)
/////////////////////////////////////////////////////////////////////////////////////////
-TCHAR* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* setting, TCHAR* out, size_t len, TCHAR *def)
+wchar_t* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* setting, wchar_t* out, size_t len, wchar_t *def)
{
DBVARIANT dbv;
- out[0] = _T('\0');
+ out[0] = '\0';
if (!db_get_ts(hContact, module, setting, &dbv)) {
if (dbv.type == DBVT_ASCIIZ)
@@ -206,13 +206,13 @@ TCHAR* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* setti
typedef struct
{
- TCHAR *text;
+ wchar_t *text;
size_t allocated;
size_t used;
} StringHelper;
-int CopyData(StringHelper *str, const TCHAR *text, size_t len)
+int CopyData(StringHelper *str, const wchar_t *text, size_t len)
{
size_t totalSize;
@@ -228,7 +228,7 @@ int CopyData(StringHelper *str, const TCHAR *text, size_t len)
totalSize += DATA_BLOCK - (totalSize % DATA_BLOCK);
if (str->text != NULL) {
- TCHAR *tmp = (TCHAR *)mir_realloc(str->text, sizeof(TCHAR) * totalSize);
+ wchar_t *tmp = (wchar_t *)mir_realloc(str->text, sizeof(wchar_t) * totalSize);
if (tmp == NULL) {
mir_free(str->text);
@@ -238,7 +238,7 @@ int CopyData(StringHelper *str, const TCHAR *text, size_t len)
str->text = tmp;
}
else {
- str->text = (TCHAR *)mir_alloc(sizeof(TCHAR) * totalSize);
+ str->text = (wchar_t *)mir_alloc(sizeof(wchar_t) * totalSize);
if (str->text == NULL) {
return -2;
@@ -248,7 +248,7 @@ int CopyData(StringHelper *str, const TCHAR *text, size_t len)
str->allocated = totalSize;
}
- memmove(&str->text[str->used], text, sizeof(TCHAR) * len);
+ memmove(&str->text[str->used], text, sizeof(wchar_t) * len);
str->used += len;
str->text[str->used] = '\0';
@@ -256,9 +256,9 @@ int CopyData(StringHelper *str, const TCHAR *text, size_t len)
}
-TCHAR * ParseText(const TCHAR *text,
- const TCHAR **variables, size_t variablesSize,
- const TCHAR **data, size_t dataSize)
+wchar_t * ParseText(const wchar_t *text,
+ const wchar_t **variables, size_t variablesSize,
+ const wchar_t **data, size_t dataSize)
{
size_t length = mir_tstrlen(text);
size_t nextPos = 0;
@@ -267,13 +267,13 @@ TCHAR * ParseText(const TCHAR *text,
// length - 1 because a % in last char will be a % and point
for (i = 0; i < length - 1; i++) {
- if (text[i] == _T('%')) {
+ if (text[i] == '%') {
BOOL found = FALSE;
if (CopyData(&ret, &text[nextPos], i - nextPos))
return NULL;
- if (text[i + 1] == _T('%')) {
+ if (text[i + 1] == '%') {
if (CopyData(&ret, L"%", 1))
return NULL;
@@ -289,7 +289,7 @@ TCHAR * ParseText(const TCHAR *text,
for (j = 0; j < size; j++) {
size_t vlen = mir_tstrlen(variables[j]);
- if (_tcsnicmp(&text[i], variables[j], vlen) == 0) {
+ if (wcsnicmp(&text[i], variables[j], vlen) == 0) {
if (CopyData(&ret, data[j], mir_tstrlen(data[j])))
return NULL;
@@ -407,18 +407,18 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
return coreCli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
}
-TCHAR status_name[128];
-TCHAR* GetStatusName(struct ClcContact *item)
+wchar_t status_name[128];
+wchar_t* GetStatusName(struct ClcContact *item)
{
int status;
- status_name[0] = _T('\0');
+ status_name[0] = '\0';
if (item->hContact == NULL || item->proto == NULL)
return status_name;
// Get XStatusName
MyDBGetContactSettingTString(item->hContact, item->proto, "XStatusName", status_name, _countof(status_name), NULL);
- if (status_name[0] != _T('\0'))
+ if (status_name[0] != '\0')
return status_name;
// Get status name
@@ -429,16 +429,16 @@ TCHAR* GetStatusName(struct ClcContact *item)
}
-TCHAR status_message[256];
-TCHAR* GetStatusMessage(struct ClcContact *item)
+wchar_t status_message[256];
+wchar_t* GetStatusMessage(struct ClcContact *item)
{
- status_message[0] = _T('\0');
+ status_message[0] = '\0';
if (item->hContact == NULL || item->proto == NULL)
return status_message;
// Get XStatusMsg
MyDBGetContactSettingTString(item->hContact, item->proto, "XStatusMsg", status_message, _countof(status_message), NULL);
- if (status_message[0] != _T('\0'))
+ if (status_message[0] != '\0')
return status_message;
// Get status message
@@ -448,8 +448,8 @@ TCHAR* GetStatusMessage(struct ClcContact *item)
}
-TCHAR proto_name[128];
-TCHAR* GetProtoName(struct ClcContact *item)
+wchar_t proto_name[128];
+wchar_t* GetProtoName(struct ClcContact *item)
{
#ifdef UNICODE
char description[128];
@@ -480,12 +480,12 @@ TCHAR* GetProtoName(struct ClcContact *item)
void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig)
{
ClcData *dat = (ClcData*)tmp_dat;
- TCHAR tmp[1024];
- TCHAR count[128];
- TCHAR template_contact[1024];
- TCHAR template_group[1024];
- TCHAR template_divider[1024];
- TCHAR template_info[1024];
+ wchar_t tmp[1024];
+ wchar_t count[128];
+ wchar_t template_contact[1024];
+ wchar_t template_group[1024];
+ wchar_t template_divider[1024];
+ wchar_t template_info[1024];
int selection = dat->selection;
BOOL has_focus = (GetFocus() == dat->hwnd_list || GetFocus() == hwnd);
@@ -509,7 +509,7 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig)
ClcGroup *group = &dat->list;
group->scanIndex = 0;
- TCHAR *text = tmp;
+ wchar_t *text = tmp;
size_t size = _countof(tmp);
while (true) {
if (group->scanIndex == group->cl.getCount()) {
@@ -522,17 +522,17 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig)
}
ClcContact *item = group->cl[group->scanIndex];
- text[0] = _T('\0');
+ text[0] = '\0';
switch (item->type) {
case CLCIT_GROUP:
{
- TCHAR *szCounts = pcli->pfnGetGroupCountsText(dat, item);
- const TCHAR *t[] = {
+ wchar_t *szCounts = pcli->pfnGetGroupCountsText(dat, item);
+ const wchar_t *t[] = {
L"%name%",
L"%count%",
L"%mode%"
};
- const TCHAR *v[] = {
+ const wchar_t *v[] = {
item->szText,
count,
item->group->expanded ? TranslateT("Expanded") : TranslateT("Collapsed")
@@ -541,9 +541,9 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig)
if (szCounts[0] != '\0')
mir_sntprintf(count, L"%s ", szCounts);
else
- count[0] = _T('\0');
+ count[0] = '\0';
- TCHAR *txt = ParseText(template_group, t, _countof(t), v, _countof(v));
+ wchar_t *txt = ParseText(template_group, t, _countof(t), v, _countof(v));
if (txt != NULL)
mir_tstrncpy(text, txt, size);
mir_free(txt);
@@ -552,20 +552,20 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig)
case CLCIT_CONTACT:
{
- const TCHAR *t[] = {
+ const wchar_t *t[] = {
L"%name%",
L"%status%",
L"%protocol%",
L"%status_message%"
};
- const TCHAR *v[] = {
+ const wchar_t *v[] = {
item->szText,
GetStatusName(item),
GetProtoName(item),
GetStatusMessage(item)
};
- TCHAR *txt = ParseText(template_contact, t, _countof(t), v, _countof(v));
+ wchar_t *txt = ParseText(template_contact, t, _countof(t), v, _countof(v));
if (txt != NULL)
mir_tstrncpy(text, txt, size);
mir_free(txt);
@@ -585,8 +585,8 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig)
if (item->type == CLCIT_GROUP && item->group->expanded) {
group = item->group;
- text[0] = _T(' ');
- text[1] = _T(' ');
+ text[0] = ' ';
+ text[1] = ' ';
text += 2;
size -= 2;
group->scanIndex = 0;
diff --git a/plugins/Clist_modern/src/cluiframes.cpp b/plugins/Clist_modern/src/cluiframes.cpp
index 94b4ad3170..38d402c835 100644
--- a/plugins/Clist_modern/src/cluiframes.cpp
+++ b/plugins/Clist_modern/src/cluiframes.cpp
@@ -1504,7 +1504,7 @@ static int CLUIFramesLoadMainMenu()
mi.hIcolibItem = F.TitleBar.hicon;
mi.flags = CMIF_SYSTEM | CMIF_TCHAR;
mi.position = separator++;
- mi.name.t = F.TitleBar.tbname ? F.TitleBar.tbname : F.name;
+ mi.name.w = F.TitleBar.tbname ? F.TitleBar.tbname : F.name;
mi.pszService = 0;
g_frameMenus.insert(F.MenuHandles.MainMenuItem = Menu_AddMainMenuItem(&mi));
CLUIFramesCreateMenuForFrame(F.id, F.MenuHandles.MainMenuItem, separator, true);
@@ -1565,7 +1565,7 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM)
g_pfwFrames[g_nFramesCount].dwFlags = clfrm->Flags;
if (clfrm->name == NULL || ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->wname) : mir_strlen(clfrm->name)) == 0) {
- g_pfwFrames[g_nFramesCount].name = (LPTSTR)mir_alloc(255 * sizeof(TCHAR));
+ g_pfwFrames[g_nFramesCount].name = (LPTSTR)mir_alloc(255 * sizeof(wchar_t));
GetClassName(g_pfwFrames[g_nFramesCount].hWnd, g_pfwFrames[g_nFramesCount].name, 255);
}
else g_pfwFrames[g_nFramesCount].name = (clfrm->Flags & F_UNICODE) ? mir_u2t(clfrm->wname) : mir_a2t(clfrm->name);
@@ -2730,7 +2730,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam
int pos;
//tbinfo
{
- TCHAR TBcapt[255];
+ wchar_t TBcapt[255];
pos = id2pos(Frameid);
if (pos != -1) {
int oldflags;
diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp
index 60358a3851..9eb5a578f8 100644
--- a/plugins/Clist_modern/src/modern_aniavatars.cpp
+++ b/plugins/Clist_modern/src/modern_aniavatars.cpp
@@ -28,8 +28,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define IMMEDIATE_DRAW (!s_bSeparateWindow)
-void GDIPlus_ExtractAnimatedGIF(TCHAR *szName, int width, int height, HBITMAP &pBmp, int* &pframesDelay, int &pframesCount, SIZE &sizeAvatar);
-BOOL GDIPlus_IsAnimatedGif(TCHAR *szName);
+void GDIPlus_ExtractAnimatedGIF(wchar_t *szName, int width, int height, HBITMAP &pBmp, int* &pframesDelay, int &pframesCount, SIZE &sizeAvatar);
+BOOL GDIPlus_IsAnimatedGif(wchar_t *szName);
/* Next is module */
#define ANIAVAWINDOWCLASS L"MirandaModernAniAvatar"
@@ -43,7 +43,7 @@ BOOL GDIPlus_IsAnimatedGif(TCHAR *szName);
//messages
enum {
AAM_FIRST = WM_USER,
- AAM_SETAVATAR, //sync WPARAM: TCHAR * filename, LPARAM: SIZE * size, RESULT: actual size
+ AAM_SETAVATAR, //sync WPARAM: wchar_t * filename, LPARAM: SIZE * size, RESULT: actual size
AAM_SETPOSITION, //async LPARAM: pointer to set pos info - the handler will empty it, RESULT: 0
AAM_REDRAW, //async
AAM_STOP, //async stops animation, timer, hide window - prepeare for deleting
@@ -73,7 +73,7 @@ struct ANIAVA_OBJECT : public MZeroedObject
struct ANIAVA_INFO
{
DWORD dwAvatarUniqId;
- TCHAR *tcsFilename;
+ wchar_t *tcsFilename;
int nRefCount;
int nStripTop;
int nFrameCount;
@@ -229,11 +229,11 @@ static void CALLBACK _AniAva_SyncCallerUserAPCProc(DWORD_PTR dwParam)
static INT_PTR _AniAva_CreateAvatarWindowSync_Worker(WPARAM tszName, LPARAM)
{
HWND hwnd = CreateWindowEx(WS_EX_TOPMOST | WS_EX_TRANSPARENT | WS_EX_NOPARENTNOTIFY, ANIAVAWINDOWCLASS,
- (TCHAR*)tszName, WS_POPUP, 0, 0, 1, 1, pcli->hwndContactList, NULL, pcli->hInst, NULL);
+ (wchar_t*)tszName, WS_POPUP, 0, 0, 1, 1, pcli->hwndContactList, NULL, pcli->hInst, NULL);
return (INT_PTR)hwnd;
}
-static HWND _AniAva_CreateAvatarWindowSync(TCHAR *szFileName)
+static HWND _AniAva_CreateAvatarWindowSync(wchar_t *szFileName)
{
if (s_AnimationThreadHandle == 0 || s_AnimationThreadID == 0)
return NULL;
@@ -340,7 +340,7 @@ static void _AniAva_RealRemoveAvatar(DWORD UniqueID)
}
}
-static int _AniAva_LoadAvatarFromImage(TCHAR * szFileName, int width, int height, ANIAVATARIMAGEINFO *pRetAII)
+static int _AniAva_LoadAvatarFromImage(wchar_t * szFileName, int width, int height, ANIAVATARIMAGEINFO *pRetAII)
{
ANIAVA_INFO aai = { 0 };
aai.tcsFilename = szFileName;
@@ -774,7 +774,7 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
//=======================================================================================
// adds avatars to be displayed
-int AniAva_AddAvatar(MCONTACT hContact, TCHAR * szFilename, int width, int heigth)
+int AniAva_AddAvatar(MCONTACT hContact, wchar_t * szFilename, int width, int heigth)
{
aacheck 0;
if (!GDIPlus_IsAnimatedGif(szFilename))
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp
index 326722ab11..95e2a7f196 100644
--- a/plugins/Clist_modern/src/modern_cachefuncs.cpp
+++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp
@@ -36,7 +36,7 @@ typedef BOOL(*ExecuteOnAllContactsFuncPtr) (ClcContact *contact, BOOL subcontact
/////////////////////////////////////////////////////////////////////////////////////////
// Module static declarations
-static int CopySkipUnprintableChars(TCHAR *to, TCHAR * buf, DWORD size);
+static int CopySkipUnprintableChars(wchar_t *to, wchar_t * buf, DWORD size);
static BOOL ExecuteOnAllContacts(ClcData *dat, ExecuteOnAllContactsFuncPtr func, void *param);
static BOOL ExecuteOnAllContactsOfGroup(ClcGroup *group, ExecuteOnAllContactsFuncPtr func, void *param);
@@ -71,7 +71,7 @@ void Cache_GetText(ClcData *dat, ClcContact *contact)
}
}
-void CSmileyString::AddListeningToIcon(ClcData *dat, TCHAR *szText)
+void CSmileyString::AddListeningToIcon(ClcData *dat, wchar_t *szText)
{
iMaxSmileyHeight = 0;
DestroySmileyList();
@@ -170,7 +170,7 @@ void CSmileyString::DestroySmileyList()
/////////////////////////////////////////////////////////////////////////////////////////
// Parsing of text for smiley
//
-void CSmileyString::ReplaceSmileys(ClcData *dat, ClcCacheEntry *pdnce, TCHAR * szText, BOOL replace_smileys)
+void CSmileyString::ReplaceSmileys(ClcData *dat, ClcCacheEntry *pdnce, wchar_t * szText, BOOL replace_smileys)
{
int last_pos = 0;
iMaxSmileyHeight = 0;
@@ -270,7 +270,7 @@ void CSmileyString::ReplaceSmileys(ClcData *dat, ClcCacheEntry *pdnce, TCHAR * s
// Getting Status name
// returns -1 for XStatus, 1 for Status
//
-int GetStatusName(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus_has_priority)
+int GetStatusName(wchar_t *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus_has_priority)
{
BOOL noAwayMsg = FALSE;
BOOL noXstatus = FALSE;
@@ -293,7 +293,7 @@ int GetStatusName(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus
}
// Get Status name
- TCHAR *tmp = pcli->pfnGetStatusModeDescription(nStatus, 0);
+ wchar_t *tmp = pcli->pfnGetStatusModeDescription(nStatus, 0);
if (tmp && *tmp) {
mir_tstrncpy(text, tmp, text_size);
return 1;
@@ -317,9 +317,9 @@ int GetStatusName(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus
/////////////////////////////////////////////////////////////////////////////////////////
// Get Listening to information
//
-void GetListeningTo(TCHAR *text, int text_size, ClcCacheEntry *pdnce)
+void GetListeningTo(wchar_t *text, int text_size, ClcCacheEntry *pdnce)
{
- *text = _T('\0');
+ *text = '\0';
if (pdnce->m_iStatus == ID_STATUS_OFFLINE || pdnce->m_iStatus == 0)
return;
@@ -333,7 +333,7 @@ void GetListeningTo(TCHAR *text, int text_size, ClcCacheEntry *pdnce)
// Getting Status message(Away message)
// returns -1 for XStatus, 1 for Status
//
-int GetStatusMessage(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus_has_priority)
+int GetStatusMessage(wchar_t *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus_has_priority)
{
BOOL noAwayMsg = FALSE;
WORD wStatus = pdnce->getStatus();
@@ -393,7 +393,7 @@ LBL_Status:
// Try to get XStatusMsg
ptrT tszXStatusMsg(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "XStatusMsg"));
if (tszXStatusMsg != NULL && tszXStatusMsg[0] != 0) {
- TCHAR *tmp = NEWTSTR_ALLOCA(text);
+ wchar_t *tmp = NEWWSTR_ALLOCA(text);
mir_sntprintf(text, text_size, L"%s: %s", tmp, tszXStatusMsg);
CopySkipUnprintableChars(text, text, text_size - 1);
}
@@ -415,7 +415,7 @@ LBL_Status:
// Try to get XStatusName
ptrT tszXStatusName(db_get_tsa(pdnce->hContact, pdnce->m_pszProto, "XStatusName"));
if (tszXStatusName != NULL && tszXStatusName[0] != 0) {
- TCHAR *tmp = NEWTSTR_ALLOCA(text);
+ wchar_t *tmp = NEWWSTR_ALLOCA(text);
mir_sntprintf(text, text_size, L"%s: %s", tszXStatusName, tmp);
CopySkipUnprintableChars(text, text, text_size - 1);
}
@@ -474,11 +474,11 @@ void Cache_GetFirstLineText(ClcData *dat, ClcContact *contact)
return;
ClcCacheEntry *pdnce = contact->pce;
- TCHAR *name = pcli->pfnGetContactDisplayName(contact->hContact, 0);
+ wchar_t *name = pcli->pfnGetContactDisplayName(contact->hContact, 0);
if (dat->first_line_append_nick && !dat->bForceInDialog) {
DBVARIANT dbv = { 0 };
if (!db_get_ts(pdnce->hContact, pdnce->m_pszProto, "Nick", &dbv)) {
- TCHAR nick[_countof(contact->szText)];
+ wchar_t nick[_countof(contact->szText)];
mir_tstrncpy(nick, dbv.ptszVal, _countof(contact->szText));
db_free(&dbv);
@@ -501,9 +501,9 @@ void Cache_GetFirstLineText(ClcData *dat, ClcContact *contact)
void Cache_GetNthLineText(ClcData *dat, ClcCacheEntry *pdnce, int n)
{
- TCHAR Text[240 - EXTRA_ICON_COUNT]; Text[0] = 0;
+ wchar_t Text[240 - EXTRA_ICON_COUNT]; Text[0] = 0;
ClcLineInfo &line = (n == 2) ? dat->secondLine : dat->thirdLine;
- TCHAR* &szText = (n == 2) ? pdnce->szSecondLineText : pdnce->szThirdLineText;
+ wchar_t* &szText = (n == 2) ? pdnce->szSecondLineText : pdnce->szThirdLineText;
// in most cases replaceStrT does nothing
if (!line.show) {
@@ -521,7 +521,7 @@ void Cache_GetNthLineText(ClcData *dat, ClcCacheEntry *pdnce, int n)
replaceStrT(szText, Text);
CSmileyString &ss = (n == 2) ? pdnce->ssSecondLine : pdnce->ssThirdLine;
- if (type == TEXT_LISTENING_TO && szText[0] != _T('\0'))
+ if (type == TEXT_LISTENING_TO && szText[0] != '\0')
ss.AddListeningToIcon(dat, szText);
else
ss.ReplaceSmileys(dat, pdnce, szText, line.draw_smileys);
@@ -529,25 +529,25 @@ void Cache_GetNthLineText(ClcData *dat, ClcCacheEntry *pdnce, int n)
/////////////////////////////////////////////////////////////////////////////////////////
-void RemoveTag(TCHAR *to, TCHAR *tag)
+void RemoveTag(wchar_t *to, wchar_t *tag)
{
- TCHAR *st = to;
+ wchar_t *st = to;
int len = (int)mir_tstrlen(tag);
int lastsize = (int)mir_tstrlen(to) + 1;
- while (st = _tcsstr(st, tag)) {
+ while (st = wcsstr(st, tag)) {
lastsize -= len;
- memmove((void*)st, (void*)(st + len), (lastsize)*sizeof(TCHAR));
+ memmove((void*)st, (void*)(st + len), (lastsize)*sizeof(wchar_t));
}
}
/////////////////////////////////////////////////////////////////////////////////////////
// Copy string with removing Escape chars from text and BBcodes
-static int CopySkipUnprintableChars(TCHAR *to, TCHAR * buf, DWORD size)
+static int CopySkipUnprintableChars(wchar_t *to, wchar_t * buf, DWORD size)
{
DWORD i;
BOOL keep = 0;
- TCHAR * cp = to;
+ wchar_t * cp = to;
if (!to) return 0;
if (!buf) {
to[0] = '\0';
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index ebc88e2976..91d9be08c1 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -44,7 +44,7 @@ static int StartScrollPos = 0;
static BOOL g_bSortTimerIsSet = FALSE;
static ClcContact *hitcontact = NULL;
HANDLE hSkinFolder;
-TCHAR SkinsFolder[MAX_PATH];
+wchar_t SkinsFolder[MAX_PATH];
int ReloadSkinFolder(WPARAM, LPARAM)
{
@@ -202,7 +202,7 @@ static int clcProceedDragToScroll(HWND hwnd, int Y)
return 1;
}
-static int clcSearchNextContact(HWND hwnd, ClcData *dat, int index, const TCHAR *text, int prefixOk, BOOL fSearchUp)
+static int clcSearchNextContact(HWND hwnd, ClcData *dat, int index, const wchar_t *text, int prefixOk, BOOL fSearchUp)
{
ClcGroup *group = &dat->list;
int testlen = (int)mir_tstrlen(text);
@@ -225,9 +225,9 @@ static int clcSearchNextContact(HWND hwnd, ClcData *dat, int index, const TCHAR
found = true;
}
else if (dat->bFilterSearch) {
- TCHAR *lowered_szText = CharLowerW(NEWTSTR_ALLOCA(cc->szText));
- TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch));
- found = _tcsstr(lowered_szText, lowered_search) != NULL;
+ wchar_t *lowered_szText = CharLowerW(NEWWSTR_ALLOCA(cc->szText));
+ wchar_t *lowered_search = CharLowerW(NEWWSTR_ALLOCA(dat->szQuickSearch));
+ found = wcsstr(lowered_szText, lowered_search) != NULL;
}
else found = ((prefixOk && CSTR_EQUAL == CompareString(LOCALE_INVARIANT, NORM_IGNORECASE, text, -1, cc->szText, testlen)) || (!prefixOk && !mir_tstrcmpi(text, cc->szText)));
@@ -1065,7 +1065,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
if (dat->dragStage == (DRAGSTAGE_NOTMOVED | DRAGSTAGEF_MAYBERENAME))
CLUI_SafeSetTimer(hwnd, TIMERID_RENAME, GetDoubleClickTime(), NULL);
else if ((dat->dragStage & DRAGSTAGEM_STAGE) == DRAGSTAGE_ACTIVE) {
- TCHAR Wording[500];
+ wchar_t Wording[500];
ClcContact *contDest, *contSour;
POINT pt = UNPACK_POINT(lParam);
int target = GetDropTargetInformation(hwnd, dat, pt);
@@ -1198,13 +1198,13 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
ClcGroup *group, *destgroup;
{
BOOL NeedRename = FALSE;
- TCHAR newName[128] = { 0 };
+ wchar_t newName[128] = { 0 };
pcli->pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
int i = pcli->pfnGetRowByIndex(dat, dat->iInsertionMark, &destcontact, &destgroup);
if (i != -1 && group->groupId != destgroup->groupId) {
- TCHAR *groupName = mir_tstrdup(Clist_GroupGetName(contact->groupId, 0));
- TCHAR *shortGroup = NULL;
- TCHAR *sourceGrName = mir_tstrdup(Clist_GroupGetName(destgroup->groupId, 0));
+ wchar_t *groupName = mir_tstrdup(Clist_GroupGetName(contact->groupId, 0));
+ wchar_t *shortGroup = NULL;
+ wchar_t *sourceGrName = mir_tstrdup(Clist_GroupGetName(destgroup->groupId, 0));
if (groupName) {
int len = (int)mir_tstrlen(groupName);
do { len--; } while (len >= 0 && groupName[len] != '\\');
@@ -1562,11 +1562,11 @@ static int clcHookModulesLoaded(WPARAM, LPARAM)
FoldersGetCustomPathT(hSkinFolder, SkinsFolder, _countof(SkinsFolder), _T(DEFAULT_SKIN_FOLDER));
// Get icons
- TCHAR szMyPath[MAX_PATH];
+ wchar_t szMyPath[MAX_PATH];
GetModuleFileName(g_hInst, szMyPath, _countof(szMyPath));
SKINICONDESC sid = { 0 };
- sid.defaultFile.t = szMyPath;
+ sid.defaultFile.w = szMyPath;
sid.flags = SIDF_PATH_TCHAR;
sid.section.a = LPGEN("Contact list");
@@ -1666,7 +1666,7 @@ int ClcDoProtoAck(ACKDATA *ack)
if (db_get_b(ack->hContact, ack->szModule, "ChatRoom", 0) != 0)
return 0;
- db_set_ws(ack->hContact, "CList", "StatusMsg", (const TCHAR *)ack->lParam);
+ db_set_ws(ack->hContact, "CList", "StatusMsg", (const wchar_t *)ack->lParam);
Clist_Broadcast(INTM_STATUSCHANGED, ack->hContact, 0);
}
else {
diff --git a/plugins/Clist_modern/src/modern_clc.h b/plugins/Clist_modern/src/modern_clc.h
index a895e46231..64fd85c7e2 100644
--- a/plugins/Clist_modern/src/modern_clc.h
+++ b/plugins/Clist_modern/src/modern_clc.h
@@ -220,7 +220,7 @@ struct ClcLineInfo
int top_space;
BOOL draw_smileys;
int type;
- TCHAR text[TEXT_TEXT_MAX_LENGTH];
+ wchar_t text[TEXT_TEXT_MAX_LENGTH];
BOOL xstatus_has_priority;
BOOL show_status_if_no_away;
BOOL show_listening_if_no_away;
@@ -374,10 +374,10 @@ DWORD GetDefaultExStyle(void);
void GetFontSetting(int i, LOGFONT *lf, COLORREF *colour, BYTE *effect, COLORREF *eColour1, COLORREF *eColour2);
// clistsettings.c
-TCHAR* GetContactDisplayNameW(MCONTACT hContact, int mode);
+wchar_t* GetContactDisplayNameW(MCONTACT hContact, int mode);
// groups.c
-TCHAR* GetGroupNameTS(int idx, DWORD* pdwFlags);
+wchar_t* GetGroupNameTS(int idx, DWORD* pdwFlags);
int RenameGroupT(WPARAM groupID, LPARAM newName);
int GetContactCachedStatus(MCONTACT hContact);
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index 03259dd5a0..e2a5cb896f 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -406,9 +406,9 @@ int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, ClcData *dat)
if (dat != NULL && dat->bFilterSearch && pdnce && pdnce->tszName) {
// search filtering
- TCHAR *lowered_name = CharLowerW(NEWTSTR_ALLOCA(pdnce->tszName));
- TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch));
- searchResult = _tcsstr(lowered_name, lowered_search) ? 0 : 1;
+ wchar_t *lowered_name = CharLowerW(NEWWSTR_ALLOCA(pdnce->tszName));
+ wchar_t *lowered_search = CharLowerW(NEWWSTR_ALLOCA(dat->szQuickSearch));
+ searchResult = wcsstr(lowered_name, lowered_search) ? 0 : 1;
}
if (pdnce && g_CluiData.bFilterEffective && dat != NULL && !dat->bForceInDialog) {
@@ -435,9 +435,9 @@ int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, ClcData *dat)
if (g_CluiData.bFilterEffective & CLVM_FILTER_GROUPS) {
ptrT tszGroup(db_get_tsa(hContact, "CList", "Group"));
if (tszGroup != NULL) {
- TCHAR szGroupMask[256];
+ wchar_t szGroupMask[256];
mir_sntprintf(szGroupMask, L"%s|", tszGroup);
- filterResult = (g_CluiData.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0));
+ filterResult = (g_CluiData.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (wcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (wcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0));
}
else if (g_CluiData.filterFlags & CLVM_INCLUDED_UNGROUPED)
filterResult = (g_CluiData.filterFlags & CLVM_PROTOGROUP_OP) ? filterResult : filterResult & 1;
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp
index 5c98b322f1..605112c0fc 100644
--- a/plugins/Clist_modern/src/modern_clcopts.cpp
+++ b/plugins/Clist_modern/src/modern_clcopts.cpp
@@ -38,24 +38,24 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
struct FontOptionsList {
DWORD dwFlags;
int fontID;
- TCHAR *szGroup;
- TCHAR *szDescr;
+ wchar_t *szGroup;
+ wchar_t *szDescr;
COLORREF defColour;
- TCHAR *szDefFace;
+ wchar_t *szDefFace;
BYTE defCharset, defStyle;
char defSize;
FONTEFFECT defeffect;
COLORREF colour;
- TCHAR szFace[LF_FACESIZE];
+ wchar_t szFace[LF_FACESIZE];
BYTE charset, style;
char size;
};
-#define CLCGROUP LPGENT("Contact list") L"/" LPGENT("Contact names")
-#define CLCLINESGROUP LPGENT("Contact list") L"/" LPGENT("Row items")
-#define CLCFRAMESGROUP LPGENT("Contact list") L"/" LPGENT("Frame texts")
-#define CLCCOLOURSGROUP LPGENT("Contact list") L"/" LPGENT("Special colors")
+#define CLCGROUP LPGENW("Contact list") L"/" LPGENW("Contact names")
+#define CLCLINESGROUP LPGENW("Contact list") L"/" LPGENW("Row items")
+#define CLCFRAMESGROUP LPGENW("Contact list") L"/" LPGENW("Frame texts")
+#define CLCCOLOURSGROUP LPGENW("Contact list") L"/" LPGENW("Special colors")
#define DEFAULT_COLOUR RGB(0, 0, 0)
#define DEFAULT_GREYCOLOUR RGB(128, 128, 128)
@@ -68,53 +68,53 @@ struct FontOptionsList {
#define DEFAULT_SMALLSIZE -8
static struct FontOptionsList fontOptionsList[] = {
- { FIDF_CLASSGENERAL, FONTID_CONTACTS, CLCGROUP, LPGENT("Standard contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_AWAY, CLCGROUP, LPGENT("Away contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_DND, CLCGROUP, LPGENT("Do not disturb contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_NA, CLCGROUP, LPGENT("Not available contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_OCCUPIED, CLCGROUP, LPGENT("Occupied contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_CHAT, CLCGROUP, LPGENT("Free for chat contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_INVISIBLE, CLCGROUP, LPGENT("Invisible contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_PHONE, CLCGROUP, LPGENT("On the phone contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_LUNCH, CLCGROUP, LPGENT("Out to lunch contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_OFFLINE, CLCGROUP, LPGENT("Offline contacts"), DEFAULT_GREYCOLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_INVIS, CLCGROUP, LPGENT("Online contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_OFFINVIS, CLCGROUP, LPGENT("Offline contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_NOTONLIST, CLCGROUP, LPGENT("Contacts who are 'not on list'"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSHEADER, FONTID_OPENGROUPS, CLCGROUP, LPGENT("Open groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSHEADER, FONTID_OPENGROUPCOUNTS, CLCGROUP, LPGENT("Open group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPS, CLCGROUP, LPGENT("Closed groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPCOUNTS, CLCGROUP, LPGENT("Closed group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSSMALL, FONTID_DIVIDERS, CLCGROUP, LPGENT("Dividers"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
-
- { FIDF_CLASSSMALL, FONTID_SECONDLINE, CLCLINESGROUP, LPGENT("Second line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
- { FIDF_CLASSSMALL, FONTID_THIRDLINE, CLCLINESGROUP, LPGENT("Third line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
- { FIDF_CLASSSMALL, FONTID_CONTACT_TIME, CLCLINESGROUP, LPGENT("Contact time"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
-
- { FIDF_CLASSGENERAL, FONTID_STATUSBAR_PROTONAME, CLCFRAMESGROUP, LPGENT("Status bar text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_EVENTAREA, CLCFRAMESGROUP, LPGENT("Event area text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_VIEMODES, CLCFRAMESGROUP, LPGENT("Current view mode text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_CONTACTS, CLCGROUP, LPGENW("Standard contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_AWAY, CLCGROUP, LPGENW("Away contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_DND, CLCGROUP, LPGENW("Do not disturb contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_NA, CLCGROUP, LPGENW("Not available contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_OCCUPIED, CLCGROUP, LPGENW("Occupied contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_CHAT, CLCGROUP, LPGENW("Free for chat contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_INVISIBLE, CLCGROUP, LPGENW("Invisible contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_PHONE, CLCGROUP, LPGENW("On the phone contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_LUNCH, CLCGROUP, LPGENW("Out to lunch contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_OFFLINE, CLCGROUP, LPGENW("Offline contacts"), DEFAULT_GREYCOLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_INVIS, CLCGROUP, LPGENW("Online contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_OFFINVIS, CLCGROUP, LPGENW("Offline contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_NOTONLIST, CLCGROUP, LPGENW("Contacts who are 'not on list'"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSHEADER, FONTID_OPENGROUPS, CLCGROUP, LPGENW("Open groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSHEADER, FONTID_OPENGROUPCOUNTS, CLCGROUP, LPGENW("Open group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPS, CLCGROUP, LPGENW("Closed groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPCOUNTS, CLCGROUP, LPGENW("Closed group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSSMALL, FONTID_DIVIDERS, CLCGROUP, LPGENW("Dividers"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+
+ { FIDF_CLASSSMALL, FONTID_SECONDLINE, CLCLINESGROUP, LPGENW("Second line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSSMALL, FONTID_THIRDLINE, CLCLINESGROUP, LPGENW("Third line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSSMALL, FONTID_CONTACT_TIME, CLCLINESGROUP, LPGENW("Contact time"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
+
+ { FIDF_CLASSGENERAL, FONTID_STATUSBAR_PROTONAME, CLCFRAMESGROUP, LPGENW("Status bar text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_EVENTAREA, CLCFRAMESGROUP, LPGENW("Event area text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_VIEMODES, CLCFRAMESGROUP, LPGENW("Current view mode text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
};
struct ColourOptionsList {
char *chGroup;
char *chName;
- TCHAR *szGroup;
- TCHAR *szDescr;
+ wchar_t *szGroup;
+ wchar_t *szDescr;
COLORREF defColour;
};
static struct ColourOptionsList colourOptionsList[] = {
- { "CLC", "BkColour", CLCGROUP, LPGENT("Background"), CLCDEFAULT_BKCOLOUR },
+ { "CLC", "BkColour", CLCGROUP, LPGENW("Background"), CLCDEFAULT_BKCOLOUR },
- { "CLC", "HotTextColour", CLCCOLOURSGROUP, LPGENT("Hot text"), CLCDEFAULT_MODERN_HOTTEXTCOLOUR },
- { "CLC", "SelTextColour", CLCCOLOURSGROUP, LPGENT("Selected text"), CLCDEFAULT_MODERN_SELTEXTCOLOUR },
- { "CLC", "QuickSearchColour", CLCCOLOURSGROUP, LPGENT("Quick search text"), CLCDEFAULT_MODERN_QUICKSEARCHCOLOUR },
+ { "CLC", "HotTextColour", CLCCOLOURSGROUP, LPGENW("Hot text"), CLCDEFAULT_MODERN_HOTTEXTCOLOUR },
+ { "CLC", "SelTextColour", CLCCOLOURSGROUP, LPGENW("Selected text"), CLCDEFAULT_MODERN_SELTEXTCOLOUR },
+ { "CLC", "QuickSearchColour", CLCCOLOURSGROUP, LPGENW("Quick search text"), CLCDEFAULT_MODERN_QUICKSEARCHCOLOUR },
- { "Menu", "TextColour", CLCCOLOURSGROUP, LPGENT("Menu text"), CLCDEFAULT_TEXTCOLOUR },
- { "Menu", "SelTextColour", CLCCOLOURSGROUP, LPGENT("Selected menu text"), CLCDEFAULT_MODERN_SELTEXTCOLOUR },
- { "FrameTitleBar", "TextColour", CLCCOLOURSGROUP, LPGENT("Frame title text"), CLCDEFAULT_TEXTCOLOUR },
- { "ModernSettings", "KeyColor", CLCCOLOURSGROUP, LPGENT("3rd party frames transparent back color"), SETTING_KEYCOLOR_DEFAULT }
+ { "Menu", "TextColour", CLCCOLOURSGROUP, LPGENW("Menu text"), CLCDEFAULT_TEXTCOLOUR },
+ { "Menu", "SelTextColour", CLCCOLOURSGROUP, LPGENW("Selected menu text"), CLCDEFAULT_MODERN_SELTEXTCOLOUR },
+ { "FrameTitleBar", "TextColour", CLCCOLOURSGROUP, LPGENW("Frame title text"), CLCDEFAULT_TEXTCOLOUR },
+ { "ModernSettings", "KeyColor", CLCCOLOURSGROUP, LPGENW("3rd party frames transparent back color"), SETTING_KEYCOLOR_DEFAULT }
};
void RegisterCLUIFonts(void)
@@ -246,34 +246,34 @@ static const struct CheckBoxToStyleEx_t checkBoxToStyleEx[] = {
struct CheckBoxValues_t {
DWORD style;
- TCHAR *szDescr;
+ wchar_t *szDescr;
};
static const struct CheckBoxValues_t greyoutValues[] = {
- { GREYF_UNFOCUS, LPGENT("Not focused") },
- { MODEF_OFFLINE, LPGENT("Offline") },
- { PF2_ONLINE, LPGENT("Online") },
- { PF2_SHORTAWAY, LPGENT("Away") },
- { PF2_LONGAWAY, LPGENT("Not available") },
- { PF2_LIGHTDND, LPGENT("Occupied") },
- { PF2_HEAVYDND, LPGENT("Do not disturb") },
- { PF2_FREECHAT, LPGENT("Free for chat") },
- { PF2_INVISIBLE, LPGENT("Invisible") },
- { PF2_OUTTOLUNCH, LPGENT("Out to lunch") },
- { PF2_ONTHEPHONE, LPGENT("On the phone") }
+ { GREYF_UNFOCUS, LPGENW("Not focused") },
+ { MODEF_OFFLINE, LPGENW("Offline") },
+ { PF2_ONLINE, LPGENW("Online") },
+ { PF2_SHORTAWAY, LPGENW("Away") },
+ { PF2_LONGAWAY, LPGENW("Not available") },
+ { PF2_LIGHTDND, LPGENW("Occupied") },
+ { PF2_HEAVYDND, LPGENW("Do not disturb") },
+ { PF2_FREECHAT, LPGENW("Free for chat") },
+ { PF2_INVISIBLE, LPGENW("Invisible") },
+ { PF2_OUTTOLUNCH, LPGENW("Out to lunch") },
+ { PF2_ONTHEPHONE, LPGENW("On the phone") }
};
static const struct CheckBoxValues_t offlineValues[] = {
- { MODEF_OFFLINE, LPGENT("Offline") },
- { PF2_ONLINE, LPGENT("Online") },
- { PF2_SHORTAWAY, LPGENT("Away") },
- { PF2_LONGAWAY, LPGENT("Not available") },
- { PF2_LIGHTDND, LPGENT("Occupied") },
- { PF2_HEAVYDND, LPGENT("Do not disturb") },
- { PF2_FREECHAT, LPGENT("Free for chat") },
- { PF2_INVISIBLE, LPGENT("Invisible") },
- { PF2_OUTTOLUNCH, LPGENT("Out to lunch") },
- { PF2_ONTHEPHONE, LPGENT("On the phone") }
+ { MODEF_OFFLINE, LPGENW("Offline") },
+ { PF2_ONLINE, LPGENW("Online") },
+ { PF2_SHORTAWAY, LPGENW("Away") },
+ { PF2_LONGAWAY, LPGENW("Not available") },
+ { PF2_LIGHTDND, LPGENW("Occupied") },
+ { PF2_HEAVYDND, LPGENW("Do not disturb") },
+ { PF2_FREECHAT, LPGENW("Free for chat") },
+ { PF2_INVISIBLE, LPGENW("Invisible") },
+ { PF2_OUTTOLUNCH, LPGENW("Out to lunch") },
+ { PF2_ONTHEPHONE, LPGENW("On the phone") }
};
static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *values, int nValues, DWORD style)
@@ -486,7 +486,7 @@ static int _GetNetVisibleProtoCount()
return netProtoCount;
}
-TCHAR *sortby[] = { LPGENT("Name"), LPGENT("Name (use locale settings)"), LPGENT("Status"), LPGENT("Last message time"), LPGENT("Account name"), LPGENT("Rate"), LPGENT("-Nothing-") };
+wchar_t *sortby[] = { LPGENW("Name"), LPGENW("Name (use locale settings)"), LPGENW("Status"), LPGENW("Last message time"), LPGENW("Account name"), LPGENW("Rate"), LPGENW("-Nothing-") };
int sortbyValue[] = { SORTBY_NAME, SORTBY_NAME_LOCALE, SORTBY_STATUS, SORTBY_LASTMSG, SORTBY_PROTO, SORTBY_RATE, SORTBY_NOTHING };
static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
@@ -803,7 +803,7 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM
EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC01), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
{
- TCHAR *hidemode[] = { TranslateT("Hide to tray"), TranslateT("Behind left edge"), TranslateT("Behind right edge") };
+ wchar_t *hidemode[] = { TranslateT("Hide to tray"), TranslateT("Behind left edge"), TranslateT("Behind right edge") };
for (int i = 0; i < _countof(hidemode); i++) {
int item = SendDlgItemMessage(hwndDlg, IDC_HIDEMETHOD, CB_ADDSTRING, 0, (LPARAM)hidemode[i]);
SendDlgItemMessage(hwndDlg, IDC_HIDEMETHOD, CB_SETITEMDATA, item, 0);
@@ -1002,7 +1002,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
{
DBVARIANT dbv = { 0 };
- TCHAR *s;
+ wchar_t *s;
if (!db_get_ts(NULL, "CList", "TitleText", &dbv))
s = dbv.ptszVal;
else
@@ -1148,7 +1148,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
db_set_b(NULL, "CList", "ThinBorder", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BORDER));
db_set_b(NULL, "CList", "NoBorder", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOBORDERWND));
{
- TCHAR title[256];
+ wchar_t title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
db_set_ws(NULL, "CList", "TitleText", title);
}
@@ -1368,7 +1368,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
case WM_COMMAND:
if (LOWORD(wParam) == IDC_BROWSE) {
- TCHAR str[MAX_PATH], filter[512];
+ wchar_t str[MAX_PATH], filter[512];
Bitmap_GetFilter(filter, _countof(filter));
GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str));
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp
index deebf09991..e03c992085 100644
--- a/plugins/Clist_modern/src/modern_clcpaint.cpp
+++ b/plugins/Clist_modern/src/modern_clcpaint.cpp
@@ -184,7 +184,7 @@ int CLCPaint::GetBasicFontID(ClcContact *contact)
}
}
-void CLCPaint::GetTextSize(SIZE *text_size, HDC hdcMem, RECT free_row_rc, TCHAR *szText, SortedList *plText, UINT uTextFormat, int smiley_height)
+void CLCPaint::GetTextSize(SIZE *text_size, HDC hdcMem, RECT free_row_rc, wchar_t *szText, SortedList *plText, UINT uTextFormat, int smiley_height)
{
if (szText == NULL || !szText[0]) {
text_size->cy = 0;
@@ -398,7 +398,7 @@ RECT CLCPaint::_GetRectangle(ClcData *dat, RECT *row_rc, RECT *free_row_rc, int
-void CLCPaint::_DrawTextSmiley(HDC hdcMem, RECT *free_rc, SIZE * text_size, TCHAR *szText, int start, int len, SortedList *plText, UINT uTextFormat, BOOL ResizeSizeSmiley)
+void CLCPaint::_DrawTextSmiley(HDC hdcMem, RECT *free_rc, SIZE * text_size, wchar_t *szText, int start, int len, SortedList *plText, UINT uTextFormat, BOOL ResizeSizeSmiley)
{
if (szText == NULL)
return;
@@ -614,19 +614,19 @@ MODERNMASK* CLCPaint::_GetCLCContactRowBackModernMask(ClcGroup *group, ClcContac
_itoa(index, buf, BUF2SIZE);
AddParam(mpModernMask, HASH[hi_Index], buf, 0);
{
- TCHAR *b2 = NEWTSTR_ALLOCA(Drawing->szText);
+ wchar_t *b2 = NEWWSTR_ALLOCA(Drawing->szText);
for (int i = 0; b2[i] != 0; i++)
- if (b2[i] == _T(','))
- b2[i] = _T('.');
+ if (b2[i] == ',')
+ b2[i] = '.';
AddParam(mpModernMask, HASH[hi_Name], T2Utf(b2), 0);
}
if (group->parent) {
- TCHAR *b2 = NEWTSTR_ALLOCA(group->parent->cl[0]->szText);
+ wchar_t *b2 = NEWWSTR_ALLOCA(group->parent->cl[0]->szText);
for (int i = 0; b2[i] != 0; i++)
- if (b2[i] == _T(','))
- b2[i] = _T('.');
+ if (b2[i] == ',')
+ b2[i] = '.';
AddParam(mpModernMask, HASH[hi_Group], T2Utf(b2), 0);
}
@@ -763,7 +763,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R
// 3 draw text
{
SIZE text_size = { 0 };
- TCHAR *szCounts = NULL;
+ wchar_t *szCounts = NULL;
RECT text_rect = fr_rc;
RECT counts_rc = { 0 };
UINT uTextFormat = DT_LEFT | DT_VCENTER | (gl_TrimText ? DT_END_ELLIPSIS : 0) | DT_SINGLELINE;
@@ -903,9 +903,9 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R
if (((dat->bFilterSearch && Drawing->type != CLCIT_GROUP) || selected) && dat->szQuickSearch[0] != '\0') {
int idx = 0;
if (dat->bFilterSearch) {
- TCHAR *lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
- TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch));
- TCHAR *p1 = _tcsstr(lowered, lowered_search);
+ wchar_t *lowered = CharLowerW(NEWWSTR_ALLOCA(Drawing->szText));
+ wchar_t *lowered_search = CharLowerW(NEWWSTR_ALLOCA(dat->szQuickSearch));
+ wchar_t *p1 = wcsstr(lowered, lowered_search);
if (p1)
idx = int(p1 - lowered);
}
@@ -981,9 +981,9 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R
if ((dat->bFilterSearch || selected) && dat->szQuickSearch[0] != '\0') {
int idx = 0;
if (dat->bFilterSearch) {
- TCHAR *lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
- TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch));
- TCHAR *p1 = _tcsstr(lowered, lowered_search);
+ wchar_t *lowered = CharLowerW(NEWWSTR_ALLOCA(Drawing->szText));
+ wchar_t *lowered_search = CharLowerW(NEWWSTR_ALLOCA(dat->szQuickSearch));
+ wchar_t *p1 = wcsstr(lowered, lowered_search);
if (p1)
idx = int(p1 - lowered);
}
@@ -1002,7 +1002,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R
RECT count_rc = { 0 };
SIZE count_size = { 0 };
int space_width = 0;
- TCHAR *szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
+ wchar_t *szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
// Has to draw the count?
if (szCounts && mir_tstrlen(szCounts) > 0) {
// calc width and height
@@ -1080,7 +1080,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R
if (dat->secondLine.show && dat->secondLine.type == TEXT_CONTACT_TIME && pdnce->hTimeZone) {
// Get contact time
- TCHAR buf[70] = L"";
+ wchar_t buf[70] = L"";
mir_free_and_nil(pdnce->szSecondLineText);
TimeZone_PrintDateTime(pdnce->hTimeZone, L"t", buf, _countof(buf), 0);
@@ -1108,7 +1108,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R
if (dat->thirdLine.show && dat->thirdLine.type == TEXT_CONTACT_TIME && pdnce->hTimeZone) {
// Get contact time
- TCHAR buf[70] = L"";
+ wchar_t buf[70] = L"";
mir_free(pdnce->szThirdLineText);
TimeZone_PrintDateTime(pdnce->hTimeZone, L"t", buf, _countof(buf), 0);
@@ -1391,7 +1391,7 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R
break;
case TC_TIME:
- TCHAR szResult[80];
+ wchar_t szResult[80];
if (!TimeZone_PrintDateTime(pdnce->hTimeZone, L"t", szResult, _countof(szResult), 0)) {
// Select font
ChangeToFont(hdcMem, dat, FONTID_CONTACT_TIME, NULL);
@@ -2103,7 +2103,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT
case ITEM_CONTACT_TIME: /////////////////////////////////////////////////////////////////////////////////////////////////////
if (Drawing->type == CLCIT_CONTACT && dat->contact_time_show && pdnce->hTimeZone) {
- TCHAR szResult[80];
+ wchar_t szResult[80];
if (!TimeZone_PrintDateTime(pdnce->hTimeZone, L"t", szResult, _countof(szResult), 0)) {
// Select font
@@ -2198,7 +2198,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT
if (Drawing->type == CLCIT_GROUP) {
int full_text_width = text_size.cx;
// Has to draw the count?
- TCHAR *szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
+ wchar_t *szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
if (szCounts && szCounts[0]) {
RECT space_rc = free_row_rc;
RECT counts_rc = free_row_rc;
@@ -2265,7 +2265,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT
if (dat->secondLine.show) {
if (dat->secondLine.type == TEXT_CONTACT_TIME && pdnce->hTimeZone) {
// Get contact time
- TCHAR buf[70] = L"";
+ wchar_t buf[70] = L"";
TimeZone_PrintDateTime(pdnce->hTimeZone, L"t", buf, _countof(buf), 0);
replaceStrT(pdnce->szSecondLineText, buf);
}
@@ -2298,7 +2298,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT
if (dat->thirdLine.show) {
if (dat->thirdLine.type == TEXT_CONTACT_TIME && pdnce->hTimeZone) {
// Get contact time
- TCHAR buf[70] = L"";
+ wchar_t buf[70] = L"";
TimeZone_PrintDateTime(pdnce->hTimeZone, L"t", buf, _countof(buf), 0);
replaceStrT(pdnce->szThirdLineText, buf);
}
@@ -2665,9 +2665,9 @@ void CLCPaint::_DrawContactText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, i
if ((dat->bFilterSearch || selected) && dat->szQuickSearch[0] != '\0') {
int idx = 0;
if (dat->bFilterSearch) {
- TCHAR *lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
- TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch));
- TCHAR *p1 = _tcsstr(lowered, lowered_search);
+ wchar_t *lowered = CharLowerW(NEWWSTR_ALLOCA(Drawing->szText));
+ wchar_t *lowered_search = CharLowerW(NEWWSTR_ALLOCA(dat->szQuickSearch));
+ wchar_t *p1 = wcsstr(lowered, lowered_search);
if (p1)
idx = int(p1 - lowered);
}
@@ -2684,7 +2684,7 @@ void CLCPaint::_DrawContactText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, i
void CLCPaint::_DrawContactSubText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem, UINT uTextFormat, BYTE itemType)
{
if (Drawing->type == CLCIT_GROUP) {
- TCHAR *szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
+ wchar_t *szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
// Has to draw the count?
if (szCounts && szCounts[0]) {
@@ -2718,7 +2718,7 @@ void CLCPaint::_DrawContactSubText(HDC hdcMem, ClcData *dat, ClcContact *Drawing
void CLCPaint::_DrawContactTime(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *prcItem)
{
- TCHAR szResult[80];
+ wchar_t szResult[80];
ClcCacheEntry *pdnce = Drawing->pce;
if (!pdnce)
return;
diff --git a/plugins/Clist_modern/src/modern_clcpaint.h b/plugins/Clist_modern/src/modern_clcpaint.h
index 406bc51137..5a3d53adb0 100644
--- a/plugins/Clist_modern/src/modern_clcpaint.h
+++ b/plugins/Clist_modern/src/modern_clcpaint.h
@@ -15,7 +15,7 @@ public:
BOOL IsForegroundWindow(HWND hWnd);
HFONT ChangeToFont(HDC hdc, ClcData *dat, int id, int *fontHeight);
int GetBasicFontID(ClcContact *contact);
- void GetTextSize(SIZE *text_size, HDC hdcMem, RECT free_row_rc, TCHAR *szText, SortedList *plText, UINT uTextFormat, int smiley_height);
+ void GetTextSize(SIZE *text_size, HDC hdcMem, RECT free_row_rc, wchar_t *szText, SortedList *plText, UINT uTextFormat, int smiley_height);
void AddParam(MODERNMASK *mpModernMask, DWORD dwParamHash, const char* szValue, DWORD dwValueHash);
BOOL CheckMiniMode(ClcData *dat, BOOL selected);
@@ -101,7 +101,7 @@ private:
int _GetGeneralisedStatus();
int _GetRealStatus(ClcContact *pContact, int nStatus);
RECT _GetRectangle(ClcData *dat, RECT *row_rc, RECT *free_row_rc, int *left_pos, int *right_pos, BOOL left, int real_width, int width, int height, int horizontal_space);
- void _DrawTextSmiley(HDC hdcMem, RECT *free_rc, SIZE * text_size, TCHAR *szText, int start, int len, SortedList *plText, UINT uTextFormat, BOOL ResizeSizeSmiley);
+ void _DrawTextSmiley(HDC hdcMem, RECT *free_rc, SIZE * text_size, wchar_t *szText, int start, int len, SortedList *plText, UINT uTextFormat, BOOL ResizeSizeSmiley);
void _AddParameter(MODERNMASK *mpModernMask, MASKPARAM * lpParam);
void _AddParamShort(MODERNMASK *mpModernMask, DWORD dwParamIndex, DWORD dwValueIndex);
void _FillParam(MASKPARAM * lpParam, DWORD dwParamHash, const char* szValue, DWORD dwValueHash);
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp
index d65e2f32bc..c20e9740e8 100644
--- a/plugins/Clist_modern/src/modern_clcutils.cpp
+++ b/plugins/Clist_modern/src/modern_clcutils.cpp
@@ -564,7 +564,7 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst)
if (tszLineText)
mir_tstrncpy(dat->secondLine.text, tszLineText, _countof(dat->secondLine.text));
else
- dat->secondLine.text[0] = _T('\0');
+ dat->secondLine.text[0] = '\0';
dat->secondLine.xstatus_has_priority = db_get_b(NULL, "CList", "SecondLineXStatusHasPriority", SETTING_SECONDLINE_XSTATUS_DEFAULT);
dat->secondLine.show_status_if_no_away = db_get_b(NULL, "CList", "SecondLineShowStatusIfNoAway", SETTING_SECONDLINE_STATUSIFNOAWAY_DEFAULT);
@@ -584,7 +584,7 @@ void cli_LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst)
if (tszLineText)
mir_tstrncpy(dat->thirdLine.text, tszLineText, _countof(dat->thirdLine.text));
else
- dat->thirdLine.text[0] = _T('\0');
+ dat->thirdLine.text[0] = '\0';
dat->thirdLine.xstatus_has_priority = db_get_b(NULL, "CList", "ThirdLineXStatusHasPriority", SETTING_THIRDLINE_XSTATUS_DEFAULT);
dat->thirdLine.show_status_if_no_away = db_get_b(NULL, "CList", "ThirdLineShowStatusIfNoAway", SETTING_THIRDLINE_STATUSIFNOAWAY_DEFAULT);
@@ -654,7 +654,7 @@ int ExpandMetaContact(HWND hwnd, ClcContact *contact, ClcData *dat)
return contact->bSubExpanded;
}
-int cliFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk)
+int cliFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk)
{
ClcGroup *group = &dat->list;
int testlen = (int)mir_tstrlen(text);
@@ -673,11 +673,11 @@ int cliFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk)
if (cc->type != CLCIT_DIVIDER) {
bool found;
if (dat->bFilterSearch) {
- TCHAR *lowered_szText = CharLowerW(NEWTSTR_ALLOCA(cc->szText));
- TCHAR *lowered_text = CharLowerW(NEWTSTR_ALLOCA(text));
- found = _tcsstr(lowered_szText, lowered_text) != NULL;
+ wchar_t *lowered_szText = CharLowerW(NEWWSTR_ALLOCA(cc->szText));
+ wchar_t *lowered_text = CharLowerW(NEWWSTR_ALLOCA(text));
+ found = wcsstr(lowered_szText, lowered_text) != NULL;
}
- else found = (prefixOk && !_tcsnicmp(text, cc->szText, testlen)) || (!prefixOk && !mir_tstrcmpi(text, cc->szText));
+ else found = (prefixOk && !wcsnicmp(text, cc->szText, testlen)) || (!prefixOk && !mir_tstrcmpi(text, cc->szText));
if (found) {
ClcGroup *ccGroup = group;
@@ -704,11 +704,11 @@ int cliFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk)
bool found;
if (dat->bFilterSearch) {
- TCHAR *lowered_szText = CharLowerW(NEWTSTR_ALLOCA(ccSub.szText));
- TCHAR *lowered_text = CharLowerW(NEWTSTR_ALLOCA(text));
- found = _tcsstr(lowered_szText, lowered_text) != NULL;
+ wchar_t *lowered_szText = CharLowerW(NEWWSTR_ALLOCA(ccSub.szText));
+ wchar_t *lowered_text = CharLowerW(NEWWSTR_ALLOCA(text));
+ found = wcsstr(lowered_szText, lowered_text) != NULL;
}
- else found = (prefixOk && !_tcsnicmp(text, ccSub.szText, testlen)) || (!prefixOk && !mir_tstrcmpi(text, ccSub.szText));
+ else found = (prefixOk && !wcsnicmp(text, ccSub.szText, testlen)) || (!prefixOk && !mir_tstrcmpi(text, ccSub.szText));
if (found) {
ClcGroup *ccGroup = group;
diff --git a/plugins/Clist_modern/src/modern_clist.h b/plugins/Clist_modern/src/modern_clist.h
index fc9e6e3695..db9ba3fd67 100644
--- a/plugins/Clist_modern/src/modern_clist.h
+++ b/plugins/Clist_modern/src/modern_clist.h
@@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void LoadContactTree(void);
HTREEITEM GetTreeItemByHContact(MCONTACT hContact);
-int GetContactInfosForSort(MCONTACT hContact, char **Proto, TCHAR **Name, int *Status);
+int GetContactInfosForSort(MCONTACT hContact, char **Proto, wchar_t **Name, int *Status);
///////////////////////////////////////////////////////////////////////////////
@@ -59,13 +59,13 @@ public:
DestroySmileyList();
}
- void ReplaceSmileys(ClcData *dat, ClcCacheEntry *pdnce, TCHAR *szText, BOOL replace_smileys);
+ void ReplaceSmileys(ClcData *dat, ClcCacheEntry *pdnce, wchar_t *szText, BOOL replace_smileys);
/** Destroy smiley list */
void DestroySmileyList();
/** Copy Smiley List */
void _CopySmileyList(SortedList *plInput);
- void AddListeningToIcon(ClcData *dat, TCHAR *szText);
+ void AddListeningToIcon(ClcData *dat, wchar_t *szText);
};
@@ -86,10 +86,10 @@ struct ClcCacheEntry : public ClcCacheEntryBase
void* ClcContact;
int IsExpanded;
- TCHAR* szSecondLineText;
+ wchar_t* szSecondLineText;
CSmileyString ssSecondLine;
- TCHAR* szThirdLineText;
+ wchar_t* szThirdLineText;
CSmileyString ssThirdLine;
HANDLE hTimeZone;
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp
index 0c05a92028..24cc1f273c 100644
--- a/plugins/Clist_modern/src/modern_clistevents.cpp
+++ b/plugins/Clist_modern/src/modern_clistevents.cpp
@@ -110,13 +110,13 @@ CListEvent* cli_AddEvent(CLISTEVENT *cle)
}
char *szProto = GetContactProto(p->hContact);
- TCHAR *szName = pcli->pfnGetContactDisplayName(p->hContact, 0);
+ wchar_t *szName = pcli->pfnGetContactDisplayName(p->hContact, 0);
if (szProto && szName) {
NotifyMenuItemExData *nmi = (struct NotifyMenuItemExData *) malloc(sizeof(struct NotifyMenuItemExData));
if (nmi) {
- TCHAR szBuffer[128];
- TCHAR* szStatus = pcli->pfnGetStatusModeDescription(db_get_w(p->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
- TCHAR szwProto[64];
+ wchar_t szBuffer[128];
+ wchar_t* szStatus = pcli->pfnGetStatusModeDescription(db_get_w(p->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
+ wchar_t szwProto[64];
MultiByteToWideChar(CP_ACP, 0, szProto, -1, szwProto, 64);
szwProto[63] = 0;
mir_sntprintf(szBuffer, L"%s: %s (%s)", szwProto, szName, szStatus);
@@ -296,7 +296,7 @@ static int EventArea_DrawWorker(HWND hWnd, HDC hDC)
int iCount = GetMenuItemCount(g_CluiData.hMenuNotify);
rc.left += 26;
if (g_CluiData.hUpdateContact != 0) {
- TCHAR *szName = pcli->pfnGetContactDisplayName(g_CluiData.hUpdateContact, 0);
+ wchar_t *szName = pcli->pfnGetContactDisplayName(g_CluiData.hUpdateContact, 0);
int iIcon = cli_GetContactIcon(g_CluiData.hUpdateContact);
ske_ImageList_DrawEx(g_himlCListClc, iIcon, hDC, rc.left, (rc.bottom + rc.top - GetSystemMetrics(SM_CYSMICON)) / 2, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), CLR_NONE, CLR_NONE, ILD_NORMAL);
@@ -311,7 +311,7 @@ static int EventArea_DrawWorker(HWND hWnd, HDC hDC)
GetMenuItemInfo(g_CluiData.hMenuNotify, iCount - 1, TRUE, &mii);
NotifyMenuItemExData *nmi = (struct NotifyMenuItemExData *) mii.dwItemData;
- TCHAR *szName = pcli->pfnGetContactDisplayName(nmi->hContact, 0);
+ wchar_t *szName = pcli->pfnGetContactDisplayName(nmi->hContact, 0);
int iIcon = cli_GetContactIcon(nmi->hContact);
ske_ImageList_DrawEx(g_himlCListClc, iIcon, hDC, rc.left, (rc.bottom + rc.top - GetSystemMetrics(SM_CYSMICON)) / 2, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), CLR_NONE, CLR_NONE, ILD_NORMAL);
rc.left += 18;
@@ -320,7 +320,7 @@ static int EventArea_DrawWorker(HWND hWnd, HDC hDC)
}
else {
HICON hIcon = (HICON)LoadImage(g_hMirApp, MAKEINTRESOURCE(IDI_BLANK), IMAGE_ICON, 16, 16, 0);
- TCHAR *ptszEvents = TranslateT("No events");
+ wchar_t *ptszEvents = TranslateT("No events");
ske_DrawText(hDC, ptszEvents, (int)mir_tstrlen(ptszEvents), &rc, DT_VCENTER | DT_SINGLELINE);
ske_DrawIconEx(hDC, 4, (rc.bottom + rc.top - 16) / 2, hIcon, 16, 16, 0, 0, DI_NORMAL | DI_COMPAT);
DestroyIcon(hIcon);
@@ -488,7 +488,7 @@ int EventArea_Create(HWND hCluiWnd)
ehhEventAreaBackgroundSettingsChanged(0, 0);
WNDCLASS wndclass = { 0 };
- TCHAR pluginname[] = L"EventArea";
+ wchar_t pluginname[] = L"EventArea";
int h = GetSystemMetrics(SM_CYSMICON) + 2;
if (GetClassInfo(g_hInst, pluginname, &wndclass) == 0) {
wndclass.style = 0;
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp
index 92dde8c3c1..2605dea546 100644
--- a/plugins/Clist_modern/src/modern_clistmenus.cpp
+++ b/plugins/Clist_modern/src/modern_clistmenus.cpp
@@ -58,13 +58,13 @@ int InitCustomMenus(void)
#define CLUI_FAVSETRATE "CLUI/SetContactRate" //LParam is rate, Wparam is contact handle
#define CLUI_FAVTOGGLESHOWOFFLINE "CLUI/ToggleContactShowOffline"
-static TCHAR *FAVMENUROOTNAME = LPGENT("&Contact rate");
+static wchar_t *FAVMENUROOTNAME = LPGENW("&Contact rate");
-static TCHAR *rates[] = {
- LPGENT("None"),
- LPGENT("Low"),
- LPGENT("Medium"),
- LPGENT("High")
+static wchar_t *rates[] = {
+ LPGENW("None"),
+ LPGENW("Low"),
+ LPGENW("Medium"),
+ LPGENW("High")
};
static HGENMENU hFavoriteContactMenu = NULL, hShowIfOflineItem = NULL;
@@ -124,7 +124,7 @@ int LoadFavoriteContactMenu()
CMenuItem mi;
SET_UID(mi, 0xf99a2320, 0xc024, 0x48bd, 0x81, 0xf7, 0x9f, 0xa2, 0x5, 0xb0, 0x7f, 0xdc);
- mi.name.t = FAVMENUROOTNAME;
+ mi.name.w = FAVMENUROOTNAME;
mi.flags = CMIF_TCHAR;
hFavoriteContactMenu = Menu_AddContactMenuItem(&mi);
Menu_ConfigureItem(hFavoriteContactMenu, MCI_OPT_UNIQUENAME, "ModernClistMenu_ContactRate");
@@ -135,7 +135,7 @@ int LoadFavoriteContactMenu()
mi.pszService = CLUI_FAVSETRATE;
for (int i = 0; i < _countof(rates); i++) {
mi.hIcolibItem = iconList[i].hIcolib;
- mi.name.t = rates[i];
+ mi.name.w = rates[i];
hFavoriteContactMenuItems[i] = Menu_AddContactMenuItem(&mi);
Menu_ConfigureItem(hFavoriteContactMenuItems[i], MCI_OPT_EXECPARAM, i);
}
@@ -143,7 +143,7 @@ int LoadFavoriteContactMenu()
mi.hIcolibItem = NULL;
mi.pszService = CLUI_FAVTOGGLESHOWOFFLINE;
mi.position = -100000000;
- mi.name.t = LPGENT("Show even if offline");
+ mi.name.w = LPGENW("Show even if offline");
hShowIfOflineItem = Menu_AddContactMenuItem(&mi);
Menu_ConfigureItem(hShowIfOflineItem, MCI_OPT_EXECPARAM, _countof(rates) + 100000000);
return 0;
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp
index a6d774893a..5e8f223061 100644
--- a/plugins/Clist_modern/src/modern_clistmod.cpp
+++ b/plugins/Clist_modern/src/modern_clistmod.cpp
@@ -290,7 +290,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY)
hAuxOld = hAux;
hAux = GetAncestor(hAux, GA_ROOTOWNER);
if (hAuxOld == hAux) {
- TCHAR buf[255];
+ wchar_t buf[255];
GetClassName(hAux, buf, _countof(buf));
if (!mir_tstrcmp(buf, CLUIFrameSubContainerClassName)) {
hWndFound = TRUE;
diff --git a/plugins/Clist_modern/src/modern_clistopts.cpp b/plugins/Clist_modern/src/modern_clistopts.cpp
index f918d50773..ed7b571b64 100644
--- a/plugins/Clist_modern/src/modern_clistopts.cpp
+++ b/plugins/Clist_modern/src/modern_clistopts.cpp
@@ -508,7 +508,7 @@ static INT_PTR CALLBACK DlgProcItemTextOpts(HWND hwndDlg, UINT msg, WPARAM wPara
//TODO: init IDC_ALIGNGROUPCOMBO from db_get_b(NULL,"CList","AlignGroupCaptions",SETTING_ALIGNGROPCAPTION_DEFAULT);
{
int item;
- TCHAR *align[] = { LPGENT("Left align group names"), LPGENT("Center group names"), LPGENT("Right align group names") };
+ wchar_t *align[] = { LPGENW("Left align group names"), LPGENW("Center group names"), LPGENW("Right align group names") };
for (int i = 0; i < sizeof(align) / sizeof(char*); i++)
item = SendDlgItemMessage(hwndDlg, IDC_ALIGNGROUPCOMBO, CB_ADDSTRING, 0, (LPARAM)TranslateTS(align[i]));
SendDlgItemMessage(hwndDlg, IDC_ALIGNGROUPCOMBO, CB_SETCURSEL, db_get_b(NULL, "CList", "AlignGroupCaptions", SETTING_ALIGNGROPCAPTION_DEFAULT), 0);
@@ -716,7 +716,7 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM
radio = TEXT_STATUS_MESSAGE;
db_set_w(NULL, "CList", "SecondLineType", (WORD)radio);
- TCHAR t[TEXT_TEXT_MAX_LENGTH];
+ wchar_t t[TEXT_TEXT_MAX_LENGTH];
GetDlgItemText(hwndDlg, IDC_VARIABLE_TEXT, t, _countof(t));
t[TEXT_TEXT_MAX_LENGTH - 1] = '\0';
db_set_ts(NULL, "CList", "SecondLineText", t);
@@ -882,7 +882,7 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM
db_set_w(NULL, "CList", "ThirdLineType", (WORD)radio);
}
{
- TCHAR t[TEXT_TEXT_MAX_LENGTH];
+ wchar_t t[TEXT_TEXT_MAX_LENGTH];
GetDlgItemText(hwndDlg, IDC_VARIABLE_TEXT, t, _countof(t));
t[TEXT_TEXT_MAX_LENGTH - 1] = '\0';
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp
index 70665ab9cc..a212170259 100644
--- a/plugins/Clist_modern/src/modern_clistsettings.cpp
+++ b/plugins/Clist_modern/src/modern_clistsettings.cpp
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void InsertContactIntoTree(MCONTACT hContact, int status);
-TCHAR* UnknownConctactTranslatedName = NULL;
+wchar_t* UnknownConctactTranslatedName = NULL;
void cliFreeCacheItem(ClcCacheEntry *p)
{
@@ -78,7 +78,7 @@ int GetStatusForContact(MCONTACT hContact, char *szProto)
return (szProto) ? db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE) : ID_STATUS_OFFLINE;
}
-int GetContactInfosForSort(MCONTACT hContact, char **Proto, TCHAR **Name, int *Status)
+int GetContactInfosForSort(MCONTACT hContact, char **Proto, wchar_t **Name, int *Status)
{
ClcCacheEntry *cacheEntry = pcli->pfnGetCacheEntry(hContact);
if (cacheEntry != NULL) {
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index 0a92bb92cc..c0b4e9c106 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -147,7 +147,7 @@ CLUI* CLUI::m_pCLUI = NULL;
BOOL CLUI::m_fMainMenuInited = FALSE;
HWND CLUI::m_hWnd = NULL;
-static TCHAR tszFolderPath[MAX_PATH];
+static wchar_t tszFolderPath[MAX_PATH];
void CLUI::cliOnCreateClc(void)
{
@@ -184,9 +184,9 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM, LPARAM)
return 0;
HWND hwndClist = GetFocus();
- TCHAR cls[128];
+ wchar_t cls[128];
GetClassName(hwndClist, cls, _countof(cls));
- if (mir_tstrcmp(_T(CLISTCONTROL_CLASS), cls))
+ if (mir_tstrcmp(CLISTCONTROL_CLASSW, cls))
hwndClist = pcli->hwndContactList;
MCONTACT hItem = (MCONTACT)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
@@ -316,13 +316,13 @@ HRESULT CLUI::LoadDllsRuntime()
}
static IconItemT iconItem[] = {
- { LPGENT("Show avatar"), "ShowAvatar", IDI_SHOW_AVATAR },
- { LPGENT("Hide avatar"), "HideAvatar", IDI_HIDE_AVATAR }
+ { LPGENW("Show avatar"), "ShowAvatar", IDI_SHOW_AVATAR },
+ { LPGENW("Hide avatar"), "HideAvatar", IDI_HIDE_AVATAR }
};
HRESULT CLUI::RegisterAvatarMenu()
{
- Icon_RegisterT(g_hInst, LPGENT("Contact list"), iconItem, _countof(iconItem));
+ Icon_RegisterT(g_hInst, LPGENW("Contact list"), iconItem, _countof(iconItem));
CMenuItem mi;
@@ -348,7 +348,7 @@ HRESULT CLUI::RegisterAvatarMenu()
HRESULT CLUI::CreateCLCWindow(const HWND hwndClui)
{
- pcli->hwndContactTree = CreateWindow(_T(CLISTCONTROL_CLASS), L"",
+ pcli->hwndContactTree = CreateWindow(CLISTCONTROL_CLASSW, L"",
WS_CHILD | WS_CLIPCHILDREN | CLS_CONTACTLIST
| (db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0)
| (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CLS_HIDEOFFLINE : 0)
@@ -412,7 +412,7 @@ HRESULT CLUI::CreateCLC()
Frame.align = alClient;
Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
Frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NO_SUBCONTAINER | F_TCHAR;
- Frame.tname = LPGENT("My contacts");
+ Frame.tname = LPGENW("My contacts");
Frame.TBtname = TranslateT("My contacts");
hFrameContactTree = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
@@ -496,7 +496,7 @@ BOOL CLUI_CheckOwnedByClui(HWND hWnd)
if (hWndMid == hWndClui)
return TRUE;
- TCHAR buf[255];
+ wchar_t buf[255];
GetClassName(hWndMid, buf, 254);
if (!mir_tstrcmpi(buf, CLUIFrameSubContainerClassName))
return TRUE;
@@ -664,7 +664,7 @@ void CLUI_ChangeWindowMode()
styleEx |= WS_EX_LAYERED;
// 4 - Set Title
- TCHAR titleText[255] = { 0 };
+ wchar_t titleText[255] = { 0 };
DBVARIANT dbv;
if (db_get_ts(NULL, "CList", "TitleText", &dbv))
mir_tstrncpy(titleText, _T(MIRANDANAME), _countof(titleText));
@@ -880,12 +880,12 @@ int CLUI_OnSkinLoad(WPARAM, LPARAM)
static int CLUI_GetConnectingIconForProtoCount(char *szAccoName)
{
int count;
- TCHAR fileFull[MAX_PATH];
+ wchar_t fileFull[MAX_PATH];
if (!tszFolderPath[0]) {
- TCHAR szRelativePath[MAX_PATH];
+ wchar_t szRelativePath[MAX_PATH];
GetModuleFileName(GetModuleHandle(NULL), szRelativePath, MAX_PATH);
- TCHAR *str = _tcsrchr(szRelativePath, '\\');
+ wchar_t *str = wcsrchr(szRelativePath, '\\');
if (str != NULL)
*str = 0;
PathToAbsoluteT(szRelativePath, tszFolderPath);
@@ -916,12 +916,12 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName)
return 8;
}
-static HICON CLUI_LoadIconFromExternalFile(TCHAR *filename, int i)
+static HICON CLUI_LoadIconFromExternalFile(wchar_t *filename, int i)
{
- TCHAR szPath[MAX_PATH], szFullPath[MAX_PATH];
+ wchar_t szPath[MAX_PATH], szFullPath[MAX_PATH];
mir_sntprintf(szPath, L"Icons\\%s", filename);
PathToAbsoluteT(szPath, szFullPath);
- if (_taccess(szPath, 0))
+ if (_waccess(szPath, 0))
return NULL;
HICON hIcon = NULL;
@@ -931,7 +931,7 @@ static HICON CLUI_LoadIconFromExternalFile(TCHAR *filename, int i)
static HICON CLUI_GetConnectingIconForProto(char *szAccoName, int idx)
{
- TCHAR szFullPath[MAX_PATH];
+ wchar_t szFullPath[MAX_PATH];
HICON hIcon;
if (szAccoName) {
@@ -1498,35 +1498,35 @@ BOOL cliInvalidateRect(HWND hWnd, CONST RECT* lpRect, BOOL bErase)
return InvalidateRect(hWnd, lpRect, bErase);
}
-static BOOL FileExists(TCHAR * tszFilename)
+static BOOL FileExists(wchar_t * tszFilename)
{
- FILE * f = _tfopen(tszFilename, L"r");
+ FILE * f = _wfopen(tszFilename, L"r");
if (f == NULL) return FALSE;
fclose(f);
return TRUE;
}
-HANDLE RegisterIcolibIconHandle(char *szIcoID, char *szSectionName, char *szDescription, TCHAR *tszDefaultFile, int iDefaultIndex, HINSTANCE hDefaultModuleInst, int iDefaultResource)
+HANDLE RegisterIcolibIconHandle(char *szIcoID, char *szSectionName, char *szDescription, wchar_t *tszDefaultFile, int iDefaultIndex, HINSTANCE hDefaultModuleInst, int iDefaultResource)
{
if (hDefaultModuleInst == NULL)
return Skin_GetIconHandle(iDefaultResource);
- TCHAR fileFull[MAX_PATH] = { 0 };
+ wchar_t fileFull[MAX_PATH] = { 0 };
SKINICONDESC sid = { 0 };
sid.section.a = szSectionName;
sid.pszName = szIcoID;
sid.flags |= SIDF_PATH_TCHAR;
sid.description.a = szDescription;
- sid.defaultFile.t = fileFull;
+ sid.defaultFile.w = fileFull;
if (tszDefaultFile) {
PathToAbsoluteT(tszDefaultFile, fileFull);
if (!FileExists(fileFull))
- fileFull[0] = _T('\0');
+ fileFull[0] = '\0';
}
- if (fileFull[0] != _T('\0'))
+ if (fileFull[0] != '\0')
sid.iDefaultIndex = -iDefaultIndex;
else {
GetModuleFileName(hDefaultModuleInst, fileFull, _countof(fileFull));
@@ -2419,7 +2419,7 @@ LRESULT CLUI::OnMeasureItem(UINT, WPARAM, LPARAM lParam)
case MENU_STATUSMENU:
HDC hdc = GetDC(m_hWnd);
- TCHAR *ptszStr = TranslateT("Status");
+ wchar_t *ptszStr = TranslateT("Status");
SIZE textSize;
GetTextExtentPoint32(hdc, ptszStr, (int)mir_tstrlen(ptszStr), &textSize);
pmis->itemWidth = textSize.cx;
diff --git a/plugins/Clist_modern/src/modern_commonprototypes.h b/plugins/Clist_modern/src/modern_commonprototypes.h
index 4f285e9ad0..3aeb4ae795 100644
--- a/plugins/Clist_modern/src/modern_commonprototypes.h
+++ b/plugins/Clist_modern/src/modern_commonprototypes.h
@@ -67,7 +67,7 @@ bool CLCItems_IsShowOfflineGroup(ClcGroup *group);
int CListMod_HideWindow();
/* CLUI */
-HANDLE RegisterIcolibIconHandle(char *szIcoID, char *szSectionName, char *szDescription, TCHAR *tszDefaultFile, int iDefaultIndex, HINSTANCE hDefaultModule, int iDefaultResource);
+HANDLE RegisterIcolibIconHandle(char *szIcoID, char *szSectionName, char *szDescription, wchar_t *tszDefaultFile, int iDefaultIndex, HINSTANCE hDefaultModule, int iDefaultResource);
void CLUI_UpdateAeroGlass();
void CLUI_ChangeWindowMode();
BOOL CLUI_CheckOwnedByClui(HWND hwnd);
@@ -91,13 +91,13 @@ int CLUIUnreadEmailCountChanged(WPARAM wParam, LPARAM lParam);
/* GDIPlus */
BOOL GDIPlus_AlphaBlend(HDC hdcDest, int nXOriginDest, int nYOriginDest, int nWidthDest, int nHeightDest, HDC hdcSrc, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, BLENDFUNCTION *blendFunction);
-HBITMAP GDIPlus_LoadGlyphImage(const TCHAR *szFileName);
+HBITMAP GDIPlus_LoadGlyphImage(const wchar_t *szFileName);
/* EventArea */
void EventArea_ConfigureEventArea();
/* ModernSkinButton */
-int ModernSkinButton_AddButton(HWND parent, char *ID, char *CommandService, char *StateDefService, char *HandeService, int Left, int Top, int Right, int Bottom, DWORD AlignedTo, TCHAR *Hint, char *DBkey, char *TypeDef, int MinWidth, int MinHeight);
+int ModernSkinButton_AddButton(HWND parent, char *ID, char *CommandService, char *StateDefService, char *HandeService, int Left, int Top, int Right, int Bottom, DWORD AlignedTo, wchar_t *Hint, char *DBkey, char *TypeDef, int MinWidth, int MinHeight);
int ModernSkinButtonLoadModule();
int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT *r);
int ModernSkinButtonUnloadModule(WPARAM, LPARAM);
@@ -119,16 +119,16 @@ int ske_DrawNonFramedObjects(BOOL Erase, RECT *r);
BOOL ske_DrawText(HDC hdc, LPCTSTR lpString, int nCount, RECT *lpRect, UINT format);
LPSKINOBJECTDESCRIPTOR ske_FindObjectByName(const char *szName, BYTE objType, SKINOBJECTSLIST *Skin);
HBITMAP ske_GetCurrentWindowImage();
-int ske_GetFullFilename(TCHAR *buf, const TCHAR *file, TCHAR *skinfolder, BOOL madeAbsolute);
-int ske_GetSkinFolder(TCHAR *szFileName, char *t2);
+int ske_GetFullFilename(wchar_t *buf, const wchar_t *file, wchar_t *skinfolder, BOOL madeAbsolute);
+int ske_GetSkinFolder(wchar_t *szFileName, char *t2);
BOOL ske_ImageList_DrawEx(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, int dx, int dy, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle);
HICON ske_ImageList_GetIcon(HIMAGELIST himl, int i);
int ske_JustUpdateWindowImageRect(RECT *rty);
-HBITMAP ske_LoadGlyphImage(const TCHAR *szFileName);
+HBITMAP ske_LoadGlyphImage(const wchar_t *szFileName);
HRESULT SkinEngineLoadModule();
void ske_LoadSkinFromDB(void);
-int ske_LoadSkinFromIniFile(TCHAR*, BOOL);
-TCHAR* ske_ParseText(TCHAR *stzText);
+int ske_LoadSkinFromIniFile(wchar_t*, BOOL);
+wchar_t* ske_ParseText(wchar_t *stzText);
int ske_PrepareImageButDontUpdateIt(RECT *r);
int ske_ReCreateBackImage(BOOL Erase, RECT *w);
int ske_RedrawCompleteWindow();
@@ -214,7 +214,7 @@ void UnLoadContactListModule(); /
void UpdateAllAvatars(ClcData *dat); //cache_func.c
void ApplyViewMode(const char *Name, bool onlySelector = false);
-void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szProtoFilter, DWORD statusMask, DWORD stickyStatusMask, unsigned int options, unsigned int stickies, unsigned int operators, unsigned int lmdat);
+void SaveViewMode(const char *name, const wchar_t *szGroupFilter, const char *szProtoFilter, DWORD statusMask, DWORD stickyStatusMask, unsigned int options, unsigned int stickies, unsigned int operators, unsigned int lmdat);
// cluiframes.c
int ExtraImage_ExtraIDToColumnNum(int extra);
@@ -238,7 +238,7 @@ void cliRebuildEntireList(HWND hwnd, ClcData *dat);
void cliRecalcScrollBar(HWND hwnd, ClcData *dat);
void CLUI_cliOnCreateClc(void);
int cliGetGroupContentsCount(ClcGroup *group, int visibleOnly);
-int cliFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk);
+int cliFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk);
int cliGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex);
int cli_IconFromStatusMode(const char *szProto, int nStatus, MCONTACT hContact);
int cli_GetContactIcon(MCONTACT hContact);
diff --git a/plugins/Clist_modern/src/modern_effectenum.h b/plugins/Clist_modern/src/modern_effectenum.h
index 28f30beaf8..aff63b837c 100644
--- a/plugins/Clist_modern/src/modern_effectenum.h
+++ b/plugins/Clist_modern/src/modern_effectenum.h
@@ -20,9 +20,9 @@ typedef struct _MODERNEFFECT
}MODERNEFFECT;
#ifdef _EFFECTENUM_FULL_H
-TCHAR * ModernEffectNames[] =
+wchar_t * ModernEffectNames[] =
#else
-TCHAR * _ModernEffectNames[] =
+wchar_t * _ModernEffectNames[] =
#endif
{
L"Shadow at left",
@@ -87,7 +87,7 @@ MODERNEFFECTMATRIX ModernEffectsEnum[] = {
#define MAXPREDEFINEDEFFECTS sizeof(ModernEffectNames)/sizeof(ModernEffectNames[0])
#else
#define MAXPREDEFINEDEFFECTS sizeof(_ModernEffectNames)/sizeof(_ModernEffectNames[0])
-extern TCHAR * ModernEffectNames[];
+extern wchar_t * ModernEffectNames[];
#endif
extern BOOL SkinEngine_ResetTextEffect(HDC);
extern BOOL SkinEngine_SelectTextEffect(HDC hdc, BYTE EffectID, DWORD FirstColor, DWORD SecondColor); \ No newline at end of file
diff --git a/plugins/Clist_modern/src/modern_gdiplus.cpp b/plugins/Clist_modern/src/modern_gdiplus.cpp
index e7d414125f..ce53d31913 100644
--- a/plugins/Clist_modern/src/modern_gdiplus.cpp
+++ b/plugins/Clist_modern/src/modern_gdiplus.cpp
@@ -48,7 +48,7 @@ DWORD argb_from_cola(COLORREF col, BYTE alpha)
return((BYTE)(alpha) << 24 | col);
}
-HBITMAP GDIPlus_LoadGlyphImage(const TCHAR *tszFileName)
+HBITMAP GDIPlus_LoadGlyphImage(const wchar_t *tszFileName)
{
// Create a Bitmap object from a JPEG file.
Bitmap bitmap(tszFileName, 0);
@@ -149,7 +149,7 @@ COLORREF __inline _revcolref(COLORREF colref)
// based on routine from http://www.codeproject.com/vcpp/gdiplus/imageexgdi.asp
//
-BOOL GDIPlus_IsAnimatedGif(TCHAR * szName)
+BOOL GDIPlus_IsAnimatedGif(wchar_t * szName)
{
int nFrameCount = 0;
Image image(szName);
@@ -169,7 +169,7 @@ BOOL GDIPlus_IsAnimatedGif(TCHAR * szName)
return (BOOL)(nFrameCount > 1);
}
-void GDIPlus_ExtractAnimatedGIF(TCHAR *szName, int width, int height, HBITMAP &pBitmap, int* &pframesDelay, int &pframesCount, SIZE &pSizeAvatar)
+void GDIPlus_ExtractAnimatedGIF(wchar_t *szName, int width, int height, HBITMAP &pBitmap, int* &pframesDelay, int &pframesCount, SIZE &pSizeAvatar)
{
int nFrameCount = 0;
Bitmap image(szName);
diff --git a/plugins/Clist_modern/src/modern_global_structure.h b/plugins/Clist_modern/src/modern_global_structure.h
index 7f54143571..242dc16c21 100644
--- a/plugins/Clist_modern/src/modern_global_structure.h
+++ b/plugins/Clist_modern/src/modern_global_structure.h
@@ -20,7 +20,7 @@ typedef struct tagCLUIDATA
MCONTACT hUpdateContact;
// Contact List View Mode
- TCHAR groupFilter[2048];
+ wchar_t groupFilter[2048];
char protoFilter[2048];
char varFilter[2048];
DWORD lastMsgFilter;
diff --git a/plugins/Clist_modern/src/modern_keyboard.cpp b/plugins/Clist_modern/src/modern_keyboard.cpp
index d55326fee4..f4773c48e2 100644
--- a/plugins/Clist_modern/src/modern_keyboard.cpp
+++ b/plugins/Clist_modern/src/modern_keyboard.cpp
@@ -49,21 +49,21 @@ int InitSkinHotKeys(void)
shk.cbSize = sizeof(shk);
shk.dwFlags = HKD_TCHAR;
- shk.ptszDescription = LPGENT("Close Miranda");
+ shk.ptszDescription = LPGENW("Close Miranda");
shk.pszName = "CloseMiranda";
- shk.ptszSection = LPGENT("Main");
+ shk.ptszSection = LPGENW("Main");
shk.pszService = "CLIST/HK/CloseMiranda";
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENT("Restore last status");
+ shk.ptszDescription = LPGENW("Restore last status");
shk.pszName = "RestoreLastStatus";
- shk.ptszSection = LPGENT("Status");
+ shk.ptszSection = LPGENW("Status");
shk.pszService = "CLIST/HK/RestoreStatus";
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENT("Show/Hide offline users");
+ shk.ptszDescription = LPGENW("Show/Hide offline users");
shk.pszName = "ShowHideOfflineUsers";
- shk.ptszSection = LPGENT("Main");
+ shk.ptszSection = LPGENW("Main");
shk.pszService = MS_CLIST_TOGGLEHIDEOFFLINE;
Hotkey_Register(&shk);
diff --git a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
index fbe18a6583..1fe7d491fb 100644
--- a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
+++ b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
@@ -70,7 +70,7 @@ int RowHeight_CalcRowHeight(ClcData *dat, ClcContact *contact, int item)
if (dat->text_replace_smileys && dat->first_line_draw_smileys && !dat->text_resize_smileys)
tmp = max(tmp, contact->ssText.iMaxSmileyHeight);
if (contact->type == CLCIT_GROUP) {
- TCHAR *szCounts = pcli->pfnGetGroupCountsText(dat, contact);
+ wchar_t *szCounts = pcli->pfnGetGroupCountsText(dat, contact);
// Has the count?
if (szCounts && szCounts[0])
tmp = max(tmp, dat->fontModernInfo[contact->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS].fontHeight);
@@ -108,7 +108,7 @@ int RowHeight_CalcRowHeight(ClcData *dat, ClcContact *contact, int item)
g_clcPainter.ChangeToFont(hdc, dat, g_clcPainter.GetBasicFontID(contact), NULL);
g_clcPainter.GetTextSize(&size, hdc, dummyRect, contact->szText, contact->ssText.plText, 0, dat->text_resize_smileys ? 0 : contact->ssText.iMaxSmileyHeight);
if (contact->type == CLCIT_GROUP) {
- TCHAR *szCounts = pcli->pfnGetGroupCountsText(dat, contact);
+ wchar_t *szCounts = pcli->pfnGetGroupCountsText(dat, contact);
if (szCounts && mir_tstrlen(szCounts) > 0) {
RECT count_rc = { 0 };
// calc width and height
@@ -239,7 +239,7 @@ int RowHeight_CalcRowHeight(ClcData *dat, ClcContact *contact, int item)
if (contact->type == CLCIT_CONTACT && dat->contact_time_show && pdnce->hTimeZone) {
pCell->h = dat->fontModernInfo[FONTID_CONTACT_TIME].fontHeight;
if (item == -1) {
- TCHAR szResult[80];
+ wchar_t szResult[80];
if (!TimeZone_PrintDateTime(pdnce->hTimeZone, L"t", szResult, _countof(szResult), 0)) {
SIZE text_size = { 0 };
diff --git a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp
index 902812a8de..a83baa7089 100644
--- a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp
+++ b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp
@@ -28,7 +28,7 @@ void RefreshTree(HWND hwndDlg, HTREEITEM hti);
static char* rowOptTmplStr;
static ROWCELL* rowOptTmplRoot;
static ROWCELL* rowOptTA[100];
-TCHAR *types[] = {
+wchar_t *types[] = {
L"none", L"text1", L"text2", L"text3", L"status",
L"avatar", L"extra", L"extra1", L"extra2", L"extra3",
L"extra4", L"extra5", L"extra6", L"extra7", L"extra8",
@@ -308,7 +308,7 @@ void RefreshTree(HWND hwndDlg, HTREEITEM hti)
cell = (pROWCELL)tvi.lParam;
if (cell)
{
- TCHAR buf[200] = { 0 };
+ wchar_t buf[200] = { 0 };
if (!cell->child)
{
if (cell->type == 0)
@@ -362,14 +362,14 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
}
SendDlgItemMessage(hwndDlg, IDC_CONTTYPE, CB_SETCURSEL, 0, 0);
- TCHAR *h_alignment[] = { L"left", L"hCenter", L"right" };
+ wchar_t *h_alignment[] = { L"left", L"hCenter", L"right" };
for (i = 0; i < _countof(h_alignment); i++) {
item = SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_ADDSTRING, 0, (LPARAM)TranslateTS(h_alignment[i]));
SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_SETITEMDATA, item, 0);
}
SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_SETCURSEL, 0, 0);
- TCHAR *v_alignment[] = { L"top", L"vCenter", L"bottom" };
+ wchar_t *v_alignment[] = { L"top", L"vCenter", L"bottom" };
for (i = 0; i < _countof(v_alignment); i++) {
item = SendDlgItemMessage(hwndDlg, IDC_VALIGN, CB_ADDSTRING, 0, (LPARAM)TranslateTS(v_alignment[i]));
SendDlgItemMessage(hwndDlg, IDC_VALIGN, CB_SETITEMDATA, item, 0);
diff --git a/plugins/Clist_modern/src/modern_skinbutton.cpp b/plugins/Clist_modern/src/modern_skinbutton.cpp
index d0062aecd5..55341cd073 100644
--- a/plugins/Clist_modern/src/modern_skinbutton.cpp
+++ b/plugins/Clist_modern/src/modern_skinbutton.cpp
@@ -33,7 +33,7 @@ This file contains code related to new modern free positioned skinned buttons
BOOL ModernSkinButtonModuleIsLoaded = FALSE;
static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
int ModernSkinButtonUnloadModule(WPARAM wParam, LPARAM lParam);
-HWND SetToolTip(HWND hwnd, TCHAR * tip);
+HWND SetToolTip(HWND hwnd, wchar_t * tip);
typedef struct _ModernSkinButtonCtrl
{
@@ -51,7 +51,7 @@ typedef struct _ModernSkinButtonCtrl
char * ValueTypeDef;
int Left, Top, Bottom, Right;
HMENU hMenu;
- TCHAR * Hint;
+ wchar_t * Hint;
} ModernSkinButtonCtrl;
typedef struct _HandleServiceParams
@@ -457,7 +457,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM w
return DefWindowProc(hwndDlg, msg, wParam, lParam);
}
-HWND SetToolTip(HWND hwnd, TCHAR * tip)
+HWND SetToolTip(HWND hwnd, wchar_t * tip)
{
TOOLINFO ti;
if (!tip) return 0;
@@ -483,7 +483,7 @@ HWND SetToolTip(HWND hwnd, TCHAR * tip)
}
ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
ti.uId = (UINT_PTR)hwnd;
- ti.lpszText = (TCHAR*)tip;
+ ti.lpszText = (wchar_t*)tip;
SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM)&ti);
return hwndToolTips;
@@ -516,7 +516,7 @@ int ModernSkinButton_AddButton(HWND parent,
int Right,
int Bottom,
DWORD sbFlags,
- TCHAR * Hint,
+ wchar_t * Hint,
char * DBkey,
char * TypeDef,
int MinWidth, int MinHeight)
@@ -607,7 +607,7 @@ static HWND ModernSkinButtonCreateWindow(ModernSkinButtonCtrl * bct, HWND parent
if (bct == NULL) return FALSE;
{
- TCHAR *UnicodeID = mir_a2u(bct->ID);
+ wchar_t *UnicodeID = mir_a2u(bct->ID);
hwnd = CreateWindow(_T(MODERNSKINBUTTONCLASS), UnicodeID, WS_VISIBLE | WS_CHILD, bct->Left, bct->Top, bct->Right - bct->Left, bct->Bottom - bct->Top, parent, NULL, g_hInst, NULL);
mir_free(UnicodeID);
}
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp
index e6c325481e..cc28081cb1 100644
--- a/plugins/Clist_modern/src/modern_skinengine.cpp
+++ b/plugins/Clist_modern/src/modern_skinengine.cpp
@@ -115,18 +115,18 @@ static MODERNEFFECT meCurrentEffect = { 0xFF, { 0 }, 0, 0 };
//////////////////////////////////////////////////////////////////////////
// Ini file parser
-IniParser::IniParser(TCHAR * tcsFileName, BYTE flags) : _Flags(flags)
+IniParser::IniParser(wchar_t * tcsFileName, BYTE flags) : _Flags(flags)
{
_DoInit();
if (!tcsFileName) return;
- if (tcsFileName[0] == _T('%')) {
+ if (tcsFileName[0] == '%') {
//TODO: Add parser of resource filename here
_LoadResourceIni(g_hInst, MAKEINTRESOURCEA(IDR_MSF_DEFAULT_SKIN), "MSF");
return;
}
- _hFile = _tfopen(tcsFileName, L"r");
+ _hFile = _wfopen(tcsFileName, L"r");
if (_hFile != NULL) {
_eType = IT_FILE;
_isValid = true;
@@ -200,20 +200,20 @@ HRESULT IniParser::WriteStrToDb(const char * szSection, const char * szName, con
return S_OK;
}
-int IniParser::GetSkinFolder(IN const TCHAR * szFileName, OUT TCHAR * pszFolderName)
+int IniParser::GetSkinFolder(IN const wchar_t * szFileName, OUT wchar_t * pszFolderName)
{
- TCHAR *szBuff = mir_tstrdup(szFileName);
- TCHAR *pszPos = szBuff + mir_tstrlen(szBuff);
- while (pszPos > szBuff && *pszPos != _T('.')) { pszPos--; }
- *pszPos = _T('\0');
+ wchar_t *szBuff = mir_tstrdup(szFileName);
+ wchar_t *pszPos = szBuff + mir_tstrlen(szBuff);
+ while (pszPos > szBuff && *pszPos != '.') { pszPos--; }
+ *pszPos = '\0';
mir_tstrcpy(pszFolderName, szBuff);
- TCHAR custom_folder[MAX_PATH], cus[MAX_PATH];
- TCHAR *b3;
+ wchar_t custom_folder[MAX_PATH], cus[MAX_PATH];
+ wchar_t *b3;
mir_tstrncpy(custom_folder, pszFolderName, _countof(custom_folder));
b3 = custom_folder + mir_tstrlen(custom_folder);
- while (b3 > custom_folder && *b3 != _T('\\')) { b3--; }
- *b3 = _T('\0');
+ while (b3 > custom_folder && *b3 != '\\') { b3--; }
+ *b3 = '\0';
GetPrivateProfileString(L"Skin_Description_Section", L"SkinFolder", L"", cus, _countof(custom_folder), szFileName);
if (cus[0] != 0)
@@ -1467,13 +1467,13 @@ void ske_PreMultiplyChannels(HBITMAP hbmp, BYTE Mult)
return;
}
-int ske_GetFullFilename(TCHAR *buf, const TCHAR *file, TCHAR *skinfolder, BOOL madeAbsolute)
+int ske_GetFullFilename(wchar_t *buf, const wchar_t *file, wchar_t *skinfolder, BOOL madeAbsolute)
{
- TCHAR *SkinPlace = db_get_tsa(NULL, SKIN, "SkinFolder");
+ wchar_t *SkinPlace = db_get_tsa(NULL, SKIN, "SkinFolder");
if (SkinPlace == NULL)
SkinPlace = mir_tstrdup(L"\\Skin\\default");
- TCHAR b2[MAX_PATH];
+ wchar_t b2[MAX_PATH];
if (file[0] != '\\' && file[1] != ':')
mir_sntprintf(b2, L"%s\\%s", (skinfolder == NULL) ? SkinPlace : ((INT_PTR)skinfolder != -1) ? skinfolder : L"", file);
else
@@ -1557,7 +1557,7 @@ static BOOL ske_ReadTGAImageData(void * From, DWORD fromSize, BYTE * destBuf, DW
return TRUE;
}
-static HBITMAP ske_LoadGlyphImage_TGA(const TCHAR *szFilename)
+static HBITMAP ske_LoadGlyphImage_TGA(const wchar_t *szFilename)
{
BYTE *colormap = NULL;
int cx = 0, cy = 0;
@@ -1566,7 +1566,7 @@ static HBITMAP ske_LoadGlyphImage_TGA(const TCHAR *szFilename)
if (!szFilename) return NULL;
if (!wildcmpit(szFilename, L"*\\*%.tga")) {
//Loading TGA image from file
- FILE *fp = _tfopen(szFilename, L"rb");
+ FILE *fp = _wfopen(szFilename, L"rb");
if (!fp) {
TRACEVAR("error: couldn't open \"%s\"!\n", szFilename);
return NULL;
@@ -1618,12 +1618,12 @@ static HBITMAP ske_LoadGlyphImage_TGA(const TCHAR *szFilename)
return NULL;
}
-static HBITMAP ske_LoadGlyphImageByDecoders(const TCHAR *tszFileName)
+static HBITMAP ske_LoadGlyphImageByDecoders(const wchar_t *tszFileName)
{
- if (!_tcschr(tszFileName, '%') && !PathFileExists(tszFileName))
+ if (!wcschr(tszFileName, '%') && !PathFileExists(tszFileName))
return NULL;
- const TCHAR *ext = _tcsrchr(tszFileName, '.');
+ const wchar_t *ext = wcsrchr(tszFileName, '.');
if (ext == NULL)
return NULL;
@@ -1661,7 +1661,7 @@ static HBITMAP ske_LoadGlyphImageByDecoders(const TCHAR *tszFileName)
return hBitmap;
}
-static HBITMAP ske_skinLoadGlyphImage(const TCHAR *tszFileName)
+static HBITMAP ske_skinLoadGlyphImage(const wchar_t *tszFileName)
{
if (!wildcmpit(tszFileName, L"*.tga"))
return GDIPlus_LoadGlyphImage(tszFileName);
@@ -1669,10 +1669,10 @@ static HBITMAP ske_skinLoadGlyphImage(const TCHAR *tszFileName)
return ske_LoadGlyphImageByDecoders(tszFileName);
}
-HBITMAP ske_LoadGlyphImage(const TCHAR *tszFileName)
+HBITMAP ske_LoadGlyphImage(const wchar_t *tszFileName)
{
// try to find image in loaded
- TCHAR szFile[MAX_PATH] = { 0 };
+ wchar_t szFile[MAX_PATH] = { 0 };
ske_GetFullFilename(szFile, tszFileName, g_SkinObjectList.szSkinPlace, TRUE);
mir_cslock lck(cs_SkinChanging);
@@ -1913,9 +1913,9 @@ static int ske_GetSkinFromDB(char *, SKINOBJECTSLIST *Skin)
Skin->pMaskList = (LISTMODERNMASK*)mir_alloc(sizeof(LISTMODERNMASK));
memset(Skin->pMaskList, 0, sizeof(LISTMODERNMASK));
Skin->szSkinPlace = db_get_tsa(NULL, SKIN, "SkinFolder");
- if (!Skin->szSkinPlace || (_tcschr(Skin->szSkinPlace, '%') && !db_get_b(NULL, SKIN, "Modified", 0))) {
+ if (!Skin->szSkinPlace || (wcschr(Skin->szSkinPlace, '%') && !db_get_b(NULL, SKIN, "Modified", 0))) {
BOOL bOnlyObjects = FALSE;
- if (Skin->szSkinPlace && _tcschr(Skin->szSkinPlace, '%'))
+ if (Skin->szSkinPlace && wcschr(Skin->szSkinPlace, '%'))
bOnlyObjects = TRUE;
mir_free(Skin->szSkinPlace);
Skin->szSkinPlace = mir_tstrdup(L"%Default%");
@@ -1957,9 +1957,9 @@ static int ske_LoadSkinFromResource(BOOL bOnlyObjects)
}
// Load data from ini file
-int ske_LoadSkinFromIniFile(TCHAR *szFileName, BOOL bOnlyObjects)
+int ske_LoadSkinFromIniFile(wchar_t *szFileName, BOOL bOnlyObjects)
{
- if (_tcschr(szFileName, _T('%')))
+ if (wcschr(szFileName, '%'))
return ske_LoadSkinFromResource(bOnlyObjects);
IniParser parser(szFileName, bOnlyObjects ? IniParser::FLAG_ONLY_OBJECTS : IniParser::FLAG_WITH_SETTINGS);
@@ -1968,7 +1968,7 @@ int ske_LoadSkinFromIniFile(TCHAR *szFileName, BOOL bOnlyObjects)
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)"ModernSkin");
- TCHAR skinFolder[MAX_PATH], skinFile[MAX_PATH];
+ wchar_t skinFolder[MAX_PATH], skinFile[MAX_PATH];
IniParser::GetSkinFolder(szFileName, skinFolder);
PathToRelativeT(szFileName, skinFile);
@@ -2272,10 +2272,10 @@ static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect,
// replace end of string by elipsis
bNeedFreeWorkString = TRUE;
- lpWorkString = (TCHAR*)mir_alloc((visibleCharCount + 4) * sizeof(TCHAR));
+ lpWorkString = (wchar_t*)mir_alloc((visibleCharCount + 4) * sizeof(wchar_t));
- memcpy((void*)lpWorkString, lpString, visibleCharCount * sizeof(TCHAR));
- memcpy((void*)(lpWorkString + visibleCharCount), L"...", 4 * sizeof(TCHAR)); // 3 + 1
+ memcpy((void*)lpWorkString, lpString, visibleCharCount * sizeof(wchar_t));
+ memcpy((void*)(lpWorkString + visibleCharCount), L"...", 4 * sizeof(wchar_t)); // 3 + 1
nCount = visibleCharCount + 3;
}
@@ -3297,19 +3297,19 @@ static DWORD ske_HexToARGB(char * Hex)
return AARRGGBB;
}
-static TCHAR *ske_ReAppend(TCHAR *lfirst, TCHAR * lsecond, int len)
+static wchar_t *ske_ReAppend(wchar_t *lfirst, wchar_t * lsecond, int len)
{
size_t l1 = lfirst ? mir_tstrlen(lfirst) : 0;
size_t l2 = (len ? len : (mir_tstrlen(lsecond) + 1));
- TCHAR *buf = (TCHAR *)mir_alloc((l1 + l2 + 1)*sizeof(TCHAR));
- if (lfirst) memmove(buf, lfirst, l1*sizeof(TCHAR));
- memmove(buf + l1, lsecond, l2*sizeof(TCHAR));
+ wchar_t *buf = (wchar_t *)mir_alloc((l1 + l2 + 1)*sizeof(wchar_t));
+ if (lfirst) memmove(buf, lfirst, l1*sizeof(wchar_t));
+ memmove(buf + l1, lsecond, l2*sizeof(wchar_t));
mir_free(lfirst);
- if (len) buf[l1 + l2] = _T('\0');
+ if (len) buf[l1 + l2] = '\0';
return buf;
}
-TCHAR* ske_ReplaceVar(TCHAR *var)
+wchar_t* ske_ReplaceVar(wchar_t *var)
{
if (!var) return mir_tstrdup(L"");
if (!mir_tstrcmpi(var, L"Profile")) {
@@ -3327,15 +3327,15 @@ TCHAR* ske_ReplaceVar(TCHAR *var)
return mir_tstrdup(L"");
}
-TCHAR *ske_ParseText(TCHAR *stzText)
+wchar_t *ske_ParseText(wchar_t *stzText)
{
size_t len = mir_tstrlen(stzText);
- TCHAR *result = NULL;
+ wchar_t *result = NULL;
size_t stpos = 0, curpos = 0;
while (curpos < len) {
//1 find first %
- while (curpos < len && stzText[curpos] != (TCHAR)'%')
+ while (curpos < len && stzText[curpos] != (wchar_t)'%')
curpos++;
if (curpos < len) { //% found
if (curpos - stpos > 0)
@@ -3343,14 +3343,14 @@ TCHAR *ske_ParseText(TCHAR *stzText)
stpos = curpos + 1;
curpos++;
//3 find second %
- while (curpos < len && stzText[curpos] != (TCHAR)'%')
+ while (curpos < len && stzText[curpos] != (wchar_t)'%')
curpos++;
if (curpos >= len)
break;
if (curpos - stpos > 0) {
- TCHAR *var = (TCHAR *)mir_alloc((curpos - stpos + 1)*sizeof(TCHAR));
- memcpy(var, stzText + stpos, (curpos - stpos)*sizeof(TCHAR));
- var[curpos - stpos] = (TCHAR)'\0';
+ wchar_t *var = (wchar_t *)mir_alloc((curpos - stpos + 1)*sizeof(wchar_t));
+ memcpy(var, stzText + stpos, (curpos - stpos)*sizeof(wchar_t));
+ var[curpos - stpos] = (wchar_t)'\0';
var = ske_ReplaceVar(var);
result = ske_ReAppend(result, var, 0);
mir_free(var);
diff --git a/plugins/Clist_modern/src/modern_skinengine.h b/plugins/Clist_modern/src/modern_skinengine.h
index 7a165081fc..d59f64f680 100644
--- a/plugins/Clist_modern/src/modern_skinengine.h
+++ b/plugins/Clist_modern/src/modern_skinengine.h
@@ -21,7 +21,7 @@ struct SKINOBJECTSLIST
{
DWORD dwObjLPReserved;
DWORD dwObjLPAlocated;
- TCHAR *szSkinPlace;
+ wchar_t *szSkinPlace;
LISTMODERNMASK *pMaskList;
SKINOBJECTDESCRIPTOR *pObjects;
SortedList *pTextList;
@@ -29,7 +29,7 @@ struct SKINOBJECTSLIST
struct GLYPHIMAGE
{
- TCHAR *szFileName;
+ wchar_t *szFileName;
DWORD dwLoadedTimes;
HBITMAP hGlyph;
BYTE isSemiTransp;
@@ -69,7 +69,7 @@ public:
typedef HRESULT(*ParserCallback_t)(const char *szSection, const char *szKey, const char *szValue, IniParser *This);
- IniParser(TCHAR *szFileName, BYTE flags = FLAG_WITH_SETTINGS);
+ IniParser(wchar_t *szFileName, BYTE flags = FLAG_WITH_SETTINGS);
IniParser(HINSTANCE hInst, const char *resourceName, const char *resourceType, BYTE flags = FLAG_ONLY_OBJECTS);
~IniParser();
@@ -77,7 +77,7 @@ public:
HRESULT Parse(ParserCallback_t pLineCallBackProc, LPARAM lParam);
static HRESULT WriteStrToDb(const char *szSection, const char *szKey, const char *szValue, IniParser *This);
- static int GetSkinFolder(IN const TCHAR *szFileName, OUT TCHAR *pszFolderName);
+ static int GetSkinFolder(IN const wchar_t *szFileName, OUT wchar_t *pszFolderName);
private:
// common
diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp
index 3be1b39192..6927134b57 100644
--- a/plugins/Clist_modern/src/modern_skinopt.cpp
+++ b/plugins/Clist_modern/src/modern_skinopt.cpp
@@ -32,14 +32,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct SkinListData
{
- TCHAR Name[MAX_NAME];
- TCHAR File[MAX_PATH];
+ wchar_t Name[MAX_NAME];
+ wchar_t File[MAX_PATH];
};
HBITMAP hPreviewBitmap = NULL;
-HTREEITEM AddItemToTree(HWND hTree, TCHAR *itemName, void *data);
-HTREEITEM AddSkinToListFullName(HWND hwndDlg, TCHAR *fullName);
-HTREEITEM AddSkinToList(HWND hwndDlg, TCHAR *path, TCHAR *file);
+HTREEITEM AddItemToTree(HWND hTree, wchar_t *itemName, void *data);
+HTREEITEM AddSkinToListFullName(HWND hwndDlg, wchar_t *fullName);
+HTREEITEM AddSkinToList(HWND hwndDlg, wchar_t *path, wchar_t *file);
HTREEITEM FillAvailableSkinList(HWND hwndDlg);
INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -53,8 +53,8 @@ int SkinOptInit(WPARAM wParam, LPARAM)
odp.hInstance = g_hInst;
odp.pfnDlgProc = DlgSkinOpts;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SKIN);
- odp.ptszGroup = LPGENT("Skins");
- odp.ptszTitle = LPGENT("Contact list");
+ odp.pwszGroup = LPGENW("Skins");
+ odp.pwszTitle = LPGENW("Contact list");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &odp);
}
@@ -117,8 +117,8 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
if (!sd)
return 0;
- TCHAR Author[255], URL[MAX_PATH], Contact[255], Description[400], text[2000];
- if (!_tcschr(sd->File, _T('%'))) {
+ wchar_t Author[255], URL[MAX_PATH], Contact[255], Description[400], text[2000];
+ if (!wcschr(sd->File, '%')) {
GetPrivateProfileString(L"Skin_Description_Section", L"Author", TranslateT("( unknown )"), Author, _countof(Author), sd->File);
GetPrivateProfileString(L"Skin_Description_Section", L"URL", L"", URL, _countof(URL), sd->File);
GetPrivateProfileString(L"Skin_Description_Section", L"Contact", L"", Contact, _countof(Contact), sd->File);
@@ -254,11 +254,11 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
if (nmtv->itemNew.lParam) {
SkinListData *sd = (SkinListData*)nmtv->itemNew.lParam;
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
PathToRelativeT(sd->File, buf);
SetDlgItemText(hwndDlg, IDC_EDIT_SKIN_FILENAME, buf);
- TCHAR prfn[MAX_PATH] = { 0 }, imfn[MAX_PATH] = { 0 }, skinfolder[MAX_PATH] = { 0 };
+ wchar_t prfn[MAX_PATH] = { 0 }, imfn[MAX_PATH] = { 0 }, skinfolder[MAX_PATH] = { 0 };
GetPrivateProfileString(L"Skin_Description_Section", L"Preview", L"", imfn, _countof(imfn), sd->File);
IniParser::GetSkinFolder(sd->File, skinfolder);
mir_sntprintf(prfn, L"%s\\%s", skinfolder, imfn);
@@ -282,8 +282,8 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
if (!sd2)
return 0;
- TCHAR Author[255], URL[MAX_PATH], Contact[255], Description[400], text[2000];
- if (sd2->File && !_tcschr(sd2->File, _T('%'))) {
+ wchar_t Author[255], URL[MAX_PATH], Contact[255], Description[400], text[2000];
+ if (sd2->File && !wcschr(sd2->File, '%')) {
GetPrivateProfileString(L"Skin_Description_Section", L"Author", TranslateT("( unknown )"), Author, _countof(Author), sd2->File);
GetPrivateProfileString(L"Skin_Description_Section", L"URL", L"", URL, _countof(URL), sd2->File);
GetPrivateProfileString(L"Skin_Description_Section", L"Contact", L"", Contact, _countof(Contact), sd2->File);
@@ -325,10 +325,10 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
return 0;
}
-int SearchSkinFiles(HWND hwndDlg, TCHAR * Folder)
+int SearchSkinFiles(HWND hwndDlg, wchar_t * Folder)
{
struct _tfinddata_t fd = { 0 };
- TCHAR mask[MAX_PATH];
+ wchar_t mask[MAX_PATH];
long hFile;
mir_sntprintf(mask, L"%s\\*.msf", Folder);
//fd.attrib = _A_SUBDIR;
@@ -344,7 +344,7 @@ int SearchSkinFiles(HWND hwndDlg, TCHAR * Folder)
{
do {
if (fd.attrib&_A_SUBDIR && !(mir_tstrcmpi(fd.name, L".") == 0 || mir_tstrcmpi(fd.name, L"..") == 0)) {//Next level of subfolders
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
mir_sntprintf(path, L"%s\\%s", Folder, fd.name);
SearchSkinFiles(hwndDlg, path);
}
@@ -366,7 +366,7 @@ HTREEITEM FillAvailableSkinList(HWND hwndDlg)
if (attrib != INVALID_FILE_ATTRIBUTES && (attrib & FILE_ATTRIBUTE_DIRECTORY))
SearchSkinFiles(hwndDlg, SkinsFolder);
{
- TCHAR skinfull[MAX_PATH];
+ wchar_t skinfull[MAX_PATH];
ptrT skinfile(db_get_tsa(NULL, SKIN, "SkinFile"));
if (skinfile) {
PathToAbsoluteT(skinfile, skinfull);
@@ -375,16 +375,16 @@ HTREEITEM FillAvailableSkinList(HWND hwndDlg)
}
return res;
}
-HTREEITEM AddSkinToListFullName(HWND hwndDlg, TCHAR * fullName)
+HTREEITEM AddSkinToListFullName(HWND hwndDlg, wchar_t * fullName)
{
- TCHAR path[MAX_PATH] = { 0 };
- TCHAR file[MAX_PATH] = { 0 };
- TCHAR *buf;
+ wchar_t path[MAX_PATH] = { 0 };
+ wchar_t file[MAX_PATH] = { 0 };
+ wchar_t *buf;
mir_tstrncpy(path, fullName, _countof(path));
buf = path + mir_tstrlen(path);
while (buf > path) {
- if (*buf == _T('\\')) {
- *buf = _T('\0');
+ if (*buf == '\\') {
+ *buf = '\0';
break;
}
buf--;
@@ -395,29 +395,29 @@ HTREEITEM AddSkinToListFullName(HWND hwndDlg, TCHAR * fullName)
}
-HTREEITEM AddSkinToList(HWND hwndDlg, TCHAR * path, TCHAR* file)
+HTREEITEM AddSkinToList(HWND hwndDlg, wchar_t * path, wchar_t* file)
{
- TCHAR fullName[MAX_PATH], defskinname[MAX_PATH];
+ wchar_t fullName[MAX_PATH], defskinname[MAX_PATH];
SkinListData *sd = (SkinListData *)mir_alloc(sizeof(SkinListData));
if (!sd)
return 0;
- if (!file || _tcschr(file, _T('%'))) {
+ if (!file || wcschr(file, '%')) {
mir_sntprintf(sd->File, L"%%Default Skin%%");
mir_sntprintf(sd->Name, TranslateT("%Default Skin%"));
- _tcsncpy_s(fullName, TranslateT("Default Skin"), _TRUNCATE);
+ wcsncpy_s(fullName, TranslateT("Default Skin"), _TRUNCATE);
}
else {
mir_sntprintf(fullName, L"%s\\%s", path, file);
- _tcsncpy_s(defskinname, file, _TRUNCATE);
- TCHAR *p = _tcsrchr(defskinname, '.'); if (p) *p = 0;
+ wcsncpy_s(defskinname, file, _TRUNCATE);
+ wchar_t *p = wcsrchr(defskinname, '.'); if (p) *p = 0;
GetPrivateProfileString(L"Skin_Description_Section", L"Name", defskinname, sd->Name, _countof(sd->Name), fullName);
- _tcsncpy_s(sd->File, fullName, _TRUNCATE);
+ wcsncpy_s(sd->File, fullName, _TRUNCATE);
}
return AddItemToTree(GetDlgItem(hwndDlg, IDC_TREE1), sd->Name, sd);
}
-HTREEITEM FindChild(HWND hTree, HTREEITEM Parent, TCHAR * Caption, void * data)
+HTREEITEM FindChild(HWND hTree, HTREEITEM Parent, wchar_t * Caption, void * data)
{
HTREEITEM tmp = NULL;
if (Parent)
@@ -427,7 +427,7 @@ HTREEITEM FindChild(HWND hTree, HTREEITEM Parent, TCHAR * Caption, void * data)
while (tmp) {
TVITEM tvi;
- TCHAR buf[255];
+ wchar_t buf[255];
tvi.hItem = tmp;
tvi.mask = TVIF_TEXT | TVIF_HANDLE;
tvi.pszText = buf;
@@ -451,7 +451,7 @@ HTREEITEM FindChild(HWND hTree, HTREEITEM Parent, TCHAR * Caption, void * data)
return tmp;
}
-HTREEITEM AddItemToTree(HWND hTree, TCHAR *itemName, void *data)
+HTREEITEM AddItemToTree(HWND hTree, wchar_t *itemName, void *data)
{
HTREEITEM cItem = NULL;
//Insert item node
@@ -473,7 +473,7 @@ INT_PTR SvcActiveSkin(WPARAM, LPARAM)
{
ptrT skinfile(db_get_tsa(NULL, SKIN, "SkinFile"));
if (skinfile) {
- TCHAR skinfull[MAX_PATH];
+ wchar_t skinfull[MAX_PATH];
PathToAbsoluteT(skinfile, skinfull);
return (INT_PTR)mir_tstrdup(skinfull);
}
@@ -483,7 +483,7 @@ INT_PTR SvcActiveSkin(WPARAM, LPARAM)
INT_PTR SvcApplySkin(WPARAM, LPARAM lParam)
{
- ske_LoadSkinFromIniFile((TCHAR *)lParam, FALSE);
+ ske_LoadSkinFromIniFile((wchar_t *)lParam, FALSE);
ske_LoadSkinFromDB();
Clist_Broadcast(INTM_RELOADOPTIONS, 0, 0);
Sync(CLUIFrames_OnClistResize_mod, 0, 0);
@@ -519,9 +519,9 @@ INT_PTR SvcPreviewSkin(WPARAM wParam, LPARAM lParam)
OffsetRect(&workRect, -workRect.left, -workRect.top);
if (lParam) {
- TCHAR prfn[MAX_PATH] = { 0 };
- TCHAR imfn[MAX_PATH] = { 0 };
- TCHAR skinfolder[MAX_PATH] = { 0 };
+ wchar_t prfn[MAX_PATH] = { 0 };
+ wchar_t imfn[MAX_PATH] = { 0 };
+ wchar_t skinfolder[MAX_PATH] = { 0 };
GetPrivateProfileString(L"Skin_Description_Section", L"Preview", L"", imfn, _countof(imfn), (LPCTSTR)lParam);
IniParser::GetSkinFolder((LPCTSTR)lParam, skinfolder);
mir_sntprintf(prfn, L"%s\\%s", skinfolder, imfn);
diff --git a/plugins/Clist_modern/src/modern_skinselector.cpp b/plugins/Clist_modern/src/modern_skinselector.cpp
index 09fbd5b350..d6a4a80fc5 100644
--- a/plugins/Clist_modern/src/modern_skinselector.cpp
+++ b/plugins/Clist_modern/src/modern_skinselector.cpp
@@ -363,10 +363,10 @@ SKINOBJECTDESCRIPTOR* skin_FindObjectByRequest(char *szValue, LISTMODERNMASK *mm
return res;
}
-TCHAR* GetParamNT(char *string, TCHAR *buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces)
+wchar_t* GetParamNT(char *string, wchar_t *buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces)
{
- char *ansibuf = (char*)mir_alloc(buflen / sizeof(TCHAR));
- GetParamN(string, ansibuf, buflen / sizeof(TCHAR), paramN, Delim, SkipSpaces);
+ char *ansibuf = (char*)mir_alloc(buflen / sizeof(wchar_t));
+ GetParamN(string, ansibuf, buflen / sizeof(wchar_t), paramN, Delim, SkipSpaces);
MultiByteToWideChar(CP_UTF8, 0, ansibuf, -1, buf, buflen);
mir_free(ansibuf);
return buf;
@@ -437,7 +437,7 @@ int RegisterButtonByParce(char * ObjectName, char * Params)
int Left, Top, Right, Bottom;
int MinWidth, MinHeight;
char TL[9] = { 0 };
- TCHAR Hint[250] = { 0 };
+ wchar_t Hint[250] = { 0 };
char Section[250] = { 0 };
char Type[250] = { 0 };
diff --git a/plugins/Clist_modern/src/modern_skinselector.h b/plugins/Clist_modern/src/modern_skinselector.h
index 76f39f6ba9..804b97fabb 100644
--- a/plugins/Clist_modern/src/modern_skinselector.h
+++ b/plugins/Clist_modern/src/modern_skinselector.h
@@ -71,6 +71,6 @@ DWORD mod_CalcHash(const char *a);
int RegisterObjectByParce(char *ObjectName, char *Params);
SKINOBJECTDESCRIPTOR* skin_FindObjectByRequest(char *szValue, LISTMODERNMASK *mmTemplateList);
SKINOBJECTDESCRIPTOR* skin_FindObjectByMask(MODERNMASK *mm, LISTMODERNMASK *mmTemplateList);
-TCHAR * GetParamNT(char *string, TCHAR *buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces);
+wchar_t * GetParamNT(char *string, wchar_t *buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces);
int SkinDrawGlyphMask(HDC hdc, RECT *rcSize, RECT *rcClip, MODERNMASK *ModernMask);
#endif
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp
index ade67318a6..f49faaa894 100644
--- a/plugins/Clist_modern/src/modern_statusbar.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar.cpp
@@ -240,7 +240,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
if (p->bShowProtoEmails == 1 && ProtoServiceExists(szProto, PS_GETUNREADEMAILCOUNT)) {
int nEmails = (int)CallProtoService(szProto, PS_GETUNREADEMAILCOUNT, 0, 0);
if (nEmails > 0) {
- TCHAR str[40];
+ wchar_t str[40];
mir_sntprintf(str, L"[%d]", nEmails);
p->szProtoEMailCount = mir_tstrdup(str);
}
@@ -343,7 +343,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
p.extraIcon = NULL;
if ((p.xStatusMode & 8) && p.iProtoStatus > ID_STATUS_OFFLINE) {
- TCHAR str[512];
+ wchar_t str[512];
CUSTOM_STATUS cs = { sizeof(cs) };
cs.flags = CSSF_MASK_NAME | CSSF_TCHAR;
cs.ptszName = str;
@@ -861,7 +861,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
return DefWindowProc(hwnd, msg, wParam, lParam);
}
-TCHAR pluginname[] = L"ModernStatusBar";
+wchar_t pluginname[] = L"ModernStatusBar";
HWND StatusBar_Create(HWND parent)
{
diff --git a/plugins/Clist_modern/src/modern_statusbar_options.cpp b/plugins/Clist_modern/src/modern_statusbar_options.cpp
index 6de1116d5a..44218b6bba 100644
--- a/plugins/Clist_modern/src/modern_statusbar_options.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar_options.cpp
@@ -237,14 +237,14 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
SendDlgItemMessage(hwndDlg, IDC_OFFSETSPIN3, UDM_SETPOS, 0, MAKELONG(db_get_dw(NULL, "CLUI", "SpaceBetween", SETTING_SPACEBETWEEN_DEFAULT), 2));
{
- TCHAR *align[] = { LPGENT("Left"), LPGENT("Center"), LPGENT("Right") };
+ wchar_t *align[] = { LPGENW("Left"), LPGENW("Center"), LPGENW("Right") };
for (int i = 0; i < _countof(align); i++)
SendDlgItemMessage(hwndDlg, IDC_SBAR_HORIZ_ALIGN, CB_ADDSTRING, 0, (LPARAM)TranslateTS(align[i]));
SendDlgItemMessage(hwndDlg, IDC_SBAR_HORIZ_ALIGN, CB_SETCURSEL, db_get_b(NULL, "CLUI", "Align", SETTING_ALIGN_DEFAULT), 0);
}
{
- TCHAR *align[] = { LPGENT("Top"), LPGENT("Center"), LPGENT("Bottom") };
+ wchar_t *align[] = { LPGENW("Top"), LPGENW("Center"), LPGENW("Bottom") };
for (int i = 0; i < _countof(align); i++)
SendDlgItemMessage(hwndDlg, IDC_SBAR_VERT_ALIGN, CB_ADDSTRING, 0, (LPARAM)TranslateTS(align[i]));
SendDlgItemMessage(hwndDlg, IDC_SBAR_VERT_ALIGN, CB_SETCURSEL, db_get_b(NULL, "CLUI", "VAlign", SETTING_VALIGN_DEFAULT), 0);
diff --git a/plugins/Clist_modern/src/modern_tbbutton.cpp b/plugins/Clist_modern/src/modern_tbbutton.cpp
index 34a6339e60..0ea00a70be 100644
--- a/plugins/Clist_modern/src/modern_tbbutton.cpp
+++ b/plugins/Clist_modern/src/modern_tbbutton.cpp
@@ -21,7 +21,7 @@ struct TBBUTTONDATA : public MButtonCtrl
bool bHotMark; // button is hot marked (e.g. current state)
bool bFocused;
int nFontID; // internal font ID
- TCHAR szText[128]; // text on the button
+ wchar_t szText[128]; // text on the button
RECT rcMargins; // margins of inner content
HANDLE hIcolibHandle; // handle of icon in iconlib
@@ -238,7 +238,7 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam
break;
case WM_SETTEXT:
- mir_tstrncpy(bct->szText, (TCHAR*)lParam, _countof(bct->szText));
+ mir_tstrncpy(bct->szText, (wchar_t*)lParam, _countof(bct->szText));
break;
case WM_SETFONT:
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp
index 051ec14f57..7db4523adb 100644
--- a/plugins/Clist_modern/src/modern_toolbar.cpp
+++ b/plugins/Clist_modern/src/modern_toolbar.cpp
@@ -299,7 +299,7 @@ void CustomizeToolbar(HWND hwnd)
static char szUrl[] = "http://miranda-ng.org/p/TopToolBar";
-static TCHAR szWarning[] = LPGENT("To view a toolbar in Clist_modern you need the TopToolBar plugin. Click Yes to download it or No to continue");
+static wchar_t szWarning[] = LPGENW("To view a toolbar in Clist_modern you need the TopToolBar plugin. Click Yes to download it or No to continue");
static void CopySettings(const char* to, const char* from, int defValue)
{
diff --git a/plugins/Clist_modern/src/modern_utils.cpp b/plugins/Clist_modern/src/modern_utils.cpp
index 469836c255..07810bd37f 100644
--- a/plugins/Clist_modern/src/modern_utils.cpp
+++ b/plugins/Clist_modern/src/modern_utils.cpp
@@ -51,7 +51,7 @@ void TRACE_ERROR()
// load small icon (not shared) it IS NEED to be destroyed
HICON LoadSmallIcon(HINSTANCE hInstance, int index)
{
- TCHAR filename[MAX_PATH] = { 0 };
+ wchar_t filename[MAX_PATH] = { 0 };
GetModuleFileName(hInstance, filename, MAX_PATH);
HICON hIcon = NULL;
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp
index 7124d3f4b4..6ce7bd2965 100644
--- a/plugins/Clist_modern/src/modern_viewmodebar.cpp
+++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp
@@ -245,7 +245,7 @@ static int FillDialog(HWND hwnd)
item.pszText = TranslateT("Ungrouped contacts");
SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
- TCHAR *szGroup;
+ wchar_t *szGroup;
for (int i = 1; (szGroup = Clist_GroupGetName(i, NULL)) != NULL; i++) {
item.pszText = szGroup;
SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
@@ -344,7 +344,7 @@ static int DeleteAutoModesCallback(char *szsetting)
}
-void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szProtoFilter, DWORD dwStatusMask, DWORD dwStickyStatusMask,
+void SaveViewMode(const char *name, const wchar_t *szGroupFilter, const char *szProtoFilter, DWORD dwStatusMask, DWORD dwStickyStatusMask,
unsigned int options, unsigned int stickies, unsigned int operators, unsigned int lmdat)
{
CLVM_EnumModes(DeleteAutoModesCallback);
@@ -372,7 +372,7 @@ void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szPr
void SaveState()
{
- TCHAR newGroupFilter[2048] = L"|";
+ wchar_t newGroupFilter[2048] = L"|";
char newProtoFilter[2048] = "|";
DWORD statusMask = 0;
DWORD operators = 0;
@@ -400,7 +400,7 @@ void SaveState()
}
{
LVITEM item = { 0 };
- TCHAR szTemp[256];
+ wchar_t szTemp[256];
HWND hwndList = GetDlgItem(clvmHwnd, IDC_GROUPS);
@@ -430,7 +430,7 @@ void SaveState()
if (iLen) {
unsigned int stickies = 0;
- TCHAR *szTempModeName = (TCHAR*)mir_alloc((iLen + 1)*sizeof(TCHAR));
+ wchar_t *szTempModeName = (wchar_t*)mir_alloc((iLen + 1)*sizeof(wchar_t));
if (szTempModeName) {
SendDlgItemMessage(clvmHwnd, IDC_VIEWMODES, LB_GETTEXT, clvm_curItem, (LPARAM)szTempModeName);
@@ -495,13 +495,13 @@ static void UpdateFilters()
if (iLen == 0)
return;
- TCHAR *szTempBuf = (TCHAR*)_alloca((iLen + 1)*sizeof(TCHAR));
+ wchar_t *szTempBuf = (wchar_t*)_alloca((iLen + 1)*sizeof(wchar_t));
SendDlgItemMessage(clvmHwnd, IDC_VIEWMODES, LB_GETTEXT, clvm_curItem, (LPARAM)szTempBuf);
T2Utf szBuf(szTempBuf);
mir_strncpy(g_szModename, szBuf, _countof(g_szModename));
{
- TCHAR szTemp[100];
+ wchar_t szTemp[100];
mir_sntprintf(szTemp, TranslateT("Configuring view mode: %s"), szTempBuf);
SetDlgItemText(clvmHwnd, IDC_CURVIEWMODE2, szTemp);
}
@@ -547,8 +547,8 @@ static void UpdateFilters()
}
{
LVITEM item = { 0 };
- TCHAR szTemp[256];
- TCHAR szMask[256];
+ wchar_t szTemp[256];
+ wchar_t szMask[256];
int i;
HWND hwndList = GetDlgItem(clvmHwnd, IDC_GROUPS);
@@ -562,7 +562,7 @@ static void UpdateFilters()
item.iItem = i;
SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
mir_sntprintf(szMask, L"%s|", szTemp);
- if (szGF && _tcsstr(szGF, szMask))
+ if (szGF && wcsstr(szGF, szMask))
ListView_SetCheckState(hwndList, i, TRUE)
else
ListView_SetCheckState(hwndList, i, FALSE);
@@ -689,7 +689,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
int index = 0;
if (g_CluiData.current_viewmode[0] != '\0') {
- TCHAR *temp = mir_utf8decodeW(g_CluiData.current_viewmode);
+ wchar_t *temp = mir_utf8decodeW(g_CluiData.current_viewmode);
if (temp) {
index = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_FINDSTRING, -1, (LPARAM)temp);
mir_free(temp);
@@ -753,7 +753,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (MessageBox(0, TranslateT("Really delete this view mode? This cannot be undone"), TranslateT("Delete a view mode"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
int iLen = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETTEXTLEN, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), 0);
if (iLen) {
- TCHAR *szTempBuf = (TCHAR*)_alloca((iLen + 1)*sizeof(TCHAR));
+ wchar_t *szTempBuf = (wchar_t*)_alloca((iLen + 1)*sizeof(wchar_t));
SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETTEXT, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), (LPARAM)szTempBuf);
DeleteViewMode(T2Utf(szTempBuf));
@@ -769,7 +769,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case IDC_ADDVIEWMODE:
{
- TCHAR szBuf[256];
+ wchar_t szBuf[256];
szBuf[0] = 0;
GetDlgItemText(hwndDlg, IDC_NEWVIEMODE, szBuf, _countof(szBuf));
szBuf[255] = 0;
@@ -890,7 +890,7 @@ static int FillMenuCallback(char *szSetting)
if (szSetting[0] == 13)
return 1;
- TCHAR *temp = mir_utf8decodeT(szSetting);
+ wchar_t *temp = mir_utf8decodeT(szSetting);
if (temp) {
AppendMenu(hViewModeMenu, MFT_STRING, menuCounter++, temp);
mir_free(temp);
@@ -1086,7 +1086,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (selection == 10002)
goto clvm_reset_command;
- TCHAR szTemp[256];
+ wchar_t szTemp[256];
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_STRING;
diff --git a/plugins/Clist_modern/src/stdafx.h b/plugins/Clist_modern/src/stdafx.h
index 21abdf4975..814eed1ffa 100644
--- a/plugins/Clist_modern/src/stdafx.h
+++ b/plugins/Clist_modern/src/stdafx.h
@@ -119,7 +119,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "resource.h"
#define DEFAULT_SKIN_FOLDER "Skins\\Modern contact list"
-extern TCHAR SkinsFolder[MAX_PATH];
+extern wchar_t SkinsFolder[MAX_PATH];
//macros to free data and set it pointer to NULL
#define mir_free_and_nil(x) {mir_free((void*)x); x=NULL;}
@@ -224,7 +224,7 @@ int AniAva_InitModule(); // HAVE TO BE AFTER GDI+ INITIALIZED
int AniAva_UnloadModule();
int AniAva_UpdateOptions(); //reload options, //hot enable/disable engine
-int AniAva_AddAvatar(MCONTACT hContact, TCHAR * szFilename, int width, int heigth); // adds avatars to be displayed
+int AniAva_AddAvatar(MCONTACT hContact, wchar_t * szFilename, int width, int heigth); // adds avatars to be displayed
int AniAva_SetAvatarPos(MCONTACT hContact, RECT *rc, int overlayIdx, BYTE bAlpha); // update avatars pos
int AniAva_InvalidateAvatarPositions(MCONTACT hContact); // reset positions of avatars to be drawn (still be painted at same place)
int AniAva_RemoveInvalidatedAvatars(); // all avatars without validated position will be stop painted and probably removed
diff --git a/plugins/Clist_ng/SRC/clcopts.cpp b/plugins/Clist_ng/SRC/clcopts.cpp
index 283c87bd0c..1a1c4b5fda 100644
--- a/plugins/Clist_ng/SRC/clcopts.cpp
+++ b/plugins/Clist_ng/SRC/clcopts.cpp
@@ -548,11 +548,11 @@ INT_PTR CALLBACK cfg::DlgProcDspClasses(HWND hwndDlg, UINT msg, WPARAM wParam, L
{
switch(msg) {
case WM_INITDIALOG:
- SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_INSERTSTRING, -1, (LPARAM)TranslateW(L"Offline contacts"));
- SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_INSERTSTRING, -1, (LPARAM)TranslateW(L"Online contacts"));
- SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_INSERTSTRING, -1, (LPARAM)TranslateW(L"Selected contacts"));
- SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_INSERTSTRING, -1, (LPARAM)TranslateW(L"Hovered contacts"));
- SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_INSERTSTRING, -1, (LPARAM)TranslateW(L"Priority contacts"));
+ SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Offline contacts"));
+ SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Online contacts"));
+ SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Selected contacts"));
+ SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Hovered contacts"));
+ SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Priority contacts"));
SendDlgItemMessage(hwndDlg, IDC_DSPCLASS, CB_SETCURSEL, 0, 0);
break;
diff --git a/plugins/Clist_nicer/src/CLCButton.cpp b/plugins/Clist_nicer/src/CLCButton.cpp
index 047ef84064..fef024d3b1 100644
--- a/plugins/Clist_nicer/src/CLCButton.cpp
+++ b/plugins/Clist_nicer/src/CLCButton.cpp
@@ -102,7 +102,7 @@ int ClcGetButtonId(HWND hwnd)
struct MButtonExtension : public MButtonCtrl
{
HICON hIconPrivate;
- TCHAR szText[128];
+ wchar_t szText[128];
SIZE sLabel;
HIMAGELIST hIml;
int iIcon;
@@ -388,7 +388,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
break;
case WM_SETTEXT:
- _tcsncpy_s(bct->szText, (TCHAR*)lParam, _TRUNCATE);
+ wcsncpy_s(bct->szText, (wchar_t*)lParam, _TRUNCATE);
break;
case BM_GETIMAGE:
diff --git a/plugins/Clist_nicer/src/clc.h b/plugins/Clist_nicer/src/clc.h
index 91b917162f..b083c93a83 100644
--- a/plugins/Clist_nicer/src/clc.h
+++ b/plugins/Clist_nicer/src/clc.h
@@ -94,7 +94,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
typedef struct _OrderTreeData
{
BYTE ID;
- const TCHAR * Name;
+ const wchar_t * Name;
BYTE Position;
BOOL Visible;
BOOL fReserved;
@@ -105,7 +105,7 @@ struct TExtraCache
MCONTACT hContact;
HANDLE hTimeZone;
BYTE valid;
- TCHAR *statusMsg;
+ wchar_t *statusMsg;
BYTE bStatusMsgValid;
DWORD dwCFlags;
DWORD dwDFlags; // display flags for caching only
@@ -274,7 +274,7 @@ struct TCluiData {
BOOL bUsePerProto;
BOOL bOverridePerStatusColors;
BOOL bDontSeparateOffline;
- TCHAR groupFilter[2048];
+ wchar_t groupFilter[2048];
char protoFilter[2048];
char varFilter[2048];
DWORD lastMsgFilter;
@@ -308,7 +308,7 @@ struct TCluiData {
int group_padding;
DWORD t_now;
BOOL realTimeSaving;
- TCHAR tszProfilePath[MAX_PATH];
+ wchar_t tszProfilePath[MAX_PATH];
FILETIME ft;
SYSTEMTIME st;
};
@@ -373,13 +373,13 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM
// clcutils.c
void SetGroupExpand(HWND hwnd, struct ClcData *dat, ClcGroup *group, int newState);
void DoSelectionDefaultAction(HWND hwnd, struct ClcData *dat);
-int FindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int prefixOk);
+int FindRowByText(HWND hwnd, struct ClcData *dat, const wchar_t *text, int prefixOk);
void BeginRenameSelection(HWND hwnd, struct ClcData *dat);
int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **contact, ClcGroup **group, DWORD *flags);
void ScrollTo(HWND hwnd, struct ClcData *dat, int desty, int noSmooth);
void RecalcScrollBar(HWND hwnd, struct ClcData *dat);
-size_t MY_pathToRelative(const TCHAR *pSrc, TCHAR *pOut);
-size_t MY_pathToAbsolute(const TCHAR *pSrc, TCHAR *pOut);
+size_t MY_pathToRelative(const wchar_t *pSrc, wchar_t *pOut);
+size_t MY_pathToAbsolute(const wchar_t *pSrc, wchar_t *pOut);
#define DROPTARGET_OUTSIDE 0
#define DROPTARGET_ONSELF 1
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp
index b6ebeb7cb3..d46f474e20 100644
--- a/plugins/Clist_nicer/src/clcitems.cpp
+++ b/plugins/Clist_nicer/src/clcitems.cpp
@@ -52,14 +52,14 @@ ClcContact* CreateClcContact(void)
return p;
}
-ClcContact* AddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText)
+ClcContact* AddInfoItemToGroup(ClcGroup *group, int flags, const wchar_t *pszText)
{
ClcContact *p = coreCli.pfnAddInfoItemToGroup(group, flags, pszText);
p->avatarLeft = p->extraIconRightBegin = -1;
return p;
}
-ClcGroup *AddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers)
+ClcGroup *AddGroup(HWND hwnd, struct ClcData *dat, const wchar_t *szName, DWORD flags, int groupId, int calcTotalMembers)
{
ClcGroup *p = coreCli.pfnAddGroup(hwnd, dat, szName, flags, groupId, calcTotalMembers);
if (p && p->parent)
@@ -188,13 +188,13 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
if (!result && mir_tstrlen(dbv.ptszVal) > 1) {
size_t iLen = mir_tstrlen(dbv.ptszVal);
p->bStatusMsgValid = STATUSMSG_XSTATUSNAME;
- p->statusMsg = (TCHAR *)realloc(p->statusMsg, (iLen + 2) * sizeof(TCHAR));
- _tcsncpy(p->statusMsg, dbv.ptszVal, iLen + 1);
+ p->statusMsg = (wchar_t *)realloc(p->statusMsg, (iLen + 2) * sizeof(wchar_t));
+ wcsncpy(p->statusMsg, dbv.ptszVal, iLen + 1);
}
else {
int xStatus;
WPARAM xStatus2;
- TCHAR xStatusName[128];
+ wchar_t xStatusName[128];
CUSTOM_STATUS cst = { sizeof(cst) };
cst.flags = CSSF_MASK_STATUS;
@@ -204,9 +204,9 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
cst.wParam = &xStatus2;
cst.ptszName = xStatusName;
if (!CallProtoService(szProto, PS_GETCUSTOMSTATUSEX, hContact, (LPARAM)&cst)) {
- TCHAR *szwXstatusName = TranslateTS(xStatusName);
- p->statusMsg = (TCHAR *)realloc(p->statusMsg, (mir_tstrlen(szwXstatusName) + 2) * sizeof(TCHAR));
- _tcsncpy(p->statusMsg, szwXstatusName, mir_tstrlen(szwXstatusName) + 1);
+ wchar_t *szwXstatusName = TranslateTS(xStatusName);
+ p->statusMsg = (wchar_t *)realloc(p->statusMsg, (mir_tstrlen(szwXstatusName) + 2) * sizeof(wchar_t));
+ wcsncpy(p->statusMsg, szwXstatusName, mir_tstrlen(szwXstatusName) + 1);
p->bStatusMsgValid = STATUSMSG_XSTATUSNAME;
}
}
@@ -215,9 +215,9 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
if (p->bStatusMsgValid > STATUSMSG_XSTATUSNAME) {
int j = 0;
- p->statusMsg = (TCHAR *)realloc(p->statusMsg, (mir_tstrlen(dbv.ptszVal) + 2) * sizeof(TCHAR));
+ p->statusMsg = (wchar_t *)realloc(p->statusMsg, (mir_tstrlen(dbv.ptszVal) + 2) * sizeof(wchar_t));
for (int i = 0; dbv.ptszVal[i]; i++) {
- if (dbv.ptszVal[i] == (TCHAR)0x0d)
+ if (dbv.ptszVal[i] == (wchar_t)0x0d)
continue;
p->statusMsg[j] = dbv.ptszVal[i] == (wchar_t)0x0a ? (wchar_t)' ' : dbv.ptszVal[i];
j++;
@@ -265,7 +265,7 @@ void ReloadExtraInfo(MCONTACT hContact)
void RTL_DetectAndSet(ClcContact *contact, MCONTACT hContact)
{
WORD infoTypeC2[12];
- TCHAR *szText;
+ wchar_t *szText;
TExtraCache *p;
memset(infoTypeC2, 0, sizeof(infoTypeC2));
@@ -409,9 +409,9 @@ int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, struct ClcData
if (cfg::dat.bFilterEffective & CLVM_FILTER_GROUPS) {
ptrT tszGroup(db_get_tsa(hContact, "CList", "Group"));
if (tszGroup != NULL) {
- TCHAR szGroupMask[256];
+ wchar_t szGroupMask[256];
mir_sntprintf(szGroupMask, L"%s|", tszGroup);
- int bHasGroup = _tcsstr(cfg::dat.groupFilter, szGroupMask) ? 1 : 0;
+ int bHasGroup = wcsstr(cfg::dat.groupFilter, szGroupMask) ? 1 : 0;
filterResult = (cfg::dat.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | bHasGroup) : (filterResult & bHasGroup);
}
else if (cfg::dat.filterFlags & CLVM_INCLUDED_UNGROUPED)
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp
index f20f3bb4e6..5d73f252b9 100644
--- a/plugins/Clist_nicer/src/clcopts.cpp
+++ b/plugins/Clist_nicer/src/clcopts.cpp
@@ -62,18 +62,18 @@ struct CheckBoxToGroupStyleEx_t {
struct CheckBoxValues_t {
DWORD style;
- TCHAR *szDescr;
+ wchar_t *szDescr;
};
static const struct CheckBoxValues_t greyoutValues[] = {
- { GREYF_UNFOCUS, LPGENT("Not focused") }, { MODEF_OFFLINE, LPGENT("Offline") }, { PF2_ONLINE, LPGENT("Online") }, { PF2_SHORTAWAY, LPGENT("Away") },
- { PF2_LONGAWAY, LPGENT("Not available") }, { PF2_LIGHTDND, LPGENT("Occupied") }, { PF2_HEAVYDND, LPGENT("Do not disturb") }, { PF2_FREECHAT, LPGENT("Free for chat") },
- { PF2_INVISIBLE, LPGENT("Invisible") }, { PF2_OUTTOLUNCH, LPGENT("Out to lunch") }, { PF2_ONTHEPHONE, LPGENT("On the phone") }
+ { GREYF_UNFOCUS, LPGENW("Not focused") }, { MODEF_OFFLINE, LPGENW("Offline") }, { PF2_ONLINE, LPGENW("Online") }, { PF2_SHORTAWAY, LPGENW("Away") },
+ { PF2_LONGAWAY, LPGENW("Not available") }, { PF2_LIGHTDND, LPGENW("Occupied") }, { PF2_HEAVYDND, LPGENW("Do not disturb") }, { PF2_FREECHAT, LPGENW("Free for chat") },
+ { PF2_INVISIBLE, LPGENW("Invisible") }, { PF2_OUTTOLUNCH, LPGENW("Out to lunch") }, { PF2_ONTHEPHONE, LPGENW("On the phone") }
};
static const struct CheckBoxValues_t offlineValues[] = {
- { MODEF_OFFLINE, LPGENT("Offline") }, { PF2_ONLINE, LPGENT("Online") }, { PF2_SHORTAWAY, LPGENT("Away") }, { PF2_LONGAWAY, LPGENT("Not available") },
- { PF2_LIGHTDND, LPGENT("Occupied") }, { PF2_HEAVYDND, LPGENT("Do not disturb") }, { PF2_FREECHAT, LPGENT("Free for chat") }, { PF2_INVISIBLE, LPGENT("Invisible") },
- { PF2_OUTTOLUNCH, LPGENT("Out to lunch") }, { PF2_ONTHEPHONE, LPGENT("On the phone") }
+ { MODEF_OFFLINE, LPGENW("Offline") }, { PF2_ONLINE, LPGENW("Online") }, { PF2_SHORTAWAY, LPGENW("Away") }, { PF2_LONGAWAY, LPGENW("Not available") },
+ { PF2_LIGHTDND, LPGENW("Occupied") }, { PF2_HEAVYDND, LPGENW("Do not disturb") }, { PF2_FREECHAT, LPGENW("Free for chat") }, { PF2_INVISIBLE, LPGENW("Invisible") },
+ { PF2_OUTTOLUNCH, LPGENW("Out to lunch") }, { PF2_ONTHEPHONE, LPGENW("On the phone") }
};
static UINT sortCtrlIDs[] = { IDC_SORTPRIMARY, IDC_SORTTHEN, IDC_SORTFINALLY, 0 };
@@ -711,7 +711,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
{
DBVARIANT dbv;
if (!db_get_ts(NULL, "CLC", "BkBitmap", &dbv)) {
- TCHAR szPath[MAX_PATH];
+ wchar_t szPath[MAX_PATH];
if (PathToAbsoluteT(dbv.ptszVal, szPath))
SetDlgItemText(hwndDlg, IDC_FILENAME, szPath);
@@ -743,7 +743,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
case WM_COMMAND:
if (LOWORD(wParam) == IDC_BROWSE) {
- TCHAR str[MAX_PATH], filter[512];
+ wchar_t str[MAX_PATH], filter[512];
GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str));
Bitmap_GetFilter(filter, _countof(filter));
diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp
index dd985a65fe..76d2aa23ed 100644
--- a/plugins/Clist_nicer/src/clcpaint.cpp
+++ b/plugins/Clist_nicer/src/clcpaint.cpp
@@ -36,7 +36,7 @@ extern char *im_clients[];
extern HICON im_clienthIcons[];
extern HICON overlayicons[];
-extern TCHAR *statusNames[];
+extern wchar_t *statusNames[];
extern LONG g_cxsmIcon, g_cysmIcon;
@@ -200,7 +200,7 @@ void PaintNotifyArea(HDC hDC, RECT *rc)
rc->left += 26;
int iCount = GetMenuItemCount(cfg::dat.hMenuNotify);
if (cfg::dat.hUpdateContact != 0) {
- TCHAR *szName = pcli->pfnGetContactDisplayName(cfg::dat.hUpdateContact, 0);
+ wchar_t *szName = pcli->pfnGetContactDisplayName(cfg::dat.hUpdateContact, 0);
int iIcon = pcli->pfnGetContactIcon(cfg::dat.hUpdateContact);
ImageList_DrawEx(hCListImages, iIcon, hDC, rc->left, (rc->bottom + rc->top - g_cysmIcon) / 2, g_cxsmIcon, g_cysmIcon, CLR_NONE, CLR_NONE, ILD_NORMAL);
@@ -215,7 +215,7 @@ void PaintNotifyArea(HDC hDC, RECT *rc)
GetMenuItemInfo(cfg::dat.hMenuNotify, iCount - 1, TRUE, &mii);
NotifyMenuItemExData *nmi = (struct NotifyMenuItemExData *) mii.dwItemData;
- TCHAR *szName = pcli->pfnGetContactDisplayName(nmi->hContact, 0);
+ wchar_t *szName = pcli->pfnGetContactDisplayName(nmi->hContact, 0);
int iIcon = pcli->pfnGetContactIcon(nmi->hContact);
ImageList_DrawEx(hCListImages, iIcon, hDC, rc->left, (rc->bottom + rc->top - g_cysmIcon) / 2, g_cxsmIcon, g_cysmIcon, CLR_NONE, CLR_NONE, ILD_NORMAL);
rc->left += 18;
@@ -499,7 +499,7 @@ set_bg_l:
else
ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight);
- TCHAR *szCounts = NULL;
+ wchar_t *szCounts = NULL;
if (type == CLCIT_GROUP) {
GetTextExtentPoint32(hdcMem, contact->szText, (int)mir_tstrlen(contact->szText), &textSize);
int width = textSize.cx;
@@ -1061,7 +1061,7 @@ bgskipped:
}
}
else {
- TCHAR *szText = contact->szText;
+ wchar_t *szText = contact->szText;
rcContent.top = y + ((rowHeight - fontHeight) >> 1);
@@ -1103,7 +1103,7 @@ bgskipped:
RECT rc2 = rcContent;
int fHeight = 0;
- TCHAR szResult[80];
+ wchar_t szResult[80];
if (TimeZone_PrintDateTime(cEntry->hTimeZone, L"t", szResult, _countof(szResult), 0))
goto nodisplay;
diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp
index 626d421ae6..576642bf86 100644
--- a/plugins/Clist_nicer/src/clcutils.cpp
+++ b/plugins/Clist_nicer/src/clcutils.cpp
@@ -35,7 +35,7 @@ extern int /*g_isConnecting,*/ during_sizing;
extern void ( *saveRecalcScrollBar )(HWND hwnd, struct ClcData *dat);
-static int MY_pathIsAbsolute(const TCHAR *path)
+static int MY_pathIsAbsolute(const wchar_t *path)
{
if (!path || !(mir_tstrlen(path) > 2))
return 0;
@@ -46,7 +46,7 @@ static int MY_pathIsAbsolute(const TCHAR *path)
return 0;
}
-size_t MY_pathToRelative(const TCHAR *pSrc, TCHAR *pOut)
+size_t MY_pathToRelative(const wchar_t *pSrc, wchar_t *pOut)
{
size_t dwSrcLen, dwProfilePathLen;
@@ -58,25 +58,25 @@ size_t MY_pathToRelative(const TCHAR *pSrc, TCHAR *pOut)
if (!MY_pathIsAbsolute(pSrc))
goto path_not_abs;
- TCHAR szTmp[MAX_PATH];
- memcpy(szTmp, pSrc, (dwSrcLen * sizeof(TCHAR)));
+ wchar_t szTmp[MAX_PATH];
+ memcpy(szTmp, pSrc, (dwSrcLen * sizeof(wchar_t)));
szTmp[dwSrcLen] = 0;
- _tcslwr(szTmp);
- if (_tcsstr(szTmp, cfg::dat.tszProfilePath)) {
+ wcslwr(szTmp);
+ if (wcsstr(szTmp, cfg::dat.tszProfilePath)) {
dwProfilePathLen = mir_tstrlen(cfg::dat.tszProfilePath);
- memcpy(pOut, (pSrc + (dwProfilePathLen - 1)), ((dwSrcLen - (dwProfilePathLen - 1)) * sizeof(TCHAR)));
+ memcpy(pOut, (pSrc + (dwProfilePathLen - 1)), ((dwSrcLen - (dwProfilePathLen - 1)) * sizeof(wchar_t)));
pOut[0] = '.';
pOut[dwSrcLen] = 0;
return (dwSrcLen - (dwProfilePathLen - 1));
}
path_not_abs:
- memcpy(pOut, pSrc, (dwSrcLen * sizeof(TCHAR)));
+ memcpy(pOut, pSrc, (dwSrcLen * sizeof(wchar_t)));
pOut[dwSrcLen] = 0;
return dwSrcLen;
}
-size_t MY_pathToAbsolute(const TCHAR *pSrc, TCHAR *pOut)
+size_t MY_pathToAbsolute(const wchar_t *pSrc, wchar_t *pOut)
{
size_t dwSrcLen;
@@ -87,7 +87,7 @@ size_t MY_pathToAbsolute(const TCHAR *pSrc, TCHAR *pOut)
return 0;
if (MY_pathIsAbsolute(pSrc) && pSrc[0] != '.') {
- memcpy(pOut, pSrc, (dwSrcLen * sizeof(TCHAR)));
+ memcpy(pOut, pSrc, (dwSrcLen * sizeof(wchar_t)));
pOut[dwSrcLen] = 0;
return dwSrcLen;
}
@@ -167,7 +167,7 @@ int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, ClcContact *hitcontac
GetTextExtentPoint32(hdc, hitcontact->szText, (int)mir_tstrlen(hitcontact->szText), &textSize);
width = textSize.cx;
if (hitcontact->type == CLCIT_GROUP) {
- TCHAR *szCounts;
+ wchar_t *szCounts;
szCounts = pcli->pfnGetGroupCountsText(dat, hitcontact);
if (szCounts[0]) {
GetTextExtentPoint32(hdc, L" ", 1, &textSize);
@@ -308,7 +308,7 @@ int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **c
GetTextExtentPoint32(hdc, hitcontact->szText, (int)mir_tstrlen(hitcontact->szText), &textSize);
width = textSize.cx;
if (hitcontact->type == CLCIT_GROUP) {
- TCHAR *szCounts;
+ wchar_t *szCounts;
szCounts = pcli->pfnGetGroupCountsText(dat, hitcontact);
if (szCounts[0]) {
GetTextExtentPoint32(hdc, L" ", 1, &textSize);
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp
index 34ec1b17dd..6a504da5b3 100644
--- a/plugins/Clist_nicer/src/clistevents.cpp
+++ b/plugins/Clist_nicer/src/clistevents.cpp
@@ -254,14 +254,14 @@ CListEvent* AddEvent(CLISTEVENT *cle)
}
char *szProto = GetContactProto(p->hContact);
- TCHAR *szName = pcli->pfnGetContactDisplayName(p->hContact, 0);
+ wchar_t *szName = pcli->pfnGetContactDisplayName(p->hContact, 0);
if (szProto && szName) {
NotifyMenuItemExData *nmi = (NotifyMenuItemExData*)malloc(sizeof(NotifyMenuItemExData));
if (nmi) {
- TCHAR szBuffer[128];
- TCHAR* szStatus = pcli->pfnGetStatusModeDescription(db_get_w(p->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
+ wchar_t szBuffer[128];
+ wchar_t* szStatus = pcli->pfnGetStatusModeDescription(db_get_w(p->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
- TCHAR szwProto[64];
+ wchar_t szwProto[64];
MultiByteToWideChar(CP_ACP, 0, szProto, -1, szwProto, 64);
szwProto[63] = 0;
mir_sntprintf(szBuffer, L"%s: %s (%s)", szwProto, szName, szStatus);
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp
index 7e74dbd6b2..94cfbf6e52 100644
--- a/plugins/Clist_nicer/src/clistmenus.cpp
+++ b/plugins/Clist_nicer/src/clistmenus.cpp
@@ -98,7 +98,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
return FALSE;
}
else {
- TCHAR szTitle[512];
+ wchar_t szTitle[512];
DWORD dwFlags = db_get_dw(hContact, "CList", "CLN_Flags", 0);
BYTE bSecondLine = db_get_b(hContact, "CList", "CLN_2ndline", -1);
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp
index 8041d1dda3..954d08a5bd 100644
--- a/plugins/Clist_nicer/src/clui.cpp
+++ b/plugins/Clist_nicer/src/clui.cpp
@@ -60,7 +60,7 @@ static BYTE old_cliststate, show_on_first_autosize = FALSE;
RECT cluiPos;
-TCHAR *statusNames[12];
+wchar_t *statusNames[12];
extern LRESULT CALLBACK EventAreaWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
extern HANDLE hNotifyFrame;
@@ -160,7 +160,7 @@ static int FS_FontsChanged(WPARAM, LPARAM)
// last frame of all.
static HWND PreCreateCLC(HWND parent)
{
- pcli->hwndContactTree = CreateWindow(_T(CLISTCONTROL_CLASS), L"",
+ pcli->hwndContactTree = CreateWindow(CLISTCONTROL_CLASSW, L"",
WS_CHILD | CLS_CONTACTLIST
| (db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0)
| (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CLS_HIDEOFFLINE : 0)
@@ -256,7 +256,7 @@ static void InitIcoLib()
char szBuffer[128];
mir_snprintf(szBuffer, "cln_ovl_%d", ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE));
IconItemT icon = { pcli->pfnGetStatusModeDescription(ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE), 0), szBuffer, i };
- Icon_RegisterT(g_hInst, LPGENT("Contact list") L"/" LPGENT("Overlay icons"), &icon, 1);
+ Icon_RegisterT(g_hInst, LPGENW("Contact list") L"/" LPGENW("Overlay icons"), &icon, 1);
}
PROTOACCOUNT **accs = NULL;
@@ -266,10 +266,10 @@ static void InitIcoLib()
if (!Proto_IsAccountEnabled(accs[k]) || CallProtoService(accs[k]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
continue;
- TCHAR szDescr[128];
+ wchar_t szDescr[128];
mir_sntprintf(szDescr, TranslateT("%s connecting"), accs[k]->tszAccountName);
IconItemT icon = { szDescr, "conn", IDI_PROTOCONNECTING };
- Icon_RegisterT(g_hInst, LPGENT("Contact list") L"/" LPGENT("Connecting icons"), &icon, 1, accs[k]->szModuleName);
+ Icon_RegisterT(g_hInst, LPGENW("Contact list") L"/" LPGENW("Connecting icons"), &icon, 1, accs[k]->szModuleName);
}
}
@@ -1415,7 +1415,7 @@ skipbg:
if (!contactOK)
MessageBox(0, TranslateT("The requested action requires a valid contact selection. Please select a contact from the contact list and repeat."), TranslateT("Parameter mismatch"), MB_OK);
if (serviceFailure) {
- TCHAR szError[512];
+ wchar_t szError[512];
mir_sntprintf(szError, TranslateT("The service %S specified by the %S button definition was not found. You may need to install additional plugins."), item->szService, item->szName);
MessageBox(NULL, szError, TranslateT("Service failure"), MB_OK);
}
@@ -1706,7 +1706,7 @@ buttons_done:
}
if (showOpts & 2) {
- TCHAR szName[64];
+ wchar_t szName[64];
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (pa) {
mir_tstrncpy(szName, pa->tszAccountName, _countof(szName));
@@ -1722,7 +1722,7 @@ buttons_done:
x += textSize.cx;
}
if (showOpts & 4) {
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
GetTextExtentPoint32(dis->hDC, szStatus, (int)mir_tstrlen(szStatus), &textSize);
TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szStatus, (int)mir_tstrlen(szStatus));
}
@@ -1825,7 +1825,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
SendDlgItemMessage(hwndDlg, IDC_VERSION, WM_SETFONT, (WPARAM)hFont, 0);
}
{
- TCHAR str[64];
+ wchar_t str[64];
DWORD v = pluginInfo.version;
mir_sntprintf(str, L"%s %d.%d.%d.%d", TranslateT("Version"), HIBYTE(HIWORD(v)), LOBYTE(HIWORD(v)), HIBYTE(LOWORD(v)), LOBYTE(LOWORD(v)));
SetDlgItemText(hwndDlg, IDC_VERSION, str);
@@ -1962,29 +1962,29 @@ void OnCreateClc()
struct
{
- const TCHAR *tszName;
+ const wchar_t *tszName;
int iMask;
}
static clistFontDescr[] =
{
- { LPGENT("Standard contacts"), FIDF_CLASSGENERAL },
- { LPGENT("Online contacts to whom you have a different visibility"), FIDF_CLASSGENERAL },
- { LPGENT("Offline contacts"), FIDF_CLASSGENERAL },
- { LPGENT("Contacts which are 'not on list'"), FIDF_CLASSGENERAL },
- { LPGENT("Groups"), FIDF_CLASSHEADER },
- { LPGENT("Group member counts"), FIDF_CLASSHEADER },
- { LPGENT("Dividers"), FIDF_CLASSSMALL },
- { LPGENT("Offline contacts to whom you have a different visibility"), FIDF_CLASSGENERAL },
- { LPGENT("Status mode"), FIDF_CLASSGENERAL },
- { LPGENT("Frame titles"), FIDF_CLASSGENERAL },
- { LPGENT("Event area"), FIDF_CLASSGENERAL },
- { LPGENT("Contact list local time"), FIDF_CLASSGENERAL }
+ { LPGENW("Standard contacts"), FIDF_CLASSGENERAL },
+ { LPGENW("Online contacts to whom you have a different visibility"), FIDF_CLASSGENERAL },
+ { LPGENW("Offline contacts"), FIDF_CLASSGENERAL },
+ { LPGENW("Contacts which are 'not on list'"), FIDF_CLASSGENERAL },
+ { LPGENW("Groups"), FIDF_CLASSHEADER },
+ { LPGENW("Group member counts"), FIDF_CLASSHEADER },
+ { LPGENW("Dividers"), FIDF_CLASSSMALL },
+ { LPGENW("Offline contacts to whom you have a different visibility"), FIDF_CLASSGENERAL },
+ { LPGENW("Status mode"), FIDF_CLASSGENERAL },
+ { LPGENW("Frame titles"), FIDF_CLASSGENERAL },
+ { LPGENW("Event area"), FIDF_CLASSGENERAL },
+ { LPGENW("Contact list local time"), FIDF_CLASSGENERAL }
};
void FS_RegisterFonts()
{
FontIDT fid = { sizeof(fid) };
- _tcsncpy(fid.group, LPGENT("Contact list"), _countof(fid.group));
+ wcsncpy(fid.group, LPGENW("Contact list"), _countof(fid.group));
strncpy(fid.dbSettingsGroup, "CLC", 5);
fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS | FIDF_APPENDNAME | FIDF_SAVEPOINTSIZE;
@@ -1994,7 +1994,7 @@ void FS_RegisterFonts()
pcli->pfnGetFontSetting(i, &lf, &fid.deffontsettings.colour);
lf.lfHeight = -MulDiv(lf.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
- _tcsncpy_s(fid.deffontsettings.szFace, lf.lfFaceName, _TRUNCATE);
+ wcsncpy_s(fid.deffontsettings.szFace, lf.lfFaceName, _TRUNCATE);
fid.deffontsettings.charset = lf.lfCharSet;
fid.deffontsettings.size = (char)lf.lfHeight;
fid.deffontsettings.style = (lf.lfWeight >= FW_BOLD ? DBFONTF_BOLD : 0) | (lf.lfItalic ? DBFONTF_ITALIC : 0);
@@ -2002,7 +2002,7 @@ void FS_RegisterFonts()
fid.flags &= ~FIDF_CLASSMASK;
fid.flags |= clistFontDescr[i].iMask;
- _tcsncpy(fid.name, clistFontDescr[i].tszName, _countof(fid.name));
+ wcsncpy(fid.name, clistFontDescr[i].tszName, _countof(fid.name));
char idstr[10];
mir_snprintf(idstr, "Font%d", i);
@@ -2019,32 +2019,32 @@ void FS_RegisterFonts()
strncpy(colourid.dbSettingsGroup, "CLC", sizeof(colourid.dbSettingsGroup));
strncpy(colourid.setting, "BkColour", sizeof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Background"), _countof(colourid.name));
- _tcsncpy(colourid.group, LPGENT("Contact list"), _countof(colourid.group));
+ wcsncpy(colourid.name, LPGENW("Background"), _countof(colourid.name));
+ wcsncpy(colourid.group, LPGENW("Contact list"), _countof(colourid.group));
colourid.defcolour = CLCDEFAULT_BKCOLOUR;
ColourRegisterT(&colourid);
strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Selected text"), _countof(colourid.name));
+ wcsncpy(colourid.name, LPGENW("Selected text"), _countof(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_SELTEXTCOLOUR;
ColourRegisterT(&colourid);
strncpy(colourid.setting, "HotTextColour", sizeof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Hottrack text"), _countof(colourid.name));
+ wcsncpy(colourid.name, LPGENW("Hottrack text"), _countof(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_HOTTEXTCOLOUR;
ColourRegisterT(&colourid);
strncpy(colourid.setting, "QuickSearchColour", sizeof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Quicksearch text"), _countof(colourid.name));
+ wcsncpy(colourid.name, LPGENW("Quicksearch text"), _countof(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_QUICKSEARCHCOLOUR;
ColourRegisterT(&colourid);
strncpy(colourid.dbSettingsGroup, "CLUI", sizeof(colourid.dbSettingsGroup));
strncpy(colourid.setting, "clr_frameborder", sizeof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Embedded frames border"), _countof(colourid.name));
+ wcsncpy(colourid.name, LPGENW("Embedded frames border"), _countof(colourid.name));
colourid.order = 1;
colourid.defcolour = RGB(40, 40, 40);
ColourRegisterT(&colourid);
diff --git a/plugins/Clist_nicer/src/cluiframes.cpp b/plugins/Clist_nicer/src/cluiframes.cpp
index 2a5fe5eca6..53e2692258 100644
--- a/plugins/Clist_nicer/src/cluiframes.cpp
+++ b/plugins/Clist_nicer/src/cluiframes.cpp
@@ -1348,7 +1348,7 @@ static int CLUIFramesLoadMainMenu()
FRAMEWND &F = Frames[i];
mi.hIcolibItem = F.TitleBar.hicon;
mi.position = separator;
- mi.name.t = F.TitleBar.tbname ? F.TitleBar.tbname : F.name;
+ mi.name.w = F.TitleBar.tbname ? F.TitleBar.tbname : F.name;
mi.pszService = 0;
g_frameMenus.insert(F.MenuHandles.MainMenuItem = Menu_AddMainMenuItem(&mi));
CLUIFramesCreateMenuForFrame(F.id, F.MenuHandles.MainMenuItem, separator, true);
@@ -1597,7 +1597,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM)
Frames[nFramescount].dwFlags = clfrm->Flags;
if (clfrm->name == NULL || ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->wname) : mir_strlen(clfrm->name)) == 0) {
- TCHAR ptszClassName[256];
+ wchar_t ptszClassName[256];
GetClassName(Frames[nFramescount].hWnd, ptszClassName, _countof(ptszClassName));
Frames[nFramescount].name = mir_tstrdup(ptszClassName);
}
@@ -2892,7 +2892,7 @@ INT_PTR CLUIFrameSetFloat(WPARAM wParam, LPARAM lParam)
return 0;
}
-TCHAR g_ptszEventName[100];
+wchar_t g_ptszEventName[100];
static int CLUIFrameOnModulesLoad(WPARAM, LPARAM)
{
diff --git a/plugins/Clist_nicer/src/cluiopts.cpp b/plugins/Clist_nicer/src/cluiopts.cpp
index dec092b6a9..fe8f5e380f 100644
--- a/plugins/Clist_nicer/src/cluiopts.cpp
+++ b/plugins/Clist_nicer/src/cluiopts.cpp
@@ -233,7 +233,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
else
SetMenu(pcli->hwndContactList, pcli->hMenuMain);
- TCHAR title[256];
+ wchar_t title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
db_set_ts(NULL, "CList", "TitleText", title);
SetWindowText(pcli->hwndContactList, title);
diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp
index 9a80fdd757..826fcdfcab 100644
--- a/plugins/Clist_nicer/src/cluiservices.cpp
+++ b/plugins/Clist_nicer/src/cluiservices.cpp
@@ -111,7 +111,7 @@ void CluiProtocolStatusChanged(int, const char*)
else {
SIZE textSize;
BYTE showOpts = db_get_b(NULL, "CLUI", "SBarShow", 1);
- TCHAR szName[32];
+ wchar_t szName[32];
HDC hdc = GetDC(NULL);
HFONT hofont = reinterpret_cast<HFONT>(SelectObject(hdc, (HFONT)SendMessage(pcli->hwndStatus, WM_GETFONT, 0, 0)));
@@ -139,7 +139,7 @@ void CluiProtocolStatusChanged(int, const char*)
x += textSize.cx + GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
}
if (showOpts & 4) {
- TCHAR* modeDescr = pcli->pfnGetStatusModeDescription(CallProtoService(accs[i]->szModuleName, PS_GETSTATUS, 0, 0), 0);
+ wchar_t* modeDescr = pcli->pfnGetStatusModeDescription(CallProtoService(accs[i]->szModuleName, PS_GETSTATUS, 0, 0), 0);
GetTextExtentPoint32(hdc, modeDescr, (int)mir_tstrlen(modeDescr), &textSize);
x += textSize.cx + GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
}
@@ -219,7 +219,7 @@ void CluiProtocolStatusChanged(int, const char*)
* and uses timer based sort and redraw handling. This can improve performance
* when connecting multiple protocols significantly.
*/
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
/*
* set the global status icon and display the global (most online) status mode on the
diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp
index 4195d5fe63..663e4dadef 100644
--- a/plugins/Clist_nicer/src/config.cpp
+++ b/plugins/Clist_nicer/src/config.cpp
@@ -42,7 +42,7 @@ EXCEPTION_RECORD API::exRecord = { 0 };
CONTEXT API::exCtx = { 0 };
LRESULT API::exLastResult = 0;
char API::exSzFile[MAX_PATH] = "";
-TCHAR API::exReason[256] = L"";
+wchar_t API::exReason[256] = L"";
int API::exLine = 0;
bool API::exAllowContinue = false;
HMODULE API::hDwm = 0;
@@ -193,7 +193,7 @@ void API::Ex_Handler()
ExitProcess(1);
}
-int API::Ex_ShowDialog(EXCEPTION_POINTERS *ep, const char *szFile, int line, TCHAR* szReason, bool fAllowContinue)
+int API::Ex_ShowDialog(EXCEPTION_POINTERS *ep, const char *szFile, int line, wchar_t* szReason, bool fAllowContinue)
{
char szDrive[MAX_PATH], szDir[MAX_PATH], szName[MAX_PATH], szExt[MAX_PATH];
@@ -230,9 +230,9 @@ void TSAPI Utils::showDlgControl(const HWND hwnd, UINT id, int showCmd)
*
* return 0 and throw an exception if something goes wrong.
*/
-HMODULE Utils::loadSystemLibrary(const TCHAR* szFilename, bool useGetHandle)
+HMODULE Utils::loadSystemLibrary(const wchar_t* szFilename, bool useGetHandle)
{
- TCHAR sysPathName[MAX_PATH + 2];
+ wchar_t sysPathName[MAX_PATH + 2];
HMODULE _h = 0;
try {
@@ -258,16 +258,16 @@ HMODULE Utils::loadSystemLibrary(const TCHAR* szFilename, bool useGetHandle)
return (_h);
}
-CRTException::CRTException(const char *szMsg, const TCHAR *szParam) : std::runtime_error(std::string(szMsg))
+CRTException::CRTException(const char *szMsg, const wchar_t *szParam) : std::runtime_error(std::string(szMsg))
{
mir_sntprintf(m_szParam, MAX_PATH, szParam);
}
void CRTException::display() const
{
- TCHAR *tszMsg = mir_a2t(what());
+ wchar_t *tszMsg = mir_a2t(what());
- TCHAR tszBoxMsg[500];
+ wchar_t tszBoxMsg[500];
mir_sntprintf(tszBoxMsg, L"%s\n\n(%s)", tszMsg, m_szParam);
::MessageBox(0, tszBoxMsg, L"Clist_nicer runtime error", MB_OK | MB_ICONERROR);
mir_free(tszMsg);
diff --git a/plugins/Clist_nicer/src/config.h b/plugins/Clist_nicer/src/config.h
index 327353432e..581d01b0be 100644
--- a/plugins/Clist_nicer/src/config.h
+++ b/plugins/Clist_nicer/src/config.h
@@ -38,13 +38,13 @@ typedef HRESULT (WINAPI *pfnDwmIsCompositionEnabled_t)(BOOL *);
class CRTException : public std::runtime_error
{
public:
- CRTException(const char *szMsg, const TCHAR *szParam);
+ CRTException(const char *szMsg, const wchar_t *szParam);
~CRTException() {}
void display() const;
private:
- TCHAR m_szParam[MAX_PATH];
+ wchar_t m_szParam[MAX_PATH];
};
class cfg
@@ -80,7 +80,7 @@ public:
static void Ex_CopyEditToClipboard (HWND hWnd);
static INT_PTR CALLBACK Ex_DlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
static void Ex_Handler ();
- static int Ex_ShowDialog (EXCEPTION_POINTERS *ep, const char *szFile, int line, TCHAR* szReason, bool fAllowContinue);
+ static int Ex_ShowDialog (EXCEPTION_POINTERS *ep, const char *szFile, int line, wchar_t* szReason, bool fAllowContinue);
static pfnDwmExtendFrameIntoClientArea_t pfnDwmExtendFrameIntoClientArea;
static pfnDwmIsCompositionEnabled_t pfnDwmIsCompositionEnabled;
@@ -92,7 +92,7 @@ public:
static CONTEXT exCtx;
static LRESULT exLastResult;
static char exSzFile[MAX_PATH];
- static TCHAR exReason[256];
+ static wchar_t exReason[256];
static int exLine;
static bool exAllowContinue;
@@ -105,7 +105,7 @@ class Utils
public:
static void TSAPI enableDlgControl(const HWND hwnd, UINT id, BOOL fEnable);
static void TSAPI showDlgControl(const HWND hwnd, UINT id, int showCmd);
- static HMODULE loadSystemLibrary(const TCHAR* szFilename, bool useGetHandle = false);
+ static HMODULE loadSystemLibrary(const wchar_t* szFilename, bool useGetHandle = false);
};
diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp
index cd8a3d8f93..04bf2fc34d 100644
--- a/plugins/Clist_nicer/src/contact.cpp
+++ b/plugins/Clist_nicer/src/contact.cpp
@@ -101,7 +101,7 @@ static void MF_CalcFrequency(MCONTACT hContact, DWORD dwCutoffDays, int doSleep)
db_set_dw(hContact, "CList", "mf_count", eventCount);
}
-extern TCHAR g_ptszEventName[];
+extern wchar_t g_ptszEventName[];
void MF_UpdateThread(LPVOID)
{
@@ -158,7 +158,7 @@ int __forceinline GetProtoIndex(char * szName)
int __forceinline INTSORT_CompareContacts(const ClcContact* c1, const ClcContact* c2, UINT bywhat)
{
- TCHAR *namea, *nameb;
+ wchar_t *namea, *nameb;
int statusa, statusb;
char *szProto1, *szProto2;
int rc;
@@ -201,8 +201,8 @@ int __forceinline INTSORT_CompareContacts(const ClcContact* c1, const ClcContact
switch (bywhat) {
case SORTBY_NAME:
- namea = (TCHAR *)c1->szText;
- nameb = (TCHAR *)c2->szText;
+ namea = (wchar_t *)c1->szText;
+ nameb = (wchar_t *)c2->szText;
return CompareString(LOCALE_USER_DEFAULT, NORM_IGNORECASE, namea, -1, nameb, -1) - 2;
case SORTBY_LASTMSG:
diff --git a/plugins/Clist_nicer/src/coolsblib.cpp b/plugins/Clist_nicer/src/coolsblib.cpp
index 3dc6705d9a..61da1b3567 100644
--- a/plugins/Clist_nicer/src/coolsblib.cpp
+++ b/plugins/Clist_nicer/src/coolsblib.cpp
@@ -31,7 +31,7 @@
#include "userdefs.h"
#include "coolsb_internal.h"
-static TCHAR szPropStr[] = L"CoolSBSubclassPtr";
+static wchar_t szPropStr[] = L"CoolSBSubclassPtr";
LRESULT CALLBACK CoolSBWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp
index 325330056c..5ed6ee4347 100644
--- a/plugins/Clist_nicer/src/extBackg.cpp
+++ b/plugins/Clist_nicer/src/extBackg.cpp
@@ -1169,10 +1169,10 @@ void IMG_LoadItems()
if (db_get_ts(NULL, "CLC", "AdvancedSkin", &dbv))
return;
- TCHAR tszFileName[MAX_PATH];
+ wchar_t tszFileName[MAX_PATH];
MY_pathToAbsolute(dbv.ptszVal, tszFileName);
- // TODO: rewrite the skin loading in TCHAR manner
+ // TODO: rewrite the skin loading in wchar_t manner
char szFileName[MAX_PATH];
WideCharToMultiByte(CP_ACP, 0, tszFileName, MAX_PATH, szFileName, MAX_PATH, 0, 0);
@@ -1221,7 +1221,7 @@ void IMG_LoadItems()
CoolSB_SetupScrollBar();
}
-void LoadPerContactSkins(TCHAR *tszFileName)
+void LoadPerContactSkins(wchar_t *tszFileName)
{
char szItem[100];
ptrA szSections(LPSTR(calloc(3002, 1)));
@@ -1441,7 +1441,7 @@ void extbk_import(char *file, HWND hwndDlg)
static void ApplyCLUISkin()
{
DBVARIANT dbv = { 0 };
- TCHAR tszFinalName[MAX_PATH];
+ wchar_t tszFinalName[MAX_PATH];
char szFinalName[MAX_PATH];
if (!db_get_ts(NULL, "CLC", "AdvancedSkin", &dbv)) {
MY_pathToAbsolute(dbv.ptszVal, tszFinalName);
@@ -1524,7 +1524,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
case IDC_SELECTSKINFILE:
{
OPENFILENAME ofn = { 0 };
- TCHAR str[MAX_PATH] = L"*.clist", final_path[MAX_PATH];
+ wchar_t str[MAX_PATH] = L"*.clist", final_path[MAX_PATH];
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwndDlg;
@@ -1562,7 +1562,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
break;
case IDC_RELOAD:
- TCHAR tszFilename[MAX_PATH], tszFinalPath[MAX_PATH];
+ wchar_t tszFilename[MAX_PATH], tszFinalPath[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_SKINFILE, tszFilename, _countof(tszFilename));
tszFilename[MAX_PATH - 1] = 0;
MY_pathToAbsolute(tszFilename, tszFinalPath);
diff --git a/plugins/Clist_nicer/src/extBackg.h b/plugins/Clist_nicer/src/extBackg.h
index 607ac3dc17..474107b05a 100644
--- a/plugins/Clist_nicer/src/extBackg.h
+++ b/plugins/Clist_nicer/src/extBackg.h
@@ -71,14 +71,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
BOOL CheckItem(int item, HWND hwndDlg);
BOOL isValidItem(void);
-void extbk_export(const TCHAR *file);
-void extbk_import(const TCHAR *file, HWND hwndDlg);
+void extbk_export(const wchar_t *file);
+void extbk_import(const wchar_t *file, HWND hwndDlg);
void LoadExtBkSettingsFromDB();
void IMG_LoadItems();
void __fastcall IMG_RenderImageItem(HDC hdc, ImageItem *item, RECT *rc);
void IMG_InitDecoder();
-void LoadPerContactSkins(const TCHAR *file);
+void LoadPerContactSkins(const wchar_t *file);
static void SaveCompleteStructToDB();
StatusItems_t *GetProtocolStatusItem(const char *szProto);
diff --git a/plugins/Clist_nicer/src/groupmenu.cpp b/plugins/Clist_nicer/src/groupmenu.cpp
index ca819a8c44..fe5c5177f9 100644
--- a/plugins/Clist_nicer/src/groupmenu.cpp
+++ b/plugins/Clist_nicer/src/groupmenu.cpp
@@ -80,12 +80,12 @@ static int OnBuildGroupMenu(WPARAM, LPARAM)
}
IconItemT iconItem[] = {
- { LPGENT("Contact list"), "clist", IDI_CLIST }
+ { LPGENW("Contact list"), "clist", IDI_CLIST }
};
void InitIconLibMenuIcons(void)
{
- Icon_RegisterT(g_hInst, LPGENT("Contact list"), iconItem, _countof(iconItem));
+ Icon_RegisterT(g_hInst, LPGENW("Contact list"), iconItem, _countof(iconItem));
}
void InitGroupMenus(void)
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp
index 27b7742c62..07397d6c33 100644
--- a/plugins/Clist_nicer/src/init.cpp
+++ b/plugins/Clist_nicer/src/init.cpp
@@ -50,10 +50,10 @@ int ShowHide(WPARAM wParam, LPARAM lParam);
int ClcShutdown(WPARAM wParam, LPARAM lParam);
CListEvent* AddEvent(CLISTEVENT *cle);
-ClcGroup* AddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers);
+ClcGroup* AddGroup(HWND hwnd, struct ClcData *dat, const wchar_t *szName, DWORD flags, int groupId, int calcTotalMembers);
ClcContact* AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hContact);
-ClcContact* AddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText);
+ClcContact* AddInfoItemToGroup(ClcGroup *group, int flags, const wchar_t *pszText);
LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
int RemoveEvent(MCONTACT hContact, MEVENT hDbEvent);
INT_PTR TrayIconProcessMessage(WPARAM wParam, LPARAM lParam);
@@ -183,7 +183,7 @@ extern "C" int __declspec(dllexport) CListInitialise()
cfg::dat.soundsOff = db_get_b(NULL, "Skin", "UseSound", 1) ? 0 : 1;
CallService(MS_DB_GETPROFILEPATHT, MAX_PATH, (LPARAM)cfg::dat.tszProfilePath);
- _tcslwr(cfg::dat.tszProfilePath);
+ wcslwr(cfg::dat.tszProfilePath);
// get the clist interface
pcli->hInst = g_hInst;
diff --git a/plugins/Clist_nicer/src/statusbar.cpp b/plugins/Clist_nicer/src/statusbar.cpp
index 8f127b3bd0..6484ccba6a 100644
--- a/plugins/Clist_nicer/src/statusbar.cpp
+++ b/plugins/Clist_nicer/src/statusbar.cpp
@@ -159,7 +159,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
WORD wStatus = (WORD)CallProtoService(PD->RealName, PS_GETSTATUS, 0, 0);
BYTE isLocked = db_get_b(NULL, PD->RealName, "LockMainStatus", 0);
- TCHAR szTipText[256];
+ wchar_t szTipText[256];
mir_sntprintf(szTipText, L"<b>%s</b>: %s%s",
PD->RealName, pcli->pfnGetStatusModeDescription(wStatus, 0), isLocked ? L" (LOCKED)" : L"");
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp
index c684d6dc0c..772f2e0fa0 100644
--- a/plugins/Clist_nicer/src/viewmodes.cpp
+++ b/plugins/Clist_nicer/src/viewmodes.cpp
@@ -199,7 +199,7 @@ static int FillDialog(HWND hwnd)
item.pszText = TranslateT("Ungrouped contacts");
SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
- TCHAR *grpName;
+ wchar_t *grpName;
for (i = 1; (grpName = Clist_GroupGetName(i, NULL)) != NULL; i++) {
item.pszText = grpName;
SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
@@ -296,7 +296,7 @@ static void SetIconsForColumn(HWND hwndList, HANDLE hItem, HANDLE hItemAll, int
}
}
-void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szProtoFilter, DWORD statusMask, DWORD stickyStatusMask, unsigned int options,
+void SaveViewMode(const char *name, const wchar_t *szGroupFilter, const char *szProtoFilter, DWORD statusMask, DWORD stickyStatusMask, unsigned int options,
unsigned int stickies, unsigned int operators, unsigned int lmdat)
{
char szSetting[512];
@@ -346,7 +346,7 @@ void SaveState()
{
LVITEM item = { 0 };
- TCHAR szTemp[256];
+ wchar_t szTemp[256];
HWND hwndList = GetDlgItem(sttClvmHwnd, IDC_GROUPS);
@@ -433,7 +433,7 @@ void UpdateFilters()
SendDlgItemMessageA(sttClvmHwnd, IDC_VIEWMODES, LB_GETTEXT, sttClvm_curItem, (LPARAM)szBuf);
mir_strncpy(sttModeName, szBuf, sizeof(sttModeName));
{
- TCHAR szTemp[100];
+ wchar_t szTemp[100];
mir_sntprintf(szTemp, TranslateT("Current view mode: %S"), sttModeName);
SetDlgItemText(sttClvmHwnd, IDC_CURVIEWMODE2, szTemp);
}
@@ -480,8 +480,8 @@ void UpdateFilters()
{
LVITEM item = { 0 };
- TCHAR szTemp[256];
- TCHAR szMask[256];
+ wchar_t szTemp[256];
+ wchar_t szMask[256];
HWND hwndList = GetDlgItem(sttClvmHwnd, IDC_GROUPS);
item.mask = LVIF_TEXT;
@@ -494,7 +494,7 @@ void UpdateFilters()
item.iItem = i;
SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
mir_sntprintf(szMask, L"%s|", szTemp);
- if (dbv_gf.ptszVal && _tcsstr(dbv_gf.ptszVal, szMask)) {
+ if (dbv_gf.ptszVal && wcsstr(dbv_gf.ptszVal, szMask)) {
ListView_SetCheckState(hwndList, i, TRUE);
}
else {
@@ -587,7 +587,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
CLCINFOITEM cii = { 0 };
cii.cbSize = sizeof(cii);
cii.hParentGroup = 0;
- cii.pszText = LPGENT("*** All contacts ***");
+ cii.pszText = LPGENW("*** All contacts ***");
hInfoItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
}
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETHIDEEMPTYGROUPS, 1, 0);
@@ -1044,7 +1044,7 @@ void ApplyViewMode(const char *name)
mir_snprintf(szSetting, "%c%s_GF", 246, name);
ptrT tszGroups(db_get_tsa(NULL, CLVM_MODULE, szSetting));
if (mir_tstrlen(tszGroups) >= 2) {
- _tcsncpy_s(cfg::dat.groupFilter, tszGroups, _TRUNCATE);
+ wcsncpy_s(cfg::dat.groupFilter, tszGroups, _TRUNCATE);
cfg::dat.bFilterEffective |= CLVM_FILTER_GROUPS;
}
diff --git a/plugins/Cln_skinedit/src/main.cpp b/plugins/Cln_skinedit/src/main.cpp
index 550c9573ff..ebb8726a92 100644
--- a/plugins/Cln_skinedit/src/main.cpp
+++ b/plugins/Cln_skinedit/src/main.cpp
@@ -655,7 +655,7 @@ static INT_PTR CALLBACK SkinEdit_ExtBkDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
SendMessage(hwndDlg, WM_USER + 101, 0, 0);
psd->hMenuItems = CreatePopupMenu();
- AppendMenu(psd->hMenuItems, MF_STRING | MF_DISABLED, (UINT_PTR)0, LPGENT("Copy from"));
+ AppendMenu(psd->hMenuItems, MF_STRING | MF_DISABLED, (UINT_PTR)0, LPGENW("Copy from"));
AppendMenuA(psd->hMenuItems, MF_SEPARATOR, (UINT_PTR)0, NULL);
{
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp
index 1dd0509bf3..7bef6f8f5b 100644
--- a/plugins/CmdLine/src/mimcmd_handlers.cpp
+++ b/plugins/CmdLine/src/mimcmd_handlers.cpp
@@ -192,7 +192,7 @@ int ParseStatusParam(char *status)
char *PrettyStatusMode(int status, char *buffer, int size)
{
- TCHAR *data = pcli->pfnGetStatusModeDescription(status, 0);
+ wchar_t *data = pcli->pfnGetStatusModeDescription(status, 0);
if (data)
strncpy_s(buffer, size, _T2A(data), _TRUNCATE);
else
diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp
index 81bb0a8c75..275133cd1f 100644
--- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp
+++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp
@@ -39,7 +39,7 @@ struct CONNECTION *connExceptionsTmp = NULL;
struct CONNECTION *connCurrentEditModal = NULL;
int currentStatus = ID_STATUS_OFFLINE, diffstat = 0;
BOOL bOptionsOpen = FALSE;
-TCHAR *tcpStates[] = { L"CLOSED", L"LISTEN", L"SYN_SENT", L"SYN_RCVD", L"ESTAB", L"FIN_WAIT1", L"FIN_WAIT2", L"CLOSE_WAIT", L"CLOSING", L"LAST_ACK", L"TIME_WAIT", L"DELETE_TCB" };
+wchar_t *tcpStates[] = { L"CLOSED", L"LISTEN", L"SYN_SENT", L"SYN_RCVD", L"ESTAB", L"FIN_WAIT1", L"FIN_WAIT2", L"CLOSE_WAIT", L"CLOSING", L"LAST_ACK", L"TIME_WAIT", L"DELETE_TCB" };
PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
@@ -62,22 +62,22 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_CONNEC
//=========================================================================================
-BOOL strrep(TCHAR *src, TCHAR *needle, TCHAR *newstring)
+BOOL strrep(wchar_t *src, wchar_t *needle, wchar_t *newstring)
{
- TCHAR *found, begining[MAX_SETTING_STR], tail[MAX_SETTING_STR];
+ wchar_t *found, begining[MAX_SETTING_STR], tail[MAX_SETTING_STR];
size_t pos = 0;
//strset(begining, ' ');
//strset(tail, ' ');
- if (!(found = _tcsstr(src, needle)))
+ if (!(found = wcsstr(src, needle)))
return FALSE;
pos = (found - src);
- _tcsncpy_s(begining, src, pos);
+ wcsncpy_s(begining, src, pos);
begining[pos] = 0;
pos = pos + mir_tstrlen(needle);
- _tcsncpy_s(tail, src + pos, _TRUNCATE);
+ wcsncpy_s(tail, src + pos, _TRUNCATE);
begining[pos] = 0;
pos = mir_sntprintf(src, mir_tstrlen(src), L"%s%s%s", begining, newstring, tail);
@@ -187,7 +187,7 @@ void fillExceptionsListView(HWND hwndDlg)
// items.
lvI.mask = LVIF_TEXT;
while (tmp) {
- TCHAR tmpAddress[25];
+ wchar_t tmpAddress[25];
lvI.iItem = i++;
lvI.iSubItem = 0;
lvI.pszText = tmp->PName;
@@ -207,7 +207,7 @@ void fillExceptionsListView(HWND hwndDlg)
lvI.pszText = tmpAddress;
ListView_SetItem(hwndList, &lvI);
lvI.iSubItem = 3;
- lvI.pszText = tmp->Pid ? LPGENT("Show") : LPGENT("Hide");
+ lvI.pszText = tmp->Pid ? LPGENW("Show") : LPGENW("Hide");
ListView_SetItem(hwndList, &lvI);
tmp = tmp->next;
@@ -246,7 +246,7 @@ static INT_PTR CALLBACK FilterEditProc(HWND hWnd, UINT message, WPARAM wParam, L
switch (LOWORD(wParam)) {
case ID_OK:
{
- TCHAR tmpPort[6];
+ wchar_t tmpPort[6];
GetDlgItemText(hWnd, ID_TXT_LOCAL_PORT, tmpPort, _countof(tmpPort));
if (tmpPort[0] == '*')
connCurrentEditModal->intIntPort = -1;
@@ -294,7 +294,7 @@ INT_PTR CALLBACK DlgProcConnectionNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wPar
{
LVCOLUMN lvc = { 0 };
LVITEM lvI = { 0 };
- TCHAR buff[256];
+ wchar_t buff[256];
bOptionsOpen = TRUE;
TranslateDialogDefault(hwndDlg);//translate miranda function
#ifdef _WIN64
@@ -588,8 +588,8 @@ int ConnectionNotifyOptInit(WPARAM wParam, LPARAM)
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_DIALOG);
- odp.ptszTitle = _T(PLUGINNAME);
- odp.ptszGroup = LPGENT("Plugins");
+ odp.pwszTitle = _T(PLUGINNAME);
+ odp.pwszGroup = LPGENW("Plugins");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pfnDlgProc = DlgProcConnectionNotifyOpts;//callback function name
Options_AddPage(wParam, &odp);
@@ -698,7 +698,7 @@ static unsigned __stdcall checkthread(void *)
if (searchConnection(first, cur->strIntIp, cur->strExtIp, cur->intIntPort, cur->intExtPort, cur->state) == NULL && (settingStatusMask & (1 << (cur->state - 1)))) {
#ifdef _DEBUG
- TCHAR msg[1024];
+ wchar_t msg[1024];
mir_sntprintf(msg, L"%s:%d\n%s:%d", cur->strIntIp, cur->intIntPort, cur->strExtIp, cur->intExtPort);
_OutputDebugString(L"New connection: %s", msg);
#endif
@@ -759,7 +759,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
//show popup
-void showMsg(TCHAR *pName, DWORD pid, TCHAR *intIp, TCHAR *extIp, int intPort, int extPort, int state)
+void showMsg(wchar_t *pName, DWORD pid, wchar_t *intIp, wchar_t *extIp, int intPort, int extPort, int state)
{
POPUPDATAT ppd;
@@ -777,7 +777,7 @@ void showMsg(TCHAR *pName, DWORD pid, TCHAR *intIp, TCHAR *extIp, int intPort, i
ppd.lchContact = NULL;//(HANDLE)hContact; //Be sure to use a GOOD handle, since this will not be checked.
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON1));
if (settingResolveIp) {
- TCHAR hostName[128];
+ wchar_t hostName[128];
getDnsName(extIp, hostName, _countof(hostName));
mir_sntprintf(ppd.lptzText, L"%s:%d\n%s:%d", hostName, extPort, intIp, intPort);
}
@@ -793,9 +793,9 @@ void showMsg(TCHAR *pName, DWORD pid, TCHAR *intIp, TCHAR *extIp, int intPort, i
ppd.iSeconds = settingInterval1;
//Now the "additional" data.
- _tcsncpy_s(mpd->strIntIp, intIp, _TRUNCATE);
- _tcsncpy_s(mpd->strExtIp, extIp, _TRUNCATE);
- _tcsncpy_s(mpd->PName, pName, _TRUNCATE);
+ wcsncpy_s(mpd->strIntIp, intIp, _TRUNCATE);
+ wcsncpy_s(mpd->strExtIp, extIp, _TRUNCATE);
+ wcsncpy_s(mpd->PName, pName, _TRUNCATE);
mpd->intIntPort = intPort;
mpd->intExtPort = extPort;
mpd->Pid = pid;
diff --git a/plugins/ConnectionNotify/src/debug.cpp b/plugins/ConnectionNotify/src/debug.cpp
index 62aa9d9dae..506a0e07a1 100644
--- a/plugins/ConnectionNotify/src/debug.cpp
+++ b/plugins/ConnectionNotify/src/debug.cpp
@@ -1,6 +1,6 @@
#include "stdafx.h"
-void _OutputDebugString(TCHAR* lpOutputString, ...)
+void _OutputDebugString(wchar_t* lpOutputString, ...)
{
CMString format;
va_list args;
diff --git a/plugins/ConnectionNotify/src/debug.h b/plugins/ConnectionNotify/src/debug.h
index 90c46be0f5..3e3783dcc9 100644
--- a/plugins/ConnectionNotify/src/debug.h
+++ b/plugins/ConnectionNotify/src/debug.h
@@ -4,7 +4,6 @@
#include <windows.h>
#include <stdio.h>
-#include <tchar.h>
-void _OutputDebugString(TCHAR* lpOutputString, ...);
+void _OutputDebugString(wchar_t* lpOutputString, ...);
#endif \ No newline at end of file
diff --git a/plugins/ConnectionNotify/src/filter.cpp b/plugins/ConnectionNotify/src/filter.cpp
index e3843d12e3..f0c40dfed8 100644
--- a/plugins/ConnectionNotify/src/filter.cpp
+++ b/plugins/ConnectionNotify/src/filter.cpp
@@ -71,7 +71,7 @@ static INT_PTR CALLBACK ConnectionFilterEditProc(HWND hWnd, UINT message, WPARAM
{
case ID_OK:
{
- TCHAR tmpPort[6];
+ wchar_t tmpPort[6];
if (bOptionsOpen)
{
MessageBox(hWnd, TranslateT("First close options window"), L"ConnectionNotify", MB_OK | MB_ICONSTOP);
diff --git a/plugins/ConnectionNotify/src/netstat.cpp b/plugins/ConnectionNotify/src/netstat.cpp
index a12dfb0837..a9827bf7f4 100644
--- a/plugins/ConnectionNotify/src/netstat.cpp
+++ b/plugins/ConnectionNotify/src/netstat.cpp
@@ -41,15 +41,15 @@ struct CONNECTION *GetConnectionsTable()
if (pTcpTable->table[i].dwLocalAddr) {
IpAddr.S_un.S_addr = (ULONG)pTcpTable->table[i].dwLocalAddr;
//_snprintf(newConn->strIntIp,_countof(newConn->strIntIp),"%d.%d.%d.%d",IpAddr.S_un.S_un_b.s_b1,IpAddr.S_un.S_un_b.s_b2,IpAddr.S_un.S_un_b.s_b3,IpAddr.S_un.S_un_b.s_b4);
- TCHAR *strIntIp = mir_a2t(inet_ntoa(IpAddr));
- _tcsncpy(newConn->strIntIp, strIntIp, _countof(newConn->strIntIp) - 1);
+ wchar_t *strIntIp = mir_a2t(inet_ntoa(IpAddr));
+ wcsncpy(newConn->strIntIp, strIntIp, _countof(newConn->strIntIp) - 1);
mir_free(strIntIp);
}
if (pTcpTable->table[i].dwRemoteAddr) {
IpAddr.S_un.S_addr = (u_long)pTcpTable->table[i].dwRemoteAddr;
- TCHAR *strExtIp = mir_a2t(inet_ntoa(IpAddr));
- _tcsncpy(newConn->strExtIp, strExtIp, _countof(newConn->strExtIp) - 1);
+ wchar_t *strExtIp = mir_a2t(inet_ntoa(IpAddr));
+ wcsncpy(newConn->strExtIp, strExtIp, _countof(newConn->strExtIp) - 1);
mir_free(strExtIp);
}
newConn->state = pTcpTable->table[i].dwState;
@@ -123,7 +123,7 @@ void deleteConnectionsTable(struct CONNECTION *head)
head = NULL;
}
-struct CONNECTION *searchConnection(struct CONNECTION *head, TCHAR *intIp, TCHAR *extIp, int intPort, int extPort, int state)
+struct CONNECTION *searchConnection(struct CONNECTION *head, wchar_t *intIp, wchar_t *extIp, int intPort, int extPort, int state)
{
for (struct CONNECTION *cur = head; cur != NULL; cur = cur->next) {
if (mir_tstrcmp(cur->strIntIp, intIp) == 0 &&
@@ -136,7 +136,7 @@ struct CONNECTION *searchConnection(struct CONNECTION *head, TCHAR *intIp, TCHAR
return NULL;
}
-void getDnsName(TCHAR *strIp, TCHAR *strHostName, size_t len)
+void getDnsName(wchar_t *strIp, wchar_t *strHostName, size_t len)
{
in_addr iaHost;
@@ -144,5 +144,5 @@ void getDnsName(TCHAR *strIp, TCHAR *strHostName, size_t len)
iaHost.s_addr = inet_addr(szStrIP);
mir_free(szStrIP);
hostent *h = gethostbyaddr((char *)&iaHost, sizeof(struct in_addr), AF_INET);
- _tcsncpy_s(strHostName, len, (h == NULL) ? strIp : _A2T(h->h_name), _TRUNCATE);
+ wcsncpy_s(strHostName, len, (h == NULL) ? strIp : _A2T(h->h_name), _TRUNCATE);
}
diff --git a/plugins/ConnectionNotify/src/netstat.h b/plugins/ConnectionNotify/src/netstat.h
index 8ea8ed564a..f55bdd081f 100644
--- a/plugins/ConnectionNotify/src/netstat.h
+++ b/plugins/ConnectionNotify/src/netstat.h
@@ -4,17 +4,17 @@
struct CONNECTION
{
- TCHAR strIntIp[16];
- TCHAR strExtIp[16];
+ wchar_t strIntIp[16];
+ wchar_t strExtIp[16];
int intIntPort;
int intExtPort;
int state;
DWORD Pid;
- TCHAR PName[260];
+ wchar_t PName[260];
struct CONNECTION *next;
};
struct CONNECTION* GetConnectionsTable();
void deleteConnectionsTable(struct CONNECTION* head);
-struct CONNECTION* searchConnection(struct CONNECTION* head, TCHAR *intIp, TCHAR *extIp, int intPort, int extPort, int state);
-void getDnsName(TCHAR *strIp, TCHAR *strHostName, size_t len); \ No newline at end of file
+struct CONNECTION* searchConnection(struct CONNECTION* head, wchar_t *intIp, wchar_t *extIp, int intPort, int extPort, int state);
+void getDnsName(wchar_t *strIp, wchar_t *strHostName, size_t len);
diff --git a/plugins/ConnectionNotify/src/pid2name.cpp b/plugins/ConnectionNotify/src/pid2name.cpp
index e30b032bdd..65270e6b00 100644
--- a/plugins/ConnectionNotify/src/pid2name.cpp
+++ b/plugins/ConnectionNotify/src/pid2name.cpp
@@ -1,6 +1,6 @@
#include "stdafx.h"
-void pid2name(DWORD procid, TCHAR *buffer, size_t bufLen)
+void pid2name(DWORD procid, wchar_t *buffer, size_t bufLen)
{
PROCESSENTRY32 ProcessStruct;
ProcessStruct.dwSize = sizeof(PROCESSENTRY32);
@@ -12,7 +12,7 @@ void pid2name(DWORD procid, TCHAR *buffer, size_t bufLen)
do {
if (ProcessStruct.th32ProcessID == procid) {
- _tcsncpy_s(buffer, bufLen, ProcessStruct.szExeFile, _TRUNCATE);
+ wcsncpy_s(buffer, bufLen, ProcessStruct.szExeFile, _TRUNCATE);
break;
}
} while (Process32Next(hSnap, &ProcessStruct));
diff --git a/plugins/ConnectionNotify/src/pid2name.h b/plugins/ConnectionNotify/src/pid2name.h
index d1e7609f10..70974afabf 100644
--- a/plugins/ConnectionNotify/src/pid2name.h
+++ b/plugins/ConnectionNotify/src/pid2name.h
@@ -3,6 +3,6 @@
#ifndef _INC_PID2NAME
#define _INC_PID2NAME
-void pid2name(DWORD, TCHAR*, size_t);
+void pid2name(DWORD, wchar_t*, size_t);
#endif
diff --git a/plugins/ConnectionNotify/src/stdafx.h b/plugins/ConnectionNotify/src/stdafx.h
index b82329e376..4e7f512ad0 100644
--- a/plugins/ConnectionNotify/src/stdafx.h
+++ b/plugins/ConnectionNotify/src/stdafx.h
@@ -40,7 +40,7 @@
#define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x))
#define FREE(x) HeapFree(GetProcessHeap(), 0, (x))
-void showMsg(TCHAR *pName,DWORD pid,TCHAR *intIp,TCHAR *extIp,int intPort,int extPort,int state);
+void showMsg(wchar_t *pName,DWORD pid,wchar_t *intIp,wchar_t *extIp,int intPort,int extPort,int state);
//int __declspec(dllexport) Load(PLUGINLINK *link);
extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
static unsigned __stdcall checkthread(void *dummy);
diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp
index 808decafdc..5c3d44da55 100644
--- a/plugins/Console/src/Console.cpp
+++ b/plugins/Console/src/Console.cpp
@@ -66,7 +66,7 @@ typedef struct {
typedef struct {
char szModule[128];
- TCHAR szMsg[1];
+ wchar_t szMsg[1];
} DUMPMSG;
@@ -111,7 +111,7 @@ static HGENMENU hMenu = NULL;
static void LoadSettings();
static void ShowConsole(int show);
static INT_PTR ShowHideConsole(WPARAM wParam, LPARAM lParam);
-static int Openfile(TCHAR *outputFile, int selection);
+static int Openfile(wchar_t *outputFile, int selection);
////////////////////////////////////////////////////////////////////////////////
@@ -165,7 +165,7 @@ static void ShowConsole(int show)
RedrawWindow(pActive->hList, NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_UPDATENOW | RDW_ERASE);
if (hMenu)
- Menu_ModifyItem(hMenu, show ? LPGENT("Hide Console") : LPGENT("Show Console"));
+ Menu_ModifyItem(hMenu, show ? LPGENW("Hide Console") : LPGENW("Show Console"));
if (hTTBButt)
CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTBButt, show ? TTBST_PUSHED : 0);
@@ -205,22 +205,22 @@ typedef struct
UINT control;
UINT icon;
int type;
- TCHAR *tooltip;
+ wchar_t *tooltip;
} controlinfo;
static controlinfo ctrls[] =
{
// IDC_SCROLL & IDC_PAUSE must be first
- { IDC_SCROLL, IDI_SCROLL, BUTTONSETASFLATBTN, LPGENT("Scrolling (Ctrl+Q)") },
- { IDC_PAUSE, IDI_STARTED, BUTTONSETASFLATBTN, LPGENT("Pause logging (Ctrl+P)") },
- { IDC_SAVE, IDI_SAVE, BUTTONSETASFLATBTN, LPGENT("Save log to file (Ctrl+S)") },
- { IDC_COPY, IDI_COPY, BUTTONSETASFLATBTN, LPGENT("Copy selected log (Ctrl+C)") },
- { IDC_DELETE, IDI_DELETE, BUTTONSETASFLATBTN, LPGENT("Delete selected (Del)") },
- { IDC_OPTIONS, IDI_OPTIONS, BUTTONSETASFLATBTN, LPGENT("Log options (Ctrl+O)") },
- { IDC_STARTALL, IDI_START, BUTTONSETASFLATBTN, LPGENT("Start logging in all tabs") },
- { IDC_PAUSEALL, IDI_PAUSE, BUTTONSETASFLATBTN, LPGENT("Pause logging in all tabs") },
- { IDC_CLOSE, IDI_CLOSE, BUTTONSETASFLATBTN, LPGENT("Close tab (Ctrl+W)") },
+ { IDC_SCROLL, IDI_SCROLL, BUTTONSETASFLATBTN, LPGENW("Scrolling (Ctrl+Q)") },
+ { IDC_PAUSE, IDI_STARTED, BUTTONSETASFLATBTN, LPGENW("Pause logging (Ctrl+P)") },
+ { IDC_SAVE, IDI_SAVE, BUTTONSETASFLATBTN, LPGENW("Save log to file (Ctrl+S)") },
+ { IDC_COPY, IDI_COPY, BUTTONSETASFLATBTN, LPGENW("Copy selected log (Ctrl+C)") },
+ { IDC_DELETE, IDI_DELETE, BUTTONSETASFLATBTN, LPGENW("Delete selected (Del)") },
+ { IDC_OPTIONS, IDI_OPTIONS, BUTTONSETASFLATBTN, LPGENW("Log options (Ctrl+O)") },
+ { IDC_STARTALL, IDI_START, BUTTONSETASFLATBTN, LPGENW("Start logging in all tabs") },
+ { IDC_PAUSEALL, IDI_PAUSE, BUTTONSETASFLATBTN, LPGENW("Pause logging in all tabs") },
+ { IDC_CLOSE, IDI_CLOSE, BUTTONSETASFLATBTN, LPGENW("Close tab (Ctrl+W)") },
};
////////////////////////////////////////////////////////////////////////////////
@@ -372,23 +372,23 @@ static INT_PTR CALLBACK LogDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LP
if (dat && !dat->Paused) {
LVITEM lvi = { 0 };
int last = 0x7fffffff;
- TCHAR szBreak;
+ wchar_t szBreak;
DWORD len, tmplen;
DWORD wraplen = gWrapLen;
- TCHAR *str = ((DUMPMSG *)lParam)->szMsg;
+ wchar_t *str = ((DUMPMSG *)lParam)->szMsg;
lvi.iItem = 0x7fffffff;
- str = _tcstok(str, L"\n");
+ str = wcstok(str, L"\n");
if (gIcons && str != NULL) {
lvi.mask = LVIF_TEXT | LVIF_IMAGE;
- if (_tcsstr(str, L"Data received")) {
+ if (wcsstr(str, L"Data received")) {
if (gSeparator) ListView_InsertItem(dat->hList, &lvi);
lvi.iImage = IMG_IN;
}
- else if (_tcsstr(str, L"Data sent")) {
+ else if (wcsstr(str, L"Data sent")) {
if (gSeparator) ListView_InsertItem(dat->hList, &lvi);
lvi.iImage = IMG_OUT;
}
@@ -423,7 +423,7 @@ static INT_PTR CALLBACK LogDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LP
last = ListView_InsertItem(dat->hList, &lvi);
- str = _tcstok(NULL, L"\n");
+ str = wcstok(NULL, L"\n");
if (str) dat->newline = 1;
lvi.iImage = IMG_EMPTY;
@@ -477,8 +477,8 @@ static INT_PTR CALLBACK LogDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LP
case IDC_COPY:
{
int idx = 0;
- TCHAR szText[128];
- TCHAR *src, *dst, *buf;
+ wchar_t szText[128];
+ wchar_t *src, *dst, *buf;
int flags = LVNI_BELOW;
int count = ListView_GetSelectedCount(dat->hList);
@@ -487,7 +487,7 @@ static INT_PTR CALLBACK LogDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LP
else
count = ListView_GetItemCount(dat->hList);
- dst = buf = (TCHAR *)malloc((count * (sizeof(szText) + 1) + 1) * sizeof(TCHAR));
+ dst = buf = (wchar_t *)malloc((count * (sizeof(szText) + 1) + 1) * sizeof(wchar_t));
if (!buf) break;
while ((idx = ListView_GetNextItem(dat->hList, idx, flags)) > 0) {
@@ -502,9 +502,9 @@ static INT_PTR CALLBACK LogDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LP
if (dst - buf > 0 && OpenClipboard(hwndDlg)) {
EmptyClipboard();
- HGLOBAL hClipboardData = GlobalAlloc(GMEM_DDESHARE, (dst - buf + 1) * sizeof(TCHAR));
+ HGLOBAL hClipboardData = GlobalAlloc(GMEM_DDESHARE, (dst - buf + 1) * sizeof(wchar_t));
if (hClipboardData) {
- TCHAR *pchData = (TCHAR *)GlobalLock(hClipboardData);
+ wchar_t *pchData = (wchar_t *)GlobalLock(hClipboardData);
mir_tstrcpy(pchData, buf);
GlobalUnlock(hClipboardData);
SetClipboardData(CF_UNICODETEXT, hClipboardData);
@@ -541,21 +541,21 @@ static INT_PTR CALLBACK LogDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LP
case IDC_SAVE:
{
- TCHAR szFile[MAX_PATH];
+ wchar_t szFile[MAX_PATH];
if (!Openfile(szFile, ListView_GetSelectedCount(dat->hList))) break;
- FILE *fp = _tfopen(szFile, L"wt");
+ FILE *fp = _wfopen(szFile, L"wt");
if (fp) {
int idx = 0;
- TCHAR szText[128];
+ wchar_t szText[128];
int flags = LVNI_BELOW;
if (ListView_GetSelectedCount(dat->hList))
flags |= LVNI_SELECTED;
while ((idx = ListView_GetNextItem(dat->hList, idx, flags)) > 0) {
ListView_GetItemText(dat->hList, idx, 0, szText, _countof(szText));
- _ftprintf(fp, L"%s\n", szText);
+ fwprintf(fp, L"%s\n", szText);
}
fclose(fp);
}
@@ -608,9 +608,9 @@ static INT_PTR CALLBACK ConsoleDlgProc(HWND hwndDlg, UINT message, WPARAM wParam
switch (message) {
case WM_INITDIALOG:
{
- TCHAR title[MAX_PATH];
- TCHAR name[MAX_PATH] = { 0 };
- TCHAR path[MAX_PATH] = { 0 };
+ wchar_t title[MAX_PATH];
+ wchar_t name[MAX_PATH] = { 0 };
+ wchar_t path[MAX_PATH] = { 0 };
hTabs = GetDlgItem(hwndDlg, IDC_TABS);
@@ -929,9 +929,9 @@ static int OnFastDump(WPARAM wParam, LPARAM lParam)
LOGMSG *logMsg = (LOGMSG *)lParam;
DWORD headlen = (DWORD)mir_strlen(logMsg->pszHead);
DWORD msglen = (DWORD)mir_strlen(logMsg->pszMsg);
- DWORD len = (headlen + msglen + 1) * sizeof(TCHAR) + sizeof(DUMPMSG);
+ DWORD len = (headlen + msglen + 1) * sizeof(wchar_t) + sizeof(DUMPMSG);
DUMPMSG *dumpMsg = (DUMPMSG *)mir_alloc(len);
- TCHAR *str = dumpMsg->szMsg;
+ wchar_t *str = dumpMsg->szMsg;
char *szModule = (wParam) ? ((NETLIBUSER *)wParam)->szDescriptiveName : "[Core]";
mir_strncpy(dumpMsg->szModule, szModule, _countof(dumpMsg->szModule));
@@ -1096,8 +1096,8 @@ static int OnFontChange(WPARAM, LPARAM)
FontIDT fid = { 0 };
fid.cbSize = sizeof(fid);
- mir_tstrncpy(fid.group, LPGENT("Console"), _countof(fid.group));
- mir_tstrncpy(fid.name, LPGENT("Text"), _countof(fid.name));
+ mir_tstrncpy(fid.group, LPGENW("Console"), _countof(fid.group));
+ mir_tstrncpy(fid.name, LPGENW("Text"), _countof(fid.name));
colLogFont = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&LogFont);
@@ -1120,12 +1120,12 @@ static int OnSystemModulesLoaded(WPARAM, LPARAM)
FontIDT fid = { 0 };
fid.cbSize = sizeof(fid);
- mir_tstrncpy(fid.group, LPGENT("Console"), _countof(fid.group));
- mir_tstrncpy(fid.name, LPGENT("Text"), _countof(fid.name));
+ mir_tstrncpy(fid.group, LPGENW("Console"), _countof(fid.group));
+ mir_tstrncpy(fid.name, LPGENW("Text"), _countof(fid.name));
mir_strncpy(fid.dbSettingsGroup, "Console", _countof(fid.dbSettingsGroup));
mir_strncpy(fid.prefix, "ConsoleFont", _countof(fid.prefix));
- mir_tstrncpy(fid.backgroundGroup, LPGENT("Console"), _countof(fid.backgroundGroup));
- mir_tstrncpy(fid.backgroundName, LPGENT("Background"), _countof(fid.backgroundName));
+ mir_tstrncpy(fid.backgroundGroup, LPGENW("Console"), _countof(fid.backgroundGroup));
+ mir_tstrncpy(fid.backgroundName, LPGENW("Background"), _countof(fid.backgroundName));
fid.flags = FIDF_DEFAULTVALID;
fid.deffontsettings.charset = DEFAULT_CHARSET;
fid.deffontsettings.colour = RGB(0, 0, 0);
@@ -1138,8 +1138,8 @@ static int OnSystemModulesLoaded(WPARAM, LPARAM)
ColourIDT cid = { 0 };
cid.cbSize = sizeof(cid);
- mir_tstrncpy(cid.group, LPGENT("Console"), _countof(cid.group));
- mir_tstrncpy(cid.name, LPGENT("Background"), _countof(cid.name));
+ mir_tstrncpy(cid.group, LPGENW("Console"), _countof(cid.group));
+ mir_tstrncpy(cid.name, LPGENW("Background"), _countof(cid.name));
mir_strncpy(cid.dbSettingsGroup, "Console", _countof(cid.dbSettingsGroup));
mir_strncpy(cid.setting, "BgColor", _countof(cid.setting));
cid.defcolour = RGB(255, 255, 255);
@@ -1164,7 +1164,7 @@ static int OnSystemModulesLoaded(WPARAM, LPARAM)
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = hIcons[0];
mi.position = 1900000000;
- mi.name.t = (IsWindowVisible(hwndConsole)) ? LPGENT("Hide Console") : LPGENT("Show Console");
+ mi.name.w = (IsWindowVisible(hwndConsole)) ? LPGENW("Hide Console") : LPGENW("Show Console");
mi.pszService = MS_CONSOLE_SHOW_HIDE;
hMenu = Menu_AddMainMenuItem(&mi);
@@ -1258,21 +1258,21 @@ void ShutdownConsole(void)
////////////////////////////////////////////////////////////////////////////////
-TCHAR *addstring(TCHAR *str, TCHAR *add) {
+wchar_t *addstring(wchar_t *str, wchar_t *add) {
mir_tstrcpy(str, add);
return str + mir_tstrlen(add) + 1;
}
-static int Openfile(TCHAR *outputFile, int selection)
+static int Openfile(wchar_t *outputFile, int selection)
{
- TCHAR filename[MAX_PATH + 2] = L"";
- TCHAR *title;
+ wchar_t filename[MAX_PATH + 2] = L"";
+ wchar_t *title;
- TCHAR *filter, *tmp, *tmp1, *tmp2;
+ wchar_t *filter, *tmp, *tmp1, *tmp2;
tmp1 = TranslateT("Text Files (*.txt)");
tmp2 = TranslateT("All Files");
- filter = tmp = (TCHAR*)_alloca((mir_tstrlen(tmp1) + mir_tstrlen(tmp2) + 11)*sizeof(TCHAR));
+ filter = tmp = (wchar_t*)_alloca((mir_tstrlen(tmp1) + mir_tstrlen(tmp2) + 11)*sizeof(wchar_t));
tmp = addstring(tmp, tmp1);
tmp = addstring(tmp, L"*.TXT");
tmp = addstring(tmp, tmp2);
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp
index 109bb50043..8852ad0eea 100644
--- a/plugins/ContactsPlus/src/main.cpp
+++ b/plugins/ContactsPlus/src/main.cpp
@@ -73,7 +73,7 @@ static int HookDBEventAdded(WPARAM hContact, LPARAM hDbEvent)
SkinPlaySound("RecvContacts");
{
//add event to the contact list
- TCHAR caToolTip[128];
+ wchar_t caToolTip[128];
mir_sntprintf(caToolTip, L"%s %s", TranslateT("Contacts received from"), pcli->pfnGetContactDisplayName(hContact, 0));
CLISTEVENT cle = {};
diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp
index 0a008a12da..0373609632 100644
--- a/plugins/ContactsPlus/src/receive.cpp
+++ b/plugins/ContactsPlus/src/receive.cpp
@@ -81,17 +81,17 @@ static int RecvDlg_Resize(HWND, LPARAM, UTILRESIZECONTROL *urc)
return RD_ANCHORX_LEFT | RD_ANCHORY_TOP; // default
}
-static TCHAR* ListView_GetItemTextEx(HWND hLV, int iItem, int iSubItem)
+static wchar_t* ListView_GetItemTextEx(HWND hLV, int iItem, int iSubItem)
{
LVITEM lvi = {0};
lvi.mask = LVIF_TEXT;
lvi.iSubItem = iSubItem;
lvi.cchTextMax = 64;
- lvi.pszText = (TCHAR*)mir_alloc(lvi.cchTextMax * sizeof(TCHAR));
+ lvi.pszText = (wchar_t*)mir_alloc(lvi.cchTextMax * sizeof(wchar_t));
// loop until the returned size is smaller than buffer size
while (SendMessage(hLV, LVM_GETITEMTEXT, iItem, (LPARAM)&lvi) == lvi.cchTextMax - 1) {
lvi.cchTextMax += 64;
- lvi.pszText = (TCHAR*)mir_realloc(lvi.pszText, lvi.cchTextMax * sizeof(TCHAR));
+ lvi.pszText = (wchar_t*)mir_realloc(lvi.pszText, lvi.cchTextMax * sizeof(wchar_t));
}
return lvi.pszText;
}
@@ -108,18 +108,18 @@ static void RebuildGroupCombo(HWND hwndDlg)
if (bHasGroups) {
int curs = SendMessage(hGroupsCombo, CB_GETCURSEL, 0, 0);
- TCHAR *curst = NULL;
+ wchar_t *curst = NULL;
EnableDlgItem(hwndDlg, IDC_ENABLEGROUPS, TRUE);
EnableGroupCombo(hwndDlg);
if (curs != CB_ERR) {
- curst = (TCHAR*)_alloca((SendMessage(hGroupsCombo, CB_GETLBTEXTLEN, curs, 0) + 1) * sizeof(TCHAR));
+ curst = (wchar_t*)_alloca((SendMessage(hGroupsCombo, CB_GETLBTEXTLEN, curs, 0) + 1) * sizeof(wchar_t));
SendMessage(hGroupsCombo, CB_GETLBTEXT, curs, (LPARAM)curst);
}
SendMessage(hGroupsCombo, CB_RESETCONTENT, 0, 0);
- TCHAR *szGroup;
+ wchar_t *szGroup;
for (int i=1; (szGroup = Clist_GroupGetName(i, NULL)) != NULL; i++) {
int nIndex = SendMessage(hGroupsCombo, CB_ADDSTRING, 0, (LPARAM)szGroup);
SendMessage(hGroupsCombo, CB_SETITEMDATA, nIndex, i);
@@ -138,7 +138,7 @@ static void RebuildGroupCombo(HWND hwndDlg)
static MCONTACT CreateTemporaryContactForItem(HWND hwndDlg, TRecvContactsData *wndData, int iItem)
{
- TCHAR *caUIN = ListView_GetItemTextEx(GetDlgItem(hwndDlg, IDC_CONTACTS), iItem, 0);
+ wchar_t *caUIN = ListView_GetItemTextEx(GetDlgItem(hwndDlg, IDC_CONTACTS), iItem, 0);
char *szProto = GetContactProto(wndData->mhContact);
wndData->rhSearch = (HANDLE)CallProtoService(szProto, PS_BASICSEARCH, 0, (LPARAM)caUIN); // find it
replaceStrT(wndData->haUin, caUIN);
@@ -148,7 +148,7 @@ static MCONTACT CreateTemporaryContactForItem(HWND hwndDlg, TRecvContactsData *w
return NULL;
}
-void RecvListView_AddColumn(HWND hList, int nWidth, TCHAR *szTitle, int nItem)
+void RecvListView_AddColumn(HWND hList, int nWidth, wchar_t *szTitle, int nItem)
{
LVCOLUMN col;
col.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
@@ -239,10 +239,10 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
}
}
// new dlg init
- wndData->hIcons[0] = InitMButton(hwndDlg, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGENT("Add Contact Permanently to List"));
- wndData->hIcons[1] = InitMButton(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGENT("View User's Details"));
- wndData->hIcons[2] = InitMButton(hwndDlg, IDC_HISTORY, SKINICON_OTHER_HISTORY, LPGENT("View User's History"));
- wndData->hIcons[3] = InitMButton(hwndDlg, IDC_USERMENU, SKINICON_OTHER_DOWNARROW, LPGENT("User Menu"));
+ wndData->hIcons[0] = InitMButton(hwndDlg, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGENW("Add Contact Permanently to List"));
+ wndData->hIcons[1] = InitMButton(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGENW("View User's Details"));
+ wndData->hIcons[2] = InitMButton(hwndDlg, IDC_HISTORY, SKINICON_OTHER_HISTORY, LPGENW("View User's History"));
+ wndData->hIcons[3] = InitMButton(hwndDlg, IDC_USERMENU, SKINICON_OTHER_DOWNARROW, LPGENW("User Menu"));
SendMessage(hwndDlg,DM_UPDATETITLE,0,0);
// new dialog init done
@@ -301,11 +301,11 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
HWND hGroupsCombo = GetDlgItem(hwndDlg, IDC_GROUPS);
HWND hGroupsCheck = GetDlgItem(hwndDlg, IDC_ENABLEGROUPS);
int curs = SendMessage(hGroupsCombo, CB_GETCURSEL, 0, 0);
- TCHAR* caGroup = NULL;
+ wchar_t* caGroup = NULL;
int nGroupId = -1;
if (curs != CB_ERR && IsWindowEnabled(hGroupsCheck) && SendMessage(hGroupsCheck, BM_GETCHECK, 0, 0))
{ //got groups, get the one selected in combo
- caGroup = (TCHAR*)_alloca((SendMessage(hGroupsCombo, CB_GETLBTEXTLEN, curs, 0) + 1) * sizeof(TCHAR));
+ caGroup = (wchar_t*)_alloca((SendMessage(hGroupsCombo, CB_GETLBTEXTLEN, curs, 0) + 1) * sizeof(wchar_t));
SendMessage(hGroupsCombo, CB_GETLBTEXT, curs, (LPARAM)caGroup);
nGroupId = SendMessage(hGroupsCombo, CB_GETITEMDATA, curs, 0);
}
@@ -313,7 +313,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
for (int i = 0; i < ListView_GetItemCount(hLV); i++)
if (ListView_GetCheckState(hLV, i)) {
// found checked contact item, add it
- TCHAR *caUIN = ListView_GetItemTextEx(hLV, i, 0);
+ wchar_t *caUIN = ListView_GetItemTextEx(hLV, i, 0);
for (int j = 0; j < wndData->cbReceived; j++) // determine item index in packet
if (!mir_tstrcmp(wndData->maReceived[j]->mcaUIN, caUIN)) {
char *szProto =GetContactProto(wndData->mhContact);
@@ -437,10 +437,10 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
fi.psz = wndData->haUin;
int iLPos = ListView_FindItem(hLV, -1, &fi);
if (iLPos == -1) iLPos = 0;
- if (mir_tstrcmp(psr->nick.t, L"") && psr->nick.t)
- ListView_SetItemText(hLV, iLPos, 1, psr->nick.t);
- ListView_SetItemText(hLV, iLPos, 2, psr->firstName.t);
- ListView_SetItemText(hLV, iLPos, 3, psr->lastName.t);
+ if (mir_tstrcmp(psr->nick.w, L"") && psr->nick.w)
+ ListView_SetItemText(hLV, iLPos, 1, psr->nick.w);
+ ListView_SetItemText(hLV, iLPos, 2, psr->firstName.w);
+ ListView_SetItemText(hLV, iLPos, 3, psr->lastName.w);
break;
}
mir_free(wndData->haUin);
@@ -482,7 +482,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
break;
case DM_UPDATETITLE:
- UpdateDialogTitle(hwndDlg, wndData ? wndData->mhContact : NULL, LPGENT("Contacts from"));
+ UpdateDialogTitle(hwndDlg, wndData ? wndData->mhContact : NULL, LPGENW("Contacts from"));
if (wndData)
UpdateDialogAddButton(hwndDlg, wndData->mhContact);
break;
diff --git a/plugins/ContactsPlus/src/receive.h b/plugins/ContactsPlus/src/receive.h
index 52db60a171..2bb0f5f659 100644
--- a/plugins/ContactsPlus/src/receive.h
+++ b/plugins/ContactsPlus/src/receive.h
@@ -35,8 +35,8 @@
#define IDI_DOWNARROW 264
struct TReceivedItem {
- TCHAR* mcaUIN;
- TCHAR* mcaNick;
+ wchar_t* mcaUIN;
+ wchar_t* mcaNick;
~TReceivedItem() { mir_free(mcaUIN); mir_free(mcaNick); }
TReceivedItem() { mcaUIN = NULL; mcaNick = NULL; }
};
@@ -52,7 +52,7 @@ struct TRecvContactsData
HMENU mhPopup; // popup menu for listview
HANDLE hHook; // hook to event
HANDLE rhSearch; // handle to uin-search
- TCHAR* haUin;
+ wchar_t* haUin;
int iPopupItem;
TReceivedItem** maReceived;// received contacts
int cbReceived;
diff --git a/plugins/ContactsPlus/src/send.cpp b/plugins/ContactsPlus/src/send.cpp
index 38505ded75..7674ed4d57 100644
--- a/plugins/ContactsPlus/src/send.cpp
+++ b/plugins/ContactsPlus/src/send.cpp
@@ -234,10 +234,10 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
wndData = new TSendContactsData(lParam);
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)wndData);
// new dlg init
- wndData->hIcons[0] = InitMButton(hwndDlg, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGENT("Add Contact Permanently to List"));
- wndData->hIcons[1] = InitMButton(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGENT("View User's Details"));
- wndData->hIcons[2] = InitMButton(hwndDlg, IDC_HISTORY, SKINICON_OTHER_HISTORY, LPGENT("View User's History"));
- wndData->hIcons[3] = InitMButton(hwndDlg, IDC_USERMENU, SKINICON_OTHER_DOWNARROW, LPGENT("User Menu"));
+ wndData->hIcons[0] = InitMButton(hwndDlg, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGENW("Add Contact Permanently to List"));
+ wndData->hIcons[1] = InitMButton(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGENW("View User's Details"));
+ wndData->hIcons[2] = InitMButton(hwndDlg, IDC_HISTORY, SKINICON_OTHER_HISTORY, LPGENW("View User's History"));
+ wndData->hIcons[3] = InitMButton(hwndDlg, IDC_USERMENU, SKINICON_OTHER_DOWNARROW, LPGENW("User Menu"));
SendMessage(hwndDlg, DM_UPDATETITLE, 0, 0);
// new dialog init done
@@ -479,7 +479,7 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
TranslateDialogDefault(hwndDlg);
{
if (lParam)
- SetDlgItemText(hwndDlg, IDC_ERRORTEXT, TranslateTS((TCHAR*)lParam));
+ SetDlgItemText(hwndDlg, IDC_ERRORTEXT, TranslateTS((wchar_t*)lParam));
RECT rc, rcParent;
GetWindowRect(hwndDlg, &rc);
diff --git a/plugins/ContactsPlus/src/utils.cpp b/plugins/ContactsPlus/src/utils.cpp
index 5ba7efea54..f16a559fe2 100644
--- a/plugins/ContactsPlus/src/utils.cpp
+++ b/plugins/ContactsPlus/src/utils.cpp
@@ -55,7 +55,7 @@ char* __fastcall null_strdup(const char *string)
return NULL;
}
-TCHAR* GetContactUID(MCONTACT hContact)
+wchar_t* GetContactUID(MCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
char *uid = (char*)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
@@ -67,19 +67,19 @@ TCHAR* GetContactUID(MCONTACT hContact)
return NULL;
if (vrUid.type == DBVT_DWORD) {
- TCHAR tmp[100];
- _itot(vrUid.dVal, tmp, 10);
+ wchar_t tmp[100];
+ _itow(vrUid.dVal, tmp, 10);
return mir_tstrdup(tmp);
}
if (vrUid.type == DBVT_ASCIIZ) {
- TCHAR *res = mir_a2t(vrUid.pszVal);
+ wchar_t *res = mir_a2t(vrUid.pszVal);
mir_free(vrUid.pszVal);
return res;
}
if (vrUid.type == DBVT_UTF8) {
- TCHAR *res = mir_utf8decodeT(vrUid.pszVal);
+ wchar_t *res = mir_utf8decodeT(vrUid.pszVal);
mir_free(vrUid.pszVal);
return res;
}
@@ -112,24 +112,24 @@ void DrawProtocolIcon(HWND hwndDlg, LPARAM lParam, MCONTACT hContact)
}
-void UpdateDialogTitle(HWND hwndDlg, MCONTACT hContact, TCHAR *pszTitleStart)
+void UpdateDialogTitle(HWND hwndDlg, MCONTACT hContact, wchar_t *pszTitleStart)
{
- TCHAR newtitle[512];
+ wchar_t newtitle[512];
mir_tstrncpy(newtitle, TranslateTS(pszTitleStart), _countof(newtitle));
if (hContact) {
char *szProto = GetContactProto(hContact);
if (szProto) {
ptrT uid(GetContactUID(hContact));
- TCHAR *contactName = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *contactName = pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR oldTitle[MAX_PATH];
+ wchar_t oldTitle[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_NAME, oldTitle, _countof(oldTitle));
if (mir_tstrcmp(uid ? uid : contactName, oldTitle))
SetDlgItemText(hwndDlg, IDC_NAME, uid ? uid : contactName);
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
mir_sntprintf(newtitle, L"%s %s (%s)", TranslateTS(pszTitleStart), contactName, szStatus);
}
}
@@ -145,7 +145,7 @@ void UpdateDialogAddButton(HWND hwndDlg, MCONTACT hContact)
}
-HICON InitMButton(HWND hDlg, int idButton, int idIcon, TCHAR *szTip)
+HICON InitMButton(HWND hDlg, int idButton, int idIcon, wchar_t *szTip)
{
HWND hButton = GetDlgItem(hDlg, idButton);
HICON hIcon = Skin_LoadIcon(idIcon);
@@ -172,10 +172,10 @@ void EnableDlgItem(HWND hwndDlg, UINT control, int state)
}
-TCHAR* GetWindowTextT(HWND hWnd)
+wchar_t* GetWindowTextT(HWND hWnd)
{
int len = GetWindowTextLength(hWnd) + 1;
- TCHAR* txt = (TCHAR*)mir_alloc(len * sizeof(TCHAR));
+ wchar_t* txt = (wchar_t*)mir_alloc(len * sizeof(wchar_t));
if (txt) {
txt[0] = 0;
GetWindowText(hWnd, txt, len);
@@ -183,9 +183,9 @@ TCHAR* GetWindowTextT(HWND hWnd)
return txt;
}
-TCHAR* __fastcall strdupT(const TCHAR *string)
+wchar_t* __fastcall strdupT(const wchar_t *string)
{
if (string)
- return (TCHAR*)wcsdup((TCHAR*)string);
+ return (wchar_t*)wcsdup((wchar_t*)string);
return NULL;
}
diff --git a/plugins/ContactsPlus/src/utils.h b/plugins/ContactsPlus/src/utils.h
index cf284b44e7..6783f5bd74 100644
--- a/plugins/ContactsPlus/src/utils.h
+++ b/plugins/ContactsPlus/src/utils.h
@@ -32,13 +32,13 @@ int __fastcall strcmpnull(const char *str1, const char *str2);
void __fastcall strcpynull(char *str1, const char *str2);
char* __fastcall null_strdup(const char *string);
-TCHAR* GetContactUID(MCONTACT hContact);
+wchar_t* GetContactUID(MCONTACT hContact);
void DrawProtocolIcon(HWND hwndDlg, LPARAM lParam, MCONTACT hContact);
-void UpdateDialogTitle(HWND hwndDlg, MCONTACT hContact, TCHAR *pszTitleStart);
+void UpdateDialogTitle(HWND hwndDlg, MCONTACT hContact, wchar_t *pszTitleStart);
void UpdateDialogAddButton(HWND hwndDlg, MCONTACT hContact);
-HICON InitMButton(HWND hDlg, int idButton, int idIcon, TCHAR *szTip);
+HICON InitMButton(HWND hDlg, int idButton, int idIcon, wchar_t *szTip);
void DialogAddContactExecute(HWND hwndDlg, MCONTACT hNewContact);
diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp
index 1d6692ca26..5c96a12456 100644
--- a/plugins/CrashDumper/src/crshdmp.cpp
+++ b/plugins/CrashDumper/src/crshdmp.cpp
@@ -27,11 +27,11 @@ LCID packlcid;
HANDLE hVerInfoFolder;
HMODULE hMsftedit;
-TCHAR* vertxt;
-TCHAR* profname;
-TCHAR* profpath;
+wchar_t* vertxt;
+wchar_t* profname;
+wchar_t* profpath;
-TCHAR CrashLogFolder[MAX_PATH], VersionInfoFolder[MAX_PATH];
+wchar_t CrashLogFolder[MAX_PATH], VersionInfoFolder[MAX_PATH];
bool servicemode, clsdates, dtsubfldr, catchcrashes, needrestart = 0;
@@ -67,7 +67,7 @@ INT_PTR StoreVersionInfoToFile(WPARAM, LPARAM lParam)
{
CreateDirectoryTreeT(VersionInfoFolder);
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
mir_sntprintf(path, TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
HANDLE hDumpFile = CreateFile(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -158,10 +158,10 @@ INT_PTR CopyLinkToClipboard(WPARAM, LPARAM)
{
ptrT tmp(db_get_wsa(NULL, PluginName, "Username"));
if (tmp != NULL) {
- TCHAR buffer[MAX_PATH];
+ wchar_t buffer[MAX_PATH];
mir_sntprintf(buffer, L"http://vi.miranda-ng.org/detail/%s", tmp);
- int bufLen = (sizeof(buffer) + 1) * sizeof(TCHAR);
+ int bufLen = (sizeof(buffer) + 1) * sizeof(wchar_t);
HANDLE hData = GlobalAlloc(GMEM_MOVEABLE, bufLen);
LPSTR buf = (LPSTR)GlobalLock(hData);
memcpy(buf, buffer, bufLen);
@@ -256,7 +256,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
}
CMenuItem mi;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Version Information"), 2000089999, GetIconHandle(IDI_VI));
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Version Information"), 2000089999, GetIconHandle(IDI_VI));
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "9A7A9C76-7FD8-4C05-B402-6C46060C2D78");
SET_UID(mi, 0x52930e40, 0xb2ee, 0x4433, 0xad, 0x77, 0xf5, 0x42, 0xe, 0xf6, 0x57, 0xc1);
@@ -369,7 +369,7 @@ extern "C" int __declspec(dllexport) Load(void)
profpath = Utils_ReplaceVarsT(L"%miranda_userdata%");
if (catchcrashes && !needrestart)
mir_sntprintf(CrashLogFolder, TEXT("%s\\CrashLog"), profpath);
- _tcsncpy_s(VersionInfoFolder, profpath, _TRUNCATE);
+ wcsncpy_s(VersionInfoFolder, profpath, _TRUNCATE);
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
diff --git a/plugins/CrashDumper/src/dumper.cpp b/plugins/CrashDumper/src/dumper.cpp
index 0ea80781bd..3fa432aa47 100644
--- a/plugins/CrashDumper/src/dumper.cpp
+++ b/plugins/CrashDumper/src/dumper.cpp
@@ -18,9 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-extern TCHAR* vertxt;
-extern TCHAR* profname;
-extern TCHAR* profpath;
+extern wchar_t* vertxt;
+extern wchar_t* profname;
+extern wchar_t* profpath;
void CreateMiniDump(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr)
{
@@ -36,8 +36,8 @@ void CreateMiniDump(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr)
void WriteBBFile(CMString& buffer, bool hdr)
{
- static const TCHAR header[] = TEXT("[spoiler=VersionInfo][quote]");
- static const TCHAR footer[] = TEXT("[/quote][/spoiler]");
+ static const wchar_t header[] = TEXT("[spoiler=VersionInfo][quote]");
+ static const wchar_t footer[] = TEXT("[/quote][/spoiler]");
buffer.Append(hdr ? header : footer);
}
@@ -59,14 +59,14 @@ BOOL CALLBACK LoadedModules64(LPCSTR, DWORD64 ModuleBase, ULONG ModuleSize, PVOI
const HMODULE hModule = (HMODULE)ModuleBase;
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
GetModuleFileName(hModule, path, MAX_PATH);
buffer.AppendFormat(TEXT("%s %p - %p"), path, (void*)ModuleBase, (void*)(ModuleBase + ModuleSize));
GetVersionInfo(hModule, buffer);
- TCHAR timebuf[30] = TEXT("");
+ wchar_t timebuf[30] = TEXT("");
GetLastWriteTime(path, timebuf, 30);
buffer.AppendFormat(TEXT(" [%s]\r\n"), timebuf);
@@ -100,7 +100,7 @@ BOOL CALLBACK LoadedModulesFind64(LPCSTR ModuleName, DWORD64 ModuleBase, ULONG M
}
-void GetLinkedModulesInfo(TCHAR *moduleName, CMString &buffer)
+void GetLinkedModulesInfo(wchar_t *moduleName, CMString &buffer)
{
HANDLE hDllFile = CreateFile(moduleName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hDllFile == INVALID_HANDLE_VALUE)
@@ -114,7 +114,7 @@ void GetLinkedModulesInfo(TCHAR *moduleName, CMString &buffer)
LPVOID dllAddr = MapViewOfFile(hDllMapping, FILE_MAP_READ, 0, 0, 0);
- static const TCHAR format[] = TEXT(" Plugin statically linked to missing module: %S\r\n");
+ static const wchar_t format[] = TEXT(" Plugin statically linked to missing module: %S\r\n");
__try {
PIMAGE_NT_HEADERS nthdrs = ImageNtHeader(dllAddr);
@@ -173,10 +173,10 @@ static void GetPluginsString(CMString& buffer, unsigned& flags)
{
buffer.AppendFormat(TEXT("Service Mode: %s\r\n"), servicemode ? TEXT("Yes") : TEXT("No"));
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
GetModuleFileName(NULL, path, MAX_PATH);
- LPTSTR fname = _tcsrchr(path, TEXT('\\'));
+ LPTSTR fname = wcsrchr(path, TEXT('\\'));
if (fname == NULL) fname = path;
mir_sntprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\*.dll"));
@@ -189,7 +189,7 @@ static void GetPluginsString(CMString& buffer, unsigned& flags)
CMString ubuffer;
ListItem* dlllist = NULL;
- static const TCHAR format[] = TEXT("\xa4 %s v.%s%d.%d.%d.%d%s [%s] - %S %s\r\n");
+ static const wchar_t format[] = TEXT("\xa4 %s v.%s%d.%d.%d.%d%s [%s] - %S %s\r\n");
do {
bool loaded = false;
@@ -201,7 +201,7 @@ static void GetPluginsString(CMString& buffer, unsigned& flags)
}
if (hModule == NULL) {
if ((flags & VI_FLAG_PRNVAR) && IsPluginEnabled(FindFileData.cFileName)) {
- TCHAR timebuf[30] = TEXT("");
+ wchar_t timebuf[30] = TEXT("");
GetLastWriteTime(&FindFileData.ftLastWriteTime, timebuf, 30);
ubuffer.AppendFormat(format, FindFileData.cFileName,
@@ -220,10 +220,10 @@ static void GetPluginsString(CMString& buffer, unsigned& flags)
PLUGININFOEX* pi = GetMirInfo(hModule);
if (pi != NULL) {
- TCHAR timebuf[30] = TEXT("");
+ wchar_t timebuf[30] = TEXT("");
GetLastWriteTime(&FindFileData.ftLastWriteTime, timebuf, 30);
- const TCHAR *unica = !(((PLUGININFOEX*)pi)->flags & UNICODE_AWARE) ? TEXT("|ANSI|") : TEXT("");
+ const wchar_t *unica = !(((PLUGININFOEX*)pi)->flags & UNICODE_AWARE) ? TEXT("|ANSI|") : TEXT("");
ListItem* lst = new ListItem;
int v1, v2, v3, v4;
@@ -345,17 +345,17 @@ static void GetProtocolStrings(CMString& buffer)
for (i = 0; i < protoCountMy; i++)
buffer.AppendFormat(TEXT("%-24s %d - Enabled %d - Disabled %sLoaded\r\n"),
- (TCHAR*)_A2T(protoListMy[i]), protos[i].countse,
+ (wchar_t*)_A2T(protoListMy[i]), protos[i].countse,
protos[i].countsd, protos[i].nloaded ? L"Not " : L"");
}
static void GetWeatherStrings(CMString& buffer, unsigned flags)
{
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
GetModuleFileName(NULL, path, MAX_PATH);
- LPTSTR fname = _tcsrchr(path, TEXT('\\'));
+ LPTSTR fname = wcsrchr(path, TEXT('\\'));
if (fname == NULL) fname = path;
mir_sntprintf(fname, MAX_PATH - (fname - path), TEXT("\\plugins\\weather\\*.ini"));
@@ -399,11 +399,11 @@ static void GetWeatherStrings(CMString& buffer, unsigned flags)
id += 5;
}
- TCHAR timebuf[30] = TEXT("");
+ wchar_t timebuf[30] = TEXT("");
GetLastWriteTime(&FindFileData.ftLastWriteTime, timebuf, 30);
- static const TCHAR format[] = TEXT(" %s v.%s%S%s [%s] - %S\r\n");
+ static const wchar_t format[] = TEXT(" %s v.%s%S%s [%s] - %S\r\n");
buffer.AppendFormat(format, FindFileData.cFileName,
(flags & VI_FLAG_FORMAT) ? TEXT("[b]") : TEXT(""),
@@ -419,10 +419,10 @@ static void GetWeatherStrings(CMString& buffer, unsigned flags)
static void GetIconStrings(CMString& buffer)
{
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
GetModuleFileName(NULL, path, MAX_PATH);
- LPTSTR fname = _tcsrchr(path, TEXT('\\'));
+ LPTSTR fname = wcsrchr(path, TEXT('\\'));
if (fname == NULL) fname = path;
mir_sntprintf(fname, MAX_PATH - (fname - path), TEXT("\\Icons\\*.*"));
@@ -433,7 +433,7 @@ static void GetIconStrings(CMString& buffer)
do {
if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue;
- TCHAR timebuf[30] = TEXT("");
+ wchar_t timebuf[30] = TEXT("");
GetLastWriteTime(&FindFileData.ftLastWriteTime, timebuf, 30);
buffer.AppendFormat(TEXT(" %s [%s]\r\n"), FindFileData.cFileName, timebuf);
@@ -450,7 +450,7 @@ void PrintVersionInfo(CMString& buffer, unsigned flags)
GetFreeMemoryString(buffer);
buffer.Append(L"\r\n");
- TCHAR tszOsVer[200];
+ wchar_t tszOsVer[200];
GetOSDisplayString(tszOsVer, _countof(tszOsVer));
buffer.Append(tszOsVer);
buffer.Append(L"\r\n");
@@ -464,7 +464,7 @@ void PrintVersionInfo(CMString& buffer, unsigned flags)
GetLanguageString(buffer);
buffer.Append(L"\r\n");
- TCHAR *profpathfull = Utils_ReplaceVarsT(profpath);
+ wchar_t *profpathfull = Utils_ReplaceVarsT(profpath);
if (flags & VI_FLAG_PRNVAR) {
GetFreeDiskString(profpathfull, buffer);
buffer.Append(L"\r\n");
@@ -474,12 +474,12 @@ void PrintVersionInfo(CMString& buffer, unsigned flags)
GetWow64String(buffer);
buffer.Append(L"\r\n");
- TCHAR path[MAX_PATH], mirtime[30];
+ wchar_t path[MAX_PATH], mirtime[30];
GetModuleFileName(NULL, path, MAX_PATH);
GetLastWriteTime(path, mirtime, 30);
buffer.AppendFormat(TEXT("Build time: %s\r\n"), mirtime);
- TCHAR profpn[MAX_PATH];
+ wchar_t profpn[MAX_PATH];
mir_sntprintf(profpn, TEXT("%s\\%s"), profpathfull, profname);
DATABASELINK *db = FindDatabasePlugin(profpn);
@@ -505,8 +505,8 @@ void PrintVersionInfo(CMString& buffer, unsigned flags)
GetLanguagePackString(buffer);
buffer.Append(L"\r\n");
- // buffer.AppendFormat(TEXT("Nightly: %s\r\n"), _tcsstr(vertxt, TEXT("alpha")) ? TEXT("Yes") : TEXT("No"));
- // buffer.AppendFormat(TEXT("Unicode: %s\r\n"), _tcsstr(vertxt, TEXT("Unicode")) ? TEXT("Yes") : TEXT("No"));
+ // buffer.AppendFormat(TEXT("Nightly: %s\r\n"), wcsstr(vertxt, TEXT("alpha")) ? TEXT("Yes") : TEXT("No"));
+ // buffer.AppendFormat(TEXT("Unicode: %s\r\n"), wcsstr(vertxt, TEXT("Unicode")) ? TEXT("Yes") : TEXT("No"));
GetPluginsString(buffer, flags);
@@ -541,7 +541,7 @@ void PrintVersionInfo(CMString& buffer, unsigned flags)
}
-void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const TCHAR* msg)
+void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const wchar_t* msg)
{
if (exc_ptr->ContextRecord == NULL || (exc_ptr->ContextRecord->ContextFlags & CONTEXT_CONTROL) == 0)
return;
@@ -573,7 +573,7 @@ void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const TCHA
const PLUGININFOEX *pluginInfoEx = GetPluginInfoEx();
- TCHAR curtime[30];
+ wchar_t curtime[30];
GetISO8061Time(NULL, curtime, 30);
CMString buffer;
@@ -596,7 +596,7 @@ void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const TCHA
buffer.Append(TEXT("\r\nStack Trace:\r\n---------------------------------------------------------------\r\n"));
for (int i = 81; --i;) {
- char symbuf[sizeof(IMAGEHLP_SYMBOL64) + MAX_SYM_NAME * sizeof(TCHAR) + 4] = { 0 };
+ char symbuf[sizeof(IMAGEHLP_SYMBOL64) + MAX_SYM_NAME * sizeof(wchar_t) + 4] = { 0 };
PIMAGEHLP_SYMBOL64 pSym = (PIMAGEHLP_SYMBOL64)symbuf;
pSym->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64);
pSym->MaxNameLength = MAX_SYM_NAME;
@@ -651,7 +651,7 @@ void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const TCHA
HMODULE hModule = (HMODULE)Module.BaseOfImage;
PLUGININFOEX *pi = GetMirInfo(hModule);
if (pi != NULL) {
- static const TCHAR formatc[] = TEXT("\r\nLikely cause of the crash plugin: %S\r\n\r\n");
+ static const wchar_t formatc[] = TEXT("\r\nLikely cause of the crash plugin: %S\r\n\r\n");
if (pi->shortName) {
CMString crashcause;
@@ -663,7 +663,7 @@ void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const TCHA
}
- static const TCHAR formatd[] = TEXT("%p (%S %p): %S (%d): %S\r\n");
+ static const wchar_t formatd[] = TEXT("%p (%S %p): %S (%d): %S\r\n");
buffer.AppendFormat(formatd, (void*)frame.AddrPC.Offset, moduleName, (void*)Module.BaseOfImage,lineFileName, Line.LineNumber, name);
}
diff --git a/plugins/CrashDumper/src/exhndlr.cpp b/plugins/CrashDumper/src/exhndlr.cpp
index c690bdc9d2..6fbace54c1 100644
--- a/plugins/CrashDumper/src/exhndlr.cpp
+++ b/plugins/CrashDumper/src/exhndlr.cpp
@@ -46,7 +46,7 @@ int myDebugFilter(unsigned int code, PEXCEPTION_POINTERS ep)
void myfilterWorker(PEXCEPTION_POINTERS exc_ptr, bool notify)
{
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
SYSTEMTIME st;
HANDLE hDumpFile = NULL;
diff --git a/plugins/CrashDumper/src/stdafx.h b/plugins/CrashDumper/src/stdafx.h
index 64b86b2da7..f7abf43d21 100644
--- a/plugins/CrashDumper/src/stdafx.h
+++ b/plugins/CrashDumper/src/stdafx.h
@@ -92,8 +92,8 @@ extern DWORD mirandaVersion;
extern LCID packlcid;
extern bool servicemode, clsdates, dtsubfldr, catchcrashes, needrestart;
-extern TCHAR CrashLogFolder[MAX_PATH];
-extern TCHAR VersionInfoFolder[MAX_PATH];
+extern wchar_t CrashLogFolder[MAX_PATH];
+extern wchar_t VersionInfoFolder[MAX_PATH];
void WriteBBFile(CMString& buffer, bool hdr);
void WriteUtfFile(HANDLE hDumpFile, char* bufu);
@@ -119,14 +119,14 @@ void ReadableExceptionInfo(PEXCEPTION_RECORD excrec, CMString& buffer);
void GetLastWriteTime(LPCTSTR fileName, LPTSTR lpszString, DWORD dwSize);
void GetLastWriteTime(FILETIME* ftime, LPTSTR lpszString, DWORD dwSize);
void StoreStringToClip(CMString& buffer);
-void ShowMessage(int type, const TCHAR* format, ...);
-bool IsPluginEnabled(TCHAR* filename);
+void ShowMessage(int type, const wchar_t* format, ...);
+bool IsPluginEnabled(wchar_t* filename);
PLUGININFOEX* GetMirInfo(HMODULE hModule);
const PLUGININFOEX* GetPluginInfoEx(void);
void CreateMiniDump(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr);
-void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const TCHAR* msg);
+void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const wchar_t* msg);
void PrintVersionInfo(CMString& buffer, unsigned flags = VI_FLAG_PRNVAR);
bool ProcessVIHash(bool store);
diff --git a/plugins/CrashDumper/src/ui.cpp b/plugins/CrashDumper/src/ui.cpp
index 34f82b15a3..14e018aa2f 100644
--- a/plugins/CrashDumper/src/ui.cpp
+++ b/plugins/CrashDumper/src/ui.cpp
@@ -278,7 +278,7 @@ LRESULT CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
break;
case 3:
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
mir_sntprintf(path, TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
ShellExecute(NULL, TEXT("open"), path, NULL, NULL, SW_SHOW);
break;
@@ -295,7 +295,7 @@ LRESULT CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
return DefWindowProc(hWnd, msg, wParam, lParam);
}
-void ShowMessage(int type, const TCHAR* format, ...)
+void ShowMessage(int type, const wchar_t* format, ...)
{
POPUPDATAT pi = { 0 };
diff --git a/plugins/CrashDumper/src/upload.cpp b/plugins/CrashDumper/src/upload.cpp
index fbd87e2f5c..ad180b0589 100644
--- a/plugins/CrashDumper/src/upload.cpp
+++ b/plugins/CrashDumper/src/upload.cpp
@@ -235,7 +235,7 @@ bool ProcessVIHash(bool store)
mir_md5_state_t context;
mir_md5_init(&context);
- mir_md5_append(&context, (PBYTE)buffer.c_str(), buffer.GetLength()*sizeof(TCHAR));
+ mir_md5_append(&context, (PBYTE)buffer.c_str(), buffer.GetLength()*sizeof(wchar_t));
mir_md5_finish(&context, hash);
char hashstr[40];
diff --git a/plugins/CrashDumper/src/utils.cpp b/plugins/CrashDumper/src/utils.cpp
index 4abad60ed6..356bf6a8a1 100644
--- a/plugins/CrashDumper/src/utils.cpp
+++ b/plugins/CrashDumper/src/utils.cpp
@@ -105,9 +105,9 @@ void GetInternetExplorerVersion(CMString &buffer)
HKEY hKey;
DWORD size;
- TCHAR ieVersion[1024] = { 0 };
- TCHAR ieBuild[512] = { 0 };
- TCHAR iVer[64] = { 0 };
+ wchar_t ieVersion[1024] = { 0 };
+ wchar_t ieBuild[512] = { 0 };
+ wchar_t iVer[64] = { 0 };
if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\Internet Explorer"), 0, KEY_QUERY_VALUE, &hKey)) {
size = _countof(ieBuild);
@@ -144,9 +144,9 @@ void GetInternetExplorerVersion(CMString &buffer)
buffer.AppendFormat(TEXT(" (build %s)"), ieBuild);
}
-void TrimMultiSpaces(TCHAR *str)
+void TrimMultiSpaces(wchar_t *str)
{
- TCHAR *src = str, *dest = str;
+ wchar_t *src = str, *dest = str;
bool trimst = false;
for (;;) {
@@ -169,8 +169,8 @@ void GetProcessorString(CMString &buffer)
HKEY hKey;
DWORD size;
- TCHAR cpuIdent[512] = { 0 };
- TCHAR cpuName[512] = { 0 };
+ wchar_t cpuIdent[512] = { 0 };
+ wchar_t cpuName[512] = { 0 };
if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Hardware\\Description\\System\\CentralProcessor\\0"), 0, KEY_QUERY_VALUE, &hKey)) {
size = _countof(cpuName);
@@ -343,7 +343,7 @@ void GetAdminString(CMString &buffer)
void GetLanguageString(CMString &buffer)
{
- TCHAR name1[256], name2[256], name3[256], name4[256];
+ wchar_t name1[256], name2[256], name3[256], name4[256];
GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SENGLANGUAGE, name1, 256);
GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SENGLANGUAGE, name2, 256);
@@ -358,7 +358,7 @@ void GetLanguagePackString(CMString &buffer)
{
buffer.Append(TEXT("Language pack: "));
if (packlcid != LOCALE_USER_DEFAULT) {
- TCHAR lang[MAX_PATH], ctry[MAX_PATH];
+ wchar_t lang[MAX_PATH], ctry[MAX_PATH];
if (GetLocaleInfo(packlcid, LOCALE_SENGLANGUAGE, lang, MAX_PATH)) {
if (GetLocaleInfo(packlcid, LOCALE_SISO3166CTRYNAME, ctry, MAX_PATH))
buffer.AppendFormat(TEXT("%s (%s) [%04x]"), lang, ctry, packlcid);
@@ -408,7 +408,7 @@ void GetVersionInfo(HMODULE hLib, CMString& buffer)
void StoreStringToClip(CMString& buffer)
{
- int bufLen = (buffer.GetLength() + 1) * sizeof(TCHAR);
+ int bufLen = (buffer.GetLength() + 1) * sizeof(wchar_t);
HANDLE hData = GlobalAlloc(GMEM_MOVEABLE, bufLen);
LPSTR buf = (LPSTR)GlobalLock(hData);
@@ -425,7 +425,7 @@ void StoreStringToClip(CMString& buffer)
}
}
-bool IsPluginEnabled(TCHAR* filename)
+bool IsPluginEnabled(wchar_t* filename)
{
char* fname;
crsi_t2a(fname, filename);
diff --git a/plugins/Db3x_mmap/src/database.cpp b/plugins/Db3x_mmap/src/database.cpp
index d5ff51a4a4..06cfcaf963 100644
--- a/plugins/Db3x_mmap/src/database.cpp
+++ b/plugins/Db3x_mmap/src/database.cpp
@@ -76,9 +76,9 @@ DWORD CDb3Mmap::ReallocSpace(DWORD ofs, int oldSize, int newSize)
/////////////////////////////////////////////////////////////////////////////////////////
static DWORD DatabaseCorrupted = 0;
-static TCHAR *msg = NULL;
+static wchar_t *msg = NULL;
static DWORD dwErr = 0;
-static TCHAR tszPanic[] = LPGENT("Miranda has detected corruption in your database. This corruption may be fixed by DbChecker plugin. Please download it from http://miranda-ng.org/p/DbChecker/. Miranda will now shut down.");
+static wchar_t tszPanic[] = LPGENW("Miranda has detected corruption in your database. This corruption may be fixed by DbChecker plugin. Please download it from http://miranda-ng.org/p/DbChecker/. Miranda will now shut down.");
void __cdecl dbpanic(void *)
{
@@ -86,7 +86,7 @@ void __cdecl dbpanic(void *)
if (dwErr == ERROR_DISK_FULL)
msg = TranslateT("Disk is full. Miranda will now shut down.");
- TCHAR err[256];
+ wchar_t err[256];
mir_sntprintf(err, msg, TranslateT("Database failure. Miranda will now shut down."), dwErr);
MessageBox(0, err, TranslateT("Database Error"), MB_SETFOREGROUND | MB_TOPMOST | MB_APPLMODAL | MB_ICONWARNING | MB_OK);
@@ -95,7 +95,7 @@ void __cdecl dbpanic(void *)
TerminateProcess(GetCurrentProcess(), 255);
}
-void CDb3Mmap::DatabaseCorruption(TCHAR *text)
+void CDb3Mmap::DatabaseCorruption(wchar_t *text)
{
int kill = 0;
diff --git a/plugins/Db3x_mmap/src/dbheaders.cpp b/plugins/Db3x_mmap/src/dbheaders.cpp
index 8662142d0d..8cd51d5a6b 100644
--- a/plugins/Db3x_mmap/src/dbheaders.cpp
+++ b/plugins/Db3x_mmap/src/dbheaders.cpp
@@ -55,8 +55,8 @@ int CDb3Mmap::CreateDbHeaders(const DBSignature& _sign)
/////////////////////////////////////////////////////////////////////////////////////////
-static TCHAR tszOldHeaders[] =
-LPGENT("This profile is too old to be updated with PluginUpdater, your database must be converted first.\n\nWould you like to read how to fix this?");
+static wchar_t tszOldHeaders[] =
+LPGENW("This profile is too old to be updated with PluginUpdater, your database must be converted first.\n\nWould you like to read how to fix this?");
int CDb3Mmap::CheckDbHeaders(bool bInteractive)
{
@@ -70,9 +70,9 @@ int CDb3Mmap::CheckDbHeaders(bool bInteractive)
if (!memcmp(&m_dbHeader.signature, &dbSignatureSD, sizeof(m_dbHeader.signature))) {
if (bInteractive)
if (IDYES == MessageBox(NULL, TranslateTS(tszOldHeaders), TranslateT("Obsolete database format"), MB_YESNO | MB_ICONWARNING)) {
- TCHAR tszCurPath[MAX_PATH];
+ wchar_t tszCurPath[MAX_PATH];
GetModuleFileName(NULL, tszCurPath, _countof(tszCurPath));
- TCHAR *p = _tcsrchr(tszCurPath, '\\');
+ wchar_t *p = wcsrchr(tszCurPath, '\\');
if (p) *p = 0;
HKEY hPathSetting;
diff --git a/plugins/Db3x_mmap/src/dbintf.cpp b/plugins/Db3x_mmap/src/dbintf.cpp
index 18735f7c44..f831b627b8 100644
--- a/plugins/Db3x_mmap/src/dbintf.cpp
+++ b/plugins/Db3x_mmap/src/dbintf.cpp
@@ -44,7 +44,7 @@ static int stringCompare2(const char *p1, const char *p2)
return mir_strcmp(p1, p2);
}
-CDb3Mmap::CDb3Mmap(const TCHAR *tszFileName, int iMode) :
+CDb3Mmap::CDb3Mmap(const wchar_t *tszFileName, int iMode) :
m_hDbFile(INVALID_HANDLE_VALUE),
m_safetyMode(true),
m_bReadOnly((iMode & DBMODE_READONLY) != 0),
diff --git a/plugins/Db3x_mmap/src/dbintf.h b/plugins/Db3x_mmap/src/dbintf.h
index 9a5b690799..dc21944426 100644
--- a/plugins/Db3x_mmap/src/dbintf.h
+++ b/plugins/Db3x_mmap/src/dbintf.h
@@ -183,7 +183,7 @@ struct DBCachedContact : public DBCachedContactBase
struct CDb3Mmap : public MIDatabase, public MIDatabaseChecker, public MZeroedObject
{
- CDb3Mmap(const TCHAR *tszFileName, int mode);
+ CDb3Mmap(const wchar_t *tszFileName, int mode);
~CDb3Mmap();
int Load(bool bSkipInit);
@@ -193,14 +193,14 @@ struct CDb3Mmap : public MIDatabase, public MIDatabaseChecker, public MZeroedObj
void ToggleEncryption(void);
void StoreKey(void);
- void SetPassword(const TCHAR *ptszPassword);
+ void SetPassword(const wchar_t *ptszPassword);
void UpdateMenuItem(void);
int PrepareCheck(int*);
- __forceinline LPTSTR GetMenuTitle() const { return m_bUsesPassword ? LPGENT("Change/remove password") : LPGENT("Set password"); }
+ __forceinline LPTSTR GetMenuTitle() const { return m_bUsesPassword ? LPGENW("Change/remove password") : LPGENW("Set password"); }
- void DatabaseCorruption(TCHAR *text);
+ void DatabaseCorruption(wchar_t *text);
void WriteSignature(DBSignature&);
__forceinline HANDLE getFile() const { return m_hDbFile; }
@@ -282,7 +282,7 @@ public: // Check functions
int WorkFinalTasks(int);
protected:
- TCHAR* m_tszProfileName;
+ wchar_t* m_tszProfileName;
HANDLE m_hDbFile;
DBHeader m_dbHeader;
DWORD m_ChunkSize;
diff --git a/plugins/Db3x_mmap/src/dbtool/modulechain.cpp b/plugins/Db3x_mmap/src/dbtool/modulechain.cpp
index cdfc9b3cc9..16ff76df78 100644
--- a/plugins/Db3x_mmap/src/dbtool/modulechain.cpp
+++ b/plugins/Db3x_mmap/src/dbtool/modulechain.cpp
@@ -96,9 +96,9 @@ int CDb3Mmap::WorkModuleChain(int firstTime)
n++;
}
if (n) {
- TCHAR szModuleName[257];
+ wchar_t szModuleName[257];
MultiByteToWideChar(CP_ACP, 0, modChain[iCurrentModName].name, -1, szModuleName, _countof(szModuleName));
- TCHAR *pszModuleName = szModuleName;
+ wchar_t *pszModuleName = szModuleName;
cb->pfnAddLogMessage(STATUS_WARNING, TranslateT("Module name '%s' is not unique: %d duplicates found"), pszModuleName, n);
}
diff --git a/plugins/Db3x_mmap/src/init.cpp b/plugins/Db3x_mmap/src/init.cpp
index ad2b9130aa..1480ad214a 100644
--- a/plugins/Db3x_mmap/src/init.cpp
+++ b/plugins/Db3x_mmap/src/init.cpp
@@ -47,7 +47,7 @@ LIST<CDb3Mmap> g_Dbs(1, HandleKeySortT);
/////////////////////////////////////////////////////////////////////////////////////////
// returns 0 if the profile is created, EMKPRF*
-static int makeDatabase(const TCHAR *profile)
+static int makeDatabase(const wchar_t *profile)
{
std::auto_ptr<CDb3Mmap> db(new CDb3Mmap(profile, 0));
if (db->Create() != ERROR_SUCCESS)
@@ -57,7 +57,7 @@ static int makeDatabase(const TCHAR *profile)
}
// returns 0 if the given profile has a valid header
-static int grokHeader(const TCHAR *profile)
+static int grokHeader(const wchar_t *profile)
{
std::auto_ptr<CDb3Mmap> db(new CDb3Mmap(profile, DBMODE_SHARED | DBMODE_READONLY));
if (db->Load(true) != ERROR_SUCCESS)
@@ -67,7 +67,7 @@ static int grokHeader(const TCHAR *profile)
}
// returns 0 if all the APIs are injected otherwise, 1
-static MIDatabase* LoadDatabase(const TCHAR *profile, BOOL bReadOnly)
+static MIDatabase* LoadDatabase(const wchar_t *profile, BOOL bReadOnly)
{
// set the memory, lists & UTF8 manager
mir_getLP(&pluginInfo);
@@ -87,7 +87,7 @@ static int UnloadDatabase(MIDatabase *db)
return 0;
}
-MIDatabaseChecker* CheckDb(const TCHAR *profile, int *error)
+MIDatabaseChecker* CheckDb(const wchar_t *profile, int *error)
{
std::auto_ptr<CDb3Mmap> db(new CDb3Mmap(profile, DBMODE_READONLY));
if (db->Load(true) != ERROR_SUCCESS) {
diff --git a/plugins/Db3x_mmap/src/ui.cpp b/plugins/Db3x_mmap/src/ui.cpp
index e29e8f0ec2..36896352e4 100644
--- a/plugins/Db3x_mmap/src/ui.cpp
+++ b/plugins/Db3x_mmap/src/ui.cpp
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct DlgChangePassParam
{
CDb3Mmap *db;
- TCHAR newPass[100];
+ wchar_t newPass[100];
int wrongPass;
};
@@ -141,7 +141,7 @@ bool CDb3Mmap::EnterPassword(const BYTE *pKey, const size_t keyLen)
static bool CheckOldPassword(HWND hwndDlg, CDb3Mmap *db)
{
if (db->usesPassword()) {
- TCHAR buf[100];
+ wchar_t buf[100];
GetDlgItemText(hwndDlg, IDC_OLDPASS, buf, _countof(buf));
if (!db->m_crypto->checkPassword(T2Utf(buf))) {
SetDlgItemText(hwndDlg, IDC_HEADERBAR, TranslateT("Wrong old password entered!"));
@@ -154,7 +154,7 @@ static bool CheckOldPassword(HWND hwndDlg, CDb3Mmap *db)
static INT_PTR CALLBACK sttChangePassword(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
DlgChangePassParam *param = (DlgChangePassParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- TCHAR buf[100];
+ wchar_t buf[100];
switch (uMsg) {
case WM_INITDIALOG:
@@ -199,7 +199,7 @@ static INT_PTR CALLBACK sttChangePassword(HWND hwndDlg, UINT uMsg, WPARAM wParam
break;
case IDOK:
- TCHAR buf2[100];
+ wchar_t buf2[100];
GetDlgItemText(hwndDlg, IDC_USERPASS1, buf2, _countof(buf2));
if (mir_tstrlen(buf2) < 3) {
SetDlgItemText(hwndDlg, IDC_HEADERBAR, TranslateT("Password is too short!"));
@@ -313,13 +313,13 @@ static int OnModulesLoaded(PVOID obj, WPARAM, LPARAM)
CMenuItem mi;
// main menu item
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Database"), 500000000, iconList[0].hIcolib);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Database"), 500000000, iconList[0].hIcolib);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "F7C5567C-D1EE-484B-B4F6-24677A5AAAEF");
SET_UID(mi, 0x50321866, 0xba1, 0x46dd, 0xb3, 0xa6, 0xc3, 0xcc, 0x55, 0xf2, 0x42, 0x9e);
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = iconList[1].hIcolib;
- mi.name.t = db->GetMenuTitle();
+ mi.name.w = db->GetMenuTitle();
mi.pszService = MS_DB_CHANGEPASSWORD;
hSetPwdMenu = Menu_AddMainMenuItem(&mi);
return 0;
diff --git a/plugins/DbChecker/src/main.cpp b/plugins/DbChecker/src/main.cpp
index 54166a4afb..80ff103a0c 100644
--- a/plugins/DbChecker/src/main.cpp
+++ b/plugins/DbChecker/src/main.cpp
@@ -73,7 +73,7 @@ static INT_PTR CheckProfile(WPARAM wParam, LPARAM lParam)
bLaunchMiranda = lParam != 0;
bAutoExit = lParam == 2;
bServiceMode = false;
- _tcsncpy(opts.filename, (TCHAR*)wParam, _countof(opts.filename));
+ wcsncpy(opts.filename, (wchar_t*)wParam, _countof(opts.filename));
return DialogBox(hInst, MAKEINTRESOURCE(IDD_WIZARD), NULL, WizardDlgProc);
}
diff --git a/plugins/DbChecker/src/openerror.cpp b/plugins/DbChecker/src/openerror.cpp
index 49d4b88bf7..a5ea7c99a6 100644
--- a/plugins/DbChecker/src/openerror.cpp
+++ b/plugins/DbChecker/src/openerror.cpp
@@ -28,7 +28,7 @@ INT_PTR CALLBACK OpenErrorDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM
switch (message) {
case WM_INITDIALOG:
{
- TCHAR szError[256];
+ wchar_t szError[256];
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, opts.error, 0, szError, _countof(szError), NULL);
SetDlgItemText(hdlg, IDC_ERRORTEXT, szError);
}
diff --git a/plugins/DbChecker/src/progress.cpp b/plugins/DbChecker/src/progress.cpp
index 7d6edd8d75..e5dce00b3f 100644
--- a/plugins/DbChecker/src/progress.cpp
+++ b/plugins/DbChecker/src/progress.cpp
@@ -28,12 +28,12 @@ HANDLE hEventRun = NULL, hEventAbort = NULL;
int errorCount;
LRESULT wizardResult;
-void AddToStatus(int flags, const TCHAR* fmt, ...)
+void AddToStatus(int flags, const wchar_t* fmt, ...)
{
va_list vararg;
va_start(vararg, fmt);
- TCHAR str[256];
+ wchar_t str[256];
mir_vsntprintf(str, _countof(str), fmt, vararg);
va_end(vararg);
@@ -120,7 +120,7 @@ INT_PTR CALLBACK ProgressDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM
return TRUE;
case WM_DRAWITEM:
- TCHAR str[256];
+ wchar_t str[256];
{
LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
int bold = 0;
diff --git a/plugins/DbChecker/src/selectdb.cpp b/plugins/DbChecker/src/selectdb.cpp
index 1f44e9913d..3b4cebdc58 100644
--- a/plugins/DbChecker/src/selectdb.cpp
+++ b/plugins/DbChecker/src/selectdb.cpp
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-static bool CheckBroken(const TCHAR *ptszFullPath)
+static bool CheckBroken(const wchar_t *ptszFullPath)
{
DATABASELINK *dblink = FindDatabasePlugin(ptszFullPath);
if (dblink == NULL || dblink->CheckDB == NULL)
@@ -30,7 +30,7 @@ static bool CheckBroken(const TCHAR *ptszFullPath)
int OpenDatabase(HWND hdlg, INT iNextPage)
{
- TCHAR tszMsg[1024];
+ wchar_t tszMsg[1024];
int error = 0;
if (opts.dbChecker == NULL) {
@@ -73,9 +73,9 @@ int OpenDatabase(HWND hdlg, INT iNextPage)
return true;
}
-void GetProfileDirectory(TCHAR* szMirandaDir, TCHAR* szPath, int cbPath)
+void GetProfileDirectory(wchar_t* szMirandaDir, wchar_t* szPath, int cbPath)
{
- TCHAR szProfileDir[MAX_PATH], szExpandedProfileDir[MAX_PATH], szMirandaBootIni[MAX_PATH];
+ wchar_t szProfileDir[MAX_PATH], szExpandedProfileDir[MAX_PATH], szMirandaBootIni[MAX_PATH];
mir_tstrcpy(szMirandaBootIni, szMirandaDir);
mir_tstrcat(szMirandaBootIni, L"\\mirandaboot.ini");
@@ -88,57 +88,57 @@ void GetProfileDirectory(TCHAR* szMirandaDir, TCHAR* szPath, int cbPath)
szPath[mir_tstrlen(szPath) - 1] = 0;
}
-static int AddDatabaseToList(HWND hwndList, const TCHAR* filename, TCHAR* dir)
+static int AddDatabaseToList(HWND hwndList, const wchar_t* filename, wchar_t* dir)
{
LV_ITEM lvi;
lvi.mask = LVIF_PARAM;
lvi.iSubItem = 0;
for (lvi.iItem = ListView_GetItemCount(hwndList) - 1; lvi.iItem >= 0; lvi.iItem--) {
ListView_GetItem(hwndList, &lvi);
- if (!mir_tstrcmpi((TCHAR*)lvi.lParam, filename))
+ if (!mir_tstrcmpi((wchar_t*)lvi.lParam, filename))
return lvi.iItem;
}
struct _stat st;
- if (_tstat(filename, &st) == -1)
+ if (_wstat(filename, &st) == -1)
return -1;
DWORD totalSize = st.st_size;
bool isBroken = CheckBroken(filename);
- const TCHAR *pName = _tcsrchr(filename, '\\');
+ const wchar_t *pName = wcsrchr(filename, '\\');
if (pName == NULL)
pName = (LPTSTR)filename;
else
pName++;
- TCHAR szName[MAX_PATH];
+ wchar_t szName[MAX_PATH];
mir_sntprintf(szName, L"%s%s", dir, pName);
- TCHAR *pDot = _tcsrchr(szName, '.');
+ wchar_t *pDot = wcsrchr(szName, '.');
if (pDot != NULL && !mir_tstrcmpi(pDot, L".dat"))
*pDot = 0;
lvi.iItem = 0;
lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
lvi.iSubItem = 0;
- lvi.lParam = (LPARAM)_tcsdup(filename);
+ lvi.lParam = (LPARAM)wcsdup(filename);
lvi.pszText = szName;
lvi.iImage = (isBroken) ? 1 : 0;
int iNewItem = ListView_InsertItem(hwndList, &lvi);
- TCHAR szSize[20];
+ wchar_t szSize[20];
mir_sntprintf(szSize, L"%.2lf MB", totalSize / 1048576.0);
ListView_SetItemText(hwndList, iNewItem, 1, szSize);
return iNewItem;
}
-void FindAdd(HWND hdlg, TCHAR *szProfileDir, TCHAR *szPrefix)
+void FindAdd(HWND hdlg, wchar_t *szProfileDir, wchar_t *szPrefix)
{
HANDLE hFind;
WIN32_FIND_DATA fd;
- TCHAR szSearchPath[MAX_PATH], szFilename[MAX_PATH];
+ wchar_t szSearchPath[MAX_PATH], szFilename[MAX_PATH];
mir_tstrcpy(szSearchPath, szProfileDir);
mir_tstrcat(szSearchPath, L"\\*.*");
@@ -150,14 +150,14 @@ void FindAdd(HWND hdlg, TCHAR *szProfileDir, TCHAR *szPrefix)
continue;
mir_sntprintf(szFilename, L"%s\\%s\\%s.dat", szProfileDir, fd.cFileName, fd.cFileName);
- if (_taccess(szFilename, 0) == 0)
+ if (_waccess(szFilename, 0) == 0)
AddDatabaseToList(GetDlgItem(hdlg, IDC_DBLIST), szFilename, szPrefix);
} while (FindNextFile(hFind, &fd));
FindClose(hFind);
}
}
-TCHAR *addstring(TCHAR *str, TCHAR *add)
+wchar_t *addstring(wchar_t *str, wchar_t *add)
{
mir_tstrcpy(str, add);
return str + mir_tstrlen(add) + 1;
@@ -191,16 +191,16 @@ INT_PTR CALLBACK SelectDbDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM
lvc.pszText = TranslateT("Total size");
ListView_InsertColumn(GetDlgItem(hdlg, IDC_DBLIST), 1, &lvc);
- TCHAR szMirandaPath[MAX_PATH];
+ wchar_t szMirandaPath[MAX_PATH];
GetModuleFileName(NULL, szMirandaPath, _countof(szMirandaPath));
- TCHAR *str2 = _tcsrchr(szMirandaPath, '\\');
+ wchar_t *str2 = wcsrchr(szMirandaPath, '\\');
if (str2 != NULL)
*str2 = 0;
int i = 0;
HKEY hKey;
- TCHAR szProfileDir[MAX_PATH];
- TCHAR szMirandaProfiles[MAX_PATH];
+ wchar_t szProfileDir[MAX_PATH];
+ wchar_t szMirandaProfiles[MAX_PATH];
DWORD cbData = _countof(szMirandaPath);
mir_tstrcpy(szMirandaProfiles, szMirandaPath);
@@ -259,13 +259,13 @@ INT_PTR CALLBACK SelectDbDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM
case IDC_OTHER:
{
OPENFILENAME ofn = { 0 };
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
// L"Miranda Databases (*.dat)\0*.DAT\0All Files (*)\0*\0";
- TCHAR *filter, *tmp, *tmp1, *tmp2;
+ wchar_t *filter, *tmp, *tmp1, *tmp2;
tmp1 = TranslateT("Miranda Databases (*.dat)");
tmp2 = TranslateT("All Files");
- filter = tmp = (TCHAR*)_alloca((mir_tstrlen(tmp1) + mir_tstrlen(tmp2) + 11)*sizeof(TCHAR));
+ filter = tmp = (wchar_t*)_alloca((mir_tstrlen(tmp1) + mir_tstrlen(tmp2) + 11)*sizeof(wchar_t));
tmp = addstring(tmp, tmp1);
tmp = addstring(tmp, L"*.DAT");
tmp = addstring(tmp, tmp2);
@@ -312,7 +312,7 @@ INT_PTR CALLBACK SelectDbDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM
if (lvi.iItem == -1) break;
lvi.mask = LVIF_PARAM;
ListView_GetItem(GetDlgItem(hdlg, IDC_DBLIST), &lvi);
- SetDlgItemText(hdlg, IDC_FILE, (TCHAR*)lvi.lParam);
+ SetDlgItemText(hdlg, IDC_FILE, (wchar_t*)lvi.lParam);
SendMessage(hdlg, WM_COMMAND, MAKEWPARAM(IDC_FILE, EN_CHANGE), (LPARAM)GetDlgItem(hdlg, IDC_FILE));
}
break;
diff --git a/plugins/DbChecker/src/stdafx.h b/plugins/DbChecker/src/stdafx.h
index c2235a6c4c..6f2f4b80c9 100644
--- a/plugins/DbChecker/src/stdafx.h
+++ b/plugins/DbChecker/src/stdafx.h
@@ -41,10 +41,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct DbToolOptions
{
- TCHAR filename[MAX_PATH];
- TCHAR workingFilename[MAX_PATH];
- TCHAR outputFilename[MAX_PATH];
- TCHAR backupFilename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
+ wchar_t workingFilename[MAX_PATH];
+ wchar_t outputFilename[MAX_PATH];
+ wchar_t backupFilename[MAX_PATH];
DATABASELINK *dblink;
MIDatabaseChecker* dbChecker;
HANDLE hOutFile;
@@ -74,6 +74,6 @@ INT_PTR CALLBACK OpenErrorDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM
int OpenDatabase(HWND hdlg, INT iNextPage);
#define STATUS_CLASSMASK 0x0f
-void AddToStatus(int flags, const TCHAR* fmt, ...);
+void AddToStatus(int flags, const wchar_t* fmt, ...);
void SetProgressBar(int perThou);
diff --git a/plugins/DbChecker/src/worker.cpp b/plugins/DbChecker/src/worker.cpp
index 674088d9f5..92ab1cf497 100644
--- a/plugins/DbChecker/src/worker.cpp
+++ b/plugins/DbChecker/src/worker.cpp
@@ -41,9 +41,9 @@ static void Finalize(time_t& ts)
}
if (opts.bBackup) {
- TCHAR dbPath[MAX_PATH], dbFile[MAX_PATH];
+ wchar_t dbPath[MAX_PATH], dbFile[MAX_PATH];
mir_tstrcpy(dbPath, opts.filename);
- TCHAR* str2 = _tcsrchr(dbPath, '\\');
+ wchar_t* str2 = wcsrchr(dbPath, '\\');
if (str2 != NULL) {
mir_tstrcpy(dbFile, str2 + 1);
*str2 = 0;
@@ -57,7 +57,7 @@ static void Finalize(time_t& ts)
mir_sntprintf(opts.backupFilename, TranslateT("%s\\Backup of %s"), dbPath, dbFile);
else
mir_sntprintf(opts.backupFilename, TranslateT("%s\\Backup (%d) of %s"), dbPath, i, dbFile);
- if (_taccess(opts.backupFilename, 0) == -1) break;
+ if (_waccess(opts.backupFilename, 0) == -1) break;
}
if (!MoveFile(opts.filename, opts.backupFilename))
@@ -87,7 +87,7 @@ void __cdecl WorkerThread(void *)
}
else {
mir_tstrcpy(opts.outputFilename, opts.filename);
- *_tcsrchr(opts.outputFilename, '.') = 0;
+ *wcsrchr(opts.outputFilename, '.') = 0;
mir_tstrcat(opts.outputFilename, TranslateT(" (Output).dat"));
opts.hOutFile = CreateFile(opts.outputFilename, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
if (opts.hOutFile == INVALID_HANDLE_VALUE) {
diff --git a/plugins/DbEditorPP/src/copymodule.cpp b/plugins/DbEditorPP/src/copymodule.cpp
index 424b43837f..042719fe53 100644
--- a/plugins/DbEditorPP/src/copymodule.cpp
+++ b/plugins/DbEditorPP/src/copymodule.cpp
@@ -27,7 +27,7 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar
SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam);
{
mac = (ModuleAndContact *)lParam;
- TCHAR name[NAME_SIZE], msg[MSG_SIZE];
+ wchar_t name[NAME_SIZE], msg[MSG_SIZE];
mir_sntprintf(msg, TranslateT("Copy module \"%s\""), _A2T(mac->module));
SetWindowText(hwnd, msg);
diff --git a/plugins/DbEditorPP/src/deletemodule.cpp b/plugins/DbEditorPP/src/deletemodule.cpp
index 4905fedd10..5bb46feefb 100644
--- a/plugins/DbEditorPP/src/deletemodule.cpp
+++ b/plugins/DbEditorPP/src/deletemodule.cpp
@@ -9,7 +9,7 @@ int deleteModule(MCONTACT hContact, const char *module, int confirm)
return 0;
if (confirm && db_get_b(NULL, modname, "WarnOnDelete", 1)) {
- TCHAR text[MSG_SIZE];
+ wchar_t text[MSG_SIZE];
mir_sntprintf(text, TranslateT("Are you sure you want to delete module \"%s\"?"), _A2T(module));
if (dlg(text, MB_YESNO | MB_ICONEXCLAMATION) == IDNO)
return 0;
@@ -75,11 +75,11 @@ INT_PTR CALLBACK DeleteModuleDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM)
{
switch (msg) {
case WM_INITDIALOG:
- SetWindowText(hwnd, LPGENT("Delete module from database... Loading"));
+ SetWindowText(hwnd, LPGENW("Delete module from database... Loading"));
EnableWindow(GetDlgItem(hwnd, IDC_CONTACTS), 0);
EnableWindow(GetDlgItem(hwnd, IDOK), 0);
- SetDlgItemText(hwnd, IDC_INFOTEXT, LPGENT("Delete module from database"));
- SetDlgItemText(hwnd, CHK_COPY2ALL, LPGENT("Delete from all contacts (including Settings)"));
+ SetDlgItemText(hwnd, IDC_INFOTEXT, LPGENW("Delete module from database"));
+ SetDlgItemText(hwnd, CHK_COPY2ALL, LPGENW("Delete from all contacts (including Settings)"));
EnableWindow(GetDlgItem(hwnd, CHK_COPY2ALL), 0);
CheckDlgButton(hwnd, CHK_COPY2ALL, BST_CHECKED);
TranslateDialogDefault(hwnd);
diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp
index ec10e43f29..40b0fd405a 100644
--- a/plugins/DbEditorPP/src/exportimport.cpp
+++ b/plugins/DbEditorPP/src/exportimport.cpp
@@ -1,15 +1,15 @@
#include "stdafx.h"
-TCHAR *GetFilter()
+wchar_t *GetFilter()
{
- static TCHAR filter[MAX_PATH];
+ static wchar_t filter[MAX_PATH];
mir_sntprintf(filter, L"%s%c*.ini%c%s%c*.*%c", TranslateT("INI Files"), 0, 0, TranslateT("All Files"), 0, 0);
return filter;
}
-int Openfile(TCHAR *outputFile, const char *module, int maxlen)
+int Openfile(wchar_t *outputFile, const char *module, int maxlen)
{
- TCHAR filename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
if (module) {
int n = 0;
@@ -17,13 +17,13 @@ int Openfile(TCHAR *outputFile, const char *module, int maxlen)
while (filename[n]) {
switch (filename[n]) {
- case _T('*'):
- case _T(':'):
- case _T('/'):
- case _T('?'):
- case _T('|'):
- case _T('\\'):
- filename[n] = _T('_');
+ case '*':
+ case ':':
+ case '/':
+ case '?':
+ case '|':
+ case '\\':
+ filename[n] = '_';
break;
}
n++;
@@ -148,10 +148,10 @@ void exportDB(MCONTACT hContact, const char *module)
if (!EnumModules(&modlist))
return;
- TCHAR fileName[MAX_PATH];
+ wchar_t fileName[MAX_PATH];
if (Openfile(fileName, (hContact == INVALID_CONTACT_ID) ? NULL : module, MAX_PATH)) {
- FILE *file = _tfopen(fileName, L"wt");
+ FILE *file = _wfopen(fileName, L"wt");
if (!file) {
msg(TranslateT("Couldn't open file for writing"));
return;
@@ -427,7 +427,7 @@ INT_PTR CALLBACK ImportDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara
TranslateDialogDefault(hwnd);
SendDlgItemMessage(hwnd, IDC_TEXT, EM_LIMITTEXT, (WPARAM)0x7FFFFFFF, 0);
- TCHAR name[NAME_SIZE], msg[MSG_SIZE];
+ wchar_t name[NAME_SIZE], msg[MSG_SIZE];
GetContactName((MCONTACT)lParam, NULL, name, _countof(name));
@@ -446,7 +446,7 @@ INT_PTR CALLBACK ImportDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara
MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_TEXT));
if (length) {
- TCHAR *data = (TCHAR*)mir_alloc((length + 1)*sizeof(TCHAR));
+ wchar_t *data = (wchar_t*)mir_alloc((length + 1)*sizeof(wchar_t));
GetDlgItemText(hwnd, IDC_TEXT, data, length + 1);
importSettings(hContact, T2Utf(data));
mir_free(data);
@@ -463,7 +463,7 @@ void ImportSettingsMenuItem(MCONTACT hContact)
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_IMPORT), hwnd2mainWindow, ImportDlgProc, hContact);
}
-int Openfile2Import(TCHAR *outputFiles, int maxlen)
+int Openfile2Import(wchar_t *outputFiles, int maxlen)
{
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
@@ -486,9 +486,9 @@ BOOL Exists(LPCTSTR strName)
void ImportSettingsFromFileMenuItem(MCONTACT hContact, const char *FilePath)
{
- TCHAR szFileNames[MAX_PATH * 10];
- TCHAR szPath[MAX_PATH] = { 0 };
- TCHAR szFile[MAX_PATH];
+ wchar_t szFileNames[MAX_PATH * 10];
+ wchar_t szPath[MAX_PATH] = { 0 };
+ wchar_t szFile[MAX_PATH];
DWORD offset = 0;
diff --git a/plugins/DbEditorPP/src/findwindow.cpp b/plugins/DbEditorPP/src/findwindow.cpp
index 0f07fb1934..3769825cd9 100644
--- a/plugins/DbEditorPP/src/findwindow.cpp
+++ b/plugins/DbEditorPP/src/findwindow.cpp
@@ -37,18 +37,18 @@ static int lastColumn = -1;
typedef struct {
HWND hwnd; // hwnd to item list
- TCHAR* search; // text to find
- TCHAR* replace; // text to replace
+ wchar_t* search; // text to find
+ wchar_t* replace; // text to replace
int options; // or'd about items
} FindInfo;
ColumnsSettings csResultList[] = {
- { LPGENT("Result"), 0, "Search0width", 100 },
- { LPGENT("Contact"), 1, "Search1width", 100 },
- { LPGENT("Module"), 2, "Search2width", 100 },
- { LPGENT("Setting"), 3, "Search3width", 100 },
- { LPGENT("Value"), 4, "Search4width", 150 },
+ { LPGENW("Result"), 0, "Search0width", 100 },
+ { LPGENW("Contact"), 1, "Search1width", 100 },
+ { LPGENW("Module"), 2, "Search2width", 100 },
+ { LPGENW("Setting"), 3, "Search3width", 100 },
+ { LPGENW("Value"), 4, "Search4width", 150 },
{0}
};
@@ -95,8 +95,8 @@ INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
if (GetWindowLongPtr(GetDlgItem(hwnd, IDC_SEARCH), GWLP_USERDATA)) // stop the search
SetWindowLongPtr(GetDlgItem(hwnd, IDC_SEARCH), GWLP_USERDATA, 0);
else {
- TCHAR text[FLD_SIZE];
- TCHAR replace[FLD_SIZE] = {0};
+ wchar_t text[FLD_SIZE];
+ wchar_t replace[FLD_SIZE] = {0};
if (!GetDlgItemText(hwnd, IDC_TEXT, text, _countof(text)) && !IsDlgButtonChecked(hwnd, IDC_EXACT)) break;
@@ -225,10 +225,10 @@ void newFindWindow() {
CreateDialog(hInst, MAKEINTRESOURCE(IDD_FIND), hwnd2mainWindow, FindWindowDlgProc);
}
-void ItemFound(HWND hwnd, MCONTACT hContact, const char *module, const char *setting, TCHAR* value, int type)
+void ItemFound(HWND hwnd, MCONTACT hContact, const char *module, const char *setting, wchar_t* value, int type)
{
- TCHAR name[NAME_SIZE];
- TCHAR* mode;
+ wchar_t name[NAME_SIZE];
+ wchar_t* mode;
if (type & F_REPLACED)
mode = TranslateT("Replaced");
@@ -429,7 +429,7 @@ void __cdecl FindSettings(LPVOID param)
// check in settings value
if (fi->options & F_SETVAL) {
- TCHAR *value = NULL;
+ wchar_t *value = NULL;
switch(dbv.type) {
@@ -437,7 +437,7 @@ void __cdecl FindSettings(LPVOID param)
case DBVT_WORD:
case DBVT_DWORD:
if ((fi->options & F_NUMSRCH) && numsearch == getNumericValue(&dbv)) {
- TCHAR *val = fi->search;
+ wchar_t *val = fi->search;
int flag = F_SETVAL;
if (fi->options & F_NUMREPL) {
@@ -468,7 +468,7 @@ void __cdecl FindSettings(LPVOID param)
if (FindMatchT(value, fi->search, fi->options)) {
foundCount++;
ptrT ptr;
- TCHAR *newValue = value;
+ wchar_t *newValue = value;
int flag = F_SETVAL;
if (fi->replace) {
@@ -567,7 +567,7 @@ void __cdecl FindSettings(LPVOID param)
} // for(module)
}
- TCHAR msg[MSG_SIZE];
+ wchar_t msg[MSG_SIZE];
mir_sntprintf(msg, TranslateT("Finished. Items found: %d / replaced: %d / deleted: %d"), foundCount, replaceCount, deleteCount);
SendDlgItemMessage(hwndParent, IDC_SBAR, SB_SETTEXT, 0, (LPARAM)msg);
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp
index b914c6a216..442237c4f6 100644
--- a/plugins/DbEditorPP/src/main.cpp
+++ b/plugins/DbEditorPP/src/main.cpp
@@ -113,7 +113,7 @@ int ModulesLoaded(WPARAM, LPARAM)
// Register menu item
CMenuItem mi;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Database"), 1900000001);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Database"), 1900000001);
SET_UID(mi, 0xe298849c, 0x1a8c, 0x4fc7, 0xa0, 0xf4, 0x78, 0x18, 0xf, 0xe2, 0xf7, 0xc9);
mi.position = 1900000001;
@@ -135,7 +135,7 @@ int ModulesLoaded(WPARAM, LPARAM)
hkd.dwFlags = HKD_TCHAR;
hkd.pszName = "hk_dbepp_open";
hkd.pszService = "DBEditorpp/MenuCommand";
- hkd.ptszDescription = LPGENT("Open Database Editor");
+ hkd.ptszDescription = LPGENW("Open Database Editor");
hkd.ptszSection = text;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_SHIFT | HOTKEYF_EXT, 'D');
Hotkey_Register(&hkd);
@@ -265,7 +265,7 @@ int WriteBlobFromString(MCONTACT hContact, const char *szModule, const char *szS
return res;
}
-TCHAR *DBVType(BYTE type)
+wchar_t *DBVType(BYTE type)
{
switch (type) {
case DBVT_BYTE: return L"BYTE";
@@ -312,14 +312,14 @@ int setNumericValue(MCONTACT hContact, const char *module, const char *setting,
return 0;
}
-int IsRealUnicode(TCHAR *value)
+int IsRealUnicode(wchar_t *value)
{
BOOL nonascii = 0;
WideCharToMultiByte(Langpack_GetDefaultCodePage(), WC_NO_BEST_FIT_CHARS, value, -1, NULL, 0, NULL, &nonascii);
return nonascii;
}
-int setTextValue(MCONTACT hContact, const char *module, const char *setting, TCHAR *value, int type)
+int setTextValue(MCONTACT hContact, const char *module, const char *setting, wchar_t *value, int type)
{
#ifdef _UNICODE
if (type == DBVT_UTF8 || type == DBVT_WCHAR)
@@ -415,7 +415,7 @@ int GetValueW(MCONTACT hContact, const char *module, const char *setting, WCHAR
return 0;
}
-int GetContactName(MCONTACT hContact, const char *proto, TCHAR *value, int maxlen)
+int GetContactName(MCONTACT hContact, const char *proto, wchar_t *value, int maxlen)
{
if (!value)
return 0;
@@ -427,7 +427,7 @@ int GetContactName(MCONTACT hContact, const char *proto, TCHAR *value, int maxle
char *szProto = (char*)proto;
char tmp[FLD_SIZE];
- TCHAR name[NAME_SIZE]; name[0] = 0;
+ wchar_t name[NAME_SIZE]; name[0] = 0;
if (hContact && (!proto || !proto[0]))
if (!db_get_static(hContact, "Protocol", "p", tmp, _countof(tmp)))
@@ -555,8 +555,8 @@ INT_PTR CALLBACK ColumnsCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam)
{
ColumnsSortParams params = *(ColumnsSortParams *)myParam;
const int maxSize = 1024;
- TCHAR text1[maxSize];
- TCHAR text2[maxSize];
+ wchar_t text1[maxSize];
+ wchar_t text2[maxSize];
ListView_GetItemText(params.hList, lParam1, params.column, text1, _countof(text1));
ListView_GetItemText(params.hList, lParam2, params.column, text2, _countof(text2));
diff --git a/plugins/DbEditorPP/src/main_window.cpp b/plugins/DbEditorPP/src/main_window.cpp
index 84248d6a5e..7351297335 100644
--- a/plugins/DbEditorPP/src/main_window.cpp
+++ b/plugins/DbEditorPP/src/main_window.cpp
@@ -112,7 +112,7 @@ LRESULT CALLBACK ModuleTreeSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
case WM_KEYUP:
if (wParam == VK_DELETE || wParam == VK_F2 || wParam == VK_F5 || wParam == VK_F3) {
TVITEM tvi;
- TCHAR text[FLD_SIZE];
+ wchar_t text[FLD_SIZE];
tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT;
tvi.hItem = TreeView_GetSelection(hwnd);
tvi.pszText = text;
@@ -129,7 +129,7 @@ LRESULT CALLBACK ModuleTreeSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
}
else if ((mtis->type == CONTACT) && hContact) {
if (db_get_b(NULL, "CList", "ConfirmDelete", 1)) {
- TCHAR str[MSG_SIZE];
+ wchar_t str[MSG_SIZE];
mir_sntprintf(str, TranslateT("Are you sure you want to delete contact \"%s\"?"), text);
if (dlg(str, MB_YESNO | MB_ICONEXCLAMATION) == IDNO)
break;
@@ -193,7 +193,7 @@ static LRESULT CALLBACK SettingListSubclassProc(HWND hwnd, UINT msg, WPARAM wPar
INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TCHAR text[256];
+ wchar_t text[256];
switch (msg) {
case WM_INITDIALOG:
diff --git a/plugins/DbEditorPP/src/moduletree.cpp b/plugins/DbEditorPP/src/moduletree.cpp
index cea9dc8bf1..00fce5eb74 100644
--- a/plugins/DbEditorPP/src/moduletree.cpp
+++ b/plugins/DbEditorPP/src/moduletree.cpp
@@ -46,7 +46,7 @@ int doContacts(HTREEITEM contactsRoot, ModuleSettingLL *modlist, MCONTACT hSelec
tvi.item.cChildren = 1;
char szProto[FLD_SIZE];
- TCHAR name[NAME_SIZE];
+ wchar_t name[NAME_SIZE];
for (MCONTACT hContact = db_find_first(); hContact && hwnd2mainWindow; hContact = db_find_next(hContact)) {
@@ -105,7 +105,7 @@ void doItems(ModuleSettingLL* modlist, int count)
{
HWND hwnd = GetParent(hwnd2Tree); //!!!
- TCHAR percent[128], title[96];
+ wchar_t percent[128], title[96];
mir_sntprintf(title, TranslateT("Loading modules..."));
TVITEM item = { 0 };
@@ -152,7 +152,7 @@ HTREEITEM findItemInTree(MCONTACT hContact, const char* module)
{
TVITEM item;
HTREEITEM lastItem;
- TCHAR text[FLD_SIZE];
+ wchar_t text[FLD_SIZE];
if (!TreeView_GetCount(hwnd2Tree))
return 0;
@@ -231,7 +231,7 @@ http://www.codeguru.com/Cpp/controls/treeview/treetraversal/comments.php/c683/?t
TVITEM item;
HTREEITEM lastItem, prelastItem;
BOOL Result = 0;
- TCHAR text[FLD_SIZE];
+ wchar_t text[FLD_SIZE];
if (!TreeView_GetCount(hwnd2Tree))
return Result;
@@ -325,7 +325,7 @@ void __cdecl PopulateModuleTreeThreadFunc(LPVOID param)
switch ((INT_PTR)param) {
case 1: // restore after rebuild
if (HTREEITEM item = TreeView_GetSelection(hwnd2Tree)) {
- TCHAR text[FLD_SIZE];
+ wchar_t text[FLD_SIZE];
TVITEM tvi = { 0 };
tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT;
tvi.pszText = text;
@@ -503,7 +503,7 @@ void moduleListWM_NOTIFY(HWND hwnd, UINT, WPARAM wParam, LPARAM lParam)// hwnd h
{
LPNMTREEVIEW pnmtv = (LPNMTREEVIEW)lParam;
TVITEM tvi = { 0 };
- TCHAR text[FLD_SIZE];
+ wchar_t text[FLD_SIZE];
MCONTACT hContact;
tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT;
tvi.hItem = pnmtv->itemNew.hItem;
@@ -584,7 +584,7 @@ void moduleListWM_NOTIFY(HWND hwnd, UINT, WPARAM wParam, LPARAM lParam)// hwnd h
case TVN_ENDLABELEDIT:
LPNMTVDISPINFO ptvdi = (LPNMTVDISPINFO)lParam;
TVITEM tvi = { 0 };
- TCHAR text[FLD_SIZE];
+ wchar_t text[FLD_SIZE];
ModuleTreeInfoStruct *mtis;
tvi.mask = TVIF_HANDLE | TVIF_TEXT | TVIF_PARAM;
tvi.hItem = ptvdi->item.hItem;
@@ -626,7 +626,7 @@ void moduleListRightClick(HWND hwnd, WPARAM, LPARAM lParam) // hwnd here is to t
TVITEM tvi = { 0 };
HMENU hMenu, hSubMenu;
int menuNumber;
- TCHAR text[FLD_SIZE];
+ wchar_t text[FLD_SIZE];
tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT;
tvi.hItem = hti.hItem;
@@ -718,7 +718,7 @@ void moduleListRightClick(HWND hwnd, WPARAM, LPARAM lParam) // hwnd here is to t
case MENU_DELETE_CONTACT:
if (db_get_b(NULL, "CList", "ConfirmDelete", 1)) {
- TCHAR str[MSG_SIZE];
+ wchar_t str[MSG_SIZE];
mir_sntprintf(str, TranslateT("Are you sure you want to delete contact \"%s\"?"), text);
if (dlg(str, MB_YESNO | MB_ICONEXCLAMATION) == IDNO)
break;
diff --git a/plugins/DbEditorPP/src/renamemodule.cpp b/plugins/DbEditorPP/src/renamemodule.cpp
index d2addc9fc3..bb713adadd 100644
--- a/plugins/DbEditorPP/src/renamemodule.cpp
+++ b/plugins/DbEditorPP/src/renamemodule.cpp
@@ -30,7 +30,7 @@ INT_PTR CALLBACK AddModDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara
SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam);
TranslateDialogDefault(hwnd);
- TCHAR msg[MSG_SIZE], name[NAME_SIZE];
+ wchar_t msg[MSG_SIZE], name[NAME_SIZE];
GetContactName((MCONTACT)lParam, NULL, name, _countof(name));
mir_sntprintf(msg, TranslateT("Add module to \"%s\""), name);
diff --git a/plugins/DbEditorPP/src/settinglist.cpp b/plugins/DbEditorPP/src/settinglist.cpp
index 863cfc8869..329b363edc 100644
--- a/plugins/DbEditorPP/src/settinglist.cpp
+++ b/plugins/DbEditorPP/src/settinglist.cpp
@@ -9,11 +9,11 @@ static int lastColumn = -1;
struct ColumnsSettings csSettingList[] =
{
- { LPGENT("Name"), 0, "Column0width", 180 },
- { LPGENT("Value"), 1, "Column1width", 250 },
- { LPGENT("Type"), 2, "Column2width", 60 },
- { LPGENT("Size"), 3, "Column3width", 80 },
- { LPGENT("#"), 4, "Column4width", 30 },
+ { LPGENW("Name"), 0, "Column0width", 180 },
+ { LPGENW("Value"), 1, "Column1width", 250 },
+ { LPGENW("Type"), 2, "Column2width", 60 },
+ { LPGENW("Size"), 3, "Column3width", 80 },
+ { LPGENW("#"), 4, "Column4width", 30 },
{ 0 }
};
@@ -49,7 +49,7 @@ int convertSetting(MCONTACT hContact, const char *module, const char *setting, i
int res = 0;
DWORD val = 0;
- TCHAR tmp[16];
+ wchar_t tmp[16];
ptrT value;
switch (dbv.type) {
@@ -74,7 +74,7 @@ int convertSetting(MCONTACT hContact, const char *module, const char *setting, i
value = mir_a2t(dbv.pszVal);
if (mir_tstrlen(value) < 11)
- val = _tcstoul(value, NULL, NULL);
+ val = wcstoul(value, NULL, NULL);
}
switch (toType) {
@@ -132,7 +132,7 @@ void DeleteSettingsFromList(MCONTACT hContact, const char *module, const char *s
if (!count) return;
if (db_get_b(NULL, modname, "WarnOnDelete", 1)) {
- TCHAR text[MSG_SIZE];
+ wchar_t text[MSG_SIZE];
mir_sntprintf(text, TranslateT("Are you sure you want to delete setting(s): %d?"), count);
if (dlg(text, MB_YESNO | MB_ICONEXCLAMATION) == IDNO)
return;
@@ -206,7 +206,7 @@ void updateListItem(int index, const char *setting, DBVARIANT *dbv, int resident
return;
}
- TCHAR data[32];
+ wchar_t data[32];
int length;
switch (dbv->type) {
@@ -295,7 +295,7 @@ void updateListItem(int index, const char *setting, DBVARIANT *dbv, int resident
void addListHandle(MCONTACT hContact)
{
- TCHAR name[NAME_SIZE], data[32];
+ wchar_t name[NAME_SIZE], data[32];
LVITEM lvi = { 0 };
lvi.mask = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM;
lvi.lParam = hContact;
@@ -475,7 +475,7 @@ static LRESULT CALLBACK SettingLabelEditSubClassProc(HWND hwnd, UINT msg, WPARAM
return 0;
}
- TCHAR *value = (TCHAR*)mir_alloc(len*sizeof(TCHAR));
+ wchar_t *value = (wchar_t*)mir_alloc(len*sizeof(wchar_t));
GetWindowText(hwnd, value, len);
@@ -508,51 +508,51 @@ static LRESULT CALLBACK SettingLabelEditSubClassProc(HWND hwnd, UINT msg, WPARAM
}
switch (value[0]) {
- case _T('b'):
- case _T('B'):
- val = _tcstoul(&value[1], NULL, 0);
- if (!val || value[1] == _T('0')) {
+ case 'b':
+ case 'B':
+ val = wcstoul(&value[1], NULL, 0);
+ if (!val || value[1] == '0') {
res = !db_set_b(info.hContact, info.module, info.setting, (BYTE)val);
}
else
res = setTextValue(info.hContact, info.module, info.setting, value, dbv.type);
break;
- case _T('w'):
- case _T('W'):
- val = _tcstoul(&value[1], NULL, 0);
- if (!val || value[1] == _T('0'))
+ case 'w':
+ case 'W':
+ val = wcstoul(&value[1], NULL, 0);
+ if (!val || value[1] == '0')
res = !db_set_w(info.hContact, info.module, info.setting, (WORD)val);
else
res = setTextValue(info.hContact, info.module, info.setting, value, dbv.type);
break;
- case _T('d'):
- case _T('D'):
- val = _tcstoul(&value[1], NULL, 0);
- if (!val || value[1] == _T('0'))
+ case 'd':
+ case 'D':
+ val = wcstoul(&value[1], NULL, 0);
+ if (!val || value[1] == '0')
res = !db_set_dw(info.hContact, info.module, info.setting, val);
else
res = setTextValue(info.hContact, info.module, info.setting, value, dbv.type);
break;
- case _T('0'):
+ case '0':
i = 1;
// fall through
- case _T('1'):
- case _T('2'):
- case _T('3'):
- case _T('4'):
- case _T('5'):
- case _T('6'):
- case _T('7'):
- case _T('8'):
- case _T('9'):
- case _T('-'):
- case _T('x'):
- case _T('X'):
- if (value[i] == _T('x') || value[i] == _T('X'))
- val = _tcstoul(&value[i + 1], NULL, 16);
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '-':
+ case 'x':
+ case 'X':
+ if (value[i] == 'x' || value[i] == 'X')
+ val = wcstoul(&value[i + 1], NULL, 16);
else
- val = _tcstoul(value, NULL, 10);
+ val = wcstoul(value, NULL, 10);
switch (dbv.type) {
case DBVT_BYTE:
@@ -567,8 +567,8 @@ static LRESULT CALLBACK SettingLabelEditSubClassProc(HWND hwnd, UINT msg, WPARAM
break;
}
break;
- case _T('\"'):
- case _T('\''):
+ case '\"':
+ case '\'':
{
size_t nlen = mir_tstrlen(value);
int sh = 0;
@@ -638,7 +638,7 @@ void EditLabel(int item, int subitem)
if (!subitem)
info.hwnd2Edit = CreateWindow(L"EDIT", _A2T(setting), WS_BORDER | WS_VISIBLE | WS_CHILD | ES_AUTOHSCROLL, rc.left, rc.top, (rc.right - rc.left), (rc.bottom - rc.top), hwnd2List, 0, hInst, 0);
else {
- TCHAR *str = NULL, value[16] = { 0 };
+ wchar_t *str = NULL, value[16] = { 0 };
switch (dbv.type) {
case DBVT_ASCIIZ:
diff --git a/plugins/DbEditorPP/src/settingsdlg.cpp b/plugins/DbEditorPP/src/settingsdlg.cpp
index b712386a5b..ed13f64227 100644
--- a/plugins/DbEditorPP/src/settingsdlg.cpp
+++ b/plugins/DbEditorPP/src/settingsdlg.cpp
@@ -130,7 +130,7 @@ INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
TranslateDialogDefault(hwnd);
{
- TCHAR text[MSG_SIZE];
+ wchar_t text[MSG_SIZE];
mir_sntprintf(text, dbsetting->setting?TranslateT("Edit setting (%s)"):TranslateT("New setting (%s)"), DBVType(dbsetting->dbv.type));
SetWindowText(hwnd, text);
}
@@ -157,21 +157,21 @@ INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
case CHK_DECIMAL:
CheckRadioButton(hwnd, CHK_HEX, CHK_DECIMAL, LOWORD(wParam));
{
- TCHAR *setting, text[32];
+ wchar_t *setting, text[32];
int settingLength, tmp;
settingLength = GetWindowTextLength(GetDlgItem(hwnd, IDC_SETTINGVALUE));
if (settingLength)
{
- setting = (TCHAR*)mir_alloc((settingLength+1)*sizeof(TCHAR));
+ setting = (wchar_t*)mir_alloc((settingLength+1)*sizeof(wchar_t));
GetDlgItemText(hwnd, IDC_SETTINGVALUE, setting, settingLength + 1);
if (LOWORD(wParam) == CHK_DECIMAL && IsDlgButtonChecked(hwnd, CHK_DECIMAL))
{
- _stscanf(setting, L"%X", &tmp);
+ swscanf(setting, L"%X", &tmp);
mir_sntprintf(text, L"%u", tmp);
}
else
{
- _stscanf(setting, L"%u", &tmp);
+ swscanf(setting, L"%u", &tmp);
mir_sntprintf(text, L"%X", tmp);
}
SetDlgItemText(hwnd, IDC_SETTINGVALUE, text);
@@ -188,7 +188,7 @@ INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
{
struct DBsetting *dbsetting = (struct DBsetting*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- TCHAR settingname[FLD_SIZE];
+ wchar_t settingname[FLD_SIZE];
GetDlgItemText(hwnd, IDC_SETTINGNAME, settingname, _countof(settingname));
if (settingname[0])
@@ -221,7 +221,7 @@ INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
break;
int len = GetWindowTextLength(GetDlgItem(hwnd, valueID))+1;
- TCHAR *value = (TCHAR*)mir_alloc(len*sizeof(TCHAR));
+ wchar_t *value = (wchar_t*)mir_alloc(len*sizeof(wchar_t));
GetDlgItemText(hwnd, valueID, value, len);
_T2A setting(settingname);
@@ -235,7 +235,7 @@ INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
case DBVT_BYTE:
case DBVT_WORD:
case DBVT_DWORD:
- res = setNumericValue(dbsetting->hContact, dbsetting->module, setting, _tcstoul(value, NULL, IsDlgButtonChecked(hwnd, CHK_HEX)? 16 : 10), type);
+ res = setNumericValue(dbsetting->hContact, dbsetting->module, setting, wcstoul(value, NULL, IsDlgButtonChecked(hwnd, CHK_HEX)? 16 : 10), type);
break;
case DBVT_ASCIIZ:
case DBVT_UTF8:
diff --git a/plugins/DbEditorPP/src/stdafx.h b/plugins/DbEditorPP/src/stdafx.h
index 8533d5942c..f573d1739c 100644
--- a/plugins/DbEditorPP/src/stdafx.h
+++ b/plugins/DbEditorPP/src/stdafx.h
@@ -4,8 +4,6 @@
// Includes
//=====================================================
-#include <tchar.h>
-
#include <Windows.h>
#include <commctrl.h>
#include <stdio.h>
@@ -134,7 +132,7 @@ struct ModuleSettingLL
};
struct ColumnsSettings {
- TCHAR *name;
+ wchar_t *name;
int index;
char *dbname;
int defsize;
@@ -203,14 +201,14 @@ extern bool g_bUsePopups;
//main
char *StringFromBlob(BYTE *blob, WORD len);
int WriteBlobFromString(MCONTACT hContact, const char *module, const char *setting, const char *value, int len);
-TCHAR *DBVType(BYTE type);
+wchar_t *DBVType(BYTE type);
DWORD getNumericValue(DBVARIANT *dbv);
int setNumericValue(MCONTACT hContact, const char *module, const char *setting, DWORD value, int type);
-int IsRealUnicode(TCHAR *value);
-int setTextValue(MCONTACT hContact, const char *module, const char *setting, TCHAR *value, int type);
+int IsRealUnicode(wchar_t *value);
+int setTextValue(MCONTACT hContact, const char *module, const char *setting, wchar_t *value, int type);
int GetValueA(MCONTACT hContact, const char *module, const char *setting, char *value, int length);
int GetValueW(MCONTACT hContact, const char *module, const char *setting, WCHAR *value, int length);
-int GetContactName(MCONTACT hContact, const char *proto, TCHAR *value, int maxlen);
+int GetContactName(MCONTACT hContact, const char *proto, wchar_t *value, int maxlen);
int ApplyProtoFilter(MCONTACT hContact);
void loadListSettings(HWND hwnd, ColumnsSettings *cs);
void saveListSettings(HWND hwnd, ColumnsSettings *cs);
diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp
index a5ca3e7c0e..3c8ce19c50 100644
--- a/plugins/DbEditorPP/src/watchedvars.cpp
+++ b/plugins/DbEditorPP/src/watchedvars.cpp
@@ -7,11 +7,11 @@ static WatchListArrayStruct WatchListArray = {0};
static int lastColumn = -1;
ColumnsSettings csWatchList[] = {
- { LPGENT("Contact"), 0, "Watch0width", 100 },
- { LPGENT("Module"), 1, "Watch1width", 100 },
- { LPGENT("Setting"), 2, "Watch2width", 100 },
- { LPGENT("Value"), 3, "Watch3width", 200 },
- { LPGENT("Type"), 4, "Watch4width", 75 },
+ { LPGENW("Contact"), 0, "Watch0width", 100 },
+ { LPGENW("Module"), 1, "Watch1width", 100 },
+ { LPGENW("Setting"), 2, "Watch2width", 100 },
+ { LPGENW("Value"), 3, "Watch3width", 200 },
+ { LPGENW("Type"), 4, "Watch4width", 75 },
{0}
};
@@ -109,7 +109,7 @@ void addwatchtolist(HWND hwnd, struct DBsetting *lParam)
if (db_get_s(lParam->hContact, lParam->module, lParam->setting, &(lParam->dbv), 0))
return;
- TCHAR data[32], tmp[16], name[NAME_SIZE];
+ wchar_t data[32], tmp[16], name[NAME_SIZE];
GetContactName(lParam->hContact, NULL, name, _countof(name));
lvItem.pszText = name;
@@ -352,7 +352,7 @@ void popupWatchedVar(MCONTACT hContact, const char *module, const char *setting)
COLORREF colorText = db_get_dw(NULL, modname, "PopupTextColour", RGB(0, 0, 0));
int timeout = db_get_b(NULL, modname, "PopupDelay", 3);
- TCHAR name[NAME_SIZE], text[MAX_SECONDLINE], value[MAX_SECONDLINE];
+ wchar_t name[NAME_SIZE], text[MAX_SECONDLINE], value[MAX_SECONDLINE];
GetContactName(hContact, NULL, name, _countof(name));
// 2nd line
diff --git a/plugins/Db_autobackups/src/backup.cpp b/plugins/Db_autobackups/src/backup.cpp
index 53a2dad93a..82d06ad4bb 100644
--- a/plugins/Db_autobackups/src/backup.cpp
+++ b/plugins/Db_autobackups/src/backup.cpp
@@ -9,7 +9,7 @@ LRESULT CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
switch (msg) {
case WM_COMMAND:
{
- TCHAR* ptszPath = (TCHAR*)PUGetPluginData(hWnd);
+ wchar_t* ptszPath = (wchar_t*)PUGetPluginData(hWnd);
if (ptszPath != 0)
ShellExecute(0, L"open", ptszPath, NULL, NULL, SW_SHOW);
@@ -25,12 +25,12 @@ LRESULT CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
}
return DefWindowProc(hWnd, msg, wParam, lParam);
}
-void ShowPopup(TCHAR* ptszText, TCHAR* ptszHeader, TCHAR* ptszPath)
+void ShowPopup(wchar_t* ptszText, wchar_t* ptszHeader, wchar_t* ptszPath)
{
POPUPDATAT ppd = { 0 };
- _tcsncpy_s(ppd.lptzText, ptszText, _TRUNCATE);
- _tcsncpy_s(ppd.lptzContactName, ptszHeader, _TRUNCATE);
+ wcsncpy_s(ppd.lptzText, ptszText, _TRUNCATE);
+ wcsncpy_s(ppd.lptzContactName, ptszHeader, _TRUNCATE);
if (ptszPath != NULL)
ppd.PluginData = (void*)mir_tstrdup(ptszPath);
ppd.PluginWindowProc = DlgProcPopup;
@@ -57,20 +57,20 @@ INT_PTR CALLBACK DlgProcProgress(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM)
return FALSE;
}
-TCHAR* DoubleSlash(TCHAR *sorce)
+wchar_t* DoubleSlash(wchar_t *sorce)
{
- TCHAR *ret, *r, *s;
+ wchar_t *ret, *r, *s;
- ret = (TCHAR*)mir_alloc((MAX_PATH * sizeof(TCHAR)));
+ ret = (wchar_t*)mir_alloc((MAX_PATH * sizeof(wchar_t)));
if (ret == NULL)
return NULL;
for (s = sorce, r = ret; *s && (r - ret) < (MAX_PATH - 1); s++, r++) {
- if (*s != _T('\\'))
+ if (*s != '\\')
*r = *s;
else {
- *r = _T('\\');
+ *r = '\\';
r++;
- *r = _T('\\');
+ *r = '\\';
}
}
r[0] = 0;
@@ -107,7 +107,7 @@ bool MakeZip_Dir(LPCSTR szDir, LPCTSTR szDest, LPCSTR /* szDbName */, HWND progr
return 1;
}
-bool MakeZip(TCHAR *tszSource, TCHAR *tszDest, TCHAR *dbname, HWND progress_dialog)
+bool MakeZip(wchar_t *tszSource, wchar_t *tszDest, wchar_t *dbname, HWND progress_dialog)
{
HWND hProgBar = GetDlgItem(progress_dialog, IDC_PROGRESS);
@@ -124,7 +124,7 @@ bool MakeZip(TCHAR *tszSource, TCHAR *tszDest, TCHAR *dbname, HWND progress_dial
struct backupFile
{
- TCHAR Name[MAX_PATH];
+ wchar_t Name[MAX_PATH];
FILETIME CreationTime;
};
@@ -140,11 +140,11 @@ int Comp(const void *i, const void *j)
return 1;
}
-int RotateBackups(TCHAR *backupfolder, TCHAR *dbname)
+int RotateBackups(wchar_t *backupfolder, wchar_t *dbname)
{
backupFile *bf = NULL, *bftmp;
HANDLE hFind;
- TCHAR backupfolderTmp[MAX_PATH];
+ wchar_t backupfolderTmp[MAX_PATH];
WIN32_FIND_DATA FindFileData;
if (options.num_backups == 0)
@@ -162,7 +162,7 @@ int RotateBackups(TCHAR *backupfolder, TCHAR *dbname)
if (bftmp == NULL)
goto err_out;
bf = bftmp;
- _tcsncpy_s(bf[i].Name, FindFileData.cFileName, _TRUNCATE);
+ wcsncpy_s(bf[i].Name, FindFileData.cFileName, _TRUNCATE);
bf[i].CreationTime = FindFileData.ftCreationTime;
i ++;
} while (FindNextFile(hFind, &FindFileData));
@@ -179,10 +179,10 @@ err_out:
}
-int Backup(TCHAR *backup_filename)
+int Backup(wchar_t *backup_filename)
{
bool bZip = false;
- TCHAR dbname[MAX_PATH], source_file[MAX_PATH] = { 0 }, dest_file[MAX_PATH];
+ wchar_t dbname[MAX_PATH], source_file[MAX_PATH] = { 0 }, dest_file[MAX_PATH];
HWND progress_dialog = NULL;
SYSTEMTIME st;
@@ -190,7 +190,7 @@ int Backup(TCHAR *backup_filename)
if (backup_filename == NULL) {
int err;
- TCHAR *backupfolder, buffer[MAX_COMPUTERNAME_LENGTH + 1];
+ wchar_t *backupfolder, buffer[MAX_COMPUTERNAME_LENGTH + 1];
DWORD size = _countof(buffer);
bZip = options.use_zip != 0;
@@ -209,8 +209,8 @@ int Backup(TCHAR *backup_filename)
mir_free(backupfolder);
}
else {
- _tcsncpy_s(dest_file, backup_filename, _TRUNCATE);
- if (!mir_tstrcmp(_tcsrchr(backup_filename, _T('.')), L".zip"))
+ wcsncpy_s(dest_file, backup_filename, _TRUNCATE);
+ if (!mir_tstrcmp(wcsrchr(backup_filename, '.'), L".zip"))
bZip = true;
}
if (!options.disable_popups)
@@ -222,7 +222,7 @@ int Backup(TCHAR *backup_filename)
SetDlgItemText(progress_dialog, IDC_PROGRESSMESSAGE, TranslateT("Copying database file..."));
mir_sntprintf(source_file, L"%s\\%s", profilePath, dbname);
- TCHAR *pathtmp = Utils_ReplaceVarsT(source_file);
+ wchar_t *pathtmp = Utils_ReplaceVarsT(source_file);
BOOL res = 0;
if (bZip)
{
@@ -254,14 +254,14 @@ int Backup(TCHAR *backup_filename)
if (!options.disable_popups) {
size_t dest_file_len = mir_tstrlen(dest_file);
- TCHAR *puText;
+ wchar_t *puText;
if (dest_file_len > 50) {
size_t i;
- puText = (TCHAR*)mir_alloc(sizeof(TCHAR) * (dest_file_len + 2));
- for (i = (dest_file_len - 1); dest_file[i] != _T('\\'); i--)
+ puText = (wchar_t*)mir_alloc(sizeof(wchar_t) * (dest_file_len + 2));
+ for (i = (dest_file_len - 1); dest_file[i] != '\\'; i--)
;
- //_tcsncpy_s(dest_file, backup_filename, _TRUNCATE);
+ //wcsncpy_s(dest_file, backup_filename, _TRUNCATE);
mir_tstrncpy(puText, dest_file, (i + 2));
mir_tstrcat(puText, L"\n");
mir_tstrcat(puText, (dest_file + i + 1));
@@ -287,14 +287,14 @@ int Backup(TCHAR *backup_filename)
void BackupThread(void *backup_filename)
{
- Backup((TCHAR*)backup_filename);
+ Backup((wchar_t*)backup_filename);
InterlockedExchange(&m_state, 0); /* Backup done. */
mir_free(backup_filename);
}
-void BackupStart(TCHAR *backup_filename)
+void BackupStart(wchar_t *backup_filename)
{
- TCHAR *tm = NULL;
+ wchar_t *tm = NULL;
LONG cur_state;
cur_state = InterlockedCompareExchange(&m_state, 1, 0);
diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp
index ea26811a07..52cc10aa91 100644
--- a/plugins/Db_autobackups/src/main.cpp
+++ b/plugins/Db_autobackups/src/main.cpp
@@ -2,7 +2,7 @@
int hLangpack;
HINSTANCE g_hInstance;
-TCHAR *profilePath;
+wchar_t *profilePath;
HANDLE hFolder;
char g_szMirVer[100];
@@ -34,7 +34,7 @@ static INT_PTR ABService(WPARAM, LPARAM)
static INT_PTR DBSaveAs(WPARAM, LPARAM)
{
- TCHAR fname_buff[MAX_PATH], tszFilter[200];
+ wchar_t fname_buff[MAX_PATH], tszFilter[200];
OPENFILENAME ofn = { 0 };
CallService(MS_DB_GETPROFILENAMET, _countof(fname_buff), (LPARAM)fname_buff);
@@ -65,7 +65,7 @@ static int FoldersGetBackupPath(WPARAM, LPARAM)
static int ModulesLoad(WPARAM, LPARAM)
{
CMenuItem mi;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Database"), 500100000);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Database"), 500100000);
SET_UID(mi, 0x1439b1db, 0x7d95, 0x495b, 0xbf, 0x5, 0x3d, 0x21, 0xc1, 0xeb, 0xf7, 0x58);
mi.name.a = LPGEN("Backup profile");
diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp
index 7c7aacf482..046f777fd9 100644
--- a/plugins/Db_autobackups/src/options.cpp
+++ b/plugins/Db_autobackups/src/options.cpp
@@ -43,10 +43,10 @@ int LoadOptions(void)
DBVARIANT dbv;
if (!db_get_ts(0, "AutoBackups", "Folder", &dbv)) {
- TCHAR *tmp = Utils_ReplaceVarsT(dbv.ptszVal);
+ wchar_t *tmp = Utils_ReplaceVarsT(dbv.ptszVal);
if (mir_tstrlen(tmp) >= 2 && tmp[1] == ':')
- _tcsncpy_s(options.folder, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(options.folder, dbv.ptszVal, _TRUNCATE);
else
mir_sntprintf(options.folder, L"%s\\%s", profilePath, dbv.ptszVal);
@@ -69,7 +69,7 @@ int LoadOptions(void)
int SaveOptions(void)
{
- TCHAR prof_dir[MAX_PATH];
+ wchar_t prof_dir[MAX_PATH];
db_set_b(0, "AutoBackups", "BackupType", (BYTE)options.backup_types);
if (options.period < 1)
@@ -81,15 +81,15 @@ int SaveOptions(void)
size_t prof_len = mir_tstrlen(prof_dir);
size_t opt_len = mir_tstrlen(options.folder);
- if (opt_len > prof_len && _tcsncmp(options.folder, prof_dir, prof_len) == 0) {
+ if (opt_len > prof_len && wcsncmp(options.folder, prof_dir, prof_len) == 0) {
db_set_ts(0, "AutoBackups", "Folder", (options.folder + prof_len));
}
else
db_set_ts(0, "AutoBackups", "Folder", options.folder);
- TCHAR *tmp = Utils_ReplaceVarsT(options.folder);
+ wchar_t *tmp = Utils_ReplaceVarsT(options.folder);
if (mir_tstrlen(tmp) < 2 || tmp[1] != ':') {
- _tcsncpy_s(prof_dir, options.folder, _TRUNCATE);
+ wcsncpy_s(prof_dir, options.folder, _TRUNCATE);
mir_sntprintf(options.folder, L"%s\\%s", profilePath, prof_dir);
}
mir_free(tmp);
@@ -108,7 +108,7 @@ Options new_options;
int SetDlgState(HWND hwndDlg)
{
- TCHAR buff[10];
+ wchar_t buff[10];
if (new_options.backup_types == BT_DISABLED) {
CheckDlgButton(hwndDlg, IDC_RAD_DISABLED, BST_CHECKED);
@@ -148,10 +148,10 @@ int SetDlgState(HWND hwndDlg)
}
SendDlgItemMessage(hwndDlg, SPIN_PERIOD, UDM_SETRANGE32, 1, (LPARAM)60);
- SetDlgItemText(hwndDlg, IDC_ED_PERIOD, _itot(new_options.period, buff, 10));
+ SetDlgItemText(hwndDlg, IDC_ED_PERIOD, _itow(new_options.period, buff, 10));
SendDlgItemMessage(hwndDlg, SPIN_NUMBACKUPS, UDM_SETRANGE32, 1, (LPARAM)100);
- SetDlgItemText(hwndDlg, IDC_ED_NUMBACKUPS, _itot(new_options.num_backups, buff, 10));
+ SetDlgItemText(hwndDlg, IDC_ED_NUMBACKUPS, _itow(new_options.num_backups, buff, 10));
SetDlgItemText(hwndDlg, IDC_ED_FOLDER, new_options.folder);
@@ -171,7 +171,7 @@ int CALLBACK BrowseProc(HWND hwnd, UINT uMsg, LPARAM, LPARAM)
switch (uMsg)
{
case BFFM_INITIALIZED:
- TCHAR *folder = Utils_ReplaceVarsT(options.folder);
+ wchar_t *folder = Utils_ReplaceVarsT(options.folder);
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM)folder);
mir_free(folder);
break;
@@ -181,7 +181,7 @@ int CALLBACK BrowseProc(HWND hwnd, UINT uMsg, LPARAM, LPARAM)
INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TCHAR folder_buff[MAX_PATH] = { 0 };
+ wchar_t folder_buff[MAX_PATH] = { 0 };
switch (msg) {
case WM_INITDIALOG:
@@ -194,7 +194,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
ShowWindow(GetDlgItem(hwndDlg, IDC_LNK_FOLDERS), SW_SHOW);
}
else {
- TCHAR tszTooltipText[4096];
+ wchar_t tszTooltipText[4096];
mir_sntprintf(tszTooltipText, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
L"%miranda_path%", TranslateT("path to Miranda root folder"),
L"%miranda_profilesdir%", TranslateT("path to folder containing Miranda profiles"),
@@ -341,11 +341,11 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == PSN_APPLY) {
- TCHAR buff[10];
+ wchar_t buff[10];
GetDlgItemText(hwndDlg, IDC_ED_PERIOD, buff, _countof(buff));
- new_options.period = _ttoi(buff);
+ new_options.period = _wtoi(buff);
GetDlgItemText(hwndDlg, IDC_ED_NUMBACKUPS, buff, _countof(buff));
- new_options.num_backups = _ttoi(buff);
+ new_options.num_backups = _wtoi(buff);
switch (SendDlgItemMessage(hwndDlg, IDC_PT, CB_GETCURSEL, 0, 0)) {
case 0: new_options.period_type = PT_DAYS; break;
@@ -355,26 +355,26 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
GetDlgItemText(hwndDlg, IDC_ED_FOLDER, folder_buff, _countof(folder_buff));
{
- TCHAR backupfolder[MAX_PATH] = { 0 };
+ wchar_t backupfolder[MAX_PATH] = { 0 };
BOOL folder_ok = TRUE;
- TCHAR *tmp = Utils_ReplaceVarsT(folder_buff);
+ wchar_t *tmp = Utils_ReplaceVarsT(folder_buff);
if (mir_tstrlen(tmp) >= 2 && tmp[1] == ':')
- _tcsncpy_s(backupfolder, tmp, _TRUNCATE);
+ wcsncpy_s(backupfolder, tmp, _TRUNCATE);
else
mir_sntprintf(backupfolder, L"%s\\%s", profilePath, tmp);
mir_free(tmp);
int err = CreateDirectoryTreeT(backupfolder);
if (err != ERROR_ALREADY_EXISTS && err != 0) {
- TCHAR msg_buff[512];
+ wchar_t msg_buff[512];
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, err, 0, msg_buff, 512, 0);
MessageBox(0, msg_buff, TranslateT("Error creating backup folder"), MB_OK | MB_ICONERROR);
folder_ok = FALSE;
}
if (folder_ok) {
- _tcsncpy_s(new_options.folder, folder_buff, _TRUNCATE);
+ wcsncpy_s(new_options.folder, folder_buff, _TRUNCATE);
memcpy(&options, &new_options, sizeof(Options));
SaveOptions();
}
diff --git a/plugins/Db_autobackups/src/options.h b/plugins/Db_autobackups/src/options.h
index 991c109285..8cd2b4f1b2 100644
--- a/plugins/Db_autobackups/src/options.h
+++ b/plugins/Db_autobackups/src/options.h
@@ -29,7 +29,7 @@ typedef struct Options_tag {
int backup_types;
unsigned int period;
PeriodType period_type;
- TCHAR folder[MAX_PATH];
+ wchar_t folder[MAX_PATH];
int num_backups;
BOOL disable_progress;
BOOL disable_popups;
diff --git a/plugins/Db_autobackups/src/stdafx.h b/plugins/Db_autobackups/src/stdafx.h
index e7f2d81b1d..55ed621497 100644
--- a/plugins/Db_autobackups/src/stdafx.h
+++ b/plugins/Db_autobackups/src/stdafx.h
@@ -39,7 +39,7 @@
int SetBackupTimer(void);
int OptionsInit(WPARAM wParam, LPARAM lParam);
int LoadOptions(void);
-void BackupStart(TCHAR *backup_filename);
+void BackupStart(wchar_t *backup_filename);
struct ZipFile
{
@@ -51,7 +51,7 @@ struct ZipFile
int CreateZipFile(const char *szDestPath, OBJLIST<ZipFile> &lstFiles, const std::function<bool(size_t)> &fnCallback);
extern HINSTANCE g_hInstance;
-extern TCHAR *profilePath;
+extern wchar_t *profilePath;
extern char g_szMirVer[];
static IconItem iconList[] = {
diff --git a/plugins/Dbx_mdb/src/dbintf.cpp b/plugins/Dbx_mdb/src/dbintf.cpp
index 2ff199717e..35e93d8fba 100644
--- a/plugins/Dbx_mdb/src/dbintf.cpp
+++ b/plugins/Dbx_mdb/src/dbintf.cpp
@@ -175,7 +175,7 @@ int CDbxMdb::Check(void)
if (pFile == nullptr)
return EGROKPRF_CANTREAD;
- fseek(pFile, iDefHeaderOffset, SEEK_SET);
+ fseek(pFile, (LONG)iDefHeaderOffset, SEEK_SET);
BYTE buf[_countof(bDefHeader)];
if (fread(buf, 1, _countof(buf), pFile) != _countof(buf))
return EGROKPRF_DAMAGED;
@@ -217,7 +217,7 @@ bool CDbxMdb::Remap()
static DWORD DatabaseCorrupted = 0;
static const TCHAR *msg = NULL;
static DWORD dwErr = 0;
-static TCHAR tszPanic[] = LPGENT("Miranda has detected corruption in your database. This corruption may be fixed by DbChecker plugin. Please download it from http://miranda-ng.org/p/DbChecker/. Miranda will now shut down.");
+static wchar_t tszPanic[] = LPGENW("Miranda has detected corruption in your database. This corruption may be fixed by DbChecker plugin. Please download it from http://miranda-ng.org/p/DbChecker/. Miranda will now shut down.");
EXTERN_C void __cdecl dbpanic(void *)
{
diff --git a/plugins/Dbx_mdb/src/ui.cpp b/plugins/Dbx_mdb/src/ui.cpp
index 003b068a48..3c12bf6dd6 100644
--- a/plugins/Dbx_mdb/src/ui.cpp
+++ b/plugins/Dbx_mdb/src/ui.cpp
@@ -182,7 +182,7 @@ static int OnModulesLoaded(PVOID obj, WPARAM, LPARAM)
CMenuItem mi;
// main menu item
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Database"), 500000000, iconList[0].hIcolib);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Database"), 500000000, iconList[0].hIcolib);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "F7C5567C-D1EE-484B-B4F6-24677A5AAAEF");
SET_UID(mi, 0x50321866, 0xba1, 0x46dd, 0xb3, 0xa6, 0xc3, 0xcc, 0x55, 0xf2, 0x42, 0x9e);
diff --git a/plugins/Dropbox/src/dropbox.cpp b/plugins/Dropbox/src/dropbox.cpp
index f7b4b62731..4a6faac5b1 100644
--- a/plugins/Dropbox/src/dropbox.cpp
+++ b/plugins/Dropbox/src/dropbox.cpp
@@ -167,7 +167,7 @@ UINT CDropbox::RequestAccessTokenAsync(void *owner, void *param)
if (hwndDlg)
SetDlgItemText(hwndDlg, IDC_AUTH_STATUS, TranslateT("server does not respond"));
/*else
- ShowNotification((TCHAR*)error_description, MB_ICONERROR);*/
+ ShowNotification((wchar_t*)error_description, MB_ICONERROR);*/
return 0;
}
@@ -178,7 +178,7 @@ UINT CDropbox::RequestAccessTokenAsync(void *owner, void *param)
if (hwndDlg)
SetDlgItemText(hwndDlg, IDC_AUTH_STATUS, error_description);
/*else
- ShowNotification((TCHAR*)error_description, MB_ICONERROR);*/
+ ShowNotification((wchar_t*)error_description, MB_ICONERROR);*/
return 0;
}
diff --git a/plugins/Dropbox/src/dropbox.h b/plugins/Dropbox/src/dropbox.h
index 1b2272729d..5c1efa5d08 100644
--- a/plugins/Dropbox/src/dropbox.h
+++ b/plugins/Dropbox/src/dropbox.h
@@ -109,7 +109,7 @@ private:
// utils
static char* PreparePath(const char *oldPath, char *newPath);
- static char* PreparePath(const TCHAR *oldPath, char *newPath);
+ static char* PreparePath(const wchar_t *oldPath, char *newPath);
static bool IsAccountIntercepted(const char *module);
@@ -118,10 +118,10 @@ private:
static MEVENT AddEventToDb(MCONTACT hContact, WORD type, DWORD flags, DWORD cbBlob, PBYTE pBlob);
- void SendToContact(MCONTACT hContact, const TCHAR *data);
- void PasteToInputArea(MCONTACT hContact, const TCHAR *data);
- void PasteToClipboard(const TCHAR *data);
- void Report(MCONTACT hContact, const TCHAR *data);
+ void SendToContact(MCONTACT hContact, const wchar_t *data);
+ void PasteToInputArea(MCONTACT hContact, const wchar_t *data);
+ void PasteToClipboard(const wchar_t *data);
+ void Report(MCONTACT hContact, const wchar_t *data);
template<int(CDropbox::*Event)(WPARAM, LPARAM)>
static int GlobalEvent(void *obj, WPARAM wParam, LPARAM lParam)
diff --git a/plugins/Dropbox/src/dropbox_options.cpp b/plugins/Dropbox/src/dropbox_options.cpp
index 9f7bd0221b..f5ff7516fd 100644
--- a/plugins/Dropbox/src/dropbox_options.cpp
+++ b/plugins/Dropbox/src/dropbox_options.cpp
@@ -152,15 +152,15 @@ void CDropboxOptionsInterception::OnApply()
int CDropbox::OnOptionsInitialized(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.ptszTitle = _T(MODULE);
+ odp.pwszTitle = MODULEW;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.ptszGroup = LPGENT("Network");
+ odp.pwszGroup = LPGENW("Network");
- odp.ptszTab = LPGENT("General");
+ odp.pwszTab = LPGENW("General");
odp.pDialog = CDropboxOptionsMain::CreateOptionsPage(this);
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Interception");
+ odp.pwszTab = LPGENW("Interception");
odp.pDialog = CDropboxOptionsInterception::CreateOptionsPage(this);
Options_AddPage(wParam, &odp);
diff --git a/plugins/Dropbox/src/dropbox_services.cpp b/plugins/Dropbox/src/dropbox_services.cpp
index dbe8602112..6896398ced 100644
--- a/plugins/Dropbox/src/dropbox_services.cpp
+++ b/plugins/Dropbox/src/dropbox_services.cpp
@@ -45,11 +45,11 @@ INT_PTR CDropbox::ProtoSendFile(WPARAM, LPARAM lParam)
FileTransferParam *ftp = new FileTransferParam(pccsd->hContact);
- const TCHAR *description = (TCHAR*)pccsd->wParam;
+ const wchar_t *description = (wchar_t*)pccsd->wParam;
if (description && description[0])
- ftp->AppendFormatData(L"%s\r\n", (TCHAR*)pccsd->wParam);
+ ftp->AppendFormatData(L"%s\r\n", (wchar_t*)pccsd->wParam);
- TCHAR **paths = (TCHAR**)pccsd->lParam;
+ wchar_t **paths = (wchar_t**)pccsd->lParam;
ftp->SetWorkingDirectory(paths[0]);
for (int i = 0; paths[i]; i++) {
if (PathIsDirectory(paths[i]))
diff --git a/plugins/Dropbox/src/dropbox_transfers.cpp b/plugins/Dropbox/src/dropbox_transfers.cpp
index c41bcdf290..33d9ed8613 100644
--- a/plugins/Dropbox/src/dropbox_transfers.cpp
+++ b/plugins/Dropbox/src/dropbox_transfers.cpp
@@ -96,7 +96,7 @@ UINT CDropbox::UploadToDropbox(void *owner, void *arg)
FileTransferParam *ftp = (FileTransferParam*)arg;
try {
- const TCHAR *folderName = ftp->GetFolderName();
+ const wchar_t *folderName = ftp->GetFolderName();
if (folderName) {
char path[MAX_PATH], url[MAX_PATH];
PreparePath(folderName, path);
@@ -108,7 +108,7 @@ UINT CDropbox::UploadToDropbox(void *owner, void *arg)
ftp->FirstFile();
do
{
- const TCHAR *fileName = ftp->GetCurrentRelativeFilePath();
+ const wchar_t *fileName = ftp->GetCurrentRelativeFilePath();
uint64_t fileSize = ftp->GetCurrentFileSize();
int chunkSize = ftp->GetCurrentFileChunkSize();
@@ -139,9 +139,9 @@ UINT CDropbox::UploadToDropbox(void *owner, void *arg)
size = 0;
char path[MAX_PATH];
- const TCHAR *serverFolder = ftp->GetServerFolder();
+ const wchar_t *serverFolder = ftp->GetServerFolder();
if (serverFolder) {
- TCHAR serverPath[MAX_PATH] = { 0 };
+ wchar_t serverPath[MAX_PATH] = { 0 };
mir_sntprintf(serverPath, L"%s\\%s", serverFolder, fileName);
PreparePath(serverPath, path);
}
@@ -151,7 +151,7 @@ UINT CDropbox::UploadToDropbox(void *owner, void *arg)
ftp->Progress(size);
- if (!_tcschr(fileName, L'\\')) {
+ if (!wcschr(fileName, L'\\')) {
char url[MAX_PATH];
instance->CreateDownloadUrl(path, url);
ftp->AppendFormatData(L"%s\r\n", ptrT(mir_utf8decodeT(url)));
diff --git a/plugins/Dropbox/src/dropbox_utils.cpp b/plugins/Dropbox/src/dropbox_utils.cpp
index 67994b6e1b..28bf244984 100644
--- a/plugins/Dropbox/src/dropbox_utils.cpp
+++ b/plugins/Dropbox/src/dropbox_utils.cpp
@@ -16,7 +16,7 @@ char* CDropbox::PreparePath(const char *oldPath, char *newPath)
return newPath;
}
-char* CDropbox::PreparePath(const TCHAR *oldPath, char *newPath)
+char* CDropbox::PreparePath(const wchar_t *oldPath, char *newPath)
{
return PreparePath(ptrA(mir_utf8encodeW(oldPath)), newPath);
}
@@ -95,7 +95,7 @@ MEVENT CDropbox::AddEventToDb(MCONTACT hContact, WORD type, DWORD flags, DWORD c
return db_event_add(hContact, &dbei);
}
-void CDropbox::SendToContact(MCONTACT hContact, const TCHAR *data)
+void CDropbox::SendToContact(MCONTACT hContact, const wchar_t *data)
{
if (hContact == GetDefaultContact()) {
char *message = mir_utf8encodeT(data);
@@ -122,7 +122,7 @@ void CDropbox::SendToContact(MCONTACT hContact, const TCHAR *data)
AddEventToDb(hContact, EVENTTYPE_MESSAGE, DBEF_UTF | DBEF_SENT, (DWORD)mir_strlen(message), (PBYTE)message);
}
-void CDropbox::PasteToInputArea(MCONTACT hContact, const TCHAR *data)
+void CDropbox::PasteToInputArea(MCONTACT hContact, const wchar_t *data)
{
MessageWindowInputData mwid = { sizeof(MessageWindowInputData) };
mwid.hContact = hContact;
@@ -137,17 +137,17 @@ void CDropbox::PasteToInputArea(MCONTACT hContact, const TCHAR *data)
}
}
-void CDropbox::PasteToClipboard(const TCHAR *data)
+void CDropbox::PasteToClipboard(const wchar_t *data)
{
if (OpenClipboard(NULL)) {
EmptyClipboard();
- size_t size = sizeof(TCHAR) * (mir_tstrlen(data) + 1);
+ size_t size = sizeof(wchar_t) * (mir_tstrlen(data) + 1);
HGLOBAL hClipboardData = GlobalAlloc(NULL, size);
if (hClipboardData) {
- TCHAR *pchData = (TCHAR*)GlobalLock(hClipboardData);
+ wchar_t *pchData = (wchar_t*)GlobalLock(hClipboardData);
if (pchData) {
- memcpy(pchData, (TCHAR*)data, size);
+ memcpy(pchData, (wchar_t*)data, size);
GlobalUnlock(hClipboardData);
SetClipboardData(CF_UNICODETEXT, hClipboardData);
}
@@ -156,7 +156,7 @@ void CDropbox::PasteToClipboard(const TCHAR *data)
}
}
-void CDropbox::Report(MCONTACT hContact, const TCHAR *data)
+void CDropbox::Report(MCONTACT hContact, const wchar_t *data)
{
if (db_get_b(NULL, MODULE, "UrlAutoSend", 1))
SendToContact(hContact, data);
diff --git a/plugins/Dropbox/src/file_transfer.h b/plugins/Dropbox/src/file_transfer.h
index 0800903627..6feacbb445 100644
--- a/plugins/Dropbox/src/file_transfer.h
+++ b/plugins/Dropbox/src/file_transfer.h
@@ -12,7 +12,7 @@ private:
bool isTerminated;
- const TCHAR* folderName;
+ const wchar_t* folderName;
int relativePathStart;
CMString serverFolder;
@@ -40,7 +40,7 @@ public:
pfts.totalBytes = 0;
pfts.totalFiles = 0;
pfts.totalProgress = 0;
- pfts.ptszFiles = (TCHAR**)mir_alloc(sizeof(TCHAR*) * (pfts.totalFiles + 1));
+ pfts.ptszFiles = (wchar_t**)mir_alloc(sizeof(wchar_t*) * (pfts.totalFiles + 1));
pfts.ptszFiles[pfts.totalFiles] = NULL;
pfts.tszWorkingDir = NULL;
pfts.tszCurrentFile = NULL;
@@ -75,7 +75,7 @@ public:
return pfts.hContact;
}
- const TCHAR* GetData() const
+ const wchar_t* GetData() const
{
if (data.IsEmpty())
return NULL;
@@ -87,40 +87,40 @@ public:
isTerminated = true;
}
- void SetWorkingDirectory(const TCHAR *path)
+ void SetWorkingDirectory(const wchar_t *path)
{
- relativePathStart = _tcsrchr(path, '\\') - path + 1;
- pfts.tszWorkingDir = (TCHAR*)mir_calloc(sizeof(TCHAR) * relativePathStart);
+ relativePathStart = wcsrchr(path, '\\') - path + 1;
+ pfts.tszWorkingDir = (wchar_t*)mir_calloc(sizeof(wchar_t) * relativePathStart);
mir_tstrncpy(pfts.tszWorkingDir, path, relativePathStart);
if (PathIsDirectory(path))
- folderName = _tcsrchr(path, '\\') + 1;
+ folderName = wcsrchr(path, '\\') + 1;
}
- void SetServerFolder(const TCHAR *path)
+ void SetServerFolder(const wchar_t *path)
{
if (path)
serverFolder = path;
}
- const TCHAR* GetServerFolder() const
+ const wchar_t* GetServerFolder() const
{
if (serverFolder.IsEmpty())
return NULL;
return serverFolder;
}
- const TCHAR* GetFolderName() const
+ const wchar_t* GetFolderName() const
{
return folderName;
}
- void AddFile(const TCHAR *path)
+ void AddFile(const wchar_t *path)
{
- pfts.ptszFiles = (TCHAR**)mir_realloc(pfts.ptszFiles, sizeof(TCHAR*) * (pfts.totalFiles + 2));
+ pfts.ptszFiles = (wchar_t**)mir_realloc(pfts.ptszFiles, sizeof(wchar_t*) * (pfts.totalFiles + 2));
pfts.ptszFiles[pfts.totalFiles++] = mir_tstrdup(path);
pfts.ptszFiles[pfts.totalFiles] = NULL;
- FILE *file = _tfopen(path, L"rb");
+ FILE *file = _wfopen(path, L"rb");
if (file != NULL) {
_fseeki64(file, 0, SEEK_END);
pfts.totalBytes += _ftelli64(file);
@@ -128,7 +128,7 @@ public:
}
}
- void AppendFormatData(const TCHAR *format, ...)
+ void AppendFormatData(const wchar_t *format, ...)
{
va_list args;
va_start(args, format);
@@ -136,24 +136,24 @@ public:
va_end(args);
}
- const TCHAR* GetCurrentFilePath() const
+ const wchar_t* GetCurrentFilePath() const
{
return pfts.ptszFiles[pfts.currentFileNumber];
}
- const TCHAR* GetCurrentRelativeFilePath() const
+ const wchar_t* GetCurrentRelativeFilePath() const
{
return &GetCurrentFilePath()[relativePathStart];
}
- const TCHAR* GetCurrentFileName() const
+ const wchar_t* GetCurrentFileName() const
{
- return _tcsrchr(pfts.ptszFiles[pfts.currentFileNumber], '\\') + 1;
+ return wcsrchr(pfts.ptszFiles[pfts.currentFileNumber], '\\') + 1;
}
void OpenCurrentFile()
{
- hFile = _tfopen(GetCurrentFilePath(), L"rb");
+ hFile = _wfopen(GetCurrentFilePath(), L"rb");
if (!hFile)
throw DropboxException("Unable to open file");
_fseeki64(hFile, 0, SEEK_END);
@@ -212,7 +212,7 @@ public:
pfts.currentFileNumber = 0;
pfts.currentFileProgress = 0;
- pfts.tszCurrentFile = _tcsrchr(pfts.ptszFiles[pfts.currentFileNumber], '\\') + 1;
+ pfts.tszCurrentFile = wcsrchr(pfts.ptszFiles[pfts.currentFileNumber], '\\') + 1;
ProtoBroadcastAck(MODULE, pfts.hContact, ACKTYPE_FILE, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&pfts);
OpenCurrentFile();
@@ -227,7 +227,7 @@ public:
return false;
pfts.currentFileProgress = 0;
- pfts.tszCurrentFile = _tcsrchr(pfts.ptszFiles[pfts.currentFileNumber], '\\') + 1;
+ pfts.tszCurrentFile = wcsrchr(pfts.ptszFiles[pfts.currentFileNumber], '\\') + 1;
ProtoBroadcastAck(MODULE, pfts.hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, (HANDLE)id, 0);
OpenCurrentFile();
diff --git a/plugins/Dropbox/src/stdafx.h b/plugins/Dropbox/src/stdafx.h
index 21da021e56..56ebe56e24 100644
--- a/plugins/Dropbox/src/stdafx.h
+++ b/plugins/Dropbox/src/stdafx.h
@@ -65,6 +65,7 @@ public:
};
#define MODULE "Dropbox"
+#define MODULEW L"Dropbox"
#include "dropbox_options.h"
#include "http_request.h"
diff --git a/plugins/Exchange/src/MirandaExchange.cpp b/plugins/Exchange/src/MirandaExchange.cpp
index 43a87b679a..ebca794f89 100644
--- a/plugins/Exchange/src/MirandaExchange.cpp
+++ b/plugins/Exchange/src/MirandaExchange.cpp
@@ -117,15 +117,15 @@ CKeeper::CKeeper( LPTSTR szSender, LPTSTR szSubject, LPSTR szEntryID)
if (NULL != szSender) {
m_nSizeSender = (UINT)mir_tstrlen(szSender)+1;
- m_szSender = new TCHAR[ m_nSizeSender ];
- memset(m_szSender, 0, m_nSizeSender * sizeof(TCHAR));
+ m_szSender = new wchar_t[ m_nSizeSender ];
+ memset(m_szSender, 0, m_nSizeSender * sizeof(wchar_t));
mir_tstrcpy(m_szSender, szSender);
}
if (NULL != szSubject) {
m_nSizeSubject = (UINT)mir_tstrlen(szSubject) +1;
- m_szSubject = new TCHAR[m_nSizeSubject];
- memset(m_szSubject, 0, m_nSizeSubject * sizeof(TCHAR));
+ m_szSubject = new wchar_t[m_nSizeSubject];
+ memset(m_szSubject, 0, m_nSizeSubject * sizeof(wchar_t));
mir_tstrcpy(m_szSubject, szSubject);
}
@@ -389,13 +389,13 @@ HRESULT CMirandaExchange::InitializeAndLogin( LPCTSTR szUsername, LPCTSTR szPass
{
_popupUtil(TranslateT("Connecting to Exchange ..."));
UINT nSize = 0;
- short nSizeOfTCHAR = sizeof( TCHAR );
+ short nSizeOfTCHAR = sizeof( wchar_t );
if (m_szUsername == NULL && NULL != szUsername) {
nSize = (UINT)mir_tstrlen(szUsername);
if (nSize > 0) {
nSize++;
- m_szUsername = new TCHAR[nSize];
+ m_szUsername = new wchar_t[nSize];
memset ( m_szUsername, 0, nSize * nSizeOfTCHAR );
mir_tstrcpy( m_szUsername, szUsername );
}
@@ -405,7 +405,7 @@ HRESULT CMirandaExchange::InitializeAndLogin( LPCTSTR szUsername, LPCTSTR szPass
nSize = (UINT)mir_tstrlen(szPassword);
if (nSize > 0) {
nSize++;
- m_szPassword = new TCHAR[nSize];
+ m_szPassword = new wchar_t[nSize];
memset(m_szPassword, 0, nSize * nSizeOfTCHAR);
mir_tstrcpy(m_szPassword, szPassword);
}
@@ -415,7 +415,7 @@ HRESULT CMirandaExchange::InitializeAndLogin( LPCTSTR szUsername, LPCTSTR szPass
nSize = (UINT)mir_tstrlen(szExchangeServer);
if (nSize > 0) {
nSize++;
- m_szExchangeServer = new TCHAR[nSize];
+ m_szExchangeServer = new wchar_t[nSize];
memset(m_szExchangeServer, 0, nSize * nSizeOfTCHAR);
mir_tstrcpy(m_szExchangeServer, szExchangeServer);
}
@@ -431,11 +431,11 @@ HRESULT CMirandaExchange::InitializeAndLogin( LPCTSTR szUsername, LPCTSTR szPass
}
if ( SUCCEEDED(hr)) {
- TCHAR szPIDandName[128];
- TCHAR szPID[20];
+ wchar_t szPIDandName[128];
+ wchar_t szPID[20];
_tstrtime(szPID);
- _tcsncpy(szPIDandName, m_szUsername, _countof(szPIDandName)-1);
+ wcsncpy(szPIDandName, m_szUsername, _countof(szPIDandName)-1);
mir_tstrncat(szPIDandName, szPID, _countof(szPIDandName) - mir_tstrlen(szPIDandName));
hr = CreateProfile(szPIDandName);
@@ -514,7 +514,7 @@ HRESULT CMirandaExchange::CreateProfile( LPTSTR szProfileName )
ULONG ulFlags = 0;
SRestriction sres;
SIZE_T nSize;
- TCHAR* szUniqName;
+ wchar_t* szUniqName;
enum {iSvcName, iSvcUID, cptaSvc};
SizedSPropTagArray(cptaSvc, sptCols) =
@@ -563,10 +563,10 @@ HRESULT CMirandaExchange::CreateProfile( LPTSTR szProfileName )
if (FAILED(hr))
return hr;
nSize = mir_tstrlen(m_szUsername);
- szUniqName = (TCHAR*)mir_alloc(sizeof(TCHAR) * (nSize + 4));
+ szUniqName = (wchar_t*)mir_alloc(sizeof(wchar_t) * (nSize + 4));
if (szUniqName != NULL) {
- memcpy(szUniqName, L"=", sizeof(TCHAR));
- memcpy((szUniqName + 1), m_szUsername, (sizeof(TCHAR) * (nSize + 1)));
+ memcpy(szUniqName, L"=", sizeof(wchar_t));
+ memcpy((szUniqName + 1), m_szUsername, (sizeof(wchar_t) * (nSize + 1)));
// Set values for PR_PROFILE_UNRESOLVED_NAME and PR_PROFILE_UNRESOLVED_SERVER
SPropValue spval[2];
spval[0].ulPropTag = PR_PROFILE_UNRESOLVED_NAME;
@@ -716,8 +716,8 @@ HRESULT CMirandaExchange::CheckInFolder( LPMAPIFOLDER lpFolder )
LPSRowSet lpRow = NULL;
LPSPropValue lpRowProp = NULL;
ULONG i = 0L;
- TCHAR* szSenderName = NULL;
- TCHAR* szSubject = NULL;
+ wchar_t* szSenderName = NULL;
+ wchar_t* szSubject = NULL;
LPSTR szEntryID = NULL;
if ( lpFolder == NULL || !m_bFolderInboxOK )
@@ -842,7 +842,7 @@ HRESULT CMirandaExchange::OpenTheMessage( LPTSTR )
HKEY hTheKey;
HRESULT hRes = E_FAIL;
- TCHAR szRegValue[ 512 ];
+ wchar_t szRegValue[ 512 ];
DWORD dwLength = 512 ;
DWORD dwType = REG_SZ;
@@ -863,11 +863,11 @@ HRESULT CMirandaExchange::OpenTheMessage( LPTSTR )
else
{
- TCHAR* szTheEnd = _tcsstr( szRegValue,L".EXE" );
+ wchar_t* szTheEnd = wcsstr( szRegValue,L".EXE" );
if ( NULL != szTheEnd )
{
- szRegValue[ mir_tstrlen(szRegValue) - mir_tstrlen(szTheEnd) +5 ] = _T('\0');
+ szRegValue[ mir_tstrlen(szRegValue) - mir_tstrlen(szTheEnd) +5 ] = '\0';
mir_tstrcat( szRegValue, L" /recycle" );
STARTUPINFO si;
PROCESS_INFORMATION pi;
diff --git a/plugins/Exchange/src/dlg_handlers.cpp b/plugins/Exchange/src/dlg_handlers.cpp
index a134dafa10..4032a748e6 100644
--- a/plugins/Exchange/src/dlg_handlers.cpp
+++ b/plugins/Exchange/src/dlg_handlers.cpp
@@ -40,7 +40,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
int bCheck = db_get_b(NULL, ModuleName, "Check", 1);
- TCHAR buffer[4096];
+ wchar_t buffer[4096];
GetStringFromDatabase("Username", L"", buffer, _countof(buffer));
SetDlgItemText(hWnd, IDC_USER_EDIT, buffer);
@@ -110,7 +110,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
case PSN_APPLY:
db_set_b(NULL, ModuleName, "Check", IsDlgButtonChecked(hWnd, IDC_CHECK_EMAILS));
- TCHAR buffer[4096];
+ wchar_t buffer[4096];
GetDlgItemText(hWnd, IDC_USER_EDIT, buffer, _countof(buffer));
db_set_ts(NULL, ModuleName, "Username", buffer);
@@ -173,7 +173,7 @@ int CALLBACK ListSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
int count = ListView_GetItemCount(hWnd);
for (int i = 0; i < count; i++) {
if (ListView_GetItemState(hWnd, i, LVIS_SELECTED)) {
- TCHAR emailID[4096]; //uhh
+ wchar_t emailID[4096]; //uhh
ListView_GetItemText(hWnd, i, 2, emailID, _countof(emailID));
exchangeServer.OpenMessage(emailID);
}
@@ -226,8 +226,8 @@ INT_PTR CALLBACK DlgProcEmails(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam
LVITEM item = { 0 };
TEmailHeader email = { 0 };
email.cbSize = sizeof(TEmailHeader);
- TCHAR sender[1024] = L"";
- TCHAR subject[1024] = L"";
+ wchar_t sender[1024] = L"";
+ wchar_t subject[1024] = L"";
//char buffer[4096];
email.cSender = sizeof(sender);
email.cSubject = sizeof(subject);
@@ -297,7 +297,7 @@ INT_PTR CALLBACK DlgProcEmails(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam
int count = ListView_GetItemCount(hList);
for (int i = 0; i < count; i++) {
if (ListView_GetCheckState(hList, i)) {
- TCHAR emailID[2048]; //uhh ohh
+ wchar_t emailID[2048]; //uhh ohh
LVITEM item = { 0 };
item.iItem = i;
item.mask = LVIF_TEXT;
diff --git a/plugins/Exchange/src/emails.cpp b/plugins/Exchange/src/emails.cpp
index 496d8969eb..f38bc7335c 100644
--- a/plugins/Exchange/src/emails.cpp
+++ b/plugins/Exchange/src/emails.cpp
@@ -57,12 +57,12 @@ int CExchangeServer::Connect(int bForceConnect)
}
if ( !IsConnected() && bTryConnect) {
- TCHAR user[1024]; //lovely
- TCHAR password[1024]; //i know
- TCHAR server[1024];
+ wchar_t user[1024]; //lovely
+ wchar_t password[1024]; //i know
+ wchar_t server[1024];
GetStringFromDatabase("Username", L"", user, _countof(user));
- _tcsncpy_s(user, VARST(user), _TRUNCATE);
+ wcsncpy_s(user, VARST(user), _TRUNCATE);
GetStringFromDatabase("Password", L"", password, _countof(password));
GetStringFromDatabase("Server", L"", server, _countof(server));
@@ -92,7 +92,7 @@ int CExchangeServer::Disconnect()
// return -1; //0 on success, != 0 otherwise
}
-int CExchangeServer::DoConnect(TCHAR *user, TCHAR *password, TCHAR *server, int)
+int CExchangeServer::DoConnect(wchar_t *user, wchar_t *password, wchar_t *server, int)
{
if (bTryConnect)
@@ -152,7 +152,7 @@ int CExchangeServer::IsServerAvailable()
if (sServer == INVALID_SOCKET)
return 0; //server is not available
- TCHAR szServer[1024];
+ wchar_t szServer[1024];
GetStringFromDatabase("Server", L"", szServer, sizeof(szServer));
sockaddr_in addrServer;
InitSocketAddr(&addrServer, mir_t2a(szServer));
@@ -205,8 +205,8 @@ int CExchangeServer::GetEmailHeader(int iUnreadEmail, TEmailHeader *emailInfo)
#ifndef NO_EXCHANGE_TEST
if (NULL != m_HeadersKeeper[iUnreadEmail]) {
- TCHAR* szSender = m_HeadersKeeper[iUnreadEmail]->m_szSender;
- TCHAR* szSubject = m_HeadersKeeper[iUnreadEmail]->m_szSubject;
+ wchar_t* szSender = m_HeadersKeeper[iUnreadEmail]->m_szSender;
+ wchar_t* szSubject = m_HeadersKeeper[iUnreadEmail]->m_szSubject;
if (NULL == szSender)
szSender = L"";
@@ -229,7 +229,7 @@ int CExchangeServer::GetEmailHeader(int iUnreadEmail, TEmailHeader *emailInfo)
return 0;
}
-int CExchangeServer::MarkEmailAsRead(TCHAR *emailID)
+int CExchangeServer::MarkEmailAsRead(wchar_t *emailID)
{
if (!IsConnected())
return -1;
@@ -241,7 +241,7 @@ int CExchangeServer::MarkEmailAsRead(TCHAR *emailID)
return 0;
}
-int CExchangeServer::OpenMessage(TCHAR *emailID)
+int CExchangeServer::OpenMessage(wchar_t *emailID)
{
if (!IsConnected())
return -1;
@@ -277,7 +277,7 @@ int CExchangeServer::Check(int bNoEmailsNotify)
}
if (((count > 0) || ((bNoEmailsNotify) && (count >= 0))) && (count != -1)) {
- TCHAR buffer[1024];
+ wchar_t buffer[1024];
if (count != 1)
mir_sntprintf(buffer, TranslateT("You have %d unread emails..."), count);
else
@@ -292,7 +292,7 @@ int CExchangeServer::Check(int bNoEmailsNotify)
return count;
}
-int ShowMessage(TCHAR *message, int cUnreadEmails)
+int ShowMessage(wchar_t *message, int cUnreadEmails)
{
int usePopups = ServiceExists(MS_POPUP_ADDPOPUPT) ? db_get_b(NULL, ModuleName, "UsePopups", 0) : 0;
if (usePopups)
@@ -301,21 +301,21 @@ int ShowMessage(TCHAR *message, int cUnreadEmails)
return ShowMessageBoxMessage(TranslateT("Do you want to see the email headers?"), message, cUnreadEmails);
}
-int ShowPopupMessage(TCHAR *title, TCHAR *message, int cUnreadEmails)
+int ShowPopupMessage(wchar_t *title, wchar_t *message, int cUnreadEmails)
{
POPUPDATAT popup = {0};
popup.lchContact = NULL;
popup.colorBack = NULL;
popup.colorText = NULL;
popup.lchIcon = hiMailIcon;
- _tcsncpy_s(popup.lptzContactName, MAX_CONTACTNAME, title, _TRUNCATE);
- _tcsncpy_s(popup.lptzText, MAX_SECONDLINE, message, _TRUNCATE);
+ wcsncpy_s(popup.lptzContactName, MAX_CONTACTNAME, title, _TRUNCATE);
+ wcsncpy_s(popup.lptzText, MAX_SECONDLINE, message, _TRUNCATE);
popup.PluginWindowProc = DlgProcPopup;
popup.PluginData = (int *) cUnreadEmails;
return PUAddPopupT(&popup);
}
-int ShowMessageBoxMessage(TCHAR *title, TCHAR *message, int cUnreadEmails)
+int ShowMessageBoxMessage(wchar_t *title, wchar_t *message, int cUnreadEmails)
{
if (MessageBox(0, message, title, MB_YESNO) == IDYES)
ShowEmailsWindow(cUnreadEmails);
diff --git a/plugins/Exchange/src/emails.h b/plugins/Exchange/src/emails.h
index 6dedbd24ce..2a624b8262 100644
--- a/plugins/Exchange/src/emails.h
+++ b/plugins/Exchange/src/emails.h
@@ -33,9 +33,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct TEmailHeader{
int cbSize;
DWORD flags; //flags
- TCHAR *szSender; //pointer to string that receives the sender name
+ wchar_t *szSender; //pointer to string that receives the sender name
int cSender; //size of szSender buffer
- TCHAR *szSubject; //pointer to string that receives the email subject
+ wchar_t *szSubject; //pointer to string that receives the email subject
int cSubject; //size of szSubject buffer
char *emailID;
};
@@ -50,7 +50,7 @@ class CExchangeServer{
int cConnections; //number of connection attempts
int bTryConnect;
- int DoConnect(TCHAR *user, TCHAR *password, TCHAR *server, int port);
+ int DoConnect(wchar_t *user, wchar_t *password, wchar_t *server, int port);
int DoDisconnect();
public:
@@ -76,18 +76,18 @@ class CExchangeServer{
/*
*/
- int MarkEmailAsRead(TCHAR *emailID);
+ int MarkEmailAsRead(wchar_t *emailID);
- int OpenMessage(TCHAR *emailID);
+ int OpenMessage(wchar_t *emailID);
int Check(int bNoEmailsNotify = FALSE);
};
extern CExchangeServer exchangeServer;
-int ShowMessage(TCHAR *message, int cUnreadEmails);
-int ShowPopupMessage(TCHAR *title, TCHAR *message, int cUnreadEmails);
-int ShowMessageBoxMessage(TCHAR *title, TCHAR *message, int cUnreadEmails);
+int ShowMessage(wchar_t *message, int cUnreadEmails);
+int ShowPopupMessage(wchar_t *title, wchar_t *message, int cUnreadEmails);
+int ShowMessageBoxMessage(wchar_t *title, wchar_t *message, int cUnreadEmails);
int ShowEmailsWindow(int cUnreadEmails);
diff --git a/plugins/Exchange/src/hooked_events.cpp b/plugins/Exchange/src/hooked_events.cpp
index ecf569ef70..c484e976c3 100644
--- a/plugins/Exchange/src/hooked_events.cpp
+++ b/plugins/Exchange/src/hooked_events.cpp
@@ -66,7 +66,7 @@ int OnModulesLoaded(WPARAM, LPARAM)
mi.position = 10000000;
mi.pszService = MS_EXCHANGE_CHECKEMAIL;
mi.flags = CMIF_TCHAR;
- mi.name.t = LPGENT("Check exchange mailbox");
+ mi.name.w = LPGENW("Check exchange mailbox");
Menu_AddMainMenuItem(&mi);
hEmailsDlg = NULL; //CreateDialog(hInstance, MAKEINTRESOURCE(IDD_EMAILS), NULL, DlgProcEmails); //create emails window
@@ -82,8 +82,8 @@ int OnOptionsInitialise(WPARAM wParam, LPARAM)
odp.position = 100000000;
odp.hInstance = hInstance;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_EXCHANGE);
- odp.ptszTitle = LPGENT("Exchange notify");
- odp.ptszGroup = LPGENT("Plugins");
+ odp.pwszTitle = LPGENW("Exchange notify");
+ odp.pwszGroup = LPGENW("Plugins");
odp.groupPosition = 910000000;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pfnDlgProc = DlgProcOptions;
diff --git a/plugins/Exchange/src/utils.cpp b/plugins/Exchange/src/utils.cpp
index c1b297f164..9b5204a0cb 100644
--- a/plugins/Exchange/src/utils.cpp
+++ b/plugins/Exchange/src/utils.cpp
@@ -92,23 +92,23 @@ char *BinToHex(int size, PBYTE data)
return szresult;
}
-void HexToBin(TCHAR *inData, ULONG &size, LPBYTE &outData)
+void HexToBin(wchar_t *inData, ULONG &size, LPBYTE &outData)
{
- TCHAR buffer[32] = { 0 };
- _tcsncpy(buffer, L"0x", _countof(L"0x"));
- _tcsncpy(buffer + 2, inData, HEX_SIZE);
- _stscanf(buffer, L"%x", &size);
+ wchar_t buffer[32] = { 0 };
+ wcsncpy(buffer, L"0x", _countof(L"0x"));
+ wcsncpy(buffer + 2, inData, HEX_SIZE);
+ swscanf(buffer, L"%x", &size);
outData = (unsigned char*)new char[size * 2];
- TCHAR *tmp = inData + HEX_SIZE;
+ wchar_t *tmp = inData + HEX_SIZE;
buffer[4] = '\0'; //mark the end of the string
for (UINT i = 0; i < size; i++) {
- _tcsncpy(buffer + 2, &tmp[i * 2], 2);
- _stscanf(buffer, L"%hhx", &outData[i]);
+ wcsncpy(buffer + 2, &tmp[i * 2], 2);
+ swscanf(buffer, L"%hhx", &outData[i]);
}
}
-int GetStringFromDatabase(char *szSettingName, TCHAR *szError, TCHAR *szResult, int size)
+int GetStringFromDatabase(char *szSettingName, wchar_t *szError, wchar_t *szResult, int size)
{
DBVARIANT dbv = { 0 };
int res = 1;
@@ -117,7 +117,7 @@ int GetStringFromDatabase(char *szSettingName, TCHAR *szError, TCHAR *szResult,
res = 0;
size_t tmp = mir_tstrlen(dbv.ptszVal);
size_t len = (tmp < size - 1) ? tmp : size - 1;
- _tcsncpy(szResult, dbv.ptszVal, len);
+ wcsncpy(szResult, dbv.ptszVal, len);
szResult[len] = '\0';
mir_free(dbv.ptszVal);
}
@@ -125,7 +125,7 @@ int GetStringFromDatabase(char *szSettingName, TCHAR *szError, TCHAR *szResult,
res = 1;
size_t tmp = mir_tstrlen(szError);
size_t len = (tmp < size - 1) ? tmp : size - 1;
- _tcsncpy(szResult, szError, len);
+ wcsncpy(szResult, szError, len);
szResult[len] = '\0';
}
return res;
@@ -220,11 +220,11 @@ int ThreadCheckEmail(int bForceAttempt)
return 0;
}
-void _popupUtil(TCHAR* szMsg)
+void _popupUtil(wchar_t* szMsg)
{
POPUPDATAT ppd = { 0 };
ppd.lchIcon = hiMailIcon;
- _tcsncpy(ppd.lptzContactName, L"Exchange notifier", MAX_CONTACTNAME - 1);
- _tcsncpy(ppd.lptzText, szMsg, MAX_SECONDLINE - 1);
+ wcsncpy(ppd.lptzContactName, L"Exchange notifier", MAX_CONTACTNAME - 1);
+ wcsncpy(ppd.lptzText, szMsg, MAX_SECONDLINE - 1);
PUAddPopupT(&ppd); //show a popup to tell the user what we're doing.
}
diff --git a/plugins/Exchange/src/utils.h b/plugins/Exchange/src/utils.h
index c430a5f995..efc7942b95 100644
--- a/plugins/Exchange/src/utils.h
+++ b/plugins/Exchange/src/utils.h
@@ -34,16 +34,16 @@ int Log(char *format, ...);
int Info(char *title, char *format, ...);
char *BinToHex(int size, PBYTE data);
-void HexToBin(TCHAR *inData, ULONG &size, PBYTE &outData);
+void HexToBin(wchar_t *inData, ULONG &size, PBYTE &outData);
void ScreenToClient(HWND hWnd, LPRECT rect);
void AnchorMoveWindow(HWND window, const WINDOWPOS *parentPos, int anchors);
RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos, int anchors);
-int GetStringFromDatabase(char *szSettingName, TCHAR *szError, TCHAR *szResult, int size);
+int GetStringFromDatabase(char *szSettingName, wchar_t *szError, wchar_t *szResult, int size);
int ThreadCheckEmail(int bForceAttempt);
-void _popupUtil(TCHAR *szMsg);
+void _popupUtil(wchar_t *szMsg);
#endif \ No newline at end of file
diff --git a/plugins/ExternalAPI/m_folders.h b/plugins/ExternalAPI/m_folders.h
index b0db2df31f..fbdc248d1c 100644
--- a/plugins/ExternalAPI/m_folders.h
+++ b/plugins/ExternalAPI/m_folders.h
@@ -189,7 +189,7 @@ __inline static INT_PTR FoldersGetCustomPathW(HANDLE hFolderEntry, wchar_t *path
if (res) {
wchar_t buffer[MAX_PATH];
PathToAbsoluteW(notFoundW, buffer);
- _tcsncpy_s(pathW, size, buffer, _TRUNCATE);
+ wcsncpy_s(pathW, size, buffer, _TRUNCATE);
}
return res;
diff --git a/plugins/FTPFileYM/src/dialog.cpp b/plugins/FTPFileYM/src/dialog.cpp
index 1706832239..39192e6583 100644
--- a/plugins/FTPFileYM/src/dialog.cpp
+++ b/plugins/FTPFileYM/src/dialog.cpp
@@ -79,7 +79,7 @@ UploadDialog::Tab::Tab(GenericJob *Job) :
m_stzComplet[0] = 0;
m_stzRemain[0] = 0;
- TCHAR buff[256];
+ wchar_t buff[256];
TCITEM tab = { 0 };
tab.mask = TCIF_TEXT;
tab.pszText = Utils::getTextFragment(m_job->m_tszFileName, 20, buff);
@@ -130,7 +130,7 @@ void UploadDialog::Tab::select()
void UploadDialog::Tab::labelCompleted()
{
- TCHAR buff[64], buff2[256];
+ wchar_t buff[64], buff2[256];
mir_sntprintf(buff2, L"* %s", Utils::getTextFragment(m_job->m_tszFileName, 20, buff));
TCITEM tab = { 0 };
@@ -286,7 +286,7 @@ INT_PTR CALLBACK UploadDialog::UploadDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar
int times[10] = { 5, 15, 30, 1 * 60, 2 * 60, 5 * 60, 10 * 60, 1 * 24 * 60, 2 * 24 * 60, 7 * 24 * 60 };
bool bChecked = (tab->m_iOptAutoDelete == -1);
- TCHAR buff[256];
+ wchar_t buff[256];
for (int i = 0; i < _countof(times); i++) {
if (i == 3 || i == 7)
diff --git a/plugins/FTPFileYM/src/dialog.h b/plugins/FTPFileYM/src/dialog.h
index 9354d45e3c..66244b7168 100644
--- a/plugins/FTPFileYM/src/dialog.h
+++ b/plugins/FTPFileYM/src/dialog.h
@@ -33,7 +33,7 @@ class UploadDialog
private:
static UploadDialog *instance;
static mir_cs mutexTabs;
- TCHAR m_tszToolTipText[1024];
+ wchar_t m_tszToolTipText[1024];
UploadDialog();
@@ -48,9 +48,9 @@ public:
bool m_bOptAutosend;
int m_iOptAutoDelete;
- TCHAR m_stzSpeed[64];
- TCHAR m_stzComplet[64];
- TCHAR m_stzRemain[64];
+ wchar_t m_stzSpeed[64];
+ wchar_t m_stzComplet[64];
+ wchar_t m_stzRemain[64];
Tab(GenericJob *Job);
~Tab();
diff --git a/plugins/FTPFileYM/src/ftpfile.cpp b/plugins/FTPFileYM/src/ftpfile.cpp
index 3fd2de8122..c5e4d548b3 100644
--- a/plugins/FTPFileYM/src/ftpfile.cpp
+++ b/plugins/FTPFileYM/src/ftpfile.cpp
@@ -89,21 +89,21 @@ static void InitIcolib()
void InitMenuItems()
{
- TCHAR stzName[256];
+ wchar_t stzName[256];
CMenuItem mi;
SET_UID(mi, 0xB7132F5A, 0x65FC, 0x42C5, 0xB4, 0xCB, 0x54, 0xBC, 0xAC, 0x58, 0x34, 0xE9);
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = iconList[ServerList::FTP_COUNT].hIcolib;
mi.position = 3000090001;
- mi.name.t = LPGENT("FTP File");
+ mi.name.w = LPGENW("FTP File");
hMainMenu = Menu_AddMainMenuItem(&mi);
if (opt.bUseSubmenu)
hMenu = Menu_AddContactMenuItem(&mi);
memset(&mi, 0, sizeof(mi));
- mi.name.t = stzName;
+ mi.name.w = stzName;
mi.flags = CMIF_TCHAR | CMIF_SYSTEM;
CMenuItem mi2;
@@ -124,7 +124,7 @@ void InitMenuItems()
mi2.root = hSubMenu[i];
mi2.pszService = MS_FTPFILE_CONTACTMENU;
- mi2.name.t = LPGENT("Upload file(s)");
+ mi2.name.w = LPGENW("Upload file(s)");
HGENMENU tmp = Menu_AddContactMenuItem(&mi2);
Menu_ConfigureItem(tmp, MCI_OPT_EXECPARAM, mi2.position = i + UploadJob::FTP_RAWFILE);
@@ -134,7 +134,7 @@ void InitMenuItems()
mi2.root = hSubMenu[i];
mi2.pszService = MS_FTPFILE_CONTACTMENU;
- mi2.name.t = LPGENT("Zip and upload file(s)");
+ mi2.name.w = LPGENW("Zip and upload file(s)");
tmp = Menu_AddContactMenuItem(&mi2);
Menu_ConfigureItem(tmp, MCI_OPT_EXECPARAM, i + UploadJob::FTP_ZIPFILE);
@@ -144,7 +144,7 @@ void InitMenuItems()
mi2.root = hSubMenu[i];
mi2.pszService = MS_FTPFILE_CONTACTMENU;
- mi2.name.t = LPGENT("Zip and upload folder");
+ mi2.name.w = LPGENW("Zip and upload folder");
tmp = Menu_AddContactMenuItem(&mi2);
Menu_ConfigureItem(tmp, MCI_OPT_EXECPARAM, i + UploadJob::FTP_ZIPFOLDER);
@@ -158,7 +158,7 @@ void InitMenuItems()
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = iconList[ServerList::FTP_COUNT].hIcolib;
mi.position = 3000090001;
- mi.name.t = LPGENT("FTP File manager");
+ mi.name.w = LPGENW("FTP File manager");
mi.pszService = MS_FTPFILE_SHOWMANAGER;
mi.root = hMainMenu;
Menu_AddMainMenuItem(&mi);
diff --git a/plugins/FTPFileYM/src/job_delete.cpp b/plugins/FTPFileYM/src/job_delete.cpp
index 19d6aff7ad..2449d1e91a 100644
--- a/plugins/FTPFileYM/src/job_delete.cpp
+++ b/plugins/FTPFileYM/src/job_delete.cpp
@@ -89,7 +89,7 @@ void DeleteJob::run()
DBEntry::remove(m_entry->m_fileID);
}
else if (manDlg != NULL && m_treeItem) {
- TCHAR *error = mir_a2t(szError);
+ wchar_t *error = mir_a2t(szError);
mir_tstrcpy(m_treeItem->m_tszToolTip, error);
m_treeItem->setState(Manager::TreeItem::_ERROR());
FREE(error);
diff --git a/plugins/FTPFileYM/src/job_generic.cpp b/plugins/FTPFileYM/src/job_generic.cpp
index 92dabed7d9..9d4adf6013 100644
--- a/plugins/FTPFileYM/src/job_generic.cpp
+++ b/plugins/FTPFileYM/src/job_generic.cpp
@@ -54,7 +54,7 @@ GenericJob::~GenericJob()
int GenericJob::openFileDialog()
{
- TCHAR temp[MAX_PATH] = L"";
+ wchar_t temp[MAX_PATH] = L"";
mir_sntprintf(temp, L"%s\0*.*\0", TranslateT("All Files (*.*)"));
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
@@ -85,12 +85,12 @@ int GenericJob::openFolderDialog()
void GenericJob::getFilesFromOpenDialog()
{
- TCHAR stzFile[MAX_PATH];
+ wchar_t stzFile[MAX_PATH];
size_t length = mir_tstrlen(m_tszFilePath);
if (m_tszFilePath[0] && m_tszFilePath[length + 1]) // multiple files
{
- TCHAR *ptr = m_tszFilePath + length + 1;
+ wchar_t *ptr = m_tszFilePath + length + 1;
while (ptr[0]) {
mir_sntprintf(stzFile, L"%s\\%s", m_tszFilePath, ptr);
addFile(stzFile);
@@ -102,9 +102,9 @@ void GenericJob::getFilesFromOpenDialog()
}
}
-int GenericJob::getFilesFromFolder(TCHAR *stzFolder)
+int GenericJob::getFilesFromFolder(wchar_t *stzFolder)
{
- TCHAR stzFile[MAX_PATH], stzDirSave[MAX_PATH];
+ wchar_t stzFile[MAX_PATH], stzDirSave[MAX_PATH];
GetCurrentDirectory(MAX_PATH, stzDirSave);
if (!SetCurrentDirectory(stzFolder)) {
@@ -152,7 +152,7 @@ int GenericJob::getFiles()
int GenericJob::getFiles(void **objects, int objCount, DWORD flags)
{
if (m_mode == FTP_ZIPFOLDER) {
- TCHAR *folder;
+ wchar_t *folder;
if (flags & FUPL_UNICODE)
folder = mir_u2t((wchar_t *)objects[0]);
else
@@ -164,7 +164,7 @@ int GenericJob::getFiles(void **objects, int objCount, DWORD flags)
}
else {
for (int i = 0; i < objCount; i++) {
- TCHAR *fileName;
+ wchar_t *fileName;
if (flags & FUPL_UNICODE)
fileName = mir_u2t((wchar_t *)objects[i]);
else
@@ -178,9 +178,9 @@ int GenericJob::getFiles(void **objects, int objCount, DWORD flags)
return (m_files.size() == 0) ? 0 : 1;
}
-void GenericJob::addFile(TCHAR *fileName)
+void GenericJob::addFile(wchar_t *fileName)
{
- TCHAR *buff = mir_tstrdup(fileName);
+ wchar_t *buff = mir_tstrdup(fileName);
m_files.push_back(buff);
}
@@ -215,7 +215,7 @@ bool GenericJob::isConnecting()
return (m_status == STATUS_CONNECTING || m_status == STATUS_CREATED);
}
-TCHAR *GenericJob::getStatusString()
+wchar_t *GenericJob::getStatusString()
{
switch (m_status) {
case STATUS_CANCELED: return TranslateT("CANCELED");
diff --git a/plugins/FTPFileYM/src/job_generic.h b/plugins/FTPFileYM/src/job_generic.h
index beeb1b606f..ffc370958d 100644
--- a/plugins/FTPFileYM/src/job_generic.h
+++ b/plugins/FTPFileYM/src/job_generic.h
@@ -43,8 +43,8 @@ private:
int openFileDialog();
int openFolderDialog();
void getFilesFromOpenDialog();
- int getFilesFromFolder(TCHAR *stzFolder);
- void addFile(TCHAR *fileName);
+ int getFilesFromFolder(wchar_t *stzFolder);
+ void addFile(wchar_t *fileName);
public:
enum EMode
@@ -69,15 +69,15 @@ public:
MCONTACT m_hContact;
int m_iFtpNum, m_fileID;
ServerList::FTP *m_ftp;
- TCHAR m_tszFilePath[1024];
- TCHAR m_tszFileName[64];
+ wchar_t m_tszFilePath[1024];
+ wchar_t m_tszFileName[64];
char m_szSafeFileName[64];
EMode m_mode;
EStatus m_status;
UploadDialog::Tab *m_tab;
- vector<TCHAR *> m_files;
- TCHAR* operator[] (int i) const { return m_files[i];}
+ vector<wchar_t *> m_files;
+ wchar_t* operator[] (int i) const { return m_files[i];}
GenericJob(MCONTACT hContact, int m_iFtpNum, EMode mode);
GenericJob(GenericJob *job);
@@ -93,7 +93,7 @@ public:
bool isConnecting();
bool isCanceled();
- TCHAR *getStatusString();
+ wchar_t *getStatusString();
virtual void start() = 0;
virtual void pause() = 0;
diff --git a/plugins/FTPFileYM/src/job_packer.cpp b/plugins/FTPFileYM/src/job_packer.cpp
index 3a6b037d5a..135b06e665 100644
--- a/plugins/FTPFileYM/src/job_packer.cpp
+++ b/plugins/FTPFileYM/src/job_packer.cpp
@@ -35,20 +35,20 @@ PackerJob::PackerJob(MCONTACT hContact, int iFtpNum, EMode mode) :
void PackerJob::getZipFilePath()
{
- TCHAR buff[256], stzFileName[256] = { 0 };
- TCHAR *pch;
+ wchar_t buff[256], stzFileName[256] = { 0 };
+ wchar_t *pch;
if (m_files.size() == 1) {
mir_tstrcpy(stzFileName, Utils::getFileNameFromPath(m_files[0]));
- pch = _tcsrchr(stzFileName, '.');
+ pch = wcsrchr(stzFileName, '.');
if (pch) *pch = 0;
}
else {
mir_tstrcpy(buff, m_files[0]);
- pch = _tcsrchr(buff, '\\');
+ pch = wcsrchr(buff, '\\');
if (pch) {
*pch = 0;
- pch = _tcsrchr(buff, '\\');
+ pch = wcsrchr(buff, '\\');
if (pch) mir_tstrcpy(stzFileName, pch + 1);
}
}
@@ -109,7 +109,7 @@ void PackerJob::pack()
{
struct _stat fileInfo;
for (UINT i = 0; i < m_files.size(); i++) {
- if (_tstat(m_files[i], &fileInfo) == 0)
+ if (_wstat(m_files[i], &fileInfo) == 0)
m_uiFileSize += (UINT64)fileInfo.st_size;
}
@@ -161,7 +161,7 @@ int PackerJob::createZipFile()
FREE(file);
if (err == ZIP_OK) {
- FILE *fin = _tfopen(m_files[i], L"rb");
+ FILE *fin = _wfopen(m_files[i], L"rb");
if (fin) {
do {
if (isCanceled()) {
@@ -209,7 +209,7 @@ Cleanup:
return result;
}
-uLong PackerJob::getFileTime(TCHAR *file, tm_zip*, uLong *dt)
+uLong PackerJob::getFileTime(wchar_t *file, tm_zip*, uLong *dt)
{
FILETIME ftLocal;
HANDLE hFind;
@@ -238,7 +238,7 @@ void PackerJob::updateStats()
double perc = m_uiFileSize ? ((double)m_uiReaded / m_uiFileSize) * 100 : 0;
mir_sntprintf(m_tab->m_stzComplet, TranslateT("%0.1f%% (%d kB/%d kB)"), perc, (int)m_uiReaded / 1024, (int)m_uiFileSize / 1024);
- TCHAR buff[256];
+ wchar_t buff[256];
long s = (m_uiFileSize - m_uiReaded) / (long)(speed * 1024);
int d = (s / 60 / 60 / 24);
int h = (s - d * 60 * 60 * 24) / 60 / 60;
diff --git a/plugins/FTPFileYM/src/job_packer.h b/plugins/FTPFileYM/src/job_packer.h
index 5cd36a0d87..14edcbeda1 100644
--- a/plugins/FTPFileYM/src/job_packer.h
+++ b/plugins/FTPFileYM/src/job_packer.h
@@ -37,7 +37,7 @@ private:
static int iRunningJobCount;
static void waitingThread(void *arg);
- static uLong getFileTime(TCHAR *file, tm_zip *tmzip, uLong *dt);
+ static uLong getFileTime(wchar_t *file, tm_zip *tmzip, uLong *dt);
void pack();
void getZipFilePath();
diff --git a/plugins/FTPFileYM/src/job_upload.cpp b/plugins/FTPFileYM/src/job_upload.cpp
index f4bb1b2fb3..b6c1e9a20c 100644
--- a/plugins/FTPFileYM/src/job_upload.cpp
+++ b/plugins/FTPFileYM/src/job_upload.cpp
@@ -245,8 +245,8 @@ INT_PTR CALLBACK UploadJob::DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wPa
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- TCHAR buff[256];
- TCHAR *fileName = mir_a2t((char *)lParam);
+ wchar_t buff[256];
+ wchar_t *fileName = mir_a2t((char *)lParam);
mir_sntprintf(buff, TranslateT("File exists - %s"), fileName);
SetWindowText(hwndDlg, buff);
FREE(fileName);
@@ -266,7 +266,7 @@ void UploadJob::upload()
{
refreshTab(true);
- m_fp = _tfopen(m_tszFilePath, L"rb");
+ m_fp = _wfopen(m_tszFilePath, L"rb");
if (m_fp == NULL) {
Utils::msgBox(TranslateT("Error occurred when opening local file.\nAborting file upload..."), MB_OK | MB_ICONERROR);
return;
@@ -277,7 +277,7 @@ void UploadJob::upload()
headerList = curl_slist_append(headerList, getChmodString());
struct _stat fileInfo;
- _tstat(m_tszFilePath, &fileInfo);
+ _wstat(m_tszFilePath, &fileInfo);
m_uiFileSize = (UINT64)fileInfo.st_size;
CURL *hCurl = curlInit(getUrlString(), headerList);
@@ -402,7 +402,7 @@ void UploadJob::updateStats()
int m = (s - d * 60 * 60 * 24 - h * 60 * 60) / 60;
s = s - (d * 24 * 60 * 60) - (h * 60 * 60) - (m * 60);
- TCHAR buff[256];
+ wchar_t buff[256];
if (d > 0) mir_sntprintf(buff, L"%dd %02d:%02d:%02d", d, h, m, s);
else mir_sntprintf(buff, L"%02d:%02d:%02d", h, m, s);
mir_sntprintf(m_tab->m_stzRemain, L"%s (%d kB/%d kB)", buff, (m_uiFileSize - m_uiTotalSent) / 1024, m_uiFileSize / 1024);
diff --git a/plugins/FTPFileYM/src/manager.cpp b/plugins/FTPFileYM/src/manager.cpp
index 8d68a8f1c6..d838e77884 100644
--- a/plugins/FTPFileYM/src/manager.cpp
+++ b/plugins/FTPFileYM/src/manager.cpp
@@ -377,7 +377,7 @@ INT_PTR CALLBACK Manager::ManagerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
if (item) {
if (item->m_tszToolTip[0]) {
- _tcsncpy(tvInfoTip->pszText, item->m_tszToolTip, tvInfoTip->cchTextMax - 1);
+ wcsncpy(tvInfoTip->pszText, item->m_tszToolTip, tvInfoTip->cchTextMax - 1);
tvInfoTip->pszText[tvInfoTip->cchTextMax - 1] = 0;
}
}
diff --git a/plugins/FTPFileYM/src/manager.h b/plugins/FTPFileYM/src/manager.h
index 088ddf0b03..52983d6f5a 100644
--- a/plugins/FTPFileYM/src/manager.h
+++ b/plugins/FTPFileYM/src/manager.h
@@ -49,7 +49,7 @@ public:
public:
HTREEITEM m_handle;
HTREEITEM m_parent;
- TCHAR m_tszToolTip[256];
+ wchar_t m_tszToolTip[256];
int m_fileID;
TreeItem(HTREEITEM _handle, HTREEITEM _parent, int _id);
diff --git a/plugins/FTPFileYM/src/mir_db.cpp b/plugins/FTPFileYM/src/mir_db.cpp
index c09b6dac51..e14e2caccc 100644
--- a/plugins/FTPFileYM/src/mir_db.cpp
+++ b/plugins/FTPFileYM/src/mir_db.cpp
@@ -46,7 +46,7 @@ int DB::setAStringF(MCONTACT hContact, char *szModule, char *szSetting, int id,
return db_set_s(hContact, szModule, formSet, szValue);
}
-int DB::setStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, TCHAR *stzValue)
+int DB::setStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, wchar_t *stzValue)
{
char formSet[256];
mir_snprintf(formSet, szSetting, id);
@@ -94,7 +94,7 @@ int DB::getAStringF(MCONTACT hContact, char *szModule, char *szSetting, int id,
return getAString(hContact, szModule, formSet, buff);
}
-int DB::getString(MCONTACT hContact, char *szModule, char *szSetting, TCHAR *buff)
+int DB::getString(MCONTACT hContact, char *szModule, char *szSetting, wchar_t *buff)
{
DBVARIANT dbv;
if (!db_get_ts(hContact, szModule, szSetting, &dbv)) {
@@ -107,7 +107,7 @@ int DB::getString(MCONTACT hContact, char *szModule, char *szSetting, TCHAR *buf
return 1;
}
-int DB::getStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, TCHAR *buff)
+int DB::getStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, wchar_t *buff)
{
char formSet[256];
mir_snprintf(formSet, szSetting, id);
diff --git a/plugins/FTPFileYM/src/mir_db.h b/plugins/FTPFileYM/src/mir_db.h
index f53e084667..750f6c6b8a 100644
--- a/plugins/FTPFileYM/src/mir_db.h
+++ b/plugins/FTPFileYM/src/mir_db.h
@@ -28,7 +28,7 @@ public:
static int setDwordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iValue);
static int setAStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, char *szValue);
- static int setStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, TCHAR *stzValue);
+ static int setStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, wchar_t *stzValue);
static int getByteF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue = -1);
static int getWordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue = -1);
@@ -37,8 +37,8 @@ public:
// !!!!!!!!!!!!!!!!!!! dangerous as hell
static int getAString(MCONTACT hContact, char *szModule, char *szSetting, char *buff);
static int getAStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, char *buff);
- static int getString(MCONTACT hContact, char *szModule, char *szSetting, TCHAR *buff);
- static int getStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, TCHAR *buff);
+ static int getString(MCONTACT hContact, char *szModule, char *szSetting, wchar_t *buff);
+ static int getStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, wchar_t *buff);
static int deleteSettingF(MCONTACT hContact, char *szModule, char *szSetting, int id);
};
diff --git a/plugins/FTPFileYM/src/options.cpp b/plugins/FTPFileYM/src/options.cpp
index dc2942b077..fa0632194b 100644
--- a/plugins/FTPFileYM/src/options.cpp
+++ b/plugins/FTPFileYM/src/options.cpp
@@ -250,15 +250,15 @@ int Options::InitOptions(WPARAM wParam, LPARAM)
odp.position = 100000000;
odp.hInstance = hInst;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.ptszTitle = LPGENT("FTP File");
- odp.ptszGroup = LPGENT("Services");
+ odp.pwszTitle = LPGENW("FTP File");
+ odp.pwszGroup = LPGENW("Services");
- odp.ptszTab = LPGENT("Accounts");
+ odp.pwszTab = LPGENW("Accounts");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FTPFILE);
odp.pfnDlgProc = Options::DlgProcOptsAccounts;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Advanced");
+ odp.pwszTab = LPGENW("Advanced");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ADVANCED);
odp.pfnDlgProc = Options::DlgProcOptsAdvanced;
Options_AddPage(wParam, &odp);
diff --git a/plugins/FTPFileYM/src/serverlist.h b/plugins/FTPFileYM/src/serverlist.h
index d542ea6c07..05b2e66724 100644
--- a/plugins/FTPFileYM/src/serverlist.h
+++ b/plugins/FTPFileYM/src/serverlist.h
@@ -40,7 +40,7 @@ public:
};
bool m_bEnabled;
- TCHAR m_stzName[64];
+ wchar_t m_stzName[64];
char m_szServer[256];
char m_szUser[64];
char m_szPass[64];
diff --git a/plugins/FTPFileYM/src/utils.cpp b/plugins/FTPFileYM/src/utils.cpp
index d17bb4ba6c..d15a706055 100644
--- a/plugins/FTPFileYM/src/utils.cpp
+++ b/plugins/FTPFileYM/src/utils.cpp
@@ -32,7 +32,7 @@ int Utils::getDeleteTimeMin()
return -1;
}
-int Utils::msgBox(TCHAR *stzMsg, UINT uType)
+int Utils::msgBox(wchar_t *stzMsg, UINT uType)
{
HWND hwnd = (uDlg != NULL) ? uDlg->m_hwnd : 0;
return MessageBox(hwnd, stzMsg, TranslateT("FTP File"), uType);
@@ -58,14 +58,14 @@ HANDLE Utils::getIconHandle(const char *szName)
return IcoLib_GetIconHandle(buff);
}
-TCHAR* Utils::getFileNameFromPath(TCHAR *stzPath)
+wchar_t* Utils::getFileNameFromPath(wchar_t *stzPath)
{
- TCHAR *pch = _tcsrchr(stzPath, '\\');
+ wchar_t *pch = wcsrchr(stzPath, '\\');
if (pch) return pch + 1;
else return L"file.zip";
}
-TCHAR* Utils::getTextFragment(TCHAR *stzText, size_t length, TCHAR *buff)
+wchar_t* Utils::getTextFragment(wchar_t *stzText, size_t length, wchar_t *buff)
{
if (mir_tstrlen(stzText) > length) {
mir_tstrcpy(buff, stzText);
@@ -95,7 +95,7 @@ void Utils::copyToClipboard(char *szText)
const char from_chars[] = "àáâãä叿çèéêëìíîïðñòóôõö÷øùúûüýþÿÀÁÂÃÄŨÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞß !@#$%^&=,{}[];'`";
const char to_chars[] = "abvgdeezziiklmnoprstufhccwwqyqeuaABVGDEEZZIIKLMNOPRSTUFHCCWWQYQEUA_________________";
-char* Utils::makeSafeString(TCHAR *input, char *output)
+char* Utils::makeSafeString(wchar_t *input, char *output)
{
char *buff = mir_t2a(input);
size_t length = mir_strlen(buff);
@@ -155,12 +155,12 @@ void Utils::curlSetOpt(CURL *hCurl, ServerList::FTP *ftp, char *url, struct curl
INT_PTR CALLBACK Utils::DlgProcSetFileName(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TCHAR *fileName = (TCHAR *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ wchar_t *fileName = (wchar_t *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- fileName = (TCHAR *)lParam;
+ fileName = (wchar_t *)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)fileName);
SetDlgItemText(hwndDlg, IDC_NAME, fileName);
@@ -189,7 +189,7 @@ INT_PTR CALLBACK Utils::DlgProcSetFileName(HWND hwndDlg, UINT msg, WPARAM wParam
return FALSE;
}
-bool Utils::setFileNameDlg(TCHAR *nameBuff)
+bool Utils::setFileNameDlg(wchar_t *nameBuff)
{
if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DLG_NAME), 0, DlgProcSetFileName, (LPARAM)nameBuff) == IDOK)
return true;
@@ -199,8 +199,8 @@ bool Utils::setFileNameDlg(TCHAR *nameBuff)
bool Utils::setFileNameDlgA(char *nameBuff)
{
- TCHAR buff[64];
- TCHAR *tmp = mir_a2t(nameBuff);
+ wchar_t buff[64];
+ wchar_t *tmp = mir_a2t(nameBuff);
mir_tstrcpy(buff, tmp);
FREE(tmp);
diff --git a/plugins/FTPFileYM/src/utils.h b/plugins/FTPFileYM/src/utils.h
index 7c83869ade..de5fd9d911 100644
--- a/plugins/FTPFileYM/src/utils.h
+++ b/plugins/FTPFileYM/src/utils.h
@@ -27,21 +27,21 @@ private:
static INT_PTR CALLBACK DlgProcSetFileName(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
public:
- static int msgBox(TCHAR *szMsg, UINT uType);
+ static int msgBox(wchar_t *szMsg, UINT uType);
static int msgBoxA(char *szMsg, UINT uType);
static int getDeleteTimeMin();
static HICON loadIconEx(const char *szName);
static HANDLE getIconHandle(const char *szName);
- static TCHAR *getFileNameFromPath(TCHAR *stzPath);
- static TCHAR *getTextFragment(TCHAR *stzText, size_t length, TCHAR *buff);
- static char *makeSafeString(TCHAR *input, char *output);
+ static wchar_t *getFileNameFromPath(wchar_t *stzPath);
+ static wchar_t *getTextFragment(wchar_t *stzText, size_t length, wchar_t *buff);
+ static char *makeSafeString(wchar_t *input, char *output);
static void createFileDownloadLink(char *szUrl, char *fileName, char *buff, int buffSize);
static void copyToClipboard(char *szText);
static void curlSetOpt(CURL *hCurl, ServerList::FTP *ftp, char *url, struct curl_slist *headerList, char *errorBuff);
- static bool setFileNameDlg(TCHAR *nameBuff);
+ static bool setFileNameDlg(wchar_t *nameBuff);
static bool setFileNameDlgA(char *nameBuff);
};
diff --git a/plugins/FavContacts/src/contact_cache.cpp b/plugins/FavContacts/src/contact_cache.cpp
index 38cd4abb62..fb837cdd09 100644
--- a/plugins/FavContacts/src/contact_cache.cpp
+++ b/plugins/FavContacts/src/contact_cache.cpp
@@ -114,7 +114,7 @@ float CContactCache::getWeight(int rate)
return -1;
}
-static bool AppendInfo(TCHAR *buf, int size, MCONTACT hContact, int info)
+static bool AppendInfo(wchar_t *buf, int size, MCONTACT hContact, int info)
{
ptrT str(Contact_GetInfo(info, hContact));
if (str != NULL) {
@@ -128,7 +128,7 @@ static bool AppendInfo(TCHAR *buf, int size, MCONTACT hContact, int info)
void CContactCache::TContactInfo::LoadInfo()
{
if (infoLoaded) return;
- TCHAR *p = info;
+ wchar_t *p = info;
p[0] = p[1] = 0;
@@ -147,22 +147,22 @@ void CContactCache::TContactInfo::LoadInfo()
infoLoaded = true;
}
-TCHAR *nb_stristr(TCHAR *str, TCHAR *substr)
+wchar_t *nb_stristr(wchar_t *str, wchar_t *substr)
{
if (!substr || !*substr) return str;
if (!str || !*str) return NULL;
- TCHAR *str_up = NEWTSTR_ALLOCA(str);
- TCHAR *substr_up = NEWTSTR_ALLOCA(substr);
+ wchar_t *str_up = NEWWSTR_ALLOCA(str);
+ wchar_t *substr_up = NEWWSTR_ALLOCA(substr);
CharUpperBuff(str_up, (DWORD)mir_tstrlen(str_up));
CharUpperBuff(substr_up, (DWORD)mir_tstrlen(substr_up));
- TCHAR *p = _tcsstr(str_up, substr_up);
+ wchar_t *p = wcsstr(str_up, substr_up);
return p ? (str + (p - str_up)) : NULL;
}
-bool CContactCache::filter(int rate, TCHAR *str)
+bool CContactCache::filter(int rate, wchar_t *str)
{
if (!str || !*str)
return true;
@@ -172,7 +172,7 @@ bool CContactCache::filter(int rate, TCHAR *str)
HKL kbdLayouts[10];
int nKbdLayouts = GetKeyboardLayoutList(_countof(kbdLayouts), kbdLayouts);
- TCHAR buf[256];
+ wchar_t buf[256];
BYTE keyState[256] = { 0 };
for (int iLayout = 0; iLayout < nKbdLayouts; ++iLayout) {
@@ -188,7 +188,7 @@ bool CContactCache::filter(int rate, TCHAR *str)
buf[i] = 0;
}
- for (TCHAR *p = m_cache[rate]->info; p && *p; p = p + mir_tstrlen(p) + 1)
+ for (wchar_t *p = m_cache[rate]->info; p && *p; p = p + mir_tstrlen(p) + 1)
if (nb_stristr(p, buf))
return true;
}
diff --git a/plugins/FavContacts/src/contact_cache.h b/plugins/FavContacts/src/contact_cache.h
index 6bbd52a74b..2987290735 100644
--- a/plugins/FavContacts/src/contact_cache.h
+++ b/plugins/FavContacts/src/contact_cache.h
@@ -11,7 +11,7 @@ public:
MCONTACT hContact;
float rate;
bool infoLoaded;
- TCHAR info[INFOSIZE];
+ wchar_t info[INFOSIZE];
TContactInfo()
{
@@ -39,7 +39,7 @@ public:
MCONTACT get(int rate);
float getWeight(int rate);
- bool filter(int rate, TCHAR *str);
+ bool filter(int rate, wchar_t *str);
};
#endif // __contact_cache__
diff --git a/plugins/FavContacts/src/favlist.h b/plugins/FavContacts/src/favlist.h
index c8adf21ca1..91245327d7 100644
--- a/plugins/FavContacts/src/favlist.h
+++ b/plugins/FavContacts/src/favlist.h
@@ -6,8 +6,8 @@ struct TContactInfo
private:
MCONTACT hContact;
DWORD status;
- TCHAR *name;
- TCHAR *group;
+ wchar_t *name;
+ wchar_t *group;
bool bManual;
float fRate;
@@ -39,7 +39,7 @@ public:
return hContact;
}
- TCHAR *getGroup() const
+ wchar_t *getGroup() const
{
return group;
}
@@ -66,7 +66,7 @@ class TFavContacts : public LIST < TContactInfo >
{
private:
int nGroups;
- TCHAR *prevGroup;
+ wchar_t *prevGroup;
MIDatabase *db;
int addContact(MCONTACT hContact, bool bManual)
@@ -84,7 +84,7 @@ private:
TContactInfo *info = new TContactInfo(hContact, bManual);
insert(info);
- TCHAR *group = info->getGroup();
+ wchar_t *group = info->getGroup();
if (prevGroup && mir_tstrcmp(prevGroup, group))
++nGroups;
prevGroup = group;
diff --git a/plugins/FavContacts/src/http_api.cpp b/plugins/FavContacts/src/http_api.cpp
index ab04a6ac71..cc84b08adc 100644
--- a/plugins/FavContacts/src/http_api.cpp
+++ b/plugins/FavContacts/src/http_api.cpp
@@ -74,7 +74,7 @@ public:
for (int i = 0; i < favList.getCount(); ++i)
{
MCONTACT hContact = favList[i]->getHandle();
- TCHAR *name = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *name = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0);
AVATARCACHEENTRY *avatar = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, hContact, 0);
int status = db_get_w(hContact, GetContactProto(hContact), "Status", ID_STATUS_OFFLINE);
diff --git a/plugins/FavContacts/src/menu.cpp b/plugins/FavContacts/src/menu.cpp
index 6110ad45ba..15c2f3189e 100644
--- a/plugins/FavContacts/src/menu.cpp
+++ b/plugins/FavContacts/src/menu.cpp
@@ -23,11 +23,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
UINT g_maxItemWidth = 0;
float g_widthMultiplier = 0;
-TCHAR g_filter[1024] = { 0 };
+wchar_t g_filter[1024] = { 0 };
HWND g_hwndMenuHost = NULL;
-static TCHAR* sttGetGroupName(int id)
+static wchar_t* sttGetGroupName(int id)
{
if (id == 1) {
if (g_Options.bUseGroups)
@@ -42,7 +42,7 @@ static BOOL sttMeasureItem_Group(LPMEASUREITEMSTRUCT lpmis, Options *options)
{
HDC hdc = GetDC(g_hwndMenuHost);
HFONT hfntSave = (HFONT)SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT));
- TCHAR *name = sttGetGroupName(-INT_PTR(lpmis->itemData));
+ wchar_t *name = sttGetGroupName(-INT_PTR(lpmis->itemData));
if (!options->bSysColors)
SelectObject(hdc, g_Options.hfntName);
@@ -71,7 +71,7 @@ static BOOL sttMeasureItem_Contact(LPMEASUREITEMSTRUCT lpmis, Options *options)
if (options->bSecondLine) {
bool bFree = false;
- TCHAR *title = db_get_tsa(hContact, "CList", "StatusMsg");
+ wchar_t *title = db_get_tsa(hContact, "CList", "StatusMsg");
if (title == NULL) {
char *proto = GetContactProto(hContact);
int status = db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE);
@@ -89,7 +89,7 @@ static BOOL sttMeasureItem_Contact(LPMEASUREITEMSTRUCT lpmis, Options *options)
mir_free(title);
}
- TCHAR *name = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *name = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0);
if (!options->bSysColors) SelectObject(hdc, g_Options.hfntName);
GetTextExtentPoint32(hdc, name, (int)mir_tstrlen(name), &sz);
@@ -155,7 +155,7 @@ static BOOL sttDrawItem_Group(LPDRAWITEMSTRUCT lpdis, Options *options = NULL)
SetTextColor(lpdis->hDC, g_Options.clLine1Sel);
}
- TCHAR *name = sttGetGroupName(-INT_PTR(lpdis->itemData));
+ wchar_t *name = sttGetGroupName(-INT_PTR(lpdis->itemData));
if (!options->bSysColors)
SelectObject(lpdis->hDC, g_Options.hfntName);
DrawText(lpdis->hDC, name, -1, &lpdis->rcItem, DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER | DT_CENTER);
@@ -301,7 +301,7 @@ static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = NULL)
}
if (true) {
- TCHAR *name = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *name = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0);
if (!options->bSysColors)
SelectObject(hdcTemp, g_Options.hfntName);
@@ -315,7 +315,7 @@ static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = NULL)
if (options->bSecondLine) {
bool bFree = false;
- TCHAR *title = db_get_tsa(hContact, "CList", "StatusMsg");
+ wchar_t *title = db_get_tsa(hContact, "CList", "StatusMsg");
if (title == NULL) {
int status = db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE);
title = pcli->pfnGetStatusModeDescription(status, 0);
@@ -393,9 +393,9 @@ static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam,
if (size_t l = mir_tstrlen(g_filter))
g_filter[l - 1] = 0;
}
- else if (_istalnum(LOWORD(wParam))) {
+ else if (iswalnum(LOWORD(wParam))) {
if (mir_tstrlen(g_filter) < _countof(g_filter) - 1) {
- TCHAR s[] = { LOWORD(wParam), 0 };
+ wchar_t s[] = { LOWORD(wParam), 0 };
mir_tstrcat(g_filter, s);
}
}
@@ -444,7 +444,7 @@ int ShowMenu(bool centered)
HMENU hMenu = CreatePopupMenu();
SIZE szMenu = { 0 };
SIZE szColumn = { 0 };
- TCHAR *prevGroup = NULL;
+ wchar_t *prevGroup = NULL;
int idItem = 100;
MCONTACT hContact;
diff --git a/plugins/FavContacts/src/services.cpp b/plugins/FavContacts/src/services.cpp
index 7a2658b6bc..556e0ebbaa 100644
--- a/plugins/FavContacts/src/services.cpp
+++ b/plugins/FavContacts/src/services.cpp
@@ -128,27 +128,27 @@ int ProcessReloadFonts(WPARAM, LPARAM)
LOGFONT lf = { 0 };
FontIDT fontid = { sizeof(fontid) };
- mir_tstrcpy(fontid.group, LPGENT("Favorite Contacts"));
- mir_tstrcpy(fontid.name, LPGENT("Contact name"));
+ mir_tstrcpy(fontid.group, LPGENW("Favorite Contacts"));
+ mir_tstrcpy(fontid.name, LPGENW("Contact name"));
g_Options.clLine1 = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
g_Options.hfntName = CreateFontIndirect(&lf);
- mir_tstrcpy(fontid.name, LPGENT("Second line"));
+ mir_tstrcpy(fontid.name, LPGENW("Second line"));
g_Options.clLine2 = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
g_Options.hfntSecond = CreateFontIndirect(&lf);
- mir_tstrcpy(fontid.name, LPGENT("Selected contact name (color)"));
+ mir_tstrcpy(fontid.name, LPGENW("Selected contact name (color)"));
g_Options.clLine1Sel = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
- mir_tstrcpy(fontid.name, LPGENT("Selected second line (color)"));
+ mir_tstrcpy(fontid.name, LPGENW("Selected second line (color)"));
g_Options.clLine2Sel = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lf);
ColourIDT colourid = { sizeof(colourid) };
- mir_tstrcpy(colourid.group, LPGENT("Favorite Contacts"));
- mir_tstrcpy(colourid.name, LPGENT("Background"));
+ mir_tstrcpy(colourid.group, LPGENW("Favorite Contacts"));
+ mir_tstrcpy(colourid.name, LPGENW("Background"));
g_Options.clBack = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, (LPARAM)&lf);
- mir_tstrcpy(colourid.name, LPGENT("Selected background"));
+ mir_tstrcpy(colourid.name, LPGENW("Selected background"));
g_Options.clBackSel = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, (LPARAM)&lf);
return 0;
@@ -171,38 +171,38 @@ int ProcessModulesLoaded(WPARAM, LPARAM)
/////////////////////////////////////////////////////////////////////////////////////
FontIDT fontid = { sizeof(fontid) };
- mir_tstrcpy(fontid.group, LPGENT("Favorite Contacts"));
+ mir_tstrcpy(fontid.group, LPGENW("Favorite Contacts"));
mir_strcpy(fontid.dbSettingsGroup, "FavContacts");
- mir_tstrcpy(fontid.backgroundGroup, LPGENT("Favorite Contacts"));
+ mir_tstrcpy(fontid.backgroundGroup, LPGENW("Favorite Contacts"));
fontid.flags = FIDF_DEFAULTVALID;
fontid.deffontsettings.charset = DEFAULT_CHARSET;
fontid.deffontsettings.size = -11;
mir_tstrcpy(fontid.deffontsettings.szFace, L"MS Shell Dlg");
fontid.deffontsettings.style = 0;
- mir_tstrcpy(fontid.backgroundName, LPGENT("Background"));
+ mir_tstrcpy(fontid.backgroundName, LPGENW("Background"));
- mir_tstrcpy(fontid.name, LPGENT("Contact name"));
+ mir_tstrcpy(fontid.name, LPGENW("Contact name"));
mir_strcpy(fontid.prefix, "fntName");
fontid.deffontsettings.colour = GetSysColor(COLOR_MENUTEXT);
fontid.deffontsettings.style = DBFONTF_BOLD;
FontRegisterT(&fontid);
- mir_tstrcpy(fontid.name, LPGENT("Second line"));
+ mir_tstrcpy(fontid.name, LPGENW("Second line"));
mir_strcpy(fontid.prefix, "fntSecond");
fontid.deffontsettings.colour = sttShadeColor(GetSysColor(COLOR_MENUTEXT), GetSysColor(COLOR_MENU));
fontid.deffontsettings.style = 0;
FontRegisterT(&fontid);
- mir_tstrcpy(fontid.backgroundName, LPGENT("Selected background"));
+ mir_tstrcpy(fontid.backgroundName, LPGENW("Selected background"));
- mir_tstrcpy(fontid.name, LPGENT("Selected contact name (color)"));
+ mir_tstrcpy(fontid.name, LPGENW("Selected contact name (color)"));
mir_strcpy(fontid.prefix, "fntNameSel");
fontid.deffontsettings.colour = GetSysColor(COLOR_HIGHLIGHTTEXT);
fontid.deffontsettings.style = DBFONTF_BOLD;
FontRegisterT(&fontid);
- mir_tstrcpy(fontid.name, LPGENT("Selected second line (color)"));
+ mir_tstrcpy(fontid.name, LPGENW("Selected second line (color)"));
mir_strcpy(fontid.prefix, "fntSecondSel");
fontid.deffontsettings.colour = sttShadeColor(GetSysColor(COLOR_HIGHLIGHTTEXT), GetSysColor(COLOR_HIGHLIGHT));
fontid.deffontsettings.style = 0;
@@ -211,15 +211,15 @@ int ProcessModulesLoaded(WPARAM, LPARAM)
/////////////////////////////////////////////////////////////////////////////////////
ColourIDT colourid = { sizeof(colourid) };
- mir_tstrcpy(colourid.group, LPGENT("Favorite Contacts"));
+ mir_tstrcpy(colourid.group, LPGENW("Favorite Contacts"));
mir_strcpy(colourid.dbSettingsGroup, "FavContacts");
- mir_tstrcpy(colourid.name, LPGENT("Background"));
+ mir_tstrcpy(colourid.name, LPGENW("Background"));
mir_strcpy(colourid.setting, "BackColour");
colourid.defcolour = GetSysColor(COLOR_MENU);
ColourRegisterT(&colourid);
- mir_tstrcpy(colourid.name, LPGENT("Selected background"));
+ mir_tstrcpy(colourid.name, LPGENW("Selected background"));
mir_strcpy(colourid.setting, "SelectedColour");
colourid.defcolour = GetSysColor(COLOR_HIGHLIGHT);
ColourRegisterT(&colourid);
diff --git a/plugins/FileAsMessage/src/main.cpp b/plugins/FileAsMessage/src/main.cpp
index 3345635863..db57964ac1 100644
--- a/plugins/FileAsMessage/src/main.cpp
+++ b/plugins/FileAsMessage/src/main.cpp
@@ -149,8 +149,8 @@ int OnOptInitialise(WPARAM wParam, LPARAM lParam)
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.ptszTitle = _T(SERVICE_TITLE);
- odp.ptszGroup = LPGENT("Events");
+ odp.pszTitle = SERVICE_TITLE;
+ odp.pwszGroup = LPGENW("Events");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pfnDlgProc = OptionsDlgProc;
Options_AddPage(wParam, &odp);
diff --git a/plugins/FingerprintNG/src/finger_groups.h b/plugins/FingerprintNG/src/finger_groups.h
index 89314cd237..965a1938f1 100644
--- a/plugins/FingerprintNG/src/finger_groups.h
+++ b/plugins/FingerprintNG/src/finger_groups.h
@@ -1,127 +1,127 @@
case MIRANDA_CASE:
if (db_get_b(NULL, MODULENAME, "GroupMiranda", 1))
- return LPGENT("Client icons") L"/" LPGENT("Miranda clients");
+ return LPGENW("Client icons") L"/" LPGENW("Miranda clients");
break;
case MIRANDA_VERSION_CASE:
if (db_get_b(NULL, MODULENAME, "GroupMirandaVersion", 1))
- return LPGENT("Client icons") L"/" LPGENT("Miranda clients");
+ return LPGENW("Client icons") L"/" LPGENW("Miranda clients");
break;
case MIRANDA_PACKS_CASE:
if (db_get_b(NULL, MODULENAME, "GroupMirandaPacks", 1))
- return LPGENT("Client icons") L"/" LPGENT("Miranda clients") L"/" LPGENT("Pack overlays");
+ return LPGENW("Client icons") L"/" LPGENW("Miranda clients") L"/" LPGENW("Pack overlays");
break;
case MULTI_CASE:
if (db_get_b(NULL, MODULENAME, "GroupMulti", 1))
- return LPGENT("Client icons") L"/" LPGENT("Multi-proto clients");
+ return LPGENW("Client icons") L"/" LPGENW("Multi-proto clients");
break;
case AIM_CASE:
if (db_get_b(NULL, MODULENAME, "GroupAIM", 1))
- return LPGENT("Client icons") L"/" LPGENT("AIM clients");
+ return LPGENW("Client icons") L"/" LPGENW("AIM clients");
break;
case GG_CASE:
if (db_get_b(NULL, MODULENAME, "GroupGG", 1))
- return LPGENT("Client icons") L"/" LPGENT("Gadu-Gadu clients");
+ return LPGENW("Client icons") L"/" LPGENW("Gadu-Gadu clients");
break;
case ICQ_CASE:
if (db_get_b(NULL, MODULENAME, "GroupICQ", 1))
- return LPGENT("Client icons") L"/" LPGENT("ICQ clients");
+ return LPGENW("Client icons") L"/" LPGENW("ICQ clients");
break;
case IRC_CASE:
if (db_get_b(NULL, MODULENAME, "GroupIRC", 1))
- return LPGENT("Client icons") L"/" LPGENT("IRC clients");
+ return LPGENW("Client icons") L"/" LPGENW("IRC clients");
break;
case JABBER_CASE:
if (db_get_b(NULL, MODULENAME, "GroupJabber", 1))
- return LPGENT("Client icons") L"/" LPGENT("Jabber clients");
+ return LPGENW("Client icons") L"/" LPGENW("Jabber clients");
break;
case MRA_CASE:
if (db_get_b(NULL, MODULENAME, "GroupMRA", 1))
- return LPGENT("Client icons") L"/" LPGENT("MRA clients");
+ return LPGENW("Client icons") L"/" LPGENW("MRA clients");
break;
case MSN_CASE:
if (db_get_b(NULL, MODULENAME, "GroupMSN", 1))
- return LPGENT("Client icons") L"/" LPGENT("MSN clients");
+ return LPGENW("Client icons") L"/" LPGENW("MSN clients");
break;
case QQ_CASE:
if (db_get_b(NULL, MODULENAME, "GroupQQ", 1))
- return LPGENT("Client icons") L"/" LPGENT("QQ clients");
+ return LPGENW("Client icons") L"/" LPGENW("QQ clients");
break;
case RSS_CASE:
if (db_get_b(NULL, MODULENAME, "GroupRSS", 1))
- return LPGENT("Client icons") L"/" LPGENT("RSS clients");
+ return LPGENW("Client icons") L"/" LPGENW("RSS clients");
break;
case TLEN_CASE:
if (db_get_b(NULL, MODULENAME, "GroupTlen", 1))
- return LPGENT("Client icons") L"/" LPGENT("Tlen clients");
+ return LPGENW("Client icons") L"/" LPGENW("Tlen clients");
break;
case WEATHER_CASE:
if (db_get_b(NULL, MODULENAME, "GroupWeather", 1))
- return LPGENT("Client icons") L"/" LPGENT("Weather clients");
+ return LPGENW("Client icons") L"/" LPGENW("Weather clients");
break;
case YAHOO_CASE:
if (db_get_b(NULL, MODULENAME, "GroupYahoo", 1))
- return LPGENT("Client icons") L"/" LPGENT("Yahoo clients");
+ return LPGENW("Client icons") L"/" LPGENW("Yahoo clients");
break;
case FACEBOOK_CASE:
if (db_get_b(NULL, MODULENAME, "GroupFacebook", 1))
- return LPGENT("Client icons") L"/" LPGENT("Facebook clients");
+ return LPGENW("Client icons") L"/" LPGENW("Facebook clients");
break;
case VK_CASE:
if (db_get_b(NULL, MODULENAME, "GroupVK", 1))
- return LPGENT("Client icons") L"/" LPGENT("VKontakte clients");
+ return LPGENW("Client icons") L"/" LPGENW("VKontakte clients");
break;
case OTHER_PROTOS_CASE:
if (db_get_b(NULL, MODULENAME, "GroupOtherProtos", 1))
- return LPGENT("Client icons") L"/" LPGENT("Other protocols");
+ return LPGENW("Client icons") L"/" LPGENW("Other protocols");
break;
case OTHERS_CASE:
if (db_get_b(NULL, MODULENAME, "GroupOthers", 1))
- return LPGENT("Client icons") L"/" LPGENT("Other icons");
+ return LPGENW("Client icons") L"/" LPGENW("Other icons");
break;
case OVERLAYS_RESOURCE_CASE:
if (db_get_b(NULL, MODULENAME, "GroupOverlaysResource", 1))
- return LPGENT("Client icons") L"/" LPGENT("Overlays") L"/" LPGENT("Resource");
+ return LPGENW("Client icons") L"/" LPGENW("Overlays") L"/" LPGENW("Resource");
break;
case OVERLAYS_PLATFORM_CASE:
if (db_get_b(NULL, MODULENAME, "GroupOverlaysPlatform", 1))
- return LPGENT("Client icons") L"/" LPGENT("Overlays") L"/" LPGENT("Platform");
+ return LPGENW("Client icons") L"/" LPGENW("Overlays") L"/" LPGENW("Platform");
break;
case OVERLAYS_UNICODE_CASE:
if (db_get_b(NULL, MODULENAME, "GroupOverlaysUnicode", 1))
- return LPGENT("Client icons") L"/" LPGENT("Overlays") L"/" LPGENT("Platform");
+ return LPGENW("Client icons") L"/" LPGENW("Overlays") L"/" LPGENW("Platform");
break;
case OVERLAYS_SECURITY_CASE:
if (db_get_b(NULL, MODULENAME, "GroupOverlaysSecurity", 1))
- return LPGENT("Client icons") L"/" LPGENT("Overlays") L"/" LPGENT("Security");
+ return LPGENW("Client icons") L"/" LPGENW("Overlays") L"/" LPGENW("Security");
break;
case OVERLAYS_PROTO_CASE:
if (db_get_b(NULL, MODULENAME, "GroupOverlaysProtos", 1))
- return LPGENT("Client icons") L"/" LPGENT("Overlays") L"/" LPGENT("Protocol");
+ return LPGENW("Client icons") L"/" LPGENW("Overlays") L"/" LPGENW("Protocol");
break;
default:
- return LPGENT("Client icons");
+ return LPGENW("Client icons");
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp
index a5f3394462..4ca28bdac2 100644
--- a/plugins/FingerprintNG/src/fingerprint.cpp
+++ b/plugins/FingerprintNG/src/fingerprint.cpp
@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
static UINT g_LPCodePage;
-static TCHAR g_szSkinLib[MAX_PATH];
+static wchar_t g_szSkinLib[MAX_PATH];
static HANDLE hExtraIcon = NULL;
static HANDLE hFolderChanged = NULL, hIconFolder = NULL;
@@ -37,7 +37,7 @@ static INT_PTR ServiceGetClientIconW(WPARAM wParam, LPARAM lParam);
* prepares upperstring masks and registers them in IcoLib
*/
-static TCHAR* getSectionName(int flag)
+static wchar_t* getSectionName(int flag)
{
switch (flag)
{
@@ -58,19 +58,19 @@ void __fastcall Prepare(KN_FP_MASK* mask, bool bEnable)
return;
size_t iMaskLen = mir_tstrlen(mask->szMask) + 1;
- LPTSTR pszNewMask = (LPTSTR)HeapAlloc(hHeap, HEAP_NO_SERIALIZE, iMaskLen * sizeof(TCHAR));
- _tcscpy_s(pszNewMask, iMaskLen, mask->szMask);
- _tcsupr_s(pszNewMask, iMaskLen);
+ LPTSTR pszNewMask = (LPTSTR)HeapAlloc(hHeap, HEAP_NO_SERIALIZE, iMaskLen * sizeof(wchar_t));
+ wcscpy_s(pszNewMask, iMaskLen, mask->szMask);
+ _wcsupr_s(pszNewMask, iMaskLen);
mask->szMaskUpper = pszNewMask;
- TCHAR destfile[MAX_PATH];
+ wchar_t destfile[MAX_PATH];
if (mask->iIconIndex == IDI_NOTFOUND || mask->iIconIndex == IDI_UNKNOWN || mask->iIconIndex == IDI_UNDETECTED)
GetModuleFileName(g_hInst, destfile, MAX_PATH);
else {
- _tcsncpy_s(destfile, g_szSkinLib, _TRUNCATE);
+ wcsncpy_s(destfile, g_szSkinLib, _TRUNCATE);
struct _stat64i32 stFileInfo;
- if (_tstat(destfile, &stFileInfo) == -1)
+ if (_wstat(destfile, &stFileInfo) == -1)
return;
}
@@ -80,10 +80,10 @@ void __fastcall Prepare(KN_FP_MASK* mask, bool bEnable)
SKINICONDESC sid = { 0 };
sid.flags = SIDF_ALL_TCHAR;
- sid.section.t = SectName;
+ sid.section.w = SectName;
sid.pszName = mask->szIconName;
- sid.description.t = mask->szClientDescription;
- sid.defaultFile.t = destfile;
+ sid.description.w = mask->szClientDescription;
+ sid.defaultFile.w = destfile;
sid.iDefaultIndex = -mask->iIconIndex;
mask->hIcolibItem = IcoLib_AddIcon(&sid);
}
@@ -237,7 +237,7 @@ BOOL __fastcall WildCompareW(LPWSTR wszName, LPWSTR wszMask)
return FALSE;
}
-static void MatchMasks(TCHAR* szMirVer, short *base, short *overlay, short *overlay2, short *overlay3, short *overlay4)
+static void MatchMasks(wchar_t* szMirVer, short *base, short *overlay, short *overlay2, short *overlay3, short *overlay4)
{
int i = 0, j = -1, k = -1, n = -1, m = -1;
@@ -250,11 +250,11 @@ static void MatchMasks(TCHAR* szMirVer, short *base, short *overlay, short *over
continue;
if (p.iIconIndex != IDI_NOTFOUND && p.iIconIndex != IDI_UNKNOWN && p.iIconIndex != IDI_UNDETECTED) {
- TCHAR destfile[MAX_PATH];
- _tcsncpy_s(destfile, g_szSkinLib, _TRUNCATE);
+ wchar_t destfile[MAX_PATH];
+ wcsncpy_s(destfile, g_szSkinLib, _TRUNCATE);
struct _stat64i32 stFileInfo;
- if (_tstat(destfile, &stFileInfo) == -1)
+ if (_wstat(destfile, &stFileInfo) == -1)
i = NOTFOUND_MASK_NUMBER;
}
break;
@@ -272,7 +272,7 @@ static void MatchMasks(TCHAR* szMirVer, short *base, short *overlay, short *over
continue;
struct _stat64i32 stFileInfo;
- if (_tstat(g_szSkinLib, &stFileInfo) != -1)
+ if (_wstat(g_szSkinLib, &stFileInfo) != -1)
break;
}
@@ -327,7 +327,7 @@ void __fastcall GetIconsIndexesA(LPSTR szMirVer, short *base, short *overlay, sh
}
LPTSTR tszMirVerUp = mir_a2t(szMirVer);
- _tcsupr(tszMirVerUp);
+ wcsupr(tszMirVerUp);
MatchMasks(tszMirVerUp, base, overlay, overlay2, overlay3, overlay4);
mir_free(tszMirVerUp);
}
diff --git a/plugins/FingerprintNG/src/masks.cpp b/plugins/FingerprintNG/src/masks.cpp
index a7e8f7ad37..fe07ab9854 100644
--- a/plugins/FingerprintNG/src/masks.cpp
+++ b/plugins/FingerprintNG/src/masks.cpp
@@ -46,17 +46,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* In order to get "Unknown" client, last mask should be "?*".
*/
-#define NIGHTLY_CORE_VERSION L"|*Miranda*NG*" _T(MIRANDA_VERSION_CORE_STRING) L"*"
-
KN_FP_MASK def_kn_fp_mask[] =
{// {"Client_IconName", L"|^*Mask*|*names*", L"Icon caption", IDI_RESOURCE_ID, CLIENT_CASE, OVERLAY? },
//#########################################################################################################################################################################
//################################# MIRANDA ###########################################################################################################################
//#########################################################################################################################################################################
- { "client_Miranda_NG", L"|*nightly.miranda.im*" NIGHTLY_CORE_VERSION, L"Miranda NG", IDI_MIRANDA_NG, MIRANDA_CASE },
+ { "client_Miranda_NG", L"|*nightly.miranda.im*" L"|*Miranda*NG*" _A2W(MIRANDA_VERSION_CORE_STRING) L"*", L"Miranda NG", IDI_MIRANDA_NG, MIRANDA_CASE },
- { "client_Miranda_NG_stbl", L"|Miranda*NG*", LPGENT("Miranda NG stable"), IDI_MIRANDA_NG_STABLE, MIRANDA_CASE },
+ { "client_Miranda_NG_stbl", L"|Miranda*NG*", LPGENW("Miranda NG stable"), IDI_MIRANDA_NG_STABLE, MIRANDA_CASE },
{ "client_Miranda_010xx", L"Miranda*IM*0.10.*", L"Miranda IM v0.10.x.x", IDI_MIRANDA_010X, MIRANDA_CASE },
{ "client_Miranda_09XX", L"|*Miranda*IM*0.9*"
@@ -70,9 +68,9 @@ KN_FP_MASK def_kn_fp_mask[] =
{ "client_Miranda_05XX", L"*Miranda*0.5*", L"Miranda IM v0.5.x.x", IDI_MIRANDA_05XX, MIRANDA_CASE },
{ "client_Miranda_04XX", L"*Miranda*0.4*", L"Miranda IM v0.4.x.x", IDI_MIRANDA_04XX, MIRANDA_CASE },
- { "client_Miranda_old", L"*Miranda*0.?*", LPGENT("Miranda IM (old versions)"), IDI_MIRANDA_OLD, MIRANDA_CASE },
+ { "client_Miranda_old", L"*Miranda*0.?*", LPGENW("Miranda IM (old versions)"), IDI_MIRANDA_OLD, MIRANDA_CASE },
- { "client_Miranda_unknown", L"*Miranda*", LPGENT("Miranda (unknown)"), IDI_MIRANDA_UNKNOWN, MIRANDA_CASE },
+ { "client_Miranda_unknown", L"*Miranda*", LPGENW("Miranda (unknown)"), IDI_MIRANDA_UNKNOWN, MIRANDA_CASE },
//#########################################################################################################################################################################
//################################# MULTI-PROTOCOL ####################################################################################################################
@@ -205,7 +203,7 @@ KN_FP_MASK def_kn_fp_mask[] =
{ "client_SmartICQ", L"Smart*ICQ*", L"SmartICQ", IDI_SMARTICQ, ICQ_CASE, TRUE },
{ "client_StrICQ", L"StrICQ*", L"StrICQ", IDI_STRICQ, ICQ_CASE, TRUE },
- { "client_spam", L"*spam*", LPGENT("spam client"), IDI_SPAM, ICQ_CASE, TRUE },
+ { "client_spam", L"*spam*", LPGENW("spam client"), IDI_SPAM, ICQ_CASE, TRUE },
{ "client_libicq2k", L"libicq*", L"LibICQ/JIT", IDI_LIBICQ2000, ICQ_CASE, TRUE },
{ "client_TICQClient", L"*TICQ*Client*", L"TICQClient (Delphi lib)", IDI_TICQ, ICQ_CASE, TRUE },
@@ -405,7 +403,7 @@ KN_FP_MASK def_kn_fp_mask[] =
{ "client_mobber", L"*mobber*", L"mobber", IDI_MOBBER, JABBER_CASE, TRUE },
{ "client_myJabber", L"*myJabber*", L"myJabber", IDI_MYJABBER, JABBER_CASE, TRUE },
{ "client_orkut", L"*orkut*", L"orkut", IDI_ORKUT, JABBER_CASE, TRUE },
- { "client_pjc", L"|*PJC*|*pjc.googlecode.com*", LPGENT("PHP Jabber Client"), IDI_PJC, JABBER_CASE, TRUE },
+ { "client_pjc", L"|*PJC*|*pjc.googlecode.com*", LPGENW("PHP Jabber Client"), IDI_PJC, JABBER_CASE, TRUE },
{ "client_saje", L"*saje*", L"saje", IDI_SAJE, JABBER_CASE, TRUE },
{ "client_schuelervz", L"*schuelervz*", L"SchulerVZ", IDI_SCHULERVZ, JABBER_CASE, TRUE },
{ "client_studivz", L"*studivz*", L"StudiVZ", IDI_STUDIVZ, JABBER_CASE, TRUE },
@@ -439,7 +437,7 @@ KN_FP_MASK def_kn_fp_mask[] =
{ "client_KVIrc", L"*KVIrc*", L"KVIrc", IDI_KVIRC, IRC_CASE, TRUE },
{ "client_Klient", L"*Klient*", L"Klient", IDI_KLIENT, IRC_CASE, TRUE },
{ "client_Konversation", L"*Konversation*", L"Konversation", IDI_KONVERSATION, IRC_CASE, TRUE },
- { "client_MP3Script", L"*MP3*Script*", LPGENT("MP3 Script for mIRC"), IDI_MP3_SCRIPT, IRC_CASE, TRUE },
+ { "client_MP3Script", L"*MP3*Script*", LPGENW("MP3 Script for mIRC"), IDI_MP3_SCRIPT, IRC_CASE, TRUE },
{ "client_NeoRaTrion", L"*NeoRa*Trion*", L"NeoRa Trion", IDI_NEORATRION, IRC_CASE, TRUE },
{ "client_Nettalk", L"*Nettalk*", L"Nettalk", IDI_NETTALK, IRC_CASE, TRUE },
{ "client_NoNameScript", L"*NoName*Script*", L"NoNameScript", IDI_NONAME_SCRIPT, IRC_CASE, TRUE },
@@ -522,10 +520,10 @@ KN_FP_MASK def_kn_fp_mask[] =
//#########################################################################################################################################################################
{ "client_MRA_official", L"|magent*|Mail.ru Agent*official*"
L"|Mail.ru Agent*PC*"
- L"|*agent.mail.ru*", LPGENT("Mail.Ru Agent (official)"), IDI_MAIL_RU_OFFICIAL, MRA_CASE, TRUE },
+ L"|*agent.mail.ru*", LPGENW("Mail.Ru Agent (official)"), IDI_MAIL_RU_OFFICIAL, MRA_CASE, TRUE },
{ "client_MRA_Mobile", L"|MobileAgent*|Mail.ru Agent*Symbian*", L"Mail.Ru Mobile Agent", IDI_MAIL_RU_MOBILE, MRA_CASE, TRUE },
{ "client_MRA_web", L"|webagent*|*Web Agent*", L"Mail.Ru Web Agent", IDI_MAIL_RU_WEBAGENT, MRA_CASE, TRUE },
- { "client_MRA_unknown", L"|Mail.ru Agent*|MRA client", LPGENT("Mail.Ru (unknown client)"), IDI_MAIL_RU_UNKNOWN, MRA_CASE },
+ { "client_MRA_unknown", L"|Mail.ru Agent*|MRA client", LPGENW("Mail.Ru (unknown client)"), IDI_MAIL_RU_UNKNOWN, MRA_CASE },
//#########################################################################################################################################################################
//################################# YAHOO #############################################################################################################################
@@ -569,7 +567,7 @@ KN_FP_MASK def_kn_fp_mask[] =
{ "client_QQConcept", L"QQ*Concept*", L"QQ Concept", IDI_QQCONCEPT, QQ_CASE, TRUE },
{ "client_QQCRM", L"QQ*CRM*", L"QQ CRM", IDI_QQCRM, QQ_CASE, TRUE },
{ "client_QQSilver", L"QQ*Silverlight*", L"QQ Silverlight", IDI_QQSILVER, QQ_CASE, TRUE },
- { "client_TM2008", L"|TM2008*|TM2009*|TM2010*", LPGENT("TM 2008 and >"), IDI_TM2008, QQ_CASE },
+ { "client_TM2008", L"|TM2008*|TM2009*|TM2010*", LPGENW("TM 2008 and >"), IDI_TM2008, QQ_CASE },
{ "client_TM", L"TM*", L"TM", IDI_TM, QQ_CASE },
{ "client_QQInt", L"QQ*International*", L"QQ International", IDI_QQINT, QQ_CASE },
{ "client_YamQQ", L"YamQQ*", L"Yam QQ", IDI_YAMQQ, QQ_CASE },
@@ -579,12 +577,12 @@ KN_FP_MASK def_kn_fp_mask[] =
//#########################################################################################################################################################################
//################################# GADU-GADU #########################################################################################################################
//#########################################################################################################################################################################
- { "client_GG", L"|Gadu-Gadu*|GG*", LPGENT("Gadu-Gadu client"), IDI_GG, GG_CASE },
+ { "client_GG", L"|Gadu-Gadu*|GG*", LPGENW("Gadu-Gadu client"), IDI_GG, GG_CASE },
//#########################################################################################################################################################################
//################################# TLEN ##############################################################################################################################
//#########################################################################################################################################################################
- { "client_Tlen", L"*Tlen*", LPGENT("Tlen.pl client"), IDI_TLEN, TLEN_CASE },
+ { "client_Tlen", L"*Tlen*", LPGENW("Tlen.pl client"), IDI_TLEN, TLEN_CASE },
//#########################################################################################################################################################################
//################################# Facebook ##########################################################################################################################
@@ -607,11 +605,11 @@ KN_FP_MASK def_kn_fp_mask[] =
{ "client_Pidgin", L"|*Pidgin*|*libpurple*|Purple*", L"Pidgin (libpurple)", IDI_PIDGIN, MULTI_CASE },
- { "client_Python", L"|*Python*|Py*|*ταλιςμαη*", LPGENT("Python-based clients"), IDI_PYTHON, MULTI_CASE },
+ { "client_Python", L"|*Python*|Py*|*ταλιςμαη*", LPGENW("Python-based clients"), IDI_PYTHON, MULTI_CASE },
- { "client_Jabber", L"*Jabber*client*", LPGENT("Jabber client"), IDI_JABBER, JABBER_CASE, TRUE },
+ { "client_Jabber", L"*Jabber*client*", LPGENW("Jabber client"), IDI_JABBER, JABBER_CASE, TRUE },
- { "client_XMPP", L"|*XMPP*|Mrim*|*DRQZ00fz5WPn1gH+*", LPGENT("XMPP client"), IDI_XMPP, JABBER_CASE },
+ { "client_XMPP", L"|*XMPP*|Mrim*|*DRQZ00fz5WPn1gH+*", LPGENW("XMPP client"), IDI_XMPP, JABBER_CASE },
{ "client_Hangouts", L"messaging-*", L"Google+ Hangouts", IDI_HANGOUTS, OTHER_PROTOS_CASE, TRUE },
@@ -627,9 +625,9 @@ KN_FP_MASK def_kn_fp_mask[] =
//################################# UNDEFINED CLIENTS #################################################################################################################
//#########################################################################################################################################################################
- { "client_Notfound", L"Notfound", LPGENT("Client not found"), IDI_NOTFOUND, OTHERS_CASE, TRUE },
- { "client_Unknown", L"|*Unknown*|...", LPGENT("Unknown client"), IDI_UNKNOWN, OTHERS_CASE, TRUE },
- { "client_Undetected", L"?*", LPGENT("Undetected client"), IDI_UNDETECTED, OTHERS_CASE, TRUE },
+ { "client_Notfound", L"Notfound", LPGENW("Client not found"), IDI_NOTFOUND, OTHERS_CASE, TRUE },
+ { "client_Unknown", L"|*Unknown*|...", LPGENW("Unknown client"), IDI_UNKNOWN, OTHERS_CASE, TRUE },
+ { "client_Undetected", L"?*", LPGENW("Undetected client"), IDI_UNDETECTED, OTHERS_CASE, TRUE },
};
@@ -688,76 +686,76 @@ KN_FP_MASK def_kn_fp_overlays_mask[] =
//#########################################################################################################################################################################
//################################# PROTO OVERLAYS ####################################################################################################################
//#########################################################################################################################################################################
- { "client_AIM_overlay", L"|^AIM*|*AIM*", LPGENT("AIM overlay"), IDI_AIM_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_ICQJ_Plus_over", L"*ICQ*Plus*", LPGENT("ICQJ Plus Mod overlay"), IDI_ICQJ_PLUS_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_ICQJ_overlay", L"|^ICQ|^ICQ*|*ICQ*|MRA client", LPGENT("ICQJ overlay"), IDI_ICQJ_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_IRC_overlay", L"|^IRC*|Miranda*IRC*", LPGENT("IRC overlay"), IDI_IRC_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_JGmail_overlay", L"*JGmail*", LPGENT("JGmail overlay"), IDI_GMAIL_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_JGTalk_overlay", L"*JGTalk*", LPGENT("JGTalk overlay"), IDI_JGTALK_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_Jabber_overlay", L"|^jabber*|Miranda*Jabber*|py*jabb*", LPGENT("Jabber overlay"), IDI_JABBER_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_MSN_overlay", L"|^MSN*|*Miranda*MSN*", LPGENT("MSN overlay"), IDI_MSN_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_QQ_overlay", L"|Miranda*QQ*|MIM*QQ*", LPGENT("QQ overlay"), IDI_QQ_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_Tlen_overlay", L"|^tlen*|*tlen*", LPGENT("Tlen.pl overlay"), IDI_TLEN_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_Yahoo_overlay", L"|^Yahoo*|*yahoo*", LPGENT("Yahoo overlay"), IDI_YAHOO_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_AIM_overlay", L"|^AIM*|*AIM*", LPGENW("AIM overlay"), IDI_AIM_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_ICQJ_Plus_over", L"*ICQ*Plus*", LPGENW("ICQJ Plus Mod overlay"), IDI_ICQJ_PLUS_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_ICQJ_overlay", L"|^ICQ|^ICQ*|*ICQ*|MRA client", LPGENW("ICQJ overlay"), IDI_ICQJ_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_IRC_overlay", L"|^IRC*|Miranda*IRC*", LPGENW("IRC overlay"), IDI_IRC_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_JGmail_overlay", L"*JGmail*", LPGENW("JGmail overlay"), IDI_GMAIL_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_JGTalk_overlay", L"*JGTalk*", LPGENW("JGTalk overlay"), IDI_JGTALK_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_Jabber_overlay", L"|^jabber*|Miranda*Jabber*|py*jabb*", LPGENW("Jabber overlay"), IDI_JABBER_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_MSN_overlay", L"|^MSN*|*Miranda*MSN*", LPGENW("MSN overlay"), IDI_MSN_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_QQ_overlay", L"|Miranda*QQ*|MIM*QQ*", LPGENW("QQ overlay"), IDI_QQ_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_Tlen_overlay", L"|^tlen*|*tlen*", LPGENW("Tlen.pl overlay"), IDI_TLEN_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_Yahoo_overlay", L"|^Yahoo*|*yahoo*", LPGENW("Yahoo overlay"), IDI_YAHOO_OVERLAY, OVERLAYS_PROTO_CASE },
{ "client_MRA_overlay", L"|^MRA*|^Mail.ru*"
L"|*MRA*|*Mail.ru*IM*|Mrim*"
- L"|*DRQZ00fz5WPn1gH+*|*nxthUwJANorB6+*|ICQ client", LPGENT("Mail.Ru Agent overlay"), IDI_MAILRU_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_VK_overlay", L"|Miranda*VKontakte*", LPGENT("VK overlay"), IDI_VK_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_Skype_overlay", L"|Miranda*Skype*", LPGENT("Skype overlay"), IDI_SKYPE_OVERLAY, OVERLAYS_PROTO_CASE },
+ L"|*DRQZ00fz5WPn1gH+*|*nxthUwJANorB6+*|ICQ client", LPGENW("Mail.Ru Agent overlay"), IDI_MAILRU_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_VK_overlay", L"|Miranda*VKontakte*", LPGENW("VK overlay"), IDI_VK_OVERLAY, OVERLAYS_PROTO_CASE },
+ { "client_Skype_overlay", L"|Miranda*Skype*", LPGENW("Skype overlay"), IDI_SKYPE_OVERLAY, OVERLAYS_PROTO_CASE },
//#########################################################################################################################################################################
//################################# CLIENT VERSION OVERLAYS ###########################################################################################################
//#########################################################################################################################################################################
- { "client_ICQ3_over", L"ICQ*2003*", LPGENT("ICQ 2003 overlay"), IDI_ICQ3_OVERLAY, ICQ_CASE },
- { "client_ICQ4_over", L"|ICQ*4*|ICQ*lite*4*", LPGENT("ICQ Lite 4 overlay"), IDI_ICQ4_OVERLAY, ICQ_CASE },
- { "client_ICQ5_over", L"|ICQ*5*|ICQ*lite*5*|icq5*", LPGENT("ICQ v5.x overlay"), IDI_ICQ5_OVERLAY, ICQ_CASE },
- { "client_ICQ6_over", L"ICQ*6*", LPGENT("ICQ v6.x overlay"), IDI_ICQ6_OVERLAY, ICQ_CASE },
- { "client_ICQ7_over", L"ICQ*7*", LPGENT("ICQ v7.x overlay"), IDI_ICQ7_OVERLAY, ICQ_CASE },
- { "client_ICQ8_over", L"ICQ*8*", LPGENT("ICQ v8.x overlay"), IDI_ICQ8_OVERLAY, ICQ_CASE },
-
- { "client_Yahoo_11", L"*Yahoo 11*", LPGENT("Yahoo v11.x overlay"), IDI_YAHOO11_OVERLAY, YAHOO_CASE },
- { "client_Yahoo_10", L"*Yahoo 10*", LPGENT("Yahoo v10.x overlay"), IDI_YAHOO10_OVERLAY, YAHOO_CASE },
- { "client_Yahoo_9", L"*Yahoo 9*", LPGENT("Yahoo v9.x overlay"), IDI_YAHOO9_OVERLAY, YAHOO_CASE },
-
- { "client_GG_11", L"|Gadu-Gadu*11*|GG*11*", LPGENT("Gadu-Gadu v11 client"), IDI_GG11_OVERLAY, GG_CASE },
- { "client_GG_10", L"|Gadu-Gadu*10*|GG*10", LPGENT("Gadu-Gadu v10 client"), IDI_GG10_OVERLAY, GG_CASE },
- { "client_GG_9", L"|Gadu-Gadu*9*|GG*9*", LPGENT("Gadu-Gadu v9 client"), IDI_GG9_OVERLAY, GG_CASE },
- { "client_GG_8", L"|Gadu-Gadu*8*|GG*8*", LPGENT("Gadu-Gadu v8 client"), IDI_GG8_OVERLAY, GG_CASE },
-
- // {"client_Tlen_8", L"Tlen Protocol 1?", LPGENT("Tlen 8.x overlay"), IDI_TLEN8_OVERLAY, TLEN_CASE },
- { "client_Tlen_7", L"Tlen Protocol 16", LPGENT("Tlen 7.x overlay"), IDI_TLEN7_OVERLAY, TLEN_CASE },
- { "client_Tlen_6", L"Tlen Protocol 10", LPGENT("Tlen 6.x overlay"), IDI_TLEN6_OVERLAY, TLEN_CASE },
- { "client_Tlen_5", L"Tlen Protocol 7", LPGENT("Tlen 5.x overlay"), IDI_TLEN5_OVERLAY, TLEN_CASE },
-
- { "client_QQ_2012", L"|QQ2012*|TM2012*", LPGENT("TM/QQ 2012 overlay"), IDI_QQ_2012_OVERLAY, QQ_CASE },
- { "client_QQ_2011", L"|QQ2011*|TM2011*", LPGENT("TM/QQ 2011 overlay"), IDI_QQ_2011_OVERLAY, QQ_CASE },
- { "client_QQ_2010", L"|QQ2010*|TM2010*", LPGENT("TM/QQ 2010 overlay"), IDI_QQ_2010_OVERLAY, QQ_CASE },
- { "client_QQ_2009", L"|QQ2009*|TM2009*", LPGENT("TM/QQ 2009 overlay"), IDI_QQ_2009_OVERLAY, QQ_CASE },
- { "client_QQ_2008", L"|QQ2008*|TM2008*", LPGENT("TM/QQ 2008 overlay"), IDI_QQ_2008_OVERLAY, QQ_CASE },
- { "client_QQ_2007", L"|QQ2007*|TM2007*", LPGENT("TM/QQ 2007 overlay"), IDI_QQ_2007_OVERLAY, QQ_CASE },
- { "client_QQ_2006", L"|QQ2006*|TM2006*", LPGENT("TM/QQ 2006 overlay"), IDI_QQ_2006_OVERLAY, QQ_CASE },
- { "client_QQ_2005", L"|QQ2005*|TM2005*", LPGENT("TM/QQ 2005 overlay"), IDI_QQ_2005_OVERLAY, QQ_CASE },
- { "client_QQ_2004", L"QQ2004*", LPGENT("QQ 2004 overlay"), IDI_QQ_2004_OVERLAY, QQ_CASE },
- { "client_QQ_2003", L"|QQ2003*|TM 3.*", LPGENT("TM 3.x / QQ 2003 overlay"), IDI_QQ_2003_OVERLAY, QQ_CASE },
- { "client_TM_2002", L"TM 2.*", LPGENT("TM 2.x overlay"), IDI_QQ_2002_OVERLAY, QQ_CASE },
- { "client_TM_2001", L"TM 1.*", LPGENT("TM 1.x overlay"), IDI_QQ_2001_OVERLAY, QQ_CASE },
- { "client_QQ_2000", L"QQ2000*", LPGENT("QQ 2000 overlay"), IDI_QQ_2000_OVERLAY, QQ_CASE },
+ { "client_ICQ3_over", L"ICQ*2003*", LPGENW("ICQ 2003 overlay"), IDI_ICQ3_OVERLAY, ICQ_CASE },
+ { "client_ICQ4_over", L"|ICQ*4*|ICQ*lite*4*", LPGENW("ICQ Lite 4 overlay"), IDI_ICQ4_OVERLAY, ICQ_CASE },
+ { "client_ICQ5_over", L"|ICQ*5*|ICQ*lite*5*|icq5*", LPGENW("ICQ v5.x overlay"), IDI_ICQ5_OVERLAY, ICQ_CASE },
+ { "client_ICQ6_over", L"ICQ*6*", LPGENW("ICQ v6.x overlay"), IDI_ICQ6_OVERLAY, ICQ_CASE },
+ { "client_ICQ7_over", L"ICQ*7*", LPGENW("ICQ v7.x overlay"), IDI_ICQ7_OVERLAY, ICQ_CASE },
+ { "client_ICQ8_over", L"ICQ*8*", LPGENW("ICQ v8.x overlay"), IDI_ICQ8_OVERLAY, ICQ_CASE },
+
+ { "client_Yahoo_11", L"*Yahoo 11*", LPGENW("Yahoo v11.x overlay"), IDI_YAHOO11_OVERLAY, YAHOO_CASE },
+ { "client_Yahoo_10", L"*Yahoo 10*", LPGENW("Yahoo v10.x overlay"), IDI_YAHOO10_OVERLAY, YAHOO_CASE },
+ { "client_Yahoo_9", L"*Yahoo 9*", LPGENW("Yahoo v9.x overlay"), IDI_YAHOO9_OVERLAY, YAHOO_CASE },
+
+ { "client_GG_11", L"|Gadu-Gadu*11*|GG*11*", LPGENW("Gadu-Gadu v11 client"), IDI_GG11_OVERLAY, GG_CASE },
+ { "client_GG_10", L"|Gadu-Gadu*10*|GG*10", LPGENW("Gadu-Gadu v10 client"), IDI_GG10_OVERLAY, GG_CASE },
+ { "client_GG_9", L"|Gadu-Gadu*9*|GG*9*", LPGENW("Gadu-Gadu v9 client"), IDI_GG9_OVERLAY, GG_CASE },
+ { "client_GG_8", L"|Gadu-Gadu*8*|GG*8*", LPGENW("Gadu-Gadu v8 client"), IDI_GG8_OVERLAY, GG_CASE },
+
+ // {"client_Tlen_8", L"Tlen Protocol 1?", LPGENW("Tlen 8.x overlay"), IDI_TLEN8_OVERLAY, TLEN_CASE },
+ { "client_Tlen_7", L"Tlen Protocol 16", LPGENW("Tlen 7.x overlay"), IDI_TLEN7_OVERLAY, TLEN_CASE },
+ { "client_Tlen_6", L"Tlen Protocol 10", LPGENW("Tlen 6.x overlay"), IDI_TLEN6_OVERLAY, TLEN_CASE },
+ { "client_Tlen_5", L"Tlen Protocol 7", LPGENW("Tlen 5.x overlay"), IDI_TLEN5_OVERLAY, TLEN_CASE },
+
+ { "client_QQ_2012", L"|QQ2012*|TM2012*", LPGENW("TM/QQ 2012 overlay"), IDI_QQ_2012_OVERLAY, QQ_CASE },
+ { "client_QQ_2011", L"|QQ2011*|TM2011*", LPGENW("TM/QQ 2011 overlay"), IDI_QQ_2011_OVERLAY, QQ_CASE },
+ { "client_QQ_2010", L"|QQ2010*|TM2010*", LPGENW("TM/QQ 2010 overlay"), IDI_QQ_2010_OVERLAY, QQ_CASE },
+ { "client_QQ_2009", L"|QQ2009*|TM2009*", LPGENW("TM/QQ 2009 overlay"), IDI_QQ_2009_OVERLAY, QQ_CASE },
+ { "client_QQ_2008", L"|QQ2008*|TM2008*", LPGENW("TM/QQ 2008 overlay"), IDI_QQ_2008_OVERLAY, QQ_CASE },
+ { "client_QQ_2007", L"|QQ2007*|TM2007*", LPGENW("TM/QQ 2007 overlay"), IDI_QQ_2007_OVERLAY, QQ_CASE },
+ { "client_QQ_2006", L"|QQ2006*|TM2006*", LPGENW("TM/QQ 2006 overlay"), IDI_QQ_2006_OVERLAY, QQ_CASE },
+ { "client_QQ_2005", L"|QQ2005*|TM2005*", LPGENW("TM/QQ 2005 overlay"), IDI_QQ_2005_OVERLAY, QQ_CASE },
+ { "client_QQ_2004", L"QQ2004*", LPGENW("QQ 2004 overlay"), IDI_QQ_2004_OVERLAY, QQ_CASE },
+ { "client_QQ_2003", L"|QQ2003*|TM 3.*", LPGENW("TM 3.x / QQ 2003 overlay"), IDI_QQ_2003_OVERLAY, QQ_CASE },
+ { "client_TM_2002", L"TM 2.*", LPGENW("TM 2.x overlay"), IDI_QQ_2002_OVERLAY, QQ_CASE },
+ { "client_TM_2001", L"TM 1.*", LPGENW("TM 1.x overlay"), IDI_QQ_2001_OVERLAY, QQ_CASE },
+ { "client_QQ_2000", L"QQ2000*", LPGENW("QQ 2000 overlay"), IDI_QQ_2000_OVERLAY, QQ_CASE },
//#########################################################################################################################################################################
//################################# PLATFORM OVERLAYS #################################################################################################################
//#########################################################################################################################################################################
- { "client_on_Win32", L"|*Win*|* WM *|wmagent*|*Vista*", LPGENT("Windows overlay"), IDI_PLATFORM_WIN, OVERLAYS_PLATFORM_CASE },
- { "client_on_iOS", L"|*ipad*|*iphone*|*iOS*", LPGENT("iOS overlay (iPhone/iPad)"), IDI_PLATFORM_IOS, OVERLAYS_PLATFORM_CASE },
- { "client_on_Mac", L"|^*smack*|* Mac *|*mac*|*OSX*", LPGENT("MacOS overlay"), IDI_PLATFORM_MAC, OVERLAYS_PLATFORM_CASE },
- { "client_on_Linux", L"*Linux*", LPGENT("Linux overlay"), IDI_PLATFORM_LINUX, OVERLAYS_PLATFORM_CASE },
- { "client_on_Flash", L"|*Flash*|*Web*ICQ*", LPGENT("Flash overlay"), IDI_PLATFORM_FLASH, OVERLAYS_PLATFORM_CASE },
- { "client_on_Java", L"|*Java*|jagent*|ICQ2Go!*", LPGENT("Java overlay"), IDI_PLATFORM_JAVA, OVERLAYS_PLATFORM_CASE },
- { "client_on_Symbian", L"|*Symbian*|sagent*", LPGENT("Symbian overlay"), IDI_PLATFORM_SYMBIAN, OVERLAYS_PLATFORM_CASE },
- { "client_on_Amiga", L"*Amiga*", LPGENT("Amiga overlay"), IDI_PLATFORM_AMIGA, OVERLAYS_PLATFORM_CASE },
- { "client_on_Android", L"|*Android*|*(android)*", LPGENT("Android overlay"), IDI_PLATFORM_ANDROID, OVERLAYS_PLATFORM_CASE },
- { "client_on_Website", L"|*(website)*|*(Web)*", LPGENT("Website overlay"), IDI_PLATFORM_WEBSITE, OVERLAYS_PLATFORM_CASE },
- { "client_on_WinPhone", L"|*(wphone)*|*(WP)*", LPGENT("Windows Phone overlay"), IDI_PLATFORM_WINPHONE, OVERLAYS_PLATFORM_CASE },
- { "client_on_mobile", L"*(mobile)*", LPGENT("Mobile overlay"), IDI_PLATFORM_MOBILE, OVERLAYS_PLATFORM_CASE },
+ { "client_on_Win32", L"|*Win*|* WM *|wmagent*|*Vista*", LPGENW("Windows overlay"), IDI_PLATFORM_WIN, OVERLAYS_PLATFORM_CASE },
+ { "client_on_iOS", L"|*ipad*|*iphone*|*iOS*", LPGENW("iOS overlay (iPhone/iPad)"), IDI_PLATFORM_IOS, OVERLAYS_PLATFORM_CASE },
+ { "client_on_Mac", L"|^*smack*|* Mac *|*mac*|*OSX*", LPGENW("MacOS overlay"), IDI_PLATFORM_MAC, OVERLAYS_PLATFORM_CASE },
+ { "client_on_Linux", L"*Linux*", LPGENW("Linux overlay"), IDI_PLATFORM_LINUX, OVERLAYS_PLATFORM_CASE },
+ { "client_on_Flash", L"|*Flash*|*Web*ICQ*", LPGENW("Flash overlay"), IDI_PLATFORM_FLASH, OVERLAYS_PLATFORM_CASE },
+ { "client_on_Java", L"|*Java*|jagent*|ICQ2Go!*", LPGENW("Java overlay"), IDI_PLATFORM_JAVA, OVERLAYS_PLATFORM_CASE },
+ { "client_on_Symbian", L"|*Symbian*|sagent*", LPGENW("Symbian overlay"), IDI_PLATFORM_SYMBIAN, OVERLAYS_PLATFORM_CASE },
+ { "client_on_Amiga", L"*Amiga*", LPGENW("Amiga overlay"), IDI_PLATFORM_AMIGA, OVERLAYS_PLATFORM_CASE },
+ { "client_on_Android", L"|*Android*|*(android)*", LPGENW("Android overlay"), IDI_PLATFORM_ANDROID, OVERLAYS_PLATFORM_CASE },
+ { "client_on_Website", L"|*(website)*|*(Web)*", LPGENW("Website overlay"), IDI_PLATFORM_WEBSITE, OVERLAYS_PLATFORM_CASE },
+ { "client_on_WinPhone", L"|*(wphone)*|*(WP)*", LPGENW("Windows Phone overlay"), IDI_PLATFORM_WINPHONE, OVERLAYS_PLATFORM_CASE },
+ { "client_on_mobile", L"*(mobile)*", LPGENW("Mobile overlay"), IDI_PLATFORM_MOBILE, OVERLAYS_PLATFORM_CASE },
};
int DEFAULT_KN_FP_OVERLAYS_COUNT = _countof(def_kn_fp_overlays_mask);
@@ -770,37 +768,37 @@ int DEFAULT_KN_FP_OVERLAYS_COUNT = _countof(def_kn_fp_overlays_mask);
KN_FP_MASK def_kn_fp_overlays2_mask[] =
{// {"Client_IconName", L"|^*Mask*|*names*", L"Icon caption", IDI_RESOURCE_ID, CLIENT_CASE, OVERLAY? },
- { "client_debug_overlay", L"|*[*debug*]*|*test*|*теÑÑ‚*", LPGENT("debug overlay"), IDI_DEBUG_OVERLAY, OVERLAYS_RESOURCE_CASE },
- { "client_office_overlay", L"|*[*office*]*|*[*офиÑ*]*", LPGENT("office overlay"), IDI_OFFICE_OVERLAY, OVERLAYS_RESOURCE_CASE },
- { "client_mobile_overlay", L"|*[*mobile*]*|*[*pda*]*", LPGENT("mobile overlay"), IDI_MOBILE_OVERLAY, OVERLAYS_RESOURCE_CASE },
- { "client_home_overlay", L"|*[*home*]*|*[*дом*]*|*[*хоме*]*", LPGENT("home overlay"), IDI_HOME_OVERLAY, OVERLAYS_RESOURCE_CASE },
+ { "client_debug_overlay", L"|*[*debug*]*|*test*|*теÑÑ‚*", LPGENW("debug overlay"), IDI_DEBUG_OVERLAY, OVERLAYS_RESOURCE_CASE },
+ { "client_office_overlay", L"|*[*office*]*|*[*офиÑ*]*", LPGENW("office overlay"), IDI_OFFICE_OVERLAY, OVERLAYS_RESOURCE_CASE },
+ { "client_mobile_overlay", L"|*[*mobile*]*|*[*pda*]*", LPGENW("mobile overlay"), IDI_MOBILE_OVERLAY, OVERLAYS_RESOURCE_CASE },
+ { "client_home_overlay", L"|*[*home*]*|*[*дом*]*|*[*хоме*]*", LPGENW("home overlay"), IDI_HOME_OVERLAY, OVERLAYS_RESOURCE_CASE },
{ "client_work_overlay", L"|*[*work*]*|*wrk*"
- L"|*[*работа*]*|*ворк*", LPGENT("work overlay"), IDI_WORK_OVERLAY, OVERLAYS_RESOURCE_CASE },
+ L"|*[*работа*]*|*ворк*", LPGENW("work overlay"), IDI_WORK_OVERLAY, OVERLAYS_RESOURCE_CASE },
{ "client_note_overlay", L"|*[*note*]*|*[*laptop*]*"
L"|*[*нетбу*]*|*[*ноут*]*|*[*ноте*]*"
L"|*[*кирпич*]*|*[*portable*]*"
- L"|*[*flash*]*|*[*usb*]*", LPGENT("notebook overlay"), IDI_NOTEBOOK_OVERLAY, OVERLAYS_RESOURCE_CASE },
+ L"|*[*flash*]*|*[*usb*]*", LPGENW("notebook overlay"), IDI_NOTEBOOK_OVERLAY, OVERLAYS_RESOURCE_CASE },
// {"client_MirNG_09_over", L"*Miranda*NG*\?.\?\?.9.*", L"Miranda NG v0.9 #2 overlay", IDI_MIRANDA_NG_V9, MIRANDA_VERSION_CASE },
// {"client_MirNG_08_over", L"*Miranda*NG*\?.\?\?.8.*", L"Miranda NG v0.8 #2 overlay", IDI_MIRANDA_NG_V8, MIRANDA_VERSION_CASE },
// {"client_MirNG_07_over", L"*Miranda*NG*\?.\?\?.7.*", L"Miranda NG v0.7 #2 overlay", IDI_MIRANDA_NG_V7, MIRANDA_VERSION_CASE },
- { "client_MirNG_06_over", L"*Miranda*NG*\?.\?\?.6.*", LPGENT("Miranda NG v0.6 #2 overlay"), IDI_MIRANDA_NG_V6, MIRANDA_VERSION_CASE },
- { "client_MirNG_05_over", L"*Miranda*NG*\?.\?\?.5.*", LPGENT("Miranda NG v0.5 #2 overlay"), IDI_MIRANDA_NG_V5, MIRANDA_VERSION_CASE },
- { "client_MirNG_04_over", L"*Miranda*NG*\?.\?\?.4.*", LPGENT("Miranda NG v0.4 #2 overlay"), IDI_MIRANDA_NG_V4, MIRANDA_VERSION_CASE },
- { "client_MirNG_03_over", L"*Miranda*NG*\?.\?\?.3.*", LPGENT("Miranda NG v0.3 #2 overlay"), IDI_MIRANDA_NG_V3, MIRANDA_VERSION_CASE },
- { "client_MirNG_02_over", L"*Miranda*NG*\?.\?\?.2.*", LPGENT("Miranda NG v0.2 #2 overlay"), IDI_MIRANDA_NG_V2, MIRANDA_VERSION_CASE },
- { "client_MirNG_01_over", L"*Miranda*NG*\?.\?\?.1.*", LPGENT("Miranda NG v0.1 #2 overlay"), IDI_MIRANDA_NG_V1, MIRANDA_VERSION_CASE },
-
- { "client_MirIM_010_over", L"*Miranda*0.10.*", LPGENT("Miranda IM v0.10 #2 overlay"), IDI_MIRANDA_IM_V10, MIRANDA_VERSION_CASE },
- { "client_MirIM_09_over", L"*Miranda*0.9.*", LPGENT("Miranda IM v0.9 #2 overlay"), IDI_MIRANDA_IM_V9, MIRANDA_VERSION_CASE },
- { "client_MirIM_08_over", L"*Miranda*0.8.*", LPGENT("Miranda IM v0.8 #2 overlay"), IDI_MIRANDA_IM_V8, MIRANDA_VERSION_CASE },
- { "client_MirIM_07_over", L"*Miranda*0.7.*", LPGENT("Miranda IM v0.7 #2 overlay"), IDI_MIRANDA_IM_V7, MIRANDA_VERSION_CASE },
- { "client_MirIM_06_over", L"*Miranda*0.6.*", LPGENT("Miranda IM v0.6 #2 overlay"), IDI_MIRANDA_IM_V6, MIRANDA_VERSION_CASE },
- { "client_MirIM_05_over", L"*Miranda*0.5.*", LPGENT("Miranda IM v0.5 #2 overlay"), IDI_MIRANDA_IM_V5, MIRANDA_VERSION_CASE },
- { "client_MirIM_04_over", L"*Miranda*0.4.*", LPGENT("Miranda IM v0.4 #2 overlay"), IDI_MIRANDA_IM_V4, MIRANDA_VERSION_CASE },
+ { "client_MirNG_06_over", L"*Miranda*NG*\?.\?\?.6.*", LPGENW("Miranda NG v0.6 #2 overlay"), IDI_MIRANDA_NG_V6, MIRANDA_VERSION_CASE },
+ { "client_MirNG_05_over", L"*Miranda*NG*\?.\?\?.5.*", LPGENW("Miranda NG v0.5 #2 overlay"), IDI_MIRANDA_NG_V5, MIRANDA_VERSION_CASE },
+ { "client_MirNG_04_over", L"*Miranda*NG*\?.\?\?.4.*", LPGENW("Miranda NG v0.4 #2 overlay"), IDI_MIRANDA_NG_V4, MIRANDA_VERSION_CASE },
+ { "client_MirNG_03_over", L"*Miranda*NG*\?.\?\?.3.*", LPGENW("Miranda NG v0.3 #2 overlay"), IDI_MIRANDA_NG_V3, MIRANDA_VERSION_CASE },
+ { "client_MirNG_02_over", L"*Miranda*NG*\?.\?\?.2.*", LPGENW("Miranda NG v0.2 #2 overlay"), IDI_MIRANDA_NG_V2, MIRANDA_VERSION_CASE },
+ { "client_MirNG_01_over", L"*Miranda*NG*\?.\?\?.1.*", LPGENW("Miranda NG v0.1 #2 overlay"), IDI_MIRANDA_NG_V1, MIRANDA_VERSION_CASE },
+
+ { "client_MirIM_010_over", L"*Miranda*0.10.*", LPGENW("Miranda IM v0.10 #2 overlay"), IDI_MIRANDA_IM_V10, MIRANDA_VERSION_CASE },
+ { "client_MirIM_09_over", L"*Miranda*0.9.*", LPGENW("Miranda IM v0.9 #2 overlay"), IDI_MIRANDA_IM_V9, MIRANDA_VERSION_CASE },
+ { "client_MirIM_08_over", L"*Miranda*0.8.*", LPGENW("Miranda IM v0.8 #2 overlay"), IDI_MIRANDA_IM_V8, MIRANDA_VERSION_CASE },
+ { "client_MirIM_07_over", L"*Miranda*0.7.*", LPGENW("Miranda IM v0.7 #2 overlay"), IDI_MIRANDA_IM_V7, MIRANDA_VERSION_CASE },
+ { "client_MirIM_06_over", L"*Miranda*0.6.*", LPGENW("Miranda IM v0.6 #2 overlay"), IDI_MIRANDA_IM_V6, MIRANDA_VERSION_CASE },
+ { "client_MirIM_05_over", L"*Miranda*0.5.*", LPGENW("Miranda IM v0.5 #2 overlay"), IDI_MIRANDA_IM_V5, MIRANDA_VERSION_CASE },
+ { "client_MirIM_04_over", L"*Miranda*0.4.*", LPGENW("Miranda IM v0.4 #2 overlay"), IDI_MIRANDA_IM_V4, MIRANDA_VERSION_CASE },
};
int DEFAULT_KN_FP_OVERLAYS2_COUNT = _countof(def_kn_fp_overlays2_mask);
@@ -811,10 +809,10 @@ int DEFAULT_KN_FP_OVERLAYS2_COUNT = _countof(def_kn_fp_overlays2_mask);
//#########################################################################################################################################################################
KN_FP_MASK def_kn_fp_overlays3_mask[] =
{// {"Client_IconName", L"|^*Mask*|*names*", L"Icon caption", IDI_RESOURCE_ID, CLIENT_CASE, OVERLAY? },
- { "client_platform_x64", L"|*x64*|*64*bit*", LPGENT("x64 overlay"), IDI_PLATFORM_X64, OVERLAYS_PLATFORM_CASE },
- { "client_platform_x32", L"|*x32*|*32*bit*|*x86*", LPGENT("x32 overlay"), IDI_PLATFORM_X32, OVERLAYS_PLATFORM_CASE },
+ { "client_platform_x64", L"|*x64*|*64*bit*", LPGENW("x64 overlay"), IDI_PLATFORM_X64, OVERLAYS_PLATFORM_CASE },
+ { "client_platform_x32", L"|*x32*|*32*bit*|*x86*", LPGENW("x32 overlay"), IDI_PLATFORM_X32, OVERLAYS_PLATFORM_CASE },
- { "client_Unicode", L"*unicode*", LPGENT("Unicode overlay"), IDI_UNICODE_CLIENT, OVERLAYS_UNICODE_CASE },
+ { "client_Unicode", L"*unicode*", LPGENW("Unicode overlay"), IDI_UNICODE_CLIENT, OVERLAYS_UNICODE_CASE },
};
int DEFAULT_KN_FP_OVERLAYS3_COUNT = _countof(def_kn_fp_overlays3_mask);
@@ -825,9 +823,9 @@ int DEFAULT_KN_FP_OVERLAYS3_COUNT = _countof(def_kn_fp_overlays3_mask);
//#########################################################################################################################################################################
KN_FP_MASK def_kn_fp_overlays4_mask[] =
{// {"Client_IconName", L"|^*Mask*|*names*", L"Icon caption", IDI_RESOURCE_ID, CLIENT_CASE, OVERLAY? },
- { "client_NewGPG_over", L"*New*GPG*", LPGENT("NewGPG overlay"), IDI_NEWGPG_OVERLAY, OVERLAYS_SECURITY_CASE },
- { "client_MirOTR_over", L"*Mir*OTR*", LPGENT("MirOTR overlay"), IDI_MIROTR_OVERLAY, OVERLAYS_SECURITY_CASE },
- { "client_SecureIM_over", L"*Secure*IM*", LPGENT("SecureIM overlay"), IDI_SECUREIM_OVERLAY, OVERLAYS_SECURITY_CASE },
+ { "client_NewGPG_over", L"*New*GPG*", LPGENW("NewGPG overlay"), IDI_NEWGPG_OVERLAY, OVERLAYS_SECURITY_CASE },
+ { "client_MirOTR_over", L"*Mir*OTR*", LPGENW("MirOTR overlay"), IDI_MIROTR_OVERLAY, OVERLAYS_SECURITY_CASE },
+ { "client_SecureIM_over", L"*Secure*IM*", LPGENW("SecureIM overlay"), IDI_SECUREIM_OVERLAY, OVERLAYS_SECURITY_CASE },
};
int DEFAULT_KN_FP_OVERLAYS4_COUNT = _countof(def_kn_fp_overlays4_mask);
diff --git a/plugins/FingerprintNG/src/options.cpp b/plugins/FingerprintNG/src/options.cpp
index 87d45c35ae..0aef494660 100644
--- a/plugins/FingerprintNG/src/options.cpp
+++ b/plugins/FingerprintNG/src/options.cpp
@@ -117,9 +117,9 @@ int OnOptInitialise(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = g_hInst;
- odp.ptszGroup = LPGENT("Icons");
+ odp.pwszGroup = LPGENW("Icons");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG);
- odp.ptszTitle = LPGENT("Fingerprint");
+ odp.pwszTitle = LPGENW("Fingerprint");
odp.pfnDlgProc = DlgProcOptions;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &odp);
diff --git a/plugins/FloatingContacts/src/bitmap_funcs.cpp b/plugins/FloatingContacts/src/bitmap_funcs.cpp
index ab3eca3c02..4db3c8f07c 100644
--- a/plugins/FloatingContacts/src/bitmap_funcs.cpp
+++ b/plugins/FloatingContacts/src/bitmap_funcs.cpp
@@ -697,7 +697,7 @@ void MyBitmap::DrawIcon(HICON hic, int x, int y, int w, int h)
// Base on code by Artem Shpynov
// from clist_modern plugin
// slightly modified and integrated to MyBitmap class
-void MyBitmap::DrawText(TCHAR *str, int x, int y, int blur, int strength)
+void MyBitmap::DrawText(wchar_t *str, int x, int y, int blur, int strength)
{
SIZE sz; GetTextExtentPoint32(this->getDC(), str, (int)mir_tstrlen(str), &sz);
sz.cx += (blur + 2) * 2; sz.cy += (blur + 2) * 2;
diff --git a/plugins/FloatingContacts/src/bitmap_funcs.h b/plugins/FloatingContacts/src/bitmap_funcs.h
index d28923ff8d..55726b14c7 100644
--- a/plugins/FloatingContacts/src/bitmap_funcs.h
+++ b/plugins/FloatingContacts/src/bitmap_funcs.h
@@ -94,7 +94,7 @@ public:
void IncreaseAlpha(float q);
void DrawIcon(HICON hic, int x, int y, int w = 0, int h = 0);
- void DrawText(TCHAR *str, int x, int y, int blur = 0, int strength = 0);
+ void DrawText(wchar_t *str, int x, int y, int blur = 0, int strength = 0);
__forceinline COLOR32 *getBits() { return bits; }
__forceinline COLOR32 *getRow(int row) { return bits + row * width; }
diff --git a/plugins/FloatingContacts/src/filedrop.cpp b/plugins/FloatingContacts/src/filedrop.cpp
index 5858e85789..76da433254 100644
--- a/plugins/FloatingContacts/src/filedrop.cpp
+++ b/plugins/FloatingContacts/src/filedrop.cpp
@@ -113,7 +113,7 @@ HRESULT STDMETHODCALLTYPE CDropTarget::Drop(IDataObject *pData, DWORD, POINTL, D
}
}
else {
- TCHAR *pText = (TCHAR*)GlobalLock(stg.hGlobal);
+ wchar_t *pText = (wchar_t*)GlobalLock(stg.hGlobal);
if (pText != NULL) {
SendMsgDialog(hwndCurDrag, pText);
GlobalUnlock(stg.hGlobal);
diff --git a/plugins/FloatingContacts/src/fltcont.h b/plugins/FloatingContacts/src/fltcont.h
index 616baa50dc..691fc6101c 100644
--- a/plugins/FloatingContacts/src/fltcont.h
+++ b/plugins/FloatingContacts/src/fltcont.h
@@ -58,6 +58,7 @@ enum
//
#define MODULE "FloatingContacts"
+#define MODULEW L"FloatingContacts"
#define TOTOPTIME_P 1000
#define TOTOPTIME_MAX (15*(60000/TOTOPTIME_P))
@@ -135,7 +136,7 @@ static __forceinline BOOL ImageList_GetIconSize_my(HIMAGELIST himl, SIZE &sz)
void RegHotkey ( MCONTACT hContact, HWND hwnd );
BOOL IsStatusVisible ( int status );
BOOL HideOnFullScreen ();
-void SendMsgDialog ( HWND hwnd, TCHAR *pText );
+void SendMsgDialog ( HWND hwnd, wchar_t *pText );
void SaveContactsPos ( void );
/////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp
index d9e4d92fbf..ac8d80cadc 100644
--- a/plugins/FloatingContacts/src/main.cpp
+++ b/plugins/FloatingContacts/src/main.cpp
@@ -26,7 +26,7 @@ static void LoadContact(MCONTACT hContact);
// Internal funcs
static void RepaintWindow(HWND hwnd, HDC hdc);
-static void CreateThumbWnd(TCHAR *ptszName, MCONTACT hContact, int nX, int nY);
+static void CreateThumbWnd(wchar_t *ptszName, MCONTACT hContact, int nX, int nY);
static void RegisterWindowClass(void);
static void UnregisterWindowClass(void);
static void LoadDBSettings(void);
@@ -123,11 +123,11 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
static LPCTSTR s_fonts[FLT_FONTIDS] =
{
- { LPGENT("Standard contacts") },
- { LPGENT("Online contacts to whom you have a different visibility") },
- { LPGENT("Offline contacts") },
- { LPGENT("Offline contacts to whom you have a different visibility") },
- { LPGENT("Contacts which are 'not on list'") }
+ { LPGENW("Standard contacts") },
+ { LPGENW("Online contacts to whom you have a different visibility") },
+ { LPGENW("Offline contacts") },
+ { LPGENW("Offline contacts to whom you have a different visibility") },
+ { LPGENW("Contacts which are 'not on list'") }
};
///////////////////////////////////////////////////////
@@ -310,7 +310,7 @@ static void LoadDBSettings()
bIsCListShow = (db_get_b(NULL, "CList", "State", 0) == 2);
}
-void SendMsgDialog(HWND hwnd, TCHAR *pText)
+void SendMsgDialog(HWND hwnd, wchar_t *pText)
{
ThumbInfo *pThumb = thumbList.FindThumb(hwnd);
if (pThumb != NULL)
@@ -413,7 +413,7 @@ static LRESULT __stdcall CommWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
case WM_REFRESH_CONTACT:
if (pThumb) {
- _tcsncpy(pThumb->ptszName, pcli->pfnGetContactDisplayName(pThumb->hContact, 0), USERNAME_LEN - 1);
+ wcsncpy(pThumb->ptszName, pcli->pfnGetContactDisplayName(pThumb->hContact, 0), USERNAME_LEN - 1);
pThumb->RefreshContactStatus((int)lParam);
pThumb->ResizeThumb();
}
@@ -500,7 +500,7 @@ static void UnregisterWindowClass()
UnregisterClass(WND_CLASS, hInst);
}
-static void CreateThumbWnd(TCHAR *ptszName, MCONTACT hContact, int nX, int nY)
+static void CreateThumbWnd(wchar_t *ptszName, MCONTACT hContact, int nX, int nY)
{
ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
if (pThumb != NULL)
@@ -532,7 +532,7 @@ static void CreateThumbsFont()
}
LOGFONT lf;
- FontService_GetFont(LPGENT("Floating contacts"), s_fonts[nFontId], &tColor[nFontId], &lf);
+ FontService_GetFont(LPGENW("Floating contacts"), s_fonts[nFontId], &tColor[nFontId], &lf);
hFont[nFontId] = CreateFontIndirect(&lf);
}
}
@@ -679,8 +679,8 @@ static void LoadContacts()
static IconItemT g_iconList[] =
{
- { LPGENT("Show all thumbs"), "flt_show", IDI_HIDE },
- { LPGENT("Hide all thumbs"), "flt_hide", IDI_SHOW }
+ { LPGENW("Show all thumbs"), "flt_show", IDI_HIDE },
+ { LPGENW("Hide all thumbs"), "flt_hide", IDI_SHOW }
};
static INT_PTR OnMainMenu_HideAll(WPARAM, LPARAM)
@@ -725,7 +725,7 @@ static void LoadMenus()
mi.position = 0xFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_HIDE));
- mi.name.t = LPGENT("Remove thumb");
+ mi.name.w = LPGENW("Remove thumb");
mi.pszService = MODULE "/RemoveThumb";
hMenuItemRemove = Menu_AddContactMenuItem(&mi);
@@ -735,7 +735,7 @@ static void LoadMenus()
mi.pszService = MODULE "/MainHideAllThumbs";
int i = (fcOpt.bHideAll) ? 0 : 1;
mi.hIcolibItem = g_iconList[i].hIcolib;
- mi.name.t = g_iconList[i].tszDescr;
+ mi.name.w = g_iconList[i].tszDescr;
hMainMenuItemHideAll = Menu_AddMainMenuItem(&mi);
// Register hotkeys
@@ -764,7 +764,7 @@ static void LoadContact(MCONTACT hContact)
DWORD dwPos = db_get_dw(hContact, MODULE, "ThumbsPos", (DWORD)-1);
if (dwPos != -1) {
- TCHAR *ptName = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *ptName = pcli->pfnGetContactDisplayName(hContact, 0);
if (ptName != NULL) {
int nX = DB_POS_GETX(dwPos);
int nY = DB_POS_GETY(dwPos);
@@ -910,7 +910,7 @@ extern "C" int __declspec(dllexport) Load()
mir_getLP(&pluginInfoEx);
mir_getCLI();
- Icon_RegisterT(hInst, _T(MODULE), g_iconList, _countof(g_iconList));
+ Icon_RegisterT(hInst, MODULEW, g_iconList, _countof(g_iconList));
LoadMenus();
InitOptions();
@@ -924,7 +924,7 @@ extern "C" int __declspec(dllexport) Load()
char szId[20];
mir_snprintf(szId, "Font%d", i);
- FontService_RegisterFont(MODULE, szId, LPGENT("Floating contacts"), s_fonts[i], NULL, NULL, i + 1, false, &lf, defColor);
+ FontService_RegisterFont(MODULE, szId, LPGENW("Floating contacts"), s_fonts[i], NULL, NULL, i + 1, false, &lf, defColor);
}
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoded);
diff --git a/plugins/FloatingContacts/src/options.cpp b/plugins/FloatingContacts/src/options.cpp
index bad721a483..ecf1100007 100644
--- a/plugins/FloatingContacts/src/options.cpp
+++ b/plugins/FloatingContacts/src/options.cpp
@@ -244,7 +244,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
case IDC_BROWSE:
{
- TCHAR str[MAX_PATH], filter[512];
+ wchar_t str[MAX_PATH], filter[512];
GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str));
Bitmap_GetFilter(filter, _countof(filter));
@@ -301,7 +301,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
db_set_b(NULL, MODULE, "BkUseBitmap", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str));
db_set_ts(NULL, MODULE, "BkBitmap", str);
diff --git a/plugins/FloatingContacts/src/thumbs.cpp b/plugins/FloatingContacts/src/thumbs.cpp
index 51dc4132d1..a5d901bdd6 100644
--- a/plugins/FloatingContacts/src/thumbs.cpp
+++ b/plugins/FloatingContacts/src/thumbs.cpp
@@ -738,13 +738,13 @@ ThumbList::ThumbList() : OBJLIST<ThumbInfo>(1, NumericKeySortT)
ThumbList::~ThumbList()
{}
-ThumbInfo *ThumbList::AddThumb(HWND hwnd, TCHAR *ptszName, MCONTACT hContact)
+ThumbInfo *ThumbList::AddThumb(HWND hwnd, wchar_t *ptszName, MCONTACT hContact)
{
if (ptszName == NULL || hContact == NULL || hwnd == NULL)
return NULL;
ThumbInfo *pThumb = new ThumbInfo;
- _tcsncpy_s(pThumb->ptszName, ptszName, _TRUNCATE);
+ wcsncpy_s(pThumb->ptszName, ptszName, _TRUNCATE);
pThumb->hContact = hContact;
pThumb->hwnd = hwnd;
diff --git a/plugins/FloatingContacts/src/thumbs.h b/plugins/FloatingContacts/src/thumbs.h
index 0fe58fceb0..d3e8d396d1 100644
--- a/plugins/FloatingContacts/src/thumbs.h
+++ b/plugins/FloatingContacts/src/thumbs.h
@@ -14,7 +14,7 @@ struct ThumbInfo
{
MCONTACT hContact;
HWND hwnd;
- TCHAR ptszName[USERNAME_LEN];
+ wchar_t ptszName[USERNAME_LEN];
int iIcon;
CDropTarget *dropTarget;
DockOpt dockOpt;
@@ -60,7 +60,7 @@ public:
ThumbList();
~ThumbList();
- ThumbInfo* AddThumb(HWND hwnd, TCHAR *ptszName, MCONTACT hContact);
+ ThumbInfo* AddThumb(HWND hwnd, wchar_t *ptszName, MCONTACT hContact);
void RemoveThumb(ThumbInfo *pThumb);
ThumbInfo* FindThumb(HWND hwnd);
diff --git a/plugins/Folders/src/dlg_handlers.cpp b/plugins/Folders/src/dlg_handlers.cpp
index d14722300f..82a1b38d04 100644
--- a/plugins/Folders/src/dlg_handlers.cpp
+++ b/plugins/Folders/src/dlg_handlers.cpp
@@ -13,19 +13,19 @@ static PFolderItem GetSelectedItem(HWND hWnd)
return (PFolderItem)SendDlgItemMessage(hWnd, IDC_FOLDERS_ITEMS_LIST, LB_GETITEMDATA, index, 0);
}
-static void GetEditText(HWND hWnd, TCHAR *buffer, int size)
+static void GetEditText(HWND hWnd, wchar_t *buffer, int size)
{
GetWindowText(GetDlgItem(hWnd, IDC_FOLDER_EDIT), buffer, size);
}
-static void SetEditText(HWND hWnd, const TCHAR *buffer)
+static void SetEditText(HWND hWnd, const wchar_t *buffer)
{
bInitializing = 1;
SetDlgItemText(hWnd, IDC_FOLDER_EDIT, buffer);
bInitializing = 0;
}
-static int ContainsSection(HWND hWnd, const TCHAR *section)
+static int ContainsSection(HWND hWnd, const wchar_t *section)
{
int index = SendDlgItemMessage(hWnd, IDC_FOLDERS_SECTIONS_LIST, LB_FINDSTRINGEXACT, -1, (LPARAM)section);
return (index != LB_ERR);
@@ -37,7 +37,7 @@ static void LoadRegisteredFolderSections(HWND hWnd)
for (int i = 0; i < lstRegisteredFolders.getCount(); i++) {
CFolderItem &tmp = lstRegisteredFolders[i];
- TCHAR *translated = mir_a2t(tmp.GetSection());
+ wchar_t *translated = mir_a2t(tmp.GetSection());
if (!ContainsSection(hWnd, TranslateTS(translated))) {
int idx = SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM)TranslateTS(translated));
SendMessage(hwndList, LB_SETITEMDATA, idx, (LPARAM)tmp.GetSection());
@@ -71,7 +71,7 @@ static void LoadRegisteredFolderItems(HWND hWnd)
static void RefreshPreview(HWND hWnd)
{
- TCHAR tmp[MAX_FOLDER_SIZE];
+ wchar_t tmp[MAX_FOLDER_SIZE];
GetEditText(hWnd, tmp, MAX_FOLDER_SIZE);
SetDlgItemText(hWnd, IDC_PREVIEW_EDIT, ExpandPath(tmp));
}
@@ -90,7 +90,7 @@ static void SaveItem(HWND hWnd, PFolderItem item, int bEnableApply)
if (!item)
return;
- TCHAR buffer[MAX_FOLDER_SIZE];
+ wchar_t buffer[MAX_FOLDER_SIZE];
GetEditText(hWnd, buffer, _countof(buffer));
item->SetFormat(buffer);
@@ -103,7 +103,7 @@ static int ChangesNotSaved(HWND hWnd, PFolderItem item)
if (!item)
return 0;
- TCHAR buffer[MAX_FOLDER_SIZE];
+ wchar_t buffer[MAX_FOLDER_SIZE];
GetEditText(hWnd, buffer, MAX_FOLDER_SIZE);
return mir_tstrcmp(item->GetFormat(), buffer) != 0;
}
@@ -119,7 +119,7 @@ static void CheckForChanges(HWND hWnd, int bNeedConfirmation = 1)
static INT_PTR CALLBACK DlgProcVariables(HWND hWnd, UINT msg, WPARAM wParam, LPARAM)
{
- TCHAR tszMessage[2048];
+ wchar_t tszMessage[2048];
switch (msg) {
case WM_INITDIALOG:
diff --git a/plugins/Folders/src/folderItem.cpp b/plugins/Folders/src/folderItem.cpp
index e1b46cb393..9cc475593e 100644
--- a/plugins/Folders/src/folderItem.cpp
+++ b/plugins/Folders/src/folderItem.cpp
@@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-CFolderItem::CFolderItem(const char *sectionName, const char *name, const TCHAR *format, const TCHAR *userName)
+CFolderItem::CFolderItem(const char *sectionName, const char *name, const wchar_t *format, const wchar_t *userName)
{
m_szSection = mir_strdup(sectionName);
m_szName = mir_strdup(name);
@@ -43,7 +43,7 @@ CFolderItem::~CFolderItem()
mir_free(m_tszUserName);
}
-void CFolderItem::SetFormat(const TCHAR *newFormat)
+void CFolderItem::SetFormat(const wchar_t *newFormat)
{
mir_free(m_tszOldFormat);
m_tszOldFormat = m_tszFormat;
@@ -55,12 +55,12 @@ int CFolderItem::IsEqual(const CFolderItem *other)
return (IsEqual(other->GetSection(), other->GetUserName()));
}
-int CFolderItem::IsEqual(const char *section, const TCHAR *name)
+int CFolderItem::IsEqual(const char *section, const wchar_t *name)
{
return !mir_tstrcmp(m_tszUserName, name) && !mir_strcmp(m_szSection, section);
}
-int CFolderItem::IsEqualTranslated(const char *trSection, const TCHAR *trName)
+int CFolderItem::IsEqualTranslated(const char *trSection, const wchar_t *trName)
{
return !mir_tstrcmp(TranslateTS(m_tszUserName), trName) && !mir_strcmp(Translate(m_szSection), trSection);
}
@@ -111,7 +111,7 @@ int CFolderItem::FolderDeleteOldDirectory(int showFolder)
return res;
}
-void CFolderItem::GetDataFromDatabase(const TCHAR *szNotFound)
+void CFolderItem::GetDataFromDatabase(const wchar_t *szNotFound)
{
char szSettingName[256];
strcpy_s(szSettingName, _countof(szSettingName), m_szSection);
diff --git a/plugins/Folders/src/folderItem.h b/plugins/Folders/src/folderItem.h
index 03b88f86e5..ad02db6d12 100644
--- a/plugins/Folders/src/folderItem.h
+++ b/plugins/Folders/src/folderItem.h
@@ -32,30 +32,30 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
class CFolderItem
{
char *m_szSection, *m_szName;
- TCHAR *m_tszFormat, *m_tszOldFormat, *m_tszUserName;
+ wchar_t *m_tszFormat, *m_tszOldFormat, *m_tszUserName;
- void GetDataFromDatabase(const TCHAR *szNotFound);
+ void GetDataFromDatabase(const wchar_t *szNotFound);
void WriteDataToDatabase();
int FolderCreateDirectory(int showFolder = 0);
int FolderDeleteOldDirectory(int showFolder = 0);
public:
- CFolderItem(const char *sectionName, const char *name, const TCHAR *format, const TCHAR *userName);
+ CFolderItem(const char *sectionName, const char *name, const wchar_t *format, const wchar_t *userName);
virtual ~CFolderItem();
CMString Expand();
void Save();
int IsEqual(const CFolderItem *other);
- int IsEqual(const char *section, const TCHAR *name);
- int IsEqualTranslated(const char *trSection, const TCHAR *trName);
+ int IsEqual(const char *section, const wchar_t *name);
+ int IsEqualTranslated(const char *trSection, const wchar_t *trName);
int operator ==(const CFolderItem *other);
__inline const char* GetSection() const { return m_szSection; }
__inline const char* GetName() const { return m_szName; }
- __inline const TCHAR* GetUserName() const { return m_tszUserName; }
- __inline const TCHAR* GetFormat() const { return m_tszFormat; }
- void SetFormat(const TCHAR *newFormat);
+ __inline const wchar_t* GetUserName() const { return m_tszUserName; }
+ __inline const wchar_t* GetFormat() const { return m_tszFormat; }
+ void SetFormat(const wchar_t *newFormat);
};
typedef CFolderItem *PFolderItem;
diff --git a/plugins/Folders/src/services.cpp b/plugins/Folders/src/services.cpp
index 348db4468e..de7669c4e9 100644
--- a/plugins/Folders/src/services.cpp
+++ b/plugins/Folders/src/services.cpp
@@ -22,10 +22,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define DEFAULT_SECTION "Unknown"
-TCHAR szCurrentProfilePath[MAX_FOLDERS_PATH];
-TCHAR szCurrentProfile[MAX_FOLDERS_PATH];
-TCHAR szMirandaPath[MAX_FOLDERS_PATH];
-TCHAR szUserDataPath[MAX_FOLDERS_PATH];
+wchar_t szCurrentProfilePath[MAX_FOLDERS_PATH];
+wchar_t szCurrentProfile[MAX_FOLDERS_PATH];
+wchar_t szMirandaPath[MAX_FOLDERS_PATH];
+wchar_t szUserDataPath[MAX_FOLDERS_PATH];
INT_PTR RegisterPathService(WPARAM, LPARAM lParam)
{
@@ -69,7 +69,7 @@ INT_PTR GetPathService(WPARAM wParam, LPARAM lParam)
CMString buf(p->Expand());
if (data->flags & FF_UNICODE)
- _tcsncpy_s(data->szPathT, data->nMaxPathSize, buf, _TRUNCATE);
+ wcsncpy_s(data->szPathT, data->nMaxPathSize, buf, _TRUNCATE);
else
strncpy_s(data->szPath, data->nMaxPathSize, _T2A(buf), _TRUNCATE);
return 0;
@@ -81,12 +81,12 @@ int InitServices()
{
CallService(MS_DB_GETPROFILEPATHT, _countof(szCurrentProfilePath), (LPARAM)szCurrentProfilePath);
CallService(MS_DB_GETPROFILENAMET, _countof(szCurrentProfile), (LPARAM)szCurrentProfile);
- TCHAR *pos = _tcsrchr(szCurrentProfile, '.'); if (pos) *pos = 0;
+ wchar_t *pos = wcsrchr(szCurrentProfile, '.'); if (pos) *pos = 0;
GetModuleFileName(GetModuleHandleA("mir_app.mir"), szMirandaPath, _countof(szMirandaPath));
- pos = _tcsrchr(szMirandaPath, '\\'); if (pos) *pos = 0;
+ pos = wcsrchr(szMirandaPath, '\\'); if (pos) *pos = 0;
- TCHAR *szTemp = Utils_ReplaceVarsT(L"%miranda_userdata%");
+ wchar_t *szTemp = Utils_ReplaceVarsT(L"%miranda_userdata%");
mir_sntprintf(szUserDataPath, szTemp);
mir_free(szTemp);
diff --git a/plugins/Folders/src/services.h b/plugins/Folders/src/services.h
index 6f1acaf1ca..c262748b13 100644
--- a/plugins/Folders/src/services.h
+++ b/plugins/Folders/src/services.h
@@ -23,10 +23,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MAX_FOLDERS_PATH 512
-extern TCHAR szCurrentProfilePath[MAX_FOLDERS_PATH];
-extern TCHAR szCurrentProfile[MAX_FOLDERS_PATH];
-extern TCHAR szMirandaPath[MAX_FOLDERS_PATH];
-extern TCHAR szUserDataPath[MAX_FOLDERS_PATH];
+extern wchar_t szCurrentProfilePath[MAX_FOLDERS_PATH];
+extern wchar_t szCurrentProfile[MAX_FOLDERS_PATH];
+extern wchar_t szMirandaPath[MAX_FOLDERS_PATH];
+extern wchar_t szUserDataPath[MAX_FOLDERS_PATH];
int InitServices();
void InitOptions();
diff --git a/plugins/Folders/src/utils.cpp b/plugins/Folders/src/utils.cpp
index 97ffef2eb6..2adc3b7035 100644
--- a/plugins/Folders/src/utils.cpp
+++ b/plugins/Folders/src/utils.cpp
@@ -20,12 +20,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-CMString ExpandPath(const TCHAR *format)
+CMString ExpandPath(const wchar_t *format)
{
CMString res;
if (ServiceExists(MS_VARS_FORMATSTRING))
- res = VARST(ptrT(variables_parse((TCHAR*)format, NULL, NULL)));
+ res = VARST(ptrT(variables_parse((wchar_t*)format, NULL, NULL)));
else
res = VARST(format);
@@ -47,20 +47,20 @@ CMString ExpandPath(const TCHAR *format)
return res;
}
-void RemoveDirectories(const TCHAR *path)
+void RemoveDirectories(const wchar_t *path)
{
- TCHAR *pos;
- TCHAR *buffer = NEWWSTR_ALLOCA(path);
+ wchar_t *pos;
+ wchar_t *buffer = NEWWSTR_ALLOCA(path);
if (!(GetFileAttributes(buffer) & FILE_ATTRIBUTE_REPARSE_POINT))
RemoveDirectory(buffer);
- while (pos = _tcsrchr(buffer, '\\')) {
+ while (pos = wcsrchr(buffer, '\\')) {
pos[0] = '\0';
if (!(GetFileAttributes(buffer) & FILE_ATTRIBUTE_REPARSE_POINT))
RemoveDirectory(buffer);
}
}
-bool DirectoryExists(const TCHAR *path)
+bool DirectoryExists(const wchar_t *path)
{
DWORD dwAttributes = GetFileAttributes(path);
if (dwAttributes == INVALID_FILE_ATTRIBUTES || !(dwAttributes & FILE_ATTRIBUTE_DIRECTORY))
diff --git a/plugins/Folders/src/utils.h b/plugins/Folders/src/utils.h
index 3307335e14..4724635ce0 100644
--- a/plugins/Folders/src/utils.h
+++ b/plugins/Folders/src/utils.h
@@ -21,9 +21,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef M_FOLDERS_UTILS_H
#define M_FOLDERS_UTILS_H
-CMString ExpandPath(const TCHAR *format);
+CMString ExpandPath(const wchar_t *format);
-void RemoveDirectories(const TCHAR *szPath);
-bool DirectoryExists(const TCHAR *szPath);
+void RemoveDirectories(const wchar_t *szPath);
+bool DirectoryExists(const wchar_t *szPath);
#endif \ No newline at end of file
diff --git a/plugins/GmailNotifier/src/options.cpp b/plugins/GmailNotifier/src/options.cpp
index 959fcd6d16..7be689df09 100644
--- a/plugins/GmailNotifier/src/options.cpp
+++ b/plugins/GmailNotifier/src/options.cpp
@@ -126,7 +126,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
case IDC_PRGBROWSE:
{
OPENFILENAME OpenFileName;
- TCHAR szName[_MAX_PATH];
+ wchar_t szName[_MAX_PATH];
memset(&OpenFileName, 0, sizeof(OPENFILENAME));
GetDlgItemText(hwndDlg, IDC_PRG, szName, _countof(szName));
OpenFileName.lStructSize = sizeof(OPENFILENAME);
diff --git a/plugins/HTTPServer/src/Glob.h b/plugins/HTTPServer/src/Glob.h
index 2e0c92fc4f..c556f73786 100644
--- a/plugins/HTTPServer/src/Glob.h
+++ b/plugins/HTTPServer/src/Glob.h
@@ -54,7 +54,7 @@ using namespace std;
#define SD_BOTH 0x02
#define MODULE "HTTPServer"
-#define MSG_BOX_TITEL TranslateT("Miranda NG HTTP-Server")
+#define MSG_BOX_TITEL Translate("Miranda NG HTTP-Server")
#define SplitIpAddress( p ) (BYTE)(p>>24),(BYTE)(p>>16),(BYTE)(p>>8),(BYTE)(p)
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp
index d79e8a8450..ed36ad8ac2 100644
--- a/plugins/HTTPServer/src/GuiElements.cpp
+++ b/plugins/HTTPServer/src/GuiElements.cpp
@@ -462,7 +462,7 @@ bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare)
| OFN_ALLOWMULTISELECT;
ofn.hwndOwner = hwndOwner;
ofn.hInstance = hInstance;
- ofn.lpstrTitle = TranslateT("Specify a file to share");
+ ofn.lpstrTitle = Translate("Specify a file to share");
ofn.lpTemplateName = MAKEINTRESOURCE(IDD_NEW_SHARE_PROPERTIES);
ofn.lpfnHook = ShareNewFileDialogHook;
ofn.lCustData = (LPARAM)pstNewShare;
@@ -505,7 +505,7 @@ bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare)
pstNewShare->pszRealPath[pstNewShare->dwMaxRealPath] = '\0';
if (CallService(MS_HTTP_ADD_CHANGE_REMOVE, 0, (LPARAM)pstNewShare)) {
- MessageBox(NULL, TranslateT("Failed to share new file"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, Translate("Failed to share new file"), MSG_BOX_TITEL, MB_OK);
return false;
}
pszFileNamePos++;
@@ -516,7 +516,7 @@ bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare)
}
else {
if (CallService(MS_HTTP_ADD_CHANGE_REMOVE, 0, (LPARAM)pstNewShare)) {
- MessageBox(NULL, TranslateT("Failed to share new file"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, Translate("Failed to share new file"), MSG_BOX_TITEL, MB_OK);
return false;
}
}
@@ -722,36 +722,36 @@ static INT_PTR CALLBACK DlgProcStatsticView(HWND hwndDlg, UINT msg, WPARAM wPara
LVCOLUMN cCol = { 0 };
cCol.mask = LVCF_TEXT | LVCF_WIDTH;
cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx1", 126);
- cCol.pszText = TranslateT("Share name");
+ cCol.pszText = Translate("Share name");
ListView_InsertColumn(hShareList, 0, &cCol);
cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx2", 48);
- cCol.pszText = TranslateT("Max Downloads");
+ cCol.pszText = Translate("Max Downloads");
ListView_InsertColumn(hShareList, 1, &cCol);
cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx3", 96);
- cCol.pszText = TranslateT("Allowed IP");
+ cCol.pszText = Translate("Allowed IP");
ListView_InsertColumn(hShareList, 2, &cCol);
cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx4", 104);
- cCol.pszText = TranslateT("Allowed Mask");
+ cCol.pszText = Translate("Allowed Mask");
ListView_InsertColumn(hShareList, 3, &cCol);
cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx5", 252);
- cCol.pszText = TranslateT("Real path");
+ cCol.pszText = Translate("Real path");
ListView_InsertColumn(hShareList, 4, &cCol);
cCol.mask = LVCF_TEXT | LVCF_WIDTH;
cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx6", 142);
- cCol.pszText = TranslateT("Share name");
+ cCol.pszText = Translate("Share name");
ListView_InsertColumn(hUserList, 0, &cCol);
cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx7", 111);
- cCol.pszText = TranslateT("User");
+ cCol.pszText = Translate("User");
ListView_InsertColumn(hUserList, 1, &cCol);
cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx8", 100);
- cCol.pszText = TranslateT("Agent");
+ cCol.pszText = Translate("Agent");
ListView_InsertColumn(hUserList, 2, &cCol);
cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx9", 100);
- cCol.pszText = TranslateT("Completed");
+ cCol.pszText = Translate("Completed");
ListView_InsertColumn(hUserList, 3, &cCol);
cCol.cx = db_get_w(NULL, MODULE, "StatWnd_cx10", 100);
- cCol.pszText = TranslateT("Speed");
+ cCol.pszText = Translate("Speed");
ListView_InsertColumn(hUserList, 4, &cCol);
bool b = db_get_b(NULL, MODULE, "StatWnd_ShowHidden", 0) != 0;
@@ -805,7 +805,7 @@ static INT_PTR CALLBACK DlgProcStatsticView(HWND hwndDlg, UINT msg, WPARAM wPara
strncpy(&szServPath[1], fileName + 1, MAX_PATH - 2);
if (CallService(MS_HTTP_ADD_CHANGE_REMOVE, 0, (LPARAM)&stNewShare)) {
- MessageBox(NULL, TranslateT("Failed to share new file"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, Translate("Failed to share new file"), MSG_BOX_TITEL, MB_OK);
return false;
}
}
@@ -915,18 +915,18 @@ static INT_PTR CALLBACK DlgProcStatsticView(HWND hwndDlg, UINT msg, WPARAM wPara
if (ListView_GetItem(hShareList, &sItem)) {
string sLink = sCreateLink(sItem.pszText);
if (sLink.size() <= 0) {
- MessageBox(hwndDlg, TranslateT("Selected link size is 0"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(hwndDlg, Translate("Selected link size is 0"), MSG_BOX_TITEL, MB_OK);
return TRUE;
}
if (LOWORD(wParam) == ID_SHARELIST_COPYLINK) {
if (!OpenClipboard(hwndDlg)) {
- MessageBox(hwndDlg, TranslateT("Failed to get access to clipboard"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(hwndDlg, Translate("Failed to get access to clipboard"), MSG_BOX_TITEL, MB_OK);
return TRUE;
}
if (!EmptyClipboard()) {
- MessageBox(hwndDlg, TranslateT("Failed to get close the clipboard"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(hwndDlg, Translate("Failed to get close the clipboard"), MSG_BOX_TITEL, MB_OK);
return TRUE;
}
@@ -940,15 +940,15 @@ static INT_PTR CALLBACK DlgProcStatsticView(HWND hwndDlg, UINT msg, WPARAM wPara
HANDLE hMyData = SetClipboardData(CF_TEXT, hglbCopy);
if (!hMyData)
- MessageBox(hwndDlg, TranslateT("Failed to set clipboard data"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(hwndDlg, Translate("Failed to set clipboard data"), MSG_BOX_TITEL, MB_OK);
CloseClipboard();
}
else Utils_OpenUrl(sLink.c_str());
}
- else MessageBox(hwndDlg, TranslateT("ListView_GetItem failed"), MSG_BOX_TITEL, MB_OK);
+ else MessageBox(hwndDlg, Translate("ListView_GetItem failed"), MSG_BOX_TITEL, MB_OK);
}
- else MessageBox(hwndDlg, TranslateT("No share selected"), MSG_BOX_TITEL, MB_OK);
+ else MessageBox(hwndDlg, Translate("No share selected"), MSG_BOX_TITEL, MB_OK);
return TRUE;
}
@@ -1238,14 +1238,14 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
bool bNew = IsDlgButtonChecked(hwndDlg, IDC_ADD_STATISTICS_MENU_ITEM) == BST_CHECKED;
if (b != bNew) {
db_set_b(NULL, MODULE, "AddStatisticsMenuItem", bNew);
- MessageBox(hwndDlg, TranslateT("You need to restart Miranda to change the main menu"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(hwndDlg, Translate("You need to restart Miranda to change the main menu"), MSG_BOX_TITEL, MB_OK);
}
b = db_get_b(NULL, MODULE, "AddAcceptConMenuItem", 1) != 0;
bNew = IsDlgButtonChecked(hwndDlg, IDC_ACCEPT_COM_MENU_ITEM) == BST_CHECKED;
if (b != bNew) {
db_set_b(NULL, MODULE, "AddAcceptConMenuItem", bNew);
- MessageBox(hwndDlg, TranslateT("You need to restart Miranda to change the main menu"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(hwndDlg, Translate("You need to restart Miranda to change the main menu"), MSG_BOX_TITEL, MB_OK);
}
bNew = IsDlgButtonChecked(hwndDlg, IDC_WRITE_LOG_FILE) == BST_CHECKED;
@@ -1343,8 +1343,8 @@ int OptionsInitialize(WPARAM wParam, LPARAM /*lParam*/)
odp.hInstance = hInstance;
odp.pszTemplate = MAKEINTRESOURCE(IDD_OPT_HTTP_SERVER);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.ptszTitle = LPGENT("HTTP Server");
- odp.ptszGroup = LPGENT("Network");
+ odp.pwszTitle = LPGENW("HTTP Server");
+ odp.pwszGroup = LPGENW("Network");
odp.pfnDlgProc = OptionsDlgProc;
Options_AddPage(wParam, &odp);
return 0;
@@ -1477,7 +1477,7 @@ void InitGuiElements()
SET_UID(mi, 0xb30a6ab5, 0x17a8, 0x4e2e, 0x84, 0x52, 0x5f, 0xbc, 0x83, 0x35, 0xf2, 0x6);
mi.hIcolibItem = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SHARE_NEW_FILE));
mi.position = -2000019955;
- mi.name.t = LPGENT("HTTP Share new file");
+ mi.name.w = LPGENW("HTTP Share new file");
mi.pszService = MS_SHARE_NEW_FILE;
hShareNewFileMenuItem = Menu_AddContactMenuItem(&mi);
@@ -1485,7 +1485,7 @@ void InitGuiElements()
SET_UID(mi, 0x68db84c9, 0xe6b4, 0x4b4f, 0x93, 0x4b, 0xfd, 0x34, 0x2d, 0x83, 0x11, 0xe7);
mi.position = 1000085005;
mi.flags = CMIF_TCHAR;
- mi.name.t = LPGENT("Show HTTP server statistics");
+ mi.name.w = LPGENW("Show HTTP server statistics");
mi.pszService = MS_SHOW_STATISTICS_VIEW;
hShowStatisticsViewMenuItem = Menu_AddMainMenuItem(&mi);
}
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp
index 76f1ffe840..9cad408bbd 100644
--- a/plugins/HTTPServer/src/main.cpp
+++ b/plugins/HTTPServer/src/main.cpp
@@ -152,15 +152,15 @@ bool bWriteToFile(HANDLE hFile, const char * pszSrc, int nLen = -1)
// Developer : KN
/////////////////////////////////////////////////////////////////////
-void LogEvent(const TCHAR * pszTitle, const char * pszLog)
+void LogEvent(const char * pszTitle, const char * pszLog)
{
HANDLE hFile = CreateFile(sLogFilePath.c_str(), GENERIC_WRITE, FILE_SHARE_READ, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) {
- MessageBox(NULL, TranslateT("Failed to open or create log file"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, Translate("Failed to open or create log file"), MSG_BOX_TITEL, MB_OK);
return;
}
if (SetFilePointer(hFile, 0, 0, FILE_END) == INVALID_SET_FILE_POINTER) {
- MessageBox(NULL, TranslateT("Failed to move to the end of the log file"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, Translate("Failed to move to the end of the log file"), MSG_BOX_TITEL, MB_OK);
CloseHandle(hFile);
return;
}
@@ -179,7 +179,7 @@ void LogEvent(const TCHAR * pszTitle, const char * pszLog)
!bWriteToFile(hFile, " : ") ||
!bWriteToFile(hFile, pszLog, nLogLen) ||
!bWriteToFile(hFile, "\r\n")) {
- MessageBox(NULL, TranslateT("Failed to write some part of the log file"), MSG_BOX_TITEL, MB_OK);
+ MessageBox(NULL, Translate("Failed to write some part of the log file"), MSG_BOX_TITEL, MB_OK);
}
CloseHandle(hFile);
}
@@ -251,7 +251,7 @@ bool bReadConfigurationFile()
// move rest of buffer to front
if (pszCurPos && pszCurPos != szBuf) {
dwBytesInBuffer = DWORD(sizeof(szBuf) - (pszCurPos - szBuf));
- memmove(szBuf, pszCurPos, dwBytesInBuffer * sizeof(TCHAR));
+ memmove(szBuf, pszCurPos, dwBytesInBuffer * sizeof(wchar_t));
}
// append data to buffer
@@ -336,21 +336,19 @@ bool bReadConfigurationFile()
bool bWriteConfigurationFile()
{
CLFileShareListAccess clCritSection;
- char szBuf[1000];
+ char szBuf[1000], temp[200];
mir_strcpy(szBuf, szPluginPath);
mir_strcat(szBuf, szConfigFile);
HANDLE hFile = CreateFile(szBuf, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) {
- TCHAR temp[200];
- mir_sntprintf(temp, "%s%s", TranslateT("Failed to open or create file "), _T(szConfigFile));
+ mir_snprintf(temp, "%s%s", Translate("Failed to open or create file "), szConfigFile);
MessageBox(NULL, temp, MSG_BOX_TITEL, MB_OK);
return false;
}
DWORD dwBytesWriten = 0;
if (!WriteFile(hFile, szXmlHeader, sizeof(szXmlHeader) - 1, &dwBytesWriten, NULL)) {
- TCHAR temp[200];
- mir_sntprintf(temp, "%s%s", TranslateT("Failed to write xml header to file "), _T(szConfigFile));
+ mir_snprintf(temp, "%s%s", TranslateT("Failed to write xml header to file "), szConfigFile);
MessageBox(NULL, temp, MSG_BOX_TITEL, MB_OK);
}
else {
@@ -364,8 +362,7 @@ bool bWriteConfigurationFile()
SplitIpAddress(pclCur->st.dwAllowedMask));
if (!WriteFile(hFile, szBuf, dwBytesToWrite, &dwBytesWriten, NULL)) {
- TCHAR temp[200];
- mir_sntprintf(temp, "%s%s", TranslateT("Failed to write xml data to file "), _T(szConfigFile));
+ mir_snprintf(temp, "%s%s", Translate("Failed to write xml data to file "), szConfigFile);
MessageBox(NULL, temp, MSG_BOX_TITEL, MB_OK);
break;
}
@@ -373,8 +370,7 @@ bool bWriteConfigurationFile()
}
if (!WriteFile(hFile, szXmlTail, sizeof(szXmlTail) - 1, &dwBytesWriten, NULL)) {
- TCHAR temp[200];
- mir_sntprintf(temp, "%s%s", TranslateT("Failed to write xml tail to file "), _T(szConfigFile));
+ mir_snprintf(temp, "%s%s", Translate("Failed to write xml tail to file "), szConfigFile);
MessageBox(NULL, temp, MSG_BOX_TITEL, MB_OK);
}
}
@@ -653,8 +649,8 @@ INT_PTR nToggelAcceptConnections(WPARAM wparam, LPARAM /*lparam*/)
hDirectBoundPort = (HANDLE)CallService(MS_NETLIB_BINDPORT, (WPARAM)hNetlibUser, (LPARAM)& nlb);
if (!hDirectBoundPort) {
- TCHAR szTemp[200];
- mir_snprintf(szTemp, TranslateT("Failed to bind to port %s\r\nThis is most likely because another program or service is using this port"),
+ char szTemp[200];
+ mir_snprintf(szTemp, Translate("Failed to bind to port %s\r\nThis is most likely because another program or service is using this port"),
nlb.wPort == 80 ? "80" : nus.szIncomingPorts);
MessageBox(NULL, szTemp, MSG_BOX_TITEL, MB_OK);
return 1001;
@@ -746,9 +742,9 @@ int MainInit(WPARAM /*wparam*/, LPARAM /*lparam*/)
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_TCHAR;
+ nlu.flags = NUF_OUTGOING | NUF_INCOMING;
nlu.szSettingsModule = MODULE;
- nlu.ptszDescriptiveName = TranslateT("HTTP Server");
+ nlu.szDescriptiveName = Translate("HTTP Server");
hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)& nlu);
if (!hNetlibUser) {
MessageBox(NULL, "Failed to register NetLib user", MSG_BOX_TITEL, MB_OK);
@@ -931,7 +927,7 @@ extern "C" __declspec(dllexport) int Load()
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SHARE_NEW_FILE));
mi.position = 1000085000;
- mi.name.a = LPGENT("Enable HTTP server");
+ mi.name.a = LPGEN("Enable HTTP server");
mi.pszService = MS_HTTP_ACCEPT_CONNECTIONS;
hAcceptConnectionsMenuItem = Menu_AddMainMenuItem(&mi);
}
diff --git a/plugins/HistoryLinkListPlus/src/linklist.cpp b/plugins/HistoryLinkListPlus/src/linklist.cpp
index 2d4ea92498..0ad6c2cda1 100644
--- a/plugins/HistoryLinkListPlus/src/linklist.cpp
+++ b/plugins/HistoryLinkListPlus/src/linklist.cpp
@@ -64,7 +64,7 @@ extern "C" __declspec(dllexport) int Load(void)
SET_UID(mi, 0x2964dc6c, 0x9cf9, 0x4f20, 0x8f, 0x8a, 0xc6, 0xfe, 0xe2, 0x65, 0xac, 0xc9);
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_LINKLISTICON));
- mi.name.t = LPGENT("&Create Linklist");
+ mi.name.w = LPGENW("&Create Linklist");
mi.pszService = "Linklist/MenuCommand";
Menu_AddContactMenuItem(&mi);
diff --git a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp
index 9946d3f060..812a828b6b 100644
--- a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp
+++ b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp
@@ -35,8 +35,8 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
switch (msg) {
case WM_INITDIALOG: {
MCONTACT hContact;
- TCHAR title[256];
- TCHAR filter[FILTERTEXT];
+ wchar_t title[256];
+ wchar_t filter[FILTERTEXT];
RECT rc;
POINT pt;
@@ -118,12 +118,12 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
WriteMessage(hDlg, DlgParam->listStart, SendDlgItemMessage(hDlg, IDC_MAIN, EM_LINEFROMCHAR, -1, 0));
break;
case WM_LBUTTONUP:
- link = (LPTSTR)mir_alloc((pENLink->chrg.cpMax - pENLink->chrg.cpMin + 2) * sizeof(TCHAR));
+ link = (LPTSTR)mir_alloc((pENLink->chrg.cpMax - pENLink->chrg.cpMin + 2) * sizeof(wchar_t));
if (link == NULL)
break;
SendDlgItemMessage(hDlg, IDC_MAIN, EM_EXSETSEL, 0, (LPARAM)&pENLink->chrg);
SendDlgItemMessage(hDlg, IDC_MAIN, EM_GETSELTEXT, 0, (LPARAM)link);
- if (_tcsstr(link, L"mailto:") != NULL)
+ if (wcsstr(link, L"mailto:") != NULL)
ShellExecute(HWND_TOP, NULL, link, NULL, NULL, SW_SHOWNORMAL);
else {
bool openNewWindow = db_get_b(NULL, LINKLIST_MODULE, LINKLIST_OPEN_WINDOW, 0xFF) != 0xFF;
@@ -142,7 +142,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
if (mouseEvent == 0x01)
EnableMenuItem(hSubMenu, IDM_SHOWMESSAGE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
TranslateMenu(hSubMenu);
- link = (LPTSTR)mir_alloc((pENLink->chrg.cpMax - pENLink->chrg.cpMin + 4) * sizeof(TCHAR));
+ link = (LPTSTR)mir_alloc((pENLink->chrg.cpMax - pENLink->chrg.cpMin + 4) * sizeof(wchar_t));
if (link == NULL)
break;
SendDlgItemMessage(hDlg, IDC_MAIN, EM_EXSETSEL, 0, (LPARAM)&pENLink->chrg);
@@ -154,13 +154,13 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
switch (TrackPopupMenu(hSubMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hDlg, NULL)) {
case IDM_LINK_OPEN:
- if (_tcsstr(link, L"mailto:") != NULL)
+ if (wcsstr(link, L"mailto:") != NULL)
ShellExecute(HWND_TOP, NULL, link, NULL, NULL, SW_SHOWNORMAL);
else
Utils_OpenUrlT(link,false);
break;
case IDM_LINK_OPENNEW:
- if (_tcsstr(link, L"mailto:") != NULL)
+ if (wcsstr(link, L"mailto:") != NULL)
ShellExecute(HWND_TOP, NULL, link, NULL, NULL, SW_SHOWNORMAL);
else
Utils_OpenUrlT(link);
@@ -170,7 +170,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
break;
EmptyClipboard();
- size_t dataLen = ((mir_tstrlen(link) + 1) * sizeof(TCHAR));
+ size_t dataLen = ((mir_tstrlen(link) + 1) * sizeof(wchar_t));
HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, dataLen);
memcpy((LPTSTR)GlobalLock(hData), link, dataLen);
GlobalUnlock(hData);
@@ -187,7 +187,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
}
} break;
case WM_COMMAND: {
- TCHAR filter[40];
+ wchar_t filter[40];
listMenu = GetMenu(hDlg);
switch (wParam) {
@@ -373,7 +373,7 @@ INT_PTR CALLBACK SearchDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
} break;
case IDSEARCH: {
BYTE flags = 0x00;
- TCHAR filter[FILTERTEXT];
+ wchar_t filter[FILTERTEXT];
LPTSTR buffer;
int length;
@@ -393,7 +393,7 @@ INT_PTR CALLBACK SearchDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
flags |= SLL_DEEP;
length = GetWindowTextLength(GetDlgItem(hDlg, IDC_SEARCHSTRING)) + 1;
- buffer = (LPTSTR)mir_alloc((length + 1) * sizeof(TCHAR));
+ buffer = (LPTSTR)mir_alloc((length + 1) * sizeof(wchar_t));
if (buffer) {
GetDlgItemText(hDlg, IDC_SEARCHSTRING, buffer, length);
WriteLinkList(hListDlg, flags, DlgParam->listStart, buffer, 0);
diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp
index 558a931e05..7517494115 100644
--- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp
+++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp
@@ -45,11 +45,11 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart)
LISTELEMENT *newElement, *actualElement;
BYTE type = LINK_UNKNOWN;
int direction, isLink, linkFound = 0;
- TCHAR date[DATE_SIZE + 1];
- TCHAR time[TIME_SIZE + 1];
- TCHAR link[LINK_MAX + 1];
- TCHAR templink[LINK_MAX + 1];
- TCHAR dbdate[DATE_SIZE + TIME_SIZE];
+ wchar_t date[DATE_SIZE + 1];
+ wchar_t time[TIME_SIZE + 1];
+ wchar_t link[LINK_MAX + 1];
+ wchar_t templink[LINK_MAX + 1];
+ wchar_t dbdate[DATE_SIZE + TIME_SIZE];
if (listStart == NULL)
return -1;
@@ -66,26 +66,26 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart)
//hyperlinks are delimited by: <non-alphanumeric>"hyperlink"<whitespace>
//then all punctuation is stripped from the end of "hyperlink"
iLastAlphaNum = 0;
- while (msg[i] && !_istalnum(msg[i])) {
+ while (msg[i] && !iswalnum(msg[i])) {
// support for files
- if (msg[i] == _T('\\') && msg[i + 1] == _T('\\') && _istalnum(msg[i + 2]))
+ if (msg[i] == '\\' && msg[i + 1] == '\\' && iswalnum(msg[i + 2]))
break;
if(IsDBCSLeadByte(msg[i]) && msg[i + 1])
i ++;
i ++;
- if (msg[i] != _T('\n'))
+ if (msg[i] != '\n')
charCount ++;
}
- if (msg[i] == _T('\0'))
+ if (msg[i] == '\0')
break;
cpWordStart = charCount;
wordStart = i;
- while (msg[i] && !_istspace(msg[i])) {
+ while (msg[i] && !iswspace(msg[i])) {
if (IsDBCSLeadByte(msg[i]) && msg[i + 1]) {
i ++;
} else {
- if (_istalnum(msg[i]) || msg[i]==_T('/')) {
+ if (iswalnum(msg[i]) || msg[i]=='/') {
cpLastAlphaNum = charCount;
iLastAlphaNum = i;
}
@@ -102,8 +102,8 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart)
isLink = 0;
wordlen = (i - wordStart + 1);
- word = (LPTSTR)mir_alloc(wordlen * sizeof(TCHAR));
- wordsearch = (LPTSTR)mir_alloc(wordlen * sizeof(TCHAR));
+ word = (LPTSTR)mir_alloc(wordlen * sizeof(wchar_t));
+ wordsearch = (LPTSTR)mir_alloc(wordlen * sizeof(wchar_t));
if (word == NULL || wordsearch == NULL) {
mir_free(word);
mir_free(wordsearch);
@@ -111,26 +111,26 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart)
break;
}
- _tcsncpy_s(word, wordlen, msg + wordStart, (wordlen - 1));
- _tcsncpy_s(wordsearch, wordlen, msg + wordStart, (wordlen - 1));
+ wcsncpy_s(word, wordlen, msg + wordStart, (wordlen - 1));
+ wcsncpy_s(wordsearch, wordlen, msg + wordStart, (wordlen - 1));
CharLower(wordsearch);
for (j = 0; j < _countof(hyperlinkPrefixes); j ++) {
- if (!_tcsncmp(wordsearch, hyperlinkPrefixes[j], mir_tstrlen(hyperlinkPrefixes[j]))) {
+ if (!wcsncmp(wordsearch, hyperlinkPrefixes[j], mir_tstrlen(hyperlinkPrefixes[j]))) {
isLink = 1;
break;
}
}
if (!isLink) {
for (j = 0; j < _countof(hyperlinkSubstrings); j ++) {
- if (_tcsstr(wordsearch + 1,hyperlinkSubstrings[j])) {
+ if (wcsstr(wordsearch + 1,hyperlinkSubstrings[j])) {
isLink = 1;
break;
}
}
}
- if (_tcschr(wordsearch,_T('@')) && _tcschr(wordsearch,_T('.')) && !_tcschr(wordsearch,_T(':')) && !_tcschr(wordsearch,_T('/'))) {
+ if (wcschr(wordsearch,'@') && wcschr(wordsearch,'.') && !wcschr(wordsearch,':') && !wcschr(wordsearch,'/')) {
isLink = 1; //e-mail addresses
type = LINK_MAIL;
} else if (isLink) {
@@ -138,29 +138,28 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart)
}
if (isLink && wordlen <= LINK_MAX) {
- if (_tcsstr(wordsearch, L"www.") != NULL && _tcsstr(wordsearch, L"http://") == NULL && _tcsstr(wordsearch, L"https://") == NULL) {
- _tcsncpy_s(link, L"http://", LINK_MAX);
- _tcsncat_s(link, word, LINK_MAX);
+ if (wcsstr(wordsearch, L"www.") != NULL && wcsstr(wordsearch, L"http://") == NULL && wcsstr(wordsearch, L"https://") == NULL) {
+ wcsncpy_s(link, L"http://", LINK_MAX);
+ wcsncat_s(link, word, LINK_MAX);
} else {
- _tcsncpy_s(link, word, LINK_MAX);
+ wcsncpy_s(link, word, LINK_MAX);
}
TimeZone_ToStringT(dbei->timestamp, L"d-t", dbdate, _countof(dbdate));
- date_ptr = _tcstok_s(dbdate, L"-", &tok_ctx);
- time_ptr = _tcstok_s(NULL, L"-", &tok_ctx);
- _tcsncpy_s(date, date_ptr, _TRUNCATE);
- _tcsncpy_s(time, time_ptr, _TRUNCATE);
+ date_ptr = wcstok_s(dbdate, L"-", &tok_ctx);
+ time_ptr = wcstok_s(NULL, L"-", &tok_ctx);
+ wcsncpy_s(date, date_ptr, _TRUNCATE);
+ wcsncpy_s(time, time_ptr, _TRUNCATE);
- if (dbei->flags & DBEF_SENT) {
+ if (dbei->flags & DBEF_SENT)
direction = DIRECTION_OUT;
- } else {
+ else
direction = DIRECTION_IN;
- }
- if (type == LINK_MAIL && _tcsstr(link, L"mailto:") == NULL) {
- _tcsncpy_s(templink, link, _TRUNCATE);
- _tcsncpy_s(link, L"mailto:", _TRUNCATE);
- _tcsncpy_s((link + _mstrlen(L"mailto:")), (_countof(link) - _mstrlen(L"mailto:")), templink, _TRUNCATE);
+ if (type == LINK_MAIL && wcsstr(link, L"mailto:") == NULL) {
+ wcsncpy_s(templink, link, _TRUNCATE);
+ wcsncpy_s(link, L"mailto:", _TRUNCATE);
+ wcsncpy_s((link + _mstrlen(L"mailto:")), (_countof(link) - _mstrlen(L"mailto:")), templink, _TRUNCATE);
}
// Add new Element to list:
@@ -172,9 +171,9 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart)
memset(newElement, 0, sizeof(LISTELEMENT));
newElement->direction = direction;
newElement->type = type;
- _tcsncpy_s(newElement->date, date, _TRUNCATE);
- _tcsncpy_s(newElement->time, time, _TRUNCATE);
- _tcsncpy_s(newElement->link, link, _TRUNCATE);
+ wcsncpy_s(newElement->date, date, _TRUNCATE);
+ wcsncpy_s(newElement->time, time, _TRUNCATE);
+ wcsncpy_s(newElement->link, link, _TRUNCATE);
newElement->hEvent = hEvent;
actualElement = listStart;
@@ -249,10 +248,10 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc
HWND hwndProgress = NULL;
RECT DesktopRect;
MYCOLOURSET colourSet;
- TCHAR textLine[LINK_MAX + DIR_SIZE + TIME_SIZE + TYPE_SIZE + 6];
- TCHAR searchText[320];
- TCHAR lastDate[11] = {0};
- TCHAR filter1, filter2, filter3;
+ wchar_t textLine[LINK_MAX + DIR_SIZE + TIME_SIZE + TYPE_SIZE + 6];
+ wchar_t searchText[320];
+ wchar_t lastDate[11] = {0};
+ wchar_t filter1, filter2, filter3;
size_t lineLen, listCount=0, realListCount=0, actCount=0, len, appCount = 0;
int linePos = -1;
LISTELEMENT *actualElement;
@@ -303,7 +302,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc
cf.dwMask = CFM_ITALIC | CFM_BOLD | CFM_FACE | CFM_COLOR;
cf.dwEffects = CFE_BOLD;
cf.crTextColor = colourSet.text;
- _tcscpy_s(cf.szFaceName, L"Arial");
+ wcscpy_s(cf.szFaceName, L"Arial");
SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
mir_sntprintf(searchText, L"%s '%s': %d\n\n", TranslateT("Matches for searchtext"), searchString, listCount);
@@ -314,7 +313,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc
memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_FACE | CFM_BOLD;
- _tcscpy_s(cf.szFaceName, L"Courier");
+ wcscpy_s(cf.szFaceName, L"Courier");
SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
}
@@ -325,13 +324,13 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc
linePos = GetLastLinePos(listStart);
if ((realListCount - append) == 1)
- _tcscpy_s(lastDate, actualElement->date);
+ wcscpy_s(lastDate, actualElement->date);
for(appCount = 1; appCount <= (realListCount - append); appCount++)
{
actualElement = actualElement->nextElement;
if(appCount == (realListCount - append - 1))
- _tcscpy_s(lastDate, actualElement->date);
+ wcscpy_s(lastDate, actualElement->date);
}
gtl.flags = GTL_PRECISE;
gtl.codepage = CP_ACP;
@@ -385,7 +384,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc
db_event_get(actualElement->hEvent, &dbe);
dbe.pBlob[dbe.cbBlob] = 0;
LPTSTR msg = DbGetEventTextT(&dbe, CP_ACP);
- if ( _tcsstr(msg, searchString))
+ if ( wcsstr(msg, searchString))
filter3 = 1;
mir_free(dbe.pBlob);
@@ -393,7 +392,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc
}
else filter3 = 0;
}
- else if ( _tcsstr(actualElement->link, searchString))
+ else if ( wcsstr(actualElement->link, searchString))
filter3 = 1;
}
else filter3 = 1;
@@ -415,7 +414,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_ITALIC | CFM_BOLD | CFM_FACE;
cf.dwEffects = CFE_BOLD;
- _tcscpy_s(cf.szFaceName, L"Arial");
+ wcscpy_s(cf.szFaceName, L"Arial");
SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
if ( options.showDate != 0 )
{
@@ -423,11 +422,11 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc
SendDlgItemMessage( hDlg, IDC_MAIN, EM_REPLACESEL, FALSE, (LPARAM) L"\n\n");
linePos += 3;
}
- _tcscpy_s(lastDate, actualElement->date);
+ wcscpy_s(lastDate, actualElement->date);
memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof cf;
cf.dwMask = CFM_ITALIC | CFM_BOLD | CFM_UNDERLINE | CFM_FACE;
- _tcscpy_s(cf.szFaceName, L"Courier");
+ wcscpy_s(cf.szFaceName, L"Courier");
SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
}
memset(&cf, 0, sizeof(cf));
@@ -485,7 +484,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_ITALIC | CFM_BOLD | CFM_FACE;
cf.dwEffects = CFE_BOLD;
- _tcscpy_s(cf.szFaceName, L"Arial");
+ wcscpy_s(cf.szFaceName, L"Arial");
SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
SendDlgItemMessage( hDlg, IDC_MAIN, EM_REPLACESEL, FALSE, (LPARAM)TranslateT("No messages found!\nPlease change current filter options."));
SendDlgItemMessage( hDlg, IDC_MAIN, EM_REPLACESEL, FALSE, (LPARAM)L"\n");
@@ -525,7 +524,7 @@ int WriteOptionExample(HWND hDlg, DWORD InColourSel, DWORD OutColourSel, DWORD B
memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_FACE | CFM_BOLD | CFM_ITALIC | CFM_COLOR;
- _tcscpy_s(cf.szFaceName, L"Courier");
+ wcscpy_s(cf.szFaceName, L"Courier");
cf.crTextColor = TxtColourSel;
SendDlgItemMessage( hDlg, IDC_OPTIONS_RE, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
if ( options->showLine == 1 )
@@ -537,7 +536,7 @@ int WriteOptionExample(HWND hDlg, DWORD InColourSel, DWORD OutColourSel, DWORD B
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_BOLD | CFM_FACE | CFM_COLOR;
cf.dwEffects = CFE_BOLD;
- _tcscpy_s(cf.szFaceName, L"Arial");
+ wcscpy_s(cf.szFaceName, L"Arial");
cf.crTextColor = TxtColourSel;
SendDlgItemMessage( hDlg, IDC_OPTIONS_RE, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
@@ -549,7 +548,7 @@ int WriteOptionExample(HWND hDlg, DWORD InColourSel, DWORD OutColourSel, DWORD B
memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_ITALIC | CFM_BOLD | CFM_UNDERLINE | CFM_FACE;
- _tcscpy_s(cf.szFaceName, L"Courier");
+ wcscpy_s(cf.szFaceName, L"Courier");
SendDlgItemMessage( hDlg, IDC_OPTIONS_RE, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
// incoming
@@ -557,7 +556,7 @@ int WriteOptionExample(HWND hDlg, DWORD InColourSel, DWORD OutColourSel, DWORD B
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_COLOR | CFM_FACE;
cf.crTextColor = InColourSel;
- _tcscpy_s(cf.szFaceName, L"Courier");
+ wcscpy_s(cf.szFaceName, L"Courier");
SendDlgItemMessage(hDlg, IDC_OPTIONS_RE, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf );
if ( options->showDirection == 1 )
@@ -580,7 +579,7 @@ int WriteOptionExample(HWND hDlg, DWORD InColourSel, DWORD OutColourSel, DWORD B
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_COLOR | CFM_FACE;
cf.crTextColor = OutColourSel;
- _tcscpy_s(cf.szFaceName, L"Courier");
+ wcscpy_s(cf.szFaceName, L"Courier");
SendDlgItemMessage(hDlg, IDC_OPTIONS_RE, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
@@ -718,13 +717,13 @@ Little helper function to draw a horizontal line
*/
void DrawLine(HWND hDlg, size_t lineLen)
{
- TCHAR line[LINK_MAX + 18];
+ wchar_t line[LINK_MAX + 18];
size_t i;
for (i=0; (i<lineLen+18)&&(i<LINK_MAX+18); i++ )
{
- line[i] = _T('_');
+ line[i] = '_';
}
- line[lineLen+18] = _T('\0');
+ line[lineLen+18] = '\0';
SendDlgItemMessage( hDlg, IDC_MAIN, EM_REPLACESEL, FALSE, (LPARAM)line);
SendDlgItemMessage( hDlg, IDC_MAIN, EM_REPLACESEL, FALSE, (LPARAM)L"\n");
return;
@@ -775,7 +774,7 @@ void GetListInfo(BYTE params, LISTELEMENT *listStart, LPCTSTR searchString, siz
dbe.pBlob = (PBYTE)mir_alloc(dbe.cbBlob+1);
db_event_get(actualElement->hEvent, &dbe);
dbe.pBlob[dbe.cbBlob] = 0;
- if ( _tcsstr((LPTSTR)dbe.pBlob, searchString))
+ if ( wcsstr((LPTSTR)dbe.pBlob, searchString))
filter3 = 1;
mir_free(dbe.pBlob);
@@ -785,7 +784,7 @@ void GetListInfo(BYTE params, LISTELEMENT *listStart, LPCTSTR searchString, siz
}
else
{
- if(_tcsstr(actualElement->link, searchString))
+ if(wcsstr(actualElement->link, searchString))
filter3 = 1;
}
}
@@ -1238,15 +1237,15 @@ BOOL SaveEditAsStream( HWND hDlg )
LONG lOut;
OPENFILENAME ofn;
HANDLE hFile;
- TCHAR szFilename[MAX_PATH];
+ wchar_t szFilename[MAX_PATH];
// Initialize filename field
- _tcscpy_s(szFilename, L"*.rtf");
+ wcscpy_s(szFilename, L"*.rtf");
// Fill in OPENFILENAME struct
memset(&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hDlg;
- TCHAR temp[MAX_PATH];
+ wchar_t temp[MAX_PATH];
mir_sntprintf(temp, L"%s (*.rtf)%c*.rtf%c%s (*.*)%c*.*%c%c", TranslateT("RTF file"), 0, 0, TranslateT("All files"), 0, 0, 0);
ofn.lpstrFilter = temp;
ofn.lpstrFile = szFilename;
diff --git a/plugins/HistoryLinkListPlus/src/stdafx.h b/plugins/HistoryLinkListPlus/src/stdafx.h
index 37859b91b2..e0ff6adecd 100644
--- a/plugins/HistoryLinkListPlus/src/stdafx.h
+++ b/plugins/HistoryLinkListPlus/src/stdafx.h
@@ -76,9 +76,9 @@
struct LISTELEMENT {
BYTE direction;
BYTE type;
- TCHAR date[DATE_SIZE];
- TCHAR time[TIME_SIZE];
- TCHAR link[LINK_MAX];
+ wchar_t date[DATE_SIZE];
+ wchar_t time[TIME_SIZE];
+ wchar_t link[LINK_MAX];
MEVENT hEvent;
int linePos;
struct LISTELEMENT *nextElement;
diff --git a/plugins/HistoryStats/src/_consts.h b/plugins/HistoryStats/src/_consts.h
index f1e8c8fa47..cd06f27fe3 100644
--- a/plugins/HistoryStats/src/_consts.h
+++ b/plugins/HistoryStats/src/_consts.h
@@ -4,11 +4,9 @@
#include "stdafx.h"
#if defined(HISTORYSTATS_CONST_DEFINE)
-#define CONST_T(nam, txt) extern const TCHAR* nam = _T(txt);
#define CONST_A(nam, txt) extern const char* nam = txt;
#define CONST_W(nam, txt) extern const WCHAR* nam = L#txt;
#else
-#define CONST_T(nam, txt) extern const TCHAR* nam;
#define CONST_A(nam, txt) extern const char* nam;
#define CONST_W(nam, txt) extern const WCHAR* nam;
#endif
@@ -109,72 +107,72 @@ namespace con
CONST_A(SettGroup , "Group" )
// column tags
- CONST_T(ColChatDuration , "chatduration" )
- CONST_T(ColEvents , "events" )
- CONST_T(ColGroup , "group" )
- CONST_T(ColInOut , "inouttext" )
- CONST_T(ColInOutGraph , "inout" )
- CONST_T(ColNick , "nick" )
- CONST_T(ColProtocol , "protocol" )
- CONST_T(ColRank , "rank" )
- CONST_T(ColSplit , "split" )
- CONST_T(ColSplitTimeline , "splittimeline" )
- CONST_T(ColTimeline , "timeline" )
- CONST_T(ColWordCount , "wordcount" )
- CONST_T(ColWords , "commonwords" )
+ CONST_W(ColChatDuration , "chatduration" )
+ CONST_W(ColEvents , "events" )
+ CONST_W(ColGroup , "group" )
+ CONST_W(ColInOut , "inouttext" )
+ CONST_W(ColInOutGraph , "inout" )
+ CONST_W(ColNick , "nick" )
+ CONST_W(ColProtocol , "protocol" )
+ CONST_W(ColRank , "rank" )
+ CONST_W(ColSplit , "split" )
+ CONST_W(ColSplitTimeline , "splittimeline" )
+ CONST_W(ColTimeline , "timeline" )
+ CONST_W(ColWordCount , "wordcount" )
+ CONST_W(ColWords , "commonwords" )
// suffix for column-specific settings
- CONST_T(SuffixData , "/data" )
+ CONST_W(SuffixData , "/data" )
// suffix for shared column data (filter words)
- CONST_T(SuffixWords , "/words" )
+ CONST_W(SuffixWords , "/words" )
// keys for common column settings
- CONST_T(KeyGUID , "guid" )
- CONST_T(KeyEnabled , "enabled" )
- CONST_T(KeyTitle , "title" )
+ CONST_W(KeyGUID , "guid" )
+ CONST_W(KeyEnabled , "enabled" )
+ CONST_W(KeyTitle , "title" )
// keys for column-specific settings
- CONST_T(KeyAbsolute , "absolute" ) // InOut, InOutGraph
- CONST_T(KeyAbsTime , "abs_time" ) // InOut, InOutGraph
- CONST_T(KeyBlocks , "blocks" ) // Split, SplitTimeline
- CONST_T(KeyBlockUnit , "block_unit" ) // Split, SplitTimeline
- CONST_T(KeyContactCount , "contact_count" ) // Nick
- CONST_T(KeyCustomGroup , "custom_group" ) // SplitTimeline
- CONST_T(KeyDays , "days" ) // Timeline
- CONST_T(KeyDetail , "detail" ) // ChatDuration, InOutGraph, Nick, Split, Timeline, WordCount, Words
- CONST_T(KeyDetailInOut , "detail_inout" ) // Words
- CONST_T(KeyDetailInvert , "detail_invert" ) // InOutGraph
- CONST_T(KeyDetailPercent , "detail_percent" ) // InOutGraph
- CONST_T(KeyDOWGroup , "dow_group" ) // SplitTimeline
- CONST_T(KeyFilterLinks , "filter_links" ) // [Base]Words
- CONST_T(KeyFilterWords , "filter_words" ) // [Base]Words
- CONST_T(KeyGraph , "graph" ) // ChatDuration
- CONST_T(KeyGraphAlign , "graph_align" ) // Split, SplitTimeline
- CONST_T(KeyGraphPercent , "graph_percent" ) // InOutGraph
- CONST_T(KeyHODGroup , "hod_group" ) // SplitTimeline
- CONST_T(KeyIgnoreOld , "ignore_old" ) // Timeline
- CONST_T(KeyInOutColor , "in_out_color" ) // Words
- CONST_T(KeyMaxLength , "max_length" ) // [Base]Words
- CONST_T(KeyMinLength , "min_length" ) // [Base]Words
- CONST_T(KeyNum , "num" ) // Words, **keys for common column settings**
- CONST_T(KeyOffset , "offset" ) // Words
- CONST_T(KeyShowSum , "show_sum" ) // InOutGraph
- CONST_T(KeySource , "source" ) // [Base]Words, Events, InOut, InOutGraph, Split, SplitTimeline, Timeline
- CONST_T(KeySourceType , "source_type" ) // Split, SplitTimeline, Timeline
- CONST_T(KeyTopPerColumn , "top_per_column" ) // SplitTimeline
- CONST_T(KeyUnitsPerBlock , "units_per_block" ) // Split, SplitTimeline
- CONST_T(KeyVisMode , "vis_mode" ) // ChatDuration, Split, SplitTimeline, WordCount, Words
+ CONST_W(KeyAbsolute , "absolute" ) // InOut, InOutGraph
+ CONST_W(KeyAbsTime , "abs_time" ) // InOut, InOutGraph
+ CONST_W(KeyBlocks , "blocks" ) // Split, SplitTimeline
+ CONST_W(KeyBlockUnit , "block_unit" ) // Split, SplitTimeline
+ CONST_W(KeyContactCount , "contact_count" ) // Nick
+ CONST_W(KeyCustomGroup , "custom_group" ) // SplitTimeline
+ CONST_W(KeyDays , "days" ) // Timeline
+ CONST_W(KeyDetail , "detail" ) // ChatDuration, InOutGraph, Nick, Split, Timeline, WordCount, Words
+ CONST_W(KeyDetailInOut , "detail_inout" ) // Words
+ CONST_W(KeyDetailInvert , "detail_invert" ) // InOutGraph
+ CONST_W(KeyDetailPercent , "detail_percent" ) // InOutGraph
+ CONST_W(KeyDOWGroup , "dow_group" ) // SplitTimeline
+ CONST_W(KeyFilterLinks , "filter_links" ) // [Base]Words
+ CONST_W(KeyFilterWords , "filter_words" ) // [Base]Words
+ CONST_W(KeyGraph , "graph" ) // ChatDuration
+ CONST_W(KeyGraphAlign , "graph_align" ) // Split, SplitTimeline
+ CONST_W(KeyGraphPercent , "graph_percent" ) // InOutGraph
+ CONST_W(KeyHODGroup , "hod_group" ) // SplitTimeline
+ CONST_W(KeyIgnoreOld , "ignore_old" ) // Timeline
+ CONST_W(KeyInOutColor , "in_out_color" ) // Words
+ CONST_W(KeyMaxLength , "max_length" ) // [Base]Words
+ CONST_W(KeyMinLength , "min_length" ) // [Base]Words
+ CONST_W(KeyNum , "num" ) // Words, **keys for common column settings**
+ CONST_W(KeyOffset , "offset" ) // Words
+ CONST_W(KeyShowSum , "show_sum" ) // InOutGraph
+ CONST_W(KeySource , "source" ) // [Base]Words, Events, InOut, InOutGraph, Split, SplitTimeline, Timeline
+ CONST_W(KeySourceType , "source_type" ) // Split, SplitTimeline, Timeline
+ CONST_W(KeyTopPerColumn , "top_per_column" ) // SplitTimeline
+ CONST_W(KeyUnitsPerBlock , "units_per_block" ) // Split, SplitTimeline
+ CONST_W(KeyVisMode , "vis_mode" ) // ChatDuration, Split, SplitTimeline, WordCount, Words
// keeys for shared column data (filter words)
- CONST_T(KeyID , "id" )
- CONST_T(KeyName , "name" )
- CONST_T(KeyMode , "mode" )
- CONST_T(KeyNumWords , "num_words" )
+ CONST_W(KeyID , "id" )
+ CONST_W(KeyName , "name" )
+ CONST_W(KeyMode , "mode" )
+ CONST_W(KeyNumWords , "num_words" )
// keys for sort settings
- CONST_T(KeyAsc , "asc" )
- CONST_T(KeyBy , "by" )
+ CONST_W(KeyAsc , "asc" )
+ CONST_W(KeyBy , "by" )
// miranda services created by historystats
CONST_A(SvcConfigure , "HistoryStats/Configure" )
@@ -206,7 +204,7 @@ namespace con
const COLORREF ColorTotals = RGB(0xDF, 0xDF, 0xDF);
}
-#undef CONST_T
+#undef CONST_W
#undef CONST_A
#undef CONST_W
diff --git a/plugins/HistoryStats/src/bandctrl.cpp b/plugins/HistoryStats/src/bandctrl.cpp
index 5569efbf3c..2240b1f55c 100644
--- a/plugins/HistoryStats/src/bandctrl.cpp
+++ b/plugins/HistoryStats/src/bandctrl.cpp
@@ -10,7 +10,7 @@ void BandCtrl::setLayout(int nLayout)
SendMessage(m_hBandWnd, BCM_SETLAYOUT, nLayout, 0);
}
-HANDLE BandCtrl::addButton(DWORD dwFlags, HICON hIcon, INT_PTR dwData, const TCHAR *szTooltip, const TCHAR *szText)
+HANDLE BandCtrl::addButton(DWORD dwFlags, HICON hIcon, INT_PTR dwData, const wchar_t *szTooltip, const wchar_t *szText)
{
BCBUTTON bcb;
diff --git a/plugins/HistoryStats/src/bandctrl.h b/plugins/HistoryStats/src/bandctrl.h
index 77f1b7d023..4917545c87 100644
--- a/plugins/HistoryStats/src/bandctrl.h
+++ b/plugins/HistoryStats/src/bandctrl.h
@@ -25,7 +25,7 @@ public:
public:
void setLayout(int nLayout);
- HANDLE addButton(DWORD dwFlags, HICON hIcon, INT_PTR dwData, const TCHAR* szTooltip = NULL, const TCHAR* szText = NULL);
+ HANDLE addButton(DWORD dwFlags, HICON hIcon, INT_PTR dwData, const wchar_t* szTooltip = NULL, const wchar_t* szText = NULL);
bool isButtonChecked(HANDLE hButton);
void checkButton(HANDLE hButton, bool bCheck);
DWORD getButtonData(HANDLE hButton);
diff --git a/plugins/HistoryStats/src/bandctrldefs.h b/plugins/HistoryStats/src/bandctrldefs.h
index a48ac238e8..1be373dcfa 100644
--- a/plugins/HistoryStats/src/bandctrldefs.h
+++ b/plugins/HistoryStats/src/bandctrldefs.h
@@ -44,8 +44,8 @@ public:
struct BCBUTTON {
DWORD dwFlags;
HICON hIcon;
- const TCHAR *m_szText;
- const TCHAR *m_szTooltip;
+ const wchar_t *m_szText;
+ const wchar_t *m_szTooltip;
INT_PTR dwData;
};
diff --git a/plugins/HistoryStats/src/bandctrlimpl.cpp b/plugins/HistoryStats/src/bandctrlimpl.cpp
index 76e8b47dbe..d3ed8a4f65 100644
--- a/plugins/HistoryStats/src/bandctrlimpl.cpp
+++ b/plugins/HistoryStats/src/bandctrlimpl.cpp
@@ -8,7 +8,7 @@
* BandCtrlImpl
*/
-const TCHAR* BandCtrlImpl::m_ClassName = L"HistoryStatsBand";
+const wchar_t* BandCtrlImpl::m_ClassName = L"HistoryStatsBand";
const int BandCtrlImpl::m_PollId = 100;
const int BandCtrlImpl::m_PollDelay = 50;
@@ -604,7 +604,7 @@ void BandCtrlImpl::recalcButtonRects()
m_Items[i].uTTId, // uId
m_Items[i].rItem, // rect
NULL, // hInstance
- const_cast<TCHAR*>(m_Items[i].tooltip.c_str()), // lpszText
+ const_cast<wchar_t*>(m_Items[i].tooltip.c_str()), // lpszText
};
SendMessage(m_hTooltip, TTM_SETTOOLINFO, 0, reinterpret_cast<LPARAM>(&ti));
@@ -625,7 +625,7 @@ void BandCtrlImpl::recalcButtonRects()
m_hTooltip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, L"", WS_POPUP, 0, 0, 0, 0, NULL, NULL, g_hInst, NULL);
TOOLINFO ti = { sizeof(TOOLINFO), TTF_SUBCLASS, m_hWnd, UINT_PTR(i+1), m_Items[i].rItem, NULL,
- const_cast<TCHAR*>(m_Items[i].tooltip.c_str()), // lpszText
+ const_cast<wchar_t*>(m_Items[i].tooltip.c_str()), // lpszText
};
if (SendMessage(m_hTooltip, TTM_ADDTOOL, 0, reinterpret_cast<LPARAM>(&ti)))
diff --git a/plugins/HistoryStats/src/bandctrlimpl.h b/plugins/HistoryStats/src/bandctrlimpl.h
index a9df939a00..7eef92ba68 100644
--- a/plugins/HistoryStats/src/bandctrlimpl.h
+++ b/plugins/HistoryStats/src/bandctrlimpl.h
@@ -31,7 +31,7 @@ private:
};
private:
- static const TCHAR* m_ClassName;
+ static const wchar_t* m_ClassName;
static const int m_PollId;
static const int m_PollDelay;
diff --git a/plugins/HistoryStats/src/canvas.cpp b/plugins/HistoryStats/src/canvas.cpp
index be0cd3978c..118534209d 100644
--- a/plugins/HistoryStats/src/canvas.cpp
+++ b/plugins/HistoryStats/src/canvas.cpp
@@ -131,13 +131,13 @@ bool Canvas::getDigest(Digest& digest)
return true;
}
-bool Canvas::writePNG(const TCHAR* szFileName)
+bool Canvas::writePNG(const wchar_t* szFileName)
{
IMGSRVC_INFO img = { 0 };
img.cbSize = sizeof(img);
img.dwMask = IMGI_HBITMAP;
img.hbm = m_hBmp;
img.fif = FIF_PNG;
- img.tszName = (TCHAR*)szFileName;
+ img.tszName = (wchar_t*)szFileName;
return CallService(MS_IMG_SAVE, (WPARAM)&img, IMGL_TCHAR) == 0;
}
diff --git a/plugins/HistoryStats/src/canvas.h b/plugins/HistoryStats/src/canvas.h
index a5b7f06519..99213316f2 100644
--- a/plugins/HistoryStats/src/canvas.h
+++ b/plugins/HistoryStats/src/canvas.h
@@ -48,7 +48,7 @@ public:
void endDraw();
bool getDigest(Digest& digest);
- bool writePNG(const TCHAR* szFileName);
+ bool writePNG(const wchar_t* szFileName);
};
#endif // HISTORYSTATS_GUARD_CANVAS_H
diff --git a/plugins/HistoryStats/src/column.h b/plugins/HistoryStats/src/column.h
index 1c1aaca70e..bb03bc1291 100644
--- a/plugins/HistoryStats/src/column.h
+++ b/plugins/HistoryStats/src/column.h
@@ -38,8 +38,8 @@ private:
{
public:
ext::string m_UID;
- const TCHAR* m_Title;
- const TCHAR* m_Description;
+ const wchar_t* m_Title;
+ const wchar_t* m_Description;
FactoryBase* m_pFactory;
};
@@ -170,9 +170,9 @@ public:
/*
* public interface for virtual functions
*/
- const TCHAR* getUID() const { return impl_getUID(); }
- const TCHAR* getTitle() const { return impl_getTitle(); }
- const TCHAR* getDescription() const { return impl_getDescription(); }
+ const wchar_t* getUID() const { return impl_getUID(); }
+ const wchar_t* getTitle() const { return impl_getTitle(); }
+ const wchar_t* getDescription() const { return impl_getDescription(); }
void copyConfig(const Column* pSource) { impl_copyConfig(pSource); }
int getFeatures() const { return impl_getFeatures(); }
void configRead(const SettingsTree& settings) { impl_configRead(settings); }
@@ -206,19 +206,19 @@ protected:
* Returns a unique ID for column.
* [virtual/abstract]
*/
- virtual const TCHAR* impl_getUID() const = 0;
+ virtual const wchar_t* impl_getUID() const = 0;
/*
* Returns the title for the column.
* [virtual/abstract]
*/
- virtual const TCHAR* impl_getTitle() const = 0;
+ virtual const wchar_t* impl_getTitle() const = 0;
/*
* Returns the description for the column.
* [virtual/abstract]
*/
- virtual const TCHAR* impl_getDescription() const = 0;
+ virtual const wchar_t* impl_getDescription() const = 0;
/*
* Creates a exact copy of the column.
diff --git a/plugins/HistoryStats/src/column_chatduration.cpp b/plugins/HistoryStats/src/column_chatduration.cpp
index 4954f693b8..762e750d1b 100644
--- a/plugins/HistoryStats/src/column_chatduration.cpp
+++ b/plugins/HistoryStats/src/column_chatduration.cpp
@@ -79,11 +79,11 @@ Column::StyleList ColChatDuration::impl_outputGetAdditionalStyles(IDProvider& id
void ColChatDuration::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const
{
- static const TCHAR* szVisModeDesc[] = {
- LPGENT("Minimum chat duration"),
- LPGENT("Average chat duration"),
- LPGENT("Maximum chat duration"),
- LPGENT("Total chat duration"),
+ static const wchar_t* szVisModeDesc[] = {
+ LPGENW("Minimum chat duration"),
+ LPGENW("Average chat duration"),
+ LPGENW("Maximum chat duration"),
+ LPGENW("Total chat duration"),
};
if (row == 1)
@@ -162,11 +162,11 @@ void ColChatDuration::impl_outputRenderRow(ext::ostream& tos, const Contact& con
// output tooltip
if (m_bDetail)
{
- static const TCHAR* szPrefixes[] = {
- LPGENT("[Min] #{amount}"),
- LPGENT("[Avg] #{amount}"),
- LPGENT("[Max] #{amount}"),
- LPGENT("[Sum] #{amount}"),
+ static const wchar_t* szPrefixes[] = {
+ LPGENW("[Min] #{amount}"),
+ LPGENW("[Avg] #{amount}"),
+ LPGENW("[Max] #{amount}"),
+ LPGENW("[Sum] #{amount}"),
};
ext::string strTooltip;
diff --git a/plugins/HistoryStats/src/column_chatduration.h b/plugins/HistoryStats/src/column_chatduration.h
index b3f325692e..95e8e237ce 100644
--- a/plugins/HistoryStats/src/column_chatduration.h
+++ b/plugins/HistoryStats/src/column_chatduration.h
@@ -27,9 +27,9 @@ public:
explicit ColChatDuration();
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColChatDuration; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("Chat duration"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding the amount of time you have chatted with the given contact."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColChatDuration; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("Chat duration"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding the amount of time you have chatted with the given contact."); }
virtual void impl_copyConfig(const Column* pSource);
virtual int impl_getFeatures() const { return cfHasConfig; }
virtual void impl_configRead(const SettingsTree& settings);
diff --git a/plugins/HistoryStats/src/column_events.cpp b/plugins/HistoryStats/src/column_events.cpp
index 5b2c859d8c..1ecea2f2d5 100644
--- a/plugins/HistoryStats/src/column_events.cpp
+++ b/plugins/HistoryStats/src/column_events.cpp
@@ -31,13 +31,13 @@ void ColEvents::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGroup)
{
m_hSource = Opt.insertCombo(hGroup, TranslateT("Events to count"));
- static const TCHAR* sourceTexts[] = {
- LPGENT("URLs (incoming)"),
- LPGENT("URLs (outgoing)"),
- LPGENT("URLs (all)"),
- LPGENT("Files (incoming)"),
- LPGENT("Files (outgoing)"),
- LPGENT("Files (all)"),
+ static const wchar_t* sourceTexts[] = {
+ LPGENW("URLs (incoming)"),
+ LPGENW("URLs (outgoing)"),
+ LPGENW("URLs (all)"),
+ LPGENW("Files (incoming)"),
+ LPGENW("Files (outgoing)"),
+ LPGENW("Files (all)"),
};
array_each_(i, sourceTexts)
@@ -55,18 +55,18 @@ void ColEvents::impl_configFromUI(OptionsCtrl& Opt)
void ColEvents::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const
{
- static const TCHAR* szShortDesc[] = {
- LPGENT("URLs"),
- LPGENT("Files"),
+ static const wchar_t* szShortDesc[] = {
+ LPGENW("URLs"),
+ LPGENW("Files"),
};
- static const TCHAR* szSourceDesc[] = {
- LPGENT("Incoming URLs"),
- LPGENT("Outgoing URLs"),
- LPGENT("URLs"),
- LPGENT("Incoming files"),
- LPGENT("Outgoing files"),
- LPGENT("Files"),
+ static const wchar_t* szSourceDesc[] = {
+ LPGENW("Incoming URLs"),
+ LPGENW("Outgoing URLs"),
+ LPGENW("URLs"),
+ LPGENW("Incoming files"),
+ LPGENW("Outgoing files"),
+ LPGENW("Files"),
};
if (row == 1)
diff --git a/plugins/HistoryStats/src/column_events.h b/plugins/HistoryStats/src/column_events.h
index 09a045c92c..5fd9d52dff 100644
--- a/plugins/HistoryStats/src/column_events.h
+++ b/plugins/HistoryStats/src/column_events.h
@@ -19,9 +19,9 @@ public:
explicit ColEvents();
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColEvents; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("Events"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding event counts for incoming, outgoing or total number of files or URLs."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColEvents; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("Events"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding event counts for incoming, outgoing or total number of files or URLs."); }
virtual void impl_copyConfig(const Column* pSource);
virtual int impl_getFeatures() const { return cfHasConfig; }
virtual void impl_configRead(const SettingsTree& settings);
diff --git a/plugins/HistoryStats/src/column_group.h b/plugins/HistoryStats/src/column_group.h
index caf7061500..4683bdb47e 100644
--- a/plugins/HistoryStats/src/column_group.h
+++ b/plugins/HistoryStats/src/column_group.h
@@ -11,9 +11,9 @@ class ColGroup
: public Column
{
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColGroup; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("Group"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding the contact list's group name the contact is in."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColGroup; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("Group"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding the contact list's group name the contact is in."); }
virtual int impl_getFeatures() const { return 0; }
virtual int impl_configGetRestrictions(ext::string*) const { return crHTMLFull; }
virtual void impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const;
diff --git a/plugins/HistoryStats/src/column_inout.cpp b/plugins/HistoryStats/src/column_inout.cpp
index 6bdc88909c..67a8d7d35f 100644
--- a/plugins/HistoryStats/src/column_inout.cpp
+++ b/plugins/HistoryStats/src/column_inout.cpp
@@ -46,16 +46,16 @@ void ColInOut::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGroup)
Opt.insertRadio(m_hAbsolute, m_hAbsTime, TranslateT("Units per week"));
Opt.insertRadio(m_hAbsolute, m_hAbsTime, TranslateT("Units per month (30 days)"));
- static const TCHAR* sourceTexts[] = {
- LPGENT("Characters (incoming)"),
- LPGENT("Characters (outgoing)"),
- LPGENT("Characters (all)"),
- LPGENT("Messages (incoming)"),
- LPGENT("Messages (outgoing)"),
- LPGENT("Messages (all)"),
- LPGENT("Chats (incoming)"),
- LPGENT("Chats (outgoing)"),
- LPGENT("Chats (all)"),
+ static const wchar_t* sourceTexts[] = {
+ LPGENW("Characters (incoming)"),
+ LPGENW("Characters (outgoing)"),
+ LPGENW("Characters (all)"),
+ LPGENW("Messages (incoming)"),
+ LPGENW("Messages (outgoing)"),
+ LPGENW("Messages (all)"),
+ LPGENW("Chats (incoming)"),
+ LPGENW("Chats (outgoing)"),
+ LPGENW("Chats (all)"),
};
array_each_(i, sourceTexts)
@@ -77,28 +77,28 @@ void ColInOut::impl_configFromUI(OptionsCtrl& Opt)
void ColInOut::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const
{
- static const TCHAR* szShortDesc[] = {
- LPGENT("Characters"),
- LPGENT("Messages"),
- LPGENT("Chats")
+ static const wchar_t* szShortDesc[] = {
+ LPGENW("Characters"),
+ LPGENW("Messages"),
+ LPGENW("Chats")
};
- static const TCHAR* szSourceDesc[] = {
- LPGENT("Incoming characters"),
- LPGENT("Outgoing characters"),
- LPGENT("Characters"),
- LPGENT("Incoming messages"),
- LPGENT("Outgoing messages"),
- LPGENT("Messages"),
- LPGENT("Incoming chats"),
- LPGENT("Outgoing chats"),
- LPGENT("Chats")
+ static const wchar_t* szSourceDesc[] = {
+ LPGENW("Incoming characters"),
+ LPGENW("Outgoing characters"),
+ LPGENW("Characters"),
+ LPGENW("Incoming messages"),
+ LPGENW("Outgoing messages"),
+ LPGENW("Messages"),
+ LPGENW("Incoming chats"),
+ LPGENW("Outgoing chats"),
+ LPGENW("Chats")
};
- static const TCHAR* szUnitDesc[] = {
- LPGENT("day"),
- LPGENT("week"),
- LPGENT("month"),
+ static const wchar_t* szUnitDesc[] = {
+ LPGENW("day"),
+ LPGENW("week"),
+ LPGENW("month"),
};
if (row == 1)
diff --git a/plugins/HistoryStats/src/column_inout.h b/plugins/HistoryStats/src/column_inout.h
index 1a5ff19d39..c1ece71bff 100644
--- a/plugins/HistoryStats/src/column_inout.h
+++ b/plugins/HistoryStats/src/column_inout.h
@@ -23,9 +23,9 @@ public:
explicit ColInOut();
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColInOut; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("In/out"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding counts for incoming, outgoing or total characters, messages or chats. This column can display absolute and average values."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColInOut; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("In/out"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding counts for incoming, outgoing or total characters, messages or chats. This column can display absolute and average values."); }
virtual void impl_copyConfig(const Column* pSource);
virtual int impl_getFeatures() const { return cfHasConfig; }
virtual void impl_configRead(const SettingsTree& settings);
diff --git a/plugins/HistoryStats/src/column_inoutgraph.cpp b/plugins/HistoryStats/src/column_inoutgraph.cpp
index be00a85cb6..288080c6fa 100644
--- a/plugins/HistoryStats/src/column_inoutgraph.cpp
+++ b/plugins/HistoryStats/src/column_inoutgraph.cpp
@@ -132,16 +132,16 @@ SIZE ColInOutGraph::impl_outputMeasureHeader() const
void ColInOutGraph::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const
{
- static const TCHAR* szSourceDesc[] = {
- LPGENT("Characters"),
- LPGENT("Messages"),
- LPGENT("Chats")
+ static const wchar_t* szSourceDesc[] = {
+ LPGENW("Characters"),
+ LPGENW("Messages"),
+ LPGENW("Chats")
};
- static const TCHAR* szSourceUnit[] = {
- LPGENT("day"),
- LPGENT("week"),
- LPGENT("month"),
+ static const wchar_t* szSourceUnit[] = {
+ LPGENW("day"),
+ LPGENW("week"),
+ LPGENW("month"),
};
if (row == 1)
diff --git a/plugins/HistoryStats/src/column_inoutgraph.h b/plugins/HistoryStats/src/column_inoutgraph.h
index 67089c260b..6b08170ff4 100644
--- a/plugins/HistoryStats/src/column_inoutgraph.h
+++ b/plugins/HistoryStats/src/column_inoutgraph.h
@@ -35,9 +35,9 @@ public:
ColInOutGraph();
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColInOutGraph; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("In/out graph"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding in/out bar graphs for characters, messages or chats."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColInOutGraph; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("In/out graph"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding in/out bar graphs for characters, messages or chats."); }
virtual void impl_copyConfig(const Column* pSource);
virtual int impl_getFeatures() const { return cfHasConfig; }
virtual void impl_configRead(const SettingsTree& settings);
diff --git a/plugins/HistoryStats/src/column_nick.h b/plugins/HistoryStats/src/column_nick.h
index 6701aa1976..b11959838e 100644
--- a/plugins/HistoryStats/src/column_nick.h
+++ b/plugins/HistoryStats/src/column_nick.h
@@ -21,9 +21,9 @@ public:
explicit ColNick();
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColNick; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("Nick"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding the contact's nick and first/last message time if selected."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColNick; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("Nick"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding the contact's nick and first/last message time if selected."); }
virtual void impl_copyConfig(const Column* pSource);
virtual int impl_getFeatures() const { return cfHasConfig; }
virtual void impl_configRead(const SettingsTree& settings);
diff --git a/plugins/HistoryStats/src/column_protocol.h b/plugins/HistoryStats/src/column_protocol.h
index 611b4fbc7a..1fc303e91f 100644
--- a/plugins/HistoryStats/src/column_protocol.h
+++ b/plugins/HistoryStats/src/column_protocol.h
@@ -11,9 +11,9 @@ class ColProtocol
: public Column
{
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColProtocol; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("Protocol"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding the contact's protocol."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColProtocol; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("Protocol"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding the contact's protocol."); }
virtual int impl_getFeatures() const { return 0; }
virtual int impl_configGetRestrictions(ext::string*) const { return crHTMLFull; }
virtual void impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const;
diff --git a/plugins/HistoryStats/src/column_rank.h b/plugins/HistoryStats/src/column_rank.h
index b0c152db84..fddadbaae7 100644
--- a/plugins/HistoryStats/src/column_rank.h
+++ b/plugins/HistoryStats/src/column_rank.h
@@ -14,9 +14,9 @@ private:
int m_nNextRank;
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColRank; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("Rank"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding the contact's placing according to your sorting criteria."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColRank; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("Rank"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding the contact's placing according to your sorting criteria."); }
virtual int impl_getFeatures() const { return 0; }
virtual int impl_configGetRestrictions(ext::string*) const { return crHTMLFull; }
virtual void impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const;
diff --git a/plugins/HistoryStats/src/column_split.cpp b/plugins/HistoryStats/src/column_split.cpp
index 0b3be3ca4f..c0b2ce3990 100644
--- a/plugins/HistoryStats/src/column_split.cpp
+++ b/plugins/HistoryStats/src/column_split.cpp
@@ -73,16 +73,16 @@ void ColSplit::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGroup)
Opt.insertRadio(hTemp, m_hGraphAlign, TranslateT("Align on week boundary"));
m_hDetail = Opt.insertCheck(hGroup, TranslateT("Details for every bar (tooltip)"));
- static const TCHAR* sourceTexts[] = {
- LPGENT("Characters (incoming)"),
- LPGENT("Characters (outgoing)"),
- LPGENT("Characters (all)"),
- LPGENT("Messages (incoming)"),
- LPGENT("Messages (outgoing)"),
- LPGENT("Messages (all)"),
- LPGENT("Chats (incoming)"),
- LPGENT("Chats (outgoing)"),
- LPGENT("Chats (all)"),
+ static const wchar_t* sourceTexts[] = {
+ LPGENW("Characters (incoming)"),
+ LPGENW("Characters (outgoing)"),
+ LPGENW("Characters (all)"),
+ LPGENW("Messages (incoming)"),
+ LPGENW("Messages (outgoing)"),
+ LPGENW("Messages (all)"),
+ LPGENW("Chats (incoming)"),
+ LPGENW("Chats (outgoing)"),
+ LPGENW("Chats (all)"),
};
array_each_(i, sourceTexts)
@@ -90,10 +90,10 @@ void ColSplit::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGroup)
Opt.addComboItem(m_hSource, TranslateTS(sourceTexts[i]));
}
- static const TCHAR* unitTexts[] = {
- LPGENT("Hours"),
- LPGENT("Days"),
- LPGENT("Weeks"),
+ static const wchar_t* unitTexts[] = {
+ LPGENW("Hours"),
+ LPGENW("Days"),
+ LPGENW("Weeks"),
};
array_each_(i, unitTexts)
@@ -263,22 +263,22 @@ Column::StyleList ColSplit::impl_outputGetAdditionalStyles(IDProvider& idp)
void ColSplit::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const
{
- static const TCHAR* szTypeDesc[] = {
- LPGENT("Hours of day"),
- LPGENT("Days of week"),
- LPGENT("\"Split\""),
+ static const wchar_t* szTypeDesc[] = {
+ LPGENW("Hours of day"),
+ LPGENW("Days of week"),
+ LPGENW("\"Split\""),
};
- static const TCHAR* szSourceDesc[] = {
- LPGENT("incoming characters"),
- LPGENT("outgoing characters"),
- LPGENT("all characters"),
- LPGENT("incoming messages"),
- LPGENT("outgoing messages"),
- LPGENT("all messages"),
- LPGENT("incoming chats"),
- LPGENT("outgoing chats"),
- LPGENT("all chats"),
+ static const wchar_t* szSourceDesc[] = {
+ LPGENW("incoming characters"),
+ LPGENW("outgoing characters"),
+ LPGENW("all characters"),
+ LPGENW("incoming messages"),
+ LPGENW("outgoing messages"),
+ LPGENW("all messages"),
+ LPGENW("incoming chats"),
+ LPGENW("outgoing chats"),
+ LPGENW("all chats"),
};
if (row == 1)
@@ -344,14 +344,14 @@ void ColSplit::impl_outputRenderRow(ext::ostream& tos, const Contact& contact, D
{
SplitParams params = getParams();
- static const TCHAR* szWDayName[] = {
- LPGENT("wday3:Mon"),
- LPGENT("wday3:Tue"),
- LPGENT("wday3:Wed"),
- LPGENT("wday3:Thu"),
- LPGENT("wday3:Fri"),
- LPGENT("wday3:Sat"),
- LPGENT("wday3:Sun")
+ static const wchar_t* szWDayName[] = {
+ LPGENW("wday3:Mon"),
+ LPGENW("wday3:Tue"),
+ LPGENW("wday3:Wed"),
+ LPGENW("wday3:Thu"),
+ LPGENW("wday3:Fri"),
+ LPGENW("wday3:Sat"),
+ LPGENW("wday3:Sun")
};
const int* pData = reinterpret_cast<const int*>(contact.getSlot(contactDataSlotGet()));
diff --git a/plugins/HistoryStats/src/column_split.h b/plugins/HistoryStats/src/column_split.h
index 06159d1615..4dbe77fe3d 100644
--- a/plugins/HistoryStats/src/column_split.h
+++ b/plugins/HistoryStats/src/column_split.h
@@ -49,9 +49,9 @@ public:
explicit ColSplit();
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColSplit; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("\"Split\""); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding a graphical overview of your chatting amount split by day of week or by hour of day. Different chatting amount measures are available."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColSplit; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("\"Split\""); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding a graphical overview of your chatting amount split by day of week or by hour of day. Different chatting amount measures are available."); }
virtual void impl_copyConfig(const Column* pSource);
virtual int impl_getFeatures() const { return cfHasConfig | cfAcquiresData; }
virtual void impl_configRead(const SettingsTree& settings);
diff --git a/plugins/HistoryStats/src/column_splittimeline.cpp b/plugins/HistoryStats/src/column_splittimeline.cpp
index 17e139ba78..55d8f791c3 100644
--- a/plugins/HistoryStats/src/column_splittimeline.cpp
+++ b/plugins/HistoryStats/src/column_splittimeline.cpp
@@ -90,19 +90,19 @@ void ColSplitTimeline::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGrou
m_hCustomGroup = Opt.insertEdit (hTempRadio, TranslateT("Number of columns to group"), L"", OptionsCtrl::OCF_NUMBER);
m_hTopPerColumn = Opt.insertCheck(hGroup, TranslateT("Calculate maximum per column (not per graph)"));
- static const TCHAR* sourceTexts[] = {
- LPGENT("Characters (incoming)"),
- LPGENT("Characters (outgoing)"),
- LPGENT("Characters (all)"),
- LPGENT("Characters (in/out ratio)"),
- LPGENT("Messages (incoming)"),
- LPGENT("Messages (outgoing)"),
- LPGENT("Messages (all)"),
- LPGENT("Messages (in/out ratio)"),
- LPGENT("Chats (incoming)"),
- LPGENT("Chats (outgoing)"),
- LPGENT("Chats (all)"),
- LPGENT("Chats (in/out ratio)"),
+ static const wchar_t* sourceTexts[] = {
+ LPGENW("Characters (incoming)"),
+ LPGENW("Characters (outgoing)"),
+ LPGENW("Characters (all)"),
+ LPGENW("Characters (in/out ratio)"),
+ LPGENW("Messages (incoming)"),
+ LPGENW("Messages (outgoing)"),
+ LPGENW("Messages (all)"),
+ LPGENW("Messages (in/out ratio)"),
+ LPGENW("Chats (incoming)"),
+ LPGENW("Chats (outgoing)"),
+ LPGENW("Chats (all)"),
+ LPGENW("Chats (in/out ratio)"),
};
array_each_(i, sourceTexts)
@@ -110,10 +110,10 @@ void ColSplitTimeline::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGrou
Opt.addComboItem(m_hSource, TranslateTS(sourceTexts[i]));
}
- static const TCHAR* unitTexts[] = {
- LPGENT("Hours"),
- LPGENT("Days"),
- LPGENT("Weeks"),
+ static const wchar_t* unitTexts[] = {
+ LPGENW("Hours"),
+ LPGENW("Days"),
+ LPGENW("Weeks"),
};
array_each_(i, unitTexts)
@@ -250,25 +250,25 @@ void ColSplitTimeline::impl_contactDataMerge(Contact& contact, const Contact& in
void ColSplitTimeline::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const
{
- static const TCHAR* szTypeDesc[] = {
- LPGENT("Hours of day timeline"),
- LPGENT("Days of week timeline"),
- LPGENT("\"Split\" timeline"),
+ static const wchar_t* szTypeDesc[] = {
+ LPGENW("Hours of day timeline"),
+ LPGENW("Days of week timeline"),
+ LPGENW("\"Split\" timeline"),
};
- static const TCHAR* szSourceDesc[] = {
- LPGENT("incoming characters"),
- LPGENT("outgoing characters"),
- LPGENT("all characters"),
- LPGENT("in/out ratio of characters"),
- LPGENT("incoming messages"),
- LPGENT("outgoing messages"),
- LPGENT("all messages"),
- LPGENT("in/out ratio of messages"),
- LPGENT("incoming chats"),
- LPGENT("outgoing chats"),
- LPGENT("all chats"),
- LPGENT("in/out ratio of chats"),
+ static const wchar_t* szSourceDesc[] = {
+ LPGENW("incoming characters"),
+ LPGENW("outgoing characters"),
+ LPGENW("all characters"),
+ LPGENW("in/out ratio of characters"),
+ LPGENW("incoming messages"),
+ LPGENW("outgoing messages"),
+ LPGENW("all messages"),
+ LPGENW("in/out ratio of messages"),
+ LPGENW("incoming chats"),
+ LPGENW("outgoing chats"),
+ LPGENW("all chats"),
+ LPGENW("in/out ratio of chats"),
};
if (row == 1)
diff --git a/plugins/HistoryStats/src/column_splittimeline.h b/plugins/HistoryStats/src/column_splittimeline.h
index ad2d41548b..4b28d74646 100644
--- a/plugins/HistoryStats/src/column_splittimeline.h
+++ b/plugins/HistoryStats/src/column_splittimeline.h
@@ -76,9 +76,9 @@ public:
explicit ColSplitTimeline();
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColSplitTimeline; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("\"Split\" timeline"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding a graphical overview of your chatting behavior (out, in, total, in/out ratio) from the first to the last day of your history. The information is spread along x- and y-axis and the values are encoded as color values. Different chatting behavior measures are available."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColSplitTimeline; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("\"Split\" timeline"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding a graphical overview of your chatting behavior (out, in, total, in/out ratio) from the first to the last day of your history. The information is spread along x- and y-axis and the values are encoded as color values. Different chatting behavior measures are available."); }
virtual void impl_copyConfig(const Column* pSource);
virtual int impl_getFeatures() const { return cfHasConfig | cfAcquiresData; }
virtual void impl_configRead(const SettingsTree& settings);
diff --git a/plugins/HistoryStats/src/column_timeline.cpp b/plugins/HistoryStats/src/column_timeline.cpp
index b6a5dc55c5..67e579ca0e 100644
--- a/plugins/HistoryStats/src/column_timeline.cpp
+++ b/plugins/HistoryStats/src/column_timeline.cpp
@@ -47,19 +47,19 @@ void ColTimeline::impl_configToUI(OptionsCtrl& Opt, OptionsCtrl::Item hGroup)
m_hDetail = Opt.insertCheck(hGroup, TranslateT("Details for every bar (tooltip)"));
m_hDays = Opt.insertEdit (hGroup, TranslateT("Number of days to group"), L"", OptionsCtrl::OCF_NUMBER);
- static const TCHAR* sourceTexts[] = {
- LPGENT("Characters (incoming)"),
- LPGENT("Characters (outgoing)"),
- LPGENT("Characters (all)"),
- LPGENT("Characters (in/out ratio)"),
- LPGENT("Messages (incoming)"),
- LPGENT("Messages (outgoing)"),
- LPGENT("Messages (all)"),
- LPGENT("Messages (in/out ratio)"),
- LPGENT("Chats (incoming)"),
- LPGENT("Chats (outgoing)"),
- LPGENT("Chats (all)"),
- LPGENT("Chats (in/out ratio)"),
+ static const wchar_t* sourceTexts[] = {
+ LPGENW("Characters (incoming)"),
+ LPGENW("Characters (outgoing)"),
+ LPGENW("Characters (all)"),
+ LPGENW("Characters (in/out ratio)"),
+ LPGENW("Messages (incoming)"),
+ LPGENW("Messages (outgoing)"),
+ LPGENW("Messages (all)"),
+ LPGENW("Messages (in/out ratio)"),
+ LPGENW("Chats (incoming)"),
+ LPGENW("Chats (outgoing)"),
+ LPGENW("Chats (all)"),
+ LPGENW("Chats (in/out ratio)"),
};
array_each_(i, sourceTexts)
@@ -190,19 +190,19 @@ Column::StyleList ColTimeline::impl_outputGetAdditionalStyles(IDProvider& idp)
void ColTimeline::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const
{
- static const TCHAR* szSourceDesc[] = {
- LPGENT("incoming characters"),
- LPGENT("outgoing characters"),
- LPGENT("all characters"),
- LPGENT("in/out ratio of characters"),
- LPGENT("incoming messages"),
- LPGENT("outgoing messages"),
- LPGENT("all messages"),
- LPGENT("in/out ratio of messages"),
- LPGENT("incoming chats"),
- LPGENT("outgoing chats"),
- LPGENT("all chats"),
- LPGENT("in/out ratio of chats"),
+ static const wchar_t* szSourceDesc[] = {
+ LPGENW("incoming characters"),
+ LPGENW("outgoing characters"),
+ LPGENW("all characters"),
+ LPGENW("in/out ratio of characters"),
+ LPGENW("incoming messages"),
+ LPGENW("outgoing messages"),
+ LPGENW("all messages"),
+ LPGENW("in/out ratio of messages"),
+ LPGENW("incoming chats"),
+ LPGENW("outgoing chats"),
+ LPGENW("all chats"),
+ LPGENW("in/out ratio of chats"),
};
if (row == 1)
diff --git a/plugins/HistoryStats/src/column_timeline.h b/plugins/HistoryStats/src/column_timeline.h
index 3e8125fd68..fb0b9c5b85 100644
--- a/plugins/HistoryStats/src/column_timeline.h
+++ b/plugins/HistoryStats/src/column_timeline.h
@@ -52,9 +52,9 @@ public:
explicit ColTimeline();
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColTimeline; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("Timeline"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding a graphical overview of your chatting behavior (out, in, total, in/out ratio) from the first to the last day of your history on a daily basis. Multiple days can be grouped. Different chatting behavior measures are available."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColTimeline; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("Timeline"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding a graphical overview of your chatting behavior (out, in, total, in/out ratio) from the first to the last day of your history on a daily basis. Multiple days can be grouped. Different chatting behavior measures are available."); }
virtual void impl_copyConfig(const Column* pSource);
virtual int impl_getFeatures() const { return cfHasConfig | cfAcquiresData; }
virtual void impl_configRead(const SettingsTree& settings);
diff --git a/plugins/HistoryStats/src/column_wordcount.cpp b/plugins/HistoryStats/src/column_wordcount.cpp
index a00d9c510d..a83f27e652 100644
--- a/plugins/HistoryStats/src/column_wordcount.cpp
+++ b/plugins/HistoryStats/src/column_wordcount.cpp
@@ -110,16 +110,16 @@ void ColWordCount::impl_contactDataTransformCleanup(Contact& contact) const
void ColWordCount::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const
{
- static const TCHAR* szTypeDesc[] = {
- LPGENT("Total word count"),
- LPGENT("Distinct word count"),
- LPGENT("Ratio total/distinct words")
+ static const wchar_t* szTypeDesc[] = {
+ LPGENW("Total word count"),
+ LPGENW("Distinct word count"),
+ LPGENW("Ratio total/distinct words")
};
- static const TCHAR* szSourceDesc[] = {
- LPGENT("incoming messages"),
- LPGENT("outgoing messages"),
- LPGENT("all messages"),
+ static const wchar_t* szSourceDesc[] = {
+ LPGENW("incoming messages"),
+ LPGENW("outgoing messages"),
+ LPGENW("all messages"),
};
if (row == 1)
diff --git a/plugins/HistoryStats/src/column_wordcount.h b/plugins/HistoryStats/src/column_wordcount.h
index 6277bc6cbb..e29b6836aa 100644
--- a/plugins/HistoryStats/src/column_wordcount.h
+++ b/plugins/HistoryStats/src/column_wordcount.h
@@ -21,9 +21,9 @@ public:
explicit ColWordCount();
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColWordCount; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("Word count"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding the number of (distinct) words used by you, by your contact, or by both of you."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColWordCount; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("Word count"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding the number of (distinct) words used by you, by your contact, or by both of you."); }
virtual void impl_copyConfig(const Column* pSource);
virtual void impl_configRead(const SettingsTree& settings);
virtual void impl_configWrite(SettingsTree& settings) const;
diff --git a/plugins/HistoryStats/src/column_words.cpp b/plugins/HistoryStats/src/column_words.cpp
index 6de8d42440..7d79cb467f 100644
--- a/plugins/HistoryStats/src/column_words.cpp
+++ b/plugins/HistoryStats/src/column_words.cpp
@@ -216,16 +216,16 @@ Column::StyleList ColWords::impl_outputGetAdditionalStyles(IDProvider&)
void ColWords::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const
{
- static const TCHAR* szTypeDesc[] = {
- LPGENT("Most common words"),
- LPGENT("Least common words"),
- LPGENT("Longest words"),
+ static const wchar_t* szTypeDesc[] = {
+ LPGENW("Most common words"),
+ LPGENW("Least common words"),
+ LPGENW("Longest words"),
};
- static const TCHAR* szSourceDesc[] = {
- LPGENT("incoming messages"),
- LPGENT("outgoing messages"),
- LPGENT("all messages"),
+ static const wchar_t* szSourceDesc[] = {
+ LPGENW("incoming messages"),
+ LPGENW("outgoing messages"),
+ LPGENW("all messages"),
};
if (row == 1)
diff --git a/plugins/HistoryStats/src/column_words.h b/plugins/HistoryStats/src/column_words.h
index 0ec4c4fbc4..d215fd4753 100644
--- a/plugins/HistoryStats/src/column_words.h
+++ b/plugins/HistoryStats/src/column_words.h
@@ -64,9 +64,9 @@ public:
explicit ColWords();
protected:
- virtual const TCHAR* impl_getUID() const { return con::ColWords; }
- virtual const TCHAR* impl_getTitle() const { return LPGENT("Words"); }
- virtual const TCHAR* impl_getDescription() const { return LPGENT("Column holding a list of a specified number of most/least common words or longest words used by you, by your contact, or by both of you."); }
+ virtual const wchar_t* impl_getUID() const { return con::ColWords; }
+ virtual const wchar_t* impl_getTitle() const { return LPGENW("Words"); }
+ virtual const wchar_t* impl_getDescription() const { return LPGENW("Column holding a list of a specified number of most/least common words or longest words used by you, by your contact, or by both of you."); }
virtual void impl_copyConfig(const Column* pSource);
virtual void impl_configRead(const SettingsTree& settings);
virtual void impl_configWrite(SettingsTree& settings) const;
diff --git a/plugins/HistoryStats/src/dlgfilterwords.cpp b/plugins/HistoryStats/src/dlgfilterwords.cpp
index 48d1dfb4da..9344e55f19 100644
--- a/plugins/HistoryStats/src/dlgfilterwords.cpp
+++ b/plugins/HistoryStats/src/dlgfilterwords.cpp
@@ -78,11 +78,11 @@ void DlgFilterWords::onWMInitDialog()
static const struct
{
WORD iconId;
- TCHAR* szTooltip;
+ wchar_t* szTooltip;
bool bDisabled;
} columnBand[] = {
- { IDI_COL_ADD, LPGENT("Add set"), false },
- { IDI_COL_DEL, LPGENT("Delete set"), true },
+ { IDI_COL_ADD, LPGENW("Add set"), false },
+ { IDI_COL_DEL, LPGENW("Delete set"), true },
};
array_each_(i, columnBand)
@@ -109,15 +109,15 @@ void DlgFilterWords::onWMInitDialog()
}
// init other controls
- static const TCHAR* szWordFilterModes[] = {
- LPGENT("Filter words matching"),
- LPGENT("Filter words containing"),
- LPGENT("Filter words starting with"),
- LPGENT("Filter words ending with"),
- LPGENT("Filter messages matching"),
- LPGENT("Filter messages containing"),
- LPGENT("Filter messages starting with"),
- LPGENT("Filter messages ending with"),
+ static const wchar_t* szWordFilterModes[] = {
+ LPGENW("Filter words matching"),
+ LPGENW("Filter words containing"),
+ LPGENW("Filter words starting with"),
+ LPGENW("Filter words ending with"),
+ LPGENW("Filter messages matching"),
+ LPGENW("Filter messages containing"),
+ LPGENW("Filter messages starting with"),
+ LPGENW("Filter messages ending with"),
};
array_each_(i, szWordFilterModes)
@@ -209,7 +209,7 @@ void DlgFilterWords::onSetSelChanging(HANDLE hItem, INT_PTR dwData)
// set name
HWND hText = GetDlgItem(m_hWnd, IDC_SETNAME);
int nLen = GetWindowTextLength(hText);
- TCHAR* szText = new TCHAR[nLen + 1];
+ wchar_t* szText = new wchar_t[nLen + 1];
if (GetWindowText(hText, szText, nLen + 1)) {
pFilter->setName(szText);
@@ -221,7 +221,7 @@ void DlgFilterWords::onSetSelChanging(HANDLE hItem, INT_PTR dwData)
// words
hText = GetDlgItem(m_hWnd, IDC_WORDS);
nLen = GetWindowTextLength(hText);
- szText = new TCHAR[nLen + 1];
+ szText = new wchar_t[nLen + 1];
if (GetWindowText(hText, szText, nLen + 1)) {
ext::string strText = szText;
diff --git a/plugins/HistoryStats/src/dlgoption.cpp b/plugins/HistoryStats/src/dlgoption.cpp
index 03125b1857..61a67c04f2 100644
--- a/plugins/HistoryStats/src/dlgoption.cpp
+++ b/plugins/HistoryStats/src/dlgoption.cpp
@@ -90,21 +90,21 @@ void DlgOption::onWMInitDialog()
static const struct
{
WORD iconId;
- TCHAR* szText;
- TCHAR* szTooltip;
+ wchar_t* szText;
+ wchar_t* szTooltip;
bool bRight;
WORD dlgId;
bool bVisible;
bool bDropDown;
}
pageBand[] = {
- { IDI_SETT_GLOBAL, LPGENT("Global"), LPGENT("Global settings"), false, IDD_SUB_GLOBAL, true, false },
- { IDI_SETT_EXCLUDE, LPGENT("Exclude"), LPGENT("Exclude contacts"), false, IDD_SUB_EXCLUDE, true, false },
- { IDI_SETT_INPUT, LPGENT("Input"), LPGENT("Input settings"), false, IDD_SUB_INPUT, true, false },
- { IDI_SETT_COLUMNS, LPGENT("Columns"), LPGENT("Column settings"), false, IDD_SUB_COLUMNS, true, false },
- { IDI_SETT_OUTPUT, LPGENT("Output"), LPGENT("Output settings"), false, IDD_SUB_OUTPUT, true, false },
- { IDI_CREATE, LPGENT("Create"), LPGENT("Create statistics"), true, 0, true, true },
- { IDI_CREATE_WARNING, LPGENT("Create"), LPGENT("Create statistics (there are warnings)"), true, 0, false, true },
+ { IDI_SETT_GLOBAL, LPGENW("Global"), LPGENW("Global settings"), false, IDD_SUB_GLOBAL, true, false },
+ { IDI_SETT_EXCLUDE, LPGENW("Exclude"), LPGENW("Exclude contacts"), false, IDD_SUB_EXCLUDE, true, false },
+ { IDI_SETT_INPUT, LPGENW("Input"), LPGENW("Input settings"), false, IDD_SUB_INPUT, true, false },
+ { IDI_SETT_COLUMNS, LPGENW("Columns"), LPGENW("Column settings"), false, IDD_SUB_COLUMNS, true, false },
+ { IDI_SETT_OUTPUT, LPGENW("Output"), LPGENW("Output settings"), false, IDD_SUB_OUTPUT, true, false },
+ { IDI_CREATE, LPGENW("Create"), LPGENW("Create statistics"), true, 0, true, true },
+ { IDI_CREATE_WARNING, LPGENW("Create"), LPGENW("Create statistics (there are warnings)"), true, 0, false, true },
};
array_each_(i, pageBand)
diff --git a/plugins/HistoryStats/src/dlgoption.h b/plugins/HistoryStats/src/dlgoption.h
index 03b882eb24..2621b48ea0 100644
--- a/plugins/HistoryStats/src/dlgoption.h
+++ b/plugins/HistoryStats/src/dlgoption.h
@@ -75,11 +75,11 @@ private:
{
private:
struct SupportInfo {
- TCHAR* szPlugin;
- TCHAR* szTeaser;
- TCHAR* szDescription;
- TCHAR* szLinkTexts;
- TCHAR* szLinkURLs;
+ wchar_t* szPlugin;
+ wchar_t* szTeaser;
+ wchar_t* szDescription;
+ wchar_t* szLinkTexts;
+ wchar_t* szLinkURLs;
};
private:
diff --git a/plugins/HistoryStats/src/dlgoption_subcolumns.cpp b/plugins/HistoryStats/src/dlgoption_subcolumns.cpp
index cf385fe4ad..f6c635bfa0 100644
--- a/plugins/HistoryStats/src/dlgoption_subcolumns.cpp
+++ b/plugins/HistoryStats/src/dlgoption_subcolumns.cpp
@@ -163,16 +163,16 @@ void DlgOption::SubColumns::onWMInitDialog()
static const struct
{
WORD iconId;
- TCHAR* szTooltip;
+ wchar_t* szTooltip;
bool bRight;
bool bDropDown;
bool bDisabled;
}
columnBand[] = {
- { IDI_COL_ADD, LPGENT("Add column..."), false, true, false },
- { IDI_COL_DEL, LPGENT("Delete column"), false, false, true },
- { IDI_COL_DOWN, LPGENT("Move down"), true, false, true },
- { IDI_COL_UP, LPGENT("Move up"), true, false, true },
+ { IDI_COL_ADD, LPGENW("Add column..."), false, true, false },
+ { IDI_COL_DEL, LPGENW("Delete column"), false, false, true },
+ { IDI_COL_DOWN, LPGENW("Move down"), true, false, true },
+ { IDI_COL_UP, LPGENW("Move up"), true, false, true },
};
array_each_(i, columnBand)
@@ -311,7 +311,7 @@ void DlgOption::SubColumns::rearrangeControls()
void DlgOption::SubColumns::toggleInfo()
{
HWND hInfo = GetDlgItem(getHWnd(), IDC_INFO);
- const TCHAR* szInfoLabelText = m_bShowInfo ? LPGENT("Hide additional column info...") : LPGENT("Show additional column info...");
+ const wchar_t* szInfoLabelText = m_bShowInfo ? LPGENW("Hide additional column info...") : LPGENW("Show additional column info...");
SetDlgItemText(getHWnd(), IDC_INFOLABEL, TranslateTS(szInfoLabelText));
ShowWindow(hInfo, m_bShowInfo ? SW_SHOW : SW_HIDE);
@@ -407,7 +407,7 @@ void DlgOption::SubColumns::onColSelChanged(HANDLE hItem, INT_PTR)
tvi.item.state = TVIS_EXPANDED;
tvi.item.stateMask = TVIS_EXPANDED;
- tvi.item.pszText = const_cast<TCHAR*>(TranslateT("For this config the selected column..."));
+ tvi.item.pszText = const_cast<wchar_t*>(TranslateT("For this config the selected column..."));
tvi.hParent = TreeView_InsertItem(hInfo, &tvi);
// show capabilities of column
@@ -425,7 +425,7 @@ void DlgOption::SubColumns::onColSelChanged(HANDLE hItem, INT_PTR)
msg += ((restrictions & Column::crPNGMask) == Column::crPNGPartial) ? TranslateT("PNG (partial)") : L"PNG";
}
- tvi.item.pszText = const_cast<TCHAR*>(msg.c_str());
+ tvi.item.pszText = const_cast<wchar_t*>(msg.c_str());
TreeView_InsertItem(hInfo, &tvi);
// show effect of current config
@@ -464,7 +464,7 @@ void DlgOption::SubColumns::onColSelChanged(HANDLE hItem, INT_PTR)
msg += ((restrictions & Column::crHTMLMask) == Column::crHTMLFull) ? L"HTML" : L"PNG";
}
- tvi.item.pszText = const_cast<TCHAR*>(msg.c_str());
+ tvi.item.pszText = const_cast<wchar_t*>(msg.c_str());
TreeView_InsertItem(hInfo, &tvi);
SendMessage(hInfo, WM_SETREDRAW, TRUE, 0);
diff --git a/plugins/HistoryStats/src/dlgoption_subglobal.cpp b/plugins/HistoryStats/src/dlgoption_subglobal.cpp
index d04db4d390..ec6c21ae94 100644
--- a/plugins/HistoryStats/src/dlgoption_subglobal.cpp
+++ b/plugins/HistoryStats/src/dlgoption_subglobal.cpp
@@ -94,10 +94,10 @@ INT_PTR CALLBACK DlgOption::SubGlobal::staticInfoProc(HWND hDlg, UINT msg, WPARA
if (HIWORD(wParam) == STN_CLICKED) {
HWND hLink = reinterpret_cast<HWND>(lParam);
int nLen = GetWindowTextLength(hLink);
- TCHAR* szTitle = new TCHAR[nLen + 1];
+ wchar_t* szTitle = new wchar_t[nLen + 1];
if (GetWindowText(hLink, szTitle, nLen + 1)) {
- TCHAR* szEndOfURL = (TCHAR*)ext::strfunc::str(szTitle, L" [");
+ wchar_t* szEndOfURL = (wchar_t*)ext::strfunc::str(szTitle, L" [");
if (szEndOfURL) {
*szEndOfURL = '\0';
g_pSettings->openURL(szTitle);
@@ -112,7 +112,7 @@ INT_PTR CALLBACK DlgOption::SubGlobal::staticInfoProc(HWND hDlg, UINT msg, WPARA
case WM_CTLCOLORSTATIC:
HWND hStatic = reinterpret_cast<HWND>(lParam);
- TCHAR szClassName[64];
+ wchar_t szClassName[64];
if (GetClassName(hStatic, szClassName, _countof(szClassName)) && ext::strfunc::cmp(szClassName, WC_EDIT) == 0) {
HDC hDC = reinterpret_cast<HDC>(wParam);
@@ -313,9 +313,9 @@ void DlgOption::SubGlobal::initSupportInfo()
static const SupportInfo Infos[] = {
{
TranslateT("At this time there is no external plugin supported."),
- LPGENT(""),
- LPGENT(""),
- LPGENT(""),
+ LPGENW(""),
+ LPGENW(""),
+ LPGENW(""),
L""
},
};
@@ -335,14 +335,14 @@ void DlgOption::SubGlobal::initSupportInfo()
tvi.item.state = TVIS_EXPANDED | TVIS_BOLD;
tvi.item.stateMask = TVIS_EXPANDED | TVIS_BOLD;
- tvi.item.pszText = const_cast<TCHAR*>(TranslateT("Supported plugins (double-click to learn more):"));
+ tvi.item.pszText = const_cast<wchar_t*>(TranslateT("Supported plugins (double-click to learn more):"));
tvi.hParent = TreeView_InsertItem(hInfo, &tvi);
tvi.item.stateMask &= ~TVIS_BOLD;
array_each_(i, Infos)
{
- tvi.item.pszText = const_cast<TCHAR*>(Infos[i].szPlugin);
+ tvi.item.pszText = const_cast<wchar_t*>(Infos[i].szPlugin);
tvi.item.lParam = reinterpret_cast<LPARAM>(&Infos[i]);
TreeView_InsertItem(hInfo, &tvi);
}
@@ -385,7 +385,7 @@ void DlgOption::SubGlobal::rearrangeControls()
void DlgOption::SubGlobal::toggleInfo()
{
HWND hInfo = GetDlgItem(getHWnd(), IDC_INFO);
- const TCHAR* szInfoLabelText = m_bShowInfo ? LPGENT("HistoryStats supports several plugins. Click to hide info...") : LPGENT("HistoryStats supports several plugins. Click to learn more...");
+ const wchar_t* szInfoLabelText = m_bShowInfo ? LPGENW("HistoryStats supports several plugins. Click to hide info...") : LPGENW("HistoryStats supports several plugins. Click to learn more...");
SetDlgItemText(getHWnd(), IDC_INFOLABEL, TranslateTS(szInfoLabelText));
ShowWindow(hInfo, m_bShowInfo ? SW_SHOW : SW_HIDE);
diff --git a/plugins/HistoryStats/src/dlgoption_suboutput.cpp b/plugins/HistoryStats/src/dlgoption_suboutput.cpp
index 866c865dd6..67c58f9910 100644
--- a/plugins/HistoryStats/src/dlgoption_suboutput.cpp
+++ b/plugins/HistoryStats/src/dlgoption_suboutput.cpp
@@ -137,44 +137,44 @@ void DlgOption::SubOutput::onWMInitDialog()
m_hAutoOpenMenu = m_Options.insertCheck(hTemp2, TranslateT("...via Miranda NG main menu"));
// our sort levels
- static const TCHAR* sortLevels[Settings::cNumSortLevels] = {
- LPGENT("First sort by"),
- LPGENT("Then sort by"),
- LPGENT("Finally sort by")
+ static const wchar_t* sortLevels[Settings::cNumSortLevels] = {
+ LPGENW("First sort by"),
+ LPGENW("Then sort by"),
+ LPGENW("Finally sort by")
};
// our sort keys
static const struct {
int key;
- TCHAR* desc;
+ wchar_t* desc;
} sortKeys[] = {
- { Settings::skNick , LPGENT("Nick") },
- { Settings::skProtocol , LPGENT("Protocol") },
- { Settings::skGroup , LPGENT("Group") },
- { Settings::skBytesIn , LPGENT("Characters (incoming, absolute)") },
- { Settings::skBytesOut , LPGENT("Characters (outgoing, absolute)") },
- { Settings::skBytesTotal , LPGENT("Characters (all, absolute)") },
- { Settings::skBytesInAvg , LPGENT("Characters (incoming, average)") },
- { Settings::skBytesOutAvg , LPGENT("Characters (outgoing, average)") },
- { Settings::skBytesTotalAvg , LPGENT("Characters (all, average)") },
- { Settings::skMessagesIn , LPGENT("Messages (incoming, absolute)") },
- { Settings::skMessagesOut , LPGENT("Messages (outgoing, absolute)") },
- { Settings::skMessagesTotal , LPGENT("Messages (all, absolute)") },
- { Settings::skMessagesInAvg , LPGENT("Messages (incoming, average)") },
- { Settings::skMessagesOutAvg , LPGENT("Messages (outgoing, average)") },
- { Settings::skMessagesTotalAvg , LPGENT("Messages (all, average)") },
- { Settings::skChatsIn , LPGENT("Chats (incoming, absolute)") },
- { Settings::skChatsOut , LPGENT("Chats (outgoing, absolute)") },
- { Settings::skChatsTotal , LPGENT("Chats (all, absolute)") },
- { Settings::skChatsInAvg , LPGENT("Chats (incoming, average)") },
- { Settings::skChatsOutAvg , LPGENT("Chats (outgoing, average)") },
- { Settings::skChatsTotalAvg , LPGENT("Chats (all, average)") },
- { Settings::skChatDurationTotal , LPGENT("Chat duration (total)") },
- { Settings::skChatDurationMin , LPGENT("Chat duration (minimum)") },
- { Settings::skChatDurationAvg , LPGENT("Chat duration (average)") },
- { Settings::skChatDurationMax , LPGENT("Chat duration (maximum)") },
- { Settings::skTimeOfFirstMessage, LPGENT("Time of first message to/from contact") },
- { Settings::skTimeOfLastMessage , LPGENT("Time of last message to/from contact") },
+ { Settings::skNick , LPGENW("Nick") },
+ { Settings::skProtocol , LPGENW("Protocol") },
+ { Settings::skGroup , LPGENW("Group") },
+ { Settings::skBytesIn , LPGENW("Characters (incoming, absolute)") },
+ { Settings::skBytesOut , LPGENW("Characters (outgoing, absolute)") },
+ { Settings::skBytesTotal , LPGENW("Characters (all, absolute)") },
+ { Settings::skBytesInAvg , LPGENW("Characters (incoming, average)") },
+ { Settings::skBytesOutAvg , LPGENW("Characters (outgoing, average)") },
+ { Settings::skBytesTotalAvg , LPGENW("Characters (all, average)") },
+ { Settings::skMessagesIn , LPGENW("Messages (incoming, absolute)") },
+ { Settings::skMessagesOut , LPGENW("Messages (outgoing, absolute)") },
+ { Settings::skMessagesTotal , LPGENW("Messages (all, absolute)") },
+ { Settings::skMessagesInAvg , LPGENW("Messages (incoming, average)") },
+ { Settings::skMessagesOutAvg , LPGENW("Messages (outgoing, average)") },
+ { Settings::skMessagesTotalAvg , LPGENW("Messages (all, average)") },
+ { Settings::skChatsIn , LPGENW("Chats (incoming, absolute)") },
+ { Settings::skChatsOut , LPGENW("Chats (outgoing, absolute)") },
+ { Settings::skChatsTotal , LPGENW("Chats (all, absolute)") },
+ { Settings::skChatsInAvg , LPGENW("Chats (incoming, average)") },
+ { Settings::skChatsOutAvg , LPGENW("Chats (outgoing, average)") },
+ { Settings::skChatsTotalAvg , LPGENW("Chats (all, average)") },
+ { Settings::skChatDurationTotal , LPGENW("Chat duration (total)") },
+ { Settings::skChatDurationMin , LPGENW("Chat duration (minimum)") },
+ { Settings::skChatDurationAvg , LPGENW("Chat duration (average)") },
+ { Settings::skChatDurationMax , LPGENW("Chat duration (maximum)") },
+ { Settings::skTimeOfFirstMessage, LPGENW("Time of first message to/from contact") },
+ { Settings::skTimeOfLastMessage , LPGENW("Time of last message to/from contact") },
};
m_SortKeyToIndex.resize(Settings::skLAST - Settings::skFIRST + 1);
@@ -205,26 +205,26 @@ void DlgOption::SubOutput::onWMInitDialog()
}
// our "omit by value" data
- static const TCHAR* omitData[] = {
- LPGENT("Characters (incoming, absolute)"),
- LPGENT("Characters (outgoing, absolute)"),
- LPGENT("Characters (all, absolute)"),
- LPGENT("Characters (incoming, average per week)"),
- LPGENT("Characters (outgoing, average per week)"),
- LPGENT("Characters (all, average per week)"),
- LPGENT("Messages (incoming, absolute)"),
- LPGENT("Messages (outgoing, absolute)"),
- LPGENT("Messages (all, absolute)"),
- LPGENT("Messages (incoming, average per week)"),
- LPGENT("Messages (outgoing, average per week)"),
- LPGENT("Messages (all, average per week)"),
- LPGENT("Chats (incoming, absolute)"),
- LPGENT("Chats (outgoing, absolute)"),
- LPGENT("Chats (all, absolute)"),
- LPGENT("Chats (incoming, average per week)"),
- LPGENT("Chats (outgoing, average per week)"),
- LPGENT("Chats (all, average per week)"),
- LPGENT("Chat duration (total, hours)"),
+ static const wchar_t* omitData[] = {
+ LPGENW("Characters (incoming, absolute)"),
+ LPGENW("Characters (outgoing, absolute)"),
+ LPGENW("Characters (all, absolute)"),
+ LPGENW("Characters (incoming, average per week)"),
+ LPGENW("Characters (outgoing, average per week)"),
+ LPGENW("Characters (all, average per week)"),
+ LPGENW("Messages (incoming, absolute)"),
+ LPGENW("Messages (outgoing, absolute)"),
+ LPGENW("Messages (all, absolute)"),
+ LPGENW("Messages (incoming, average per week)"),
+ LPGENW("Messages (outgoing, average per week)"),
+ LPGENW("Messages (all, average per week)"),
+ LPGENW("Chats (incoming, absolute)"),
+ LPGENW("Chats (outgoing, absolute)"),
+ LPGENW("Chats (all, absolute)"),
+ LPGENW("Chats (incoming, average per week)"),
+ LPGENW("Chats (outgoing, average per week)"),
+ LPGENW("Chats (all, average per week)"),
+ LPGENW("Chat duration (total, hours)"),
};
array_each_(i, omitData)
diff --git a/plugins/HistoryStats/src/iconlib.cpp b/plugins/HistoryStats/src/iconlib.cpp
index 3f105824fa..7993c26a3b 100644
--- a/plugins/HistoryStats/src/iconlib.cpp
+++ b/plugins/HistoryStats/src/iconlib.cpp
@@ -8,30 +8,30 @@ bool IconLib::m_bIcoLibAvailable = false;
HANDLE IconLib::m_hHookSkin2IconsChanged = NULL;
IconLib::IconInfo IconLib::m_IconInfo[] = {
- { IDI_HISTORYSTATS , "main_menu" , NULL, LPGENT("Create statistics (main menu)") },
- { IDI_HISTORYSTATS , "menu_show" , NULL, LPGENT("Show statistics (main menu)") },
- { IDI_HISTORYSTATS , "menu_config" , NULL, LPGENT("Configure... (main menu)") },
- { IDI_HISTORYSTATS , "contact_menu" , NULL, LPGENT("Contact menu") },
- { IDI_EXCLUDE_NO , "exclude_no" , NULL, LPGENT("Unexcluded contacts") },
- { IDI_EXCLUDE_YES , "exclude_yes" , NULL, LPGENT("Excluded contacts") },
- { IDI_TREE_CHECK1 , "tree_check1" , LPGENT("Options tree"), LPGENT("Checkbox") },
- { IDI_TREE_CHECK2 , "tree_check2" , LPGENT("Options tree"), LPGENT("Checkbox (checked)") },
- { IDI_TREE_CHECK3 , "tree_check3" , LPGENT("Options tree"), LPGENT("Checkbox (disabled)") },
- { IDI_TREE_CHECK4 , "tree_check4" , LPGENT("Options tree"), LPGENT("Checkbox (checked & disabled)") },
- { IDI_TREE_RADIO1 , "tree_radio1" , LPGENT("Options tree"), LPGENT("Radio button") },
- { IDI_TREE_RADIO2 , "tree_radio2" , LPGENT("Options tree"), LPGENT("Radio button (checked)") },
- { IDI_TREE_RADIO3 , "tree_radio3" , LPGENT("Options tree"), LPGENT("Radio button (disabled)") },
- { IDI_TREE_RADIO4 , "tree_radio4" , LPGENT("Options tree"), LPGENT("Radio button (checked & disabled)") },
- { IDI_TREE_EDIT1 , "tree_edit1" , LPGENT("Options tree"), LPGENT("Edit control") },
- { IDI_TREE_EDIT2 , "tree_edit2" , LPGENT("Options tree"), LPGENT("Edit control (disabled)") },
- { IDI_TREE_COMBO1 , "tree_combo1" , LPGENT("Options tree"), LPGENT("Combo box") },
- { IDI_TREE_COMBO2 , "tree_combo2" , LPGENT("Options tree"), LPGENT("Combo box (disabled)") },
- { IDI_TREE_FOLDER1 , "tree_folder1" , LPGENT("Options tree"), LPGENT("Folder") },
- { IDI_TREE_FOLDER2 , "tree_folder2" , LPGENT("Options tree"), LPGENT("Folder (disabled)") },
- { IDI_TREE_BUTTON1 , "tree_button1" , LPGENT("Options tree"), LPGENT("Button") },
- { IDI_TREE_BUTTON2 , "tree_button2" , LPGENT("Options tree"), LPGENT("Button (disabled)") },
- { IDI_TREE_DATETIME1, "tree_datetime1", LPGENT("Options tree"), LPGENT("Date/time picker") },
- { IDI_TREE_DATETIME2, "tree_datetime2", LPGENT("Options tree"), LPGENT("Date/time picker (disabled)") },
+ { IDI_HISTORYSTATS , "main_menu" , NULL, LPGENW("Create statistics (main menu)") },
+ { IDI_HISTORYSTATS , "menu_show" , NULL, LPGENW("Show statistics (main menu)") },
+ { IDI_HISTORYSTATS , "menu_config" , NULL, LPGENW("Configure... (main menu)") },
+ { IDI_HISTORYSTATS , "contact_menu" , NULL, LPGENW("Contact menu") },
+ { IDI_EXCLUDE_NO , "exclude_no" , NULL, LPGENW("Unexcluded contacts") },
+ { IDI_EXCLUDE_YES , "exclude_yes" , NULL, LPGENW("Excluded contacts") },
+ { IDI_TREE_CHECK1 , "tree_check1" , LPGENW("Options tree"), LPGENW("Checkbox") },
+ { IDI_TREE_CHECK2 , "tree_check2" , LPGENW("Options tree"), LPGENW("Checkbox (checked)") },
+ { IDI_TREE_CHECK3 , "tree_check3" , LPGENW("Options tree"), LPGENW("Checkbox (disabled)") },
+ { IDI_TREE_CHECK4 , "tree_check4" , LPGENW("Options tree"), LPGENW("Checkbox (checked & disabled)") },
+ { IDI_TREE_RADIO1 , "tree_radio1" , LPGENW("Options tree"), LPGENW("Radio button") },
+ { IDI_TREE_RADIO2 , "tree_radio2" , LPGENW("Options tree"), LPGENW("Radio button (checked)") },
+ { IDI_TREE_RADIO3 , "tree_radio3" , LPGENW("Options tree"), LPGENW("Radio button (disabled)") },
+ { IDI_TREE_RADIO4 , "tree_radio4" , LPGENW("Options tree"), LPGENW("Radio button (checked & disabled)") },
+ { IDI_TREE_EDIT1 , "tree_edit1" , LPGENW("Options tree"), LPGENW("Edit control") },
+ { IDI_TREE_EDIT2 , "tree_edit2" , LPGENW("Options tree"), LPGENW("Edit control (disabled)") },
+ { IDI_TREE_COMBO1 , "tree_combo1" , LPGENW("Options tree"), LPGENW("Combo box") },
+ { IDI_TREE_COMBO2 , "tree_combo2" , LPGENW("Options tree"), LPGENW("Combo box (disabled)") },
+ { IDI_TREE_FOLDER1 , "tree_folder1" , LPGENW("Options tree"), LPGENW("Folder") },
+ { IDI_TREE_FOLDER2 , "tree_folder2" , LPGENW("Options tree"), LPGENW("Folder (disabled)") },
+ { IDI_TREE_BUTTON1 , "tree_button1" , LPGENW("Options tree"), LPGENW("Button") },
+ { IDI_TREE_BUTTON2 , "tree_button2" , LPGENW("Options tree"), LPGENW("Button (disabled)") },
+ { IDI_TREE_DATETIME1, "tree_datetime1", LPGENW("Options tree"), LPGENW("Date/time picker") },
+ { IDI_TREE_DATETIME2, "tree_datetime2", LPGENW("Options tree"), LPGENW("Date/time picker (disabled)") },
};
ext::string IconLib::m_Section;
diff --git a/plugins/HistoryStats/src/iconlib.h b/plugins/HistoryStats/src/iconlib.h
index 6586d1284e..5ac891850c 100644
--- a/plugins/HistoryStats/src/iconlib.h
+++ b/plugins/HistoryStats/src/iconlib.h
@@ -44,8 +44,8 @@ private:
{
WORD wID;
char* szIconName;
- TCHAR* szSection;
- TCHAR* szDescription;
+ wchar_t* szSection;
+ wchar_t* szDescription;
HICON hIcon;
};
diff --git a/plugins/HistoryStats/src/main.cpp b/plugins/HistoryStats/src/main.cpp
index f44efb8a85..4f3db4a67f 100644
--- a/plugins/HistoryStats/src/main.cpp
+++ b/plugins/HistoryStats/src/main.cpp
@@ -156,18 +156,18 @@ void AddMainMenu()
CreateServiceFunction(con::SvcShowStatistics, MenuShowStatistics);
CreateServiceFunction(con::SvcConfigure, MenuConfigure);
- HGENMENU hRoot = bInPopup ? Menu_CreateRoot(MO_MAIN, LPGENT("Statistics"), 1910000000) : NULL;
+ HGENMENU hRoot = bInPopup ? Menu_CreateRoot(MO_MAIN, LPGENW("Statistics"), 1910000000) : NULL;
Menu_ConfigureItem(hRoot, MCI_OPT_UID, "7F116B24-9D84-4D04-B6AA-EED95051A184");
g_hMenuCreateStatistics = mu::clist::addMainMenuItem(
- LPGENT("Create statistics"), 0, 1910000000, IconLib::getIcon(IconLib::iiMenuCreateStatistics), con::SvcCreateStatistics, hRoot);
+ LPGENW("Create statistics"), 0, 1910000000, IconLib::getIcon(IconLib::iiMenuCreateStatistics), con::SvcCreateStatistics, hRoot);
g_hMenuShowStatistics = mu::clist::addMainMenuItem(
- LPGENT("Show statistics"), // MEMO: implicit translation
+ LPGENW("Show statistics"), // MEMO: implicit translation
0, 1910000001, IconLib::getIcon(IconLib::iiMenuShowStatistics), con::SvcShowStatistics, hRoot);
g_hMenuConfigure = mu::clist::addMainMenuItem(
- bInPopup ? LPGENT("Configure...") : LPGENT("Configure statistics..."), // MEMO: implicit translation
+ bInPopup ? LPGENW("Configure...") : LPGENW("Configure statistics..."), // MEMO: implicit translation
0, 1910000002, IconLib::getIcon(IconLib::iiMenuConfigure), con::SvcConfigure, hRoot);
}
@@ -317,7 +317,7 @@ void AddContactMenu()
CreateServiceFunction(con::SvcToggleExclude, MenuToggleExclude);
g_hMenuToggleExclude = mu::clist::addContactMenuItem(
- LPGENT("Exclude from statistics"), // MEMO: implicit translation
+ LPGENW("Exclude from statistics"), // MEMO: implicit translation
0,
800000,
IconLib::getIcon(IconLib::iiContactMenu),
@@ -328,14 +328,14 @@ void AddContactMenu()
CreateServiceFunction(con::SvcHistoryPaste, MenuHistoryPaste);
g_hMenuHistoryCopy = mu::clist::addContactMenuItem(
- LPGENT("Copy history")), // MEMO: implicit translation
+ LPGENW("Copy history")), // MEMO: implicit translation
0,
800001,
NULL,
con::SvcHistoryCopy);
g_hMenuHistoryPaste = mu::clist::addContactMenuItem(
- LPGENT("Paste history...")), // MEMO: implicit translation
+ LPGENW("Paste history...")), // MEMO: implicit translation
0,
800002,
NULL,
diff --git a/plugins/HistoryStats/src/message.cpp b/plugins/HistoryStats/src/message.cpp
index 66a928bc8a..a42974a8fe 100644
--- a/plugins/HistoryStats/src/message.cpp
+++ b/plugins/HistoryStats/src/message.cpp
@@ -22,7 +22,7 @@ void Message::makeRawAvailable()
break;
}
- m_Raw.assign(reinterpret_cast<const TCHAR*>(m_RawSource), m_nLength);
+ m_Raw.assign(reinterpret_cast<const wchar_t*>(m_RawSource), m_nLength);
m_Available |= Raw;
}
while (false);
@@ -42,14 +42,14 @@ void Message::stripRawRTF()
void Message::stripBBCodes()
{
- static const TCHAR* szSimpleBBCodes[][2] = {
+ static const wchar_t* szSimpleBBCodes[][2] = {
{ L"[b]", L"[/b]" },
{ L"[u]", L"[/u]" },
{ L"[i]", L"[/i]" },
{ L"[s]", L"[/s]" },
};
- static const TCHAR* szParamBBCodes[][2] = {
+ static const wchar_t* szParamBBCodes[][2] = {
{ L"[url=", L"[/url]" },
{ L"[color=", L"[/color]" },
};
@@ -60,8 +60,8 @@ void Message::stripBBCodes()
// remove simple BBcodes
array_each_(i, szSimpleBBCodes)
{
- const TCHAR* szOpenTag = szSimpleBBCodes[i][0];
- const TCHAR* szCloseTag = szSimpleBBCodes[i][1];
+ const wchar_t* szOpenTag = szSimpleBBCodes[i][0];
+ const wchar_t* szCloseTag = szSimpleBBCodes[i][1];
int lenOpen = ext::strfunc::len(szOpenTag);
int lenClose = ext::strfunc::len(szCloseTag);
@@ -88,8 +88,8 @@ void Message::stripBBCodes()
// remove BBcodes with parameters
array_each_(i, szParamBBCodes)
{
- const TCHAR* szOpenTag = szParamBBCodes[i][0];
- const TCHAR* szCloseTag = szParamBBCodes[i][1];
+ const wchar_t* szOpenTag = szParamBBCodes[i][0];
+ const wchar_t* szCloseTag = szParamBBCodes[i][1];
int lenOpen = ext::strfunc::len(szOpenTag);
int lenClose = ext::strfunc::len(szCloseTag);
@@ -120,11 +120,11 @@ void Message::stripBBCodes()
void Message::filterLinks()
{
- static const TCHAR* szSpaces = L" \r\r\n";
- static const TCHAR* szPrefixes = L"([{<:\"'";
- static const TCHAR* szSuffixes = L".,:;!?)]}>\"'";
- static const TCHAR* szValidProtocol = L"abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- static const TCHAR* szValidHost = L".-abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ static const wchar_t* szSpaces = L" \r\r\n";
+ static const wchar_t* szPrefixes = L"([{<:\"'";
+ static const wchar_t* szSuffixes = L".,:;!?)]}>\"'";
+ static const wchar_t* szValidProtocol = L"abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ static const wchar_t* szValidHost = L".-abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
// init with raw text
m_WithoutLinks = getRaw();
diff --git a/plugins/HistoryStats/src/message.h b/plugins/HistoryStats/src/message.h
index 6dc9e2f28a..f3aa8e75a7 100644
--- a/plugins/HistoryStats/src/message.h
+++ b/plugins/HistoryStats/src/message.h
@@ -56,7 +56,7 @@ public:
m_Timestamp = localTimestamp;
}
- void assignText(const TCHAR* msg, ext::string::size_type len)
+ void assignText(const wchar_t* msg, ext::string::size_type len)
{
m_RawSource = msg;
m_nLength = len;
diff --git a/plugins/HistoryStats/src/mirandasettings.cpp b/plugins/HistoryStats/src/mirandasettings.cpp
index cc6623545d..e2b9bc9d49 100644
--- a/plugins/HistoryStats/src/mirandasettings.cpp
+++ b/plugins/HistoryStats/src/mirandasettings.cpp
@@ -27,7 +27,7 @@ int MirandaSettings::readDWord(const char* szSetting, int dwDefault) const
return db_get_dw(m_hContact, m_strModule.c_str(), szSetting, dwDefault);
}
-ext::string MirandaSettings::readStr(const char* szSetting, const TCHAR* szDefault) const
+ext::string MirandaSettings::readStr(const char* szSetting, const wchar_t* szDefault) const
{
DBVARIANT dbv;
if (db_get_s(m_hContact, m_strModule.c_str(), szSetting, &dbv))
@@ -38,7 +38,7 @@ ext::string MirandaSettings::readStr(const char* szSetting, const TCHAR* szDefau
return str;
}
-ext::string MirandaSettings::readStrDirect(const char* szSetting, const TCHAR* szDefault) const
+ext::string MirandaSettings::readStrDirect(const char* szSetting, const wchar_t* szDefault) const
{
DBVARIANT dbv;
@@ -73,7 +73,7 @@ ext::string MirandaSettings::readStrDirect(const char* szSetting, const TCHAR* s
return str;
}
-void MirandaSettings::readTree(const char* szSetting, const TCHAR* szDefault, SettingsTree& value) const
+void MirandaSettings::readTree(const char* szSetting, const wchar_t* szDefault, SettingsTree& value) const
{
value.fromString(readStr(szSetting, szDefault));
}
@@ -98,12 +98,12 @@ void MirandaSettings::writeDWord(const char* szSetting, int dwValue) const
db_set_dw(m_hContact, m_strModule.c_str(), szSetting, dwValue);
}
-void MirandaSettings::writeStr(const char* szSetting, const TCHAR* szValue) const
+void MirandaSettings::writeStr(const char* szSetting, const wchar_t* szValue) const
{
db_set_ts(m_hContact, m_strModule.c_str(), szSetting, szValue);
}
-void MirandaSettings::writeStrDirect(const char* szSetting, const TCHAR* szValue) const
+void MirandaSettings::writeStrDirect(const char* szSetting, const wchar_t* szValue) const
{
db_set_ts(m_hContact, m_strModule.c_str(), szSetting, szValue);
}
diff --git a/plugins/HistoryStats/src/mirandasettings.h b/plugins/HistoryStats/src/mirandasettings.h
index 11e743c977..c8671faa4c 100644
--- a/plugins/HistoryStats/src/mirandasettings.h
+++ b/plugins/HistoryStats/src/mirandasettings.h
@@ -39,17 +39,17 @@ public:
int readByte(const char* szSetting, int bDefault) const;
int readWord(const char* szSetting, int wDefault) const;
int readDWord(const char* szSetting, int dwDeault) const;
- ext::string readStr(const char* szSetting, const TCHAR* szDefault) const;
- ext::string readStrDirect(const char* szSetting, const TCHAR* szDefault) const;
- void readTree(const char* szSetting, const TCHAR* szDefault, SettingsTree& value) const;
+ ext::string readStr(const char* szSetting, const wchar_t* szDefault) const;
+ ext::string readStrDirect(const char* szSetting, const wchar_t* szDefault) const;
+ void readTree(const char* szSetting, const wchar_t* szDefault, SettingsTree& value) const;
// writing
void writeBool(const char* szSetting, bool bValue) const;
void writeByte(const char* szSetting, int bValue) const;
void writeWord(const char* szSetting, int wValue) const;
void writeDWord(const char* szSetting, int dwValue) const;
- void writeStr(const char* szSetting, const TCHAR* szValue) const;
- void writeStrDirect(const char* szSetting, const TCHAR* szValue) const;
+ void writeStr(const char* szSetting, const wchar_t* szValue) const;
+ void writeStrDirect(const char* szSetting, const wchar_t* szValue) const;
void writeTree(const char* szSetting, const SettingsTree& value) const;
// misc functions
diff --git a/plugins/HistoryStats/src/mu_common.cpp b/plugins/HistoryStats/src/mu_common.cpp
index 4bdf16a7f1..7b1ee72f8d 100644
--- a/plugins/HistoryStats/src/mu_common.cpp
+++ b/plugins/HistoryStats/src/mu_common.cpp
@@ -15,11 +15,11 @@ namespace mu
namespace clist
{
- HGENMENU addMainMenuItem(const TCHAR* pszName, DWORD flags, int position, HICON hIcon, const char* pszService, HGENMENU hRoot)
+ HGENMENU addMainMenuItem(const wchar_t* pszName, DWORD flags, int position, HICON hIcon, const char* pszService, HGENMENU hRoot)
{
// TODO: support for unicode-core with unicode-aware CList
CMenuItem mi;
- mi.name.t = (TCHAR*)pszName;
+ mi.name.w = (wchar_t*)pszName;
mi.flags = flags | CMIF_TCHAR;
mi.position = position;
mi.hIcolibItem = hIcon;
@@ -29,11 +29,11 @@ namespace mu
return Menu_AddMainMenuItem(&mi);
}
- HGENMENU addContactMenuItem(const TCHAR* pszName, DWORD flags, int position, HICON hIcon, const char* pszService)
+ HGENMENU addContactMenuItem(const wchar_t* pszName, DWORD flags, int position, HICON hIcon, const char* pszService)
{
// TODO: support for unicode-core with unicode-aware CList
CMenuItem mi;
- mi.name.t = (TCHAR*)pszName;
+ mi.name.w = (wchar_t*)pszName;
mi.flags = flags | CMIF_TCHAR;
mi.position = position;
mi.hIcolibItem = hIcon;
@@ -49,12 +49,12 @@ namespace mu
namespace db
{
- int getProfilePath(int cbName, TCHAR* pszName)
+ int getProfilePath(int cbName, wchar_t* pszName)
{
return CallService(MS_DB_GETPROFILEPATHT, cbName, reinterpret_cast<LPARAM>(pszName));
}
- int getProfileName(int cbName, TCHAR* pszName)
+ int getProfileName(int cbName, wchar_t* pszName)
{
return CallService(MS_DB_GETPROFILENAMET, cbName, reinterpret_cast<LPARAM>(pszName));
}
@@ -95,11 +95,11 @@ namespace mu
return true;
}
- void addIcon(const TCHAR* szSection, const TCHAR* szDescription, const char* szIconName, const char* szDefaultFile, int iDefaultIndex)
+ void addIcon(const wchar_t* szSection, const wchar_t* szDescription, const char* szIconName, const char* szDefaultFile, int iDefaultIndex)
{
SKINICONDESC sid = { 0 };
- sid.section.t = const_cast<TCHAR*>(szSection);
- sid.description.t = const_cast<TCHAR*>(szDescription);
+ sid.section.w = const_cast<wchar_t*>(szSection);
+ sid.description.w = const_cast<wchar_t*>(szDescription);
sid.pszName = const_cast<char*>(szIconName);
sid.defaultFile.a = const_cast<char*>(szDefaultFile);
sid.iDefaultIndex = iDefaultIndex;
@@ -119,16 +119,16 @@ namespace mu
namespace opt
{
- void addPage(WPARAM addInfo, const TCHAR* pszGroup, const TCHAR* pszTitle, const TCHAR* pszTab, DLGPROC pfnDlgProc, const char* pszTemplate, HINSTANCE hInstance, DWORD flags /* = ODPF_BOLDGROUPS */)
+ void addPage(WPARAM addInfo, const wchar_t* pszGroup, const wchar_t* pszTitle, const wchar_t* pszTab, DLGPROC pfnDlgProc, const char* pszTemplate, HINSTANCE hInstance, DWORD flags /* = ODPF_BOLDGROUPS */)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.ptszTitle = const_cast<TCHAR*>(pszTitle);
+ odp.pwszTitle = const_cast<wchar_t*>(pszTitle);
odp.pfnDlgProc = pfnDlgProc;
odp.pszTemplate = const_cast<char*>(pszTemplate);
odp.hInstance = hInstance;
- odp.ptszGroup = const_cast<TCHAR*>(pszGroup);
+ odp.pwszGroup = const_cast<wchar_t*>(pszGroup);
odp.flags = flags | ODPF_TCHAR;
- odp.ptszTab = const_cast<TCHAR*>(pszTab);
+ odp.pwszTab = const_cast<wchar_t*>(pszTab);
Options_AddPage(addInfo, &odp);
}
}
diff --git a/plugins/HistoryStats/src/mu_common.h b/plugins/HistoryStats/src/mu_common.h
index 98bab3800e..cc82ea61da 100644
--- a/plugins/HistoryStats/src/mu_common.h
+++ b/plugins/HistoryStats/src/mu_common.h
@@ -13,8 +13,8 @@ namespace mu
namespace clist
{
- HGENMENU addMainMenuItem(const TCHAR* pszName, DWORD flags, int position, HICON hIcon, const char* pszService, HGENMENU hRoot = 0);
- HGENMENU addContactMenuItem(const TCHAR* pszName, DWORD flags, int position, HICON hIcon, const char* pszService);
+ HGENMENU addMainMenuItem(const wchar_t* pszName, DWORD flags, int position, HICON hIcon, const char* pszService, HGENMENU hRoot = 0);
+ HGENMENU addContactMenuItem(const wchar_t* pszName, DWORD flags, int position, HICON hIcon, const char* pszService);
}
/*
@@ -23,8 +23,8 @@ namespace mu
namespace db
{
- int getProfilePath(int cbName, TCHAR* pszName);
- int getProfileName(int cbName, TCHAR* pszName);
+ int getProfilePath(int cbName, wchar_t* pszName);
+ int getProfileName(int cbName, wchar_t* pszName);
void setSafetyMode(bool safetyMode);
}
@@ -45,7 +45,7 @@ namespace mu
namespace icolib
{
bool _available();
- void addIcon(const TCHAR* szSection, const TCHAR* szDescription, const char* szIconName, const char* szDefaultFile, int iDefaultIndex);
+ void addIcon(const wchar_t* szSection, const wchar_t* szDescription, const char* szIconName, const char* szDefaultFile, int iDefaultIndex);
HICON getIcon(const char* szIconName);
}
@@ -55,7 +55,7 @@ namespace mu
namespace opt
{
- void addPage(WPARAM addInfo, const TCHAR* pszGroup, const TCHAR* pszTitle, const TCHAR* pszTab, DLGPROC pfnDlgProc, const char* pszTemplate, HINSTANCE hInstance, DWORD flags = ODPF_BOLDGROUPS);
+ void addPage(WPARAM addInfo, const wchar_t* pszGroup, const wchar_t* pszTitle, const wchar_t* pszTab, DLGPROC pfnDlgProc, const char* pszTemplate, HINSTANCE hInstance, DWORD flags = ODPF_BOLDGROUPS);
}
/*
diff --git a/plugins/HistoryStats/src/optionsctrl.cpp b/plugins/HistoryStats/src/optionsctrl.cpp
index 2359259bad..c2b6e2738f 100644
--- a/plugins/HistoryStats/src/optionsctrl.cpp
+++ b/plugins/HistoryStats/src/optionsctrl.cpp
@@ -7,98 +7,98 @@
* OptionsCtrl
*/
-HANDLE OptionsCtrl::insertGroup(HANDLE hParent, const TCHAR* szLabel, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
+HANDLE OptionsCtrl::insertGroup(HANDLE hParent, const wchar_t* szLabel, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
{
OCGROUP ocg;
ocg.dwFlags = dwFlags;
- ocg.szLabel = const_cast<TCHAR*>(szLabel);
+ ocg.szLabel = const_cast<wchar_t*>(szLabel);
ocg.dwData = dwData;
return reinterpret_cast<HANDLE>(SendMessage(m_hOptWnd, OCM_INSERTGROUP, reinterpret_cast<WPARAM>(hParent), reinterpret_cast<LPARAM>(&ocg)));
}
-HANDLE OptionsCtrl::insertCheck(HANDLE hParent, const TCHAR* szLabel, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
+HANDLE OptionsCtrl::insertCheck(HANDLE hParent, const wchar_t* szLabel, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
{
OCCHECK occ;
occ.dwFlags = dwFlags;
- occ.szLabel = const_cast<TCHAR*>(szLabel);
+ occ.szLabel = const_cast<wchar_t*>(szLabel);
occ.dwData = dwData;
return reinterpret_cast<HANDLE>(SendMessage(m_hOptWnd, OCM_INSERTCHECK, reinterpret_cast<WPARAM>(hParent), reinterpret_cast<LPARAM>(&occ)));
}
-HANDLE OptionsCtrl::insertRadio(HANDLE hParent, HANDLE hSibling, const TCHAR* szLabel, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
+HANDLE OptionsCtrl::insertRadio(HANDLE hParent, HANDLE hSibling, const wchar_t* szLabel, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
{
OCRADIO ocr;
ocr.dwFlags = dwFlags;
- ocr.szLabel = const_cast<TCHAR*>(szLabel);
+ ocr.szLabel = const_cast<wchar_t*>(szLabel);
ocr.dwData = dwData;
ocr.hSibling = hSibling;
return reinterpret_cast<HANDLE>(SendMessage(m_hOptWnd, OCM_INSERTRADIO, reinterpret_cast<WPARAM>(hParent), reinterpret_cast<LPARAM>(&ocr)));
}
-HANDLE OptionsCtrl::insertEdit(HANDLE hParent, const TCHAR* szLabel, const TCHAR* szEdit /* = L"" */, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
+HANDLE OptionsCtrl::insertEdit(HANDLE hParent, const wchar_t* szLabel, const wchar_t* szEdit /* = L"" */, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
{
OCEDIT oce;
oce.dwFlags = dwFlags;
- oce.szLabel = const_cast<TCHAR*>(szLabel);
+ oce.szLabel = const_cast<wchar_t*>(szLabel);
oce.dwData = dwData;
- oce.szEdit = const_cast<TCHAR*>(szEdit);
+ oce.szEdit = const_cast<wchar_t*>(szEdit);
return reinterpret_cast<HANDLE>(SendMessage(m_hOptWnd, OCM_INSERTEDIT, reinterpret_cast<WPARAM>(hParent), reinterpret_cast<LPARAM>(&oce)));
}
-HANDLE OptionsCtrl::insertCombo(HANDLE hParent, const TCHAR* szLabel, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
+HANDLE OptionsCtrl::insertCombo(HANDLE hParent, const wchar_t* szLabel, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
{
OCCOMBO occ;
occ.dwFlags = dwFlags;
- occ.szLabel = const_cast<TCHAR*>(szLabel);
+ occ.szLabel = const_cast<wchar_t*>(szLabel);
occ.dwData = dwData;
return reinterpret_cast<HANDLE>(SendMessage(m_hOptWnd, OCM_INSERTCOMBO, reinterpret_cast<WPARAM>(hParent), reinterpret_cast<LPARAM>(&occ)));
}
-HANDLE OptionsCtrl::insertButton(HANDLE hParent, const TCHAR* szLabel, const TCHAR* szButton, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
+HANDLE OptionsCtrl::insertButton(HANDLE hParent, const wchar_t* szLabel, const wchar_t* szButton, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
{
OCBUTTON ocb;
ocb.dwFlags = dwFlags;
- ocb.szLabel = const_cast<TCHAR*>(szLabel);
+ ocb.szLabel = const_cast<wchar_t*>(szLabel);
ocb.dwData = dwData;
- ocb.szButton = const_cast<TCHAR*>(szButton);
+ ocb.szButton = const_cast<wchar_t*>(szButton);
return reinterpret_cast<HANDLE>(SendMessage(m_hOptWnd, OCM_INSERTBUTTON, reinterpret_cast<WPARAM>(hParent), reinterpret_cast<LPARAM>(&ocb)));
}
-HANDLE OptionsCtrl::insertDateTime(HANDLE hParent, const TCHAR* szLabel, DWORD dwDateTime, const TCHAR* szFormat /* = L"%Y-%m-%d" */, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
+HANDLE OptionsCtrl::insertDateTime(HANDLE hParent, const wchar_t* szLabel, DWORD dwDateTime, const wchar_t* szFormat /* = L"%Y-%m-%d" */, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
{
OCDATETIME ocdt;
ocdt.dwFlags = dwFlags;
- ocdt.szLabel = const_cast<TCHAR*>(szLabel);
+ ocdt.szLabel = const_cast<wchar_t*>(szLabel);
ocdt.dwData = dwData;
- ocdt.szFormat = const_cast<TCHAR*>(szFormat);
+ ocdt.szFormat = const_cast<wchar_t*>(szFormat);
ocdt.dwDateTime = dwDateTime;
return reinterpret_cast<HANDLE>(SendMessage(m_hOptWnd, OCM_INSERTDATETIME, reinterpret_cast<WPARAM>(hParent), reinterpret_cast<LPARAM>(&ocdt)));
}
-HANDLE OptionsCtrl::insertColor(HANDLE hParent, const TCHAR* szLabel, COLORREF crColor /* = 0 */, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
+HANDLE OptionsCtrl::insertColor(HANDLE hParent, const wchar_t* szLabel, COLORREF crColor /* = 0 */, DWORD dwFlags /* = 0 */, INT_PTR dwData /* = 0 */)
{
OCCOLOR occ;
occ.dwFlags = dwFlags;
- occ.szLabel = const_cast<TCHAR*>(szLabel);
+ occ.szLabel = const_cast<wchar_t*>(szLabel);
occ.dwData = dwData;
occ.crColor = crColor;
return reinterpret_cast<HANDLE>(SendMessage(m_hOptWnd, OCM_INSERTCOLOR, reinterpret_cast<WPARAM>(hParent), reinterpret_cast<LPARAM>(&occ)));
}
-const TCHAR* OptionsCtrl::getItemLabel(HANDLE hItem)
+const wchar_t* OptionsCtrl::getItemLabel(HANDLE hItem)
{
- return reinterpret_cast<const TCHAR*>(SendMessage(m_hOptWnd, OCM_GETITEMLABEL, reinterpret_cast<WPARAM>(hItem), 0));
+ return reinterpret_cast<const wchar_t*>(SendMessage(m_hOptWnd, OCM_GETITEMLABEL, reinterpret_cast<WPARAM>(hItem), 0));
}
-void OptionsCtrl::setItemLabel(HANDLE hItem, const TCHAR* szLabel)
+void OptionsCtrl::setItemLabel(HANDLE hItem, const wchar_t* szLabel)
{
SendMessage(m_hOptWnd, OCM_SETITEMLABEL, reinterpret_cast<WPARAM>(hItem), reinterpret_cast<LPARAM>(szLabel));
}
@@ -153,17 +153,17 @@ void OptionsCtrl::setEditNumber(HANDLE hEdit, int nNumber)
SendMessage(m_hOptWnd, OCM_SETEDITNUMBER, reinterpret_cast<WPARAM>(hEdit), nNumber);
}
-const TCHAR* OptionsCtrl::getEditString(HANDLE hEdit)
+const wchar_t* OptionsCtrl::getEditString(HANDLE hEdit)
{
- return reinterpret_cast<const TCHAR*>(SendMessage(m_hOptWnd, OCM_GETEDITSTRING, reinterpret_cast<WPARAM>(hEdit), 0));
+ return reinterpret_cast<const wchar_t*>(SendMessage(m_hOptWnd, OCM_GETEDITSTRING, reinterpret_cast<WPARAM>(hEdit), 0));
}
-void OptionsCtrl::setEditString(HANDLE hEdit, const TCHAR* szString)
+void OptionsCtrl::setEditString(HANDLE hEdit, const wchar_t* szString)
{
SendMessage(m_hOptWnd, OCM_SETEDITSTRING, reinterpret_cast<WPARAM>(hEdit), reinterpret_cast<LPARAM>(szString));
}
-void OptionsCtrl::addComboItem(HANDLE hCombo, const TCHAR* szItem)
+void OptionsCtrl::addComboItem(HANDLE hCombo, const wchar_t* szItem)
{
SendMessage(m_hOptWnd, OCM_ADDCOMBOITEM, reinterpret_cast<WPARAM>(hCombo), reinterpret_cast<LPARAM>(szItem));
}
diff --git a/plugins/HistoryStats/src/optionsctrl.h b/plugins/HistoryStats/src/optionsctrl.h
index 026a535176..629249e99b 100644
--- a/plugins/HistoryStats/src/optionsctrl.h
+++ b/plugins/HistoryStats/src/optionsctrl.h
@@ -39,16 +39,16 @@ public:
operator HWND() { return m_hOptWnd; }
public:
- HANDLE insertGroup(HANDLE hParent, const TCHAR* szLabel, DWORD dwFlags = 0, INT_PTR dwData = 0);
- HANDLE insertCheck(HANDLE hParent, const TCHAR* szLabel, DWORD dwFlags = 0, INT_PTR dwData = 0);
- HANDLE insertRadio(HANDLE hParent, HANDLE hSibling, const TCHAR* szLabel, DWORD dwFlags = 0, INT_PTR dwData = 0);
- HANDLE insertEdit(HANDLE hParent, const TCHAR* szLabel, const TCHAR* szEdit = L"", DWORD dwFlags = 0, INT_PTR dwData = 0);
- HANDLE insertCombo(HANDLE hParent, const TCHAR* szLabel, DWORD dwFlags = 0, INT_PTR dwData = 0);
- HANDLE insertButton(HANDLE hParent, const TCHAR* szLabel, const TCHAR* szButton, DWORD dwFlags = 0, INT_PTR dwData = 0);
- HANDLE insertDateTime(HANDLE hParent, const TCHAR* szLabel, DWORD dwDateTime, const TCHAR* szFormat = L"%Y-%m-%d", DWORD dwFlags = 0, INT_PTR dwData = 0);
- HANDLE insertColor(HANDLE hParent, const TCHAR* szLabel, COLORREF crColor = 0, DWORD dwFlags = 0, INT_PTR dwData = 0);
- const TCHAR* getItemLabel(HANDLE hItem);
- void setItemLabel(HANDLE hItem, const TCHAR* szLabel);
+ HANDLE insertGroup(HANDLE hParent, const wchar_t* szLabel, DWORD dwFlags = 0, INT_PTR dwData = 0);
+ HANDLE insertCheck(HANDLE hParent, const wchar_t* szLabel, DWORD dwFlags = 0, INT_PTR dwData = 0);
+ HANDLE insertRadio(HANDLE hParent, HANDLE hSibling, const wchar_t* szLabel, DWORD dwFlags = 0, INT_PTR dwData = 0);
+ HANDLE insertEdit(HANDLE hParent, const wchar_t* szLabel, const wchar_t* szEdit = L"", DWORD dwFlags = 0, INT_PTR dwData = 0);
+ HANDLE insertCombo(HANDLE hParent, const wchar_t* szLabel, DWORD dwFlags = 0, INT_PTR dwData = 0);
+ HANDLE insertButton(HANDLE hParent, const wchar_t* szLabel, const wchar_t* szButton, DWORD dwFlags = 0, INT_PTR dwData = 0);
+ HANDLE insertDateTime(HANDLE hParent, const wchar_t* szLabel, DWORD dwDateTime, const wchar_t* szFormat = L"%Y-%m-%d", DWORD dwFlags = 0, INT_PTR dwData = 0);
+ HANDLE insertColor(HANDLE hParent, const wchar_t* szLabel, COLORREF crColor = 0, DWORD dwFlags = 0, INT_PTR dwData = 0);
+ const wchar_t* getItemLabel(HANDLE hItem);
+ void setItemLabel(HANDLE hItem, const wchar_t* szLabel);
bool isItemEnabled(HANDLE hItem);
void enableItem(HANDLE hItem, bool bEnable);
DWORD getItemData(HANDLE hItem);
@@ -59,9 +59,9 @@ public:
void setRadioChecked(HANDLE hRadio, int nCheck);
int getEditNumber(HANDLE hEdit);
void setEditNumber(HANDLE hEdit, int nNumber);
- const TCHAR* getEditString(HANDLE hEdit);
- void setEditString(HANDLE hEdit, const TCHAR* szString);
- void addComboItem(HANDLE hCombo, const TCHAR* szItem);
+ const wchar_t* getEditString(HANDLE hEdit);
+ void setEditString(HANDLE hEdit, const wchar_t* szString);
+ void addComboItem(HANDLE hCombo, const wchar_t* szItem);
int getComboSelected(HANDLE hCombo);
void setComboSelected(HANDLE hCombo, int nSelect);
void ensureVisible(HANDLE hItem);
diff --git a/plugins/HistoryStats/src/optionsctrldefs.h b/plugins/HistoryStats/src/optionsctrldefs.h
index 837a41924e..7b24009cdf 100644
--- a/plugins/HistoryStats/src/optionsctrldefs.h
+++ b/plugins/HistoryStats/src/optionsctrldefs.h
@@ -17,8 +17,8 @@ public:
OCM_INSERTEDIT = WM_USER + 3, // (HANDLE hParent, OCEDIT* pEdit) -> HANDLE hEdit [Edit]
OCM_INSERTCOMBO = WM_USER + 4, // (HANDLE hParent, OCCOMBO* pCombo) -> HANDLE hCombo [Combo]
OCM_INSERTBUTTON = WM_USER + 5, // (HANDLE hParent, OCBUTTON* pButton) -> HANDLE hButton [Button]
- OCM_GETITEMLABEL = WM_USER + 6, // (HANDLE hItem, #) -> const TCHAR* szLabel
- OCM_SETITEMLABEL = WM_USER + 7, // (HANDLE hItem, const TCHAR* szLabel) -> #
+ OCM_GETITEMLABEL = WM_USER + 6, // (HANDLE hItem, #) -> const wchar_t* szLabel
+ OCM_SETITEMLABEL = WM_USER + 7, // (HANDLE hItem, const wchar_t* szLabel) -> #
OCM_ISITEMENABLED = WM_USER + 8, // (HANDLE hItem, #) -> BOOL bEnabled
OCM_ENABLEITEM = WM_USER + 9, // (HANDLE hItem, BOOL bEnable) -> #
OCM_GETITEMDATA = WM_USER + 10, // (HANDLE hItem, #) -> INT_PTR dwData
@@ -29,9 +29,9 @@ public:
OCM_SETRADIOCHECKED = WM_USER + 15, // (HANDLE hRadio, int nCheck) -> # [Radio]
OCM_GETEDITNUMBER = WM_USER + 16, // (HANDLE hEdit, #) -> int nNumber [Edit]
OCM_SETEDITNUMBER = WM_USER + 17, // (HANDLE hEdit, int nNumber) -> # [Edit]
- OCM_GETEDITSTRING = WM_USER + 18, // (HANDLE hEdit, #) -> const TCHAR* szString [Edit]
- OCM_SETEDITSTRING = WM_USER + 19, // (HANDLE hEdit, const TCHAR* szString) -> # [Edit]
- OCM_ADDCOMBOITEM = WM_USER + 20, // (HANDLE hCombo, const TCHAR* szItem) -> # [Combo]
+ OCM_GETEDITSTRING = WM_USER + 18, // (HANDLE hEdit, #) -> const wchar_t* szString [Edit]
+ OCM_SETEDITSTRING = WM_USER + 19, // (HANDLE hEdit, const wchar_t* szString) -> # [Edit]
+ OCM_ADDCOMBOITEM = WM_USER + 20, // (HANDLE hCombo, const wchar_t* szItem) -> # [Combo]
OCM_GETCOMBOSELECTED = WM_USER + 21, // (HANDLE hCombo, #) -> int nSelected [Combo]
OCM_SETCOMBOSELECTED = WM_USER + 22, // (HANDLE hCombo, int nSelect) -> # [Combo]
OCM_ENSUREVISIBLE = WM_USER + 23, // (HANDLE hItem, #) -> #
@@ -89,54 +89,54 @@ public:
struct OCGROUP {
DWORD dwFlags;
- TCHAR* szLabel;
+ wchar_t* szLabel;
INT_PTR dwData;
};
struct OCCHECK {
DWORD dwFlags;
- TCHAR* szLabel;
+ wchar_t* szLabel;
INT_PTR dwData;
};
struct OCRADIO {
DWORD dwFlags;
- TCHAR* szLabel;
+ wchar_t* szLabel;
INT_PTR dwData;
HANDLE hSibling;
};
struct OCEDIT {
DWORD dwFlags;
- TCHAR* szLabel;
+ wchar_t* szLabel;
INT_PTR dwData;
- TCHAR* szEdit;
+ wchar_t* szEdit;
};
struct OCCOMBO {
DWORD dwFlags;
- TCHAR* szLabel;
+ wchar_t* szLabel;
INT_PTR dwData;
};
struct OCBUTTON {
DWORD dwFlags;
- TCHAR* szLabel;
+ wchar_t* szLabel;
INT_PTR dwData;
- TCHAR* szButton;
+ wchar_t* szButton;
};
struct OCDATETIME {
DWORD dwFlags;
- TCHAR* szLabel;
+ wchar_t* szLabel;
INT_PTR dwData;
- TCHAR* szFormat;
+ wchar_t* szFormat;
DWORD dwDateTime;
};
struct OCCOLOR {
DWORD dwFlags;
- TCHAR* szLabel;
+ wchar_t* szLabel;
INT_PTR dwData;
COLORREF crColor;
};
diff --git a/plugins/HistoryStats/src/optionsctrlimpl.cpp b/plugins/HistoryStats/src/optionsctrlimpl.cpp
index f4d8e55e5e..95c17cd380 100644
--- a/plugins/HistoryStats/src/optionsctrlimpl.cpp
+++ b/plugins/HistoryStats/src/optionsctrlimpl.cpp
@@ -8,7 +8,7 @@
* OptionsCtrlImpl
*/
-const TCHAR* OptionsCtrlImpl::m_ClassName = L"HistoryStatsOptions";
+const wchar_t* OptionsCtrlImpl::m_ClassName = L"HistoryStatsOptions";
HIMAGELIST OptionsCtrlImpl::m_hStateIcons = NULL;
int OptionsCtrlImpl::m_nStateIconsRef = 0;
@@ -140,7 +140,7 @@ LRESULT CALLBACK OptionsCtrlImpl::staticWndProc(HWND hWnd, UINT msg, WPARAM wPar
return reinterpret_cast<LRESULT>(pCtrl->onOCMGetItemLabel(reinterpret_cast<HTREEITEM>(wParam)));
case OCM_SETITEMLABEL:
- pCtrl->onOCMSetItemLabel(reinterpret_cast<HTREEITEM>(wParam), reinterpret_cast<const TCHAR*>(lParam));
+ pCtrl->onOCMSetItemLabel(reinterpret_cast<HTREEITEM>(wParam), reinterpret_cast<const wchar_t*>(lParam));
return 0;
case OCM_ISITEMENABLED:
@@ -182,11 +182,11 @@ LRESULT CALLBACK OptionsCtrlImpl::staticWndProc(HWND hWnd, UINT msg, WPARAM wPar
return reinterpret_cast<LPARAM>(pCtrl->onOCMGetEditString(reinterpret_cast<HTREEITEM>(wParam)));
case OCM_SETEDITSTRING:
- pCtrl->onOCMSetEditString(reinterpret_cast<HTREEITEM>(wParam), reinterpret_cast<const TCHAR*>(lParam));
+ pCtrl->onOCMSetEditString(reinterpret_cast<HTREEITEM>(wParam), reinterpret_cast<const wchar_t*>(lParam));
return 0;
case OCM_ADDCOMBOITEM:
- pCtrl->onOCMAddComboItem(reinterpret_cast<HTREEITEM>(wParam), reinterpret_cast<const TCHAR*>(lParam));
+ pCtrl->onOCMAddComboItem(reinterpret_cast<HTREEITEM>(wParam), reinterpret_cast<const wchar_t*>(lParam));
return 0;
case OCM_GETCOMBOSELECTED:
@@ -839,12 +839,12 @@ HTREEITEM OptionsCtrlImpl::onOCMInsertColor(HTREEITEM hParent, OCCOLOR* pColor)
return (new Color(this, hParent ? getItem(hParent) : NULL, pColor->szLabel, pColor->crColor, pColor->dwFlags, pColor->dwData))->m_hItem;
}
-const TCHAR* OptionsCtrlImpl::onOCMGetItemLabel(HTREEITEM hItem)
+const wchar_t* OptionsCtrlImpl::onOCMGetItemLabel(HTREEITEM hItem)
{
return getItem(hItem)->getLabel();
}
-void OptionsCtrlImpl::onOCMSetItemLabel(HTREEITEM hItem, const TCHAR* szLabel)
+void OptionsCtrlImpl::onOCMSetItemLabel(HTREEITEM hItem, const wchar_t* szLabel)
{
assert(szLabel);
@@ -928,7 +928,7 @@ void OptionsCtrlImpl::onOCMSetEditNumber(HTREEITEM hEdit, int nNumber)
reinterpret_cast<Edit*>(pEdit)->setNumber(nNumber);
}
-const TCHAR* OptionsCtrlImpl::onOCMGetEditString(HTREEITEM hEdit)
+const wchar_t* OptionsCtrlImpl::onOCMGetEditString(HTREEITEM hEdit)
{
Item* pEdit = getItem(hEdit);
@@ -937,7 +937,7 @@ const TCHAR* OptionsCtrlImpl::onOCMGetEditString(HTREEITEM hEdit)
return reinterpret_cast<Edit*>(pEdit)->getString();
}
-void OptionsCtrlImpl::onOCMSetEditString(HTREEITEM hEdit, const TCHAR *szString)
+void OptionsCtrlImpl::onOCMSetEditString(HTREEITEM hEdit, const wchar_t *szString)
{
assert(szString);
@@ -948,7 +948,7 @@ void OptionsCtrlImpl::onOCMSetEditString(HTREEITEM hEdit, const TCHAR *szString)
reinterpret_cast<Edit*>(pEdit)->setString(szString);
}
-void OptionsCtrlImpl::onOCMAddComboItem(HTREEITEM hCombo, const TCHAR* szItem)
+void OptionsCtrlImpl::onOCMAddComboItem(HTREEITEM hCombo, const wchar_t* szItem)
{
assert(szItem);
@@ -1111,7 +1111,7 @@ void OptionsCtrlImpl::onOCMSetItemColor(HTREEITEM hColor, COLORREF crColor)
reinterpret_cast<Color*>(pColor)->setColor(crColor);
}
-void OptionsCtrlImpl::insertItem(Item* pParent, Item* pItem, const TCHAR* szNodeText, DWORD dwFlags, int iImage)
+void OptionsCtrlImpl::insertItem(Item* pParent, Item* pItem, const wchar_t* szNodeText, DWORD dwFlags, int iImage)
{
assert(!pParent || pParent->m_hItem);
assert(pItem);
@@ -1121,7 +1121,7 @@ void OptionsCtrlImpl::insertItem(Item* pParent, Item* pItem, const TCHAR* szNode
tvis.hParent = pParent ? pParent->m_hItem : TVI_ROOT;
tvis.hInsertAfter = TVI_LAST;
tvis.item.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE | TVIF_PARAM;
- tvis.item.pszText = const_cast<TCHAR*>(szNodeText);
+ tvis.item.pszText = const_cast<wchar_t*>(szNodeText);
tvis.item.iImage = iImage;
tvis.item.iSelectedImage = iImage;
tvis.item.stateMask = TVIS_EXPANDED | ((dwFlags & OCF_BOLD) ? TVIS_BOLD : 0);
@@ -1192,7 +1192,7 @@ void OptionsCtrlImpl::setStateImage(HTREEITEM hItem, int iImage)
TreeView_SetItem(m_hTree, &tvi);
}
-void OptionsCtrlImpl::setNodeText(HTREEITEM hItem, const TCHAR* szNodeText)
+void OptionsCtrlImpl::setNodeText(HTREEITEM hItem, const wchar_t* szNodeText)
{
assert(hItem);
assert(szNodeText);
@@ -1200,7 +1200,7 @@ void OptionsCtrlImpl::setNodeText(HTREEITEM hItem, const TCHAR* szNodeText)
TVITEM tvi;
tvi.mask = TVIF_HANDLE | TVIF_TEXT;
tvi.hItem = hItem;
- tvi.pszText = const_cast<TCHAR*>(szNodeText);
+ tvi.pszText = const_cast<wchar_t*>(szNodeText);
TreeView_SetItem(m_hTree, &tvi);
}
diff --git a/plugins/HistoryStats/src/optionsctrlimpl.h b/plugins/HistoryStats/src/optionsctrlimpl.h
index e931aa8933..97d27a92a2 100644
--- a/plugins/HistoryStats/src/optionsctrlimpl.h
+++ b/plugins/HistoryStats/src/optionsctrlimpl.h
@@ -76,7 +76,7 @@ private:
INT_PTR m_dwData;
protected:
- explicit Item(OptionsCtrlImpl* pCtrl, ItemType ItemType, const TCHAR* szLabel, DWORD dwFlags, INT_PTR dwData);
+ explicit Item(OptionsCtrlImpl* pCtrl, ItemType ItemType, const wchar_t* szLabel, DWORD dwFlags, INT_PTR dwData);
void enableChilds(bool bEnable);
@@ -91,8 +91,8 @@ private:
virtual void setEnabled(bool bEnable) = 0;
virtual void childAdded(Item* pChild) = 0;
- virtual void setLabel(const TCHAR* szLabel);
- virtual const TCHAR* getLabel() { return m_strLabel.c_str(); }
+ virtual void setLabel(const wchar_t* szLabel);
+ virtual const wchar_t* getLabel() { return m_strLabel.c_str(); }
};
class Group
@@ -102,7 +102,7 @@ private:
bool m_bDrawLine;
public:
- explicit Group(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, DWORD dwFlags, INT_PTR dwData);
+ explicit Group(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, DWORD dwFlags, INT_PTR dwData);
virtual void setEnabled(bool bEnable);
virtual void childAdded(Item* pChild);
@@ -122,7 +122,7 @@ private:
void updateItem();
public:
- explicit Check(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, DWORD dwFlags, INT_PTR dwData);
+ explicit Check(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, DWORD dwFlags, INT_PTR dwData);
virtual void onToggle();
@@ -171,7 +171,7 @@ private:
void updateItem();
public:
- explicit Radio(OptionsCtrlImpl* pCtrl, Item* pParent, Radio* pSibling, const TCHAR* szLabel, DWORD dwFlags, INT_PTR dwData);
+ explicit Radio(OptionsCtrlImpl* pCtrl, Item* pParent, Radio* pSibling, const wchar_t* szLabel, DWORD dwFlags, INT_PTR dwData);
virtual ~Radio();
virtual void onToggle();
@@ -196,7 +196,7 @@ private:
ext::string getCombinedText();
public:
- explicit Edit(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, const TCHAR* szEdit, DWORD dwFlags, INT_PTR dwData);
+ explicit Edit(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, const wchar_t* szEdit, DWORD dwFlags, INT_PTR dwData);
virtual void onToggle() { onActivate(); }
virtual void onSelect();
@@ -206,11 +206,11 @@ private:
virtual void setEnabled(bool bEnable);
virtual void childAdded(Item* pChild);
- virtual void setLabel(const TCHAR* szLabel);
+ virtual void setLabel(const wchar_t* szLabel);
- const TCHAR* getString();
- void setString(const TCHAR* szString);
- int getNumber() { return _ttoi(getString()); }
+ const wchar_t* getString();
+ void setString(const wchar_t* szString);
+ int getNumber() { return _wtoi(getString()); }
void setNumber(int nNumber) { setString(utils::intToString(nNumber).c_str()); }
};
@@ -230,7 +230,7 @@ private:
ext::string getCombinedText();
public:
- explicit Combo(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, DWORD dwFlags, INT_PTR dwData);
+ explicit Combo(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, DWORD dwFlags, INT_PTR dwData);
virtual void onToggle() { onActivate(); }
virtual void onSelect();
@@ -240,9 +240,9 @@ private:
virtual void setEnabled(bool bEnable);
virtual void childAdded(Item* pChild);
- virtual void setLabel(const TCHAR* szLabel);
+ virtual void setLabel(const wchar_t* szLabel);
- void addItem(const TCHAR* szItem);
+ void addItem(const wchar_t* szItem);
int getSelected();
void setSelected(int nSelect);
void onSelChanged();
@@ -256,7 +256,7 @@ private:
HWND m_hButtonWnd;
public:
- explicit Button(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, const TCHAR* szButton, DWORD dwFlags, INT_PTR dwData);
+ explicit Button(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, const wchar_t* szButton, DWORD dwFlags, INT_PTR dwData);
virtual void onToggle() { onActivate(); }
virtual void onSelect();
@@ -266,7 +266,7 @@ private:
virtual void setEnabled(bool bEnable);
virtual void childAdded(Item* pChild);
- virtual void setLabel(const TCHAR* szLabel);
+ virtual void setLabel(const wchar_t* szLabel);
};
class DateTime
@@ -294,7 +294,7 @@ private:
ext::string getCombinedText();
public:
- explicit DateTime(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, const TCHAR* szFormat, time_t timestamp, DWORD dwFlags, INT_PTR dwData);
+ explicit DateTime(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, const wchar_t* szFormat, time_t timestamp, DWORD dwFlags, INT_PTR dwData);
virtual void onToggle() { onActivate(); }
virtual void onSelect();
@@ -304,7 +304,7 @@ private:
virtual void setEnabled(bool bEnable);
virtual void childAdded(Item* pChild);
- virtual void setLabel(const TCHAR* szLabel);
+ virtual void setLabel(const wchar_t* szLabel);
bool isNone();
void setNone();
@@ -325,7 +325,7 @@ private:
COLORREF getColorValue();
public:
- explicit Color(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, COLORREF crColor, DWORD dwFlags, INT_PTR dwData);
+ explicit Color(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, COLORREF crColor, DWORD dwFlags, INT_PTR dwData);
virtual void onToggle() { onActivate(); }
virtual void onSelect();
@@ -335,7 +335,7 @@ private:
virtual void setEnabled(bool bEnable);
virtual void childAdded(Item* pChild);
- virtual void setLabel(const TCHAR* szLabel);
+ virtual void setLabel(const wchar_t* szLabel);
COLORREF getColor();
void setColor(COLORREF crColor);
@@ -343,7 +343,7 @@ private:
};
private:
- static const TCHAR* m_ClassName;
+ static const wchar_t* m_ClassName;
static HIMAGELIST m_hStateIcons;
static int m_nStateIconsRef;
@@ -402,8 +402,8 @@ private:
HTREEITEM onOCMInsertButton(HTREEITEM hParent, OCBUTTON* pButton);
HTREEITEM onOCMInsertDateTime(HTREEITEM hParent, OCDATETIME* pDateTime);
HTREEITEM onOCMInsertColor(HTREEITEM hParent, OCCOLOR* pColor);
- const TCHAR* onOCMGetItemLabel(HTREEITEM hItem);
- void onOCMSetItemLabel(HTREEITEM hItem, const TCHAR* szLabel);
+ const wchar_t* onOCMGetItemLabel(HTREEITEM hItem);
+ void onOCMSetItemLabel(HTREEITEM hItem, const wchar_t* szLabel);
bool onOCMIsItemEnabled(HTREEITEM hItem);
void onOCMEnableItem(HTREEITEM hItem, bool bEnable);
DWORD onOCMGetItemData(HTREEITEM hItem);
@@ -414,9 +414,9 @@ private:
void onOCMSetRadioChecked(HTREEITEM hRadio, int nCheck);
int onOCMGetEditNumber(HTREEITEM hEdit);
void onOCMSetEditNumber(HTREEITEM hEdit, int nNumber);
- const TCHAR* onOCMGetEditString(HTREEITEM hEdit);
- void onOCMSetEditString(HTREEITEM hEdit, const TCHAR *szString);
- void onOCMAddComboItem(HTREEITEM hCombo, const TCHAR* szItem);
+ const wchar_t* onOCMGetEditString(HTREEITEM hEdit);
+ void onOCMSetEditString(HTREEITEM hEdit, const wchar_t *szString);
+ void onOCMAddComboItem(HTREEITEM hCombo, const wchar_t* szItem);
int onOCMGetComboSelected(HTREEITEM hCombo);
void onOCMSetComboSelected(HTREEITEM hCombo, int nSelect);
void onOCMEnsureVisible(HTREEITEM hItem);
@@ -434,13 +434,13 @@ private:
void onOCMSetItemColor(HTREEITEM hColor, COLORREF crColor);
private:
- void insertItem(Item* pParent, Item* pItem, const TCHAR* szNodeText, DWORD dwFlags, int iImage);
+ void insertItem(Item* pParent, Item* pItem, const wchar_t* szNodeText, DWORD dwFlags, int iImage);
void setModified(Item* pItem, bool bModified = true);
bool isItemValid(HTREEITEM hItem);
Item* getItem(HTREEITEM hItem);
void setItem(HTREEITEM hItem, Item* pItem);
void setStateImage(HTREEITEM hItem, int iImage);
- void setNodeText(HTREEITEM hItem, const TCHAR* szNodeText);
+ void setNodeText(HTREEITEM hItem, const wchar_t* szNodeText);
bool getItemFreeRect(HTREEITEM hItem, RECT& outRect);
};
diff --git a/plugins/HistoryStats/src/optionsctrlimpl_button.cpp b/plugins/HistoryStats/src/optionsctrlimpl_button.cpp
index 5c56523322..868fa46436 100644
--- a/plugins/HistoryStats/src/optionsctrlimpl_button.cpp
+++ b/plugins/HistoryStats/src/optionsctrlimpl_button.cpp
@@ -7,7 +7,7 @@
* OptionsCtrlImpl::Button
*/
-OptionsCtrlImpl::Button::Button(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, const TCHAR* szButton, DWORD dwFlags, INT_PTR dwData)
+OptionsCtrlImpl::Button::Button(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, const wchar_t* szButton, DWORD dwFlags, INT_PTR dwData)
: Item(pCtrl, itButton, szLabel, dwFlags, dwData)
, m_hButtonWnd(NULL)
, m_strButton(szButton)
@@ -113,7 +113,7 @@ void OptionsCtrlImpl::Button::childAdded(Item* pChild)
}
}
-void OptionsCtrlImpl::Button::setLabel(const TCHAR* szLabel)
+void OptionsCtrlImpl::Button::setLabel(const wchar_t* szLabel)
{
m_strLabel = szLabel;
diff --git a/plugins/HistoryStats/src/optionsctrlimpl_check.cpp b/plugins/HistoryStats/src/optionsctrlimpl_check.cpp
index 351c77b1d0..8776224299 100644
--- a/plugins/HistoryStats/src/optionsctrlimpl_check.cpp
+++ b/plugins/HistoryStats/src/optionsctrlimpl_check.cpp
@@ -25,7 +25,7 @@ void OptionsCtrlImpl::Check::updateItem()
enableChilds(getChildEnable());
}
-OptionsCtrlImpl::Check::Check(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, DWORD dwFlags, INT_PTR dwData) :
+OptionsCtrlImpl::Check::Check(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, DWORD dwFlags, INT_PTR dwData) :
Item(pCtrl, itCheck, szLabel, dwFlags, dwData)
{
m_bChecked = bool_(dwFlags & OCF_CHECKED);
diff --git a/plugins/HistoryStats/src/optionsctrlimpl_color.cpp b/plugins/HistoryStats/src/optionsctrlimpl_color.cpp
index a8991041f1..e0b330d147 100644
--- a/plugins/HistoryStats/src/optionsctrlimpl_color.cpp
+++ b/plugins/HistoryStats/src/optionsctrlimpl_color.cpp
@@ -12,7 +12,7 @@ COLORREF OptionsCtrlImpl::Color::getColorValue()
return SendMessage(m_hColorWnd, CPM_GETCOLOUR, 0, 0);
}
-OptionsCtrlImpl::Color::Color(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, COLORREF crColor, DWORD dwFlags, INT_PTR dwData)
+OptionsCtrlImpl::Color::Color(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, COLORREF crColor, DWORD dwFlags, INT_PTR dwData)
: Item(pCtrl, itColor, szLabel, dwFlags, dwData)
, m_hColorWnd(NULL)
, m_crColor(crColor)
@@ -130,7 +130,7 @@ void OptionsCtrlImpl::Color::childAdded(Item* pChild)
}
}
-void OptionsCtrlImpl::Color::setLabel(const TCHAR* szLabel)
+void OptionsCtrlImpl::Color::setLabel(const wchar_t* szLabel)
{
m_strLabel = szLabel;
diff --git a/plugins/HistoryStats/src/optionsctrlimpl_combo.cpp b/plugins/HistoryStats/src/optionsctrlimpl_combo.cpp
index 436e32aa13..db0837a97e 100644
--- a/plugins/HistoryStats/src/optionsctrlimpl_combo.cpp
+++ b/plugins/HistoryStats/src/optionsctrlimpl_combo.cpp
@@ -46,7 +46,7 @@ ext::string OptionsCtrlImpl::Combo::getCombinedText()
}
}
-OptionsCtrlImpl::Combo::Combo(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, DWORD dwFlags, INT_PTR dwData)
+OptionsCtrlImpl::Combo::Combo(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, DWORD dwFlags, INT_PTR dwData)
: Item(pCtrl, itCombo, szLabel, dwFlags, dwData), m_hComboWnd(NULL), m_nSelected(-1)
{
m_bDisableChildsOnIndex0 = bool_(dwFlags & OCF_DISABLECHILDSONINDEX0);
@@ -177,7 +177,7 @@ void OptionsCtrlImpl::Combo::childAdded(Item* pChild)
}
}
-void OptionsCtrlImpl::Combo::setLabel(const TCHAR* szLabel)
+void OptionsCtrlImpl::Combo::setLabel(const wchar_t* szLabel)
{
m_strLabel = szLabel;
@@ -188,7 +188,7 @@ void OptionsCtrlImpl::Combo::setLabel(const TCHAR* szLabel)
}
}
-void OptionsCtrlImpl::Combo::addItem(const TCHAR* szItem)
+void OptionsCtrlImpl::Combo::addItem(const wchar_t* szItem)
{
m_Items.push_back(szItem);
}
diff --git a/plugins/HistoryStats/src/optionsctrlimpl_datetime.cpp b/plugins/HistoryStats/src/optionsctrlimpl_datetime.cpp
index d55e4c0a38..0a32c7a29c 100644
--- a/plugins/HistoryStats/src/optionsctrlimpl_datetime.cpp
+++ b/plugins/HistoryStats/src/optionsctrlimpl_datetime.cpp
@@ -180,7 +180,7 @@ ext::string OptionsCtrlImpl::DateTime::getCombinedText()
return strTemp;
}
-OptionsCtrlImpl::DateTime::DateTime(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, const TCHAR* szFormat, time_t timestamp, DWORD dwFlags, INT_PTR dwData)
+OptionsCtrlImpl::DateTime::DateTime(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, const wchar_t* szFormat, time_t timestamp, DWORD dwFlags, INT_PTR dwData)
: Item(pCtrl, itDateTime, szLabel, dwFlags, dwData), m_hDateTimeWnd(NULL), m_strFormat(szFormat), m_timestamp(timestamp)
{
m_bDisableChildsOnNone = bool_(dwFlags & OCF_DISABLECHILDSONNONE);
@@ -313,7 +313,7 @@ void OptionsCtrlImpl::DateTime::childAdded(Item* pChild)
}
}
-void OptionsCtrlImpl::DateTime::setLabel(const TCHAR* szLabel)
+void OptionsCtrlImpl::DateTime::setLabel(const wchar_t* szLabel)
{
m_strLabel = szLabel;
diff --git a/plugins/HistoryStats/src/optionsctrlimpl_edit.cpp b/plugins/HistoryStats/src/optionsctrlimpl_edit.cpp
index ce8a053190..c297fedd16 100644
--- a/plugins/HistoryStats/src/optionsctrlimpl_edit.cpp
+++ b/plugins/HistoryStats/src/optionsctrlimpl_edit.cpp
@@ -10,7 +10,7 @@
ext::string OptionsCtrlImpl::Edit::getEditText()
{
int nLen = GetWindowTextLength(m_hEditWnd);
- TCHAR* szBuf = new TCHAR[nLen + 1];
+ wchar_t* szBuf = new wchar_t[nLen + 1];
GetWindowText(m_hEditWnd, szBuf, nLen + 1);
@@ -38,7 +38,7 @@ ext::string OptionsCtrlImpl::Edit::getCombinedText()
}
}
-OptionsCtrlImpl::Edit::Edit(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, const TCHAR* szEdit, DWORD dwFlags, INT_PTR dwData)
+OptionsCtrlImpl::Edit::Edit(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, const wchar_t* szEdit, DWORD dwFlags, INT_PTR dwData)
: Item(pCtrl, itEdit, szLabel, dwFlags, dwData), m_hEditWnd(NULL)
{
m_strEdit = szEdit;
@@ -154,7 +154,7 @@ void OptionsCtrlImpl::Edit::childAdded(Item* pChild)
}
}
-const TCHAR* OptionsCtrlImpl::Edit::getString()
+const wchar_t* OptionsCtrlImpl::Edit::getString()
{
if (m_hEditWnd)
{
@@ -164,7 +164,7 @@ const TCHAR* OptionsCtrlImpl::Edit::getString()
return m_strEdit.c_str();
}
-void OptionsCtrlImpl::Edit::setString(const TCHAR* szString)
+void OptionsCtrlImpl::Edit::setString(const wchar_t* szString)
{
m_strEdit = szString;
@@ -178,7 +178,7 @@ void OptionsCtrlImpl::Edit::setString(const TCHAR* szString)
}
}
-void OptionsCtrlImpl::Edit::setLabel(const TCHAR* szLabel)
+void OptionsCtrlImpl::Edit::setLabel(const wchar_t* szLabel)
{
m_strLabel = szLabel;
diff --git a/plugins/HistoryStats/src/optionsctrlimpl_group.cpp b/plugins/HistoryStats/src/optionsctrlimpl_group.cpp
index b92a88a42d..2d36374668 100644
--- a/plugins/HistoryStats/src/optionsctrlimpl_group.cpp
+++ b/plugins/HistoryStats/src/optionsctrlimpl_group.cpp
@@ -5,7 +5,7 @@
* OptionsCtrlImpl::Group
*/
-OptionsCtrlImpl::Group::Group(OptionsCtrlImpl* pCtrl, Item* pParent, const TCHAR* szLabel, DWORD dwFlags, INT_PTR dwData)
+OptionsCtrlImpl::Group::Group(OptionsCtrlImpl* pCtrl, Item* pParent, const wchar_t* szLabel, DWORD dwFlags, INT_PTR dwData)
: Item(pCtrl, itGroup, szLabel, dwFlags, dwData)
{
m_bDrawLine = bool_(dwFlags & OCF_DRAWLINE);
diff --git a/plugins/HistoryStats/src/optionsctrlimpl_item.cpp b/plugins/HistoryStats/src/optionsctrlimpl_item.cpp
index b628b834a5..2900ce6a44 100644
--- a/plugins/HistoryStats/src/optionsctrlimpl_item.cpp
+++ b/plugins/HistoryStats/src/optionsctrlimpl_item.cpp
@@ -5,7 +5,7 @@
* OptionsCtrlImpl::Item
*/
-OptionsCtrlImpl::Item::Item(OptionsCtrlImpl* pCtrl, ItemType ItemType, const TCHAR* szLabel, DWORD dwFlags, INT_PTR dwData) :
+OptionsCtrlImpl::Item::Item(OptionsCtrlImpl* pCtrl, ItemType ItemType, const wchar_t* szLabel, DWORD dwFlags, INT_PTR dwData) :
m_pCtrl(pCtrl), m_hItem(NULL), m_nRef(1), m_ItemType(ItemType), m_strLabel(szLabel), m_dwData(dwData)
{
m_bEnabled = !(dwFlags & OCF_DISABLED);
@@ -25,7 +25,7 @@ void OptionsCtrlImpl::Item::enableChilds(bool bEnable)
}
}
-void OptionsCtrlImpl::Item::setLabel(const TCHAR* szLabel)
+void OptionsCtrlImpl::Item::setLabel(const wchar_t* szLabel)
{
m_strLabel = szLabel;
diff --git a/plugins/HistoryStats/src/optionsctrlimpl_radio.cpp b/plugins/HistoryStats/src/optionsctrlimpl_radio.cpp
index f3ee55cb17..a8fc86ae86 100644
--- a/plugins/HistoryStats/src/optionsctrlimpl_radio.cpp
+++ b/plugins/HistoryStats/src/optionsctrlimpl_radio.cpp
@@ -74,7 +74,7 @@ void OptionsCtrlImpl::Radio::updateItem()
}
}
-OptionsCtrlImpl::Radio::Radio(OptionsCtrlImpl* pCtrl, Item* pParent, Radio* pSibling, const TCHAR* szLabel, DWORD dwFlags, INT_PTR dwData)
+OptionsCtrlImpl::Radio::Radio(OptionsCtrlImpl* pCtrl, Item* pParent, Radio* pSibling, const wchar_t* szLabel, DWORD dwFlags, INT_PTR dwData)
: Item(pCtrl, itRadio, szLabel, dwFlags, dwData)
{
m_bDisableChildsOnUncheck = bool_(dwFlags & OCF_DISABLECHILDSONUNCHECK);
diff --git a/plugins/HistoryStats/src/settings.cpp b/plugins/HistoryStats/src/settings.cpp
index ebd57958c7..34fbf1d640 100644
--- a/plugins/HistoryStats/src/settings.cpp
+++ b/plugins/HistoryStats/src/settings.cpp
@@ -13,11 +13,11 @@
Settings::CharMapper::CharMapper(const Settings& settings)
{
- static const TCHAR* defaultWordDelimiters = L"\n\r\t";
+ static const wchar_t* defaultWordDelimiters = L"\n\r\t";
array_each_(i, m_CharMap)
{
- m_CharMap[i] = static_cast<TCHAR>(i);
+ m_CharMap[i] = static_cast<wchar_t>(i);
}
LCID lcid = GetUserDefaultLCID();
@@ -63,12 +63,12 @@ Settings::Filter::Filter(const ext::string& strID)
* Settings
*/
-const TCHAR* Settings::getDefaultWordDelimiters()
+const wchar_t* Settings::getDefaultWordDelimiters()
{
return L".?!,:;()[]{}<>+-*/=\\_^&\"'~%#@|$";
}
-const TCHAR* Settings::getDefaultStyleSheet()
+const wchar_t* Settings::getDefaultStyleSheet()
{
static ext::string StyleSheet;
@@ -104,17 +104,17 @@ const TCHAR* Settings::getDefaultStyleSheet()
return StyleSheet.c_str();
}
-const TCHAR* Settings::getDefaultHideContactMenuProtos()
+const wchar_t* Settings::getDefaultHideContactMenuProtos()
{
return L"{num:0;}";
}
-const TCHAR* Settings::getDefaultProtosIgnore()
+const wchar_t* Settings::getDefaultProtosIgnore()
{
return L"{num:0;}";
}
-const TCHAR* Settings::getDefaultColumns()
+const wchar_t* Settings::getDefaultColumns()
{
return
L"{num:11;}"
@@ -131,7 +131,7 @@ const TCHAR* Settings::getDefaultColumns()
L"10{enabled:y;guid:split;}10/data{block_unit:0;blocks:28;detail:y;graph_align:1;source:0;source_type:2;units_per_block:6;vis_mode:0;}";
}
-const TCHAR* Settings::getDefaultSort()
+const wchar_t* Settings::getDefaultSort()
{
return
L"0{by:17;asc:n}"
@@ -139,17 +139,17 @@ const TCHAR* Settings::getDefaultSort()
L"2{by:-1;asc:y}";
}
-const TCHAR* Settings::getDefaultOutputFile()
+const wchar_t* Settings::getDefaultOutputFile()
{
return L"HistoryStats\\stats.html";
}
-const TCHAR* Settings::getDefaultOutputExtraFolder()
+const wchar_t* Settings::getDefaultOutputExtraFolder()
{
return L"extra";
}
-const TCHAR* Settings::getDefaultFilterWords()
+const wchar_t* Settings::getDefaultFilterWords()
{
return L"{num:0;}";
}
@@ -566,7 +566,7 @@ void Settings::ensureConstraints()
utils::ensureRange(m_TableHeaderRepeat, 0, 1000, 0);
}
-void Settings::openURL(const TCHAR* szURL)
+void Settings::openURL(const wchar_t* szURL)
{
if (m_PathToBrowser.empty())
ShellExecute(NULL, L"open", szURL, NULL, NULL, SW_SHOWNORMAL);
diff --git a/plugins/HistoryStats/src/settings.h b/plugins/HistoryStats/src/settings.h
index 2c91882230..77cafca6e7 100644
--- a/plugins/HistoryStats/src/settings.h
+++ b/plugins/HistoryStats/src/settings.h
@@ -138,16 +138,16 @@ public:
#else // _UNICODE
typedef unsigned char t_uchar;
#endif // _UNICODE
-#define T_NUMCHARS (1 << (sizeof(TCHAR) * 8))
+#define T_NUMCHARS (1 << (sizeof(wchar_t) * 8))
private:
- TCHAR m_CharMap[T_NUMCHARS];
+ wchar_t m_CharMap[T_NUMCHARS];
#undef T_NUMCHARS
public:
explicit CharMapper(const Settings& settings);
- TCHAR mapChar(TCHAR c) const { return m_CharMap[static_cast<t_uchar>(c)]; }
+ wchar_t mapChar(wchar_t c) const { return m_CharMap[static_cast<t_uchar>(c)]; }
};
typedef std::set<ext::string> WordSet;
@@ -193,15 +193,15 @@ public:
typedef std::vector<Column*> ColumnList;
public:
- static const TCHAR* getDefaultWordDelimiters();
- static const TCHAR* getDefaultStyleSheet();
- static const TCHAR* getDefaultHideContactMenuProtos();
- static const TCHAR* getDefaultProtosIgnore();
- static const TCHAR* getDefaultColumns();
- static const TCHAR* getDefaultSort();
- static const TCHAR* getDefaultOutputFile();
- static const TCHAR* getDefaultOutputExtraFolder();
- static const TCHAR* getDefaultFilterWords();
+ static const wchar_t* getDefaultWordDelimiters();
+ static const wchar_t* getDefaultStyleSheet();
+ static const wchar_t* getDefaultHideContactMenuProtos();
+ static const wchar_t* getDefaultProtosIgnore();
+ static const wchar_t* getDefaultColumns();
+ static const wchar_t* getDefaultSort();
+ static const wchar_t* getDefaultOutputFile();
+ static const wchar_t* getDefaultOutputExtraFolder();
+ static const wchar_t* getDefaultFilterWords();
public:
const DWORD m_VersionCurrent;
@@ -305,7 +305,7 @@ public:
void ensureConstraints();
- void openURL(const TCHAR* szURL);
+ void openURL(const wchar_t* szURL);
};
#endif // HISTORYSTATS_GUARD_SETTINGS_H
diff --git a/plugins/HistoryStats/src/settingsserializer.cpp b/plugins/HistoryStats/src/settingsserializer.cpp
index 0610fcf5e8..1c295460e9 100644
--- a/plugins/HistoryStats/src/settingsserializer.cpp
+++ b/plugins/HistoryStats/src/settingsserializer.cpp
@@ -484,7 +484,7 @@ ext::string SettingsSerializer::getLastStatisticsFile()
return m_DB.readStr(con::SettLastStatisticsFile, L"");
}
-void SettingsSerializer::setLastStatisticsFile(const TCHAR* szFileName)
+void SettingsSerializer::setLastStatisticsFile(const wchar_t* szFileName)
{
m_DB.writeStr(con::SettLastStatisticsFile, szFileName);
}
diff --git a/plugins/HistoryStats/src/settingsserializer.h b/plugins/HistoryStats/src/settingsserializer.h
index 6f967f20ca..88bd9e1c6d 100644
--- a/plugins/HistoryStats/src/settingsserializer.h
+++ b/plugins/HistoryStats/src/settingsserializer.h
@@ -33,7 +33,7 @@ public:
void setShowSupportInfo(bool bShow);
ext::string getLastStatisticsFile();
- void setLastStatisticsFile(const TCHAR* szFileName);
+ void setLastStatisticsFile(const wchar_t* szFileName);
bool canShowStatistics();
void showStatistics();
};
diff --git a/plugins/HistoryStats/src/settingstree.cpp b/plugins/HistoryStats/src/settingstree.cpp
index 2e8ab0a0a4..a73ef0f442 100644
--- a/plugins/HistoryStats/src/settingstree.cpp
+++ b/plugins/HistoryStats/src/settingstree.cpp
@@ -74,7 +74,7 @@ void SettingsTree::fromString(const ext::string& config)
ext::string SettingsTree::toString() const
{
- static const TCHAR* replaces[5][2] = {
+ static const wchar_t* replaces[5][2] = {
{ L"\\", L"\\\\" },
{ L"{", L"\\{" },
{ L"}", L"\\}" },
@@ -113,7 +113,7 @@ ext::string SettingsTree::toString() const
return data;
}
-void SettingsTree::setKey(const TCHAR* key)
+void SettingsTree::setKey(const wchar_t* key)
{
m_CurKey = key;
@@ -125,7 +125,7 @@ void SettingsTree::setKey(const TCHAR* key)
m_pCurValues = NULL;
}
-bool SettingsTree::readBool(const TCHAR* setting, bool errorValue) const
+bool SettingsTree::readBool(const wchar_t* setting, bool errorValue) const
{
if (m_pCurValues) {
ValueMap::iterator i = m_pCurValues->find(setting);
@@ -138,19 +138,19 @@ bool SettingsTree::readBool(const TCHAR* setting, bool errorValue) const
return errorValue;
}
-int SettingsTree::readInt(const TCHAR* setting, int errorValue) const
+int SettingsTree::readInt(const wchar_t* setting, int errorValue) const
{
if (m_pCurValues) {
ValueMap::iterator i = m_pCurValues->find(setting);
if (i != m_pCurValues->end())
- return _ttoi(i->second.c_str());
+ return _wtoi(i->second.c_str());
}
return errorValue;
}
-int SettingsTree::readIntRanged(const TCHAR* setting, int errorValue, int minValue, int maxValue) const
+int SettingsTree::readIntRanged(const wchar_t* setting, int errorValue, int minValue, int maxValue) const
{
int value = readInt(setting, errorValue);
if (minValue <= value && value <= maxValue)
@@ -159,7 +159,7 @@ int SettingsTree::readIntRanged(const TCHAR* setting, int errorValue, int minVal
return errorValue;
}
-ext::string SettingsTree::readStr(const TCHAR* setting, const TCHAR* errorValue) const
+ext::string SettingsTree::readStr(const wchar_t* setting, const wchar_t* errorValue) const
{
if (m_pCurValues) {
ValueMap::iterator i = m_pCurValues->find(setting);
@@ -171,28 +171,28 @@ ext::string SettingsTree::readStr(const TCHAR* setting, const TCHAR* errorValue)
return errorValue;
}
-void SettingsTree::writeBool(const TCHAR* setting, bool value)
+void SettingsTree::writeBool(const wchar_t* setting, bool value)
{
makeKeyValid();
(*m_pCurValues)[setting] = value ? L"y" : L"n";
}
-void SettingsTree::writeInt(const TCHAR* setting, int value)
+void SettingsTree::writeInt(const wchar_t* setting, int value)
{
makeKeyValid();
(*m_pCurValues)[setting] = utils::intToString(value);
}
-void SettingsTree::writeStr(const TCHAR* setting, const TCHAR* value)
+void SettingsTree::writeStr(const wchar_t* setting, const wchar_t* value)
{
makeKeyValid();
(*m_pCurValues)[setting] = value;
}
-bool SettingsTree::hasSetting(const TCHAR* setting) const
+bool SettingsTree::hasSetting(const wchar_t* setting) const
{
if (m_pCurValues) {
ValueMap::const_iterator i = m_pCurValues->find(setting);
@@ -203,7 +203,7 @@ bool SettingsTree::hasSetting(const TCHAR* setting) const
return false;
}
-bool SettingsTree::delSetting(const TCHAR* setting)
+bool SettingsTree::delSetting(const wchar_t* setting)
{
if (m_pCurValues) {
ValueMap::iterator i = m_pCurValues->find(setting);
diff --git a/plugins/HistoryStats/src/settingstree.h b/plugins/HistoryStats/src/settingstree.h
index c96261390b..f8c471e340 100644
--- a/plugins/HistoryStats/src/settingstree.h
+++ b/plugins/HistoryStats/src/settingstree.h
@@ -30,20 +30,20 @@ public:
void fromString(const ext::string& config);
ext::string toString() const;
- void setKey(const TCHAR* key);
+ void setKey(const wchar_t* key);
const ext::string& getKey() const { return m_CurKey; }
- bool readBool(const TCHAR* setting, bool errorValue) const;
- int readInt(const TCHAR* setting, int errorValue) const;
- int readIntRanged(const TCHAR* setting, int errorValue, int minValue, int maxValue) const;
- ext::string readStr(const TCHAR* setting, const TCHAR* errorValue) const;
+ bool readBool(const wchar_t* setting, bool errorValue) const;
+ int readInt(const wchar_t* setting, int errorValue) const;
+ int readIntRanged(const wchar_t* setting, int errorValue, int minValue, int maxValue) const;
+ ext::string readStr(const wchar_t* setting, const wchar_t* errorValue) const;
- void writeBool(const TCHAR* setting, bool value);
- void writeInt(const TCHAR* setting, int value);
- void writeStr(const TCHAR* setting, const TCHAR* value);
+ void writeBool(const wchar_t* setting, bool value);
+ void writeInt(const wchar_t* setting, int value);
+ void writeStr(const wchar_t* setting, const wchar_t* value);
- bool hasSetting(const TCHAR* setting) const;
- bool delSetting(const TCHAR* setting);
+ bool hasSetting(const wchar_t* setting) const;
+ bool delSetting(const wchar_t* setting);
};
#endif // HISTORYSTATS_GUARD_SETTINGSTREE_H \ No newline at end of file
diff --git a/plugins/HistoryStats/src/statistic.cpp b/plugins/HistoryStats/src/statistic.cpp
index 0f66d31c62..0d9b1deea9 100644
--- a/plugins/HistoryStats/src/statistic.cpp
+++ b/plugins/HistoryStats/src/statistic.cpp
@@ -193,7 +193,7 @@ DWORD Statistic::getHistoryTime()
ext::string Statistic::createFile(const ext::string& desiredName)
{
if (!m_Settings.m_OverwriteAlways && utils::fileExists(desiredName)) {
- TCHAR tempBuf[MAX_PATH];
+ wchar_t tempBuf[MAX_PATH];
UINT nUnique = GetTempFileName(m_TempPath.c_str(), L"his", 0, tempBuf);
@@ -220,7 +220,7 @@ ext::string Statistic::createFile(const ext::string& desiredName)
return desiredName;
}
-bool Statistic::newFile(const TCHAR* fileExt, ext::string& writeFile, ext::string& finalURL)
+bool Statistic::newFile(const wchar_t* fileExt, ext::string& writeFile, ext::string& finalURL)
{
++m_nLastFileNr;
@@ -352,7 +352,7 @@ void Statistic::stepProgress(bool bSub, int step /* = 1 */)
bool Statistic::stepInit()
{
// file management
- TCHAR tempPath[MAX_PATH];
+ wchar_t tempPath[MAX_PATH];
int nRes = GetTempPath(MAX_PATH, tempPath);
if (nRes > 0) {
@@ -1333,19 +1333,19 @@ bool Statistic::createStatisticsSteps()
static const struct
{
bool (Statistic::*stepFn)();
- TCHAR* stepMsg;
+ wchar_t* stepMsg;
}
stepsInfo[] = {
- { &Statistic::stepInit, LPGENT("Initializing") },
- { &Statistic::stepReadDB, LPGENT("Reading database") },
- { &Statistic::stepRemoveContacts, LPGENT("Removing contacts") },
- { &Statistic::stepSortContacts, LPGENT("Sorting contacts") },
- { &Statistic::stepPreOmitContacts, LPGENT("Precollecting column data") },
- { &Statistic::stepOmitContacts, LPGENT("Limiting number of contacts") },
- { &Statistic::stepCalcTotals, LPGENT("Calculating totals") },
- { &Statistic::stepPostOmitContacts, LPGENT("Postcollecting column data") },
- { &Statistic::stepTransformData, LPGENT("Transforming data") },
- { &Statistic::stepWriteHTML, LPGENT("Creating HTML") }
+ { &Statistic::stepInit, LPGENW("Initializing") },
+ { &Statistic::stepReadDB, LPGENW("Reading database") },
+ { &Statistic::stepRemoveContacts, LPGENW("Removing contacts") },
+ { &Statistic::stepSortContacts, LPGENW("Sorting contacts") },
+ { &Statistic::stepPreOmitContacts, LPGENW("Precollecting column data") },
+ { &Statistic::stepOmitContacts, LPGENW("Limiting number of contacts") },
+ { &Statistic::stepCalcTotals, LPGENW("Calculating totals") },
+ { &Statistic::stepPostOmitContacts, LPGENW("Postcollecting column data") },
+ { &Statistic::stepTransformData, LPGENW("Transforming data") },
+ { &Statistic::stepWriteHTML, LPGENW("Creating HTML") }
};
setProgressMax(false, _countof(stepsInfo));
@@ -1414,7 +1414,7 @@ INT_PTR CALLBACK Statistic::staticConflictProc(HWND hDlg, UINT uMsg, WPARAM wPar
lvc.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_FMT;
lvc.fmt = LVCFMT_LEFT;
lvc.cx = 400;
- lvc.pszText = const_cast<TCHAR*>(TranslateT("Already existing file"));
+ lvc.pszText = const_cast<wchar_t*>(TranslateT("Already existing file"));
ListView_InsertColumn(hWndFiles, 0, &lvc);
int nIndex = 0;
@@ -1425,7 +1425,7 @@ INT_PTR CALLBACK Statistic::staticConflictProc(HWND hDlg, UINT uMsg, WPARAM wPar
lvi.mask = LVIF_TEXT;
lvi.iItem = nIndex++;
lvi.iSubItem = 0;
- lvi.pszText = const_cast<TCHAR*>(fi->first.c_str());
+ lvi.pszText = const_cast<wchar_t*>(fi->first.c_str());
ListView_InsertItem(hWndFiles, &lvi);
}
}
diff --git a/plugins/HistoryStats/src/statistic.h b/plugins/HistoryStats/src/statistic.h
index 07b502b200..93f3d729bf 100644
--- a/plugins/HistoryStats/src/statistic.h
+++ b/plugins/HistoryStats/src/statistic.h
@@ -182,7 +182,7 @@ public:
// file management
ext::string createFile(const ext::string& desiredName);
- bool newFile(const TCHAR* fileExt, ext::string& writeFile, ext::string& finalURL);
+ bool newFile(const wchar_t* fileExt, ext::string& writeFile, ext::string& finalURL);
bool newFilePNG(ext::string& writeFile, ext::string& finalURL) { return newFile(L".png", writeFile, finalURL); }
bool newFilePNG(Canvas& canvas, ext::string& finalURL);
};
diff --git a/plugins/HistoryStats/src/stdafx.h b/plugins/HistoryStats/src/stdafx.h
index 8646a67c1e..d4fcfc6f6b 100644
--- a/plugins/HistoryStats/src/stdafx.h
+++ b/plugins/HistoryStats/src/stdafx.h
@@ -19,7 +19,6 @@
#pragma comment(lib, "UxTheme.lib")
-#include <tchar.h>
#include <stdio.h>
#include <cstdio>
diff --git a/plugins/HistoryStats/src/utf8buffer.h b/plugins/HistoryStats/src/utf8buffer.h
index e4727afc30..56342adbf7 100644
--- a/plugins/HistoryStats/src/utf8buffer.h
+++ b/plugins/HistoryStats/src/utf8buffer.h
@@ -5,15 +5,15 @@
#include <string>
class UTF8Buffer
- : public std::basic_streambuf<TCHAR, std::char_traits<TCHAR> >
+ : public std::basic_streambuf<wchar_t, std::char_traits<wchar_t> >
, private pattern::NotCopyable<UTF8Buffer>
{
private:
- typedef std::char_traits<TCHAR> _Tr;
+ typedef std::char_traits<wchar_t> _Tr;
private:
int m_BufSize;
- TCHAR* m_pBuf;
+ wchar_t* m_pBuf;
ext::a::ostream& m_Stream;
char* m_pUTF8Buf;
WCHAR* m_pBufW;
@@ -23,7 +23,7 @@ private:
#endif // _UNICODE
private:
- void dump(const TCHAR* pBegin, const TCHAR* pEnd)
+ void dump(const wchar_t* pBegin, const wchar_t* pEnd)
{
size_t len = pEnd - pBegin;
@@ -81,7 +81,7 @@ public:
explicit UTF8Buffer(ext::a::ostream& outStream, int bufferSize = 4096)
: m_BufSize(bufferSize), m_Stream(outStream)
{
- m_pBuf = new TCHAR[m_BufSize];
+ m_pBuf = new wchar_t[m_BufSize];
m_pUTF8Buf = new char[3 * m_BufSize];
#if defined(_UNICODE)
diff --git a/plugins/HistoryStats/src/utils.cpp b/plugins/HistoryStats/src/utils.cpp
index 91dedaf163..b70ee4630e 100644
--- a/plugins/HistoryStats/src/utils.cpp
+++ b/plugins/HistoryStats/src/utils.cpp
@@ -12,23 +12,23 @@
namespace utils
{
- ext::string timestampToString(time_t value, const TCHAR* format)
+ ext::string timestampToString(time_t value, const wchar_t* format)
{
- TCHAR temp[100] = { 0 };
+ wchar_t temp[100] = { 0 };
return (ext::strfunc::ftime(temp, 100, format, gmtime(&value)) > 0) ? temp : L"";
}
- ext::string tmStructToString(const tm& value, const TCHAR* format)
+ ext::string tmStructToString(const tm& value, const wchar_t* format)
{
- TCHAR temp[100] = { 0 };
+ wchar_t temp[100] = { 0 };
return (ext::strfunc::ftime(temp, 100, format, &value) > 0) ? temp : L"";
}
ext::string durationToString(DWORD value)
{
- TCHAR temp[100] = { 0 };
+ wchar_t temp[100] = { 0 };
value += 59;
value /= 60;
@@ -48,9 +48,9 @@ namespace utils
struct tm dateTM;
- dateTM.tm_year = _ttoi(date.c_str() + 0) - 1900;
- dateTM.tm_mon = _ttoi(date.c_str() + 5) - 1;
- dateTM.tm_mday = _ttoi(date.c_str() + 8);
+ dateTM.tm_year = _wtoi(date.c_str() + 0) - 1900;
+ dateTM.tm_mon = _wtoi(date.c_str() + 5) - 1;
+ dateTM.tm_mday = _wtoi(date.c_str() + 8);
dateTM.tm_hour = dateTM.tm_min = dateTM.tm_sec = 0;
dateTM.tm_isdst = dateTM.tm_wday = dateTM.tm_yday = 0;
@@ -75,7 +75,7 @@ namespace utils
ext::string intToString(int value)
{
- TCHAR temp[100] = { 0 };
+ wchar_t temp[100] = { 0 };
ext::strfunc::sprintf(temp, L"%d", value);
@@ -84,7 +84,7 @@ namespace utils
ext::string intToPadded(int value, int len)
{
- TCHAR temp[100] = { 0 };
+ wchar_t temp[100] = { 0 };
ext::strfunc::sprintf(temp, L"%0*d", len, value);
@@ -93,7 +93,7 @@ namespace utils
ext::string intToGrouped(int value)
{
- TCHAR temp[100] = { 0 };
+ wchar_t temp[100] = { 0 };
const char* grouping = Locale::grouping();
ext::strfunc::sprintf(temp, L"%d", value);
@@ -117,7 +117,7 @@ namespace utils
ext::string floatToString(double value, int precision)
{
- TCHAR temp[100] = { 0 };
+ wchar_t temp[100] = { 0 };
ext::strfunc::sprintf(temp, L"%.*f", precision, value);
@@ -126,7 +126,7 @@ namespace utils
ext::string floatToGrouped(double value, int precision)
{
- TCHAR temp[100] = { 0 };
+ wchar_t temp[100] = { 0 };
const char* grouping = Locale::grouping();
ext::strfunc::sprintf(temp, L"%.*f", precision, value);
@@ -154,7 +154,7 @@ namespace utils
ext::string ratioToPercent(int numerator, int denominator)
{
float value = 0.0;
- TCHAR temp[100] = { 0 };
+ wchar_t temp[100] = { 0 };
if (denominator != 0) {
value = 1.0f * numerator / denominator;
@@ -165,7 +165,7 @@ namespace utils
return temp;
}
- void replaceAllInPlace(ext::string& text, const TCHAR* find, const TCHAR* replace)
+ void replaceAllInPlace(ext::string& text, const wchar_t* find, const wchar_t* replace)
{
ext::string::size_type pos = 0;
ext::string::size_type find_len = ext::strfunc::len(find);
@@ -186,7 +186,7 @@ namespace utils
replaceAllInPlace(text, L">", L"&gt;");
}
- const TCHAR* stripPrefix(const TCHAR* szPrefix, const TCHAR* szText)
+ const wchar_t* stripPrefix(const wchar_t* szPrefix, const wchar_t* szText)
{
int i = 0;
@@ -199,31 +199,31 @@ namespace utils
return szText;
}
- ext::string replaceVariables(const ext::string& strFormat, time_t timeValue, const TCHAR* szNick /* = L"" */)
+ ext::string replaceVariables(const ext::string& strFormat, time_t timeValue, const wchar_t* szNick /* = L"" */)
{
- static const TCHAR* szMonthName[][2] = {
- { LPGENT("month3:Jan"), LPGENT("monthF:January") },
- { LPGENT("month3:Feb"), LPGENT("monthF:February") },
- { LPGENT("month3:Mar"), LPGENT("monthF:March") },
- { LPGENT("month3:Apr"), LPGENT("monthF:April") },
- { LPGENT("month3:May"), LPGENT("monthF:May") },
- { LPGENT("month3:Jun"), LPGENT("monthF:June") },
- { LPGENT("month3:Jul"), LPGENT("monthF:July") },
- { LPGENT("month3:Aug"), LPGENT("monthF:August") },
- { LPGENT("month3:Sep"), LPGENT("monthF:September") },
- { LPGENT("month3:Oct"), LPGENT("monthF:October") },
- { LPGENT("month3:Nov"), LPGENT("monthF:November") },
- { LPGENT("month3:Dec"), LPGENT("monthF:December") },
+ static const wchar_t* szMonthName[][2] = {
+ { LPGENW("month3:Jan"), LPGENW("monthF:January") },
+ { LPGENW("month3:Feb"), LPGENW("monthF:February") },
+ { LPGENW("month3:Mar"), LPGENW("monthF:March") },
+ { LPGENW("month3:Apr"), LPGENW("monthF:April") },
+ { LPGENW("month3:May"), LPGENW("monthF:May") },
+ { LPGENW("month3:Jun"), LPGENW("monthF:June") },
+ { LPGENW("month3:Jul"), LPGENW("monthF:July") },
+ { LPGENW("month3:Aug"), LPGENW("monthF:August") },
+ { LPGENW("month3:Sep"), LPGENW("monthF:September") },
+ { LPGENW("month3:Oct"), LPGENW("monthF:October") },
+ { LPGENW("month3:Nov"), LPGENW("monthF:November") },
+ { LPGENW("month3:Dec"), LPGENW("monthF:December") },
};
- static const TCHAR* szWDayName[][3] = {
- { LPGENT("wday2:Mo"), LPGENT("wday3:Mon"), LPGENT("wdayF:Monday") },
- { LPGENT("wday2:Tu"), LPGENT("wday3:Tue"), LPGENT("wdayF:Tuesday") },
- { LPGENT("wday2:We"), LPGENT("wday3:Wed"), LPGENT("wdayF:Wednesday") },
- { LPGENT("wday2:Th"), LPGENT("wday3:Thu"), LPGENT("wdayF:Thursday") },
- { LPGENT("wday2:Fr"), LPGENT("wday3:Fri"), LPGENT("wdayF:Friday") },
- { LPGENT("wday2:Sa"), LPGENT("wday3:Sat"), LPGENT("wdayF:Saturday") },
- { LPGENT("wday2:Su"), LPGENT("wday3:Sun"), LPGENT("wdayF:Sunday") },
+ static const wchar_t* szWDayName[][3] = {
+ { LPGENW("wday2:Mo"), LPGENW("wday3:Mon"), LPGENW("wdayF:Monday") },
+ { LPGENW("wday2:Tu"), LPGENW("wday3:Tue"), LPGENW("wdayF:Tuesday") },
+ { LPGENW("wday2:We"), LPGENW("wday3:Wed"), LPGENW("wdayF:Wednesday") },
+ { LPGENW("wday2:Th"), LPGENW("wday3:Thu"), LPGENW("wdayF:Thursday") },
+ { LPGENW("wday2:Fr"), LPGENW("wday3:Fri"), LPGENW("wdayF:Friday") },
+ { LPGENW("wday2:Sa"), LPGENW("wday3:Sat"), LPGENW("wdayF:Saturday") },
+ { LPGENW("wday2:Su"), LPGENW("wday3:Sun"), LPGENW("wdayF:Sunday") },
};
struct tm* timeTM = gmtime(&timeValue);
@@ -337,7 +337,7 @@ namespace utils
ext::string toLowerCase(const ext::string& text)
{
int len = text.length();
- TCHAR* buf = new TCHAR[len + 1];
+ wchar_t* buf = new wchar_t[len + 1];
LCID lcid = GetUserDefaultLCID();
@@ -355,7 +355,7 @@ namespace utils
ext::string toUpperCase(const ext::string& text)
{
int len = text.length();
- TCHAR* buf = new TCHAR[len + 1];
+ wchar_t* buf = new wchar_t[len + 1];
LCID lcid = GetUserDefaultLCID();
@@ -387,7 +387,7 @@ namespace utils
dotPos = version.length();
}
- res.parts[part--] = _ttoi(version.substr(0, dotPos).c_str());
+ res.parts[part--] = _wtoi(version.substr(0, dotPos).c_str());
version.erase(0, dotPos + 1);
}
@@ -397,7 +397,7 @@ namespace utils
ext::string versionToDotted(DWORD version)
{
- TCHAR temp[16] = { 0 };
+ wchar_t temp[16] = { 0 };
ext::strfunc::sprintf(
temp,
@@ -440,7 +440,7 @@ namespace utils
return ret_str;
}
- ext::a::string convertTToUTF8(const TCHAR* str, size_t str_len)
+ ext::a::string convertTToUTF8(const wchar_t* str, size_t str_len)
{
#if defined(_UNICODE)
const WCHAR* conv_str = str;
@@ -649,7 +649,7 @@ namespace utils
return false;
// check for disallowed names
- static const TCHAR* disallowedNames[] = {
+ static const wchar_t* disallowedNames[] = {
L"clock$",
L"aux",
L"con",
@@ -776,7 +776,7 @@ namespace utils
ext::string colorToHTML(COLORREF crColor)
{
- static const TCHAR hexDigits[] = L"0123456789ABCDEF";
+ static const wchar_t hexDigits[] = L"0123456789ABCDEF";
ext::string htmlColor(7, '#');
@@ -823,7 +823,7 @@ namespace utils
ext::string getGUID()
{
- static const TCHAR hexDigits[] = L"0123456789ABCDEF";
+ static const wchar_t hexDigits[] = L"0123456789ABCDEF";
GUID guid;
CoCreateGuid(&guid);
@@ -893,7 +893,7 @@ namespace utils
static ext::string strMirandaPath;
if (strMirandaPath.empty()) {
- TCHAR szPath[MAX_PATH] = { 0 };
+ wchar_t szPath[MAX_PATH] = { 0 };
PathToAbsoluteT(L"x", szPath);
strMirandaPath = extractPath(szPath);
@@ -907,7 +907,7 @@ namespace utils
static ext::string strProfilePath;
if (strProfilePath.empty()) {
- TCHAR szPath[MAX_PATH] = { 0 };
+ wchar_t szPath[MAX_PATH] = { 0 };
mu::db::getProfilePath(MAX_PATH, szPath);
strProfilePath = szPath;
@@ -926,7 +926,7 @@ namespace utils
static ext::string strProfileName;
if (strProfileName.empty()) {
- TCHAR szName[MAX_PATH] = { 0 };
+ wchar_t szName[MAX_PATH] = { 0 };
mu::db::getProfileName(MAX_PATH, szName);
strProfileName = szName;
@@ -1031,7 +1031,7 @@ ext::t::string RTFFilter::filter(const ext::t::string& str)
return str;
}
- TCHAR* out_buf = new TCHAR[len / sizeof(TCHAR)];
+ wchar_t* out_buf = new wchar_t[len / sizeof(wchar_t)];
intptr_t res = m_Data.m_RTFConvString(
strA.c_str(),
@@ -1048,7 +1048,7 @@ ext::t::string RTFFilter::filter(const ext::t::string& str)
return str;
}
- ext::t::string out_str(out_buf, res / sizeof(TCHAR)-1);
+ ext::t::string out_str(out_buf, res / sizeof(wchar_t)-1);
delete[] out_buf;
return out_str;
diff --git a/plugins/HistoryStats/src/utils.h b/plugins/HistoryStats/src/utils.h
index 834b154ccb..884b1c7302 100644
--- a/plugins/HistoryStats/src/utils.h
+++ b/plugins/HistoryStats/src/utils.h
@@ -7,8 +7,8 @@
namespace utils
{
// time formatting
- ext::string timestampToString(time_t value, const TCHAR* format);
- ext::string tmStructToString(const tm& value, const TCHAR* format);
+ ext::string timestampToString(time_t value, const wchar_t* format);
+ ext::string tmStructToString(const tm& value, const wchar_t* format);
inline ext::string timestampToDateTime(DWORD value) { return timestampToString(value, L"%c"); }
inline ext::string timestampToDate(DWORD value) { return timestampToString(value, L"%x"); }
inline ext::string timestampToTime(DWORD value) { return timestampToString(value, L"%X"); }
@@ -27,12 +27,12 @@ namespace utils
ext::string ratioToPercent(int numerator, int denominator);
// text conversion
- void replaceAllInPlace(ext::string& text, const TCHAR* find, const TCHAR* replace);
+ void replaceAllInPlace(ext::string& text, const wchar_t* find, const wchar_t* replace);
void htmlEscapeInPlace(ext::string& text);
- inline ext::string replaceAll(ext::string text, const TCHAR* find, const TCHAR* replace) { replaceAllInPlace(text, find, replace); return text; }
+ inline ext::string replaceAll(ext::string text, const wchar_t* find, const wchar_t* replace) { replaceAllInPlace(text, find, replace); return text; }
inline ext::string htmlEscape(ext::string text) { htmlEscapeInPlace(text); return text; }
- const TCHAR* stripPrefix(const TCHAR* szPrefix, const TCHAR* szText);
- ext::string replaceVariables(const ext::string& strFormat, time_t timeValue, const TCHAR* szNick = L"");
+ const wchar_t* stripPrefix(const wchar_t* szPrefix, const wchar_t* szText);
+ ext::string replaceVariables(const ext::string& strFormat, time_t timeValue, const wchar_t* szNick = L"");
// case conversion
ext::string toLowerCase(const ext::string& text);
@@ -45,21 +45,21 @@ namespace utils
// character conversion (wide, ansi, utf8)
ext::a::string convertWToA(const WCHAR* str, size_t len);
ext::w::string convertAToW(const char* str, size_t len);
- ext::a::string convertTToUTF8(const TCHAR* str, size_t str_len);
+ ext::a::string convertTToUTF8(const wchar_t* str, size_t str_len);
ext::string convertUTF8ToT(const char* str, size_t str_len);
size_t rawUTF8Encode(const WCHAR* pIn, size_t lenIn, char* pOut);
size_t getUTF8Len(const char* str);
// character conversion (convenience functions)
- inline ext::a::string toA(const TCHAR* str) { return convertWToA(str, ext::strfunc::len(str)); }
- inline ext::w::string toW(const TCHAR* str) { return str; }
+ inline ext::a::string toA(const wchar_t* str) { return convertWToA(str, ext::strfunc::len(str)); }
+ inline ext::w::string toW(const wchar_t* str) { return str; }
inline ext::string fromA(const char* str) { return convertAToW(str, ext::a::strfunc::len(str)); }
inline ext::string fromW(const WCHAR* str) { return str; }
inline ext::a::string toA(const ext::string& str) { return convertWToA(str.c_str(), str.length()); }
inline ext::w::string toW(const ext::string& str) { return str; }
inline ext::string fromA(const ext::a::string& str) { return convertAToW(str.c_str(), str.length()); }
inline ext::string fromW(const ext::w::string& str) { return str; }
- inline ext::a::string toUTF8(const TCHAR* str) { return convertTToUTF8(str, ext::strfunc::len(str)); }
+ inline ext::a::string toUTF8(const wchar_t* str) { return convertTToUTF8(str, ext::strfunc::len(str)); }
inline ext::string fromUTF8(const char* str) { return convertUTF8ToT(str, ext::a::strfunc::len(str)); }
inline ext::a::string toUTF8(const ext::string& str) { return convertTToUTF8(str.c_str(), str.length()); }
inline ext::string fromUTF8(const ext::a::string& str) { return convertUTF8ToT(str.c_str(), str.length()); }
@@ -133,8 +133,8 @@ class Locale
: private pattern::NotCopyable<Locale>
{
private:
- TCHAR m_DecimalPoint;
- TCHAR m_ThousandSep;
+ wchar_t m_DecimalPoint;
+ wchar_t m_ThousandSep;
ext::a::string m_Grouping;
private:
@@ -145,8 +145,8 @@ private:
public:
static void init();
- static TCHAR decimalPoint() { return m_Data.m_DecimalPoint; }
- static TCHAR thousandSep() { return m_Data.m_ThousandSep; }
+ static wchar_t decimalPoint() { return m_Data.m_DecimalPoint; }
+ static wchar_t thousandSep() { return m_Data.m_ThousandSep; }
static const char* grouping() { return m_Data.m_Grouping.c_str(); }
};
diff --git a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp
index 677cb1ff89..30c64f0d74 100644
--- a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp
+++ b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp
@@ -130,8 +130,8 @@ int initializeOptions(WPARAM wParam, LPARAM)
OptDlgPg.hInstance = hInstance;
OptDlgPg.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
OptDlgPg.pszTemplate = MAKEINTRESOURCEA(dlg_options);
- OptDlgPg.ptszGroup = LPGENT("Customize");
- OptDlgPg.ptszTitle = LPGENT("Hardware HotKeys");
+ OptDlgPg.pwszGroup = LPGENW("Customize");
+ OptDlgPg.pwszTitle = LPGENW("Hardware HotKeys");
OptDlgPg.pfnDlgProc = OptDlgProc;
OptDlgPg.hLangpack = hLangpack;
Options_AddPage(wParam, &OptDlgPg);
diff --git a/plugins/IEHistory/src/IEHistory.cpp b/plugins/IEHistory/src/IEHistory.cpp
index 6f0e9667ea..5a0460db92 100644
--- a/plugins/IEHistory/src/IEHistory.cpp
+++ b/plugins/IEHistory/src/IEHistory.cpp
@@ -77,7 +77,7 @@ extern "C" int __declspec(dllexport) Load(void)
/// menu items
CMenuItem mi;
SET_UID(mi, 0x28848d7a, 0x6995, 0x4799, 0x82, 0xd7, 0x18, 0x40, 0x3d, 0xe3, 0x71, 0xc4);
- mi.name.t = LPGENT("View &history");
+ mi.name.w = LPGENW("View &history");
mi.flags = CMIF_TCHAR;
mi.position = 1000090000;
mi.hIcolibItem = hIcon;
@@ -86,7 +86,7 @@ extern "C" int __declspec(dllexport) Load(void)
/// @todo (White-Tiger#1#08/19/14): fully implement System History someday^^
SET_UID(mi, 0xfcb4bb2a, 0xd4d8, 0x48ab, 0x94, 0xcc, 0x5b, 0xe9, 0x8d, 0x53, 0x3e, 0xf1);
- mi.name.t = LPGENT("&System History");
+ mi.name.w = LPGENW("&System History");
Menu_AddMainMenuItem(&mi);
HookEvents();
diff --git a/plugins/IEHistory/src/dlgHandlers.cpp b/plugins/IEHistory/src/dlgHandlers.cpp
index 836599dd8e..a56e975015 100644
--- a/plugins/IEHistory/src/dlgHandlers.cpp
+++ b/plugins/IEHistory/src/dlgHandlers.cpp
@@ -69,8 +69,8 @@ void LoadName(HWND hWnd)
SetWindowText(hWnd, TranslateT("System History"));
return;
}
- TCHAR *szOther = GetContactName(data->contact);
- TCHAR buffer[1024];
+ wchar_t *szOther = GetContactName(data->contact);
+ wchar_t buffer[1024];
sntprintf(buffer, 1024, L"'%s' - IEHistory", szOther);
SetWindowText(hWnd, buffer);
mir_free(szOther);
@@ -227,7 +227,7 @@ int DoLoadEvents(HWND hWnd, HistoryWindowData *data, IEVIEWEVENT ieEvent)
CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&ieEvent);
ScrollToBottom(hWnd);
- TCHAR buffer[256];
+ wchar_t buffer[256];
itot(data->index + 1, buffer, 10);
SendDlgItemMessage(hWnd, IDC_STATUSBAR, SB_SETTEXT, 0 | SBT_POPOUT, (LPARAM)buffer);
itot(data->index + ieEvent.count, buffer, 10);
@@ -501,7 +501,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
CheckDlgButton(hWnd, IDC_SHOW_LAST_FIRST, db_get_b(NULL, ModuleName, "ShowLastPageFirst", 0) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_LOAD_BACKGROUND, db_get_b(NULL, ModuleName, "UseWorkerThread", 0) ? BST_CHECKED : BST_UNCHECKED);
- TCHAR buffer[40];
+ wchar_t buffer[40];
_itot_s(count, buffer, 10);
SetDlgItemText(hWnd, IDC_EVENTS_COUNT, buffer);
}
@@ -539,7 +539,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
if (IsDlgButtonChecked(hWnd, IDC_LOAD_ALL))
count = 0;
else {
- TCHAR buffer[1024];
+ wchar_t buffer[1024];
GetDlgItemText(hWnd, IDC_EVENTS_COUNT, buffer, _countof(buffer));
count = _tstol(buffer);
count = (count < 0) ? 0 : count;
@@ -636,7 +636,7 @@ INT_PTR CALLBACK SearchDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam
data->hLastFoundEvent = GetNeededEvent(data->hLastFoundEvent, 1, direction);
if (type == SEARCH_TEXT) { //text search
- TCHAR text[2048]; //TODO buffer overrun
+ wchar_t text[2048]; //TODO buffer overrun
GetDlgItemText(hWnd, IDC_SEARCH_TEXT, text, _countof(text));
searchResult = SearchHistory(data->contact, data->hLastFoundEvent, text, direction, type);
}
diff --git a/plugins/IEHistory/src/events.cpp b/plugins/IEHistory/src/events.cpp
index f9cc9c4c56..67edd36a56 100644
--- a/plugins/IEHistory/src/events.cpp
+++ b/plugins/IEHistory/src/events.cpp
@@ -39,7 +39,7 @@ int OnOptionsInitialize(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 100000000;
- odp.ptszTitle = LPGENT("History");
+ odp.pwszTitle = LPGENW("History");
odp.pfnDlgProc = OptionsDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_HISTORY);
odp.hInstance = hInstance;
diff --git a/plugins/IEHistory/src/utils.cpp b/plugins/IEHistory/src/utils.cpp
index d34557b094..090033c533 100644
--- a/plugins/IEHistory/src/utils.cpp
+++ b/plugins/IEHistory/src/utils.cpp
@@ -78,10 +78,10 @@ int Info(char *title, char *format, ...)
returns the name of a contact
*/
-TCHAR* GetContactName(MCONTACT contact)
+wchar_t* GetContactName(MCONTACT contact)
{
ptrT name(Contact_GetInfo(CNF_DISPLAY, contact));
- return (name) ? _tcsdup(name) : NULL;
+ return (name) ? wcsdup(name) : NULL;
}
/*
@@ -211,7 +211,7 @@ SearchResult SearchHistory(MCONTACT contact, MEVENT hFirstEvent, void *searchDat
int index = 0;
MEVENT hEvent = hFirstEvent;
void *buffer = NULL;
- TCHAR *search;
+ wchar_t *search;
bool found = false;
int oldSize, newSize;
oldSize = newSize = 0;
@@ -223,7 +223,7 @@ SearchResult SearchHistory(MCONTACT contact, MEVENT hFirstEvent, void *searchDat
newSize = db_event_getBlobSize(hEvent);
if (newSize > oldSize)
{
- buffer = (TCHAR *)realloc(buffer, newSize);
+ buffer = (wchar_t *)realloc(buffer, newSize);
oldSize = newSize;
}
dbEvent.pBlob = (PBYTE)buffer;
@@ -247,8 +247,8 @@ SearchResult SearchHistory(MCONTACT contact, MEVENT hFirstEvent, void *searchDat
#else
search = (char *) buffer;
#endif
- TCHAR *data = (TCHAR *)searchData;
- TCHAR *tmp = _tcsstr(search, data);
+ wchar_t *data = (wchar_t *)searchData;
+ wchar_t *tmp = wcsstr(search, data);
if (tmp)
{
found = true;
diff --git a/plugins/IEHistory/src/utils.h b/plugins/IEHistory/src/utils.h
index 7cdf8186f6..6cb2b71370 100644
--- a/plugins/IEHistory/src/utils.h
+++ b/plugins/IEHistory/src/utils.h
@@ -68,7 +68,7 @@ int Log(char *format, ...);
void ScreenToClient(HWND hWnd, LPRECT rect);
int Info(char *title, char *format, ...);
-TCHAR *GetContactName(MCONTACT contact);
+wchar_t *GetContactName(MCONTACT contact);
void AnchorMoveWindow(HWND window, const WINDOWPOS *parentPos, int anchors);
RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos, int anchors);
diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp
index 24d39ed408..c43c1dc415 100644
--- a/plugins/IEView/src/HTMLBuilder.cpp
+++ b/plugins/IEView/src/HTMLBuilder.cpp
@@ -193,7 +193,7 @@ void HTMLBuilder::getUINs(MCONTACT hContact, char *&uinIn, char *&uinOut)
wchar_t* HTMLBuilder::getContactName(MCONTACT hContact, const char *szProto)
{
- TCHAR *str = Contact_GetInfo(CNF_DISPLAY, hContact, szProto);
+ wchar_t *str = Contact_GetInfo(CNF_DISPLAY, hContact, szProto);
if (str != NULL)
return str;
diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp
index 94495a434c..f99da29479 100644
--- a/plugins/IEView/src/Options.cpp
+++ b/plugins/IEView/src/Options.cpp
@@ -38,14 +38,14 @@ struct
{
DLGPROC dlgProc;
DWORD dlgId;
- TCHAR *tabName;
+ wchar_t *tabName;
}
static tabPages[] =
{
- { IEViewGeneralOptDlgProc, IDD_GENERAL_OPTIONS, LPGENT("General") },
- { IEViewSRMMOptDlgProc, IDD_SRMM_OPTIONS, LPGENT("Message Log") },
- { IEViewGroupChatsOptDlgProc, IDD_SRMM_OPTIONS, LPGENT("Group chats") },
- { IEViewHistoryOptDlgProc, IDD_SRMM_OPTIONS, LPGENT("History") }
+ { IEViewGeneralOptDlgProc, IDD_GENERAL_OPTIONS, LPGENW("General") },
+ { IEViewSRMMOptDlgProc, IDD_SRMM_OPTIONS, LPGENW("Message Log") },
+ { IEViewGroupChatsOptDlgProc, IDD_SRMM_OPTIONS, LPGENW("Group chats") },
+ { IEViewHistoryOptDlgProc, IDD_SRMM_OPTIONS, LPGENW("History") }
};
static LPARAM GetItemParam(HWND hwndTreeView, HTREEITEM hItem)
@@ -437,20 +437,20 @@ int IEViewOptInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInstance;
- odp.ptszGroup = LPGENT("Message sessions");
- odp.ptszTitle = LPGENT("IEView");
+ odp.pwszGroup = LPGENW("Message sessions");
+ odp.pwszTitle = LPGENW("IEView");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pszTemplate = MAKEINTRESOURCEA(tabPages[0].dlgId);
odp.pfnDlgProc = tabPages[0].dlgProc;
- odp.ptszTab = tabPages[0].tabName;
+ odp.pwszTab = tabPages[0].tabName;
Options_AddPage(wParam, &odp);
- odp.ptszGroup = LPGENT("Skins");
- odp.ptszTitle = LPGENT("IEView");
+ odp.pwszGroup = LPGENW("Skins");
+ odp.pwszTitle = LPGENW("IEView");
for (size_t i = 1; i < _countof(tabPages); i++) {
odp.pszTemplate = MAKEINTRESOURCEA(tabPages[i].dlgId);
odp.pfnDlgProc = tabPages[i].dlgProc;
- odp.ptszTab = tabPages[i].tabName;
+ odp.pwszTab = tabPages[i].tabName;
Options_AddPage(wParam, &odp);
}
return 0;
@@ -509,7 +509,7 @@ static INT_PTR CALLBACK IEViewGeneralOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w
EnableWindow(GetDlgItem(hwndDlg, IDC_SMILEYS_IN_NAMES), Options::isSmileyAdd());
EnableWindow(GetDlgItem(hwndDlg, IDC_EMBED_SIZE), IsDlgButtonChecked(hwndDlg, IDC_ENABLE_EMBED));
{
- TCHAR* size[] = { L"320 x 205", L"480 x 385", L"560 x 349", L"640 x 390" };
+ wchar_t* size[] = { L"320 x 205", L"480 x 385", L"560 x 349", L"640 x 390" };
for (int i = 0; i < _countof(size); ++i) {
int item = SendDlgItemMessage(hwndDlg, IDC_EMBED_SIZE, CB_ADDSTRING, 0, (LPARAM)TranslateTS(size[i]));
SendDlgItemMessage(hwndDlg, IDC_EMBED_SIZE, CB_SETITEMDATA, item, 0);
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp
index 49ee57bc83..c0712adff6 100644
--- a/plugins/IEView/src/TemplateHTMLBuilder.cpp
+++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp
@@ -35,8 +35,8 @@ TemplateHTMLBuilder::~TemplateHTMLBuilder()
char* TemplateHTMLBuilder::getAvatar(MCONTACT hContact, const char *szProto)
{
DBVARIANT dbv;
- TCHAR tmpPath[MAX_PATH];
- TCHAR *result = NULL;
+ wchar_t tmpPath[MAX_PATH];
+ wchar_t *result = NULL;
if (Options::getAvatarServiceFlags() == Options::AVATARSERVICE_PRESENT) {
avatarCacheEntry *ace;
@@ -54,11 +54,11 @@ char* TemplateHTMLBuilder::getAvatar(MCONTACT hContact, const char *szProto)
}
if (!db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
if (mir_tstrlen(dbv.ptszVal) > 0) {
- //TCHAR *ext = _tcsrchr(dbv.ptszVal, '.');
+ //wchar_t *ext = wcsrchr(dbv.ptszVal, '.');
if (result == NULL) {
/* relative -> absolute */
mir_tstrcpy(tmpPath, dbv.ptszVal);
- if (_tcsncmp(tmpPath, L"http://", 7))
+ if (wcsncmp(tmpPath, L"http://", 7))
PathToAbsoluteT(dbv.ptszVal, tmpPath);
result = tmpPath;
}
@@ -83,7 +83,7 @@ int TemplateHTMLBuilder::getFlags(ProtocolSettings * protoSettings)
char *TemplateHTMLBuilder::timestampToString(DWORD dwFlags, time_t check, int mode)
{
static char szResult[512]; szResult[0] = '\0';
- TCHAR str[300];
+ wchar_t str[300];
if (mode) // time
TimeZone_ToStringT(check, (dwFlags & Options::LOG_SHOW_SECONDS) ? L"s" : L"t", str, _countof(str));
@@ -96,9 +96,9 @@ char *TemplateHTMLBuilder::timestampToString(DWORD dwFlags, time_t check, int mo
tm_today.tm_hour = tm_today.tm_min = tm_today.tm_sec = 0;
today = mktime(&tm_today);
if (dwFlags & Options::LOG_RELATIVE_DATE && check >= today)
- _tcsncpy(str, TranslateT("Today"), _countof(str));
+ wcsncpy(str, TranslateT("Today"), _countof(str));
else if (dwFlags & Options::LOG_RELATIVE_DATE && check > (today - 86400))
- _tcsncpy(str, TranslateT("Yesterday"), _countof(str));
+ wcsncpy(str, TranslateT("Yesterday"), _countof(str));
else
TimeZone_ToStringT(check, (dwFlags & Options::LOG_LONG_DATE) ? L"D" : L"d", str, _countof(str));
}
@@ -152,13 +152,13 @@ void TemplateHTMLBuilder::buildHeadTemplate(IEView *view, IEVIEWEVENT *event, Pr
szNameIn = mir_strdup("&nbsp;");
}
mir_snprintf(tempStr, "%snoavatar.png", tempBase);
- TCHAR szNoAvatarPath[MAX_PATH];
- _tcsncpy_s(szNoAvatarPath, _A2T(protoSettings->getSRMMTemplateFilename()), _TRUNCATE);
- TCHAR *szNoAvatarPathTmp = _tcsrchr(szNoAvatarPath, '\\');
+ wchar_t szNoAvatarPath[MAX_PATH];
+ wcsncpy_s(szNoAvatarPath, _A2T(protoSettings->getSRMMTemplateFilename()), _TRUNCATE);
+ wchar_t *szNoAvatarPathTmp = wcsrchr(szNoAvatarPath, '\\');
if (szNoAvatarPathTmp != NULL)
*szNoAvatarPathTmp = 0;
mir_tstrcat(szNoAvatarPath, L"\\noavatar.png");
- if (_taccess(szNoAvatarPath, 0) == -1)
+ if (_waccess(szNoAvatarPath, 0) == -1)
mir_snprintf(tempStr, "%snoavatar.jpg", tempBase);
else
mir_snprintf(tempStr, "%snoavatar.png", tempBase);
@@ -321,13 +321,13 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event,
szNameIn = mir_strdup("&nbsp;");
}
- TCHAR szNoAvatarPath[MAX_PATH];
- _tcsncpy_s(szNoAvatarPath, _A2T(protoSettings->getSRMMTemplateFilename()), _TRUNCATE);
- TCHAR *szNoAvatarPathTmp = _tcsrchr(szNoAvatarPath, '\\');
+ wchar_t szNoAvatarPath[MAX_PATH];
+ wcsncpy_s(szNoAvatarPath, _A2T(protoSettings->getSRMMTemplateFilename()), _TRUNCATE);
+ wchar_t *szNoAvatarPathTmp = wcsrchr(szNoAvatarPath, '\\');
if (szNoAvatarPathTmp != NULL)
*szNoAvatarPathTmp = 0;
mir_tstrcat(szNoAvatarPath, L"\\noavatar.png");
- if (_taccess(szNoAvatarPath, 0) == -1)
+ if (_waccess(szNoAvatarPath, 0) == -1)
mir_snprintf(tempStr, "%snoavatar.jpg", tempBase);
else
mir_snprintf(tempStr, "%snoavatar.png", tempBase);
diff --git a/plugins/IEView/src/external_funcs.cpp b/plugins/IEView/src/external_funcs.cpp
index d5c75e5e89..3ca5d06151 100644
--- a/plugins/IEView/src/external_funcs.cpp
+++ b/plugins/IEView/src/external_funcs.cpp
@@ -40,7 +40,7 @@ namespace External
WPARAM wParam = Var_To<WPARAM>(pDispParams->rgvarg[1], wType);
LPARAM lParam = Var_To<LPARAM>(pDispParams->rgvarg[0], lType);
- INT_PTR res = CallService(_T2A((TCHAR*)szName), wParam, lParam);
+ INT_PTR res = CallService(_T2A((wchar_t*)szName), wParam, lParam);
if (wType == 'A' || wType == 'U') mir_free((void*)wParam);
if (lType == 'A' || lType == 'U') mir_free((void*)lParam);
@@ -67,7 +67,7 @@ namespace External
WPARAM wParam = Var_To<WPARAM>(pDispParams->rgvarg[1], wType);
LPARAM lParam = Var_To<LPARAM>(pDispParams->rgvarg[0], lType);
- INT_PTR res = ProtoChainSend(hContact, _T2A((TCHAR*)szName), wParam, lParam);
+ INT_PTR res = ProtoChainSend(hContact, _T2A((wchar_t*)szName), wParam, lParam);
if (wType == 'A' || wType == 'U') mir_free((void*)wParam);
if (lType == 'A' || lType == 'U') mir_free((void*)lParam);
@@ -101,7 +101,7 @@ namespace External
DBVARIANT dbv = { 0 };
- if (db_get(hContact, _T2A((TCHAR*)szModule), _T2A((TCHAR*)szSetting), &dbv))
+ if (db_get(hContact, _T2A((wchar_t*)szModule), _T2A((wchar_t*)szSetting), &dbv))
return S_OK;
if (pVarResult != nullptr)
@@ -175,7 +175,7 @@ namespace External
return E_INVALIDARG;
}
- INT_PTR res = ::db_set(hContact, _T2A((TCHAR*)szModule), _T2A((TCHAR*)szSetting), &dbv);
+ INT_PTR res = ::db_set(hContact, _T2A((wchar_t*)szModule), _T2A((wchar_t*)szSetting), &dbv);
if (pVarResult != nullptr)
{
@@ -210,14 +210,14 @@ namespace External
if (OpenClipboard(NULL))
{
EmptyClipboard();
- size_t size = sizeof(TCHAR)* (mir_wstrlen(data) + 1);
+ size_t size = sizeof(wchar_t)* (mir_wstrlen(data) + 1);
HGLOBAL hClipboardData = GlobalAlloc(0, size);
if (hClipboardData)
{
- TCHAR *pchData = (TCHAR*)GlobalLock(hClipboardData);
+ wchar_t *pchData = (wchar_t*)GlobalLock(hClipboardData);
if (pchData)
{
- memcpy(pchData, (TCHAR*)data, size);
+ memcpy(pchData, (wchar_t*)data, size);
GlobalUnlock(hClipboardData);
SetClipboardData(CF_UNICODETEXT, hClipboardData);
}
diff --git a/plugins/IEView/src/ieview_main.cpp b/plugins/IEView/src/ieview_main.cpp
index 852bc3ccaf..ecf69d2561 100644
--- a/plugins/IEView/src/ieview_main.cpp
+++ b/plugins/IEView/src/ieview_main.cpp
@@ -60,7 +60,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
extern "C" int __declspec(dllexport) Load(void)
{
int wdsize = GetCurrentDirectory(0, NULL);
- TCHAR *workingDir = new TCHAR[wdsize];
+ wchar_t *workingDir = new wchar_t[wdsize];
GetCurrentDirectory(wdsize, workingDir);
Utils::convertPath(workingDir);
workingDirUtf8 = mir_utf8encodeT(workingDir);
diff --git a/plugins/IgnoreState/src/main.cpp b/plugins/IgnoreState/src/main.cpp
index 17768316b0..e83b181864 100644
--- a/plugins/IgnoreState/src/main.cpp
+++ b/plugins/IgnoreState/src/main.cpp
@@ -33,14 +33,14 @@ INT currentFilter = 0;
INT clistIcon = 0; //Icon slot to use
IGNOREITEMS ii[] = {
- { LPGENT("All"), IGNOREEVENT_ALL, SKINICON_OTHER_FILLEDBLOB },
- { LPGENT("Messages"), IGNOREEVENT_MESSAGE, SKINICON_EVENT_MESSAGE },
- { LPGENT("URL"), IGNOREEVENT_URL, SKINICON_EVENT_URL },
- { LPGENT("Files"), IGNOREEVENT_FILE, SKINICON_EVENT_FILE },
- { LPGENT("User Online"), IGNOREEVENT_USERONLINE, SKINICON_OTHER_USERONLINE },
- { LPGENT("Authorization"), IGNOREEVENT_AUTHORIZATION, SKINICON_OTHER_MIRANDA },
- { LPGENT("You Were Added"), IGNOREEVENT_YOUWEREADDED, SKINICON_OTHER_ADDCONTACT },
- { LPGENT("Typing Notify"), IGNOREEVENT_TYPINGNOTIFY, SKINICON_OTHER_TYPING }
+ { LPGENW("All"), IGNOREEVENT_ALL, SKINICON_OTHER_FILLEDBLOB },
+ { LPGENW("Messages"), IGNOREEVENT_MESSAGE, SKINICON_EVENT_MESSAGE },
+ { LPGENW("URL"), IGNOREEVENT_URL, SKINICON_EVENT_URL },
+ { LPGENW("Files"), IGNOREEVENT_FILE, SKINICON_EVENT_FILE },
+ { LPGENW("User Online"), IGNOREEVENT_USERONLINE, SKINICON_OTHER_USERONLINE },
+ { LPGENW("Authorization"), IGNOREEVENT_AUTHORIZATION, SKINICON_OTHER_MIRANDA },
+ { LPGENW("You Were Added"), IGNOREEVENT_YOUWEREADDED, SKINICON_OTHER_ADDCONTACT },
+ { LPGENW("Typing Notify"), IGNOREEVENT_TYPINGNOTIFY, SKINICON_OTHER_TYPING }
};
int nII = _countof(ii);
diff --git a/plugins/IgnoreState/src/stdafx.h b/plugins/IgnoreState/src/stdafx.h
index 979b893ece..4ba2b7e83a 100644
--- a/plugins/IgnoreState/src/stdafx.h
+++ b/plugins/IgnoreState/src/stdafx.h
@@ -41,7 +41,7 @@
struct IGNOREITEMS
{
- TCHAR* name;
+ wchar_t* name;
int type;
int icon;
bool filtered;
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp
index 920bf8b15d..c19816d33c 100644
--- a/plugins/Import/src/import.cpp
+++ b/plugins/Import/src/import.cpp
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct AccountMap
{
- AccountMap(const char *_src, int _origIdx, const TCHAR *_srcName) :
+ AccountMap(const char *_src, int _origIdx, const wchar_t *_srcName) :
szSrcAcc(mir_strdup(_src)),
iSrcIndex(_origIdx),
tszSrcName(mir_tstrdup(_srcName)),
@@ -72,10 +72,10 @@ static MIDatabase *srcDb, *dstDb;
/////////////////////////////////////////////////////////////////////////////////////////
-void AddMessage(const TCHAR* fmt, ...)
+void AddMessage(const wchar_t* fmt, ...)
{
va_list args;
- TCHAR msgBuf[4096];
+ wchar_t msgBuf[4096];
va_start(args, fmt);
mir_vsntprintf(msgBuf, _countof(msgBuf), TranslateTS(fmt), args);
@@ -111,7 +111,7 @@ static int myGetD(MCONTACT hContact, const char *szModule, const char *szSetting
return srcDb->GetContactSetting(hContact, szModule, szSetting, &dbv) ? iDefault : dbv.dVal;
}
-static TCHAR* myGetWs(MCONTACT hContact, const char *szModule, const char *szSetting)
+static wchar_t* myGetWs(MCONTACT hContact, const char *szModule, const char *szSetting)
{
DBVARIANT dbv = { DBVT_TCHAR };
return srcDb->GetContactSettingStr(hContact, szModule, szSetting, &dbv) ? NULL : dbv.ptszVal;
@@ -138,7 +138,7 @@ static MCONTACT HContactFromNumericID(char *pszProtoName, char *pszSetting, DWOR
return INVALID_CONTACT_ID;
}
-static MCONTACT HContactFromID(char *pszProtoName, char *pszSetting, TCHAR *pwszID)
+static MCONTACT HContactFromID(char *pszProtoName, char *pszSetting, wchar_t *pwszID)
{
for (MCONTACT hContact = dstDb->FindFirstContact(); hContact; hContact = dstDb->FindNextContact(hContact)) {
char *szProto = GetContactProto(hContact);
@@ -230,7 +230,7 @@ static LRESULT CALLBACK ListWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
ListView_GetSubItemRect(hwnd, hit.iItem, 1, LVIR_BOUNDS, &r);
r.top--; r.bottom--;
- TCHAR tszText[100];
+ wchar_t tszText[100];
ListView_GetItemText(hwnd, hit.iItem, 1, tszText, _countof(tszText));
LVITEM lvitem;
@@ -369,7 +369,7 @@ static bool FindDestAccount(const char *szProto)
return false;
}
-static PROTOACCOUNT* FindMyAccount(const char *szProto, const char *szBaseProto, const TCHAR *ptszName, bool bStrict)
+static PROTOACCOUNT* FindMyAccount(const char *szProto, const char *szBaseProto, const wchar_t *ptszName, bool bStrict)
{
int destProtoCount;
PROTOACCOUNT **destAccs;
@@ -469,7 +469,7 @@ bool ImportAccounts(OBJLIST<char> &arSkippedModules)
continue;
if (!Proto_IsProtocolLoaded(p.szBaseProto)) {
- AddMessage(LPGENT("Protocol %S is not loaded, skipping account %s creation"), p.szBaseProto, p.tszSrcName);
+ AddMessage(LPGENW("Protocol %S is not loaded, skipping account %s creation"), p.szBaseProto, p.tszSrcName);
continue;
}
@@ -480,7 +480,7 @@ bool ImportAccounts(OBJLIST<char> &arSkippedModules)
p.pa = ProtoCreateAccount(&newacc);
if (p.pa == NULL) {
- AddMessage(LPGENT("Unable to create an account %s of protocol %S"), p.tszSrcName, p.szBaseProto);
+ AddMessage(LPGENW("Unable to create an account %s of protocol %S"), p.tszSrcName, p.szBaseProto);
return false;
}
@@ -525,12 +525,12 @@ static MCONTACT MapContact(MCONTACT hSrc)
return (pDestContact == NULL) ? INVALID_CONTACT_ID : pDestContact->dstID;
}
-static MCONTACT AddContact(char *szProto, char *pszUniqueSetting, DBVARIANT *id, const TCHAR *pszUserID, TCHAR *nick, TCHAR *group)
+static MCONTACT AddContact(char *szProto, char *pszUniqueSetting, DBVARIANT *id, const wchar_t *pszUserID, wchar_t *nick, wchar_t *group)
{
MCONTACT hContact = CallService(MS_DB_CONTACT_ADD, 0, 0);
if (Proto_AddToContact(hContact, szProto) != 0) {
CallService(MS_DB_CONTACT_DELETE, hContact, 0);
- AddMessage(LPGENT("Failed to add %S contact %s"), szProto, pszUserID);
+ AddMessage(LPGENW("Failed to add %S contact %s"), szProto, pszUserID);
return INVALID_CONTACT_ID;
}
@@ -540,9 +540,9 @@ static MCONTACT AddContact(char *szProto, char *pszUniqueSetting, DBVARIANT *id,
if (nick && *nick) {
db_set_ws(hContact, "CList", "MyHandle", nick);
- AddMessage(LPGENT("Added %S contact %s, '%s'"), szProto, pszUserID, nick);
+ AddMessage(LPGENW("Added %S contact %s, '%s'"), szProto, pszUserID, nick);
}
- else AddMessage(LPGENT("Added %S contact %s"), szProto, pszUserID);
+ else AddMessage(LPGENW("Added %S contact %s"), szProto, pszUserID);
srcDb->FreeVariant(id);
return hContact;
@@ -582,7 +582,7 @@ static int ImportGroup(const char* szSettingName, LPARAM lParam)
{
int *pnGroups = (int*)lParam;
- TCHAR *tszGroup = myGetWs(NULL, "CListGroups", szSettingName);
+ wchar_t *tszGroup = myGetWs(NULL, "CListGroups", szSettingName);
if (tszGroup != NULL) {
if (CreateGroup(tszGroup + 1, NULL))
pnGroups[0]++;
@@ -659,7 +659,7 @@ void ImportMeta(DBCachedContact *ccSrc)
if (ccDst == NULL) {
MCONTACT hDest = FindExistingMeta(ccSrc);
if (hDest == 0) {
- AddMessage(LPGENT("Metacontact cannot be imported due to its ambiguity."));
+ AddMessage(LPGENW("Metacontact cannot be imported due to its ambiguity."));
return;
}
@@ -714,14 +714,14 @@ void ImportMeta(DBCachedContact *ccSrc)
if (tszNick && *tszNick) {
db_set_ws(hDest, "CList", "MyHandle", tszNick);
- AddMessage(LPGENT("Added metacontact '%s'"), tszNick);
+ AddMessage(LPGENW("Added metacontact '%s'"), tszNick);
}
- else AddMessage(LPGENT("Added metacontact"));
+ else AddMessage(LPGENW("Added metacontact"));
}
PROTOACCOUNT *pa = Proto_GetAccount(META_PROTO);
if (pa) {
- AccountMap pda(META_PROTO, 0, _T(META_PROTO));
+ AccountMap pda(META_PROTO, 0, META_PROTOW);
ImportContactSettings(&pda, ccSrc->contactID, ccDst->contactID);
}
@@ -735,7 +735,7 @@ static MCONTACT ImportContact(MCONTACT hSrc)
// Check what protocol this contact belongs to
DBCachedContact *cc = srcDb->m_cache->GetCachedContact(hSrc);
if (cc == NULL || cc->szProto == NULL) {
- AddMessage(LPGENT("Skipping contact with no protocol"));
+ AddMessage(LPGENW("Skipping contact with no protocol"));
return NULL;
}
@@ -746,40 +746,40 @@ static MCONTACT ImportContact(MCONTACT hSrc)
AccountMap *pda = arAccountMap.find((AccountMap*)&cc->szProto);
if (pda == NULL || pda->pa == NULL) {
- AddMessage(LPGENT("Skipping contact, account %S cannot be mapped."), cc->szProto);
+ AddMessage(LPGENW("Skipping contact, account %S cannot be mapped."), cc->szProto);
return NULL;
}
if (!Proto_GetAccount(pda->pa->szModuleName)) {
- AddMessage(LPGENT("Skipping contact, %S not installed."), cc->szProto);
+ AddMessage(LPGENW("Skipping contact, %S not installed."), cc->szProto);
return NULL;
}
// Skip protocols with no unique id setting (some non IM protocols return NULL)
char *pszUniqueSetting = (char*)CallProtoService(pda->pa->szModuleName, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
if (!pszUniqueSetting || (INT_PTR)pszUniqueSetting == CALLSERVICE_NOTFOUND) {
- AddMessage(LPGENT("Skipping non-IM contact (%S)"), cc->szProto);
+ AddMessage(LPGENW("Skipping non-IM contact (%S)"), cc->szProto);
return NULL;
}
DBVARIANT dbv;
if (myGet(hSrc, cc->szProto, pszUniqueSetting, &dbv)) {
- AddMessage(LPGENT("Skipping %S contact, ID not found"), cc->szProto);
+ AddMessage(LPGENW("Skipping %S contact, ID not found"), cc->szProto);
return NULL;
}
// Does the contact already exist?
- TCHAR id[40], *pszUniqueID;
+ wchar_t id[40], *pszUniqueID;
MCONTACT hDst;
switch (dbv.type) {
case DBVT_DWORD:
- pszUniqueID = _ltot(dbv.dVal, id, 10);
+ pszUniqueID = _ltow(dbv.dVal, id, 10);
hDst = HContactFromNumericID(pda->pa->szModuleName, pszUniqueSetting, dbv.dVal);
break;
case DBVT_ASCIIZ:
case DBVT_UTF8:
- pszUniqueID = NEWTSTR_ALLOCA(_A2T(dbv.pszVal));
+ pszUniqueID = NEWWSTR_ALLOCA(_A2T(dbv.pszVal));
hDst = HContactFromID(pda->pa->szModuleName, pszUniqueSetting, pszUniqueID);
break;
@@ -789,7 +789,7 @@ static MCONTACT ImportContact(MCONTACT hSrc)
}
if (hDst != INVALID_CONTACT_ID) {
- AddMessage(LPGENT("Skipping duplicate %S contact %s"), cc->szProto, pszUniqueID);
+ AddMessage(LPGENW("Skipping duplicate %S contact %s"), cc->szProto, pszUniqueID);
srcDb->FreeVariant(&dbv);
arContactMap.insert(new ContactMap(hSrc, hDst));
return NULL;
@@ -801,7 +801,7 @@ static MCONTACT ImportContact(MCONTACT hSrc)
hDst = AddContact(pda->pa->szModuleName, pszUniqueSetting, &dbv, pszUniqueID, tszNick, tszGroup);
if (hDst == INVALID_CONTACT_ID) {
- AddMessage(LPGENT("Unknown error while adding %S contact %s"), pda->pa->szModuleName, pszUniqueID);
+ AddMessage(LPGENW("Unknown error while adding %S contact %s"), pda->pa->szModuleName, pszUniqueID);
return INVALID_CONTACT_ID;
}
@@ -939,7 +939,7 @@ static void ImportHistory(MCONTACT hContact, PROTOACCOUNT **protocol, int protoC
if (dstDb->AddEvent(hOwner, &dbei) != NULL)
nMessagesCount++;
else
- AddMessage(LPGENT("Failed to add message"));
+ AddMessage(LPGENW("Failed to add message"));
}
}
else nDupes++;
@@ -973,18 +973,18 @@ void MirandaImport(HWND hdlg)
hdlgProgress = hdlg;
if ((dstDb = GetCurrentDatabase()) == NULL) {
- AddMessage(LPGENT("Error retrieving current profile, exiting."));
+ AddMessage(LPGENW("Error retrieving current profile, exiting."));
return;
}
DATABASELINK *dblink = FindDatabasePlugin(importFile);
if (dblink == NULL) {
- AddMessage(LPGENT("There's no database driver to open the input file, exiting."));
+ AddMessage(LPGENW("There's no database driver to open the input file, exiting."));
return;
}
if ((srcDb = dblink->Load(importFile, TRUE)) == NULL) {
- AddMessage(LPGENT("Error loading source file, exiting."));
+ AddMessage(LPGENW("Error loading source file, exiting."));
return;
}
@@ -999,7 +999,7 @@ void MirandaImport(HWND hdlg)
// Get number of contacts
int nNumberOfContacts = srcDb->GetContactCount();
- AddMessage(LPGENT("Number of contacts in database: %d"), nNumberOfContacts);
+ AddMessage(LPGENW("Number of contacts in database: %d"), nNumberOfContacts);
AddMessage(L"");
// Configure database for fast writing
@@ -1010,7 +1010,7 @@ void MirandaImport(HWND hdlg)
OBJLIST<char> arSkippedAccs(1, CompareModules);
if (!ImportAccounts(arSkippedAccs)) {
- AddMessage(LPGENT("Error mapping accounts, exiting."));
+ AddMessage(LPGENW("Error mapping accounts, exiting."));
return;
}
@@ -1021,10 +1021,10 @@ void MirandaImport(HWND hdlg)
// Import Groups
if (nImportOptions & IOPT_GROUPS) {
- AddMessage(LPGENT("Importing groups."));
+ AddMessage(LPGENW("Importing groups."));
nGroupsCount = ImportGroups();
if (nGroupsCount == -1)
- AddMessage(LPGENT("Group import failed."));
+ AddMessage(LPGENW("Group import failed."));
AddMessage(L"");
}
@@ -1032,7 +1032,7 @@ void MirandaImport(HWND hdlg)
// Import Contacts
if (nImportOptions & IOPT_CONTACTS) {
- AddMessage(LPGENT("Importing contacts."));
+ AddMessage(LPGENW("Importing contacts."));
int i = 1;
MCONTACT hContact = srcDb->FindFirstContact();
while (hContact != NULL) {
@@ -1056,13 +1056,13 @@ void MirandaImport(HWND hdlg)
for (i = 0; i < arMetas.getCount(); i++)
ImportMeta(arMetas[i]);
}
- else AddMessage(LPGENT("Skipping new contacts import."));
+ else AddMessage(LPGENW("Skipping new contacts import."));
AddMessage(L"");
// End of Import Contacts
// Import NULL contact message chain
if (nImportOptions & IOPT_SYSTEM) {
- AddMessage(LPGENT("Importing system history."));
+ AddMessage(LPGENW("Importing system history."));
int protoCount;
PROTOACCOUNT **accs;
@@ -1071,12 +1071,12 @@ void MirandaImport(HWND hdlg)
if (protoCount > 0)
ImportHistory(NULL, accs, protoCount);
}
- else AddMessage(LPGENT("Skipping system history import."));
+ else AddMessage(LPGENW("Skipping system history import."));
AddMessage(L"");
// Import other contact messages
if (nImportOptions & IOPT_HISTORY) {
- AddMessage(LPGENT("Importing history."));
+ AddMessage(LPGENW("Importing history."));
MCONTACT hContact = srcDb->FindFirstContact();
for (int i = 1; hContact != NULL; i++) {
ImportHistory(hContact, NULL, NULL);
@@ -1085,7 +1085,7 @@ void MirandaImport(HWND hdlg)
hContact = srcDb->FindNextContact(hContact);
}
}
- else AddMessage(LPGENT("Skipping history import."));
+ else AddMessage(LPGENW("Skipping history import."));
AddMessage(L"");
// Restore database writing mode
@@ -1098,17 +1098,17 @@ void MirandaImport(HWND hdlg)
dwTimer = time(NULL) - dwTimer;
// Print statistics
- AddMessage(LPGENT("Import completed in %d seconds."), dwTimer);
+ AddMessage(LPGENW("Import completed in %d seconds."), dwTimer);
SetProgress(100);
AddMessage(nMessagesCount == 0 ?
- LPGENT("Added %d contacts and %d groups.") : LPGENT("Added %d contacts, %d groups and %d events."),
+ LPGENW("Added %d contacts and %d groups.") : LPGENW("Added %d contacts, %d groups and %d events."),
nContactsCount, nGroupsCount, nMessagesCount);
if (nSkippedContacts)
- AddMessage(LPGENT("Skipped %d contacts."), nSkippedContacts);
+ AddMessage(LPGENW("Skipped %d contacts."), nSkippedContacts);
if (nDupes || nSkippedEvents)
- AddMessage(LPGENT("Skipped %d duplicates and %d filtered events."), nDupes, nSkippedEvents);
+ AddMessage(LPGENW("Skipped %d duplicates and %d filtered events."), nDupes, nSkippedEvents);
arMetas.destroy();
arAccountMap.destroy();
diff --git a/plugins/Import/src/miranda.cpp b/plugins/Import/src/miranda.cpp
index cbddcb5836..dc4c5c86f8 100644
--- a/plugins/Import/src/miranda.cpp
+++ b/plugins/Import/src/miranda.cpp
@@ -24,15 +24,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
time_t dwSinceDate = 0;
-TCHAR importFile[MAX_PATH];
+wchar_t importFile[MAX_PATH];
//=======================================================================================
// Profile selection dialog
-static void SearchForLists(HWND hwndDlg, const TCHAR *mirandaPath, const TCHAR *mirandaProf)
+static void SearchForLists(HWND hwndDlg, const wchar_t *mirandaPath, const wchar_t *mirandaProf)
{
// find in Miranda profile subfolders
- TCHAR searchspec[MAX_PATH];
+ wchar_t searchspec[MAX_PATH];
mir_sntprintf(searchspec, L"%s\\*.*", mirandaPath);
WIN32_FIND_DATA fd;
@@ -49,9 +49,9 @@ static void SearchForLists(HWND hwndDlg, const TCHAR *mirandaPath, const TCHAR *
if (mirandaProf != NULL && !mir_tstrcmpi(mirandaProf, fd.cFileName))
continue;
- TCHAR buf[MAX_PATH], profile[MAX_PATH];
+ wchar_t buf[MAX_PATH], profile[MAX_PATH];
mir_sntprintf(buf, L"%s\\%s\\%s.dat", mirandaPath, fd.cFileName, fd.cFileName);
- if (_taccess(buf, 0) == 0) {
+ if (_waccess(buf, 0) == 0) {
mir_sntprintf(profile, L"%s.dat", fd.cFileName);
int i = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_ADDSTRING, 0, (LPARAM)profile);
@@ -65,7 +65,7 @@ static void SearchForLists(HWND hwndDlg, const TCHAR *mirandaPath, const TCHAR *
INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM)
{
- TCHAR filename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
switch(message) {
case WM_INITDIALOG:
@@ -84,7 +84,7 @@ INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPAR
SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETCURSEL, 0, 0);
SendMessage(hwndDlg, WM_COMMAND, MAKELONG(IDC_LIST, LBN_SELCHANGE), 0);
GetDlgItemText(hwndDlg, IDC_FILENAME, filename, _countof(filename));
- if (_taccess(filename, 4))
+ if (_waccess(filename, 4))
SendMessage(GetParent(hwndDlg), WIZM_DISABLEBUTTON, 1, 0);
return TRUE;
@@ -96,7 +96,7 @@ INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPAR
case IDOK:
GetDlgItemText(hwndDlg, IDC_FILENAME, filename, _countof(filename));
- if (_taccess(filename, 4)) {
+ if (_waccess(filename, 4)) {
MessageBox(hwndDlg, TranslateT("The given file does not exist. Please check that you have entered the name correctly."), TranslateT("Miranda Import"), MB_OK);
break;
}
@@ -112,7 +112,7 @@ INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPAR
if (HIWORD(wParam) == LBN_SELCHANGE) {
int sel = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETCURSEL, 0, 0);
if (sel != LB_ERR) {
- SetDlgItemText(hwndDlg, IDC_FILENAME, (TCHAR*)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, sel, 0));
+ SetDlgItemText(hwndDlg, IDC_FILENAME, (wchar_t*)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, sel, 0));
SendMessage(GetParent(hwndDlg), WIZM_ENABLEBUTTON, 1, 0);
}
}
@@ -121,7 +121,7 @@ INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPAR
case IDC_OTHER:
ptrT pfd(Utils_ReplaceVarsT(L"%miranda_profilesdir%"));
- TCHAR str[MAX_PATH], text[256];
+ wchar_t str[MAX_PATH], text[256];
GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str));
mir_sntprintf(text, L"%s (*.dat, *.bak)%c*.dat;*.bak%c%s (*.*)%c*.*%c%c", TranslateT("Miranda NG database"), 0, 0, TranslateT("All Files"), 0, 0, 0);
diff --git a/plugins/Import/src/stdafx.h b/plugins/Import/src/stdafx.h
index 2be67303d6..260f49da20 100644
--- a/plugins/Import/src/stdafx.h
+++ b/plugins/Import/src/stdafx.h
@@ -85,7 +85,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define IOPT_HISTORY 0x000007FE
-void AddMessage(const TCHAR* fmt, ...);
+void AddMessage(const wchar_t* fmt, ...);
INT_PTR CALLBACK WizardIntroPageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK ProgressPageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam);
@@ -96,12 +96,12 @@ INT_PTR CALLBACK FinishedPageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM
bool IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO dbei);
-int CreateGroup(const TCHAR* name, MCONTACT hContact);
+int CreateGroup(const wchar_t* name, MCONTACT hContact);
extern HINSTANCE hInst;
extern HWND hwndAccMerge;
extern int nImportOptions;
-extern TCHAR importFile[];
+extern wchar_t importFile[];
extern time_t dwSinceDate;
extern bool g_bServiceMode;
diff --git a/plugins/Import/src/utils.cpp b/plugins/Import/src/utils.cpp
index 05d4e1d0ad..59adce72b9 100644
--- a/plugins/Import/src/utils.cpp
+++ b/plugins/Import/src/utils.cpp
@@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// ------------------------------------------------
// Returns 1 if successful and 0 when it fails.
-int CreateGroup(const TCHAR *group, MCONTACT hContact)
+int CreateGroup(const wchar_t *group, MCONTACT hContact)
{
if (group == NULL)
return 0;
@@ -38,7 +38,7 @@ int CreateGroup(const TCHAR *group, MCONTACT hContact)
if (hContact)
db_set_ts(hContact, "CList", "Group", group);
else
- AddMessage(LPGENT("Skipping duplicate group %s."), group);
+ AddMessage(LPGENW("Skipping duplicate group %s."), group);
return 0;
}
diff --git a/plugins/Import/src/wizard.cpp b/plugins/Import/src/wizard.cpp
index 7232aec1fd..189a530d55 100644
--- a/plugins/Import/src/wizard.cpp
+++ b/plugins/Import/src/wizard.cpp
@@ -146,7 +146,7 @@ INT_PTR CALLBACK WizardDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lP
break;
case WIZM_SETCANCELTEXT:
- SetDlgItemText(hdlg, IDCANCEL, (TCHAR*)lParam);
+ SetDlgItemText(hdlg, IDCANCEL, (wchar_t*)lParam);
break;
case WM_COMMAND:
diff --git a/plugins/KeyboardNotify/src/EnumProc.cpp b/plugins/KeyboardNotify/src/EnumProc.cpp
index 527e4fda05..e1056113e4 100644
--- a/plugins/KeyboardNotify/src/EnumProc.cpp
+++ b/plugins/KeyboardNotify/src/EnumProc.cpp
@@ -18,8 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-BOOL findFilename(TCHAR *);
-TCHAR *filename(TCHAR *);
+BOOL findFilename(wchar_t *);
+wchar_t *filename(wchar_t *);
// Globals
extern PROCESS_LIST ProcessList;
@@ -40,7 +40,7 @@ BOOL areThereProcessesRunning(void)
// While there are processes, keep looping.
for (procentry.dwSize=sizeof(PROCESSENTRY32), bFlag=Process32First(hSnapShot, &procentry); bFlag; procentry.dwSize=sizeof(PROCESSENTRY32), bFlag=Process32Next(hSnapShot, &procentry)) {
- TCHAR *szFileNameAux = filename(procentry.szExeFile);
+ wchar_t *szFileNameAux = filename(procentry.szExeFile);
// Search szFileName in user-defined list
if (findFilename(szFileNameAux))
@@ -50,7 +50,7 @@ BOOL areThereProcessesRunning(void)
return FALSE;
}
-BOOL findFilename(TCHAR *fileName)
+BOOL findFilename(wchar_t *fileName)
{
for (int i=0; i < ProcessList.count; i++)
if (ProcessList.szFileName[i] && !_wcsicmp(ProcessList.szFileName[i], fileName))
@@ -60,9 +60,9 @@ BOOL findFilename(TCHAR *fileName)
}
-TCHAR *filename(TCHAR *fullFileName)
+wchar_t *filename(wchar_t *fullFileName)
{
- TCHAR *str;
+ wchar_t *str;
str = wcsrchr(fullFileName, '\\');
if (!str)
diff --git a/plugins/KeyboardNotify/src/EnumProc.h b/plugins/KeyboardNotify/src/EnumProc.h
index 489ce06fd6..5f401ce9e0 100644
--- a/plugins/KeyboardNotify/src/EnumProc.h
+++ b/plugins/KeyboardNotify/src/EnumProc.h
@@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
typedef struct {
int count;
- TCHAR **szFileName;
+ wchar_t **szFileName;
} PROCESS_LIST;
BOOL areThereProcessesRunning(void);
diff --git a/plugins/KeyboardNotify/src/flash.cpp b/plugins/KeyboardNotify/src/flash.cpp
index c2a22d11bf..bbbcc84da4 100644
--- a/plugins/KeyboardNotify/src/flash.cpp
+++ b/plugins/KeyboardNotify/src/flash.cpp
@@ -33,7 +33,7 @@ FLASHING_SEQUENCE *getTrillianSeq(void);
void updateTrillianSeq(void);
static void __cdecl TestThread(void *param);
static void PreviewThread(void *);
-FLASHING_SEQUENCE str2FS(TCHAR *);
+FLASHING_SEQUENCE str2FS(wchar_t *);
BYTE KbdChar2Byte(char);
void countUnopenEvents(int *, int *, int *, int *);
@@ -195,11 +195,11 @@ void updateTrillianSeq(void)
}
}
-void useExternSequence(TCHAR *extStr)
+void useExternSequence(wchar_t *extStr)
{
static FLASHING_SEQUENCE Extern = {0};
- TCHAR externStr[MAX_PATH+1];
+ wchar_t externStr[MAX_PATH+1];
mir_wstrcpy(externStr, extStr);
Extern = str2FS(normalizeCustomString(externStr));
@@ -209,98 +209,98 @@ void useExternSequence(TCHAR *extStr)
}
-TCHAR *normalizeCustomString(TCHAR *customStr)
+wchar_t *normalizeCustomString(wchar_t *customStr)
{
int len=0, status=0;
BOOL used[4];
- TCHAR strAux[MAX_PATH+1], *str;
+ wchar_t strAux[MAX_PATH+1], *str;
for (mir_wstrcpy(str=strAux, customStr); *str; str++) {
switch (*str) {
- case _T('['):
+ case '[':
if (status == 0) {
status = 1;
customStr[len++] = *str;
used[0] = used [1] = used[2] = used[3] = FALSE;
}
break;
- case _T(']'):
+ case ']':
if (status == 1) {
status = 0;
customStr[len++] = *str;
}
break;
- case _T('0'):
- case _T('1'):
- case _T('2'):
- case _T('3'):
+ case '0':
+ case '1':
+ case '2':
+ case '3':
if (status == 0)
customStr[len++] = *str;
- else if (!used[*str - _T('0')]) {
+ else if (!used[*str - '0']) {
customStr[len++] = *str;
- used[*str - _T('0')] = TRUE;
+ used[*str - '0'] = TRUE;
}
break;
}
}
if (status == 1)
- customStr[len++] = _T(']');
- customStr[len] = _T('\0');
+ customStr[len++] = ']';
+ customStr[len] = '\0';
return customStr;
}
-TCHAR* getCurrentSequenceString(void)
+wchar_t* getCurrentSequenceString(void)
{
- static TCHAR CurrentSeqString[MAX_PATH+1];
- TCHAR *str = CurrentSeqString;
+ static wchar_t CurrentSeqString[MAX_PATH+1];
+ wchar_t *str = CurrentSeqString;
for (unsigned i=0; i < pFS->size; i++) {
switch (pFS->frame[i]) {
case 0:
- *(str++) = _T('0');
+ *(str++) = '0';
break;
case 1:
- *(str++) = _T('3');
+ *(str++) = '3';
break;
case 2:
- *(str++) = _T('1');
+ *(str++) = '1';
break;
case 3:
- *(str++) = _T('[');
- *(str++) = _T('1');
- *(str++) = _T('3');
- *(str++) = _T(']');
+ *(str++) = '[';
+ *(str++) = '1';
+ *(str++) = '3';
+ *(str++) = ']';
break;
case 4:
- *(str++) = _T('2');
+ *(str++) = '2';
break;
case 5:
- *(str++) = _T('[');
- *(str++) = _T('2');
- *(str++) = _T('3');
- *(str++) = _T(']');
+ *(str++) = '[';
+ *(str++) = '2';
+ *(str++) = '3';
+ *(str++) = ']';
break;
case 6:
- *(str++) = _T('[');
- *(str++) = _T('1');
- *(str++) = _T('2');
- *(str++) = _T(']');
+ *(str++) = '[';
+ *(str++) = '1';
+ *(str++) = '2';
+ *(str++) = ']';
break;
case 7:
- *(str++) = _T('[');
- *(str++) = _T('1');
- *(str++) = _T('2');
- *(str++) = _T('3');
- *(str++) = _T(']');
+ *(str++) = '[';
+ *(str++) = '1';
+ *(str++) = '2';
+ *(str++) = '3';
+ *(str++) = ']';
}
}
- *str = _T('\0');
+ *str = '\0';
return CurrentSeqString;
}
-void testSequence(TCHAR *testStr)
+void testSequence(wchar_t *testStr)
{
if (bTestSemaphore) // we try to avoid concurrent test threads
return;
@@ -362,15 +362,15 @@ static void PreviewThread(void*)
}
-FLASHING_SEQUENCE str2FS(TCHAR *str)
+FLASHING_SEQUENCE str2FS(wchar_t *str)
{
FLASHING_SEQUENCE Temp = {0};
for (Temp.size=Temp.index=0; *str; str++) {
Temp.size++;
- if (*str == _T('[')) {
+ if (*str == '[') {
Temp.frame[Temp.size - 1] = 0;
- for (str++; *str && *str != _T(']'); str++)
+ for (str++; *str && *str != ']'; str++)
Temp.frame[Temp.size - 1] += KbdChar2Byte(*str) & Leds2Flash;
if (!*str) break;
}
diff --git a/plugins/KeyboardNotify/src/flash.h b/plugins/KeyboardNotify/src/flash.h
index f60706fc76..96421c966e 100644
--- a/plugins/KeyboardNotify/src/flash.h
+++ b/plugins/KeyboardNotify/src/flash.h
@@ -19,10 +19,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void RestoreLEDState(void);
BYTE getBlinkingLeds(void);
void setFlashingSequence(void);
-void useExternSequence(TCHAR *);
-TCHAR *normalizeCustomString(TCHAR *);
-TCHAR *getCurrentSequenceString(void);
-void testSequence(TCHAR *);
+void useExternSequence(wchar_t *);
+wchar_t *normalizeCustomString(wchar_t *);
+wchar_t *getCurrentSequenceString(void);
+void testSequence(wchar_t *);
void previewFlashing(BOOL);
#define LedState(a) (((BYTE)(GetKeyState(a) & 0xffff))!=0)
diff --git a/plugins/KeyboardNotify/src/keyboard.cpp b/plugins/KeyboardNotify/src/keyboard.cpp
index 8fd9325b5f..5fd5116dc5 100644
--- a/plugins/KeyboardNotify/src/keyboard.cpp
+++ b/plugins/KeyboardNotify/src/keyboard.cpp
@@ -37,7 +37,7 @@ typedef struct _KEYBOARD_INDICATOR_PARAMETERS {
BOOL OpenKeyboardDevice()
{
int i = 0;
- TCHAR aux1[MAX_PATH+1], aux2[MAX_PATH+1];
+ wchar_t aux1[MAX_PATH+1], aux2[MAX_PATH+1];
do {
mir_sntprintf(aux1, L"Kbd%d", i);
@@ -74,7 +74,7 @@ BOOL ToggleKeyboardLights(BYTE byte)
void CloseKeyboardDevice()
{
int i = 0;
- TCHAR aux[MAX_PATH+1];
+ wchar_t aux[MAX_PATH+1];
do {
if (hKbdDev[i] != INVALID_HANDLE_VALUE)
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp
index 9bccd96da1..3cafb2523b 100644
--- a/plugins/KeyboardNotify/src/main.cpp
+++ b/plugins/KeyboardNotify/src/main.cpp
@@ -463,7 +463,7 @@ static INT_PTR StartBlinkService(WPARAM wParam, LPARAM lParam)
nExternCount += (unsigned int)wParam;
if (bFlashOnOther && checkNotifyOptions() && checkGlobalStatus() && checkGlobalXstatus()) {
if (lParam)
- useExternSequence((TCHAR *)lParam);
+ useExternSequence((wchar_t *)lParam);
SetEvent(hFlashEvent);
}
@@ -490,10 +490,10 @@ static INT_PTR IsFlashingActiveService(WPARAM, LPARAM)
INT_PTR NormalizeSequenceService(WPARAM, LPARAM lParam)
{
- TCHAR strAux[MAX_PATH + 1], *strIn = (TCHAR*)lParam;
+ wchar_t strAux[MAX_PATH + 1], *strIn = (wchar_t*)lParam;
- _tcsncpy_s(strAux, strIn, _TRUNCATE);
- _tcsncpy_s(strIn, MAX_PATH, normalizeCustomString(strAux), _TRUNCATE);
+ wcsncpy_s(strAux, strIn, _TRUNCATE);
+ wcsncpy_s(strIn, MAX_PATH, normalizeCustomString(strAux), _TRUNCATE);
return (INT_PTR)strIn;
}
@@ -518,7 +518,7 @@ void createProcessList(void)
int count = db_get_w(NULL, KEYBDMODULE, "processcount", 0);
ProcessList.count = 0;
- ProcessList.szFileName = (TCHAR **)mir_alloc(count * sizeof(TCHAR *));
+ ProcessList.szFileName = (wchar_t **)mir_alloc(count * sizeof(wchar_t *));
if (ProcessList.szFileName) {
for (int i = 0; i < count; i++)
ProcessList.szFileName[i] = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i));
@@ -820,20 +820,20 @@ static void destroyProtocolList(void)
// We use the profile name to create the first part of each event name
// We do so to avoid problems between different instances of the plugin concurrently running
-void createEventPrefix(TCHAR *prefixName, size_t maxLen)
+void createEventPrefix(wchar_t *prefixName, size_t maxLen)
{
size_t len;
- TCHAR profileName[MAX_PATH + 1], *str;
+ wchar_t profileName[MAX_PATH + 1], *str;
getAbsoluteProfileName(profileName, MAX_PATH);
- while (str = _tcschr(profileName, _T('\\')))
- *str = _T('/');
+ while (str = wcschr(profileName, '\\'))
+ *str = '/';
if ((len = mir_tstrlen(profileName)) <= maxLen)
- _tcsncpy_s(prefixName, maxLen, profileName, _TRUNCATE);
+ wcsncpy_s(prefixName, maxLen, profileName, _TRUNCATE);
else {
str = profileName + len - maxLen / 2;
- _tcsncpy_s(prefixName, (maxLen / 2), profileName, _TRUNCATE);
+ wcsncpy_s(prefixName, (maxLen / 2), profileName, _TRUNCATE);
mir_tstrcat(prefixName, str);
}
}
@@ -907,7 +907,7 @@ static int OnPreshutdown(WPARAM, LPARAM)
static int ModulesLoaded(WPARAM, LPARAM)
{
- TCHAR eventPrefix[MAX_PATH + 1], eventName[MAX_PATH + 1];
+ wchar_t eventPrefix[MAX_PATH + 1], eventName[MAX_PATH + 1];
createProtocolList();
LoadSettings();
diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp
index afd15ae342..5f5f0bd92d 100644
--- a/plugins/KeyboardNotify/src/options.cpp
+++ b/plugins/KeyboardNotify/src/options.cpp
@@ -34,66 +34,66 @@ extern PROCESS_LIST ProcessList;
HWND hwndProto, hwndBasic, hwndEffect, hwndTheme, hwndIgnore, hwndCurrentTab;
-TCHAR *AttendedName[]={L"Miranda", L"Windows"};
-TCHAR *OrderName[]={LPGENT("left -> right"), LPGENT("right -> left"), LPGENT("left <-> right")};
+wchar_t *AttendedName[]={L"Miranda", L"Windows"};
+wchar_t *OrderName[]={LPGENW("left -> right"), LPGENW("right -> left"), LPGENW("left <-> right")};
PROCESS_LIST ProcessListAux;
XSTATUS_INFO *XstatusListAux;
BYTE trillianLedsMsg, trillianLedsURL, trillianLedsFile, trillianLedsOther;
-static void writeThemeToCombo(const TCHAR *theme, const TCHAR *custom, BOOL overrideExisting)
+static void writeThemeToCombo(const wchar_t *theme, const wchar_t *custom, BOOL overrideExisting)
{
int item = SendDlgItemMessage(hwndTheme, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme);
if (item == CB_ERR) {
item = SendDlgItemMessage(hwndTheme, IDC_THEME, CB_ADDSTRING, 0, (LPARAM)theme);
- TCHAR *str = mir_tstrdup(custom);
+ wchar_t *str = mir_tstrdup(custom);
SendDlgItemMessage(hwndTheme, IDC_THEME, CB_SETITEMDATA, (WPARAM)item, (LPARAM)str);
}
else
if (overrideExisting) {
- TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndTheme, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0);
+ wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndTheme, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0);
if (str)
mir_tstrcpy(str, custom);
}
}
-void exportThemes(const TCHAR *filename)
+void exportThemes(const wchar_t *filename)
{
- FILE *fExport = _tfopen(filename, L"wt");
+ FILE *fExport = _wfopen(filename, L"wt");
if (!fExport)
return;
fwprintf(fExport, TranslateT("\n; Automatically generated Keyboard Notify Theme file\n\n\n"));
- TCHAR *szTheme;
+ wchar_t *szTheme;
for (int i = 0; szTheme = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) {
- _ftprintf(fExport, L"[%s]\n", szTheme);
+ fwprintf(fExport, L"[%s]\n", szTheme);
mir_free(szTheme);
if (szTheme = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i))) {
- _ftprintf(fExport, L"%s\n\n", szTheme);
+ fwprintf(fExport, L"%s\n\n", szTheme);
mir_free(szTheme);
}
else
- _ftprintf(fExport, L"0\n\n");
+ fwprintf(fExport, L"0\n\n");
}
- _ftprintf(fExport, TranslateT("\n; End of automatically generated Keyboard Notify Theme file\n"));
+ fwprintf(fExport, TranslateT("\n; End of automatically generated Keyboard Notify Theme file\n"));
fclose(fExport);
}
-void importThemes(const TCHAR *filename, BOOL overrideExisting)
+void importThemes(const wchar_t *filename, BOOL overrideExisting)
{
- FILE *fImport = _tfopen(filename, L"rt");
+ FILE *fImport = _wfopen(filename, L"rt");
if (!fImport)
return;
int status = 0;
size_t i;
- TCHAR buffer[MAX_PATH + 1], theme[MAX_PATH + 1], *str;
+ wchar_t buffer[MAX_PATH + 1], theme[MAX_PATH + 1], *str;
- while (_fgetts(buffer, MAX_PATH, fImport) != NULL) {
+ while (fgetws(buffer, MAX_PATH, fImport) != NULL) {
for (str = buffer; *str && isspace(*str); str++); //ltrim
if (!*str || *str == ';') //empty line or comment
continue;
@@ -119,7 +119,7 @@ void importThemes(const TCHAR *filename, BOOL overrideExisting)
static void createProcessListAux(void)
{
ProcessListAux.count = ProcessList.count;
- ProcessListAux.szFileName = (TCHAR **)mir_alloc(ProcessListAux.count * sizeof(TCHAR *));
+ ProcessListAux.szFileName = (wchar_t **)mir_alloc(ProcessListAux.count * sizeof(wchar_t *));
if (!ProcessListAux.szFileName)
ProcessListAux.count = 0;
else
@@ -213,7 +213,7 @@ static INT_PTR CALLBACK DlgProcProcesses(HWND hwndDlg, UINT msg, WPARAM wParam,
EnableWindow(GetDlgItem(hwndDlg, IDC_DELETEPGM), TRUE);
break;
case CBN_EDITCHANGE:
- TCHAR szFileName[MAX_PATH + 1];
+ wchar_t szFileName[MAX_PATH + 1];
GetDlgItemText(hwndDlg, IDC_PROGRAMS, szFileName, _countof(szFileName));
int item = SendMessage((HWND)lParam, CB_FINDSTRINGEXACT, -1, (LPARAM)szFileName);
if (item == CB_ERR) { //new program
@@ -229,7 +229,7 @@ static INT_PTR CALLBACK DlgProcProcesses(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
case IDC_ADDPGM:
{
- TCHAR szFileName[MAX_PATH + 1];
+ wchar_t szFileName[MAX_PATH + 1];
GetDlgItemText(hwndDlg, IDC_PROGRAMS, szFileName, _countof(szFileName));
if (!szFileName[0])
break;
@@ -240,7 +240,7 @@ static INT_PTR CALLBACK DlgProcProcesses(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
case IDC_DELETEPGM:
{
- TCHAR szFileName[MAX_PATH + 1];
+ wchar_t szFileName[MAX_PATH + 1];
GetDlgItemText(hwndDlg, IDC_PROGRAMS, szFileName, _countof(szFileName));
int item = SendDlgItemMessage(hwndDlg, IDC_PROGRAMS, CB_FINDSTRINGEXACT, -1, (LPARAM)szFileName);
SendDlgItemMessage(hwndDlg, IDC_PROGRAMS, CB_DELETESTRING, (WPARAM)item, 0);
@@ -256,12 +256,12 @@ static INT_PTR CALLBACK DlgProcProcesses(HWND hwndDlg, UINT msg, WPARAM wParam,
destroyProcessListAux();
ProcessListAux.count = SendDlgItemMessage(hwndDlg, IDC_PROGRAMS, CB_GETCOUNT, 0, 0);
- ProcessListAux.szFileName = (TCHAR **)mir_alloc(ProcessListAux.count * sizeof(TCHAR *));
+ ProcessListAux.szFileName = (wchar_t **)mir_alloc(ProcessListAux.count * sizeof(wchar_t *));
if (!ProcessListAux.szFileName)
ProcessListAux.count = 0;
else
for (int i = 0; i < ProcessListAux.count; i++) {
- TCHAR szFileNameAux[MAX_PATH + 1];
+ wchar_t szFileNameAux[MAX_PATH + 1];
SendDlgItemMessage(hwndDlg, IDC_PROGRAMS, CB_GETLBTEXT, (WPARAM)i, (LPARAM)szFileNameAux);
ProcessListAux.szFileName[i] = mir_tstrdup(szFileNameAux);
@@ -337,7 +337,7 @@ static INT_PTR CALLBACK DlgProcXstatusList(HWND hwndDlg, UINT msg, WPARAM wParam
tvis.item.pszText = TranslateT("None");
}
else {
- TCHAR szDefaultName[1024];
+ wchar_t szDefaultName[1024];
CUSTOM_STATUS xstatus = { 0 };
xstatus.cbSize = sizeof(CUSTOM_STATUS);
xstatus.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR;
@@ -864,7 +864,7 @@ static INT_PTR CALLBACK DlgProcEffectOptions(HWND hwndDlg, UINT msg, WPARAM wPar
EnableWindow(GetDlgItem(hwndDlg, IDC_SEQORDER), FALSE);
CheckDlgButton(hwndDlg, IDC_CUSTOM, bFlashEffect == FLASH_CUSTOM ? BST_CHECKED : BST_UNCHECKED);
- TCHAR *szTheme;
+ wchar_t *szTheme;
for (int i = 0; szTheme = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) {
int index = SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)szTheme);
mir_free(szTheme);
@@ -1000,12 +1000,12 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
SendDlgItemMessage(hwndDlg, IDC_THEME, EM_LIMITTEXT, MAX_PATH, 0);
SendDlgItemMessage(hwndDlg, IDC_CUSTOMSTRING, EM_LIMITTEXT, MAX_PATH, 0);
- TCHAR *szTheme;
+ wchar_t *szTheme;
for (int i = 0; szTheme = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++) {
int index = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)szTheme);
mir_free(szTheme);
if (index != CB_ERR && index != CB_ERRSPACE) {
- TCHAR *str = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i));
+ wchar_t *str = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i));
if (str)
SendDlgItemMessage(hwndDlg, IDC_THEME, CB_SETITEMDATA, (WPARAM)index, (LPARAM)str);
}
@@ -1017,7 +1017,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
EnableWindow(GetDlgItem(hwndDlg, IDC_DELETE), FALSE);
else {
SendDlgItemMessage(hwndDlg, IDC_THEME, CB_SETCURSEL, (WPARAM)wCustomTheme, 0);
- TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)wCustomTheme, 0);
+ wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)wCustomTheme, 0);
if (str)
SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, str);
}
@@ -1033,7 +1033,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
switch (HIWORD(wParam)) {
case CBN_SELENDOK:
case CBN_SELCHANGE: {
- TCHAR *str = (TCHAR *)SendMessage((HWND)lParam, CB_GETITEMDATA, (WPARAM)SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0), 0);
+ wchar_t *str = (wchar_t *)SendMessage((HWND)lParam, CB_GETITEMDATA, (WPARAM)SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0), 0);
if (str)
SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, str);
else
@@ -1044,7 +1044,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
}
break;
case CBN_EDITCHANGE:
- TCHAR theme[MAX_PATH + 1];
+ wchar_t theme[MAX_PATH + 1];
GetDlgItemText(hwndDlg, IDC_THEME, theme, _countof(theme));
int item = SendMessage((HWND)lParam, CB_FINDSTRINGEXACT, -1, (LPARAM)theme);
if (item == CB_ERR) {
@@ -1054,7 +1054,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
EnableWindow(GetDlgItem(hwndDlg, IDC_DELETE), FALSE);
}
else {
- TCHAR *str = (TCHAR *)SendMessage((HWND)lParam, CB_GETITEMDATA, (WPARAM)item, 0);
+ wchar_t *str = (wchar_t *)SendMessage((HWND)lParam, CB_GETITEMDATA, (WPARAM)item, 0);
if (str)
SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, str);
else
@@ -1068,13 +1068,13 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
return TRUE;
case IDC_CUSTOMSTRING:
if (HIWORD(wParam) == EN_CHANGE) {
- TCHAR theme[MAX_PATH + 1], customAux[MAX_PATH + 1];
+ wchar_t theme[MAX_PATH + 1], customAux[MAX_PATH + 1];
GetDlgItemText(hwndDlg, IDC_THEME, theme, _countof(theme));
int item = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme);
if (item == CB_ERR)
return TRUE;
- TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0);
+ wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0);
if (str) {
GetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, customAux, _countof(customAux));
if (mir_wstrcmp(str, customAux))
@@ -1086,7 +1086,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
return TRUE;
case IDC_TEST:
{
- TCHAR custom[MAX_PATH + 1];
+ wchar_t custom[MAX_PATH + 1];
GetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, custom, _countof(custom));
SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, normalizeCustomString(custom));
@@ -1095,13 +1095,13 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
return TRUE;
case IDC_ADD:
{
- TCHAR theme[MAX_PATH + 1];
+ wchar_t theme[MAX_PATH + 1];
GetDlgItemText(hwndDlg, IDC_THEME, theme, _countof(theme));
if (!theme[0])
return TRUE;
int item = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_ADDSTRING, 0, (LPARAM)theme);
- TCHAR *str = (TCHAR *)mir_alloc((MAX_PATH + 1)*sizeof(TCHAR));
+ wchar_t *str = (wchar_t *)mir_alloc((MAX_PATH + 1)*sizeof(wchar_t));
if (str) {
GetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, str, MAX_PATH);
SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, normalizeCustomString(str));
@@ -1115,11 +1115,11 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
return TRUE;
case IDC_UPDATE:
{
- TCHAR theme[MAX_PATH + 1];
+ wchar_t theme[MAX_PATH + 1];
GetDlgItemText(hwndDlg, IDC_THEME, theme, _countof(theme));
int item = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme);
- TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0);
+ wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0);
if (str) {
GetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, str, MAX_PATH);
SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, normalizeCustomString(str));
@@ -1130,11 +1130,11 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
return TRUE;
case IDC_DELETE:
{
- TCHAR theme[MAX_PATH + 1];
+ wchar_t theme[MAX_PATH + 1];
GetDlgItemText(hwndDlg, IDC_THEME, theme, _countof(theme));
int item = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_FINDSTRINGEXACT, -1, (LPARAM)theme);
- TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0);
+ wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0);
if (str)
mir_free(str);
SendDlgItemMessage(hwndDlg, IDC_THEME, CB_DELETESTRING, (WPARAM)item, 0);
@@ -1145,7 +1145,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
}
else {
SendDlgItemMessage(hwndDlg, IDC_THEME, CB_SETCURSEL, 0, 0);
- str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, 0, 0);
+ str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, 0, 0);
if (str)
SetDlgItemText(hwndDlg, IDC_CUSTOMSTRING, str);
}
@@ -1155,10 +1155,10 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
return TRUE;
case IDC_EXPORT:
{
- TCHAR path[MAX_PATH + 1], filter[MAX_PATH + 1], *pfilter;
+ wchar_t path[MAX_PATH + 1], filter[MAX_PATH + 1], *pfilter;
OPENFILENAME ofn = { 0 };
- path[0] = _T('\0');
+ path[0] = '\0';
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hwndDlg;
ofn.hInstance = NULL;
@@ -1171,7 +1171,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
mir_tstrcpy(pfilter, L"*.*");
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
- *pfilter = _T('\0');
+ *pfilter = '\0';
ofn.lpstrFilter = filter;
ofn.lpstrFile = path;
ofn.Flags = OFN_HIDEREADONLY | OFN_NOCHANGEDIR | OFN_NOREADONLYRETURN | OFN_PATHMUSTEXIST;
@@ -1183,10 +1183,10 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
return TRUE;
case IDC_IMPORT:
{
- TCHAR path[MAX_PATH + 1], filter[MAX_PATH + 1], *pfilter;
+ wchar_t path[MAX_PATH + 1], filter[MAX_PATH + 1], *pfilter;
OPENFILENAME ofn = { 0 };
- path[0] = _T('\0');
+ path[0] = '\0';
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hwndDlg;
ofn.hInstance = NULL;
@@ -1199,7 +1199,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
mir_tstrcpy(pfilter, L"*.*");
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
- *pfilter = _T('\0');
+ *pfilter = '\0';
ofn.lpstrFilter = filter;
ofn.lpstrFile = path;
ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_NOCHANGEDIR;
@@ -1220,7 +1220,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
case WM_NOTIFY:
{
int count;
- TCHAR theme[MAX_PATH + 1], themeAux[MAX_PATH + 1];
+ wchar_t theme[MAX_PATH + 1], themeAux[MAX_PATH + 1];
// Here we have pressed either the OK or the APPLY button.
switch (((LPNMHDR)lParam)->idFrom) {
case 0:
@@ -1231,7 +1231,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
mir_free(szTheme);
}
else
- theme[0] = _T('\0');
+ theme[0] = '\0';
// Here we will delete all the items in the theme combo on the Flashing tab: we will load them again later
for (int i = 0; SendDlgItemMessage(hwndEffect, IDC_SCUSTOM, CB_DELETESTRING, 0, (LPARAM)i) != CB_ERR; i++);
@@ -1240,7 +1240,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
for (int i = 0; i < count; i++) {
SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETLBTEXT, (WPARAM)i, (LPARAM)themeAux);
db_set_ts(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), themeAux);
- TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)i, 0);
+ wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)i, 0);
if (str)
db_set_ts(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), str);
else
@@ -1274,7 +1274,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara
int count = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETCOUNT, 0, 0);
for (int item = 0; item < count; item++) {
- TCHAR *str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0);
+ wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)item, 0);
if (str)
mir_free(str);
}
diff --git a/plugins/KeyboardNotify/src/utils.cpp b/plugins/KeyboardNotify/src/utils.cpp
index 23b9408ff2..b7d59819b8 100644
--- a/plugins/KeyboardNotify/src/utils.cpp
+++ b/plugins/KeyboardNotify/src/utils.cpp
@@ -31,9 +31,9 @@ char *fmtDBSettingName(const char *fmt, ...)
}
-TCHAR *getAbsoluteProfileName(TCHAR *absoluteProfileName, size_t maxLen)
+wchar_t *getAbsoluteProfileName(wchar_t *absoluteProfileName, size_t maxLen)
{
- TCHAR profilePath[MAX_PATH+1], profileName[MAX_PATH+1];
+ wchar_t profilePath[MAX_PATH+1], profileName[MAX_PATH+1];
profilePath[0] = profileName[0] = '\0';
CallService(MS_DB_GETPROFILEPATHT, MAX_PATH, (LPARAM)profilePath);
diff --git a/plugins/KeyboardNotify/src/utils.h b/plugins/KeyboardNotify/src/utils.h
index 66917754ed..64e83feeb5 100644
--- a/plugins/KeyboardNotify/src/utils.h
+++ b/plugins/KeyboardNotify/src/utils.h
@@ -17,4 +17,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
char *fmtDBSettingName(const char *, ...);
-TCHAR *getAbsoluteProfileName(TCHAR *, size_t);
+wchar_t *getAbsoluteProfileName(wchar_t *, size_t);
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp
index a383681c07..6292695560 100644
--- a/plugins/ListeningTo/src/listeningto.cpp
+++ b/plugins/ListeningTo/src/listeningto.cpp
@@ -62,7 +62,7 @@ INT_PTR ListeningToEnabled(WPARAM wParam, LPARAM lParam);
INT_PTR EnableListeningTo(WPARAM wParam, LPARAM lParam);
INT_PTR EnableListeningTo(char *proto = NULL, bool enabled = false);
INT_PTR GetTextFormat(WPARAM wParam, LPARAM lParam);
-TCHAR* GetParsedFormat(LISTENINGTOINFO *lti);
+wchar_t* GetParsedFormat(LISTENINGTOINFO *lti);
INT_PTR GetParsedFormat(WPARAM wParam, LPARAM lParam);
INT_PTR GetOverrideContactOption(WPARAM wParam, LPARAM lParam);
INT_PTR GetUnknownText(WPARAM wParam, LPARAM lParam);
@@ -73,21 +73,21 @@ INT_PTR HotkeysEnable(WPARAM wParam, LPARAM lParam);
INT_PTR HotkeysDisable(WPARAM wParam, LPARAM lParam);
INT_PTR HotkeysToggle(WPARAM wParam, LPARAM lParam);
-TCHAR* VariablesParseInfo(ARGUMENTSINFO *ai);
-TCHAR* VariablesParseType(ARGUMENTSINFO *ai);
-TCHAR* VariablesParseArtist(ARGUMENTSINFO *ai);
-TCHAR* VariablesParseAlbum(ARGUMENTSINFO *ai);
-TCHAR* VariablesParseTitle(ARGUMENTSINFO *ai);
-TCHAR* VariablesParseTrack(ARGUMENTSINFO *ai);
-TCHAR* VariablesParseYear(ARGUMENTSINFO *ai);
-TCHAR* VariablesParseGenre(ARGUMENTSINFO *ai);
-TCHAR* VariablesParseLength(ARGUMENTSINFO *ai);
-TCHAR* VariablesParsePlayer(ARGUMENTSINFO *ai);
+wchar_t* VariablesParseInfo(ARGUMENTSINFO *ai);
+wchar_t* VariablesParseType(ARGUMENTSINFO *ai);
+wchar_t* VariablesParseArtist(ARGUMENTSINFO *ai);
+wchar_t* VariablesParseAlbum(ARGUMENTSINFO *ai);
+wchar_t* VariablesParseTitle(ARGUMENTSINFO *ai);
+wchar_t* VariablesParseTrack(ARGUMENTSINFO *ai);
+wchar_t* VariablesParseYear(ARGUMENTSINFO *ai);
+wchar_t* VariablesParseGenre(ARGUMENTSINFO *ai);
+wchar_t* VariablesParseLength(ARGUMENTSINFO *ai);
+wchar_t* VariablesParsePlayer(ARGUMENTSINFO *ai);
#define XSTATUS_MUSIC 11
-#define UNKNOWN(_X_) ( _X_ == NULL || _X_[0] == _T('\0') ? opts.unknown : _X_ )
+#define UNKNOWN(_X_) ( _X_ == NULL || _X_[0] == '\0' ? opts.unknown : _X_ )
// Functions ////////////////////////////////////////////////////////////////////////////
@@ -185,7 +185,7 @@ void RebuildMenu()
if (info->hMenu != NULL)
Menu_RemoveItem(info->hMenu);
- TCHAR text[512];
+ wchar_t text[512];
mir_sntprintf(text, TranslateT("Send to %s"), info->account);
CMenuItem mi;
@@ -193,7 +193,7 @@ void RebuildMenu()
mi.root = hMainMenuGroup;
mi.position = 500080000 + i;
mi.pszService = MS_LISTENINGTO_MAINMENU;
- mi.name.t = text;
+ mi.name.w = text;
mi.flags = CMIF_TCHAR | CMIF_UNMOVABLE
| (ListeningToEnabled(info->proto, TRUE) ? CMIF_CHECKED : 0)
| (opts.enable_sending ? 0 : CMIF_GRAYED);
@@ -205,7 +205,7 @@ void RebuildMenu()
UpdateGlobalStatusMenus();
}
-void RegisterProtocol(char *proto, TCHAR *account)
+void RegisterProtocol(char *proto, wchar_t *account)
{
if (!ProtoServiceExists(proto, PS_SET_LISTENINGTO) && !ProtoServiceExists(proto, PS_SETCUSTOMSTATUSEX) && !ProtoServiceExists(proto, PS_SETAWAYMSG))
return;
@@ -220,8 +220,8 @@ void RegisterProtocol(char *proto, TCHAR *account)
proto_items[id].hMenu = NULL;
proto_items[id].old_xstatus = 0;
- proto_items[id].old_xstatus_name[0] = _T('\0');
- proto_items[id].old_xstatus_message[0] = _T('\0');
+ proto_items[id].old_xstatus_name[0] = '\0';
+ proto_items[id].old_xstatus_message[0] = '\0';
}
@@ -236,7 +236,7 @@ int AccListChanged(WPARAM wParam, LPARAM lParam)
if (wParam == PRAC_UPGRADED || wParam == PRAC_CHANGED) {
mir_tstrncpy(info->account, proto->tszAccountName, _countof(info->account));
- TCHAR text[512];
+ wchar_t text[512];
mir_sntprintf(text, TranslateT("Send to %s"), info->account);
Menu_ModifyItem(info->hMenu, text);
}
@@ -286,7 +286,7 @@ int ModulesLoaded(WPARAM, LPARAM)
CMenuItem mi;
SET_UID(mi, 0xe8e4e594, 0x255e, 0x434d, 0x83, 0x74, 0x79, 0x44, 0x1b, 0x4e, 0xe7, 0x16);
mi.position = 500080000;
- mi.name.t = LPGENT("Listening to");
+ mi.name.w = LPGENW("Listening to");
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = iconList[0].hIcolib;
hMainMenuGroup = Menu_AddMainMenuItem(&mi);
@@ -298,7 +298,7 @@ int ModulesLoaded(WPARAM, LPARAM)
// Add all protos
SET_UID(mi, 0xc396a9dd, 0x9a00, 0x46af, 0x96, 0x2e, 0x5, 0x5a, 0xbc, 0x52, 0xfc, 0x9b);
- mi.name.t = LPGENT("Send to all protocols");
+ mi.name.w = LPGENW("Send to all protocols");
mi.flags = CMIF_TCHAR
| (ListeningToEnabled(NULL, true) ? CMIF_CHECKED : 0)
| (opts.enable_sending ? 0 : CMIF_GRAYED);
@@ -307,8 +307,8 @@ int ModulesLoaded(WPARAM, LPARAM)
proto_items[0].proto[0] = 0;
proto_items[0].account[0] = 0;
proto_items[0].old_xstatus = 0;
- proto_items[0].old_xstatus_name[0] = _T('\0');
- proto_items[0].old_xstatus_message[0] = _T('\0');
+ proto_items[0].old_xstatus_name[0] = '\0';
+ proto_items[0].old_xstatus_message[0] = '\0';
// Add each proto
PROTOACCOUNT **protos;
@@ -529,8 +529,8 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL)
ProtocolInfo *pi = GetProtoInfo(proto);
if (pi != NULL) {
pi->old_xstatus = 0;
- pi->old_xstatus_name[0] = _T('\0');
- pi->old_xstatus_message[0] = _T('\0');
+ pi->old_xstatus_name[0] = '\0';
+ pi->old_xstatus_message[0] = '\0';
}
}
return;
@@ -538,13 +538,13 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL)
if (opts.xstatus_set == CHECK_XSTATUS_MUSIC) {
// Set text to nothing
- TCHAR *fr[] = {
+ wchar_t *fr[] = {
L"listening", opts.nothing
};
- Buffer<TCHAR> name;
+ Buffer<wchar_t> name;
ReplaceTemplate(&name, NULL, opts.xstatus_name, fr, _countof(fr));
- Buffer<TCHAR> msg;
+ Buffer<wchar_t> msg;
ReplaceTemplate(&msg, NULL, opts.xstatus_message, fr, _countof(fr));
ics.flags = CSSF_TCHAR | CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE;
@@ -577,8 +577,8 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL)
if (pi != NULL) {
pi->old_xstatus = 0;
- pi->old_xstatus_name[0] = _T('\0');
- pi->old_xstatus_message[0] = _T('\0');
+ pi->old_xstatus_name[0] = '\0';
+ pi->old_xstatus_message[0] = '\0';
}
}
}
@@ -610,7 +610,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL)
}
}
- TCHAR *fr[] = {
+ wchar_t *fr[] = {
L"listening", GetParsedFormat(lti),
L"artist", UNKNOWN(lti->ptszArtist),
L"album", UNKNOWN(lti->ptszAlbum),
@@ -623,9 +623,9 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL)
L"type", UNKNOWN(lti->ptszType)
};
- Buffer<TCHAR> name;
+ Buffer<wchar_t> name;
ReplaceTemplate(&name, NULL, opts.xstatus_name, fr, _countof(fr));
- Buffer<TCHAR> msg;
+ Buffer<wchar_t> msg;
ReplaceTemplate(&msg, NULL, opts.xstatus_message, fr, _countof(fr));
status = XSTATUS_MUSIC;
@@ -716,12 +716,12 @@ INT_PTR GetTextFormat(WPARAM, LPARAM)
return (INT_PTR)mir_tstrdup(opts.templ);
}
-TCHAR *GetParsedFormat(LISTENINGTOINFO *lti)
+wchar_t *GetParsedFormat(LISTENINGTOINFO *lti)
{
if (lti == NULL)
return NULL;
- TCHAR *fr[] = {
+ wchar_t *fr[] = {
L"artist", UNKNOWN(lti->ptszArtist),
L"album", UNKNOWN(lti->ptszAlbum),
L"title", UNKNOWN(lti->ptszTitle),
@@ -733,7 +733,7 @@ TCHAR *GetParsedFormat(LISTENINGTOINFO *lti)
L"type", UNKNOWN(lti->ptszType)
};
- Buffer<TCHAR> ret;
+ Buffer<wchar_t> ret;
ReplaceTemplate(&ret, NULL, opts.templ, fr, _countof(fr));
return ret.detach();
}
@@ -759,7 +759,7 @@ void SetListeningInfos(LISTENINGTOINFO *lti)
for (unsigned int i = 1; i < proto_items.size(); ++i)
SetListeningInfo(proto_items[i].proto, lti);
- TCHAR *fr = NULL;
+ wchar_t *fr = NULL;
char *info = NULL;
if (lti) {
@@ -902,7 +902,7 @@ INT_PTR SetNewSong(WPARAM wParam, LPARAM lParam)
return 0;
}
-TCHAR* VariablesParseInfo(ARGUMENTSINFO *ai)
+wchar_t* VariablesParseInfo(ARGUMENTSINFO *ai)
{
if (ai->cbSize < sizeof(ARGUMENTSINFO))
return NULL;
@@ -913,7 +913,7 @@ TCHAR* VariablesParseInfo(ARGUMENTSINFO *ai)
return mir_tstrdup(L"");
}
- TCHAR *fr[] = {
+ wchar_t *fr[] = {
L"artist", UNKNOWN(lti->ptszArtist),
L"album", UNKNOWN(lti->ptszAlbum),
L"title", UNKNOWN(lti->ptszTitle),
@@ -925,7 +925,7 @@ TCHAR* VariablesParseInfo(ARGUMENTSINFO *ai)
L"type", UNKNOWN(lti->ptszType)
};
- Buffer<TCHAR> ret;
+ Buffer<wchar_t> ret;
ReplaceTemplate(&ret, NULL, opts.templ, fr, _countof(fr));
return ret.detach();
}
@@ -948,52 +948,52 @@ TCHAR* VariablesParseInfo(ARGUMENTSINFO *ai)
else \
{ \
ai->flags = AIF_DONTPARSE; \
- TCHAR *ret = mir_tstrdup(lti->__field__); \
+ wchar_t *ret = mir_tstrdup(lti->__field__); \
return ret; \
}
-TCHAR* VariablesParseType(ARGUMENTSINFO *ai)
+wchar_t* VariablesParseType(ARGUMENTSINFO *ai)
{
VARIABLES_PARSE_BODY(ptszType);
}
-TCHAR* VariablesParseArtist(ARGUMENTSINFO *ai)
+wchar_t* VariablesParseArtist(ARGUMENTSINFO *ai)
{
VARIABLES_PARSE_BODY(ptszArtist);
}
-TCHAR* VariablesParseAlbum(ARGUMENTSINFO *ai)
+wchar_t* VariablesParseAlbum(ARGUMENTSINFO *ai)
{
VARIABLES_PARSE_BODY(ptszAlbum);
}
-TCHAR* VariablesParseTitle(ARGUMENTSINFO *ai)
+wchar_t* VariablesParseTitle(ARGUMENTSINFO *ai)
{
VARIABLES_PARSE_BODY(ptszTitle);
}
-TCHAR* VariablesParseTrack(ARGUMENTSINFO *ai)
+wchar_t* VariablesParseTrack(ARGUMENTSINFO *ai)
{
VARIABLES_PARSE_BODY(ptszTrack);
}
-TCHAR* VariablesParseYear(ARGUMENTSINFO *ai)
+wchar_t* VariablesParseYear(ARGUMENTSINFO *ai)
{
VARIABLES_PARSE_BODY(ptszYear);
}
-TCHAR* VariablesParseGenre(ARGUMENTSINFO *ai)
+wchar_t* VariablesParseGenre(ARGUMENTSINFO *ai)
{
VARIABLES_PARSE_BODY(ptszGenre);
}
-TCHAR* VariablesParseLength(ARGUMENTSINFO *ai)
+wchar_t* VariablesParseLength(ARGUMENTSINFO *ai)
{
VARIABLES_PARSE_BODY(ptszLength);
}
-TCHAR* VariablesParsePlayer(ARGUMENTSINFO *ai)
+wchar_t* VariablesParsePlayer(ARGUMENTSINFO *ai)
{
VARIABLES_PARSE_BODY(ptszPlayer);
}
diff --git a/plugins/ListeningTo/src/options.cpp b/plugins/ListeningTo/src/options.cpp
index 2e36c42b2a..121a5e5869 100644
--- a/plugins/ListeningTo/src/options.cpp
+++ b/plugins/ListeningTo/src/options.cpp
@@ -52,10 +52,10 @@ static OptPageControl optionsControls[] = {
static OptPageControl formatControls[] = {
{ &opts.templ, CONTROL_TEXT, IDC_TEMPLATE, "Template", (ULONG_PTR)L"%artist% - %title%" },
- { &opts.unknown, CONTROL_TEXT, IDC_UNKNOWN, "Unknown", (ULONG_PTR)LPGENT("<Unknown>"), 0, 0, 128 },
- { &opts.xstatus_name, CONTROL_TEXT, IDC_XSTATUS_NAME, "XStatusName", (ULONG_PTR)LPGENT("Listening to") },
+ { &opts.unknown, CONTROL_TEXT, IDC_UNKNOWN, "Unknown", (ULONG_PTR)LPGENW("<Unknown>"), 0, 0, 128 },
+ { &opts.xstatus_name, CONTROL_TEXT, IDC_XSTATUS_NAME, "XStatusName", (ULONG_PTR)LPGENW("Listening to") },
{ &opts.xstatus_message, CONTROL_TEXT, IDC_XSTATUS_MESSAGE, "XStatusMessage", (ULONG_PTR)L"%listening%" },
- { &opts.nothing, CONTROL_TEXT, IDC_NOTHING, "Nothing", (ULONG_PTR)LPGENT("<Nothing is playing now>"), 0, 0, 128 }
+ { &opts.nothing, CONTROL_TEXT, IDC_NOTHING, "Nothing", (ULONG_PTR)LPGENW("<Nothing is playing now>"), 0, 0, 128 }
};
static OptPageControl playersControls[] = {
@@ -131,11 +131,11 @@ BOOL IsTypeEnabled(LISTENINGTOINFO *lti)
return TRUE;
if (lti->dwFlags & LTI_UNICODE) {
- if (mir_tstrcmpi(lti->ptszType, LPGENT("Music")) == 0)
+ if (mir_tstrcmpi(lti->ptszType, LPGENW("Music")) == 0)
return opts.enable_music;
- if (mir_tstrcmpi(lti->ptszType, LPGENT("Radio")) == 0)
+ if (mir_tstrcmpi(lti->ptszType, LPGENW("Radio")) == 0)
return opts.enable_radio;
- if (mir_tstrcmpi(lti->ptszType, LPGENT("Video")) == 0)
+ if (mir_tstrcmpi(lti->ptszType, LPGENW("Video")) == 0)
return opts.enable_video;
return opts.enable_others;
}
@@ -192,9 +192,9 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SendDlgItemMessage(hwndDlg, IDC_ADV_ICON, CB_ADDSTRING, 0, (LPARAM)L"2");
if (total > 0) {
- TCHAR tmp[10];
+ wchar_t tmp[10];
for (int i = first; i <= total; i++)
- SendDlgItemMessage(hwndDlg, IDC_ADV_ICON, CB_ADDSTRING, 0, (LPARAM)_itot(i - first + 3, tmp, 10));
+ SendDlgItemMessage(hwndDlg, IDC_ADV_ICON, CB_ADDSTRING, 0, (LPARAM)_itow(i - first + 3, tmp, 10));
}
}
diff --git a/plugins/ListeningTo/src/options.h b/plugins/ListeningTo/src/options.h
index 0aff9030fd..002237cf17 100644
--- a/plugins/ListeningTo/src/options.h
+++ b/plugins/ListeningTo/src/options.h
@@ -48,8 +48,8 @@ struct Options {
bool enable_video;
bool enable_others;
- TCHAR templ[1024];
- TCHAR unknown[128];
+ wchar_t templ[1024];
+ wchar_t unknown[128];
bool override_contact_template;
bool show_adv_icon;
@@ -61,9 +61,9 @@ struct Options {
int time_to_pool;
WORD xstatus_set;
- TCHAR xstatus_name[1024];
- TCHAR xstatus_message[1024];
- TCHAR nothing[128];
+ wchar_t xstatus_name[1024];
+ wchar_t xstatus_message[1024];
+ wchar_t nothing[128];
};
extern Options opts;
diff --git a/plugins/ListeningTo/src/players/foobar.cpp b/plugins/ListeningTo/src/players/foobar.cpp
index eb06043b11..8e9f14eaac 100644
--- a/plugins/ListeningTo/src/players/foobar.cpp
+++ b/plugins/ListeningTo/src/players/foobar.cpp
@@ -19,7 +19,7 @@ Boston, MA 02111-1307, USA.
#include "../stdafx.h"
-static TCHAR *wcs[] = {
+static wchar_t *wcs[] = {
L"{DA7CD0DE-1602-45e6-89A1-C2CA151E008E}/1", // Foobar 0.9.1
L"{DA7CD0DE-1602-45e6-89A1-C2CA151E008E}",
L"{97E27FAA-C0B3-4b8e-A693-ED7881E99FC1}", // Foobar 0.9.5.3
diff --git a/plugins/ListeningTo/src/players/generic.cpp b/plugins/ListeningTo/src/players/generic.cpp
index 62456fd480..551d0d2a5e 100644
--- a/plugins/ListeningTo/src/players/generic.cpp
+++ b/plugins/ListeningTo/src/players/generic.cpp
@@ -24,7 +24,7 @@ static HANDLE hLog = NULL;
GenericPlayer *singleton = NULL;
-void m_log(const TCHAR *function, const TCHAR *fmt, ...)
+void m_log(const wchar_t *function, const wchar_t *fmt, ...)
{
if (hLog == NULL) {
hLog = mir_createLog(MODULE_NAME, L"ListeningTo log", L"c:\\temp\\listeningto.txt", 0);
@@ -80,7 +80,7 @@ GenericPlayer::GenericPlayer()
RegisterClass(&wc);
- hWnd = CreateWindow(MIRANDA_WINDOWCLASS, LPGENT("Miranda ListeningTo receiver"),
+ hWnd = CreateWindow(MIRANDA_WINDOWCLASS, LPGENW("Miranda ListeningTo receiver"),
0, 0, 0, 0, 0, NULL, NULL, hInst, NULL);
}
@@ -118,14 +118,14 @@ void GenericPlayer::ProcessReceived()
int pCount = 0;
WCHAR *p = received;
do {
- *p1 = _T('\0');
+ *p1 = '\0';
parts[pCount] = p;
pCount++;
p = p1 + 2;
p1 = wcsstr(p, L"\\0");
} while (p1 != NULL && pCount < 10);
if (p1 != NULL)
- *p1 = _T('\0');
+ *p1 = '\0';
parts[pCount] = p;
if (pCount < 5)
@@ -170,7 +170,7 @@ void GenericPlayer::ProcessReceived()
if (parts[9] != NULL) {
long length = _wtoi(parts[9]);
if (length > 0) {
- li->ptszLength = (TCHAR*)mir_alloc(10 * sizeof(TCHAR));
+ li->ptszLength = (wchar_t*)mir_alloc(10 * sizeof(wchar_t));
int s = length % 60;
int m = (length / 60) % 60;
@@ -212,7 +212,7 @@ static VOID CALLBACK SendTimerProc(HWND, UINT, UINT_PTR, DWORD)
void GenericPlayer::NewData(const WCHAR *data, size_t len)
{
- if (data[0] == _T('\0'))
+ if (data[0] == '\0')
return;
mir_cslock lck(cs);
diff --git a/plugins/ListeningTo/src/players/itunes.cpp b/plugins/ListeningTo/src/players/itunes.cpp
index 79cea49a13..fa6f2478e6 100644
--- a/plugins/ListeningTo/src/players/itunes.cpp
+++ b/plugins/ListeningTo/src/players/itunes.cpp
@@ -103,14 +103,14 @@ BOOL ITunes::FillCache()
CALL(track->get_Year(&lret));
if (lret > 0) {
- listening_info.ptszYear = (TCHAR*)mir_alloc(10 * sizeof(TCHAR));
- _itot(lret, listening_info.ptszYear, 10);
+ listening_info.ptszYear = (wchar_t*)mir_alloc(10 * sizeof(wchar_t));
+ _itow(lret, listening_info.ptszYear, 10);
}
CALL(track->get_TrackNumber(&lret));
if (lret > 0) {
- listening_info.ptszTrack = (TCHAR*)mir_alloc(10 * sizeof(TCHAR));
- _itot(lret, listening_info.ptszTrack, 10);
+ listening_info.ptszTrack = (wchar_t*)mir_alloc(10 * sizeof(wchar_t));
+ _itow(lret, listening_info.ptszTrack, 10);
}
CALL(track->get_Genre(&ret));
@@ -118,7 +118,7 @@ BOOL ITunes::FillCache()
CALL(track->get_Duration(&lret));
if (lret > 0) {
- listening_info.ptszLength = (TCHAR*)mir_alloc(10 * sizeof(TCHAR));
+ listening_info.ptszLength = (wchar_t*)mir_alloc(10 * sizeof(wchar_t));
int s = lret % 60;
int m = (lret / 60) % 60;
@@ -142,9 +142,9 @@ BOOL ITunes::FillCache()
listening_info.ptszTitle = mir_u2t(p);
- TCHAR *pt = _tcsrchr(listening_info.ptszTitle, '.');
+ wchar_t *pt = wcsrchr(listening_info.ptszTitle, '.');
if (pt != NULL)
- *p = _T('\0');
+ *p = '\0';
}
listening_info.ptszPlayer = mir_tstrdup(name);
diff --git a/plugins/ListeningTo/src/players/itunes.h b/plugins/ListeningTo/src/players/itunes.h
index bce9318f1a..cc5c496910 100644
--- a/plugins/ListeningTo/src/players/itunes.h
+++ b/plugins/ListeningTo/src/players/itunes.h
@@ -38,7 +38,7 @@ protected:
BOOL InitTempData();
void FreeTempData();
BOOL InitAndGetFilename();
- int GetMetadata(char *metadata, TCHAR **data);
+ int GetMetadata(char *metadata, wchar_t **data);
BOOL FillCache();
public:
diff --git a/plugins/ListeningTo/src/players/player.h b/plugins/ListeningTo/src/players/player.h
index 83a14e3a69..f5505b7374 100644
--- a/plugins/ListeningTo/src/players/player.h
+++ b/plugins/ListeningTo/src/players/player.h
@@ -29,7 +29,7 @@ protected:
public:
BOOL enabled;
BOOL needPoll;
- TCHAR *name;
+ wchar_t *name;
Player();
virtual ~Player();
@@ -48,7 +48,7 @@ public:
class ExternalPlayer : public Player
{
protected:
- TCHAR **window_classes;
+ wchar_t **window_classes;
int num_window_classes;
BOOL found_window;
@@ -66,7 +66,7 @@ class CodeInjectionPlayer : public ExternalPlayer
{
protected:
char *dll_name;
- TCHAR *message_window_class;
+ wchar_t *message_window_class;
DWORD next_request_time;
virtual void InjectCode();
diff --git a/plugins/ListeningTo/src/players/watrack.cpp b/plugins/ListeningTo/src/players/watrack.cpp
index 3a7cd24a0f..d76b79571b 100644
--- a/plugins/ListeningTo/src/players/watrack.cpp
+++ b/plugins/ListeningTo/src/players/watrack.cpp
@@ -88,14 +88,14 @@ void WATrack::GetData()
listening_info.ptszYear = DUP(si->year);
if (si->track > 0) {
- listening_info.ptszTrack = (TCHAR*)mir_alloc(10 * sizeof(TCHAR));
- _itot(si->track, listening_info.ptszTrack, 10);
+ listening_info.ptszTrack = (wchar_t*)mir_alloc(10 * sizeof(wchar_t));
+ _itow(si->track, listening_info.ptszTrack, 10);
}
listening_info.ptszGenre = DUP(si->genre);
if (si->total > 0) {
- listening_info.ptszLength = (TCHAR*)mir_alloc(10 * sizeof(TCHAR));
+ listening_info.ptszLength = (wchar_t*)mir_alloc(10 * sizeof(wchar_t));
int s = si->total % 60;
int m = (si->total / 60) % 60;
diff --git a/plugins/ListeningTo/src/players/winamp.cpp b/plugins/ListeningTo/src/players/winamp.cpp
index 35bfde5cfe..685459fb63 100644
--- a/plugins/ListeningTo/src/players/winamp.cpp
+++ b/plugins/ListeningTo/src/players/winamp.cpp
@@ -19,7 +19,7 @@ Boston, MA 02111-1307, USA.
#include "../stdafx.h"
-static TCHAR *wcs[] = {
+static wchar_t *wcs[] = {
L"Winamp v1.x"
};
diff --git a/plugins/ListeningTo/src/players/wmp.cpp b/plugins/ListeningTo/src/players/wmp.cpp
index 639c384b40..c3131e8718 100644
--- a/plugins/ListeningTo/src/players/wmp.cpp
+++ b/plugins/ListeningTo/src/players/wmp.cpp
@@ -30,7 +30,7 @@ WindowsMediaPlayer *singleton = NULL;
WindowsMediaPlayer::WindowsMediaPlayer()
{
name = L"WindowsMediaPlayer";
- received[0] = _T('\0');
+ received[0] = '\0';
singleton = this;
WNDCLASS wc = { 0 };
@@ -40,7 +40,7 @@ WindowsMediaPlayer::WindowsMediaPlayer()
RegisterClass(&wc);
- hWnd = CreateWindow(WMP_WINDOWCLASS, LPGENT("Miranda ListeningTo WMP receiver"),
+ hWnd = CreateWindow(WMP_WINDOWCLASS, LPGENW("Miranda ListeningTo WMP receiver"),
0, 0, 0, 0, 0, NULL, NULL, hInst, NULL);
}
@@ -132,7 +132,7 @@ void WindowsMediaPlayer::NewData(const WCHAR *data, size_t len)
len = min(len, 1023);
if (wcsncmp(received, data, len) != 0) {
wcsncpy(received, data, len);
- received[len] = _T('\0');
+ received[len] = '\0';
if (hTimer)
KillTimer(NULL, hTimer);
diff --git a/plugins/ListeningTo/src/stdafx.h b/plugins/ListeningTo/src/stdafx.h
index 81ba49f016..535d581660 100644
--- a/plugins/ListeningTo/src/stdafx.h
+++ b/plugins/ListeningTo/src/stdafx.h
@@ -87,15 +87,15 @@ void StartTimer();
struct ProtocolInfo
{
char proto[128];
- TCHAR account[128];
+ wchar_t account[128];
HGENMENU hMenu;
int old_xstatus;
- TCHAR old_xstatus_name[1024];
- TCHAR old_xstatus_message[1024];
+ wchar_t old_xstatus_name[1024];
+ wchar_t old_xstatus_message[1024];
};
ProtocolInfo *GetProtoInfo(char *proto);
-void m_log(const TCHAR *function, const TCHAR *fmt, ...);
+void m_log(const wchar_t *function, const wchar_t *fmt, ...);
static bool IsEmpty(const char *str)
diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp
index fdd573b3bb..062961e373 100644
--- a/plugins/LotusNotify/src/LotusNotify.cpp
+++ b/plugins/LotusNotify/src/LotusNotify.cpp
@@ -40,7 +40,7 @@ static UINT TID = (UINT)2006;
char settingServer[MAX_SETTING_STR] = "", settingServerSec[MAX_SETTING_STR] = "", settingDatabase[MAX_SETTING_STR] = "",
settingCommand[MAX_SETTING_STR] = "", settingParameters[MAX_SETTING_STR] = "", settingPassword[MAX_SETTING_STR] = "";
-TCHAR settingFilterSubject[MAX_SETTING_STR] = TEXT(""), settingFilterSender[MAX_SETTING_STR] = TEXT(""), settingFilterTo[MAX_SETTING_STR] = TEXT("");
+wchar_t settingFilterSubject[MAX_SETTING_STR] = TEXT(""), settingFilterSender[MAX_SETTING_STR] = TEXT(""), settingFilterTo[MAX_SETTING_STR] = TEXT("");
COLORREF settingBgColor, settingFgColor;
int settingInterval = 0, settingInterval1 = 0;
@@ -57,12 +57,12 @@ BOOL isPopupWaiting = FALSE;
int currentStatus = ID_STATUS_OFFLINE;
int diffstat = 0;
int startuperror = 0;
-TCHAR *startuperrors[] = {
- LPGENT("Unable to load all required Lotus API functions"),
- LPGENT("Lotus Notes Client not detected. Check plugin configuration description on install.txt"),
- LPGENT("Unable to initialize Notes."),
- LPGENT("Lotus Notes Extension Manager was not registered. Authentication function will not work properly"),
- LPGENT("In notes.ini file there is no required entry EXTMGR_ADDINS=plugindllnamewithout\".dll\"")
+wchar_t *startuperrors[] = {
+ LPGENW("Unable to load all required Lotus API functions"),
+ LPGENW("Lotus Notes Client not detected. Check plugin configuration description on install.txt"),
+ LPGENW("Unable to initialize Notes."),
+ LPGENW("Lotus Notes Extension Manager was not registered. Authentication function will not work properly"),
+ LPGENW("In notes.ini file there is no required entry EXTMGR_ADDINS=plugindllnamewithout\".dll\"")
};
@@ -262,30 +262,30 @@ BOOL strrep(char *src, char *needle, char *newstring)
//check if given string contain filter string
//param field= 0-sender
// 1-subject
-BOOL checkFilters(TCHAR* str, int field)
+BOOL checkFilters(wchar_t* str, int field)
{
- TCHAR buff[512] = L"";
- TCHAR *strptr = NULL;
+ wchar_t buff[512] = L"";
+ wchar_t *strptr = NULL;
switch(field) {
case 0:
- _tcsncpy_s(buff, settingFilterSender, _TRUNCATE);
+ wcsncpy_s(buff, settingFilterSender, _TRUNCATE);
break;
case 1:
- _tcsncpy_s(buff, settingFilterSubject, _TRUNCATE);
+ wcsncpy_s(buff, settingFilterSubject, _TRUNCATE);
break;
case 2:
- _tcsncpy_s(buff, settingFilterTo, _TRUNCATE);
+ wcsncpy_s(buff, settingFilterTo, _TRUNCATE);
break;
}
- while(strptr = _tcschr(buff, ';'))
+ while(strptr = wcschr(buff, ';'))
{
- TCHAR tmp[512] = TEXT(""), *ptr;
- _tcsncpy_s(tmp, buff, (strptr-buff));
- _tcsncpy_s(buff, strptr + 1, _TRUNCATE);
+ wchar_t tmp[512] = TEXT(""), *ptr;
+ wcsncpy_s(tmp, buff, (strptr-buff));
+ wcsncpy_s(buff, strptr + 1, _TRUNCATE);
- if(_tcsstr(_tcslwr(ptr=_tcsdup(str)),_tcslwr(tmp)))
+ if(wcsstr(wcslwr(ptr=wcsdup(str)),wcslwr(tmp)))
{
free(ptr);
return TRUE;
@@ -436,7 +436,7 @@ BOOL checkNotesIniFile(BOOL bInfo)
//popup plugin to show popup function
-void showMsg(TCHAR* sender,TCHAR* text, DWORD id, char *strUID)
+void showMsg(wchar_t* sender,wchar_t* text, DWORD id, char *strUID)
{
POPUPDATAT ppd;
@@ -452,8 +452,8 @@ void showMsg(TCHAR* sender,TCHAR* text, DWORD id, char *strUID)
memset(&ppd, 0, sizeof(ppd)); //This is always a good thing to do.
ppd.lchContact = NULL; //(HANDLE)hContact; //Be sure to use a GOOD handle, since this will not be checked.
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON1));
- _tcscpy_s(ppd.lptzContactName, _countof(ppd.lptzContactName), sender);
- _tcscpy_s(ppd.lptzText, _countof(ppd.lptzText), text);
+ wcscpy_s(ppd.lptzContactName, _countof(ppd.lptzContactName), sender);
+ wcscpy_s(ppd.lptzText, _countof(ppd.lptzText), text);
if(settingSetColours)
{
ppd.colorBack = settingBgColor;
@@ -478,18 +478,18 @@ void showMsg(TCHAR* sender,TCHAR* text, DWORD id, char *strUID)
//what to do with error msg
void ErMsgW(WCHAR* msg)
{
- TCHAR* msgT = mir_u2t(msg);
+ wchar_t* msgT = mir_u2t(msg);
ErMsgT(msgT);
mir_free(msgT);
}
-///TODO TCHAR->WCHAR and test
-void ErMsgT(TCHAR* msg)
+///TODO wchar_t->WCHAR and test
+void ErMsgT(wchar_t* msg)
{
log_p(L"Error: %S", msg);
if(settingShowError && !isPopupWaiting) {
- TCHAR buffer[256+14];
- _tcsncpy_s(buffer, L"LotusNotify: ", _TRUNCATE);
- _tcscat_s(buffer, msg);
+ wchar_t buffer[256+14];
+ wcsncpy_s(buffer, L"LotusNotify: ", _TRUNCATE);
+ wcscat_s(buffer, msg);
isPopupWaiting = TRUE;
PUShowMessageT(buffer, SM_WARNING);
isPopupWaiting = FALSE;
@@ -562,7 +562,7 @@ void checkthread(void*)
char field_date[MAXALPHATIMEDATE + 1];
char field_lotus_LMBCS[MAX_FIELD];
- char field_lotus_UNICODEatCHAR[MAX_FIELD * sizeof(TCHAR)];
+ char field_lotus_UNICODEatCHAR[MAX_FIELD * sizeof(wchar_t)];
WCHAR field_from_UNICODE[MAX_FIELD], field_subject_UNICODE[MAX_FIELD], field_to_UNICODE[MAX_FIELD],field_copy_UNICODE[MAX_FIELD];
mir_cslock lck(checkthreadCS);
@@ -716,7 +716,7 @@ void checkthread(void*)
field_len = NSFItemGetText1(note_handle, MAIL_FROM_ITEM, field_lotus_LMBCS, (WORD)sizeof(field_lotus_LMBCS));
OSTranslate1(OS_TRANSLATE_LMBCS_TO_UNICODE, field_lotus_LMBCS, field_len, field_lotus_UNICODEatCHAR, sizeof(field_lotus_UNICODEatCHAR));
- memcpy(field_from_UNICODE, field_lotus_UNICODEatCHAR, field_len * sizeof(TCHAR));
+ memcpy(field_from_UNICODE, field_lotus_UNICODEatCHAR, field_len * sizeof(wchar_t));
field_from_UNICODE[field_len] = '\0';
NSFItemGetTime1(note_handle, MAIL_POSTEDDATE_ITEM, &sendDate);
@@ -725,17 +725,17 @@ void checkthread(void*)
field_len = NSFItemGetText1(note_handle, MAIL_SUBJECT_ITEM, field_lotus_LMBCS, (WORD)sizeof(field_lotus_LMBCS));
OSTranslate1(OS_TRANSLATE_LMBCS_TO_UNICODE, field_lotus_LMBCS, field_len, field_lotus_UNICODEatCHAR, sizeof(field_lotus_UNICODEatCHAR));
- memcpy(field_subject_UNICODE, field_lotus_UNICODEatCHAR, field_len * sizeof(TCHAR));
+ memcpy(field_subject_UNICODE, field_lotus_UNICODEatCHAR, field_len * sizeof(wchar_t));
field_subject_UNICODE[field_len] = '\0';
field_len = NSFItemGetText1(note_handle, MAIL_SENDTO_ITEM, field_lotus_LMBCS, (WORD)sizeof(field_lotus_LMBCS));
OSTranslate1(OS_TRANSLATE_LMBCS_TO_UNICODE, field_lotus_LMBCS, field_len, field_lotus_UNICODEatCHAR, sizeof(field_lotus_UNICODEatCHAR));
- memcpy(field_to_UNICODE, field_lotus_UNICODEatCHAR, field_len * sizeof(TCHAR));
+ memcpy(field_to_UNICODE, field_lotus_UNICODEatCHAR, field_len * sizeof(wchar_t));
field_to_UNICODE[field_len] = '\0';
field_len = NSFItemGetText1(note_handle, MAIL_COPYTO_ITEM, field_lotus_LMBCS, (WORD)sizeof(field_lotus_LMBCS));
OSTranslate1(OS_TRANSLATE_LMBCS_TO_UNICODE, field_lotus_LMBCS, field_len, field_lotus_UNICODEatCHAR, sizeof(field_lotus_UNICODEatCHAR));
- memcpy(field_copy_UNICODE, field_lotus_UNICODEatCHAR, field_len * sizeof(TCHAR));
+ memcpy(field_copy_UNICODE, field_lotus_UNICODEatCHAR, field_len * sizeof(wchar_t));
field_copy_UNICODE[field_len] = '\0';
@@ -744,9 +744,9 @@ void checkthread(void*)
memset(msgSubject, 0, sizeof(msgSubject));
if (mir_wstrlen(field_from_UNICODE) < 512 && mir_wstrlen(field_from_UNICODE) > 3 && wcsstr(field_from_UNICODE, L"CN=") == field_from_UNICODE)
- _tcsncpy_s(msgFrom, &(field_from_UNICODE[3]), wcscspn(field_from_UNICODE, L"/") - 3);
+ wcsncpy_s(msgFrom, &(field_from_UNICODE[3]), wcscspn(field_from_UNICODE, L"/") - 3);
else
- _tcsncpy_s(msgFrom, field_from_UNICODE, _TRUNCATE);
+ wcsncpy_s(msgFrom, field_from_UNICODE, _TRUNCATE);
for (Att = 0; MailGetMessageAttachmentInfo1(note_handle, Att, &bhAttachment, NULL, &cSize, NULL, NULL, NULL, NULL); Att++)
attSize += cSize;
@@ -775,7 +775,7 @@ void checkthread(void*)
if (attSize) {
WCHAR field_attachments_UNICODE[MAX_FIELD];
- mir_sntprintf(field_attachments_UNICODE, TranslateW(L"Attachments: %d bytes"), attSize);
+ mir_sntprintf(field_attachments_UNICODE, TranslateT("Attachments: %d bytes"), attSize);
mir_sntprintf(msgSubject, L"%S\n%s\n%s", field_date, field_subject_UNICODE, field_attachments_UNICODE);
}
else {
@@ -986,15 +986,15 @@ static void LoadSettings()
}
if (!db_get_ts(NULL, PLUGINNAME, "LNFilterSender", &dbv)) {
- _tcsncpy_s(settingFilterSender, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(settingFilterSender, dbv.ptszVal, _TRUNCATE);
db_free(&dbv);
}
if (!db_get_ts(NULL, PLUGINNAME, "LNFilterSubject", &dbv)) {
- _tcsncpy_s(settingFilterSubject, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(settingFilterSubject, dbv.ptszVal, _TRUNCATE);
db_free(&dbv);
}
if (!db_get_ts(NULL, PLUGINNAME, "LNFilterTo", &dbv)) {
- _tcsncpy_s(settingFilterTo, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(settingFilterTo, dbv.ptszVal, _TRUNCATE);
db_free(&dbv);
}
@@ -1051,28 +1051,28 @@ static void SaveSettings(HWND hwndDlg)
settingFilterSender[0] = 0;
for (int i = 0; i < SendDlgItemMessage(hwndDlg, IDC_FILTER_SENDER, CB_GETCOUNT, 0, 0); i++) {
- TCHAR text[512] = TEXT("");
+ wchar_t text[512] = TEXT("");
SendDlgItemMessage(hwndDlg, IDC_FILTER_SENDER, CB_GETLBTEXT, (WPARAM)i, (LPARAM)text);
- _tcscat_s(settingFilterSender, _countof(settingFilterSender), text);
- _tcscat_s(settingFilterSender, _countof(settingFilterSender), TEXT(";"));
+ wcscat_s(settingFilterSender, _countof(settingFilterSender), text);
+ wcscat_s(settingFilterSender, _countof(settingFilterSender), TEXT(";"));
}
db_set_ts(NULL, PLUGINNAME, "LNFilterSender", settingFilterSender);
settingFilterSubject[0] = 0;
for (int i = 0; i < SendDlgItemMessage(hwndDlg, IDC_FILTER_SUBJECT, CB_GETCOUNT, 0, 0); i++) {
- TCHAR text[512] = TEXT("");
+ wchar_t text[512] = TEXT("");
SendDlgItemMessage(hwndDlg, IDC_FILTER_SUBJECT, CB_GETLBTEXT, (WPARAM)i, (LPARAM)text);
- _tcscat_s(settingFilterSubject, _countof(settingFilterSubject), text);
- _tcscat_s(settingFilterSubject, _countof(settingFilterSubject), TEXT(";"));
+ wcscat_s(settingFilterSubject, _countof(settingFilterSubject), text);
+ wcscat_s(settingFilterSubject, _countof(settingFilterSubject), TEXT(";"));
}
db_set_ts(NULL, PLUGINNAME, "LNFilterSubject", settingFilterSubject);
settingFilterTo[0] = 0;
for (int i = 0; i < SendDlgItemMessage(hwndDlg, IDC_FILTER_TO, CB_GETCOUNT, 0, 0); i++) {
- TCHAR text[512] = TEXT("");
+ wchar_t text[512] = TEXT("");
SendDlgItemMessage(hwndDlg, IDC_FILTER_TO, CB_GETLBTEXT, (WPARAM)i, (LPARAM)text);
- _tcscat_s(settingFilterTo, _countof(settingFilterTo), text);
- _tcscat_s(settingFilterTo, _countof(settingFilterTo), TEXT(";"));
+ wcscat_s(settingFilterTo, _countof(settingFilterTo), text);
+ wcscat_s(settingFilterTo, _countof(settingFilterTo), TEXT(";"));
}
db_set_ts(NULL, PLUGINNAME, "LNFilterTo", settingFilterTo);
}
@@ -1293,41 +1293,41 @@ static INT_PTR CALLBACK DlgProcLotusNotifyMiscOpts(HWND hwndDlg, UINT msg, WPARA
{
static bool bInit = false;
- TCHAR* strptr;
+ wchar_t* strptr;
LVITEM lvI = { 0 };
LVCOLUMN lvc = { 0 };
switch (msg) {
case WM_INITDIALOG://initialize dialog, so set properties from db.
{
- TCHAR buff[512];
+ wchar_t buff[512];
bInit = true;
TranslateDialogDefault(hwndDlg);//translate miranda function
LoadSettings();
//fill filter combos
- _tcsncpy_s(buff, settingFilterSender, _TRUNCATE);
- while (strptr = _tcschr(buff, TEXT(';'))) {
- TCHAR tmp[512] = TEXT("");
- _tcsncpy_s(tmp, buff, (strptr - buff));
+ wcsncpy_s(buff, settingFilterSender, _TRUNCATE);
+ while (strptr = wcschr(buff, TEXT(';'))) {
+ wchar_t tmp[512] = TEXT("");
+ wcsncpy_s(tmp, buff, (strptr - buff));
SendDlgItemMessage(hwndDlg, IDC_FILTER_SENDER, CB_ADDSTRING, 0, (LPARAM)tmp);
- _tcsncpy_s(buff, strptr + 1, _TRUNCATE);
+ wcsncpy_s(buff, strptr + 1, _TRUNCATE);
}
- _tcsncpy_s(buff, settingFilterSubject, _TRUNCATE);
- while (strptr = _tcschr(buff, TEXT(';'))) {
- TCHAR tmp[512] = TEXT("");
- _tcsncpy_s(tmp, buff, (strptr - buff));
+ wcsncpy_s(buff, settingFilterSubject, _TRUNCATE);
+ while (strptr = wcschr(buff, TEXT(';'))) {
+ wchar_t tmp[512] = TEXT("");
+ wcsncpy_s(tmp, buff, (strptr - buff));
SendDlgItemMessage(hwndDlg, IDC_FILTER_SUBJECT, CB_ADDSTRING, 0, (LPARAM)tmp);
- _tcsncpy_s(buff, strptr + 1, _TRUNCATE);
+ wcsncpy_s(buff, strptr + 1, _TRUNCATE);
}
- _tcsncpy_s(buff, settingFilterTo, _TRUNCATE);
- while (strptr = _tcschr(buff, TEXT(';'))) {
- TCHAR tmp[512] = TEXT("");
- _tcsncpy_s(tmp, buff, (strptr - buff));
+ wcsncpy_s(buff, settingFilterTo, _TRUNCATE);
+ while (strptr = wcschr(buff, TEXT(';'))) {
+ wchar_t tmp[512] = TEXT("");
+ wcsncpy_s(tmp, buff, (strptr - buff));
SendDlgItemMessage(hwndDlg, IDC_FILTER_TO, CB_ADDSTRING, 0, (LPARAM)tmp);
- _tcsncpy_s(buff, strptr + 1, _TRUNCATE);
+ wcsncpy_s(buff, strptr + 1, _TRUNCATE);
}
// initialise and fill listbox
@@ -1455,21 +1455,21 @@ int LotusNotifyOptInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
- odp.ptszGroup = LPGENT("Plugins");
- odp.ptszTitle = LPGENT(__PLUGIN_NAME);
+ odp.pwszGroup = LPGENW("Plugins");
+ odp.pwszTitle = _A2W(__PLUGIN_NAME);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.ptszTab = LPGENT("Connection");
+ odp.pwszTab = LPGENW("Connection");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_LOTUS_CONECTION);
odp.pfnDlgProc = DlgProcLotusNotifyConnectionOpts;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Popup");
+ odp.pwszTab = LPGENW("Popup");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_LOTUS_POPUP);
odp.pfnDlgProc = DlgProcLotusNotifyPopupOpts;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Miscellaneous");
+ odp.pwszTab = LPGENW("Miscellaneous");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_LOTUS_MISC);
odp.pfnDlgProc = DlgProcLotusNotifyMiscOpts;
Options_AddPage(wParam, &odp);
@@ -1566,14 +1566,14 @@ INT_PTR SetStatus(WPARAM wParam, LPARAM lParam)
}
-void checkEnvPath(TCHAR *path)
+void checkEnvPath(wchar_t *path)
{
log_p(L"checkEnvPath: [%s]", path);
- _tcslwr(path);
- TCHAR *cur = _tgetenv(L"PATH");
- _tcslwr(cur);
- TCHAR *found = _tcsstr(cur, path);
+ wcslwr(path);
+ wchar_t *cur = _tgetenv(L"PATH");
+ wcslwr(cur);
+ wchar_t *found = wcsstr(cur, path);
size_t len = mir_tstrlen(path);
if (found != NULL && (found[len] == ';' || found[len] == 0 || (found[len] == '\\' && (found[len + 1] == ';' || found[len + 1] == 0))))
return;
@@ -1593,13 +1593,13 @@ static INT_PTR GetStatus(WPARAM, LPARAM)
static int modulesloaded(WPARAM, LPARAM)
{
int cnt;
- TCHAR path[255] = { 0 };
+ wchar_t path[255] = { 0 };
log(L"Modules loaded, lets start LN...");
GetLotusPath(path, sizeof(path));
checkEnvPath(path);
- _tcscat_s(path, _countof(path), L"nnotes.dll");
+ wcscat_s(path, _countof(path), L"nnotes.dll");
assert(mir_tstrlen(path) > 0);
log_p(L"Loading dll: %s", path);
@@ -1701,7 +1701,7 @@ extern "C" int __declspec(dllexport) Load(void)
mi.position = -0x7FFFFFFF; //on top menu position
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON1));
- mi.name.t = LPGENT("&Check Lotus");
+ mi.name.w = LPGENW("&Check Lotus");
mi.pszService = "LotusNotify/MenuCommand"; //service name thet listning for menu call
hMenuHandle = Menu_AddMainMenuItem(&mi); //create menu pos.
@@ -1727,7 +1727,7 @@ extern "C" int __declspec(dllexport) Load(void)
LoadSettings(); //read from db to variables
- SkinAddNewSoundExT("LotusNotify", LPGENT("Lotus Notify"), LPGENT("New Lotus document detected"));
+ SkinAddNewSoundExT("LotusNotify", LPGENW("Lotus Notify"), LPGENW("New Lotus document detected"));
hOptInit = HookEvent(ME_OPT_INITIALISE, LotusNotifyOptInit); //register service to hook option call
assert(hOptInit);
diff --git a/plugins/LotusNotify/src/LotusNotify.h b/plugins/LotusNotify/src/LotusNotify.h
index daa9c417b4..9eec4a4c74 100644
--- a/plugins/LotusNotify/src/LotusNotify.h
+++ b/plugins/LotusNotify/src/LotusNotify.h
@@ -27,6 +27,6 @@ typedef struct {
__declspec(dllexport) STATUS LNPUBLIC MainEntryPoint (void);
-void ErMsgT(TCHAR* msg);
+void ErMsgT(wchar_t* msg);
void checkthread(void*);
diff --git a/plugins/LotusNotify/src/lotusnotes.cpp b/plugins/LotusNotify/src/lotusnotes.cpp
index 447efa0d0d..8c5d1d9ff9 100644
--- a/plugins/LotusNotify/src/lotusnotes.cpp
+++ b/plugins/LotusNotify/src/lotusnotes.cpp
@@ -66,7 +66,7 @@ BOOL HookLotusFunctions()
) ? TRUE : FALSE;
}
-void GetLotusPath(TCHAR *sTemp, DWORD size)
+void GetLotusPath(wchar_t *sTemp, DWORD size)
{
DWORD rc;
HKEY dmKey;
diff --git a/plugins/LotusNotify/src/lotusnotes.h b/plugins/LotusNotify/src/lotusnotes.h
index 234952a746..436809c466 100644
--- a/plugins/LotusNotify/src/lotusnotes.h
+++ b/plugins/LotusNotify/src/lotusnotes.h
@@ -172,5 +172,5 @@ extern NOTESTERMTHREAD NotesTermThread1;
BOOL HookLotusFunctions();
-void GetLotusPath(TCHAR *sTemp, DWORD size);
+void GetLotusPath(wchar_t *sTemp, DWORD size);
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp
index 66d45d1059..ed5005e30d 100644
--- a/plugins/MenuItemEx/src/main.cpp
+++ b/plugins/MenuItemEx/src/main.cpp
@@ -30,16 +30,16 @@ int hLangpack;
struct {
char *module;
char *name;
- TCHAR *fullName;
+ wchar_t *fullName;
char flag;
}
static const statusMsg[] = {
- { "CList", "StatusMsg", LPGENT("Status message"), 1 },
- { 0, "XStatusName", LPGENT("xStatus title"), 4 },
- { 0, "XStatusMsg", LPGENT("xStatus message"), 2 },
- { "AdvStatus", "tune/text", LPGENT("Listening to"), 8 },
- { "AdvStatus", "activity/title", LPGENT("Activity title"), 8 },
- { "AdvStatus", "activity/text", LPGENT("Activity text"), 8 }
+ { "CList", "StatusMsg", LPGENW("Status message"), 1 },
+ { 0, "XStatusName", LPGENW("xStatus title"), 4 },
+ { 0, "XStatusMsg", LPGENW("xStatus message"), 2 },
+ { "AdvStatus", "tune/text", LPGENW("Listening to"), 8 },
+ { "AdvStatus", "activity/title", LPGENW("Activity title"), 8 },
+ { "AdvStatus", "activity/text", LPGENW("Activity text"), 8 }
};
static IconItem iconList[] = {
@@ -61,19 +61,19 @@ static IconItem overlayIconList[] = {
};
struct {
- TCHAR* name;
+ wchar_t* name;
int type;
int icon;
}
static const ii[] = {
- { LPGENT("All"), IGNOREEVENT_ALL, SKINICON_OTHER_FILLEDBLOB },
- { LPGENT("Messages"), IGNOREEVENT_MESSAGE, SKINICON_EVENT_MESSAGE },
- { LPGENT("URL"), IGNOREEVENT_URL, SKINICON_EVENT_URL },
- { LPGENT("Files"), IGNOREEVENT_FILE, SKINICON_EVENT_FILE },
- { LPGENT("User Online"), IGNOREEVENT_USERONLINE, SKINICON_OTHER_USERONLINE },
- { LPGENT("Authorization"), IGNOREEVENT_AUTHORIZATION, SKINICON_AUTH_REQUEST },
- { LPGENT("You Were Added"), IGNOREEVENT_YOUWEREADDED, SKINICON_AUTH_ADD },
- { LPGENT("Typing Notify"), IGNOREEVENT_TYPINGNOTIFY, SKINICON_OTHER_TYPING }
+ { LPGENW("All"), IGNOREEVENT_ALL, SKINICON_OTHER_FILLEDBLOB },
+ { LPGENW("Messages"), IGNOREEVENT_MESSAGE, SKINICON_EVENT_MESSAGE },
+ { LPGENW("URL"), IGNOREEVENT_URL, SKINICON_EVENT_URL },
+ { LPGENW("Files"), IGNOREEVENT_FILE, SKINICON_EVENT_FILE },
+ { LPGENW("User Online"), IGNOREEVENT_USERONLINE, SKINICON_OTHER_USERONLINE },
+ { LPGENW("Authorization"), IGNOREEVENT_AUTHORIZATION, SKINICON_AUTH_REQUEST },
+ { LPGENW("You Were Added"), IGNOREEVENT_YOUWEREADDED, SKINICON_AUTH_ADD },
+ { LPGENW("Typing Notify"), IGNOREEVENT_TYPINGNOTIFY, SKINICON_OTHER_TYPING }
};
PLUGININFOEX pluginInfoEx = {
@@ -203,10 +203,10 @@ void RenameDbProto(MCONTACT hContact, MCONTACT hContactNew, char* oldName, char*
FreeModuleSettingLL(&settinglist);
} // end code from dbe++
-void ShowPopup(char* szText, TCHAR* tszText, MCONTACT hContact)
+void ShowPopup(char* szText, wchar_t* tszText, MCONTACT hContact)
{
POPUPDATAT ppd = { 0 };
- TCHAR* text = 0;
+ wchar_t* text = 0;
if (tszText)
text = mir_tstrdup(tszText);
@@ -216,8 +216,8 @@ void ShowPopup(char* szText, TCHAR* tszText, MCONTACT hContact)
ppd.lchIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
ppd.lchContact = hContact;
- _tcsncpy(ppd.lptzContactName, pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME - 1);
- _tcsncpy(ppd.lptzText, text, MAX_SECONDLINE - 1);
+ wcsncpy(ppd.lptzContactName, pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME - 1);
+ wcsncpy(ppd.lptzText, text, MAX_SECONDLINE - 1);
ppd.iSeconds = -1;
PUAddPopupT(&ppd);
@@ -243,7 +243,7 @@ void CopyToClipboard(HWND, LPSTR pszMsg, LPTSTR ptszMsg)
if (buf == 0)
return;
- HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(buf) + 1)*sizeof(TCHAR));
+ HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(buf) + 1)*sizeof(wchar_t));
LPTSTR lptstrCopy = (LPTSTR)GlobalLock(hglbCopy);
mir_tstrcpy(lptstrCopy, buf);
mir_free(buf);
@@ -401,7 +401,7 @@ INT_PTR CALLBACK AuthReqWndProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpara
switch (LOWORD(wparam)) {
case IDOK:
{
- TCHAR tszReason[256] = { 0 };
+ wchar_t tszReason[256] = { 0 };
GetDlgItemText(hdlg, IDC_REASON, tszReason, _countof(tszReason));
ProtoChainSend(hcontact, PSS_AUTHREQUEST, 0, (LPARAM)tszReason);
} // fall through
@@ -497,7 +497,7 @@ void ModifyCopyID(MCONTACT hContact, BOOL bShowID, BOOL bTrimID)
hIconCID = hIcon;
}
- TCHAR buffer[256];
+ wchar_t buffer[256];
char szID[256];
GetID(hContact, szProto, (LPSTR)&szID, _countof(szID));
if (szID[0]) {
@@ -510,7 +510,7 @@ void ModifyCopyID(MCONTACT hContact, BOOL bShowID, BOOL bTrimID)
mir_sntprintf(buffer, L"%s [%S]", TranslateT("Copy ID"), szID);
Menu_ModifyItem(hmenuCopyID, buffer, hIconCID);
}
- else Menu_ModifyItem(hmenuCopyID, LPGENT("Copy ID"), hIconCID);
+ else Menu_ModifyItem(hmenuCopyID, LPGENW("Copy ID"), hIconCID);
}
else Menu_ShowItem(hmenuCopyID, false);
@@ -610,7 +610,7 @@ INT_PTR onCopyStatusMsg(WPARAM wparam, LPARAM lparam)
{
MCONTACT hContact = (MCONTACT) wparam;
char par[32];
- TCHAR buffer[2048];
+ wchar_t buffer[2048];
DWORD flags = db_get_dw(NULL, MODULENAME, "flags", vf_default);
LPSTR module = GetContactProto((MCONTACT)wparam);
@@ -626,13 +626,13 @@ INT_PTR onCopyStatusMsg(WPARAM wparam, LPARAM lparam)
LPTSTR msg = db_get_tsa(hContact, (statusMsg[i].module) ? statusMsg[i].module : module, par);
if (msg) {
- if (_tcsclen(msg)) {
+ if (wcslen(msg)) {
if (flags & VF_SMNAME) {
- mir_tstrncat(buffer, TranslateTS(statusMsg[i].fullName), (_countof(buffer) - _tcsclen(buffer) - 1));
- mir_tstrncat(buffer, L": ", (_countof(buffer) - _tcsclen(buffer) - 1));
+ mir_tstrncat(buffer, TranslateTS(statusMsg[i].fullName), (_countof(buffer) - wcslen(buffer) - 1));
+ mir_tstrncat(buffer, L": ", (_countof(buffer) - wcslen(buffer) - 1));
}
- mir_tstrncat(buffer, msg, (_countof(buffer) - _tcsclen(buffer) - 1));
- mir_tstrncat(buffer, L"\r\n", (_countof(buffer) - _tcsclen(buffer) - 1));
+ mir_tstrncat(buffer, msg, (_countof(buffer) - wcslen(buffer) - 1));
+ mir_tstrncat(buffer, L"\r\n", (_countof(buffer) - wcslen(buffer) - 1));
}
mir_free(msg);
}
@@ -733,12 +733,12 @@ INT_PTR onIgnore(WPARAM wparam, LPARAM lparam)
return 0;
}
-static HGENMENU AddSubmenuItem(HGENMENU hRoot, TCHAR* name, HICON icon, DWORD flag, char* service, int pos, INT_PTR param)
+static HGENMENU AddSubmenuItem(HGENMENU hRoot, wchar_t* name, HICON icon, DWORD flag, char* service, int pos, INT_PTR param)
{
CMenuItem mi;
mi.root = hRoot;
mi.position = pos;
- mi.name.t = name;
+ mi.name.w = name;
mi.hIcolibItem = icon;
mi.flags = CMIF_UNICODE | CMIF_UNMOVABLE | flag;
mi.pszService = service;
@@ -779,9 +779,9 @@ int BuildMenu(WPARAM wparam, LPARAM)
if (bEnabled) {
BYTE bHidden = db_get_b(hContact, "CList", "Hidden", 0);
if (bHidden)
- Menu_ModifyItem(hmenuHide, LPGENT("Show in list"), IcoLib_GetIcon("miex_showil"));
+ Menu_ModifyItem(hmenuHide, LPGENW("Show in list"), IcoLib_GetIcon("miex_showil"));
else
- Menu_ModifyItem(hmenuHide, LPGENT("Hide from list"), IcoLib_GetIcon("miex_hidefl"));
+ Menu_ModifyItem(hmenuHide, LPGENW("Hide from list"), IcoLib_GetIcon("miex_hidefl"));
}
bEnabled = bShowAll || (flags & VF_IGN);
@@ -903,7 +903,7 @@ static int TabsrmmButtonsInit(WPARAM, LPARAM)
bbd.pszModuleName = MODULENAME;
bbd.dwButtonID = 0;
bbd.dwDefPos = 1000;
- bbd.ptszTooltip = LPGENT("Browse Received Files");
+ bbd.ptszTooltip = LPGENW("Browse Received Files");
bbd.bbbFlags = BBBF_ISLSIDEBUTTON | BBBF_CANBEHIDDEN;
bbd.hIcon = IcoLib_GetIconHandle("miex_recfiles");
CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
@@ -965,25 +965,25 @@ static int PluginInit(WPARAM, LPARAM)
SET_UID(mi, 0x2616aa3f, 0x535a, 0x464c, 0xbd, 0x26, 0x1b, 0x15, 0xbe, 0xfa, 0x1f, 0xf);
mi.position = 120000;
- mi.name.t = LPGENT("Always visible");
+ mi.name.w = LPGENW("Always visible");
mi.pszService = MS_SETVIS;
hmenuVis = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x7d93de78, 0xb1c, 0x4c51, 0x8c, 0x88, 0x33, 0x72, 0x12, 0xb5, 0xb8, 0xe7);
mi.position++;
- mi.name.t = LPGENT("Never visible");
+ mi.name.w = LPGENW("Never visible");
mi.pszService = MS_SETINVIS;
hmenuOff = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x724f6ac0, 0x7f69, 0x407d, 0x85, 0x98, 0x9c, 0x80, 0x32, 0xdb, 0x66, 0x2d);
mi.position++;
- mi.name.t = LPGENT("Hide from list");
+ mi.name.w = LPGENW("Hide from list");
mi.pszService = MS_HIDE;
hmenuHide = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0xe09c04d4, 0xc6b1, 0x4048, 0x98, 0xd6, 0xbe, 0x11, 0xf6, 0x91, 0x15, 0xba);
mi.position++;
- mi.name.t = LPGENT("Ignore");
+ mi.name.w = LPGENW("Ignore");
mi.pszService = 0;
mi.hIcolibItem = IcoLib_GetIcon("miex_ignore");
hmenuIgnore = Menu_AddContactMenuItem(&mi);
@@ -997,11 +997,11 @@ static int PluginInit(WPARAM, LPARAM)
ood.cbSize = sizeof(ood);
ood.pszGroup = "Contacts";
ood.pszPage = "Ignore";
- AddSubmenuItem(hmenuIgnore, LPGENT("Open ignore settings"), IcoLib_GetIcon("miex_ignore"), 0, "Opt/OpenOptions", pos, (INT_PTR)&ood);
+ AddSubmenuItem(hmenuIgnore, LPGENW("Open ignore settings"), IcoLib_GetIcon("miex_ignore"), 0, "Opt/OpenOptions", pos, (INT_PTR)&ood);
SET_UID(mi, 0x820f4637, 0xbcc4, 0x46b7, 0x9c, 0x67, 0xf9, 0x69, 0xed, 0xc2, 0x46, 0xa2);
mi.position++;
- mi.name.t = LPGENT("Copy to Account");
+ mi.name.w = LPGENW("Copy to Account");
mi.pszService = MS_PROTO;
mi.hIcolibItem = IcoLib_GetIcon("miex_protocol");
hmenuProto = Menu_AddContactMenuItem(&mi);
@@ -1012,47 +1012,47 @@ static int PluginInit(WPARAM, LPARAM)
SET_UID(mi, 0x3f031688, 0xe947, 0x4aba, 0xa3, 0xc4, 0xa7, 0x2c, 0xd0, 0xda, 0x88, 0xb4);
mi.position++;
- mi.name.t = LPGENT("Send 'You were added'");
+ mi.name.w = LPGENW("Send 'You were added'");
mi.pszService = MS_ADDED;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_AUTH_ADD);
hmenuAdded = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x332c5564, 0x6283, 0x43ff, 0xa2, 0xfc, 0x58, 0x29, 0x27, 0x83, 0xea, 0x1a);
mi.position++;
- mi.name.t = LPGENT("Request authorization");
+ mi.name.w = LPGENW("Request authorization");
mi.pszService = MS_AUTHREQ;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_AUTH_REQUEST);
hmenuAuthReq = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x92826bf6, 0xd44c, 0x4dc2, 0xb2, 0xdd, 0xfe, 0xaf, 0x9b, 0x86, 0xe1, 0x53);
mi.position++;
- mi.name.t = LPGENT("Copy ID");
+ mi.name.w = LPGENW("Copy ID");
mi.pszService = MS_COPYID;
hmenuCopyID = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x54d45bf1, 0x1c6d, 0x49c9, 0xbd, 0xde, 0x63, 0xb2, 0x3d, 0xb0, 0x89, 0xbf);
mi.position++;
- mi.name.t = LPGENT("Browse Received Files");
+ mi.name.w = LPGENW("Browse Received Files");
mi.pszService = MS_RECVFILES;
mi.hIcolibItem = IcoLib_GetIcon("miex_recfiles");
hmenuRecvFiles = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0xf750f36b, 0x284f, 0x4841, 0x83, 0x18, 0xc7, 0x10, 0x4, 0x73, 0xea, 0x22);
mi.position++;
- mi.name.t = LPGENT("Copy Status Message");
+ mi.name.w = LPGENW("Copy Status Message");
mi.pszService = MS_STATUSMSG;
mi.hIcolibItem = NULL;
hmenuStatusMsg = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x3847bfcd, 0xfcd5, 0x4435, 0xa6, 0x54, 0x2e, 0x9, 0xc5, 0xba, 0xcf, 0x71);
mi.position++;
- mi.name.t = LPGENT("Copy IP");
+ mi.name.w = LPGENW("Copy IP");
mi.pszService = MS_COPYIP;
hmenuCopyIP = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x8c6ad48, 0x882d, 0x47ed, 0xa6, 0x6e, 0xba, 0x26, 0xa3, 0x50, 0x17, 0x82);
mi.position++;
- mi.name.t = LPGENT("Copy MirVer");
+ mi.name.w = LPGENW("Copy MirVer");
mi.pszService = MS_COPYMIRVER;
hmenuCopyMirVer = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/MenuItemEx/src/options.cpp b/plugins/MenuItemEx/src/options.cpp
index e82e65b045..75e33c58a5 100644
--- a/plugins/MenuItemEx/src/options.cpp
+++ b/plugins/MenuItemEx/src/options.cpp
@@ -30,7 +30,7 @@ static const checkboxes[] = {
INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
{
DWORD flags = db_get_dw(NULL, MODULENAME, "flags", vf_default);
- TCHAR buffer[64] = { 0 };
+ wchar_t buffer[64] = { 0 };
int i;
switch (msg) {
diff --git a/plugins/MessageState/src/messagestate.cpp b/plugins/MessageState/src/messagestate.cpp
index 6f64d22273..2082f67ec5 100644
--- a/plugins/MessageState/src/messagestate.cpp
+++ b/plugins/MessageState/src/messagestate.cpp
@@ -9,12 +9,12 @@ IconItem Icons[] =
{ LPGEN("Unread clist extra icon"), "clist_unread_icon", IDI_EXTRA },
};
-const TCHAR* Tooltips[] =
+const wchar_t* Tooltips[] =
{
- LPGENT("Last message is not read"),
- LPGENT("Last message read"),
- LPGENT("Last message was not sent"),
- LPGENT("Sending...")
+ LPGENW("Last message is not read"),
+ LPGENW("Last message read"),
+ LPGENW("Last message was not sent"),
+ LPGENW("Sending...")
};
void SetSRMMIcon(MCONTACT hContact, SRMM_ICON_TYPE type, time_t time)
@@ -34,7 +34,7 @@ void SetSRMMIcon(MCONTACT hContact, SRMM_ICON_TYPE type, time_t time)
{
if (db_get_dw(hContact, MODULENAME, DBKEY_MESSAGE_READ_TIME_TYPE, -1) == MRD_TYPE_READTIME)
{
- _tcsftime(tszTooltip.GetBuffer(64), 64, TranslateT("Last message read at %X %x"), localtime(&time));
+ wcsftime(tszTooltip.GetBuffer(64), 64, TranslateT("Last message read at %X %x"), localtime(&time));
tszTooltip.ReleaseBuffer();
}
else
diff --git a/plugins/MimCmd/src/commands.cpp b/plugins/MimCmd/src/commands.cpp
index b9ba0b26ab..d066dab4af 100644
--- a/plugins/MimCmd/src/commands.cpp
+++ b/plugins/MimCmd/src/commands.cpp
@@ -35,18 +35,18 @@ char *GetMirandaFolder(char *mimFolder, int size)
int ConnectToMiranda()
{
- TCHAR tszPath[MAX_PATH];
+ wchar_t tszPath[MAX_PATH];
GetModuleFileName(NULL, tszPath, _countof(tszPath));
- TCHAR *p = _tcsrchr(tszPath, '\\');
+ wchar_t *p = wcsrchr(tszPath, '\\');
if (p) p[1] = 0;
- _tcsncat_s(tszPath, L"libs", _TRUNCATE);
- DWORD cbPath = (DWORD)_tcslen(tszPath);
+ wcsncat_s(tszPath, L"libs", _TRUNCATE);
+ DWORD cbPath = (DWORD)wcslen(tszPath);
DWORD cbSize = GetEnvironmentVariable(L"PATH", NULL, 0);
- TCHAR *ptszVal = new TCHAR[cbSize + MAX_PATH + 2];
- _tcscpy(ptszVal, tszPath);
- _tcscat(ptszVal, L";");
+ wchar_t *ptszVal = new wchar_t[cbSize + MAX_PATH + 2];
+ wcscpy(ptszVal, tszPath);
+ wcscat(ptszVal, L";");
GetEnvironmentVariable(L"PATH", ptszVal + cbPath + 1, cbSize);
SetEnvironmentVariable(L"PATH", ptszVal);
delete[] ptszVal;
diff --git a/plugins/MirFox/src/MirandaOptions.cpp b/plugins/MirFox/src/MirandaOptions.cpp
index b9dea187de..7ea8ece4f5 100644
--- a/plugins/MirFox/src/MirandaOptions.cpp
+++ b/plugins/MirFox/src/MirandaOptions.cpp
@@ -675,25 +675,25 @@ int OptInit(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.position = -790000000;
odp.hInstance = hInst;
- odp.ptszTitle = LPGENT(PLUGIN_OPTIONS_NAME);
- odp.ptszGroup = LPGENT("Services");
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.pszTitle = LPGEN(PLUGIN_OPTIONS_NAME);
+ odp.pszGroup = LPGEN("Services");
+ odp.flags = ODPF_BOLDGROUPS;
//1 - options
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT1);
- odp.ptszTab = LPGENT("Options");
+ odp.pszTab = LPGEN("Options");
odp.pfnDlgProc = DlgProcOpts_Tab1;
Options_AddPage(wParam, &odp);
//2 - contacts
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT2);
- odp.ptszTab = LPGENT("Contacts");
+ odp.pszTab = LPGEN("Contacts");
odp.pfnDlgProc = DlgProcOpts_Tab2;
Options_AddPage(wParam, &odp);
//3 - accounts
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT3);
- odp.ptszTab = LPGENT("Accounts");
+ odp.pszTab = LPGEN("Accounts");
odp.pfnDlgProc = DlgProcOpts_Tab3;
Options_AddPage(wParam, &odp);
return 0;
diff --git a/plugins/MirFox/src/MirandaUtils.cpp b/plugins/MirFox/src/MirandaUtils.cpp
index 06ea0e2092..b37be018a8 100644
--- a/plugins/MirFox/src/MirandaUtils.cpp
+++ b/plugins/MirFox/src/MirandaUtils.cpp
@@ -186,7 +186,7 @@ void MirandaUtils::sendMessage(ActionThreadArgStruct* args, MFENUM_SEND_MESSAGE_
MirandaContact* mirandaContact = args->mirfoxDataPtr->getMirandaContactPtrByHandle((UINT_PTR)args->targetHandle);
const wchar_t* contactNameW = NULL;
- TCHAR* tszAccountName = NULL;
+ wchar_t* tszAccountName = NULL;
if (mirandaContact){
contactNameW = mirandaContact->contactNameW.c_str();
MirandaAccount* mirandaAccount = mirandaContact->mirandaAccountPtr;
@@ -342,7 +342,7 @@ int MirandaUtils::on_hook_OpenMW(WPARAM wParam, LPARAM lParam)
OnHookOpenMvStruct* param = (OnHookOpenMvStruct*)wParam;
if (param->msgBuffer != NULL){
- TCHAR *msgBuffer = mir_tstrdup(param->msgBuffer->c_str());
+ wchar_t *msgBuffer = mir_tstrdup(param->msgBuffer->c_str());
CallServiceSync(MS_MSG_SENDMESSAGET, (WPARAM)param->targetHandle, (LPARAM)msgBuffer);
mir_free(msgBuffer);
@@ -392,7 +392,7 @@ void MirandaUtils::setStatusOnAccount(ActionThreadArgStruct* args)
result = CallProtoService(args->accountSzModuleName, PS_SETAWAYMSG, status, (LPARAM)args->userActionSelection);
MirandaAccount* mirandaAccount = args->mirfoxDataPtr->getMirandaAccountPtrBySzModuleName(args->accountSzModuleName);
- TCHAR* tszAccountName = NULL;
+ wchar_t* tszAccountName = NULL;
if (mirandaAccount)
tszAccountName = mirandaAccount->tszAccountName;
diff --git a/plugins/MirFox/src/MirfoxData.cpp b/plugins/MirFox/src/MirfoxData.cpp
index 22eb70e504..c3369ac897 100644
--- a/plugins/MirFox/src/MirfoxData.cpp
+++ b/plugins/MirFox/src/MirfoxData.cpp
@@ -245,7 +245,7 @@ MirfoxData::getMirandaAccountPtrBySzModuleName(char* szModuleName)
// refresh support
-void MirfoxData::refreshAccount_Add(SharedMemoryUtils& sharedMemoryUtils, char* szModuleName, TCHAR* tszAccountName, char* szProtoName)
+void MirfoxData::refreshAccount_Add(SharedMemoryUtils& sharedMemoryUtils, char* szModuleName, wchar_t* tszAccountName, char* szProtoName)
{
MFLogger* logger = MFLogger::getInstance();
logger->log_p(L"MirfoxData::refreshAccount_Add proto [%S]", szModuleName);
@@ -296,7 +296,7 @@ void MirfoxData::refreshAccount_Add(SharedMemoryUtils& sharedMemoryUtils, char*
return;
}
-void MirfoxData::refreshAccount_Edit(SharedMemoryUtils& sharedMemoryUtils, char* szModuleName, TCHAR* tszAccountName)
+void MirfoxData::refreshAccount_Edit(SharedMemoryUtils& sharedMemoryUtils, char* szModuleName, wchar_t* tszAccountName)
{
MFLogger* logger = MFLogger::getInstance();
logger->log_p(L"MirfoxData::refreshAccount_Edit proto [%S]", szModuleName);
@@ -779,7 +779,7 @@ void MirfoxData::releaseMirfoxData()
* class functions implementation
*/
-MirandaAccount::MirandaAccount(uint64_t idL, char* szModuleNameL, TCHAR* tszAccountNameL, char* szProtoNameL, int displayOrderL)
+MirandaAccount::MirandaAccount(uint64_t idL, char* szModuleNameL, wchar_t* tszAccountNameL, char* szProtoNameL, int displayOrderL)
{
accountState = MFENUM_MIRANDAACCOUNT_STATE_UNKNOWN;
id = idL;
diff --git a/plugins/MirFox/src/MirfoxData.h b/plugins/MirFox/src/MirfoxData.h
index 4806745396..b06f614241 100644
--- a/plugins/MirFox/src/MirfoxData.h
+++ b/plugins/MirFox/src/MirfoxData.h
@@ -118,8 +118,8 @@ public:
MirandaAccount* getMirandaAccountPtrBySzModuleName(char* szModuleName);
//refresh data support
- void refreshAccount_Add(SharedMemoryUtils& sharedMemoryUtils, char* szModuleName, TCHAR* tszAccountName, char* szProtoName);
- void refreshAccount_Edit(SharedMemoryUtils& sharedMemoryUtils, char* szModuleName, TCHAR* tszAccountName);
+ void refreshAccount_Add(SharedMemoryUtils& sharedMemoryUtils, char* szModuleName, wchar_t* tszAccountName, char* szProtoName);
+ void refreshAccount_Edit(SharedMemoryUtils& sharedMemoryUtils, char* szModuleName, wchar_t* tszAccountName);
void refreshAccount_Delete(SharedMemoryUtils& sharedMemoryUtils, char* szModuleName);
void refreshContact_Add(SharedMemoryUtils& sharedMemoryUtils, MCONTACT hContact);
void refreshContact_Edit(SharedMemoryUtils& sharedMemoryUtils, MCONTACT hContact);
@@ -247,13 +247,13 @@ class MirandaAccount
{
public:
- MirandaAccount(uint64_t idL, char* szModuleNameL, TCHAR* tszAccountNameL, char* szProtoNameL, int displayOrderL);
+ MirandaAccount(uint64_t idL, char* szModuleNameL, wchar_t* tszAccountNameL, char* szProtoNameL, int displayOrderL);
~MirandaAccount(void);
MirandaAccount* getObjectPtr();
uint64_t id; //selfgenerated id, used in sm
char* szModuleName; //unique string id of account
- TCHAR* tszAccountName; //account name
+ wchar_t* tszAccountName; //account name
char* szProtoName; //physical protocol name
int displayOrder; //presentation order - not used now
MFENUM_MIRANDAACCOUNT_STATE accountState; //state in options
diff --git a/plugins/MirLua/Modules/WinAPI/src/stdafx.h b/plugins/MirLua/Modules/WinAPI/src/stdafx.h
index 1e67e7c313..4885e14c2f 100644
--- a/plugins/MirLua/Modules/WinAPI/src/stdafx.h
+++ b/plugins/MirLua/Modules/WinAPI/src/stdafx.h
@@ -52,7 +52,6 @@
#include <stddef.h>
#include <process.h>
#include <direct.h>
-#include <tchar.h>
#include <shlwapi.h>
#include <shlobj.h>
diff --git a/plugins/MirLua/Modules/WinAPI/src/winapi.cpp b/plugins/MirLua/Modules/WinAPI/src/winapi.cpp
index b6d77a2973..8bb7ec0d8b 100644
--- a/plugins/MirLua/Modules/WinAPI/src/winapi.cpp
+++ b/plugins/MirLua/Modules/WinAPI/src/winapi.cpp
@@ -38,7 +38,7 @@ static int lua_ShellExecute(lua_State *L)
static int lua_FindIterator(lua_State *L)
{
HANDLE hFind = lua_touserdata(L, lua_upvalueindex(1));
- TCHAR* path = (TCHAR*)lua_touserdata(L, lua_upvalueindex(2));
+ wchar_t* path = (wchar_t*)lua_touserdata(L, lua_upvalueindex(2));
WIN32_FIND_DATA ffd = { 0 };
if (hFind == NULL)
@@ -98,7 +98,7 @@ static int lua_FindIterator(lua_State *L)
static int lua_Find(lua_State *L)
{
- TCHAR *path = mir_utf8decodeT(luaL_checkstring(L, 1));
+ wchar_t *path = mir_utf8decodeT(luaL_checkstring(L, 1));
lua_pushlightuserdata(L, NULL);
lua_pushlightuserdata(L, path);
@@ -137,7 +137,7 @@ static int lua_GetIniValue(lua_State *L)
ptrT default(mir_utf8decodeT(lua_tostring(L, 4)));
- TCHAR value[MAX_PATH] = { 0 };
+ wchar_t value[MAX_PATH] = { 0 };
if (!::GetPrivateProfileString(section, key, default, value, _countof(value), path))
{
lua_pushvalue(L, 4);
@@ -218,7 +218,7 @@ static int lua_GetRegValue(lua_State *L)
case REG_LINK:
case REG_EXPAND_SZ:
{
- ptrA str(Utf8EncodeT((TCHAR*)value));
+ ptrA str(Utf8EncodeT((wchar_t*)value));
lua_pushlstring(L, str, mir_strlen(str));
}
break;
@@ -274,7 +274,7 @@ static int lua_SetRegValue(lua_State *L)
case LUA_TSTRING:
type = REG_SZ;
- length = mir_strlen(lua_tostring(L, 4)) * sizeof(TCHAR);
+ length = mir_strlen(lua_tostring(L, 4)) * sizeof(wchar_t);
value = (BYTE*)mir_utf8decodeT(lua_tostring(L, 4));
break;
@@ -1708,7 +1708,7 @@ static int global_GetOpenFileName(lua_State *L)
{
_A2T tszExt(lua_tostring(L, 1));
- TCHAR buff[MAX_PATH] = L"";
+ wchar_t buff[MAX_PATH] = L"";
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
diff --git a/plugins/MirLua/Modules/m_variables/src/main.cpp b/plugins/MirLua/Modules/m_variables/src/main.cpp
index 8eac605407..308325e202 100644
--- a/plugins/MirLua/Modules/m_variables/src/main.cpp
+++ b/plugins/MirLua/Modules/m_variables/src/main.cpp
@@ -11,7 +11,7 @@ static int lua_Parse(lua_State *L)
ptrT format(mir_utf8decodeT(luaL_checkstring(L, 1)));
MCONTACT hContact = lua_tointeger(L, 2);
- TCHAR *res = variables_parse_ex(format, NULL, hContact, NULL, 0);
+ wchar_t *res = variables_parse_ex(format, NULL, hContact, NULL, 0);
lua_pushstring(L, T2Utf(res));
return 1;
diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp
index 4c2b6e7a38..27d4cc7714 100644
--- a/plugins/MirLua/src/m_core.cpp
+++ b/plugins/MirLua/src/m_core.cpp
@@ -296,7 +296,7 @@ static int core_Parse(lua_State *L)
static int core_GetFullPath(lua_State *L)
{
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
GetModuleFileName(NULL, path, MAX_PATH);
lua_pushstring(L, ptrA(mir_utf8encodeT(path)));
diff --git a/plugins/MirLua/src/m_genmenu.cpp b/plugins/MirLua/src/m_genmenu.cpp
index 64540804a0..78ed5343d6 100644
--- a/plugins/MirLua/src/m_genmenu.cpp
+++ b/plugins/MirLua/src/m_genmenu.cpp
@@ -18,7 +18,7 @@ void MakeMenuItem(lua_State *L, CMenuItem &mi)
lua_pop(L, 1);
lua_getfield(L, -1, "Name");
- mi.name.t = mir_utf8decodeT(luaL_checkstring(L, -1));
+ mi.name.w = mir_utf8decodeT(luaL_checkstring(L, -1));
lua_pop(L, 1);
lua_getfield(L, -1, "Position");
diff --git a/plugins/MirLua/src/m_icolib.cpp b/plugins/MirLua/src/m_icolib.cpp
index 019d1ccf25..8827cc749c 100644
--- a/plugins/MirLua/src/m_icolib.cpp
+++ b/plugins/MirLua/src/m_icolib.cpp
@@ -9,16 +9,16 @@ static int icolib_AddIcon(lua_State *L)
if (filePath == NULL)
{
- filePath = (TCHAR*)mir_calloc(MAX_PATH + 1);
+ filePath = (wchar_t*)mir_calloc(MAX_PATH + 1);
GetModuleFileName(g_hInstance, filePath, MAX_PATH);
}
SKINICONDESC si = { 0 };
si.flags = SIDF_ALL_TCHAR;
si.pszName = mir_utf8decodeA(name);
- si.description.t = description;
- si.section.t = section;
- si.defaultFile.t = filePath;
+ si.description.w = description;
+ si.section.w = section;
+ si.defaultFile.w = filePath;
si.hDefaultIcon = GetIcon(IDI_SCRIPT);
int hScriptLangpack = CMLuaScript::GetScriptIdFromEnviroment(L);
diff --git a/plugins/MirLua/src/m_options.cpp b/plugins/MirLua/src/m_options.cpp
index 149403ee44..d67106d247 100644
--- a/plugins/MirLua/src/m_options.cpp
+++ b/plugins/MirLua/src/m_options.cpp
@@ -54,15 +54,15 @@ void MakeOptionDialogPage(lua_State *L, OPTIONSDIALOGPAGE &odp)
odp.flags |= ODPF_TCHAR;
lua_getfield(L, -1, "Group");
- odp.ptszGroup = mir_utf8decodeT(lua_tostring(L, -1));
+ odp.pwszGroup = mir_utf8decodeT(lua_tostring(L, -1));
lua_pop(L, 1);
lua_getfield(L, -1, "Title");
- odp.ptszTitle = mir_utf8decodeT(luaL_checkstring(L, -1));
+ odp.pwszTitle = mir_utf8decodeT(luaL_checkstring(L, -1));
lua_pop(L, 1);
lua_getfield(L, -1, "Tab");
- odp.ptszTab = mir_utf8decodeT(lua_tostring(L, -1));
+ odp.pwszTab = mir_utf8decodeT(lua_tostring(L, -1));
lua_pop(L, 1);
int onInitDialogRef = LUA_NOREF;
@@ -95,9 +95,9 @@ int opt_AddPage(lua_State *L)
INT_PTR res = Options_AddPage(wParam, &odp);
lua_pushboolean(L, !res);
- mir_free(odp.ptszGroup);
- mir_free(odp.ptszTitle);
- mir_free(odp.ptszTab);
+ mir_free(odp.pwszGroup);
+ mir_free(odp.pwszTitle);
+ mir_free(odp.pwszTab);
return 1;
}
diff --git a/plugins/MirLua/src/main.cpp b/plugins/MirLua/src/main.cpp
index 49b50190fd..ce2d3aa589 100644
--- a/plugins/MirLua/src/main.cpp
+++ b/plugins/MirLua/src/main.cpp
@@ -62,8 +62,8 @@ extern "C" int __declspec(dllexport) Load(void)
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_NOOPTIONS | NUF_UNICODE;
- nlu.ptszDescriptiveName = _T(MODULE);
+ nlu.flags = NUF_NOOPTIONS;
+ nlu.szDescriptiveName = MODULE;
nlu.szSettingsModule = MODULE;
hNetlib = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
diff --git a/plugins/MirLua/src/mlua.cpp b/plugins/MirLua/src/mlua.cpp
index 2c67f32f3e..5386f364d1 100644
--- a/plugins/MirLua/src/mlua.cpp
+++ b/plugins/MirLua/src/mlua.cpp
@@ -23,7 +23,7 @@ CMLua::~CMLua()
void CMLua::SetPaths()
{
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
lua_getglobal(L, "package");
diff --git a/plugins/MirLua/src/mlua_icons.cpp b/plugins/MirLua/src/mlua_icons.cpp
index 175e5c62e8..92bcd1dcd5 100644
--- a/plugins/MirLua/src/mlua_icons.cpp
+++ b/plugins/MirLua/src/mlua_icons.cpp
@@ -1,17 +1,17 @@
#include "stdafx.h"
-IconItemT Icons[] =
+IconItem Icons[] =
{
- { LPGENT("Script"), "script", IDI_SCRIPT },
- { LPGENT("Loaded"), "loaded", IDI_LOADED },
- { LPGENT("Failed"), "failed", IDI_FAILED },
- { LPGENT("Open"), "open", IDI_OPEN },
- { LPGENT("Reload"), "reload", IDI_RELOAD },
+ { LPGEN("Script"), "script", IDI_SCRIPT },
+ { LPGEN("Loaded"), "loaded", IDI_LOADED },
+ { LPGEN("Failed"), "failed", IDI_FAILED },
+ { LPGEN("Open"), "open", IDI_OPEN },
+ { LPGEN("Reload"), "reload", IDI_RELOAD },
};
void InitIcons()
{
- Icon_RegisterT(g_hInstance, LPGENT(MODULE), Icons, _countof(Icons), MODULE);
+ Icon_Register(g_hInstance, MODULE, Icons, _countof(Icons), MODULE);
}
HICON GetIcon(int iconId)
diff --git a/plugins/MirLua/src/mlua_options.cpp b/plugins/MirLua/src/mlua_options.cpp
index 6714d7ebed..cc902165d6 100644
--- a/plugins/MirLua/src/mlua_options.cpp
+++ b/plugins/MirLua/src/mlua_options.cpp
@@ -37,7 +37,7 @@ void CMLuaOptions::LoadScripts()
for (int i = 0; i < g_mLua->Scripts.getCount(); i++)
{
CMLuaScript *script = g_mLua->Scripts[i];
- TCHAR *fileName = NEWTSTR_ALLOCA(script->GetFileName());
+ wchar_t *fileName = NEWWSTR_ALLOCA(script->GetFileName());
int iIcon = script->GetStatus() - 1;
int iItem = m_scripts.AddItem(fileName, iIcon, (LPARAM)script);
if (db_get_b(NULL, MODULE, _T2A(fileName), 1))
@@ -59,7 +59,7 @@ void CMLuaOptions::OnInitDialog()
ImageList_AddIcon(hImageList, GetIcon(IDI_OPEN));
ImageList_AddIcon(hImageList, GetIcon(IDI_RELOAD));
- TCHAR scriptDir[MAX_PATH], relativeScriptDir[MAX_PATH], header[MAX_PATH + 100];
+ wchar_t scriptDir[MAX_PATH], relativeScriptDir[MAX_PATH], header[MAX_PATH + 100];
FoldersGetCustomPathT(g_hScriptsFolder, scriptDir, _countof(scriptDir), VARST(MIRLUA_PATHT));
PathToRelativeT(scriptDir, relativeScriptDir, NULL);
mir_sntprintf(header, L"%s (%s)", TranslateT("Common scripts"), relativeScriptDir);
@@ -78,7 +78,7 @@ void CMLuaOptions::OnApply()
int count = m_scripts.GetItemCount();
for (int iItem = 0; iItem < count; iItem++)
{
- TCHAR fileName[MAX_PATH];
+ wchar_t fileName[MAX_PATH];
m_scripts.GetItemText(iItem, 0, fileName, _countof(fileName));
if (!m_scripts.GetCheckState(iItem))
db_set_b(NULL, MODULE, _T2A(fileName), 0);
@@ -115,7 +115,7 @@ void CMLuaOptions::OnScriptListClick(CCtrlListView::TEventInfo *evt)
LVITEM lvi = { 0 };
lvi.iItem = evt->nmlvia->iItem;
if (lvi.iItem == -1) return;
- lvi.pszText = (LPTSTR)mir_calloc(MAX_PATH * sizeof(TCHAR));
+ lvi.pszText = (LPTSTR)mir_calloc(MAX_PATH * sizeof(wchar_t));
lvi.cchTextMax = MAX_PATH;
lvi.mask = LVIF_GROUPID | LVIF_TEXT | LVIF_PARAM;
evt->treeviewctrl->GetItem(&lvi);
@@ -161,9 +161,9 @@ int CMLuaOptions::OnOptionsInit(WPARAM wParam, LPARAM)
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = g_hInstance;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.ptszGroup = LPGENT("Services");
- odp.ptszTitle = L"Lua";
- odp.ptszTab = LPGENT("Scripts");
+ odp.pwszGroup = LPGENW("Services");
+ odp.pwszTitle = L"Lua";
+ odp.pwszTab = LPGENW("Scripts");
odp.pDialog = CMLuaOptions::CreateOptionsPage();
Options_AddPage(wParam, &odp);
diff --git a/plugins/MirLua/src/mlua_script.cpp b/plugins/MirLua/src/mlua_script.cpp
index d36f93b7a8..b84c3d978e 100644
--- a/plugins/MirLua/src/mlua_script.cpp
+++ b/plugins/MirLua/src/mlua_script.cpp
@@ -2,17 +2,17 @@
#define SCRIPT "Script"
-CMLuaScript::CMLuaScript(lua_State *L, const TCHAR *path)
+CMLuaScript::CMLuaScript(lua_State *L, const wchar_t *path)
: L(L), status(None), unloadRef(LUA_NOREF)
{
mir_tstrcpy(filePath, path);
- fileName = _tcsrchr(filePath, '\\') + 1;
- TCHAR *dot = _tcsrchr(fileName, '.');
+ fileName = wcsrchr(filePath, '\\') + 1;
+ wchar_t *dot = wcsrchr(fileName, '.');
size_t length = mir_tstrlen(fileName) - mir_tstrlen(dot) + 1;
- ptrT name((TCHAR*)mir_calloc(sizeof(TCHAR) * (length + 1)));
+ ptrT name((wchar_t*)mir_calloc(sizeof(wchar_t) * (length + 1)));
mir_tstrncpy(name, fileName, length);
moduleName = mir_utf8encodeT(name);
@@ -76,12 +76,12 @@ const char* CMLuaScript::GetModuleName() const
return moduleName;
}
-const TCHAR* CMLuaScript::GetFilePath() const
+const wchar_t* CMLuaScript::GetFilePath() const
{
return filePath;
}
-const TCHAR* CMLuaScript::GetFileName() const
+const wchar_t* CMLuaScript::GetFileName() const
{
return fileName;
}
diff --git a/plugins/MirLua/src/mlua_script.h b/plugins/MirLua/src/mlua_script.h
index c466e16c20..042e78dadf 100644
--- a/plugins/MirLua/src/mlua_script.h
+++ b/plugins/MirLua/src/mlua_script.h
@@ -17,13 +17,13 @@ private:
int id;
int unloadRef;
char *moduleName;
- TCHAR *fileName;
- TCHAR filePath[MAX_PATH];
+ wchar_t *fileName;
+ wchar_t filePath[MAX_PATH];
Status status;
public:
- CMLuaScript(lua_State *L, const TCHAR *path);
+ CMLuaScript(lua_State *L, const wchar_t *path);
~CMLuaScript();
static CMLuaScript* GetScriptFromEnviroment(lua_State *L);
@@ -34,8 +34,8 @@ public:
const char* GetModuleName() const;
- const TCHAR* GetFilePath() const;
- const TCHAR* GetFileName() const;
+ const wchar_t* GetFilePath() const;
+ const wchar_t* GetFileName() const;
const Status GetStatus() const;
diff --git a/plugins/MirLua/src/mlua_script_loader.cpp b/plugins/MirLua/src/mlua_script_loader.cpp
index f95fdbfc78..a8efa32320 100644
--- a/plugins/MirLua/src/mlua_script_loader.cpp
+++ b/plugins/MirLua/src/mlua_script_loader.cpp
@@ -4,9 +4,9 @@ CMLuaScriptLoader::CMLuaScriptLoader(lua_State *L) : L(L)
{
}
-void CMLuaScriptLoader::LoadScript(const TCHAR *scriptDir, const TCHAR *file)
+void CMLuaScriptLoader::LoadScript(const wchar_t *scriptDir, const wchar_t *file)
{
- TCHAR fullPath[MAX_PATH], path[MAX_PATH];
+ wchar_t fullPath[MAX_PATH], path[MAX_PATH];
mir_sntprintf(fullPath, L"%s\\%s", scriptDir, file);
PathToRelativeT(fullPath, path);
@@ -25,12 +25,12 @@ void CMLuaScriptLoader::LoadScript(const TCHAR *scriptDir, const TCHAR *file)
void CMLuaScriptLoader::LoadScripts()
{
- TCHAR scriptDir[MAX_PATH];
+ wchar_t scriptDir[MAX_PATH];
FoldersGetCustomPathT(g_hScriptsFolder, scriptDir, _countof(scriptDir), VARST(MIRLUA_PATHT));
Log(L"Loading scripts from %s", scriptDir);
- TCHAR searchMask[MAX_PATH];
+ wchar_t searchMask[MAX_PATH];
mir_sntprintf(searchMask, L"%s\\%s", scriptDir, L"*.lua");
WIN32_FIND_DATA fd;
diff --git a/plugins/MirLua/src/mlua_script_loader.h b/plugins/MirLua/src/mlua_script_loader.h
index 949f870fac..e455793adf 100644
--- a/plugins/MirLua/src/mlua_script_loader.h
+++ b/plugins/MirLua/src/mlua_script_loader.h
@@ -8,7 +8,7 @@ private:
CMLuaScriptLoader(lua_State *L);
- void LoadScript(const TCHAR *scriptDir, const TCHAR *file);
+ void LoadScript(const wchar_t *scriptDir, const wchar_t *file);
void LoadScripts();
public:
diff --git a/plugins/MirOTR/src/dialogs.cpp b/plugins/MirOTR/src/dialogs.cpp
index 0451367f84..cc3ab94d61 100644
--- a/plugins/MirOTR/src/dialogs.cpp
+++ b/plugins/MirOTR/src/dialogs.cpp
@@ -6,7 +6,7 @@ struct SmpData
TrustLevel oldlevel;
ConnContext *context;
bool responder;
- TCHAR *question;
+ wchar_t *question;
};
typedef std::map<HANDLE, SmpData> SmpForContactMap;
SmpForContactMap smp_for_contact;
@@ -40,11 +40,11 @@ static INT_PTR CALLBACK DlgSMPUpdateProc(HWND hwndDlg, UINT msg, WPARAM wParam,
smp_for_contact[context->app_data].responder = data->responder;
mir_free(data);
- TCHAR title[512], *proto = mir_a2t(GetContactProto(hContact));
- const TCHAR *name = contact_get_nameT(hContact);
- mir_sntprintf(title, TranslateT(LANG_SMP_PROGRESS_TITLE), name, proto);
+ wchar_t title[512], *proto = mir_a2t(GetContactProto(hContact));
+ const wchar_t *name = contact_get_nameT(hContact);
+ mir_sntprintf(title, TranslateW(LANG_SMP_PROGRESS_TITLE), name, proto);
SetWindowText(hwndDlg, title);
- mir_sntprintf(title, TranslateT(LANG_SMP_PROGRESS_DESC), name, proto);
+ mir_sntprintf(title, TranslateW(LANG_SMP_PROGRESS_DESC), name, proto);
mir_free(proto);
SetDlgItemText(hwndDlg, IDC_STC_SMP_HEADPRO, title);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)context);
@@ -97,7 +97,7 @@ static INT_PTR CALLBACK DlgSMPUpdateProc(HWND hwndDlg, UINT msg, WPARAM wParam,
case 0:
EnableWindow(GetDlgItem(hwndDlg, IDCANCEL), false);
EnableWindow(GetDlgItem(hwndDlg, IDOK), true);
- SetDlgItemText(hwndDlg, IDC_STC_SMP_PROGRESS, TranslateT(LANG_SMP_ERROR));
+ SetDlgItemText(hwndDlg, IDC_STC_SMP_PROGRESS, TranslateW(LANG_SMP_ERROR));
smp_for_contact.erase(context->app_data);
break;
case 100:
@@ -107,14 +107,14 @@ static INT_PTR CALLBACK DlgSMPUpdateProc(HWND hwndDlg, UINT msg, WPARAM wParam,
smp_for_contact.erase(context->app_data);
if (context->smstate->sm_prog_state == OTRL_SMP_PROG_SUCCEEDED) {
if (context->active_fingerprint->trust && context->active_fingerprint->trust[0]) {
- SetDlgItemText(hwndDlg, IDC_STC_SMP_PROGRESS, TranslateT(LANG_SMP_SUCCESS));
+ SetDlgItemText(hwndDlg, IDC_STC_SMP_PROGRESS, TranslateW(LANG_SMP_SUCCESS));
}
else {
- SetDlgItemText(hwndDlg, IDC_STC_SMP_PROGRESS, TranslateT(LANG_SMP_SUCCESS_VERIFY));
+ SetDlgItemText(hwndDlg, IDC_STC_SMP_PROGRESS, TranslateW(LANG_SMP_SUCCESS_VERIFY));
}
}
else {
- SetDlgItemText(hwndDlg, IDC_STC_SMP_PROGRESS, TranslateT(LANG_SMP_FAILED));
+ SetDlgItemText(hwndDlg, IDC_STC_SMP_PROGRESS, TranslateW(LANG_SMP_FAILED));
}
}
break;
@@ -183,25 +183,25 @@ static INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam
smp_for_contact[context->app_data].oldlevel = data->oldlevel;
smp_for_contact[context->app_data].responder = data->responder;
- TCHAR buff[512], *proto = mir_a2t(GetContactProto(hContact));
- mir_sntprintf(buff, TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto);
+ wchar_t buff[512], *proto = mir_a2t(GetContactProto(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto);
mir_free(proto);
SetWindowText(hwndDlg, buff);
SetDlgItemText(hwndDlg, IDC_STC_SMP_HEAD, buff);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)context);
if (data->question) {
- mir_sntprintf(buff, TranslateT(LANG_OTR_SMPQUESTION_RESPOND_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_OTR_SMPQUESTION_RESPOND_DESC), contact_get_nameT(hContact));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD1, data->question);
SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD1, EM_SETREADONLY, TRUE, 0);
- SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD1, TranslateT(LANG_SMP_QUESTION));
+ SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD1, TranslateW(LANG_SMP_QUESTION));
SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD2, L"");
SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, EM_SETREADONLY, FALSE, 0);
- SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateT(LANG_SMP_ANSWER));
+ SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateW(LANG_SMP_ANSWER));
ShowWindow(GetDlgItem(hwndDlg, IDOK), SW_SHOWNA);
@@ -211,7 +211,7 @@ static INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam
mir_free(data->question);
}
else {
- mir_sntprintf(buff, TranslateT(LANG_OTR_SMPPASSWORD_RESPOND_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_OTR_SMPPASSWORD_RESPOND_DESC), contact_get_nameT(hContact));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -221,7 +221,7 @@ static INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam
SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD2, L"");
SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, EM_SETREADONLY, FALSE, 0);
- SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateT(LANG_SMP_PASSWORD));
+ SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateW(LANG_SMP_PASSWORD));
ShowWindow(GetDlgItem(hwndDlg, IDOK), SW_SHOWNA);
@@ -272,7 +272,7 @@ static INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam
SMPInitUpdateDialog(context, true);
{
int len = SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, WM_GETTEXTLENGTH, 0, 0);
- TCHAR *answer = new TCHAR[len + 1];
+ wchar_t *answer = new wchar_t[len + 1];
GetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD2, answer, len + 1);
T2Utf ans(answer);
@@ -297,7 +297,7 @@ static INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam
}
/*
-void SMPInitResponseDialog(ConnContext *context, const TCHAR *question) {
+void SMPInitResponseDialog(ConnContext *context, const wchar_t *question) {
if (!context) return;
SmpData *data = (SmpData*)mir_calloc(sizeof(SmpData));
data->context = context;
@@ -326,8 +326,8 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam
}
MCONTACT hContact = (UINT_PTR)context->app_data;
- TCHAR title[512], *proto = mir_a2t(GetContactProto(hContact));
- mir_sntprintf(title, TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto);
+ wchar_t title[512], *proto = mir_a2t(GetContactProto(hContact));
+ mir_sntprintf(title, TranslateW(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto);
mir_free(proto);
SetWindowText(hwndDlg, title);
SetDlgItemText(hwndDlg, IDC_STC_SMP_HEAD, title);
@@ -366,10 +366,10 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam
HWND cmb = GetDlgItem(hwndDlg, IDC_CBO_SMP_CHOOSE);
- SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_SMPTYPE_QUESTION));
- SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_SMPTYPE_PASSWORD));
- SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_SMPTYPE_FINGERPRINT));
- SendMessage(cmb, CB_SELECTSTRING, -1, (WPARAM)TranslateT(LANG_SMPTYPE_QUESTION));
+ SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_SMPTYPE_QUESTION));
+ SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_SMPTYPE_PASSWORD));
+ SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_SMPTYPE_FINGERPRINT));
+ SendMessage(cmb, CB_SELECTSTRING, -1, (WPARAM)TranslateW(LANG_SMPTYPE_QUESTION));
EnableWindow(GetDlgItem(hwndDlg, IDC_CBO_SMP_CHOOSE), TRUE);
@@ -378,21 +378,21 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam
DestroyWindow(hwndDlg);
return FALSE;
}
- TCHAR buff[1024];
+ wchar_t buff[1024];
if (!fp->trust || fp->trust[0] == '\0')
- mir_sntprintf(buff, TranslateT(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT(hContact));
else
- mir_sntprintf(buff, TranslateT(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT(hContact));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD1, L"");
SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD1, EM_SETREADONLY, FALSE, 0);
- SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD1, TranslateT(LANG_SMP_QUESTION));
+ SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD1, TranslateW(LANG_SMP_QUESTION));
SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD2, L"");
SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, EM_SETREADONLY, FALSE, 0);
- SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateT(LANG_SMP_ANSWER));
+ SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateW(LANG_SMP_ANSWER));
ShowWindow(GetDlgItem(hwndDlg, IDOK), SW_SHOWNA);
@@ -409,27 +409,27 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam
{
ConnContext *context = (ConnContext*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
MCONTACT hContact = (UINT_PTR)context->app_data;
- TCHAR szMsg[1024];
+ wchar_t szMsg[1024];
switch (LOWORD(wParam)) {
case IDCANCEL:
DestroyWindow(hwndDlg);
break;
case IDOK:
GetDlgItemText(hwndDlg, IDC_CBO_SMP_CHOOSE, szMsg, _countof(szMsg));
- if (_tcsncmp(szMsg, TranslateT(LANG_SMPTYPE_QUESTION), _countof(szMsg)) == 0) {
+ if (wcsncmp(szMsg, TranslateW(LANG_SMPTYPE_QUESTION), _countof(szMsg)) == 0) {
if (smp_for_contact.find(context->app_data) != smp_for_contact.end()) {
- mir_sntprintf(szMsg, TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact));
+ mir_sntprintf(szMsg, TranslateW(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact));
ShowError(szMsg);
}
else {
int len = SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD1, WM_GETTEXTLENGTH, 0, 0);
- TCHAR *question = new TCHAR[len + 1];
+ wchar_t *question = new wchar_t[len + 1];
GetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD1, question, len + 1);
T2Utf quest(question);
delete[] question;
len = SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, WM_GETTEXTLENGTH, 0, 0);
- TCHAR *answer = new TCHAR[len + 1];
+ wchar_t *answer = new wchar_t[len + 1];
GetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD2, answer, len + 1);
T2Utf ans(answer);
delete[] answer;
@@ -439,14 +439,14 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam
}
}
- else if (_tcsncmp(szMsg, TranslateT(LANG_SMPTYPE_PASSWORD), _countof(szMsg)) == 0) {
+ else if (wcsncmp(szMsg, TranslateW(LANG_SMPTYPE_PASSWORD), _countof(szMsg)) == 0) {
if (smp_for_contact.find(context->app_data) != smp_for_contact.end()) {
- mir_sntprintf(szMsg, TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact));
+ mir_sntprintf(szMsg, TranslateW(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact));
ShowError(szMsg);
}
else {
int len = SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, WM_GETTEXTLENGTH, 0, 0);
- TCHAR *answer = new TCHAR[len + 1];
+ wchar_t *answer = new wchar_t[len + 1];
GetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD2, answer, len + 1);
T2Utf ans(answer);
delete[] answer;
@@ -485,34 +485,34 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam
BOOL trusted = false;
if (fp->trust && fp->trust[0] != '\0') trusted = true;
- TCHAR buff[512];
+ wchar_t buff[512];
GetDlgItemText(hwndDlg, IDC_CBO_SMP_CHOOSE, buff, 255);
- if (_tcsncmp(buff, TranslateT(LANG_SMPTYPE_QUESTION), 255) == 0) {
+ if (wcsncmp(buff, TranslateW(LANG_SMPTYPE_QUESTION), 255) == 0) {
if (trusted)
- mir_sntprintf(buff, TranslateT(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT(hContact));
else
- mir_sntprintf(buff, TranslateT(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT(hContact));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD1, L"");
SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD1, EM_SETREADONLY, FALSE, 0);
- SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD1, TranslateT(LANG_SMP_QUESTION));
+ SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD1, TranslateW(LANG_SMP_QUESTION));
SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD2, L"");
SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, EM_SETREADONLY, FALSE, 0);
- SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateT(LANG_SMP_ANSWER));
+ SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateW(LANG_SMP_ANSWER));
ShowWindow(GetDlgItem(hwndDlg, IDOK), SW_SHOWNA);
ShowWindow(GetDlgItem(hwndDlg, IDYES), SW_HIDE);
ShowWindow(GetDlgItem(hwndDlg, IDNO), SW_HIDE);
}
- else if (_tcsncmp(buff, TranslateT(LANG_SMPTYPE_PASSWORD), 255) == 0) {
+ else if (wcsncmp(buff, TranslateW(LANG_SMPTYPE_PASSWORD), 255) == 0) {
if (trusted)
- mir_sntprintf(buff, TranslateT(LANG_OTR_SMPPASSWORD_VERIFIED_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_OTR_SMPPASSWORD_VERIFIED_DESC), contact_get_nameT(hContact));
else
- mir_sntprintf(buff, TranslateT(LANG_OTR_SMPPASSWORD_VERIFY_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_OTR_SMPPASSWORD_VERIFY_DESC), contact_get_nameT(hContact));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -522,18 +522,18 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam
SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD2, L"");
SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, EM_SETREADONLY, FALSE, 0);
- SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateT(LANG_SMP_PASSWORD));
+ SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateW(LANG_SMP_PASSWORD));
ShowWindow(GetDlgItem(hwndDlg, IDOK), SW_SHOWNA);
ShowWindow(GetDlgItem(hwndDlg, IDYES), SW_HIDE);
ShowWindow(GetDlgItem(hwndDlg, IDNO), SW_HIDE);
}
- else if (_tcsncmp(buff, TranslateT(LANG_SMPTYPE_FINGERPRINT), 255) == 0) {
+ else if (wcsncmp(buff, TranslateW(LANG_SMPTYPE_FINGERPRINT), 255) == 0) {
if (trusted)
- mir_sntprintf(buff, TranslateT(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT(hContact));
else
- mir_sntprintf(buff, TranslateT(LANG_OTR_FPVERIFY_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_OTR_FPVERIFY_DESC), contact_get_nameT(hContact));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -546,12 +546,12 @@ static INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam
otrl_privkey_hash_to_humanT(buff, hash);
SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD1, buff);
SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD1, EM_SETREADONLY, TRUE, 0);
- SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD1, TranslateT(LANG_YOUR_PRIVKEY));
+ SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD1, TranslateW(LANG_YOUR_PRIVKEY));
otrl_privkey_hash_to_humanT(buff, fp->fingerprint);
SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD2, buff);
SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, EM_SETREADONLY, TRUE, 0);
- SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateT(LANG_CONTACT_FINGERPRINT));
+ SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateW(LANG_CONTACT_FINGERPRINT));
ShowWindow(GetDlgItem(hwndDlg, IDOK), SW_HIDE);
ShowWindow(GetDlgItem(hwndDlg, IDYES), SW_SHOWNA);
@@ -626,8 +626,8 @@ static INT_PTR CALLBACK DlgBoxProcVerifyContext(HWND hwndDlg, UINT msg, WPARAM w
EndDialog(hwndDlg, IDCANCEL);
return FALSE;
}
- SetWindowText(hwndDlg, _T(LANG_OTR_FPVERIFY_TITLE));
- SetDlgItemText(hwndDlg, IDC_STC_SMP_HEAD, _T(LANG_OTR_FPVERIFY_TITLE));
+ SetWindowText(hwndDlg, LANG_OTR_FPVERIFY_TITLE);
+ SetDlgItemText(hwndDlg, IDC_STC_SMP_HEAD, LANG_OTR_FPVERIFY_TITLE);
TranslateDialogDefault(hwndDlg);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
@@ -669,11 +669,11 @@ static INT_PTR CALLBACK DlgBoxProcVerifyContext(HWND hwndDlg, UINT msg, WPARAM w
EndDialog(hwndDlg, IDCANCEL);
return FALSE;
}
- TCHAR buff[512];
+ wchar_t buff[512];
if (!fp->trust || fp->trust[0] == '\0')
- mir_sntprintf(buff, TranslateT(LANG_OTR_FPVERIFY_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_OTR_FPVERIFY_DESC), contact_get_nameT(hContact));
else
- mir_sntprintf(buff, TranslateT(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT(hContact));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -686,12 +686,12 @@ static INT_PTR CALLBACK DlgBoxProcVerifyContext(HWND hwndDlg, UINT msg, WPARAM w
otrl_privkey_hash_to_humanT(buff, hash);
SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD1, buff);
SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD1, EM_SETREADONLY, TRUE, 0);
- SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD1, TranslateT(LANG_YOUR_PRIVKEY));
+ SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD1, TranslateW(LANG_YOUR_PRIVKEY));
otrl_privkey_hash_to_humanT(buff, fp->fingerprint);
SetDlgItemText(hwndDlg, IDC_EDT_SMP_FIELD2, buff);
SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, EM_SETREADONLY, TRUE, 0);
- SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateT(LANG_CONTACT_FINGERPRINT));
+ SetDlgItemText(hwndDlg, IDC_STC_SMP_FIELD2, TranslateW(LANG_CONTACT_FINGERPRINT));
EnableWindow(GetDlgItem(hwndDlg, IDC_CBO_SMP_CHOOSE), FALSE);
@@ -728,14 +728,14 @@ static unsigned int CALLBACK verify_context_thread(void *param)
if (param) {
ConnContext *context = (ConnContext *)param;
MCONTACT hContact = (UINT_PTR)context->app_data;
- TCHAR msg[1024];
+ wchar_t msg[1024];
switch (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SMP_INPUT), 0, DlgBoxProcVerifyContext, (LPARAM)param)) {
case IDOK:
case IDYES:
lib_cs_lock();
otrl_context_set_trust(context->active_fingerprint, "verified");
otrl_privkey_write_fingerprints(otr_user_state, _T2A(g_fingerprint_store_filename));
- mir_sntprintf(msg, TranslateT(LANG_FINGERPRINT_VERIFIED), contact_get_nameT(hContact));
+ mir_sntprintf(msg, TranslateW(LANG_FINGERPRINT_VERIFIED), contact_get_nameT(hContact));
ShowMessage(hContact, msg);
SetEncryptionStatus(hContact, otr_context_get_trust(context));
break;
@@ -744,7 +744,7 @@ static unsigned int CALLBACK verify_context_thread(void *param)
lib_cs_lock();
otrl_context_set_trust(context->active_fingerprint, NULL);
otrl_privkey_write_fingerprints(otr_user_state, _T2A(g_fingerprint_store_filename));
- mir_sntprintf(msg, TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact));
+ mir_sntprintf(msg, TranslateW(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact));
ShowMessage(hContact, msg);
SetEncryptionStatus(hContact, otr_context_get_trust(context));
break;
diff --git a/plugins/MirOTR/src/dllmain.cpp b/plugins/MirOTR/src/dllmain.cpp
index 134c5d8114..d32244bdef 100644
--- a/plugins/MirOTR/src/dllmain.cpp
+++ b/plugins/MirOTR/src/dllmain.cpp
@@ -51,7 +51,7 @@ int ModulesLoaded(WPARAM, LPARAM)
db_set_b(0, MODULENAME, "sim_warned", 1);
options.default_policy = OTRL_POLICY_MANUAL_MOD;
SaveOptions();
- MessageBox(0, TranslateT(LANG_OTR_SECUREIM_TEXT), TranslateT(LANG_OTR_SECUREIM_TITLE), 0x30);
+ MessageBox(0, TranslateW(LANG_OTR_SECUREIM_TEXT), TranslateW(LANG_OTR_SECUREIM_TITLE), 0x30);
}
return 0;
}
diff --git a/plugins/MirOTR/src/language.h b/plugins/MirOTR/src/language.h
index ab93acfa5a..b191f1ab30 100644
--- a/plugins/MirOTR/src/language.h
+++ b/plugins/MirOTR/src/language.h
@@ -5,39 +5,39 @@
#define LANG_START_OTR LPGEN("Start OTR")
#define LANG_STOP_OTR LPGEN("Stop OTR")
-#define LANG_YES LPGEN("Yes")
-#define LANG_NO LPGEN("No")
+#define LANG_YES LPGENW("Yes")
+#define LANG_NO LPGENW("No")
#define LANG_OTR_TOOLTIP LPGEN("OTR status (Click for more options)")
-#define LANG_STATUS_DISABLED LPGEN("OTR Encryption: Disabled")
-#define LANG_STATUS_UNVERIFIED LPGEN("OTR Encryption: UNVERIFIED")
-#define LANG_STATUS_PRIVATE LPGEN("OTR Encryption: Private")
-#define LANG_STATUS_FINISHED LPGEN("OTR Encryption: Finished")
-
-#define LANG_MENU_START LPGENT("&Start OTR session")
-#define LANG_MENU_REFRESH LPGENT("&Refresh OTR session")
-#define LANG_MENU_STOP LPGENT("Sto&p OTR session")
-#define LANG_MENU_VERIFY LPGENT("&Verify Fingerprint")
-#define LANG_MENU_TOGGLEHTML LPGENT("&Convert HTML (for Pidgin)")
-
-#define LANG_SESSION_TERMINATED_OTR LPGEN("OTR encrypted session with '%s' has been terminated")
-#define LANG_SESSION_REQUEST_OTR LPGEN("Requesting OTR encrypted session with '%s'")
-#define LANG_SESSION_START_OTR LPGEN("Beginning OTR encrypted session with '%s'")
-#define LANG_SESSION_START_OTR_VERIFY LPGEN("Beginning OTR encrypted session with '%s' (NOT VERIFIED)")
-#define LANG_SESSION_TRY_CONTINUE_OTR LPGEN("Trying to refresh OTR encrypted session with '%s'")
-#define LANG_SESSION_HAS_CONTINUE_OTR LPGEN("OTR encrypted session was refreshed by '%s'")
-#define LANG_SESSION_HAS_CONTINUE_OTR_VERIFY LPGEN("OTR encrypted session was refreshed by '%s' (NOT VERIFIED)")
-#define LANG_SESSION_CONTINUE_OTR LPGEN("OTR encrypted session with '%s' successfully refreshed")
-#define LANG_SESSION_CONTINUE_OTR_VERIFY LPGEN("OTR encrypted session with '%s' successfully refreshed (NOT VERIFIED)")
-#define LANG_SESSION_TERMINATED_BY_OTR LPGEN("OTR encrypted session has been terminated by '%s'. You should do that, too!")
-#define LANG_SESSION_NOT_STARTED_OTR LPGEN("OTR encrypted session with '%s' could not be started")
-
-#define LANG_ENCRYPTION_ERROR LPGEN("OTR could not encrypt when sending message")
+#define LANG_STATUS_DISABLED LPGENW("OTR Encryption: Disabled")
+#define LANG_STATUS_UNVERIFIED LPGENW("OTR Encryption: UNVERIFIED")
+#define LANG_STATUS_PRIVATE LPGENW("OTR Encryption: Private")
+#define LANG_STATUS_FINISHED LPGENW("OTR Encryption: Finished")
+
+#define LANG_MENU_START LPGENW("&Start OTR session")
+#define LANG_MENU_REFRESH LPGENW("&Refresh OTR session")
+#define LANG_MENU_STOP LPGENW("Sto&p OTR session")
+#define LANG_MENU_VERIFY LPGENW("&Verify Fingerprint")
+#define LANG_MENU_TOGGLEHTML LPGENW("&Convert HTML (for Pidgin)")
+
+#define LANG_SESSION_TERMINATED_OTR LPGENW("OTR encrypted session with '%s' has been terminated")
+#define LANG_SESSION_REQUEST_OTR LPGENW("Requesting OTR encrypted session with '%s'")
+#define LANG_SESSION_START_OTR LPGENW("Beginning OTR encrypted session with '%s'")
+#define LANG_SESSION_START_OTR_VERIFY LPGENW("Beginning OTR encrypted session with '%s' (NOT VERIFIED)")
+#define LANG_SESSION_TRY_CONTINUE_OTR LPGENW("Trying to refresh OTR encrypted session with '%s'")
+#define LANG_SESSION_HAS_CONTINUE_OTR LPGENW("OTR encrypted session was refreshed by '%s'")
+#define LANG_SESSION_HAS_CONTINUE_OTR_VERIFY LPGENW("OTR encrypted session was refreshed by '%s' (NOT VERIFIED)")
+#define LANG_SESSION_CONTINUE_OTR LPGENW("OTR encrypted session with '%s' successfully refreshed")
+#define LANG_SESSION_CONTINUE_OTR_VERIFY LPGENW("OTR encrypted session with '%s' successfully refreshed (NOT VERIFIED)")
+#define LANG_SESSION_TERMINATED_BY_OTR LPGENW("OTR encrypted session has been terminated by '%s'. You should do that, too!")
+#define LANG_SESSION_NOT_STARTED_OTR LPGENW("OTR encrypted session with '%s' could not be started")
+
+#define LANG_ENCRYPTION_ERROR LPGENW("OTR could not encrypt when sending message")
#define LANG_OTR_INFO LPGEN("OTR Information")
-#define LANG_FINGERPRINT_VERIFIED LPGEN("OTR encrypted session with '%s' is now using a VERIFIED fingerprint")
-#define LANG_FINGERPRINT_NOT_VERIFIED LPGEN("OTR encrypted session with '%s' is now using a NOT VERIFIED fingerprint")
+#define LANG_FINGERPRINT_VERIFIED LPGENW("OTR encrypted session with '%s' is now using a VERIFIED fingerprint")
+#define LANG_FINGERPRINT_NOT_VERIFIED LPGENW("OTR encrypted session with '%s' is now using a NOT VERIFIED fingerprint")
#define LANG_ICON_UNVERIFIED LPGEN("OTR unverified")
#define LANG_ICON_FINISHED LPGEN("OTR finished")
@@ -46,66 +46,66 @@
#define LANG_ICON_OTR LPGEN("OTR")
#define LANG_ICON_REFRESH LPGEN("Refresh")
-#define LANG_GENERATE_KEY LPGEN("Generating new private key for protocol '%s'.\nPlease Wait...")
-
-#define LANG_OPT_GENERAL LPGENT("General")
-#define LANG_OPT_PROTO LPGENT("Protocols")
-#define LANG_OPT_CONTACTS LPGENT("Contacts")
-#define LANG_OPT_FINGER LPGENT("Fingerprints")
-
-#define LANG_CONTACT LPGEN("Contact")
-#define LANG_PROTO LPGEN("Account")
-#define LANG_POLICY LPGEN("Policy")
-#define LANG_VERIFIED LPGEN("Verified")
-#define LANG_ACTIVE LPGEN("Active")
-#define LANG_FINGERPRINT LPGEN("Fingerprint")
-#define LANG_HTMLCONV LPGEN("Conv. HTML")
-
-#define LANG_POLICY_DEFAULT LPGEN("Default")
-#define LANG_POLICY_ALWAYS LPGEN("Always")
-#define LANG_POLICY_OPP LPGEN("Opportunistic")
-#define LANG_POLICY_MANUAL LPGEN("Manual")
-#define LANG_POLICY_NEVER LPGEN("Never")
-
-#define LANG_OTR_ASK_NEWKEY LPGEN("Generating new key for '%s'. Continue?")
-#define LANG_OTR_ASK_REMOVEKEY LPGEN("Removing key for '%s'. Continue?")
-
-#define LANG_OTR_FPVERIFY_TITLE LPGEN("OTR Fingerprint Verification")
-#define LANG_OTR_FPVERIFY_DESC LPGEN("OTR encrypted session with '%s'.\nThe OTR fingerprint used by your contact is NOT VERIFIED.\nDo you trust it?")
-#define LANG_OTR_FPVERIFIED_DESC LPGEN("OTR encrypted session with '%s'.\nThe OTR fingerprint used by your contact is already verified.\nDo you still trust it?")
-#define LANG_YOUR_PRIVKEY LPGEN("Your Fingerprint to tell your contact (use a trusted channel!)")
-#define LANG_CONTACT_FINGERPRINT LPGEN("VERIFY: Fingerprint from contact")
-
-#define LANG_SMP_VERIFY_TITLE LPGEN("OTR Authenticate: %s (%s)")
-#define LANG_SMPTYPE_QUESTION LPGEN("Challenge Question")
-#define LANG_SMPTYPE_PASSWORD LPGEN("Known Password")
-#define LANG_SMPTYPE_FINGERPRINT LPGEN("Manual fingerprint comparison")
-#define LANG_SMP_ANSWER LPGEN("Secret Answer")
-#define LANG_SMP_QUESTION LPGEN("Question")
-#define LANG_SMP_PASSWORD LPGEN("Password")
-
-#define LANG_SMP_SUCCESS LPGEN("Authentication successful.")
-#define LANG_SMP_SUCCESS_VERIFY LPGEN("Your contact authenticated you successfully. You can send your own request to authenticate him.")
-#define LANG_SMP_ERROR LPGEN("Error during authentication.")
-#define LANG_SMP_FAILED LPGEN("Authentication failed")
-#define LANG_SMP_IN_PROGRESS LPGEN("Authentication for '%s' is already in progress.")
-
-#define LANG_SMP_PROGRESS_TITLE LPGEN("OTR Authenticating: %s (%s)")
-#define LANG_SMP_PROGRESS_DESC LPGEN("Authenticating contact:\n%s (%s)")
-
-#define LANG_OTR_SMPQUESTION_VERIFY_DESC LPGEN("OTR encrypted session with '%s' (UNVERIFIED).\nUse a question only your partner can answer.")
-#define LANG_OTR_SMPQUESTION_VERIFIED_DESC LPGEN("OTR encrypted session with '%s' (VERIFIED).\nVerify the session again using a question only your partner can answer.")
-
-#define LANG_OTR_SMPPASSWORD_VERIFY_DESC LPGEN("OTR encrypted session with '%s' (UNVERIFIED).\nUse a known password.")
-#define LANG_OTR_SMPPASSWORD_VERIFIED_DESC LPGEN("OTR encrypted session with '%s' (VERIFIED).\nVerify the session again using a known password.")
-
-#define LANG_OTR_SMPQUESTION_RESPOND_DESC LPGEN("Your contact '%s' wants to verify your identity with a question only you can answer.")
-
-#define LANG_OTR_SMPPASSWORD_RESPOND_DESC LPGEN("Your contact '%s' wants to verify your identity with a secret password you should know.")
-
-#define LANG_FINGERPRINT_STILL_IN_USE LPGEN("Fingerprint '%s' still in use in conversation with '%s' (%s). You cannot delete it!")
-#define LANG_FINGERPRINT_NOT_DELETED LPGEN("Fingerprint '%s' in use in conversation with '%s' (%s). It could not be deleted!")
-
-#define LANG_OTR_SECUREIM_STARTED LPGEN("Cannot start OTR for '%s'. SecureIM is already running")
-#define LANG_OTR_SECUREIM_TITLE LPGEN("OTR: SecureIM installed")
-#define LANG_OTR_SECUREIM_TEXT LPGEN("You are using SecureIM. MirOTR will only work for contacts with SecureIM disabled")
+#define LANG_GENERATE_KEY LPGENW("Generating new private key for protocol '%s'.\nPlease Wait...")
+
+#define LANG_OPT_GENERAL LPGENW("General")
+#define LANG_OPT_PROTO LPGENW("Protocols")
+#define LANG_OPT_CONTACTS LPGENW("Contacts")
+#define LANG_OPT_FINGER LPGENW("Fingerprints")
+
+#define LANG_CONTACT LPGENW("Contact")
+#define LANG_PROTO LPGENW("Account")
+#define LANG_POLICY LPGENW("Policy")
+#define LANG_VERIFIED LPGENW("Verified")
+#define LANG_ACTIVE LPGENW("Active")
+#define LANG_FINGERPRINT LPGENW("Fingerprint")
+#define LANG_HTMLCONV LPGENW("Conv. HTML")
+
+#define LANG_POLICY_DEFAULT LPGENW("Default")
+#define LANG_POLICY_ALWAYS LPGENW("Always")
+#define LANG_POLICY_OPP LPGENW("Opportunistic")
+#define LANG_POLICY_MANUAL LPGENW("Manual")
+#define LANG_POLICY_NEVER LPGENW("Never")
+
+#define LANG_OTR_ASK_NEWKEY LPGENW("Generating new key for '%s'. Continue?")
+#define LANG_OTR_ASK_REMOVEKEY LPGENW("Removing key for '%s'. Continue?")
+
+#define LANG_OTR_FPVERIFY_TITLE LPGENW("OTR Fingerprint Verification")
+#define LANG_OTR_FPVERIFY_DESC LPGENW("OTR encrypted session with '%s'.\nThe OTR fingerprint used by your contact is NOT VERIFIED.\nDo you trust it?")
+#define LANG_OTR_FPVERIFIED_DESC LPGENW("OTR encrypted session with '%s'.\nThe OTR fingerprint used by your contact is already verified.\nDo you still trust it?")
+#define LANG_YOUR_PRIVKEY LPGENW("Your Fingerprint to tell your contact (use a trusted channel!)")
+#define LANG_CONTACT_FINGERPRINT LPGENW("VERIFY: Fingerprint from contact")
+
+#define LANG_SMP_VERIFY_TITLE LPGENW("OTR Authenticate: %s (%s)")
+#define LANG_SMPTYPE_QUESTION LPGENW("Challenge Question")
+#define LANG_SMPTYPE_PASSWORD LPGENW("Known Password")
+#define LANG_SMPTYPE_FINGERPRINT LPGENW("Manual fingerprint comparison")
+#define LANG_SMP_ANSWER LPGENW("Secret Answer")
+#define LANG_SMP_QUESTION LPGENW("Question")
+#define LANG_SMP_PASSWORD LPGENW("Password")
+
+#define LANG_SMP_SUCCESS LPGENW("Authentication successful.")
+#define LANG_SMP_SUCCESS_VERIFY LPGENW("Your contact authenticated you successfully. You can send your own request to authenticate him.")
+#define LANG_SMP_ERROR LPGENW("Error during authentication.")
+#define LANG_SMP_FAILED LPGENW("Authentication failed")
+#define LANG_SMP_IN_PROGRESS LPGENW("Authentication for '%s' is already in progress.")
+
+#define LANG_SMP_PROGRESS_TITLE LPGENW("OTR Authenticating: %s (%s)")
+#define LANG_SMP_PROGRESS_DESC LPGENW("Authenticating contact:\n%s (%s)")
+
+#define LANG_OTR_SMPQUESTION_VERIFY_DESC LPGENW("OTR encrypted session with '%s' (UNVERIFIED).\nUse a question only your partner can answer.")
+#define LANG_OTR_SMPQUESTION_VERIFIED_DESC LPGENW("OTR encrypted session with '%s' (VERIFIED).\nVerify the session again using a question only your partner can answer.")
+
+#define LANG_OTR_SMPPASSWORD_VERIFY_DESC LPGENW("OTR encrypted session with '%s' (UNVERIFIED).\nUse a known password.")
+#define LANG_OTR_SMPPASSWORD_VERIFIED_DESC LPGENW("OTR encrypted session with '%s' (VERIFIED).\nVerify the session again using a known password.")
+
+#define LANG_OTR_SMPQUESTION_RESPOND_DESC LPGENW("Your contact '%s' wants to verify your identity with a question only you can answer.")
+
+#define LANG_OTR_SMPPASSWORD_RESPOND_DESC LPGENW("Your contact '%s' wants to verify your identity with a secret password you should know.")
+
+#define LANG_FINGERPRINT_STILL_IN_USE LPGENW("Fingerprint '%s' still in use in conversation with '%s' (%s). You cannot delete it!")
+#define LANG_FINGERPRINT_NOT_DELETED LPGENW("Fingerprint '%s' in use in conversation with '%s' (%s). It could not be deleted!")
+
+#define LANG_OTR_SECUREIM_STARTED LPGENW("Cannot start OTR for '%s'. SecureIM is already running")
+#define LANG_OTR_SECUREIM_TITLE LPGENW("OTR: SecureIM installed")
+#define LANG_OTR_SECUREIM_TEXT LPGENW("You are using SecureIM. MirOTR will only work for contacts with SecureIM disabled")
diff --git a/plugins/MirOTR/src/mirotrmenu.cpp b/plugins/MirOTR/src/mirotrmenu.cpp
index e4c214f823..23e7ecf35c 100644
--- a/plugins/MirOTR/src/mirotrmenu.cpp
+++ b/plugins/MirOTR/src/mirotrmenu.cpp
@@ -64,25 +64,25 @@ INT_PTR MirOTRMenuCheckService(WPARAM wParam, LPARAM)
if (mi.flags & CMIF_NOTNOTPRIVATE && level == TRUST_NOT_PRIVATE) return FALSE;
if (pcpp->MenuItemHandle == hStatusInfoItem) {
- TCHAR text[128];
+ wchar_t text[128];
switch (level) {
case TRUST_PRIVATE:
- mir_sntprintf(text, L"%s [v%i]", TranslateT(LANG_STATUS_PRIVATE), context->protocol_version);
+ mir_sntprintf(text, L"%s [v%i]", TranslateW(LANG_STATUS_PRIVATE), context->protocol_version);
Menu_ModifyItem(hStatusInfoItem, text, IcoLib_GetIconHandle(ICON_PRIVATE));
break;
case TRUST_UNVERIFIED:
- mir_sntprintf(text, L"%s [v%i]", TranslateT(LANG_STATUS_UNVERIFIED), context->protocol_version);
+ mir_sntprintf(text, L"%s [v%i]", TranslateW(LANG_STATUS_UNVERIFIED), context->protocol_version);
Menu_ModifyItem(hStatusInfoItem, text, IcoLib_GetIconHandle(ICON_UNVERIFIED));
break;
case TRUST_FINISHED:
- Menu_ModifyItem(hStatusInfoItem, TranslateT(LANG_STATUS_FINISHED), IcoLib_GetIconHandle(ICON_UNVERIFIED));
+ Menu_ModifyItem(hStatusInfoItem, TranslateW(LANG_STATUS_FINISHED), IcoLib_GetIconHandle(ICON_UNVERIFIED));
break;
default:
- Menu_ModifyItem(hStatusInfoItem, TranslateT(LANG_STATUS_DISABLED), IcoLib_GetIconHandle(ICON_NOT_PRIVATE));
+ Menu_ModifyItem(hStatusInfoItem, TranslateW(LANG_STATUS_DISABLED), IcoLib_GetIconHandle(ICON_NOT_PRIVATE));
}
}
else if (pcpp->MenuItemHandle == hHTMLConvMenuItem)
@@ -168,36 +168,36 @@ void InitMirOTRMenu(void)
// menu items
CMenuItem mi;
mi.flags = CMIF_DISABLED | CMIF_TCHAR;
- mi.name.t = LPGENT("OTR Status");
+ mi.name.w = LPGENW("OTR Status");
mi.position = 0;
hStatusInfoItem = AddMirOTRMenuItem(&mi, NULL);
mi.flags = CMIF_TCHAR | CMIF_NOTPRIVATE | CMIF_NOTUNVERIFIED;
- mi.name.t = LANG_MENU_START;
+ mi.name.w = LANG_MENU_START;
mi.position = 100001;
mi.hIcolibItem = IcoLib_GetIconHandle(ICON_UNVERIFIED);
AddMirOTRMenuItem(&mi, MS_OTR_MENUSTART);
mi.flags = CMIF_TCHAR | CMIF_NOTNOTPRIVATE | CMIF_NOTFINISHED;
- mi.name.t = LANG_MENU_REFRESH;
+ mi.name.w = LANG_MENU_REFRESH;
mi.position = 100002;
mi.hIcolibItem = IcoLib_GetIconHandle(ICON_FINISHED);
AddMirOTRMenuItem(&mi, MS_OTR_MENUREFRESH);
mi.flags = CMIF_TCHAR | CMIF_NOTNOTPRIVATE;
- mi.name.t = LANG_MENU_STOP;
+ mi.name.w = LANG_MENU_STOP;
mi.position = 100003;
mi.hIcolibItem = IcoLib_GetIconHandle(ICON_NOT_PRIVATE);
AddMirOTRMenuItem(&mi, MS_OTR_MENUSTOP);
mi.flags = CMIF_TCHAR | CMIF_NOTNOTPRIVATE | CMIF_NOTFINISHED;
- mi.name.t = LANG_MENU_VERIFY;
+ mi.name.w = LANG_MENU_VERIFY;
mi.position = 200001;
mi.hIcolibItem = IcoLib_GetIconHandle(ICON_PRIVATE);
AddMirOTRMenuItem(&mi, MS_OTR_MENUVERIFY);
mi.flags = CMIF_TCHAR | CMIF_CHECKED;
- mi.name.t = LANG_MENU_TOGGLEHTML;
+ mi.name.w = LANG_MENU_TOGGLEHTML;
mi.position = 300001;
mi.hIcolibItem = 0;
hHTMLConvMenuItem = AddMirOTRMenuItem(&mi, MS_OTR_MENUTOGGLEHTML);
diff --git a/plugins/MirOTR/src/options.cpp b/plugins/MirOTR/src/options.cpp
index 6743a71079..246dbf71e9 100644
--- a/plugins/MirOTR/src/options.cpp
+++ b/plugins/MirOTR/src/options.cpp
@@ -3,19 +3,19 @@ extern "C"{
#include "otrlextensions.h"
}
-TCHAR g_private_key_filename[MAX_PATH];
-TCHAR g_fingerprint_store_filename[MAX_PATH];
-TCHAR g_instag_filename[MAX_PATH];
+wchar_t g_private_key_filename[MAX_PATH];
+wchar_t g_fingerprint_store_filename[MAX_PATH];
+wchar_t g_instag_filename[MAX_PATH];
HANDLE hPATH_MIROTR;
Options options;
#define DATA_DIRECTORY MIRANDA_USERDATAT L"\\" _T(MODULENAME)
struct PROTOREGENKEYOPTIONS {
HWND refresh;
- TCHAR proto[129];
+ wchar_t proto[129];
};
-void SetFilenames(const TCHAR *path)
+void SetFilenames(const wchar_t *path)
{
if (!path || !path[0])
return;
@@ -28,7 +28,7 @@ void SetFilenames(const TCHAR *path)
int FoldersChanged(WPARAM, LPARAM)
{
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
if ( FoldersGetCustomPathT(hPATH_MIROTR, path, _countof(path), L""))
SetFilenames( VARST(DATA_DIRECTORY));
else
@@ -130,7 +130,7 @@ void ReadPrivkeyFiles()
static INT_PTR CALLBACK DlgProcMirOTROpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
static bool bInit = true;
- TCHAR *prefix;
+ wchar_t *prefix;
switch ( msg ) {
case WM_INITDIALOG:
bInit = false;
@@ -214,7 +214,7 @@ static INT_PTR CALLBACK DlgProcMirOTROpts(HWND hwndDlg, UINT msg, WPARAM wParam,
options.end_offline = (TRUE==IsDlgButtonChecked(hwndDlg, IDC_CHK_ENDOFFLINE));
options.end_window_close = (TRUE==IsDlgButtonChecked(hwndDlg, IDC_CHK_ENDCLOSE));
- prefix = (TCHAR*)_alloca(sizeof(TCHAR)*OPTIONS_PREFIXLEN);
+ prefix = (wchar_t*)_alloca(sizeof(wchar_t)*OPTIONS_PREFIXLEN);
GetDlgItemText(hwndDlg, IDC_ED_PREFIX, prefix, OPTIONS_PREFIXLEN);
T2Utf prefix_utf(prefix);
@@ -236,9 +236,9 @@ static unsigned int CALLBACK regen_key_thread(void* param)
{
Thread_Push(0);
PROTOREGENKEYOPTIONS *opts = (PROTOREGENKEYOPTIONS *)param;
- TCHAR buff[512];
+ wchar_t buff[512];
- mir_sntprintf(buff, TranslateT(LANG_OTR_ASK_NEWKEY), opts->proto);
+ mir_sntprintf(buff, TranslateW(LANG_OTR_ASK_NEWKEY), opts->proto);
EnableWindow(opts->refresh, FALSE);
if (IDYES == MessageBox(opts->refresh, buff, TranslateT(LANG_OTR_INFO), MB_ICONQUESTION|MB_YESNO)) {
char* proto = mir_t2a(opts->proto);
@@ -270,11 +270,11 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP
TranslateDialogDefault(hwndDlg);
{
HWND cmb = GetDlgItem(hwndDlg, IDC_CMB_PROTO_POLICY);
- SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_DEFAULT));
- SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_ALWAYS));
- SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_OPP));
- SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_MANUAL));
- SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_NEVER));
+ SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_POLICY_DEFAULT));
+ SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_POLICY_ALWAYS));
+ SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_POLICY_OPP));
+ SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_POLICY_MANUAL));
+ SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_POLICY_NEVER));
SendDlgItemMessage(hwndDlg, IDC_CMB_PROTO_POLICY, CB_SETCURSEL, (LPARAM)-1, 0);
EnableWindow(GetDlgItem(hwndDlg, IDC_CMB_PROTO_POLICY), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_PROTO_NEWKEY), FALSE);
@@ -292,17 +292,17 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP
lvc.fmt = LVCFMT_LEFT;
lvc.iSubItem = 0;
- lvc.pszText = TranslateT(LANG_PROTO);
+ lvc.pszText = TranslateW(LANG_PROTO);
lvc.cx = 85; // width of column in pixels
ListView_InsertColumn(lv, 0, &lvc);
lvc.iSubItem = 1;
- lvc.pszText = TranslateT(LANG_POLICY);
+ lvc.pszText = TranslateW(LANG_POLICY);
lvc.cx = 80; // width of column in pixels
ListView_InsertColumn(lv, 1, &lvc);
lvc.iSubItem = 2;
- lvc.pszText = TranslateT(LANG_FINGERPRINT);
+ lvc.pszText = TranslateW(LANG_FINGERPRINT);
lvc.cx = 275; // width of column in pixels
ListView_InsertColumn(lv, 2, &lvc);
}
@@ -328,11 +328,11 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP
item.lParam = (LPARAM)pppDesc[i]->szModuleName;
int ilvItem = ListView_InsertItem(lv, &item);
- ListView_SetItemText(lv, ilvItem, 1, (TCHAR*)policy_to_string(db_get_dw(0, MODULENAME"_ProtoPol", pppDesc[i]->szModuleName, CONTACT_DEFAULT_POLICY)));
+ ListView_SetItemText(lv, ilvItem, 1, (wchar_t*)policy_to_string(db_get_dw(0, MODULENAME"_ProtoPol", pppDesc[i]->szModuleName, CONTACT_DEFAULT_POLICY)));
char fprint[45];
if (otrl_privkey_fingerprint(otr_user_state, fprint, pppDesc[i]->szModuleName, pppDesc[i]->szModuleName)) {
- TCHAR *temp = mir_a2t(fprint);
+ wchar_t *temp = mir_a2t(fprint);
ListView_SetItemText(lv, ilvItem, 2, temp);
mir_free(temp);
}
@@ -357,10 +357,10 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP
case IDC_BTN_PROTO_FORGET:
sel = ListView_GetSelectionMark(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS));
if (sel != -1) {
- TCHAR buff_proto[128];
+ wchar_t buff_proto[128];
ListView_GetItemText(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS), sel, 0, buff_proto, _countof(buff_proto));
- TCHAR buff[512];
- mir_sntprintf(buff, TranslateT(LANG_OTR_ASK_REMOVEKEY), buff_proto);
+ wchar_t buff[512];
+ mir_sntprintf(buff, TranslateW(LANG_OTR_ASK_REMOVEKEY), buff_proto);
if (IDYES == MessageBox(hwndDlg, buff, TranslateT(LANG_OTR_INFO), MB_ICONQUESTION | MB_YESNO)) {
char *proto = GetProtoName(lv, sel);
if (proto == NULL)
@@ -386,7 +386,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP
if (sel == CB_ERR) break;
int len = SendDlgItemMessage(hwndDlg, IDC_CMB_PROTO_POLICY, CB_GETLBTEXTLEN, sel, 0);
if (len < 0) break;
- TCHAR *text = new TCHAR[len + 1];
+ wchar_t *text = new wchar_t[len + 1];
SendDlgItemMessage(hwndDlg, IDC_CMB_PROTO_POLICY, CB_GETLBTEXT, sel, (LPARAM)text);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS), proto, 1, text);
delete[] text;
@@ -412,14 +412,14 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP
EnableWindow(GetDlgItem(hwndDlg, IDC_CMB_PROTO_POLICY), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_PROTO_NEWKEY), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_PROTO_FORGET), TRUE);
- TCHAR buff[50];
+ wchar_t buff[50];
ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, notif->iItem, 1, buff, _countof(buff));
SendDlgItemMessage(hwndDlg, IDC_CMB_PROTO_POLICY, CB_SELECTSTRING, (LPARAM)-1, (WPARAM)buff);
}
}
else if (((LPNMHDR)lParam)->code == PSN_APPLY) {
int cnt = ListView_GetItemCount(lv);
- TCHAR policy[64];
+ wchar_t policy[64];
for (int i = 0; i < cnt; ++i) {
char *proto = GetProtoName(lv, i);
if (proto == NULL)
@@ -447,11 +447,11 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) new ContactPolicyMap());
HWND cmb = GetDlgItem(hwndDlg, IDC_CMB_CONT_POLICY);
- SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_DEFAULT));
- SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_ALWAYS));
- SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_OPP));
- SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_MANUAL));
- SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateT(LANG_POLICY_NEVER));
+ SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_POLICY_DEFAULT));
+ SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_POLICY_ALWAYS));
+ SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_POLICY_OPP));
+ SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_POLICY_MANUAL));
+ SendMessage(cmb, CB_ADDSTRING, 0, (WPARAM)TranslateW(LANG_POLICY_NEVER));
EnableWindow(GetDlgItem(hwndDlg, IDC_CMB_CONT_POLICY), FALSE);
SendDlgItemMessage(hwndDlg, IDC_LV_CONT_CONTACTS, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);// | LVS_EX_CHECKBOXES);
@@ -465,22 +465,22 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM
lvc.fmt = LVCFMT_LEFT;
lvc.iSubItem = 0;
- lvc.pszText = TranslateT(LANG_CONTACT);
+ lvc.pszText = TranslateW(LANG_CONTACT);
lvc.cx = 150; // width of column in pixels
ListView_InsertColumn(lv, 0, &lvc);
lvc.iSubItem = 1;
- lvc.pszText = TranslateT(LANG_PROTO);
+ lvc.pszText = TranslateW(LANG_PROTO);
lvc.cx = 100; // width of column in pixels
ListView_InsertColumn(lv, 1, &lvc);
lvc.iSubItem = 2;
- lvc.pszText = TranslateT(LANG_POLICY);
+ lvc.pszText = TranslateW(LANG_POLICY);
lvc.cx = 90; // width of column in pixels
ListView_InsertColumn(lv, 2, &lvc);
lvc.iSubItem = 3;
- lvc.pszText = TranslateT(LANG_HTMLCONV);
+ lvc.pszText = TranslateW(LANG_HTMLCONV);
lvc.cx = 80; // width of column in pixels
ListView_InsertColumn(lv, 3, &lvc);
}
@@ -505,14 +505,14 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM
lvI.iItem = 0;
lvI.iSubItem = 0;
lvI.lParam = hContact;
- lvI.pszText = (TCHAR*)contact_get_nameT(hContact);
+ lvI.pszText = (wchar_t*)contact_get_nameT(hContact);
lvI.iItem = ListView_InsertItem(lv, &lvI);
PROTOACCOUNT *pa = Proto_GetAccount(proto);
ListView_SetItemText(lv, lvI.iItem, 1, pa->tszAccountName);
- ListView_SetItemText(lv, lvI.iItem, 2, (TCHAR*)policy_to_string((OtrlPolicy)db_get_dw(hContact, MODULENAME, "Policy", CONTACT_DEFAULT_POLICY)));
- ListView_SetItemText(lv, lvI.iItem, 3, (db_get_b(hContact, MODULENAME, "HTMLConv", 0)) ? TranslateT(LANG_YES) : TranslateT(LANG_NO));
+ ListView_SetItemText(lv, lvI.iItem, 2, (wchar_t*)policy_to_string((OtrlPolicy)db_get_dw(hContact, MODULENAME, "Policy", CONTACT_DEFAULT_POLICY)));
+ ListView_SetItemText(lv, lvI.iItem, 3, (db_get_b(hContact, MODULENAME, "HTMLConv", 0)) ? TranslateW(LANG_YES) : TranslateW(LANG_NO));
}
}
}
@@ -529,7 +529,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM
if (sel == CB_ERR) break;
int len = SendDlgItemMessage(hwndDlg, IDC_CMB_CONT_POLICY, CB_GETLBTEXTLEN, sel, 0);
if (len < 0) break;
- TCHAR *text = new TCHAR[len + 1];
+ wchar_t *text = new wchar_t[len + 1];
SendDlgItemMessage(hwndDlg, IDC_CMB_CONT_POLICY, CB_GETLBTEXT, sel, (LPARAM)text);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_LV_CONT_CONTACTS), iUser, 2, text);
OtrlPolicy policy = policy_from_string(text);
@@ -574,7 +574,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM
}
else {
EnableWindow(GetDlgItem(hwndDlg, IDC_CMB_CONT_POLICY), TRUE);
- TCHAR buff[50];
+ wchar_t buff[50];
ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, notif->iItem, 2, buff, _countof(buff));
SendDlgItemMessage(hwndDlg, IDC_CMB_CONT_POLICY, CB_SELECTSTRING, (LPARAM)-1, (WPARAM)buff);
}
@@ -590,15 +590,15 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM
MCONTACT hContact = (MCONTACT)lvi.lParam;
ContactPolicyMap *cp = (ContactPolicyMap *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- TCHAR buff[50];
+ wchar_t buff[50];
ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, lvi.iItem, 3, buff, _countof(buff));
- if (_tcsncmp(buff, TranslateT(LANG_YES), 50) == 0) {
+ if (wcsncmp(buff, TranslateW(LANG_YES), 50) == 0) {
(*cp)[hContact].htmlconv = HTMLCONV_DISABLE;
- ListView_SetItemText(((LPNMHDR)lParam)->hwndFrom, lvi.iItem, 3, TranslateT(LANG_NO));
+ ListView_SetItemText(((LPNMHDR)lParam)->hwndFrom, lvi.iItem, 3, TranslateW(LANG_NO));
}
else {
(*cp)[hContact].htmlconv = HTMLCONV_ENABLE;
- ListView_SetItemText(((LPNMHDR)lParam)->hwndFrom, lvi.iItem, 3, TranslateT(LANG_YES));
+ ListView_SetItemText(((LPNMHDR)lParam)->hwndFrom, lvi.iItem, 3, TranslateW(LANG_YES));
}
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
@@ -635,27 +635,27 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w
lvc.fmt = LVCFMT_LEFT;
lvc.iSubItem = 0;
- lvc.pszText = TranslateT(LANG_CONTACT);
+ lvc.pszText = TranslateW(LANG_CONTACT);
lvc.cx = 100; // width of column in pixels
ListView_InsertColumn(lv, 0, &lvc);
lvc.iSubItem = 1;
- lvc.pszText = TranslateT(LANG_PROTO);
+ lvc.pszText = TranslateW(LANG_PROTO);
lvc.cx = 90; // width of column in pixels
ListView_InsertColumn(lv, 1, &lvc);
lvc.iSubItem = 2;
- lvc.pszText = TranslateT(LANG_ACTIVE);
+ lvc.pszText = TranslateW(LANG_ACTIVE);
lvc.cx = 50; // width of column in pixels
ListView_InsertColumn(lv, 2, &lvc);
lvc.iSubItem = 3;
- lvc.pszText = TranslateT(LANG_VERIFIED);
+ lvc.pszText = TranslateW(LANG_VERIFIED);
lvc.cx = 50; // width of column in pixels
ListView_InsertColumn(lv, 3, &lvc);
lvc.iSubItem = 4;
- lvc.pszText = TranslateT(LANG_FINGERPRINT);
+ lvc.pszText = TranslateW(LANG_FINGERPRINT);
lvc.cx = 300; // width of column in pixels
ListView_InsertColumn(lv, 4, &lvc);
}
@@ -673,10 +673,10 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w
// items.
lvI.mask = LVIF_TEXT | LVIF_PARAM;// | LVIF_NORECOMPUTE;// | LVIF_IMAGE;
- TCHAR *user, hash[45] = { 0 };
+ wchar_t *user, hash[45] = { 0 };
for (ConnContext *context = otr_user_state->context_root; context; context = context->next) {
if (context->app_data) {
- user = (TCHAR*)contact_get_nameT((UINT_PTR)context->app_data);
+ user = (wchar_t*)contact_get_nameT((UINT_PTR)context->app_data);
if (user) {
PROTOACCOUNT *pa = Proto_GetAccount(context->protocol);
@@ -688,8 +688,8 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w
int d = ListView_InsertItem(lv, &lvI);
ListView_SetItemText(lv, d, 1, pa->tszAccountName);
- ListView_SetItemText(lv, d, 2, (context->active_fingerprint == fp) ? TranslateT(LANG_YES) : TranslateT(LANG_NO));
- ListView_SetItemText(lv, d, 3, (fp->trust && fp->trust[0] != '\0') ? TranslateT(LANG_YES) : TranslateT(LANG_NO));
+ ListView_SetItemText(lv, d, 2, (context->active_fingerprint == fp) ? TranslateW(LANG_YES) : TranslateW(LANG_NO));
+ ListView_SetItemText(lv, d, 3, (fp->trust && fp->trust[0] != '\0') ? TranslateW(LANG_YES) : TranslateW(LANG_NO));
ListView_SetItemText(lv, d, 4, hash);
}
}
@@ -713,7 +713,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w
Fingerprint *fp = (Fingerprint*)lvi.lParam;
FPModifyMap* fpm = (FPModifyMap*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
(*fpm)[fp] = FPM_NOTRUST;
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_LV_FINGER_LIST), sel, 3, TranslateT(LANG_NO));
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_LV_FINGER_LIST), sel, 3, TranslateW(LANG_NO));
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
break;
@@ -727,7 +727,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w
Fingerprint *fp = (Fingerprint*)lvi.lParam;
FPModifyMap* fpm = (FPModifyMap*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
(*fpm)[fp] = FPM_VERIFY;
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_LV_FINGER_LIST), sel, 3, TranslateT(LANG_YES));
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_LV_FINGER_LIST), sel, 3, TranslateW(LANG_YES));
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
break;
@@ -742,10 +742,10 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w
Fingerprint *fp = (Fingerprint*)lvi.lParam;
if (fp->context->active_fingerprint == fp) {
MCONTACT hContact = (UINT_PTR)fp->context->app_data;
- TCHAR buff[1024], hash[45];
+ wchar_t buff[1024], hash[45];
otrl_privkey_hash_to_humanT(hash, fp->fingerprint);
PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact));
- mir_sntprintf(buff, TranslateT(LANG_FINGERPRINT_STILL_IN_USE), hash, contact_get_nameT(hContact), pa->tszAccountName);
+ mir_sntprintf(buff, TranslateW(LANG_FINGERPRINT_STILL_IN_USE), hash, contact_get_nameT(hContact), pa->tszAccountName);
ShowError(buff);
}
else {
@@ -772,10 +772,10 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w
case FPM_DELETE:
if (it->first->context->active_fingerprint == it->first) {
MCONTACT hContact = (UINT_PTR)it->first->context->app_data;
- TCHAR buff[1024], hash[45];
+ wchar_t buff[1024], hash[45];
otrl_privkey_hash_to_humanT(hash, it->first->fingerprint);
PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact));
- mir_sntprintf(buff, TranslateT(LANG_FINGERPRINT_NOT_DELETED), hash, contact_get_nameT(hContact), pa->tszAccountName);
+ mir_sntprintf(buff, TranslateW(LANG_FINGERPRINT_NOT_DELETED), hash, contact_get_nameT(hContact), pa->tszAccountName);
ShowError(buff);
}
else otrl_context_forget_fingerprint(it->first, 1);
@@ -820,26 +820,26 @@ static int OpenOptions(WPARAM wParam, LPARAM)
OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 100;
odp.hInstance = hInst;
- odp.ptszGroup = LPGENT("Services");
- odp.ptszTitle = L"OTR";
+ odp.pwszGroup = LPGENW("Services");
+ odp.pwszTitle = L"OTR";
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.ptszTab = LANG_OPT_GENERAL;
+ odp.pwszTab = LANG_OPT_GENERAL;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GENERAL);
odp.pfnDlgProc = DlgProcMirOTROpts;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LANG_OPT_PROTO;
+ odp.pwszTab = LANG_OPT_PROTO;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_PROTO);
odp.pfnDlgProc = DlgProcMirOTROptsProto;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LANG_OPT_CONTACTS;
+ odp.pwszTab = LANG_OPT_CONTACTS;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CONTACTS);
odp.pfnDlgProc = DlgProcMirOTROptsContacts;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LANG_OPT_FINGER;
+ odp.pwszTab = LANG_OPT_FINGER;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FINGER);
odp.pfnDlgProc = DlgProcMirOTROptsFinger;
Options_AddPage(wParam, &odp);
diff --git a/plugins/MirOTR/src/options.h b/plugins/MirOTR/src/options.h
index d7f46344ea..1aca058985 100644
--- a/plugins/MirOTR/src/options.h
+++ b/plugins/MirOTR/src/options.h
@@ -5,9 +5,9 @@
#define FINGERPRINT_STORE_FILENAME "otr.fingerprints"
#define INSTAG_FILENAME "otr.instag"
-extern TCHAR g_fingerprint_store_filename[MAX_PATH];
-extern TCHAR g_private_key_filename[MAX_PATH];
-extern TCHAR g_instag_filename[MAX_PATH];
+extern wchar_t g_fingerprint_store_filename[MAX_PATH];
+extern wchar_t g_private_key_filename[MAX_PATH];
+extern wchar_t g_instag_filename[MAX_PATH];
#define CONTACT_DEFAULT_POLICY 0xFFFF
diff --git a/plugins/MirOTR/src/otr.cpp b/plugins/MirOTR/src/otr.cpp
index 8f2c9f0bb8..da2af8a178 100644
--- a/plugins/MirOTR/src/otr.cpp
+++ b/plugins/MirOTR/src/otr.cpp
@@ -56,9 +56,9 @@ INT_PTR CALLBACK GenKeyDlgBoxProc(HWND hWndDlg, UINT msg, WPARAM, LPARAM lParam)
}
TranslateDialogDefault(hWndDlg);
SetClassLongPtr(hWndDlg, GCLP_HICON, (LONG_PTR)IcoLib_GetIcon(ICON_OTR, 1));
- TCHAR buff[256];
- TCHAR *proto = mir_a2t((char*)lParam);
- mir_sntprintf(buff, TranslateT(LANG_GENERATE_KEY), proto);
+ wchar_t buff[256];
+ wchar_t *proto = mir_a2t((char*)lParam);
+ mir_sntprintf(buff, TranslateW(LANG_GENERATE_KEY), proto);
mir_free(proto);
SetDlgItemText(hWndDlg, IDC_GENERATE, buff);
GenKeyData *data = (GenKeyData *)mir_calloc(sizeof(GenKeyData));
@@ -175,20 +175,20 @@ extern "C" {
MCONTACT hContact = (UINT_PTR)opdata;
TrustLevel trusted = otr_context_get_trust(context);
SetEncryptionStatus(hContact, trusted);
- TCHAR buff[512];
+ wchar_t buff[512];
if (trusted == TRUST_PRIVATE) {
- mir_sntprintf(buff, TranslateT(LANG_SESSION_START_OTR), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_SESSION_START_OTR), contact_get_nameT(hContact));
}
else if (trusted == TRUST_UNVERIFIED) {
if (options.autoshow_verify) SMPInitDialog(context); //VerifyContextDialog(context);
- mir_sntprintf(buff, TranslateT(LANG_SESSION_START_OTR_VERIFY), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_SESSION_START_OTR_VERIFY), contact_get_nameT(hContact));
}
else { // should never happen
- mir_sntprintf(buff, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact));
}
if (context->protocol_version < MIROTR_PROTO_LATEST){
size_t remaining = mir_tstrlen(buff);
- TCHAR *offset = buff + remaining;
+ wchar_t *offset = buff + remaining;
remaining = _countof(buff) - remaining;
mir_sntprintf(offset, remaining, TranslateT("\nusing older protocol version %i"), context->protocol_version);
}
@@ -200,8 +200,8 @@ extern "C" {
void otr_gui_gone_insecure(void *opdata, ConnContext *context) {
MCONTACT hContact = (UINT_PTR)opdata;
DEBUGOUTA("OTR_GUI_GONE_INSECURE\n");
- TCHAR buff[512];
- mir_sntprintf(buff, TranslateT(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(hContact));
+ wchar_t buff[512];
+ mir_sntprintf(buff, TranslateW(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(hContact));
//MessageBox(0, buff, Translate("OTR Information"), MB_OK);
if (!Miranda_Terminated()) {
ShowMessage(hContact, buff);
@@ -218,30 +218,30 @@ extern "C" {
DEBUGOUTA("OTR_GUI_STILL_SECURE\n");
TrustLevel trusted = otr_context_get_trust(context);
SetEncryptionStatus(hContact, trusted);
- TCHAR buff[1024];
+ wchar_t buff[1024];
if (!is_reply) {
if (trusted == TRUST_PRIVATE) {
- mir_sntprintf(buff, TranslateT(LANG_SESSION_CONTINUE_OTR), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_SESSION_CONTINUE_OTR), contact_get_nameT(hContact));
}
else if (trusted == TRUST_UNVERIFIED) {
if (options.autoshow_verify) SMPInitDialog(context); //VerifyContextDialog(context);
- mir_sntprintf(buff, TranslateT(LANG_SESSION_CONTINUE_OTR_VERIFY), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_SESSION_CONTINUE_OTR_VERIFY), contact_get_nameT(hContact));
}
else { // should never happen
- mir_sntprintf(buff, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact));
}
// opdata is hContact
ShowMessage(hContact, buff);
}
else {
if (trusted == TRUST_PRIVATE) {
- mir_sntprintf(buff, TranslateT(LANG_SESSION_HAS_CONTINUE_OTR), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_SESSION_HAS_CONTINUE_OTR), contact_get_nameT(hContact));
}
else if (trusted == TRUST_UNVERIFIED) {
- mir_sntprintf(buff, TranslateT(LANG_SESSION_HAS_CONTINUE_OTR_VERIFY), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_SESSION_HAS_CONTINUE_OTR_VERIFY), contact_get_nameT(hContact));
}
else { // should never happen
- mir_sntprintf(buff, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact));
}
}
@@ -313,12 +313,12 @@ extern "C" {
void handle_msg_event(void *opdata, OtrlMessageEvent msg_event, ConnContext *, const char *message, gcry_error_t err) {
DEBUGOUTA("HANDLE_MSG_EVENT\n");
MCONTACT hContact = (UINT_PTR)opdata;
- const TCHAR* contact = contact_get_nameT(hContact);
+ const wchar_t* contact = contact_get_nameT(hContact);
- typedef void(*msgfunc_t)(const MCONTACT, const TCHAR*);
+ typedef void(*msgfunc_t)(const MCONTACT, const wchar_t*);
msgfunc_t msgfunc = ShowMessage;
- // TCHAR* title = NULL;
- TCHAR msg[512];
+ // wchar_t* title = NULL;
+ wchar_t msg[512];
msg[0] = '\0';
switch (msg_event){
case OTRL_MSGEVENT_NONE:
@@ -346,7 +346,7 @@ extern "C" {
mir_snwprintf(msg, _countof(msg), TranslateT("Error setting up private conversation: %s"), TranslateT("Malformed message received"));
break;
default:{
- TCHAR* tmp = mir_utf8decodeT(gcry_strerror(err));
+ wchar_t* tmp = mir_utf8decodeT(gcry_strerror(err));
mir_snwprintf(msg, _countof(msg), TranslateT("Error setting up private conversation: %s"), tmp);
mir_free(tmp); }
}
@@ -373,14 +373,14 @@ extern "C" {
break;
case OTRL_MSGEVENT_RCVDMSG_GENERAL_ERR:{
// title = TranslateT("OTR Error");
- TCHAR* tmp = mir_utf8decodeT(message);
+ wchar_t* tmp = mir_utf8decodeT(message);
mir_tstrncpy(msg, tmp, _countof(msg));
mir_free(tmp);
break; }
case OTRL_MSGEVENT_RCVDMSG_UNENCRYPTED:{
// title = TranslateT("Received unencrypted message");
msgfunc = ShowMessageInline;
- TCHAR* tmp = mir_utf8decodeT(message);
+ wchar_t* tmp = mir_utf8decodeT(message);
mir_snwprintf(msg, _countof(msg), TranslateT("The following message received from '%s' was NOT encrypted:\n\n%s"), contact, tmp);
mir_free(tmp);
ProtoChainSend(hContact, PSS_MESSAGE, PREF_BYPASS_OTR, (LPARAM)message);
@@ -400,7 +400,7 @@ extern "C" {
//void otr_create_instag(void *opdata, const char *accountname, const char *protocol) {
void otr_create_instag(void *, const char *accountname, const char *protocol){
DEBUGOUTA("OTR_CREATE_INSTAG\n");
- FILE* instagf = _tfopen(g_instag_filename, L"w+b");
+ FILE* instagf = _wfopen(g_instag_filename, L"w+b");
if (!instagf)
return;
otrl_instag_generate_FILEp(otr_user_state, instagf, accountname, protocol);
diff --git a/plugins/MirOTR/src/otr.h b/plugins/MirOTR/src/otr.h
index efa67f4aed..7746f2dd79 100644
--- a/plugins/MirOTR/src/otr.h
+++ b/plugins/MirOTR/src/otr.h
@@ -8,7 +8,7 @@ extern OtrlMessageAppOps ops;
#define MIROTR_PROTO_HELLO "?OTRv23?"
/* OTR link normally is https://otr.cypherpunks.ca/ but it's blocked by ICQ as of March 2015 (even something like "ot-r.cyp her_ pun ks. ca")
It might be a good idea to use http://wikipedia.org/wiki/Off-the-Record_Messaging instead as it's not yet blocked by ICQ but might still help users to find a client/plugin */
-#define MIROTR_PROTO_HELLO_MSG LPGENT(" has requested an Off-the-Record private conversation. However, you do not have a plugin to support that.\nSee http://wikipedia.org/wiki/Off-the-Record_Messaging for more information.")
+#define MIROTR_PROTO_HELLO_MSG LPGENW(" has requested an Off-the-Record private conversation. However, you do not have a plugin to support that.\nSee http://wikipedia.org/wiki/Off-the-Record_Messaging for more information.")
extern "C" {
diff --git a/plugins/MirOTR/src/svcs_menu.cpp b/plugins/MirOTR/src/svcs_menu.cpp
index 15a139bef8..e21c05c762 100644
--- a/plugins/MirOTR/src/svcs_menu.cpp
+++ b/plugins/MirOTR/src/svcs_menu.cpp
@@ -19,22 +19,22 @@ int StartOTR(MCONTACT hContact) {
otr_gui_inject_message((void*)hContact, proto, proto, uname, msg ? msg : MIROTR_PROTO_HELLO);
free(msg);
#else
- TCHAR* nick=ProtoGetNickname(proto);
+ wchar_t* nick=ProtoGetNickname(proto);
if(nick){
- TCHAR msg[1024];
- TCHAR* msgend = msg+_countof(msg)-1;
- TCHAR* msgoff = msg;
+ wchar_t msg[1024];
+ wchar_t* msgend = msg+_countof(msg)-1;
+ wchar_t* msgoff = msg;
for(const char* c=MIROTR_PROTO_HELLO; *c; *msgoff++=*c++);
*msgoff++ = '\n';
- for(const TCHAR* c=nick; *c && msgoff<msgend; *msgoff++=*c++);
- for(const TCHAR* c=MIROTR_PROTO_HELLO_MSG; *c && msgoff<msgend; *msgoff++=*c++);
+ for(const wchar_t* c=nick; *c && msgoff<msgend; *msgoff++=*c++);
+ for(const wchar_t* c=MIROTR_PROTO_HELLO_MSG; *c && msgoff<msgend; *msgoff++=*c++);
LCID langid = Langpack_GetDefaultLocale();
if(langid != 0x0409/*US*/ && langid != 0x1009/*CA*/ && langid != 0x0809/*GB*/){ // non english
- const TCHAR* translated=TranslateTS(MIROTR_PROTO_HELLO_MSG);
+ const wchar_t* translated=TranslateTS(MIROTR_PROTO_HELLO_MSG);
if(mir_tstrcmp(MIROTR_PROTO_HELLO_MSG,translated)){
*msgoff++ = '\n';
- for(const TCHAR* c=nick; *c && msgoff<msgend; *msgoff++=*c++);
- for(const TCHAR* c=translated; *c && msgoff<msgend; *msgoff++=*c++);
+ for(const wchar_t* c=nick; *c && msgoff<msgend; *msgoff++=*c++);
+ for(const wchar_t* c=translated; *c && msgoff<msgend; *msgoff++=*c++);
}
}
*msgoff='\0';
@@ -50,19 +50,19 @@ int StartOTR(MCONTACT hContact) {
INT_PTR SVC_StartOTR(WPARAM hContact, LPARAM)
{
- TCHAR buff[512];
+ wchar_t buff[512];
MCONTACT hSub = db_mc_getMostOnline(hContact);
if(hSub != 0)
hContact = hSub;
if ( options.bHaveSecureIM && CallService("SecureIM/IsContactSecured", hContact, 0) != 0 ) {
- mir_sntprintf(buff, TranslateT(LANG_OTR_SECUREIM_STARTED), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_OTR_SECUREIM_STARTED), contact_get_nameT(hContact));
ShowError(buff);
return 0;
}
- mir_sntprintf(buff, TranslateT(LANG_SESSION_REQUEST_OTR), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_SESSION_REQUEST_OTR), contact_get_nameT(hContact));
ShowMessage(hContact, buff);
return StartOTR(hContact);
@@ -70,19 +70,19 @@ INT_PTR SVC_StartOTR(WPARAM hContact, LPARAM)
INT_PTR SVC_RefreshOTR(WPARAM hContact, LPARAM)
{
- TCHAR buff[512];
+ wchar_t buff[512];
MCONTACT hSub = db_mc_getMostOnline(hContact);
if(hSub != 0)
hContact = hSub;
if ( options.bHaveSecureIM && CallService("SecureIM/IsContactSecured", hContact, 0) != 0 ) {
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SECUREIM_STARTED), contact_get_nameT(hContact));
+ mir_sntprintf(buff, 512, TranslateW(LANG_OTR_SECUREIM_STARTED), contact_get_nameT(hContact));
ShowError(buff);
return 0;
}
- mir_sntprintf(buff, TranslateT(LANG_SESSION_TRY_CONTINUE_OTR), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateW(LANG_SESSION_TRY_CONTINUE_OTR), contact_get_nameT(hContact));
ShowMessage(hContact, buff);
int res = StartOTR(hContact);
@@ -115,8 +115,8 @@ INT_PTR SVC_StopOTR(WPARAM hContact, LPARAM)
SetEncryptionStatus(hContact, TRUST_NOT_PRIVATE);
- TCHAR buff[512];
- mir_sntprintf(buff, TranslateT(LANG_SESSION_TERMINATED_OTR), contact_get_nameT(hContact));
+ wchar_t buff[512];
+ mir_sntprintf(buff, TranslateW(LANG_SESSION_TERMINATED_OTR), contact_get_nameT(hContact));
ShowMessage(hContact, buff);
return 0;
}
@@ -163,13 +163,13 @@ void InitMenu()
mi.position = -400000;
SET_UID(mi, 0xAB574FAD, 0x15D8, 0x49FF, 0xB7, 0x03, 0xDA, 0x2B, 0x45, 0x46, 0xC3, 0x56);
- mi.name.t = _T(LANG_STOP_OTR);
+ mi.name.w = _T(LANG_STOP_OTR);
mi.pszService = MS_OTR_MENUSTOP;
mi.hIcolibItem = IcoLib_GetIconHandle(ICON_PRIVATE);
hStopItem = Menu_AddContactMenuItem(&mi);
mi.uid.d[7]++;
- mi.name.t = _T(LANG_START_OTR);
+ mi.name.w = _T(LANG_START_OTR);
mi.pszService = MS_OTR_MENUSTART;
mi.hIcolibItem = IcoLib_GetIconHandle(ICON_NOT_PRIVATE);
hStartItem = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/MirOTR/src/svcs_proto.cpp b/plugins/MirOTR/src/svcs_proto.cpp
index 9aa72920d9..375484f775 100644
--- a/plugins/MirOTR/src/svcs_proto.cpp
+++ b/plugins/MirOTR/src/svcs_proto.cpp
@@ -45,7 +45,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){
if (err) { /* Be *sure* not to send out plaintext */
DEBUGOUTA("otrl_message_sending err");
- ShowError(TranslateT(LANG_ENCRYPTION_ERROR));
+ ShowError(TranslateW(LANG_ENCRYPTION_ERROR));
otrl_message_free(newmessage);
return 1;
}
@@ -110,8 +110,8 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam)
OtrlTLV *tlv = otrl_tlv_find(tlvs, OTRL_TLV_DISCONNECTED);
if (tlv && !Miranda_Terminated()) {
/* Notify the user that the other side disconnected. */
- TCHAR buff[256];
- mir_sntprintf(buff, TranslateT(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(ccs->hContact));
+ wchar_t buff[256];
+ mir_sntprintf(buff, TranslateW(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(ccs->hContact));
SetEncryptionStatus(ccs->hContact, otr_context_get_trust(context)); // required since libotr 4!?
ShowMessage(ccs->hContact, buff);
}
diff --git a/plugins/MirOTR/src/svcs_srmm.cpp b/plugins/MirOTR/src/svcs_srmm.cpp
index 51ebb6145d..025b968610 100644
--- a/plugins/MirOTR/src/svcs_srmm.cpp
+++ b/plugins/MirOTR/src/svcs_srmm.cpp
@@ -40,22 +40,22 @@ void SetEncryptionStatus(MCONTACT hContact, TrustLevel level)
switch (level) {
case TRUST_FINISHED:
sid.flags = 0;
- button.ptszTooltip = TranslateT(LANG_STATUS_FINISHED);
+ button.ptszTooltip = TranslateW(LANG_STATUS_FINISHED);
button.hIcon = IcoLib_GetIconHandle(ICON_FINISHED);
break;
case TRUST_UNVERIFIED:
sid2.flags = MBF_DISABLED;
- button.ptszTooltip = TranslateT(LANG_STATUS_UNVERIFIED);
+ button.ptszTooltip = TranslateW(LANG_STATUS_UNVERIFIED);
button.hIcon = IcoLib_GetIconHandle(ICON_UNVERIFIED);
break;
case TRUST_PRIVATE:
sid2.flags = 0;
- button.ptszTooltip = TranslateT(LANG_STATUS_PRIVATE);
+ button.ptszTooltip = TranslateW(LANG_STATUS_PRIVATE);
button.hIcon = IcoLib_GetIconHandle(ICON_PRIVATE);
break;
default:
sid.flags = MBF_DISABLED;
- button.ptszTooltip = TranslateT(LANG_STATUS_DISABLED);
+ button.ptszTooltip = TranslateW(LANG_STATUS_DISABLED);
button.hIcon = IcoLib_GetIconHandle(ICON_NOT_PRIVATE);
break;
}
diff --git a/plugins/MirOTR/src/utils.cpp b/plugins/MirOTR/src/utils.cpp
index 0fc9e6a450..f7471b9c98 100644
--- a/plugins/MirOTR/src/utils.cpp
+++ b/plugins/MirOTR/src/utils.cpp
@@ -66,22 +66,22 @@ void VerifyFingerprint(ConnContext *context, bool verify) {
void VerifyFingerprintMessage(ConnContext *context, bool verify) {
MCONTACT hContact = (UINT_PTR)context->app_data;
- TCHAR msg[1024];
- mir_sntprintf(msg, (verify)?TranslateT(LANG_FINGERPRINT_VERIFIED):TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact));
+ wchar_t msg[1024];
+ mir_snwprintf(msg, (verify) ? TranslateW(LANG_FINGERPRINT_VERIFIED) : TranslateW(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact));
ShowMessage(hContact, msg);
SetEncryptionStatus(hContact, otr_context_get_trust(context));
}
/* Convert a 20-byte hash value to a 45-byte human-readable value */
-void otrl_privkey_hash_to_humanT(TCHAR human[45], const unsigned char hash[20])
+void otrl_privkey_hash_to_humanT(wchar_t human[45], const unsigned char hash[20])
{
int word, byte;
- TCHAR *p = human;
+ wchar_t *p = human;
for(word=0; word<5; ++word) {
for(byte=0; byte<4; ++byte) {
- _stprintf(p, L"%02X", hash[word*4+byte]); //!!!!!!!!!!!!!!
+ swprintf(p, L"%02X", hash[word*4+byte]); //!!!!!!!!!!!!!!
p += 2;
}
*(p++) = ' ';
@@ -100,26 +100,26 @@ char* contact_get_id(MCONTACT hContact, bool bNameOnError)
return mir_t2a(pszUniqueID);
}
-__inline const TCHAR* contact_get_nameT(MCONTACT hContact) {
+__inline const wchar_t* contact_get_nameT(MCONTACT hContact) {
return pcli->pfnGetContactDisplayName(hContact, 0);
}
-TCHAR* ProtoGetNickname(const char* proto)
+wchar_t* ProtoGetNickname(const char* proto)
{
- TCHAR *p = Contact_GetInfo(CNF_NICK, NULL, proto);
+ wchar_t *p = Contact_GetInfo(CNF_NICK, NULL, proto);
return (p != NULL) ? p : mir_tstrdup(L"");
}
-void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const MCONTACT hContact) {
+void ShowPopup(const wchar_t* line1, const wchar_t* line2, int timeout, const MCONTACT hContact) {
if(CallService(MS_SYSTEM_TERMINATED, 0, 0)) return;
if ( !options.bHavePopups) {
- TCHAR title[256];
+ wchar_t title[256];
mir_sntprintf(title, L"%s Message", _T(MODULENAME));
if(line1 && line2) {
int size = int(mir_tstrlen(line1) + mir_tstrlen(line2) + 3);
- TCHAR *message = new TCHAR[size]; // newline and null terminator
+ wchar_t *message = new wchar_t[size]; // newline and null terminator
mir_sntprintf(message, size, L"%s\r\n%s", line1, line2);
MessageBox( NULL, message, title, MB_OK | MB_ICONINFORMATION );
delete[] message;
@@ -138,12 +138,12 @@ void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const MCONTA
ppd.lchIcon = NULL;
if(line1 && line2) {
- _tcsncpy( ppd.lptzContactName, line1, MAX_CONTACTNAME-1 );
- _tcsncpy( ppd.lptzText, line2, MAX_SECONDLINE-1 );
+ wcsncpy( ppd.lptzContactName, line1, MAX_CONTACTNAME-1 );
+ wcsncpy( ppd.lptzText, line2, MAX_SECONDLINE-1 );
} else if(line1)
- _tcsncpy( ppd.lptzText, line1, MAX_SECONDLINE-1 );
+ wcsncpy( ppd.lptzText, line1, MAX_SECONDLINE-1 );
else if(line2)
- _tcsncpy( ppd.lptzText, line2, MAX_SECONDLINE-1 );
+ wcsncpy( ppd.lptzText, line2, MAX_SECONDLINE-1 );
ppd.iSeconds = timeout;
@@ -154,8 +154,8 @@ void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const MCONTA
}
-void ShowWarning(TCHAR *msg) {
- TCHAR buffer[512];
+void ShowWarning(wchar_t *msg) {
+ wchar_t buffer[512];
ErrorDisplay disp = options.err_method;
// funny logic :) ... try to avoid message boxes
// if want baloons but no balloons, try popups
@@ -172,7 +172,7 @@ void ShowWarning(TCHAR *msg) {
case ED_POP:
{
int size = int(mir_tstrlen(msg) + 515);
- TCHAR *message = new TCHAR[size]; // newline and null terminator
+ wchar_t *message = new wchar_t[size]; // newline and null terminator
mir_sntprintf(message, size, L"%s\r\n%s", buffer, msg);
PUShowMessageT(message, SM_WARNING);
delete[] message;
@@ -200,8 +200,8 @@ void ShowWarning(TCHAR *msg) {
}
}
-void ShowError(TCHAR *msg) {
- TCHAR buffer[512];
+void ShowError(wchar_t *msg) {
+ wchar_t buffer[512];
ErrorDisplay disp = options.err_method;
// funny logic :) ... try to avoid message boxes
// if want baloons but no balloons, try popups
@@ -214,12 +214,12 @@ void ShowError(TCHAR *msg) {
mir_sntprintf(buffer, L"%s Error", _T(MODULENAME));
- TCHAR *message;
+ wchar_t *message;
switch(disp) {
case ED_POP:
{
int size = int(mir_tstrlen(msg) + 515);
- message = new TCHAR[size]; // newline and null terminator
+ message = new wchar_t[size]; // newline and null terminator
mir_sntprintf(message, size, L"%s\r\n%s", buffer, msg);
PUShowMessageT(message, SM_WARNING);
delete[] message;
@@ -249,26 +249,26 @@ void ShowError(TCHAR *msg) {
void ShowPopupUtf(const char* line1, const char* line2, int timeout, const MCONTACT hContact) {
- TCHAR* l1 = (line1) ? mir_utf8decodeT(line1) : NULL;
- TCHAR* l2 = (line2) ? mir_utf8decodeT(line2) : NULL;
+ wchar_t* l1 = (line1) ? mir_utf8decodeT(line1) : NULL;
+ wchar_t* l2 = (line2) ? mir_utf8decodeT(line2) : NULL;
ShowPopup(l1, l2, timeout, hContact);
if (l1) mir_free(l1);
if (l2) mir_free(l2);
}
void ShowWarningUtf(char* msg) {
- TCHAR* m = (msg) ? mir_utf8decodeT(msg) : NULL;
+ wchar_t* m = (msg) ? mir_utf8decodeT(msg) : NULL;
ShowWarning(m);
if (m) mir_free(m);
}
void ShowErrorUtf(char* msg) {
- TCHAR* m = (msg) ? mir_utf8decodeT(msg) : NULL;
+ wchar_t* m = (msg) ? mir_utf8decodeT(msg) : NULL;
ShowError(m);
if (m) mir_free(m);
}
-void ShowMessageInline(const MCONTACT hContact, const TCHAR *msg) {
- TCHAR buff[1024];
+void ShowMessageInline(const MCONTACT hContact, const wchar_t *msg) {
+ wchar_t buff[1024];
mir_sntprintf(buff, L"%s%s", _T(LANG_INLINE_PREFIX), msg);
T2Utf utf(buff);
@@ -297,37 +297,37 @@ void ShowMessageUtf(const MCONTACT hContact, const char *msg) {
ShowPopupUtf(Translate(LANG_OTR_INFO), msg, 0, hContact);
}
-void ShowMessage(const MCONTACT hContact, const TCHAR *msg) {
+void ShowMessage(const MCONTACT hContact, const wchar_t *msg) {
if(options.msg_inline)
ShowMessageInline(hContact, msg);
if(options.msg_popup)
ShowPopup(TranslateT(LANG_OTR_INFO), msg, 0, hContact);
}
-const TCHAR *policy_to_string(OtrlPolicy policy) {
+const wchar_t *policy_to_string(OtrlPolicy policy) {
switch (policy) {
case OTRL_POLICY_NEVER:
- return TranslateT(LANG_POLICY_NEVER);
+ return TranslateW(LANG_POLICY_NEVER);
case OTRL_POLICY_OPPORTUNISTIC:
- return TranslateT(LANG_POLICY_OPP);
+ return TranslateW(LANG_POLICY_OPP);
case OTRL_POLICY_MANUAL:
case OTRL_POLICY_MANUAL_MOD:
- return TranslateT(LANG_POLICY_MANUAL);
+ return TranslateW(LANG_POLICY_MANUAL);
case OTRL_POLICY_ALWAYS:
- return TranslateT(LANG_POLICY_ALWAYS);
+ return TranslateW(LANG_POLICY_ALWAYS);
default:
- return TranslateT(LANG_POLICY_DEFAULT);
+ return TranslateW(LANG_POLICY_DEFAULT);
}
}
-OtrlPolicy policy_from_string(const TCHAR *polstring) {
- if (mir_tstrcmp(polstring, TranslateT(LANG_POLICY_NEVER)) == 0)
+OtrlPolicy policy_from_string(const wchar_t *polstring) {
+ if (mir_tstrcmp(polstring, TranslateW(LANG_POLICY_NEVER)) == 0)
return OTRL_POLICY_NEVER;
- else if (mir_tstrcmp(polstring, TranslateT(LANG_POLICY_OPP)) == 0)
+ else if (mir_tstrcmp(polstring, TranslateW(LANG_POLICY_OPP)) == 0)
return OTRL_POLICY_OPPORTUNISTIC;
- else if (mir_tstrcmp(polstring, TranslateT(LANG_POLICY_MANUAL)) == 0)
+ else if (mir_tstrcmp(polstring, TranslateW(LANG_POLICY_MANUAL)) == 0)
return OTRL_POLICY_MANUAL_MOD;
- else if (mir_tstrcmp(polstring, TranslateT(LANG_POLICY_ALWAYS)) == 0)
+ else if (mir_tstrcmp(polstring, TranslateW(LANG_POLICY_ALWAYS)) == 0)
return OTRL_POLICY_ALWAYS;
else
return CONTACT_DEFAULT_POLICY;
diff --git a/plugins/MirOTR/src/utils.h b/plugins/MirOTR/src/utils.h
index 633b5a0647..aec0e4a01a 100644
--- a/plugins/MirOTR/src/utils.h
+++ b/plugins/MirOTR/src/utils.h
@@ -19,28 +19,28 @@ TrustLevel otr_context_get_trust(ConnContext *context);
void VerifyFingerprint(ConnContext *context, bool verify);
void VerifyFingerprintMessage(ConnContext *context, bool verify);
-void otrl_privkey_hash_to_humanT(TCHAR human[45], const unsigned char hash[20]);
+void otrl_privkey_hash_to_humanT(wchar_t human[45], const unsigned char hash[20]);
char* contact_get_id(MCONTACT hContact, bool bNameOnError=true);
__inline const char* contact_get_account(MCONTACT hContact);
-extern __inline const TCHAR* contact_get_nameT(MCONTACT hContact);
+extern __inline const wchar_t* contact_get_nameT(MCONTACT hContact);
-TCHAR* ProtoGetNickname(const char* proto);
+wchar_t* ProtoGetNickname(const char* proto);
-void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const MCONTACT hContact = NULL);
-void ShowWarning(TCHAR* msg);
-void ShowError(TCHAR* msg);
+void ShowPopup(const wchar_t* line1, const wchar_t* line2, int timeout, const MCONTACT hContact = NULL);
+void ShowWarning(wchar_t* msg);
+void ShowError(wchar_t* msg);
void ShowPopupUtf(const char* line1, const char* line2, int timeout, const MCONTACT hContact = NULL);
void ShowWarningUtf(char* msg);
void ShowErrorUtf(char* msg);
-void ShowMessageInline(const MCONTACT hContact, const TCHAR *msg);
+void ShowMessageInline(const MCONTACT hContact, const wchar_t *msg);
void ShowMessageInlineUtf(const MCONTACT hContact, const char *msg);
-void ShowMessage(const MCONTACT hContact, const TCHAR *msg);
+void ShowMessage(const MCONTACT hContact, const wchar_t *msg);
void ShowMessageUtf(const MCONTACT hContact, const char *msg);
-const TCHAR *policy_to_string(OtrlPolicy policy);
-OtrlPolicy policy_from_string(const TCHAR *polstring);
+const wchar_t *policy_to_string(OtrlPolicy policy);
+OtrlPolicy policy_from_string(const wchar_t *polstring);
#endif
diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp
index b1be837708..ddaaeef100 100644
--- a/plugins/MirandaG15/src/CAppletManager.cpp
+++ b/plugins/MirandaG15/src/CAppletManager.cpp
@@ -199,10 +199,10 @@ bool CAppletManager::Shutdown()
//************************************************************************
// Translates the specified string, and inserts the parameters
//************************************************************************
-tstring CAppletManager::TranslateString(TCHAR *szString, ...)
+tstring CAppletManager::TranslateString(wchar_t *szString, ...)
{
- TCHAR out[1024];
- TCHAR *szTranslatedString = TranslateTS(szString);
+ wchar_t out[1024];
+ wchar_t *szTranslatedString = TranslateTS(szString);
va_list body;
va_start(body, szString);
@@ -532,19 +532,19 @@ tstring CAppletManager::GetFormattedTimestamp(tm *tm_time)
time(&now);
localtime_s(&tm_now, &now);
- TCHAR buffer[128];
+ wchar_t buffer[128];
if (tm_time->tm_mday != tm_now.tm_mday || tm_time->tm_mon != tm_now.tm_mon) {
if (CConfig::GetBoolSetting(TIMESTAMP_SECONDS))
- _tcsftime(buffer, 128, L"[%x %H:%M:%S]", tm_time);
+ wcsftime(buffer, 128, L"[%x %H:%M:%S]", tm_time);
else
- _tcsftime(buffer, 128, L"[%x %H:%M]", tm_time);
+ wcsftime(buffer, 128, L"[%x %H:%M]", tm_time);
}
else {
if (CConfig::GetBoolSetting(TIMESTAMP_SECONDS))
- _tcsftime(buffer, 128, L"[%H:%M:%S]", tm_time);
+ wcsftime(buffer, 128, L"[%H:%M:%S]", tm_time);
else
- _tcsftime(buffer, 128, L"[%H:%M]", tm_time);
+ wcsftime(buffer, 128, L"[%H:%M]", tm_time);
}
return toTstring(buffer);
@@ -875,7 +875,7 @@ bool CAppletManager::TranslateDBEvent(CEvent *pEvent, WPARAM hContact, LPARAM hd
pEvent->strValue = Utf8_Decode((char*)dbevent.pBlob);
}
else if ((int)dbevent.cbBlob == msglen * 3) {
- pEvent->strValue = (TCHAR *)& dbevent.pBlob[msglen];
+ pEvent->strValue = (wchar_t *)& dbevent.pBlob[msglen];
}
else {
pEvent->strValue = toTstring((char*)dbevent.pBlob);
diff --git a/plugins/MirandaG15/src/CAppletManager.h b/plugins/MirandaG15/src/CAppletManager.h
index a01b3268a1..f80b612c83 100644
--- a/plugins/MirandaG15/src/CAppletManager.h
+++ b/plugins/MirandaG15/src/CAppletManager.h
@@ -108,7 +108,7 @@ public:
// checks if the patched IRC protocol is in place
bool IsIRCHookEnabled();
- static tstring TranslateString(TCHAR *szString,...);
+ static tstring TranslateString(wchar_t *szString,...);
private:
list<CIRCHistory*> m_LIRCHistorys;
diff --git a/plugins/MirandaG15/src/CChatScreen.cpp b/plugins/MirandaG15/src/CChatScreen.cpp
index 34c228c697..12020a9630 100644
--- a/plugins/MirandaG15/src/CChatScreen.cpp
+++ b/plugins/MirandaG15/src/CChatScreen.cpp
@@ -178,7 +178,7 @@ void CChatScreen::UpdateLabels()
m_iStatus = db_get_w(m_hContact,szProto,"Status",ID_STATUS_OFFLINE);
}
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(m_iStatus, 0);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(m_iStatus, 0);
if(szStatus != NULL)
strStatus = toTstring(szStatus);
diff --git a/plugins/MirandaG15/src/CContactList.cpp b/plugins/MirandaG15/src/CContactList.cpp
index 6e6f42593b..69a7e1e972 100644
--- a/plugins/MirandaG15/src/CContactList.cpp
+++ b/plugins/MirandaG15/src/CContactList.cpp
@@ -109,7 +109,7 @@ void CContactList::AddContact(MCONTACT hContact)
return;
int iStatus = db_get_w(hContact,szProto,"Status",ID_STATUS_OFFLINE);
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(iStatus, 0);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(iStatus, 0);
CContactListEntry *psContact = new CContactListEntry();
@@ -721,7 +721,7 @@ void CContactList::OnStatusChange(MCONTACT hContact,int iStatus)
int iOldStatus = pItemData->iStatus;
// Update the list entry
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(iStatus, 0);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(iStatus, 0);
if(szStatus != NULL)
pItemData->strStatus =toTstring(szStatus);
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp
index 1ca9bd4378..2a121c22c1 100644
--- a/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp
+++ b/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp
@@ -101,7 +101,7 @@ bool CLCDInput::Draw(CLCDGfx *pGfx)
int iLine = m_iLinePosition;
int iEndLine = m_iLinePosition + m_iLineCount;
int iLen = 0;
- TCHAR *pcOffset = NULL;
+ wchar_t *pcOffset = NULL;
while(iLine < iEndLine && iLine < m_vLineOffsets.size())
{
// Calculate the text length
@@ -115,7 +115,7 @@ bool CLCDInput::Draw(CLCDGfx *pGfx)
else iLen = (int)m_strText.length() - m_vLineOffsets[iLine].iOffset;
// Draw the text
- pcOffset = (TCHAR*)m_strText.c_str() + m_vLineOffsets[iLine].iOffset;
+ pcOffset = (wchar_t*)m_strText.c_str() + m_vLineOffsets[iLine].iOffset;
DrawTextEx(pGfx->GetHDC(),
(LPTSTR)pcOffset,
iLen,
@@ -380,7 +380,7 @@ LRESULT CLCDInput::ProcessKeyEvent(int Code, WPARAM wParam, LPARAM lParam)
{
#ifdef _UNICODE
- TCHAR output[4];
+ wchar_t output[4];
#else
unsigned char output[2];
#endif
@@ -419,9 +419,9 @@ LRESULT CLCDInput::ProcessKeyEvent(int Code, WPARAM wParam, LPARAM lParam)
return 1;
if(m_bInsert || m_strText[m_Marker[0].iPosition] == '\r')
- m_strText.insert(m_Marker[0].iPosition,(TCHAR*)output,res);
+ m_strText.insert(m_Marker[0].iPosition,(wchar_t*)output,res);
else
- m_strText.replace(m_Marker[0].iPosition,res,(TCHAR*)output);
+ m_strText.replace(m_Marker[0].iPosition,res,(wchar_t*)output);
scroll = 1;
size = res;
@@ -601,7 +601,7 @@ void CLCDInput::UpdateOffsets(int iModified)
// Initialize variables
int iLen = (int)m_strText.length();
int *piWidths = new int[iLen];
- TCHAR *pszText = (TCHAR*)m_strText.c_str();
+ wchar_t *pszText = (wchar_t*)m_strText.c_str();
tstring::size_type pos = 0;
int iMaxChars = 0;
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDLabel.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDLabel.cpp
index 2c0a0bd866..e416be2810 100644
--- a/plugins/MirandaG15/src/LCDFramework/CLCDLabel.cpp
+++ b/plugins/MirandaG15/src/LCDFramework/CLCDLabel.cpp
@@ -150,7 +150,7 @@ void CLCDLabel::UpdateCutOffIndex()
if(m_bWordWrap && GetWidth() > 0)
{
int *piExtents = new int[m_strText.length()];
- TCHAR *szString = (TCHAR*)m_strText.c_str();
+ wchar_t *szString = (wchar_t*)m_strText.c_str();
int iMaxChars = 0;
tstring::size_type pos = 0;
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDTextLog.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDTextLog.cpp
index f0c30b78cf..bbb9b689df 100644
--- a/plugins/MirandaG15/src/LCDFramework/CLCDTextLog.cpp
+++ b/plugins/MirandaG15/src/LCDFramework/CLCDTextLog.cpp
@@ -304,7 +304,7 @@ void CLCDTextLog::WrapMessage(CLogEntry *pEntry)
SIZE sizeLine = {0, 0};
int *piExtents = new int[strString.length()];
- TCHAR *szString = (TCHAR*)strString.c_str();
+ wchar_t *szString = (wchar_t*)strString.c_str();
int iMaxChars = 0;
tstring::size_type pos = 0;
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp
index 56c2d9f68c..236cefc71b 100644
--- a/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp
+++ b/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp
@@ -108,7 +108,7 @@ void CLCDTextObject::SetFontFaceName(tstring strFontName)
memset(&lf, 0, sizeof(lf));
GetObject(m_hFont, sizeof(LOGFONT), &lf);
- _tcsncpy(lf.lfFaceName, strFontName.c_str(), LF_FACESIZE);
+ wcsncpy(lf.lfFaceName, strFontName.c_str(), LF_FACESIZE);
SetFont(lf);
}
diff --git a/plugins/MirandaG15/src/LCDFramework/debug.cpp b/plugins/MirandaG15/src/LCDFramework/debug.cpp
index abca919bfe..1eb18013c7 100644
--- a/plugins/MirandaG15/src/LCDFramework/debug.cpp
+++ b/plugins/MirandaG15/src/LCDFramework/debug.cpp
@@ -25,9 +25,9 @@
}
#endif
-void _trace(TCHAR *fmt, ...)
+void _trace(wchar_t *fmt, ...)
{
- TCHAR out[1024];
+ wchar_t out[1024];
va_list body;
va_start(body, fmt);
#ifdef _UNICODE
diff --git a/plugins/MirandaG15/src/LCDFramework/debug.h b/plugins/MirandaG15/src/LCDFramework/debug.h
index 55bb8719e5..b9d49bf17f 100644
--- a/plugins/MirandaG15/src/LCDFramework/debug.h
+++ b/plugins/MirandaG15/src/LCDFramework/debug.h
@@ -12,7 +12,7 @@ extern void UnInitDebug();
#include "ConStream.h"
#endif
#define TRACE _trace
-extern void _trace(TCHAR *fmt, ...);
+extern void _trace(wchar_t *fmt, ...);
#else
inline void _trace(LPCTSTR, ...) { }
#define TRACE 1 ? (void)0 : _trace
diff --git a/plugins/MirandaG15/src/LCDFramework/misc.cpp b/plugins/MirandaG15/src/LCDFramework/misc.cpp
index 968bb5ce6c..339b88e393 100644
--- a/plugins/MirandaG15/src/LCDFramework/misc.cpp
+++ b/plugins/MirandaG15/src/LCDFramework/misc.cpp
@@ -7,7 +7,7 @@ tstring tstringprintf(tstring strFormat,...) {
va_start(vlist, strFormat);
int mlen = (int)strFormat.length()+128;
- TCHAR *text = (TCHAR*)malloc(mlen*sizeof(TCHAR));
+ wchar_t *text = (wchar_t*)malloc(mlen*sizeof(wchar_t));
_vsntprintf(text,mlen,strFormat.c_str(),vlist);
va_end(vlist);
@@ -122,7 +122,7 @@ tstring Utf8_Decode(const char *str)
size_t len = mir_strlen(str);
- if ((wszTemp = (WCHAR *) malloc(sizeof(TCHAR) * (len + 2))) == NULL)
+ if ((wszTemp = (WCHAR *) malloc(sizeof(wchar_t) * (len + 2))) == NULL)
return strRes;
p = (char *) str;
@@ -140,7 +140,7 @@ tstring Utf8_Decode(const char *str)
wszTemp[i++] |= (*(p++) & 0x3f);
}
}
- wszTemp[i] = (TCHAR)'\0';
+ wszTemp[i] = (wchar_t)'\0';
strRes = wszTemp;
free(wszTemp);
diff --git a/plugins/MirandaG15/src/LCDFramework/misc.h b/plugins/MirandaG15/src/LCDFramework/misc.h
index 0dd4494f0c..c5f2bb4f06 100644
--- a/plugins/MirandaG15/src/LCDFramework/misc.h
+++ b/plugins/MirandaG15/src/LCDFramework/misc.h
@@ -30,11 +30,11 @@ inline std::string toNarrowString( const std::string& str )
#ifdef _UNICODE
#define tstring wstring
- inline TCHAR toTchar( char ch )
+ inline wchar_t toTchar( char ch )
{
return (wchar_t)ch ;
}
- inline TCHAR toTchar( wchar_t ch )
+ inline wchar_t toTchar( wchar_t ch )
{
return ch ;
}
@@ -61,11 +61,11 @@ inline std::string toNarrowString( const std::string& str )
extern string Utf8_Encode(const WCHAR *str);
#else
#define tstring string
- inline TCHAR toTchar( char ch )
+ inline wchar_t toTchar( char ch )
{
return ch ;
}
- inline TCHAR toTchar( wchar_t ch )
+ inline wchar_t toTchar( wchar_t ch )
{
return (ch >= 0 && ch <= 0xFF) ? (char)ch : '?' ;
}
diff --git a/plugins/MirandaG15/src/LCDFramework/stdafx.h b/plugins/MirandaG15/src/LCDFramework/stdafx.h
index 2195cdf02e..2ae74c24b1 100644
--- a/plugins/MirandaG15/src/LCDFramework/stdafx.h
+++ b/plugins/MirandaG15/src/LCDFramework/stdafx.h
@@ -6,7 +6,6 @@
#define ASSERT assert
#include <Windows.h>
-#include <tchar.h>
#include <string>
#include <vector>
#include <queue>
diff --git a/plugins/MirandaG15/src/StdAfx.h b/plugins/MirandaG15/src/StdAfx.h
index 176f52cdb6..64723b62b2 100644
--- a/plugins/MirandaG15/src/StdAfx.h
+++ b/plugins/MirandaG15/src/StdAfx.h
@@ -8,7 +8,6 @@
#include <Windows.h>
#include <CommCtrl.h>
-#include <tchar.h>
#include <time.h>
#include <string>
#include <vector>
diff --git a/plugins/MobileState/src/clients.h b/plugins/MobileState/src/clients.h
index b9c87ae6e5..a7f6041ff2 100644
--- a/plugins/MobileState/src/clients.h
+++ b/plugins/MobileState/src/clients.h
@@ -19,7 +19,7 @@
#pragma once
-static const TCHAR *clients[] = {
+static const wchar_t *clients[] = {
L"android",
L"mobile",
L"pda",
diff --git a/plugins/MobileState/src/main.cpp b/plugins/MobileState/src/main.cpp
index 7b1b1ebceb..b18452a7d8 100644
--- a/plugins/MobileState/src/main.cpp
+++ b/plugins/MobileState/src/main.cpp
@@ -57,11 +57,11 @@ bool hasMobileClient(MCONTACT hContact, LPARAM)
ptrT client(db_get_tsa(hContact, proto, "MirVer"));
if (client) {
// Make client lower-case
- _tcslwr(client);
+ wcslwr(client);
// Find whether this client contain something from clients list
for (size_t i = 0; i < _countof(clients); i++)
- if (_tcsstr(client, clients[i]))
+ if (wcsstr(client, clients[i]))
return true;
}
diff --git a/plugins/ModernOpt/src/modernopt.cpp b/plugins/ModernOpt/src/modernopt.cpp
index 8eb3a1b369..8ef64ff744 100644
--- a/plugins/ModernOpt/src/modernopt.cpp
+++ b/plugins/ModernOpt/src/modernopt.cpp
@@ -69,15 +69,15 @@ static void ModernOptUI_SelectSection(HWND hwndDlg, struct ModernOptionsData *da
// Main option pages
struct ModernOptMainPageInfo g_ModernOptPages[MODERNOPT_PAGE_COUNT] =
{
- {0, FALSE, IDI_MIRANDA, LPGENT("Home"), LPGENT("Miranda NG configuration center")},
- {IDC_BTN_ACCOUNTS, TRUE, IDI_BIG_NETWORK, LPGENT("Accounts"), LPGENT("Setup your account information to start messaging.")},
- {IDC_BTN_SKINS, TRUE, IDI_BIG_SKINS, LPGENT("Style"), LPGENT("Change the look of Miranda NG according to your taste.")},
- {IDC_BTN_CLIST, TRUE, IDI_BIG_BUDDYLIST, LPGENT("Contacts"), LPGENT("Configure behavior of your contact list.")},
- {IDC_BTN_MESSAGING, TRUE, IDI_BIG_MESSAGE, LPGENT("Chats"), LPGENT("Customize look&&feel of your chat windows here.")},
- {IDC_BTN_IGNORE, TRUE, IDI_BIG_IGNORE, LPGENT("Ignore"), LPGENT("Ban those users and events, you are annoyed with.")},
- {IDC_BTN_STATUS, TRUE, IDI_BIG_STATUS, LPGENT("Status"), LPGENT("Set your status messages and idle reporting.")},
- {IDC_BTN_ADVANCED, TRUE, IDI_BIG_ADVANCED, LPGENT("Advanced"), LPGENT("")},
- {IDC_BTN_PLUGINS, TRUE, IDI_BIG_MODULES, LPGENT("Plugins"), LPGENT("Miranda NG is all about plugins. Manage all the plugins you have here.")},
+ {0, FALSE, IDI_MIRANDA, LPGENW("Home"), LPGENW("Miranda NG configuration center")},
+ {IDC_BTN_ACCOUNTS, TRUE, IDI_BIG_NETWORK, LPGENW("Accounts"), LPGENW("Setup your account information to start messaging.")},
+ {IDC_BTN_SKINS, TRUE, IDI_BIG_SKINS, LPGENW("Style"), LPGENW("Change the look of Miranda NG according to your taste.")},
+ {IDC_BTN_CLIST, TRUE, IDI_BIG_BUDDYLIST, LPGENW("Contacts"), LPGENW("Configure behavior of your contact list.")},
+ {IDC_BTN_MESSAGING, TRUE, IDI_BIG_MESSAGE, LPGENW("Chats"), LPGENW("Customize look&&feel of your chat windows here.")},
+ {IDC_BTN_IGNORE, TRUE, IDI_BIG_IGNORE, LPGENW("Ignore"), LPGENW("Ban those users and events, you are annoyed with.")},
+ {IDC_BTN_STATUS, TRUE, IDI_BIG_STATUS, LPGENW("Status"), LPGENW("Set your status messages and idle reporting.")},
+ {IDC_BTN_ADVANCED, TRUE, IDI_BIG_ADVANCED, LPGENW("Advanced"), LPGENW("")},
+ {IDC_BTN_PLUGINS, TRUE, IDI_BIG_MODULES, LPGENW("Plugins"), LPGENW("Miranda NG is all about plugins. Manage all the plugins you have here.")},
};
////////////////////////////////////////////////////////////////////////////////
@@ -371,7 +371,7 @@ static HWND ModernOptUI_ShowPage_Impl(HWND hwndDlg, struct ModernOptionsData *da
return obj->hwnd;
}
-static int lstrcmp_null(TCHAR *p1, TCHAR *p2)
+static int lstrcmp_null(wchar_t *p1, wchar_t *p2)
{
if (!p1 && !p2) return 0;
if (!p1) return -1;
diff --git a/plugins/ModernOpt/src/modernopt.h b/plugins/ModernOpt/src/modernopt.h
index 0fe6bce59f..12dc27c5c3 100644
--- a/plugins/ModernOpt/src/modernopt.h
+++ b/plugins/ModernOpt/src/modernopt.h
@@ -32,8 +32,8 @@ struct ModernOptMainPageInfo
int idcButton;
BOOL bShowTab;
int iIcon;
- TCHAR *lpzTitle;
- TCHAR *lpzDescription;
+ wchar_t *lpzTitle;
+ wchar_t *lpzDescription;
int iPageType;
BOOL bShow;
};
diff --git a/plugins/ModernOpt/src/mopt_selector.cpp b/plugins/ModernOpt/src/mopt_selector.cpp
index 7c669dd656..5e97984584 100644
--- a/plugins/ModernOpt/src/mopt_selector.cpp
+++ b/plugins/ModernOpt/src/mopt_selector.cpp
@@ -26,18 +26,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-static void sttApplySkin(MODERNOPTOBJECT *obj, TCHAR *fn)
+static void sttApplySkin(MODERNOPTOBJECT *obj, wchar_t *fn)
{
CallProtoService(obj->lpzThemeModuleName, TS_SKIN_APPLY, NULL, (LPARAM)fn);
}
-static TCHAR *sttGetActiveSkin(MODERNOPTOBJECT *obj)
+static wchar_t *sttGetActiveSkin(MODERNOPTOBJECT *obj)
{
return ProtoServiceExists(obj->lpzThemeModuleName, TS_SKIN_ACTIVE) ?
- (TCHAR*)CallProtoService(obj->lpzThemeModuleName, TS_SKIN_ACTIVE, 0, 0) : 0;
+ (wchar_t*)CallProtoService(obj->lpzThemeModuleName, TS_SKIN_ACTIVE, 0, 0) : 0;
}
-static void sttPreviewSkin(MODERNOPTOBJECT *obj, TCHAR *fn, LPDRAWITEMSTRUCT lps)
+static void sttPreviewSkin(MODERNOPTOBJECT *obj, wchar_t *fn, LPDRAWITEMSTRUCT lps)
{
if (!fn) return;
@@ -75,24 +75,24 @@ static void sttPreviewSkin(MODERNOPTOBJECT *obj, TCHAR *fn, LPDRAWITEMSTRUCT lps
struct TSkinListItem
{
- TCHAR *path;
- TCHAR *title;
- TCHAR *filename;
+ wchar_t *path;
+ wchar_t *title;
+ wchar_t *filename;
- TSkinListItem(TCHAR *fn)
+ TSkinListItem(wchar_t *fn)
{
title = mir_tstrdup(fn);
- if (TCHAR *p = _tcsrchr(title, _T('.')))
+ if (wchar_t *p = wcsrchr(title, '.'))
*p = 0;
- TCHAR curPath[MAX_PATH];
+ wchar_t curPath[MAX_PATH];
GetCurrentDirectory(_countof(curPath), curPath);
- path = (TCHAR *)mir_alloc(MAX_PATH * sizeof(TCHAR));
+ path = (wchar_t *)mir_alloc(MAX_PATH * sizeof(wchar_t));
PathToRelativeT(curPath, path);
size_t length = mir_tstrlen(curPath) + mir_tstrlen(fn) + 2;
- filename = (TCHAR *)mir_alloc(length * sizeof(TCHAR));
+ filename = (wchar_t *)mir_alloc(length * sizeof(wchar_t));
mir_sntprintf(filename, length, L"%s\\%s", curPath, fn);
}
@@ -107,7 +107,7 @@ struct TSkinListItem
struct TSelectorData
{
MODERNOPTOBJECT *obj;
- TCHAR *active;
+ wchar_t *active;
HBITMAP hbmpPreview;
TSelectorData()
@@ -121,18 +121,18 @@ struct TSelectorData
}
};
-static bool CheckExt(TCHAR *fn, TCHAR *ext, int n)
+static bool CheckExt(wchar_t *fn, wchar_t *ext, int n)
{
size_t l = mir_tstrlen(fn);
return (l > n) && !mir_tstrcmp(fn + l - n, ext);
}
-static void BuildSkinList(HWND hwndList, TCHAR *szExt, int nExtLength = -1, bool start = true)
+static void BuildSkinList(HWND hwndList, wchar_t *szExt, int nExtLength = -1, bool start = true)
{
if (start) {
- static TCHAR mirPath[MAX_PATH];
+ static wchar_t mirPath[MAX_PATH];
GetModuleFileName(NULL, mirPath, _countof(mirPath));
- if (TCHAR *p = _tcsrchr(mirPath, _T('\\'))) *p = 0;
+ if (wchar_t *p = wcsrchr(mirPath, '\\')) *p = 0;
SetCurrentDirectory(mirPath);
SendMessage(hwndList, LB_RESETCONTENT, 0, 0);
nExtLength = (int)mir_tstrlen(szExt);
@@ -168,7 +168,7 @@ static void BuildSkinList(HWND hwndList, TCHAR *szExt, int nExtLength = -1, bool
}
}
-static void CreatePreview(TSelectorData *sd, TCHAR *fn, LPDRAWITEMSTRUCT lps)
+static void CreatePreview(TSelectorData *sd, wchar_t *fn, LPDRAWITEMSTRUCT lps)
{
HDC hdc = CreateCompatibleDC(lps->hDC);
sd->hbmpPreview = CreateCompatibleBitmap(lps->hDC, lps->rcItem.right - lps->rcItem.left, lps->rcItem.bottom - lps->rcItem.top);
diff --git a/plugins/MsgPopup/src/main.cpp b/plugins/MsgPopup/src/main.cpp
index ee5b3e254a..56f1d5b2cc 100644
--- a/plugins/MsgPopup/src/main.cpp
+++ b/plugins/MsgPopup/src/main.cpp
@@ -132,7 +132,7 @@ void HookOnImport(HMODULE hModule, char *lpszImpModName, PVOID lpOrigFunc, PVOID
if (!VirtualProtect((LPVOID)ppfn, sizeof(void*), PAGE_EXECUTE_READWRITE, &oldProtect)) {
if (!g_HookError) {
- TCHAR buf[200];
+ wchar_t buf[200];
g_HookError = TRUE;
mir_sntprintf(buf, TranslateT("VirtualProtect failed. Code %d\nTry to call the author"), GetLastError());
@@ -186,8 +186,8 @@ int HookedOptions(WPARAM wParam, LPARAM)
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.ptszTitle = LPGENT("MessagePopup");
- odp.ptszGroup = LPGENT("Popups");
+ odp.pwszTitle = LPGENW("MessagePopup");
+ odp.pwszGroup = LPGENW("Popups");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pfnDlgProc = OptionsDlgProc;
Options_AddPage(wParam, &odp);
diff --git a/plugins/Msg_Export/src/FileViewer.cpp b/plugins/Msg_Export/src/FileViewer.cpp
index 40ca0e112f..ecc4f8305c 100755
--- a/plugins/Msg_Export/src/FileViewer.cpp
+++ b/plugins/Msg_Export/src/FileViewer.cpp
@@ -108,7 +108,7 @@ public:
HWND hFindDlg;
FINDREPLACE fr;
- TCHAR acFindStr[100];
+ wchar_t acFindStr[100];
bool bFirstLoad;
bool bUtf8File;
@@ -419,7 +419,7 @@ int CLStreamRTFInfo::nLoadFileStream(LPBYTE pbBuff, LONG cb)
// Developer : KN
/////////////////////////////////////////////////////////////////////
-void UpdateFileViews(const TCHAR *pszFile)
+void UpdateFileViews(const wchar_t *pszFile)
{
mir_cslock lck(csHistoryList);
@@ -469,11 +469,11 @@ bool bOpenExternaly(MCONTACT hContact)
STARTUPINFO sStartupInfo = { 0 };
GetStartupInfo(&sStartupInfo); // we parse oure owne info on
- sStartupInfo.lpTitle = (TCHAR*)sFileViewerPrg.c_str();
+ sStartupInfo.lpTitle = (wchar_t*)sFileViewerPrg.c_str();
PROCESS_INFORMATION stProcesses = { 0 };
if (!CreateProcess(NULL,
- (TCHAR*)sTmp.c_str(),
+ (wchar_t*)sTmp.c_str(),
NULL,
NULL,
FALSE,
@@ -483,7 +483,7 @@ bool bOpenExternaly(MCONTACT hContact)
&sStartupInfo,
&stProcesses))
{
- DisplayLastError(LPGENT("Failed to execute external file view"));
+ DisplayLastError(LPGENW("Failed to execute external file view"));
}
return true;
}
@@ -528,7 +528,7 @@ bool bUseInternalViewer(bool bNew)
hRichEditDll = LoadLibraryA("Msftedit.dll");
if (!hRichEditDll)
{
- DisplayLastError(LPGENT("Failed to load Rich Edit (Msftedit.dll)"));
+ DisplayLastError(LPGENW("Failed to load Rich Edit (Msftedit.dll)"));
return false;
}
}
@@ -618,7 +618,7 @@ bool bLoadFile(HWND hwndDlg, CLHistoryDlg * pclDlg)
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) {
int nDBCount = db_event_count(pclDlg->hContact);
- TCHAR szTmp[1500];
+ wchar_t szTmp[1500];
if (nDBCount == -1)
mir_sntprintf(szTmp, TranslateT("Failed to open file\r\n%s\r\n\r\nContact handle is invalid"), pclDlg->sPath.c_str());
@@ -669,7 +669,7 @@ bool bLoadFile(HWND hwndDlg, CLHistoryDlg * pclDlg)
}
CloseHandle(hFile);
- TCHAR szTmp[100];
+ wchar_t szTmp[100];
mir_sntprintf(szTmp, L"File open time %d\n", GetTickCount() - dwStart);
OutputDebugString(szTmp);
@@ -710,15 +710,15 @@ bool bAdvancedCopy(HWND hwnd)
if (OpenClipboard(NULL)) {
EmptyClipboard();
- TCHAR *pszSrcBuf = new TCHAR[nSelLenght];
+ wchar_t *pszSrcBuf = new wchar_t[nSelLenght];
pszSrcBuf[0] = 0;
SendMessage(hwnd, EM_GETSELTEXT, 0, (LPARAM)pszSrcBuf);
HANDLE hDecMem = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, nSelLenght);
- TCHAR *pszCurDec = (TCHAR*)GlobalLock(hDecMem);
+ wchar_t *pszCurDec = (wchar_t*)GlobalLock(hDecMem);
bool bInSpaces = false;
- for (TCHAR *pszCur = pszSrcBuf; pszCur[0]; pszCur++) {
+ for (wchar_t *pszCur = pszSrcBuf; pszCur[0]; pszCur++) {
if (bInSpaces) {
if (pszCur[0] == ' ')
continue;
@@ -953,19 +953,19 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam,
HMENU hSysMenu = GetSystemMenu(hwndDlg, FALSE);
InsertMenu(hSysMenu, 0, MF_SEPARATOR | MF_BYPOSITION, 0, 0);
- InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION, ID_FV_SAVE_AS_RTF, LPGENT("Save as RTF"));
+ InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION, ID_FV_SAVE_AS_RTF, LPGENW("Save as RTF"));
InsertMenu(hSysMenu, 0, MF_SEPARATOR | MF_BYPOSITION, 0, 0);
BYTE bUseCC = (BYTE)db_get_b(NULL, MODULE, szFileViewDB "UseCC", 0);
- InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION | (bUseCC ? MF_CHECKED : 0), ID_FV_COLOR, LPGENT("Color..."));
+ InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION | (bUseCC ? MF_CHECKED : 0), ID_FV_COLOR, LPGENW("Color..."));
if (bUseCC)
SendMessage(hRichEdit, EM_SETBKGNDCOLOR, 0, db_get_dw(NULL, MODULE, szFileViewDB "CustomC", RGB(255, 255, 255)));
- InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION, ID_FV_FONT, LPGENT("Font..."));
+ InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION, ID_FV_FONT, LPGENW("Font..."));
bool bUseSyntaxHL = db_get_b(NULL, MODULE, szFileViewDB "UseSyntaxHL", 1) != 0;
- InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION | (bUseSyntaxHL ? MF_CHECKED : 0), ID_FV_SYNTAX_HL, LPGENT("Syntax highlight"));
+ InsertMenu(hSysMenu, 0, MF_STRING | MF_BYPOSITION | (bUseSyntaxHL ? MF_CHECKED : 0), ID_FV_SYNTAX_HL, LPGENW("Syntax highlight"));
SetRichEditFont(hRichEdit, bUseSyntaxHL);
@@ -979,10 +979,10 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam,
bLoadFile(hwndDlg, pclDlg);
- TCHAR szFormat[200];
- TCHAR szTitle[200];
+ wchar_t szFormat[200];
+ wchar_t szTitle[200];
if (GetWindowText(hwndDlg, szFormat, _countof(szFormat))) {
- const TCHAR *pszNick = pcli->pfnGetContactDisplayName(pclDlg->hContact, 0);
+ const wchar_t *pszNick = pcli->pfnGetContactDisplayName(pclDlg->hContact, 0);
tstring sPath = pclDlg->sPath;
string::size_type n = sPath.find_last_of('\\');
if (n != sPath.npos)
@@ -1107,7 +1107,7 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam,
FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) {
- DisplayLastError(LPGENT("Failed to create file"));
+ DisplayLastError(LPGENW("Failed to create file"));
return TRUE;
}
@@ -1155,7 +1155,7 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam,
if (((NMHDR*)lParam)->code == EN_LINK) {
ENLINK* pstLink = (ENLINK*)lParam;
if (pstLink->msg == WM_LBUTTONUP) {
- TCHAR szUrl[500];
+ wchar_t szUrl[500];
if ((pstLink->chrg.cpMax - pstLink->chrg.cpMin) > (sizeof(szUrl) - 2))
return FALSE;
@@ -1209,7 +1209,7 @@ bool bShowFileViewer(MCONTACT hContact)
ShowWindow(pcl->hWnd, SW_SHOWNORMAL);
return true;
}
- DisplayLastError(LPGENT("Failed to create history dialog"));
+ DisplayLastError(LPGENW("Failed to create history dialog"));
delete pcl;
return false;
}
diff --git a/plugins/Msg_Export/src/FileViewer.h b/plugins/Msg_Export/src/FileViewer.h
index e074df6843..de58099d6d 100755
--- a/plugins/Msg_Export/src/FileViewer.h
+++ b/plugins/Msg_Export/src/FileViewer.h
@@ -19,7 +19,7 @@
#ifndef MSG_EXP_FILE_VIEWER
#define MSG_EXP_FILE_VIEWER
-void UpdateFileViews(const TCHAR *pszFile);
+void UpdateFileViews(const wchar_t *pszFile);
bool bOpenExternaly(MCONTACT hContact);
bool bShowFileViewer(MCONTACT hContact);
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp
index 41251ca214..bbcd2d8513 100755
--- a/plugins/Msg_Export/src/options.cpp
+++ b/plugins/Msg_Export/src/options.cpp
@@ -271,7 +271,7 @@ void SetToDefault(HWND hParent)
if (!hMapUser || nContacts <= 0)
return;
- TCHAR szTemp[500];
+ wchar_t szTemp[500];
if (!GetDlgItemText(hParent, IDC_DEFAULT_FILE, szTemp, _countof(szTemp)))
return;
@@ -291,7 +291,7 @@ void SetToDefault(HWND hParent)
ReplaceTimeVariables(sFileName);
sItem.mask = LVIF_TEXT;
- sItem.pszText = (TCHAR*)sFileName.c_str();
+ sItem.pszText = (wchar_t*)sFileName.c_str();
ListView_SetItem(hMapUser, &sItem);
if (!bUnaplyedChanges) {
@@ -318,7 +318,7 @@ BOOL bApplyChanges(HWND hwndDlg)
{
BOOL bTrans;
BOOL bRet = true;
- TCHAR szTemp[500];
+ wchar_t szTemp[500];
int nTmp = GetDlgItemInt(hwndDlg, IDC_MAX_CLOUMN_WIDTH, &bTrans, TRUE);
if (!bTrans || nTmp < 5) {
@@ -431,7 +431,7 @@ void ClearAllFileNames(HWND hwndDlg)
void AutoFindeFileNames(HWND hwndDlg)
{
- TCHAR szDefaultFile[500];
+ wchar_t szDefaultFile[500];
GetDlgItemText(hwndDlg, IDC_DEFAULT_FILE, szDefaultFile, _countof(szDefaultFile));
LVITEM sItem = { 0 };
@@ -439,7 +439,7 @@ void AutoFindeFileNames(HWND hwndDlg)
HWND hMapUser = GetDlgItem(hwndDlg, IDC_MAP_USER_LIST);
int nCount = ListView_GetItemCount(hMapUser);
for (int nCur = 0; nCur < nCount; nCur++) {
- TCHAR szSearch[100];
+ wchar_t szSearch[100];
sItem.pszText = szSearch;
sItem.mask = LVIF_TEXT;
sItem.iItem = nCur;
@@ -454,7 +454,7 @@ void AutoFindeFileNames(HWND hwndDlg)
for (int nSubCur = 0; nSubCur < nCount; nSubCur++) {
if (nSubCur == nCur)
continue;
- TCHAR szSubCur[100];
+ wchar_t szSubCur[100];
sItem.mask = LVIF_TEXT | LVIF_PARAM;
sItem.iItem = nSubCur;
sItem.iSubItem = 1;
@@ -462,7 +462,7 @@ void AutoFindeFileNames(HWND hwndDlg)
sItem.cchTextMax = _countof(szSubCur);
if (ListView_GetItem(hMapUser, &sItem)) {
size_t nLen = mir_tstrlen(szSubCur);
- if (_tcsncicmp(szSubCur, szSearch, nLen) == 0) {
+ if (wcsnicmp(szSubCur, szSearch, nLen) == 0) {
if (nLen < (size_t)nShortestMatch) {
nShortestMatch = (int)nLen;
nStortestIndex = nSubCur;
@@ -493,10 +493,10 @@ void AutoFindeFileNames(HWND hwndDlg)
}
if (!bPriHasFileName)
- ListView_SetItemText(hMapUser, nCur, 0, (TCHAR*)sFileName.c_str());
+ ListView_SetItemText(hMapUser, nCur, 0, (wchar_t*)sFileName.c_str());
if (!bSubHasFileName)
- ListView_SetItemText(hMapUser, nStortestIndex, 0, (TCHAR*)sFileName.c_str());
+ ListView_SetItemText(hMapUser, nStortestIndex, 0, (wchar_t*)sFileName.c_str());
if (!bUnaplyedChanges) {
bUnaplyedChanges = TRUE;
@@ -521,7 +521,7 @@ void AutoFindeFileNames(HWND hwndDlg)
void OpenHelp(HWND hwndDlg)
{
- TCHAR szPath[MAX_PATH];
+ wchar_t szPath[MAX_PATH];
if (GetModuleFileName(hInstance, szPath, _countof(szPath))) {
size_t nLen = mir_tstrlen(szPath);
if (nLen > 3) {
@@ -629,7 +629,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
sItem.lParam = hContact;
sTmp = _DBGetString(hContact, MODULE, "FileName", L"");
- sItem.pszText = (TCHAR*)sTmp.c_str();
+ sItem.pszText = (wchar_t*)sTmp.c_str();
ListView_InsertItem(hMapUser, &sItem);
sItem.mask = LVIF_TEXT;
@@ -642,7 +642,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
ListView_SetItem(hMapUser, &sItem);
DWORD dwUIN = db_get_dw(hContact, pa->szModuleName, "UIN", 0);
- TCHAR szTmp[50];
+ wchar_t szTmp[50];
mir_sntprintf(szTmp, L"%d", dwUIN);
sItem.iSubItem = 3;
sItem.pszText = szTmp;
@@ -789,10 +789,10 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
return TRUE;
case IDC_FILE_VIEWER_BROWSE:
- TCHAR szFile[260]; // buffer for file name
+ wchar_t szFile[260]; // buffer for file name
GetDlgItemText(hwndDlg, IDC_FILE_VIEWER, szFile, _countof(szFile));
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
mir_sntprintf(buf, L"%s (*.exe;*.com;*.bat;*.cmd)%c*.exe;*.com;*.bat;*.cmd%c%s (*.*)%c*.*%c%c", TranslateT("Executable files"), 0, 0, TranslateT("All files"), 0, 0, 0);
{
OPENFILENAME ofn = {}; // common dialog box structure
@@ -823,7 +823,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
}
// Allocate the Dest Dir buffer to receive browse info
- TCHAR *lpDestDir = (TCHAR *)pMalloc->Alloc(MAX_PATH + 100);
+ wchar_t *lpDestDir = (wchar_t *)pMalloc->Alloc(MAX_PATH + 100);
if (!lpDestDir) {
pMalloc->Release();
MessageBox(hwndDlg, TranslateT("Failed to Allocate buffer space"), MSG_BOX_TITEL, MB_OK);
@@ -1227,16 +1227,16 @@ int OptionsInitialize(WPARAM wParam, LPARAM /*lParam*/)
odp.hInstance = hInstance;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MSGEXPORT);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.ptszTitle = LPGENT("Message export");
- odp.ptszGroup = LPGENT("History");
- odp.ptszTab = LPGENT("General");
+ odp.pwszTitle = LPGENW("Message export");
+ odp.pwszGroup = LPGENW("History");
+ odp.pwszTab = LPGENW("General");
odp.groupPosition = 100000000;
odp.pfnDlgProc = DlgProcMsgExportOpts;
Options_AddPage(wParam, &odp);
odp.position = 100000001;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MSGEXPORT2);
- odp.ptszTab = LPGENT("Additional");
+ odp.pwszTab = LPGENW("Additional");
odp.pfnDlgProc = DlgProcMsgExportOpts2;
Options_AddPage(wParam, &odp);
return 0;
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp
index 6ef31c4135..c485229adc 100755
--- a/plugins/Msg_Export/src/utils.cpp
+++ b/plugins/Msg_Export/src/utils.cpp
@@ -19,11 +19,11 @@
#include "stdafx.h"
// Default error string used upon errors
-const TCHAR *pszGroupError = LPGENT("No_Group");
-const TCHAR *pszDbPathError = L".";
+const wchar_t *pszGroupError = LPGENW("No_Group");
+const wchar_t *pszDbPathError = L".";
// Replacement for chareteres not alowed in file names.
-const TCHAR cBadCharReplace = _T('_');
+const wchar_t cBadCharReplace = '_';
// sTimeFormat
tstring sTimeFormat;
@@ -49,7 +49,7 @@ map<tstring, string::size_type, less<tstring> > clFileTo1ColWidth;
// default line width
int nMaxLineWidth = 80;
-const TCHAR *pszReplaceList[] =
+const wchar_t *pszReplaceList[] =
{
L"%FirstName%",
L"%LastName%",
@@ -137,7 +137,7 @@ void ShowDebugInfo()
// Developer : KN
/////////////////////////////////////////////////////////////////////
-int nGetFormatCount(const TCHAR *pszToCheck)
+int nGetFormatCount(const wchar_t *pszToCheck)
{
if (!pszToCheck || pszToCheck[0] == 0)
return 0;
@@ -192,12 +192,12 @@ tstring sGetErrorString()
return sGetErrorString(GetLastError());
}
-void DisplayLastError(const TCHAR *pszError)
+void DisplayLastError(const wchar_t *pszError)
{
tstring sError = pszError;
DWORD error = GetLastError();
- TCHAR szTemp[50];
+ wchar_t szTemp[50];
mir_sntprintf(szTemp, L"\r\nErrorCode: %d\r\n", error);
sError += szTemp;
sError += sGetErrorString(error);
@@ -220,7 +220,7 @@ void DisplayLastError(const TCHAR *pszError)
// Developer : KN
/////////////////////////////////////////////////////////////////////
-tstring _DBGetStringW(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *pszError)
+tstring _DBGetStringW(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *pszError)
{
tstring ret;
DBVARIANT dbv = { 0 };
@@ -230,7 +230,7 @@ tstring _DBGetStringW(MCONTACT hContact, const char *szModule, const char *szSet
MessageBox(NULL, TranslateT("Database: Attempt to get wrong type of value, string"), MSG_BOX_TITEL, MB_OK);
ret = pszError;
}
- else ret = (TCHAR*)dbv.pszVal;
+ else ret = (wchar_t*)dbv.pszVal;
}
else ret = pszError;
@@ -270,7 +270,7 @@ string _DBGetStringA(MCONTACT hContact, const char *szModule, const char *szSett
// Developer : KN
/////////////////////////////////////////////////////////////////////
-void ReplaceAll(tstring &sSrc, const TCHAR *pszReplace, const tstring &sNew)
+void ReplaceAll(tstring &sSrc, const wchar_t *pszReplace, const tstring &sNew)
{
string::size_type nCur = 0;
while ((nCur = sSrc.find(pszReplace, nCur)) != sSrc.npos) {
@@ -279,7 +279,7 @@ void ReplaceAll(tstring &sSrc, const TCHAR *pszReplace, const tstring &sNew)
}
}
-void ReplaceAll(tstring &sSrc, const TCHAR *pszReplace, const TCHAR *pszNew)
+void ReplaceAll(tstring &sSrc, const wchar_t *pszReplace, const wchar_t *pszNew)
{
tstring sNew = pszNew;
ReplaceAll(sSrc, pszReplace, sNew);
@@ -364,10 +364,10 @@ bool bWriteToFile(HANDLE hFile, const char *pszSrc, int nLen = -1)
// Developer : KN
/////////////////////////////////////////////////////////////////////
-static bool bWriteTextToFile(HANDLE hFile, const TCHAR *pszSrc, bool bUtf8File, int nLen = -1)
+static bool bWriteTextToFile(HANDLE hFile, const wchar_t *pszSrc, bool bUtf8File, int nLen = -1)
{
if (nLen != -1) {
- TCHAR *tmp = (TCHAR*)alloca(sizeof(TCHAR)*(nLen + 1));
+ wchar_t *tmp = (wchar_t*)alloca(sizeof(wchar_t)*(nLen + 1));
mir_tstrncpy(tmp, pszSrc, nLen + 1);
pszSrc = tmp;
}
@@ -463,7 +463,7 @@ bool bWriteHexToFile(HANDLE hFile, void * pData, int nSize)
bool bReadMirandaDirAndPath()
{
- TCHAR szDBPath[MAX_PATH], tmp[MAX_PATH];
+ wchar_t szDBPath[MAX_PATH], tmp[MAX_PATH];
mir_tstrcpy(szDBPath, pszDbPathError);
PathToAbsoluteT(L"miranda32.exe", tmp);
sMirandaPath = tmp;
@@ -537,7 +537,7 @@ tstring GetFilePathFromUser(MCONTACT hContact)
// Here we will try to avoide the (Unknown Contact) in cases where the protocol for
// this user has been removed.
- if (bNickUsed && (_tcsstr(pcli->pfnGetContactDisplayName(hContact, 0), LPGENT("(Unknown Contact)")) != 0))
+ if (bNickUsed && (wcsstr(pcli->pfnGetContactDisplayName(hContact, 0), LPGENW("(Unknown Contact)")) != 0))
return sPrevFileName; // Then the filename must have changed from a correct path to one including the (Unknown Contact)
// file name has changed
@@ -555,7 +555,7 @@ tstring GetFilePathFromUser(MCONTACT hContact)
if (hPrevFile != INVALID_HANDLE_VALUE) {
CloseHandle(hPrevFile);
- TCHAR szTemp[500];
+ wchar_t szTemp[500];
// There is a previous file we can move
// ask user ?
bool bTryRename;
@@ -640,10 +640,10 @@ tstring FileNickFromHandle(MCONTACT hContact)
// Developer : KN
/////////////////////////////////////////////////////////////////////
-void ReplaceAllNoColon(tstring &sSrc, const TCHAR *pszReplace, tstring &sNew)
+void ReplaceAllNoColon(tstring &sSrc, const wchar_t *pszReplace, tstring &sNew)
{
tstring::size_type nCur = 0;
- while ((nCur = sNew.find_first_of(_T(':'), nCur)) != sNew.npos)
+ while ((nCur = sNew.find_first_of(':', nCur)) != sNew.npos)
sNew[nCur] = cBadCharReplace;
ReplaceAll(sSrc, pszReplace, sNew);
}
@@ -678,7 +678,7 @@ void ReplaceDefines(MCONTACT hContact, tstring & sTarget)
DWORD dwUIN = db_get_dw(hContact, sProto.c_str(), "UIN", 0);
tstring sReplaceUin;
if (dwUIN) {
- TCHAR sTmp[20];
+ wchar_t sTmp[20];
mir_sntprintf(sTmp, L"%d", dwUIN);
sReplaceUin = sTmp;
}
@@ -759,7 +759,7 @@ void ReplaceTimeVariables(tstring &sRet)
sRet.find(L"%day%") != string::npos) {
SYSTEMTIME stTime;
GetLocalTime(&stTime);
- TCHAR sTmp[20];
+ wchar_t sTmp[20];
mir_sntprintf(sTmp, L"%d", stTime.wYear);
ReplaceAll(sRet, L"%year%", sTmp);
@@ -810,7 +810,7 @@ void UpdateFileToColWidth()
// Developer : KN
/////////////////////////////////////////////////////////////////////
-void DisplayErrorDialog(const TCHAR *pszError, tstring& sFilePath, DBEVENTINFO * dbei)
+void DisplayErrorDialog(const wchar_t *pszError, tstring& sFilePath, DBEVENTINFO * dbei)
{
tstring sError = TranslateTS(pszError);
sError += sFilePath;
@@ -820,7 +820,7 @@ void DisplayErrorDialog(const TCHAR *pszError, tstring& sFilePath, DBEVENTINFO *
sError += TranslateT("Do you wish to save debug information?");
if (MessageBox(NULL, sError.c_str(), MSG_BOX_TITEL, MB_YESNO) == IDYES) {
OPENFILENAME ofn; // common dialog box structure
- TCHAR szFile[260]; // buffer for file name
+ wchar_t szFile[260]; // buffer for file name
mir_tstrcpy(szFile, L"DebugInfo.txt");
// Initialize OPENFILENAME
@@ -879,7 +879,7 @@ void DisplayErrorDialog(const TCHAR *pszError, tstring& sFilePath, DBEVENTINFO *
void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei)
{
- TCHAR szTemp[500];
+ wchar_t szTemp[500];
tstring sFilePath = GetFilePathFromUser(hContact);
GetLastError();// Clear last error !!
@@ -894,7 +894,7 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei)
}
if (hFile == INVALID_HANDLE_VALUE) {
- DisplayErrorDialog(LPGENT("Failed to open or create file :\n"), sFilePath, NULL);
+ DisplayErrorDialog(LPGENW("Failed to open or create file :\n"), sFilePath, NULL);
return;
}
@@ -931,7 +931,7 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei)
if (dwPtr == INVALID_SET_FILE_POINTER) {
// we need to aborte mission here because if we continue we risk
// overwriting old log.
- DisplayErrorDialog(LPGENT("Failed to move to the end of the file :\n"), sFilePath, NULL);
+ DisplayErrorDialog(LPGENW("Failed to move to the end of the file :\n"), sFilePath, NULL);
CloseHandle(hFile);
return;
}
@@ -940,27 +940,27 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei)
bWriteUTF8Format = bUseUtf8InNewFiles;
if (bWriteUTF8Format) {
if (!bWriteToFile(hFile, szUtf8ByteOrderHeader, sizeof(szUtf8ByteOrderHeader) - 1)) {
- DisplayErrorDialog(LPGENT("Failed to UTF8 byte order code to file :\n"), sFilePath, NULL);
+ DisplayErrorDialog(LPGENW("Failed to UTF8 byte order code to file :\n"), sFilePath, NULL);
CloseHandle(hFile);
return;
}
}
tstring output = L"------------------------------------------------\r\n"
- LPGENT(" History for\r\n")
- LPGENT("User : %User%\r\n")
- LPGENT("Protocol : %Proto%\r\n")
- LPGENT("UIN : %UIN%\r\n")
- LPGENT("FirstName : %FirstName%\r\n")
- LPGENT("LastName : %LastName%\r\n")
- LPGENT("Age : %Age%\r\n")
- LPGENT("Gender : %Gender%\r\n")
- LPGENT("e-mail : %e-mail%\r\n")
- LPGENT("Nick : %Nick%\r\n")
- LPGENT("City : %City%\r\n")
- LPGENT("State : %State%\r\n")
- LPGENT("Phone : %Phone%\r\n")
- LPGENT("Homepage : %Homepage%\r\n")
- LPGENT("- About -\r\n%About%\r\n")
+ LPGENW(" History for\r\n")
+ LPGENW("User : %User%\r\n")
+ LPGENW("Protocol : %Proto%\r\n")
+ LPGENW("UIN : %UIN%\r\n")
+ LPGENW("FirstName : %FirstName%\r\n")
+ LPGENW("LastName : %LastName%\r\n")
+ LPGENW("Age : %Age%\r\n")
+ LPGENW("Gender : %Gender%\r\n")
+ LPGENW("e-mail : %e-mail%\r\n")
+ LPGENW("Nick : %Nick%\r\n")
+ LPGENW("City : %City%\r\n")
+ LPGENW("State : %State%\r\n")
+ LPGENW("Phone : %Phone%\r\n")
+ LPGENW("Homepage : %Homepage%\r\n")
+ LPGENW("- About -\r\n%About%\r\n")
L"------------------------------------------------\r\n";
// This is written this way because I expect this will become a string the user may set
@@ -980,12 +980,12 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei)
mir_sntprintf(szTemp, L"%d", db_get_w(hContact, sProto.c_str(), "Age", 0));
ReplaceAll(output, L"%Age%", szTemp);
- szTemp[0] = (TCHAR)db_get_b(hContact, sProto.c_str(), "Gender", 0);
+ szTemp[0] = (wchar_t)db_get_b(hContact, sProto.c_str(), "Gender", 0);
szTemp[1] = 0;
ReplaceAll(output, L"%Gender%", szTemp);
if (!bWriteTextToFile(hFile, output.data(), bWriteUTF8Format, (int)output.size())) {
- DisplayErrorDialog(LPGENT("Failed to write user details to file :\n"), sFilePath, NULL);
+ DisplayErrorDialog(LPGENW("Failed to write user details to file :\n"), sFilePath, NULL);
CloseHandle(hFile);
return;
}
@@ -1002,7 +1002,7 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei)
// Write first part of line with name and timestamp
if (!bWriteTextToFile(hFile, szTemp, bWriteUTF8Format, nIndent)) {
- DisplayErrorDialog(LPGENT("Failed to write timestamp and username to file :\n"), sFilePath, &dbei);
+ DisplayErrorDialog(LPGENW("Failed to write timestamp and username to file :\n"), sFilePath, &dbei);
CloseHandle(hFile);
return;
}
@@ -1013,9 +1013,9 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei)
switch (dbei.eventType) {
case EVENTTYPE_MESSAGE:
{
- TCHAR *msg = DbGetEventTextT(&dbei, CP_ACP);
+ wchar_t *msg = DbGetEventTextT(&dbei, CP_ACP);
if (!bWriteIndentedToFile(hFile, nIndent, msg, bWriteUTF8Format)) {
- DisplayErrorDialog(LPGENT("Failed to write message to the file :\n"), sFilePath, &dbei);
+ DisplayErrorDialog(LPGENW("Failed to write message to the file :\n"), sFilePath, &dbei);
}
mir_free(msg);
}
@@ -1024,15 +1024,15 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei)
case EVENTTYPE_URL:
case EVENTTYPE_FILE:
{
- const TCHAR *pszType;
+ const wchar_t *pszType;
const char *pszData;
if (dbei.eventType == EVENTTYPE_URL) {
- pszType = LPGENT("URL: ");
+ pszType = LPGENW("URL: ");
pszData = (char *)dbei.pBlob;
}
else {
- pszType = LPGENT("File: ");
+ pszType = LPGENW("File: ");
pszData = (char *)(dbei.pBlob + sizeof(DWORD));
}
@@ -1050,7 +1050,7 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei)
nLen = (int)mir_strlen(pszData);
if ((pszData - (char *)dbei.pBlob) + nLen < (int)dbei.cbBlob) {
if (bWriteNewLine(hFile, nIndent) &&
- bWriteTextToFile(hFile, LPGENT("Description: "), bWriteUTF8Format) &&
+ bWriteTextToFile(hFile, LPGENW("Description: "), bWriteUTF8Format) &&
bWriteIndentedToFile(hFile, nIndent, pszData, bWriteUTF8Format)) {
bWriteOk = true;
}
@@ -1060,48 +1060,48 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei)
}
if (!bWriteOk)
- DisplayErrorDialog(LPGENT("Failed to write URL/File to the file :\n"), sFilePath, &dbei);
+ DisplayErrorDialog(LPGENW("Failed to write URL/File to the file :\n"), sFilePath, &dbei);
}
break;
case EVENTTYPE_AUTHREQUEST:
case EVENTTYPE_ADDED:
{
- const TCHAR *pszTypes[] = {
- LPGENT("Nick :"),
- LPGENT("FirstName :"),
- LPGENT("LastName :"),
- LPGENT("e-mail :"),
- LPGENT("Reason :") };
+ const wchar_t *pszTypes[] = {
+ LPGENW("Nick :"),
+ LPGENW("FirstName :"),
+ LPGENW("LastName :"),
+ LPGENW("e-mail :"),
+ LPGENW("Reason :") };
if (dbei.cbBlob < 8 || dbei.cbBlob > 5000) {
int n = mir_sntprintf(szTemp, TranslateT("Invalid Database event received. Type %d, size %d"), dbei.eventType, dbei.cbBlob);
if (!bWriteTextToFile(hFile, szTemp, bWriteUTF8Format, n))
- DisplayErrorDialog(LPGENT("Failed to write Invalid Database event the file :\n"), sFilePath, &dbei);
+ DisplayErrorDialog(LPGENW("Failed to write Invalid Database event the file :\n"), sFilePath, &dbei);
break;
}
bool bWriteOk = false;
int nStringCount;
- const TCHAR *pszTitle;
+ const wchar_t *pszTitle;
char *pszCurBlobPos;
if (dbei.eventType == EVENTTYPE_AUTHREQUEST) { // request
//blob is: uin(DWORD), hContact(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ)
nStringCount = 5;
pszCurBlobPos = (char *)dbei.pBlob + sizeof(DWORD) * 2;
- pszTitle = LPGENT("The following user made an authorization request:");
+ pszTitle = LPGENW("The following user made an authorization request:");
}
else { // Added
//blob is: uin(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ)
pszCurBlobPos = (char *)dbei.pBlob + sizeof(DWORD);
nStringCount = 4;
- pszTitle = LPGENT("The following user added you to their contact list:");
+ pszTitle = LPGENW("The following user added you to their contact list:");
}
if (bWriteTextToFile(hFile, pszTitle, bWriteUTF8Format) &&
bWriteNewLine(hFile, nIndent) &&
- bWriteTextToFile(hFile, LPGENT("UIN :"), bWriteUTF8Format)) {
+ bWriteTextToFile(hFile, LPGENW("UIN :"), bWriteUTF8Format)) {
DWORD uin = *((PDWORD)(dbei.pBlob));
int n = mir_sntprintf(szTemp, L"%d", uin);
if (bWriteTextToFile(hFile, szTemp, bWriteUTF8Format, n)) {
@@ -1122,7 +1122,7 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei)
}
if (!bWriteOk)
- DisplayErrorDialog(LPGENT("Failed to write AUTHREQUEST or ADDED to the file :\n"), sFilePath, &dbei);
+ DisplayErrorDialog(LPGENW("Failed to write AUTHREQUEST or ADDED to the file :\n"), sFilePath, &dbei);
}
break;
@@ -1145,9 +1145,9 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei)
const char* pszStr = (const char*)dbei.pBlob;
if (dbei.eventType == ICQEVENTTYPE_EMAILEXPRESS)
- bWriteTextToFile(hFile, LPGENT("EmailExpress from:"), bWriteUTF8Format);
+ bWriteTextToFile(hFile, LPGENW("EmailExpress from:"), bWriteUTF8Format);
else
- bWriteTextToFile(hFile, LPGENT("WebPager from:"), bWriteUTF8Format);
+ bWriteTextToFile(hFile, LPGENW("WebPager from:"), bWriteUTF8Format);
bWriteNewLine(hFile, nIndent);
@@ -1163,24 +1163,24 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei)
bWriteTextToFile(hFile, L">", bWriteUTF8Format);
}
}
- else bWriteTextToFile(hFile, LPGENT("No from address"), bWriteUTF8Format);
+ else bWriteTextToFile(hFile, LPGENW("No from address"), bWriteUTF8Format);
if (!bWriteNewLine(hFile, nIndent) ||
!bWriteIndentedToFile(hFile, nIndent, pszStr, bWriteUTF8Format)) {
- DisplayErrorDialog(LPGENT("Failed to write EmailExpress to the file :\n"), sFilePath, &dbei);
+ DisplayErrorDialog(LPGENW("Failed to write EmailExpress to the file :\n"), sFilePath, &dbei);
}
}
break;
case ICQEVENTTYPE_SMS:
if (!bWriteIndentedToFile(hFile, nIndent, (const char*)dbei.pBlob, bWriteUTF8Format))
- DisplayErrorDialog(LPGENT("Failed to write SMS to the file :\n"), sFilePath, &dbei);
+ DisplayErrorDialog(LPGENW("Failed to write SMS to the file :\n"), sFilePath, &dbei);
break;
default:
int n = mir_sntprintf(szTemp, TranslateT("Unknown event type %d, size %d"), dbei.eventType, dbei.cbBlob);
if (!bWriteTextToFile(hFile, szTemp, bWriteUTF8Format, n))
- DisplayErrorDialog(LPGENT("Failed to write Unknown event to the file :\n"), sFilePath, &dbei);
+ DisplayErrorDialog(LPGENW("Failed to write Unknown event to the file :\n"), sFilePath, &dbei);
break;
}
}
@@ -1267,7 +1267,7 @@ bool bWriteIndentedToFile(HANDLE hFile, int nIndent, const char *pszSrc, bool bU
// Developer : KN
/////////////////////////////////////////////////////////////////////
-bool bWriteIndentedToFile(HANDLE hFile, int nIndent, const TCHAR *pszSrc, bool bUtf8File)
+bool bWriteIndentedToFile(HANDLE hFile, int nIndent, const wchar_t *pszSrc, bool bUtf8File)
{
if (pszSrc == NULL)
return true;
@@ -1278,14 +1278,14 @@ bool bWriteIndentedToFile(HANDLE hFile, int nIndent, const TCHAR *pszSrc, bool b
while (*pszSrc) { // first we will scan forward in string to finde either new line or "max line with"
int nLineLen = 0;
do {
- if (pszSrc[nLineLen] == _T('\n') || pszSrc[nLineLen] == _T('\r'))
+ if (pszSrc[nLineLen] == '\n' || pszSrc[nLineLen] == '\r')
break;
if (nLineLen >= nMaxLineWidth) { // ok the line was not broken. we need to force a break
// we will scan backwards again to finde a space !!
// then we will look for a ? and so on.
- const TCHAR ac[] = { _T(' '), _T('?'), _T('-'), _T('.'), _T(',') };
+ const wchar_t ac[] = { ' ', '?', '-', '.', ',' };
for (int y = 0; y < _countof(ac); y++) {
for (int n = nLineLen; n > 0; n--) {
if (pszSrc[n] == ac[y]) {
@@ -1319,9 +1319,9 @@ bool bWriteIndentedToFile(HANDLE hFile, int nIndent, const TCHAR *pszSrc, bool b
// skip any noice chars, MAC style '\r' '\r' '\n'
// and excess spaces
- const TCHAR *pszPrev = pszSrc;
+ const wchar_t *pszPrev = pszSrc;
pszSrc += nLineLen;
- while (*pszSrc == _T(' ') || *pszSrc == _T('\n') || *pszSrc == _T('\r'))
+ while (*pszSrc == ' ' || *pszSrc == '\n' || *pszSrc == '\r')
pszSrc++;
if (pszPrev == pszSrc) {
@@ -1379,7 +1379,7 @@ int nContactDeleted(WPARAM wparam, LPARAM /*lparam*/)
if (hPrevFile != INVALID_HANDLE_VALUE) {
CloseHandle(hPrevFile);
- TCHAR szTemp[500];
+ wchar_t szTemp[500];
mir_sntprintf(szTemp, L"%s\r\n%s",
TranslateT("User has been deleted. Do you want to delete the file?"), sFilePath.c_str());
@@ -1431,8 +1431,8 @@ void SaveSettings()
/////////////////////////////////////////////////////////////////////
-TCHAR* GetMyOwnNick(MCONTACT hContact)
+wchar_t* GetMyOwnNick(MCONTACT hContact)
{
- TCHAR *p = Contact_GetInfo(CNF_DISPLAY, NULL, GetContactProto(hContact));
+ wchar_t *p = Contact_GetInfo(CNF_DISPLAY, NULL, GetContactProto(hContact));
return (p != NULL) ? p : mir_tstrdup(TranslateT("No_Nick"));
}
diff --git a/plugins/Msg_Export/src/utils.h b/plugins/Msg_Export/src/utils.h
index ac567f8808..f7bf70efc8 100755
--- a/plugins/Msg_Export/src/utils.h
+++ b/plugins/Msg_Export/src/utils.h
@@ -47,9 +47,9 @@ extern bool bReplaceHistory;
tstring sGetErrorString(DWORD dwError);
tstring sGetErrorString();
-void DisplayLastError(const TCHAR *pszError);
+void DisplayLastError(const wchar_t *pszError);
-TCHAR *CheckedTranslate(const TCHAR *szEng, int nFormatCount = -1);
+wchar_t *CheckedTranslate(const wchar_t *szEng, int nFormatCount = -1);
void SaveSettings();
void ShowDebugInfo();
@@ -57,13 +57,13 @@ void ShowDebugInfo();
int nExportEvent(WPARAM wparam, LPARAM lparam);
int nContactDeleted(WPARAM wparam, LPARAM lparam);
-TCHAR* GetMyOwnNick(MCONTACT hContact);
+wchar_t* GetMyOwnNick(MCONTACT hContact);
-tstring __inline _DBGetStringW(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *pszError);
+tstring __inline _DBGetStringW(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *pszError);
string __inline _DBGetStringA(MCONTACT hContact, const char *szModule, const char *szSetting, const char *pszError);
-void ReplaceAll(tstring &sSrc, const TCHAR *pszReplace, const tstring &sNew);
-void ReplaceAll(tstring &sSrc, const TCHAR *pszReplace, const TCHAR *pszNew);
+void ReplaceAll(tstring &sSrc, const wchar_t *pszReplace, const tstring &sNew);
+void ReplaceAll(tstring &sSrc, const wchar_t *pszReplace, const wchar_t *pszNew);
void UpdateFileToColWidth();
@@ -76,7 +76,7 @@ void ReplaceTimeVariables(tstring &sRet);
bool bCreatePathToFile(tstring sFilePath);
bool bWriteIndentedToFile(HANDLE hFile, int nIndent, const char *pszSrc, bool bUtf8File);
-bool bWriteIndentedToFile(HANDLE hFile, int nIndent, const TCHAR *pszSrc, bool bUtf8File);
+bool bWriteIndentedToFile(HANDLE hFile, int nIndent, const wchar_t *pszSrc, bool bUtf8File);
bool bWriteNewLine(HANDLE hFile, DWORD dwIndent);
bool bIsUtf8Header(BYTE * pucByteOrder);
diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp
index 838c398f46..c9b2a1b0ea 100644
--- a/plugins/MyDetails/src/data.cpp
+++ b/plugins/MyDetails/src/data.cpp
@@ -52,7 +52,7 @@ void DeInitProtocolData()
// Protocol Class ///////////////////////////////////////////////////////////////////////////////////////////
-Protocol::Protocol(const char *aName, const TCHAR *descr)
+Protocol::Protocol(const char *aName, const wchar_t *descr)
{
mir_strncpy(name, aName, _countof(name));
mir_tstrncpy(description, descr, _countof(description));
@@ -84,7 +84,7 @@ Protocol::~Protocol()
{
}
-void Protocol::lcopystr(TCHAR *dest, TCHAR *src, size_t maxlen)
+void Protocol::lcopystr(wchar_t *dest, wchar_t *src, size_t maxlen)
{
if (mir_tstrcmp(dest, src) != 0) {
data_changed = true;
@@ -110,7 +110,7 @@ int Protocol::GetStatus()
// check if protocol supports custom status
CUSTOM_STATUS css = { sizeof(css) };
- TCHAR tszXStatusName[256], tszXStatusMessage[1024];
+ wchar_t tszXStatusName[256], tszXStatusMessage[1024];
if (ProtoServiceExists(name, PS_GETCUSTOMSTATUSEX)) {
// check if custom status is set
css.flags = CSSF_TCHAR | CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE | CSSF_DEFAULT_NAME;
@@ -128,11 +128,11 @@ int Protocol::GetStatus()
custom_status = 0;
if (custom_status == 0) {
- TCHAR *tmp = pcli->pfnGetStatusModeDescription(status, 0);
+ wchar_t *tmp = pcli->pfnGetStatusModeDescription(status, 0);
lcopystr(status_name, tmp, _countof(status_name));
}
else {
- TCHAR *p = (tszXStatusName[0] != 0) ? TranslateTS(tszXStatusName) : TranslateT("<no status name>");
+ wchar_t *p = (tszXStatusName[0] != 0) ? TranslateTS(tszXStatusName) : TranslateT("<no status name>");
if (tszXStatusMessage[0])
mir_sntprintf(status_name, L"%s: %s", p, tszXStatusMessage);
else
@@ -168,7 +168,7 @@ void Protocol::SetStatus(int aStatus)
pse[0]->status = aStatus;
pse[0]->szName = name;
- TCHAR status_msg[256];
+ wchar_t status_msg[256];
GetStatusMsg(aStatus, status_msg, _countof(status_msg));
pse[0]->szMsg = status_msg;
@@ -182,7 +182,7 @@ void Protocol::SetStatus(int aStatus)
CallProtoService(name, PS_SETSTATUS, aStatus, 0);
if (CanSetStatusMsg(aStatus)) {
- TCHAR status_msg[MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE];
+ wchar_t status_msg[MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE];
GetStatusMsg(aStatus, status_msg, _countof(status_msg));
SetStatusMsg(aStatus, status_msg);
}
@@ -209,32 +209,32 @@ bool Protocol::CanSetStatusMsg(int aStatus)
return CanGetStatusMsg(aStatus);
}
-void Protocol::GetStatusMsg(int aStatus, TCHAR *msg, size_t msg_size)
+void Protocol::GetStatusMsg(int aStatus, wchar_t *msg, size_t msg_size)
{
if (!CanGetStatusMsg())
lcopystr(msg, L"", msg_size);
else if (aStatus == status && ProtoServiceExists(name, PS_GETMYAWAYMSG)) {
- ptrT tmp((TCHAR *)CallProtoService(name, PS_GETMYAWAYMSG, 0, SGMA_TCHAR));
+ ptrT tmp((wchar_t *)CallProtoService(name, PS_GETMYAWAYMSG, 0, SGMA_TCHAR));
lcopystr(msg, tmp == NULL ? L"" : tmp, msg_size);
}
else if (ServiceExists(MS_AWAYMSG_GETSTATUSMSGT)) {
- ptrT tmp((TCHAR *)CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)aStatus, (LPARAM)name));
+ ptrT tmp((wchar_t *)CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)aStatus, (LPARAM)name));
lcopystr(msg, tmp == NULL ? L"" : tmp, msg_size);
}
}
-TCHAR* Protocol::GetStatusMsg()
+wchar_t* Protocol::GetStatusMsg()
{
GetStatusMsg(status, status_message, _countof(status_message));
return status_message;
}
-void Protocol::SetStatusMsg(const TCHAR *message)
+void Protocol::SetStatusMsg(const wchar_t *message)
{
SetStatusMsg(GetStatus(), message);
}
-void Protocol::SetStatusMsg(int aStatus, const TCHAR *message)
+void Protocol::SetStatusMsg(int aStatus, const wchar_t *message)
{
if (!CanSetStatusMsg(aStatus))
return;
@@ -284,7 +284,7 @@ int Protocol::GetNickMaxLength()
return ret;
}
-TCHAR* Protocol::GetNick()
+wchar_t* Protocol::GetNick()
{
ptrT nick(Contact_GetInfo(CNF_DISPLAY, NULL, name));
lcopystr(nickname, (nick != NULL) ? nick : L"", _countof(nickname));
@@ -296,7 +296,7 @@ bool Protocol::CanSetNick()
return can_set_nick;
}
-void Protocol::SetNick(const TCHAR *nick)
+void Protocol::SetNick(const wchar_t *nick)
{
// See if can get one
if (!CanSetNick())
@@ -314,7 +314,7 @@ bool Protocol::CanSetAvatar()
return g_bAvsExist && CallService(MS_AV_CANSETMYAVATAR, (WPARAM)name, 0);
}
-void Protocol::SetAvatar(const TCHAR *file_name)
+void Protocol::SetAvatar(const wchar_t *file_name)
{
if (CanSetAvatar())
CallService(MS_AV_SETMYAVATART, (WPARAM)name, (LPARAM)file_name);
@@ -335,7 +335,7 @@ bool Protocol::ListeningToEnabled()
return CanSetListeningTo() && CallService(MS_LISTENINGTO_ENABLED, (WPARAM)name, 0) != 0;
}
-TCHAR *Protocol::GetListeningTo()
+wchar_t *Protocol::GetListeningTo()
{
if (!CanGetListeningTo()) {
lcopystr(listening_to, L"", _countof(listening_to));
@@ -445,7 +445,7 @@ bool ProtocolArray::CanSetAvatars()
return g_bAvsExist;
}
-void ProtocolArray::SetAvatars(const TCHAR *file_name)
+void ProtocolArray::SetAvatars(const wchar_t *file_name)
{
if (!CanSetAvatars())
return;
@@ -453,7 +453,7 @@ void ProtocolArray::SetAvatars(const TCHAR *file_name)
CallService(MS_AV_SETMYAVATART, NULL, (WPARAM)file_name);
}
-void ProtocolArray::SetNicks(const TCHAR *nick)
+void ProtocolArray::SetNicks(const wchar_t *nick)
{
if (nick == NULL || nick[0] == '\0')
return;
@@ -472,13 +472,13 @@ void ProtocolArray::SetStatus(int aStatus)
CallService(MS_CLIST_SETSTATUSMODE, aStatus, 0);
}
-void ProtocolArray::SetStatusMsgs(const TCHAR *message)
+void ProtocolArray::SetStatusMsgs(const wchar_t *message)
{
for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_IDLE; i++)
SetStatusMsgs(i, message);
}
-void ProtocolArray::SetStatusMsgs(int status, const TCHAR *message)
+void ProtocolArray::SetStatusMsgs(int status, const wchar_t *message)
{
db_set_ts(NULL, "SRAway", StatusModeToDbSetting(status, "Msg"), message);
@@ -509,19 +509,19 @@ void ProtocolArray::GetDefaultAvatar()
default_avatar_file[0] = '\0';
}
-TCHAR *ProtocolArray::GetDefaultStatusMsg()
+wchar_t *ProtocolArray::GetDefaultStatusMsg()
{
return GetDefaultStatusMsg(CallService(MS_CLIST_GETSTATUSMODE, 0, 0));
}
-TCHAR *ProtocolArray::GetDefaultStatusMsg(int status)
+wchar_t *ProtocolArray::GetDefaultStatusMsg(int status)
{
default_status_message[0] = '\0';
if (status == ID_STATUS_CONNECTING)
status = ID_STATUS_OFFLINE;
- TCHAR *tmp = (TCHAR *)CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)status, 0);
+ wchar_t *tmp = (wchar_t *)CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)status, 0);
if (tmp != NULL) {
mir_tstrncpy(default_status_message, tmp, _countof(default_status_message));
mir_free(tmp);
diff --git a/plugins/MyDetails/src/data.h b/plugins/MyDetails/src/data.h
index 6af422d56d..5f70525f38 100644
--- a/plugins/MyDetails/src/data.h
+++ b/plugins/MyDetails/src/data.h
@@ -34,18 +34,18 @@ protected:
bool can_have_listening_to;
int PF3;
- void lcopystr(TCHAR *dest, TCHAR *src, size_t maxlen);
+ void lcopystr(wchar_t *dest, wchar_t *src, size_t maxlen);
public:
// Name of protocol
char name[256];
- TCHAR description[256];
- TCHAR nickname[256];
- TCHAR status_name[256];
- TCHAR status_message[1024];
- TCHAR listening_to[1024];
+ wchar_t description[256];
+ wchar_t nickname[256];
+ wchar_t status_name[256];
+ wchar_t status_message[1024];
+ wchar_t listening_to[1024];
AVATARCACHEENTRY *ace;
- TCHAR avatar_file[1024];
+ wchar_t avatar_file[1024];
HBITMAP avatar_bmp;
int status;
int custom_status;
@@ -57,7 +57,7 @@ public:
// Methods ///////////////
- Protocol(const char *name, const TCHAR *descr);
+ Protocol(const char *name, const wchar_t *descr);
~Protocol();
bool IsValid();
@@ -70,27 +70,27 @@ public:
void GetAvatar(); // Copy to cache
bool CanSetAvatar();
- void SetAvatar(const TCHAR *file_name);
+ void SetAvatar(const wchar_t *file_name);
//void SetAvatar(const char *file_name, HBITMAP hBmp);
- TCHAR *GetNick(); // Copy to cache and return a copy
+ wchar_t *GetNick(); // Copy to cache and return a copy
int GetNickMaxLength();
bool CanSetNick();
- void SetNick(const TCHAR *nick);
+ void SetNick(const wchar_t *nick);
bool CanGetListeningTo();
bool CanSetListeningTo();
bool ListeningToEnabled();
- TCHAR *GetListeningTo(); // Copy to cache and return a copy
+ wchar_t *GetListeningTo(); // Copy to cache and return a copy
bool CanGetStatusMsg();
bool CanGetStatusMsg(int aStatus);
- TCHAR *GetStatusMsg(); // Copy to cache and return a copy
- void GetStatusMsg(int aStatus, TCHAR *msg, size_t msg_size);
+ wchar_t *GetStatusMsg(); // Copy to cache and return a copy
+ void GetStatusMsg(int aStatus, wchar_t *msg, size_t msg_size);
bool CanSetStatusMsg();
bool CanSetStatusMsg(int aStatus);
- void SetStatusMsg(const TCHAR *message);
- void SetStatusMsg(int aStatus, const TCHAR *message);
+ void SetStatusMsg(const wchar_t *message);
+ void SetStatusMsg(int aStatus, const wchar_t *message);
};
@@ -103,9 +103,9 @@ protected:
int buffer_len;
public:
- TCHAR default_nick[256];
- TCHAR default_avatar_file[256];
- TCHAR default_status_message[256];
+ wchar_t default_nick[256];
+ wchar_t default_avatar_file[256];
+ wchar_t default_status_message[256];
// Methods ///////////////
@@ -120,14 +120,14 @@ public:
void GetAvatars();
bool CanSetAvatars();
- void SetAvatars(const TCHAR *file);
+ void SetAvatars(const wchar_t *file);
- void SetNicks(const TCHAR *nick);
+ void SetNicks(const wchar_t *nick);
void SetStatus(int aStatus);
- void SetStatusMsgs(const TCHAR *message);
- void SetStatusMsgs(int status, const TCHAR *message);
+ void SetStatusMsgs(const wchar_t *message);
+ void SetStatusMsgs(int status, const wchar_t *message);
void GetStatusMsgs();
void GetStatuses();
@@ -137,8 +137,8 @@ public:
void GetDefaultNick(); // Copy to cache
void GetDefaultAvatar(); // Copy to cache
- TCHAR *GetDefaultStatusMsg(); // Copy to cache
- TCHAR *GetDefaultStatusMsg(int status);
+ wchar_t *GetDefaultStatusMsg(); // Copy to cache
+ wchar_t *GetDefaultStatusMsg(int status);
bool CanSetListeningTo();
bool ListeningToEnabled();
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp
index e5a19095d5..2778f655b9 100644
--- a/plugins/MyDetails/src/frame.cpp
+++ b/plugins/MyDetails/src/frame.cpp
@@ -68,7 +68,7 @@ COLORREF font_colour[NUM_FONTS];
// Defaults
char *font_settings[] = { "NicknameFont", "AccountFont", "StatusFont", "StatusMessageFont", "ListeningToFont" };
-TCHAR *font_names[] = { LPGENT("Nickname"), LPGENT("Account"), LPGENT("Status"), LPGENT("Status message"), LPGENT("Listening to") };
+wchar_t *font_names[] = { LPGENW("Nickname"), LPGENW("Account"), LPGENW("Status"), LPGENW("Status message"), LPGENW("Listening to") };
char font_sizes[] = { 13, 8, 8, 8, 8 };
BYTE font_styles[] = { DBFONTF_BOLD, 0, 0, DBFONTF_ITALIC, DBFONTF_ITALIC };
COLORREF font_colors[] = { RGB(0, 0, 0), RGB(0, 0, 0), RGB(0, 0, 0), RGB(150, 150, 150), RGB(150, 150, 150) };
@@ -234,11 +234,11 @@ int CreateFrame()
memset(&font_id[i], 0, sizeof(font_id[i]));
font_id[i].cbSize = sizeof(FontIDT);
- mir_tstrncpy(font_id[i].group, LPGENT("My details"), _countof(font_id[i].group));
+ mir_tstrncpy(font_id[i].group, LPGENW("My details"), _countof(font_id[i].group));
mir_tstrncpy(font_id[i].name, font_names[i], _countof(font_id[i].name));
mir_strncpy(font_id[i].dbSettingsGroup, MODULE_NAME, _countof(font_id[i].dbSettingsGroup));
- mir_tstrncpy(font_id[i].backgroundName, LPGENT("Background"), _countof(font_id[i].backgroundName));
- mir_tstrncpy(font_id[i].backgroundGroup, LPGENT("My details"), _countof(font_id[i].backgroundGroup));
+ mir_tstrncpy(font_id[i].backgroundName, LPGENW("Background"), _countof(font_id[i].backgroundName));
+ mir_tstrncpy(font_id[i].backgroundGroup, LPGENW("My details"), _countof(font_id[i].backgroundGroup));
mir_strncpy(font_id[i].prefix, font_settings[i], _countof(font_id[i].prefix));
@@ -328,14 +328,14 @@ int CreateFrame()
// Create menu item
CMenuItem mi;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("My details"), 500010000);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("My details"), 500010000);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "8C1C981C-4F28-4C4C-9121-544156210CE9");
SET_UID(mi, 0x69a43f1d, 0x6ebd, 0x4e41, 0xa6, 0xbd, 0x18, 0xea, 0xc4, 0x3, 0x90, 0x35);
mi.flags = CMIF_TCHAR;
mi.position = 1;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_USERDETAILS);
- mi.name.t = LPGENT("Show my details");
+ mi.name.w = LPGENW("Show my details");
mi.pszService = MODULE_NAME"/ShowHideMyDetails";
hMenuShowHideFrame = Menu_AddMainMenuItem(&mi);
Menu_ConfigureItem(hMenuShowHideFrame, MCI_OPT_EXECPARAM, -0x7FFFFFFF);
@@ -477,10 +477,10 @@ RECT GetRect(HDC hdc, RECT rc, SIZE s, UINT uFormat, int next_top, int text_left
return r;
}
-RECT GetRect(HDC hdc, RECT rc, const TCHAR *text, const TCHAR *def_text, Protocol *proto, UINT uFormat,
+RECT GetRect(HDC hdc, RECT rc, const wchar_t *text, const wchar_t *def_text, Protocol *proto, UINT uFormat,
int next_top, int text_left, bool smileys = true, bool frame = true, bool end_elipsis_on_frame = true)
{
- const TCHAR *tmp;
+ const wchar_t *tmp;
if (text[0] == '\0')
tmp = TranslateTS(def_text);
@@ -493,11 +493,11 @@ RECT GetRect(HDC hdc, RECT rc, const TCHAR *text, const TCHAR *def_text, Protoco
RECT r_tmp = rc;
// Only first line
- TCHAR *tmp2 = mir_tstrdup(tmp);
- TCHAR *pos = _tcschr(tmp2, '\r');
+ wchar_t *tmp2 = mir_tstrdup(tmp);
+ wchar_t *pos = wcschr(tmp2, '\r');
if (pos != NULL)
pos[0] = '\0';
- pos = _tcschr(tmp2, '\n');
+ pos = wcschr(tmp2, '\n');
if (pos != NULL)
pos[0] = '\0';
@@ -1021,20 +1021,20 @@ void EraseBackground(HWND hwnd, HDC hdc)
}
}
-void DrawTextWithRect(HDC hdc, const TCHAR *text, const TCHAR *def_text, RECT rc, UINT uFormat, bool mouse_over, Protocol *proto)
+void DrawTextWithRect(HDC hdc, const wchar_t *text, const wchar_t *def_text, RECT rc, UINT uFormat, bool mouse_over, Protocol *proto)
{
- const TCHAR *tmp;
+ const wchar_t *tmp;
if (text[0] == '\0')
tmp = TranslateTS(def_text);
else
tmp = text;
// Only first line
- TCHAR *tmp2 = mir_tstrdup(tmp);
- TCHAR *pos = _tcsrchr(tmp2, '\r');
+ wchar_t *tmp2 = mir_tstrdup(tmp);
+ wchar_t *pos = wcsrchr(tmp2, '\r');
if (pos != NULL)
pos[0] = '\0';
- pos = _tcschr(tmp2, '\n');
+ pos = wcschr(tmp2, '\n');
if (pos != NULL)
pos[0] = '\0';
@@ -1418,7 +1418,7 @@ void ShowProtocolStatusMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto
if (mii.cch != 0) {
mii.cch++;
- mii.dwTypeData = (TCHAR *)malloc(sizeof(TCHAR) * mii.cch);
+ mii.dwTypeData = (wchar_t *)malloc(sizeof(wchar_t) * mii.cch);
GetMenuItemInfo(menu, i, TRUE, &mii);
if (mir_tstrcmp(mii.dwTypeData, proto->description) == 0)
@@ -1477,7 +1477,7 @@ void ShowListeningToMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto, P
TranslateMenu(submenu);
// Add this proto to menu
- TCHAR tmp[128];
+ wchar_t tmp[128];
mir_sntprintf(tmp, TranslateT("Enable listening to for %s"), proto->description);
MENUITEMINFO mii = { 0 };
@@ -1715,7 +1715,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
TranslateMenu(submenu);
// Add this proto to menu
- TCHAR tmp[128];
+ wchar_t tmp[128];
mir_sntprintf(tmp, TranslateT("Set my avatar for %s..."), proto->description);
MENUITEMINFO mii = { 0 };
@@ -1755,7 +1755,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
TranslateMenu(submenu);
// Add this proto to menu
- TCHAR tmp[128];
+ wchar_t tmp[128];
mir_sntprintf(tmp, TranslateT("Set my nickname for %s..."), proto->description);
MENUITEMINFO mii = { 0 };
@@ -1796,7 +1796,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
// In status message?
else if (data->draw_away_msg && InsideRect(&p, &data->away_msg_rect)) {
- TCHAR tmp[128];
+ wchar_t tmp[128];
HMENU menu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_MENU1));
HMENU submenu = GetSubMenu(menu, 3);
@@ -1885,7 +1885,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
RemoveMenu(submenu, ID_DONT_CYCLE_THROUGH_PROTOS, MF_BYCOMMAND);
// Add this proto to menu
- TCHAR tmp[128];
+ wchar_t tmp[128];
mir_sntprintf(tmp, TranslateT("Enable listening to for %s"), proto->description);
MENUITEMINFO mii = { 0 };
@@ -2231,7 +2231,7 @@ INT_PTR HideFrameFunc(WPARAM, LPARAM)
void FixMainMenu()
{
- Menu_ModifyItem(hMenuShowHideFrame, MyDetailsFrameVisible() ? LPGENT("Hide my details") : LPGENT("Show my details"));
+ Menu_ModifyItem(hMenuShowHideFrame, MyDetailsFrameVisible() ? LPGENW("Hide my details") : LPGENW("Show my details"));
}
#include <math.h>
diff --git a/plugins/MyDetails/src/mydetails.cpp b/plugins/MyDetails/src/mydetails.cpp
index c82cfac707..7688d7c586 100644
--- a/plugins/MyDetails/src/mydetails.cpp
+++ b/plugins/MyDetails/src/mydetails.cpp
@@ -92,7 +92,7 @@ static int MainInit(WPARAM, LPARAM)
mi.position = 500050000;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_USERDETAILS);
- mi.name.t = LPGENT("My details");
+ mi.name.w = LPGENW("My details");
HGENMENU hMenuRoot = Menu_AddMainMenuItem(&mi);
mi.flags = CMIF_TCHAR;
@@ -102,7 +102,7 @@ static int MainInit(WPARAM, LPARAM)
if (protocols->CanSetAvatars()) {
SET_UID(mi, 0xe5b2d79e, 0xd25a, 0x4f72, 0xa4, 0x1a, 0x21, 0xfd, 0x48, 0x6b, 0xb5, 0x6);
mi.position = 100001;
- mi.name.t = LPGENT("Set my avatar...");
+ mi.name.w = LPGENW("Set my avatar...");
CreateServiceFunction("MENU_" MS_MYDETAILS_SETMYAVATARUI, Menu_SetMyAvatarUI);
mi.pszService = "MENU_" MS_MYDETAILS_SETMYAVATARUI;
Menu_AddMainMenuItem(&mi);
@@ -110,14 +110,14 @@ static int MainInit(WPARAM, LPARAM)
SET_UID(mi, 0xa327838f, 0xea6, 0x4ba5, 0x95, 0x92, 0xd8, 0xc4, 0x80, 0x84, 0x3, 0x50);
mi.position = 100002;
- mi.name.t = LPGENT("Set my nickname...");
+ mi.name.w = LPGENW("Set my nickname...");
CreateServiceFunction("MENU_" MS_MYDETAILS_SETMYNICKNAMEUI, Menu_SetMyNicknameUI);
mi.pszService = "MENU_" MS_MYDETAILS_SETMYNICKNAMEUI;
Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0x57c0d407, 0x61e1, 0x4c08, 0x8f, 0xcb, 0x65, 0x6a, 0x73, 0x3e, 0x20, 0xa8);
mi.position = 100003;
- mi.name.t = LPGENT("Set my status message...");
+ mi.name.w = LPGENW("Set my status message...");
CreateServiceFunction("MENU_" MS_MYDETAILS_SETMYSTATUSMESSAGEUI, Menu_SetMyStatusMessageUI);
mi.pszService = "MENU_" MS_MYDETAILS_SETMYSTATUSMESSAGEUI;
Menu_AddMainMenuItem(&mi);
@@ -125,7 +125,7 @@ static int MainInit(WPARAM, LPARAM)
// Set protocols to show frame
SET_UID(mi, 0x248530a2, 0xfc37, 0x413a, 0x87, 0x62, 0xb1, 0xd1, 0xa8, 0x87, 0x39, 0x5c);
mi.position = 200001;
- mi.name.t = LPGENT("Show next account");
+ mi.name.w = LPGENW("Show next account");
mi.pszService = MS_MYDETAILS_SHOWNEXTPROTOCOL;
Menu_AddMainMenuItem(&mi);
diff --git a/plugins/MyDetails/src/options.cpp b/plugins/MyDetails/src/options.cpp
index 0bc92981c0..c9be969e5c 100644
--- a/plugins/MyDetails/src/options.cpp
+++ b/plugins/MyDetails/src/options.cpp
@@ -166,8 +166,8 @@ int InitOptionsCallback(WPARAM wParam, LPARAM)
odp.hInstance = hInst;
odp.pfnDlgProc = DlgProcOpts;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTS);
- odp.ptszGroup = LPGENT("Contact list");
- odp.ptszTitle = LPGENT("My details");
+ odp.pwszGroup = LPGENW("Contact list");
+ odp.pwszTitle = LPGENW("My details");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &odp);
return 0;
diff --git a/plugins/MyDetails/src/services.cpp b/plugins/MyDetails/src/services.cpp
index 16fcf7eb93..30be916a0f 100644
--- a/plugins/MyDetails/src/services.cpp
+++ b/plugins/MyDetails/src/services.cpp
@@ -48,7 +48,7 @@ static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam
// All protos have the same nick?
if (protocols->GetSize() > 0) {
- TCHAR *nick = protocols->Get(0)->nickname;
+ wchar_t *nick = protocols->Get(0)->nickname;
bool foundDefNick = true;
for (int i = 1; foundDefNick && i < protocols->GetSize(); i++) {
@@ -69,7 +69,7 @@ static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam
else {
Protocol *proto = protocols->Get(proto_num);
- TCHAR tmp[128];
+ wchar_t tmp[128];
mir_sntprintf(tmp, TranslateT("Set my nickname for %s"), proto->description);
SetWindowText(hwndDlg, tmp);
@@ -92,7 +92,7 @@ static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam
switch (wParam) {
case IDOK:
{
- TCHAR tmp[MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE];
+ wchar_t tmp[MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE];
GetDlgItemText(hwndDlg, IDC_NICKNAME, tmp, _countof(tmp));
LONG_PTR proto_num = GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
@@ -168,7 +168,7 @@ INT_PTR PluginCommand_SetMyNickname(WPARAM wParam, LPARAM lParam)
if (!protocols->Get(i)->CanSetNick())
return -2;
- protocols->Get(i)->SetNick((TCHAR *)lParam);
+ protocols->Get(i)->SetNick((wchar_t *)lParam);
return 0;
}
}
@@ -176,13 +176,13 @@ INT_PTR PluginCommand_SetMyNickname(WPARAM wParam, LPARAM lParam)
return -1;
}
- protocols->SetNicks((TCHAR *)lParam);
+ protocols->SetNicks((wchar_t *)lParam);
return 0;
}
INT_PTR PluginCommand_GetMyNickname(WPARAM wParam, LPARAM lParam)
{
- TCHAR *ret = (TCHAR *)lParam;
+ wchar_t *ret = (wchar_t *)lParam;
if (ret == NULL)
return -1;
@@ -242,7 +242,7 @@ INT_PTR PluginCommand_SetMyAvatar(WPARAM wParam, LPARAM lParam)
if (!protocols->Get(i)->CanSetAvatar())
return -2;
- protocols->Get(i)->SetAvatar((TCHAR *)lParam);
+ protocols->Get(i)->SetAvatar((wchar_t *)lParam);
return 0;
}
}
@@ -250,13 +250,13 @@ INT_PTR PluginCommand_SetMyAvatar(WPARAM wParam, LPARAM lParam)
return -1;
}
- protocols->SetAvatars((TCHAR *)lParam);
+ protocols->SetAvatars((wchar_t *)lParam);
return 0;
}
INT_PTR PluginCommand_GetMyAvatar(WPARAM wParam, LPARAM lParam)
{
- TCHAR *ret = (TCHAR *)lParam;
+ wchar_t *ret = (wchar_t *)lParam;
char *proto = (char *)wParam;
if (ret == NULL)
@@ -332,7 +332,7 @@ static INT_PTR CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM w
DestroyIcon(hIcon);
}
- TCHAR title[256];
+ wchar_t title[256];
mir_sntprintf(title, TranslateT("Set my status message for %s"), proto->description);
SetWindowText(hwndDlg, title);
@@ -341,7 +341,7 @@ static INT_PTR CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM w
else if (data->status != 0) {
Window_SetProtoIcon_IcoLib(hwndDlg, NULL, data->status);
- TCHAR title[256];
+ wchar_t title[256];
mir_sntprintf(title, TranslateT("Set my status message for %s"), pcli->pfnGetStatusModeDescription(data->status, 0));
SetWindowText(hwndDlg, title);
@@ -359,7 +359,7 @@ static INT_PTR CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM w
switch (wParam) {
case IDOK:
{
- TCHAR tmp[MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE];
+ wchar_t tmp[MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE];
GetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, tmp, _countof(tmp));
SetStatusMessageData *data = (SetStatusMessageData *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
diff --git a/plugins/NewAwaySysMod/src/AwayOpt.cpp b/plugins/NewAwaySysMod/src/AwayOpt.cpp
index dff4fa7a04..d6e0213ac0 100644
--- a/plugins/NewAwaySysMod/src/AwayOpt.cpp
+++ b/plugins/NewAwaySysMod/src/AwayOpt.cpp
@@ -115,13 +115,13 @@ static Dlg1DefMsgDlgItems[] = {
struct {
int DlgItem, IconIndex;
- TCHAR* Text;
+ wchar_t* Text;
}
static Dlg1Buttons[] = {
- IDC_MESSAGEDLG_NEWMSG, ILI_NEWMESSAGE, LPGENT("Create new message"),
- IDC_MESSAGEDLG_NEWCAT, ILI_NEWCATEGORY, LPGENT("Create new category"),
- IDC_MESSAGEDLG_DEL, ILI_DELETE, LPGENT("Delete"),
- IDC_MESSAGEDLG_VARS, ILI_NOICON, LPGENT("Open Variables help dialog"),
+ IDC_MESSAGEDLG_NEWMSG, ILI_NEWMESSAGE, LPGENW("Create new message"),
+ IDC_MESSAGEDLG_NEWCAT, ILI_NEWCATEGORY, LPGENW("Create new category"),
+ IDC_MESSAGEDLG_DEL, ILI_DELETE, LPGENW("Delete"),
+ IDC_MESSAGEDLG_VARS, ILI_NOICON, LPGENW("Open Variables help dialog"),
};
static INT_PTR CALLBACK MessagesOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -192,7 +192,7 @@ static INT_PTR CALLBACK MessagesOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LP
TCString Msg;
GetDlgItemText(hwndDlg, IDC_MESSAGEDLG_MSGDATA, Msg.GetBuffer(AWAY_MSGDATA_MAX), AWAY_MSGDATA_MAX);
Msg.ReleaseBuffer();
- if (((CTreeItem*)pnm->ItemOld)->User_Str1 != (const TCHAR*)Msg) {
+ if (((CTreeItem*)pnm->ItemOld)->User_Str1 != (const wchar_t*)Msg) {
((CTreeItem*)pnm->ItemOld)->User_Str1 = Msg;
MsgTree->SetModified(true);
}
@@ -515,7 +515,7 @@ INT_PTR CALLBACK AutoreplyOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
HWND hCombo = GetDlgItem(hwndDlg, IDC_REPLYDLG_ONLYIDLEREPLY_COMBO);
struct {
- TCHAR *Text;
+ wchar_t *Text;
int Meaning;
}
static IdleComboValues[] = {
@@ -544,13 +544,13 @@ INT_PTR CALLBACK AutoreplyOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
// init tooltips
struct {
int m_dlgItemID;
- TCHAR *Text;
+ wchar_t *Text;
}
Tooltips[] = {
- IDC_REPLYDLG_RESETCOUNTERWHENSAMEICON, LPGENT("When this checkbox is ticked, NewAwaySys counts \"send times\" starting from the last status message change, even if status mode didn't change.\nWhen the checkbox isn't ticked, \"send times\" are counted from last status mode change (i.e., disabled state is more restrictive)."),
- IDC_MOREOPTDLG_EVNTMSG, LPGENT("Message"),
- IDC_MOREOPTDLG_EVNTURL, LPGENT("URL"),
- IDC_MOREOPTDLG_EVNTFILE, LPGENT("File")
+ IDC_REPLYDLG_RESETCOUNTERWHENSAMEICON, LPGENW("When this checkbox is ticked, NewAwaySys counts \"send times\" starting from the last status message change, even if status mode didn't change.\nWhen the checkbox isn't ticked, \"send times\" are counted from last status mode change (i.e., disabled state is more restrictive)."),
+ IDC_MOREOPTDLG_EVNTMSG, LPGENW("Message"),
+ IDC_MOREOPTDLG_EVNTURL, LPGENW("URL"),
+ IDC_MOREOPTDLG_EVNTFILE, LPGENW("File")
};
hWndTooltips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, L"", WS_POPUP | TTS_NOPREFIX, 0, 0, 0, 0, NULL, NULL, GetModuleHandleA("mir_app.mir"), NULL);
TOOLINFO ti = { 0 };
@@ -669,13 +669,13 @@ Dlg4DefMsgDlgItems[] = {
static struct {
int DlgItem, IconIndex;
- TCHAR* Text;
+ wchar_t* Text;
}
Dlg4Buttons[] = {
- IDC_MESSAGEDLG_NEWMSG, ILI_NEWMESSAGE, LPGENT("Create new message"),
- IDC_MESSAGEDLG_NEWCAT, ILI_NEWCATEGORY, LPGENT("Create new category"),
- IDC_MESSAGEDLG_DEL, ILI_DELETE, LPGENT("Delete"),
- IDC_MESSAGEDLG_VARS, ILI_NOICON, LPGENT("Open Variables help dialog"),
+ IDC_MESSAGEDLG_NEWMSG, ILI_NEWMESSAGE, LPGENW("Create new message"),
+ IDC_MESSAGEDLG_NEWCAT, ILI_NEWCATEGORY, LPGENW("Create new category"),
+ IDC_MESSAGEDLG_DEL, ILI_DELETE, LPGENW("Delete"),
+ IDC_MESSAGEDLG_VARS, ILI_NOICON, LPGENW("Open Variables help dialog"),
};
INT_PTR CALLBACK MessagesModernOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -747,7 +747,7 @@ INT_PTR CALLBACK MessagesModernOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
TCString Msg;
GetDlgItemText(hwndDlg, IDC_MESSAGEDLG_MSGDATA, Msg.GetBuffer(AWAY_MSGDATA_MAX), AWAY_MSGDATA_MAX);
Msg.ReleaseBuffer();
- if (((CTreeItem*)pnm->ItemOld)->User_Str1 != (const TCHAR*)Msg) {
+ if (((CTreeItem*)pnm->ItemOld)->User_Str1 != (const wchar_t*)Msg) {
((CTreeItem*)pnm->ItemOld)->User_Str1 = Msg;
MsgTree->SetModified(true);
}
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp
index f5f291c59b..7a86594b43 100644
--- a/plugins/NewAwaySysMod/src/AwaySys.cpp
+++ b/plugins/NewAwaySysMod/src/AwaySys.cpp
@@ -119,7 +119,7 @@ TCString GetDynamicStatMsg(MCONTACT hContact, char *szProto, DWORD UIN, int iSta
VarParseData.UIN = UIN;
VarParseData.Flags = 0;
if (ServiceExists(MS_VARS_FORMATSTRING) && !g_SetAwayMsgPage.GetDBValueCopy(IDS_SAWAYMSG_DISABLEVARIABLES)) {
- TCHAR *szResult = variables_parse(VarParseData.Message, 0, hContact);
+ wchar_t *szResult = variables_parse(VarParseData.Message, 0, hContact);
if (szResult) {
VarParseData.Message = szResult;
mir_free(szResult);
@@ -312,7 +312,7 @@ int PreBuildContactMenu(WPARAM hContact, LPARAM)
int iMode = szProto ? CallProtoService(szProto, PS_GETSTATUS, 0, 0) : 0;
int Flag1 = szProto ? CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) : 0;
int iContactMode = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
- TCHAR szSetStr[256], szReadStr[256];
+ wchar_t szSetStr[256], szReadStr[256];
szSetStr[0] = szReadStr[0] = 0;
HICON hReadMsgIcon = NULL;
@@ -466,7 +466,7 @@ static int IconsChanged(WPARAM, LPARAM)
struct
{
- TCHAR *Name;
+ wchar_t *Name;
char *Descr;
int Flags;
}
@@ -501,7 +501,7 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam)
}
else if (!mir_tstrcmp(ai->targv[0], VAR_MYNICK)) {
if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_MYNICKPERPROTO) && VarParseData.szProto)
- Result = db_get_s(NULL, VarParseData.szProto, "Nick", (TCHAR*)NULL);
+ Result = db_get_s(NULL, VarParseData.szProto, "Nick", (wchar_t*)NULL);
if (Result == NULL)
Result = pcli->pfnGetContactDisplayName(NULL, 0);
@@ -562,7 +562,7 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam)
if (Result == NULL) // if we didn't find a message with specified title
return NULL; // return it now, as later we change NULL to ""
}
- TCHAR *szResult = (TCHAR*)malloc((Result.GetLen() + 1) * sizeof(TCHAR));
+ wchar_t *szResult = (wchar_t*)malloc((Result.GetLen() + 1) * sizeof(wchar_t));
if (!szResult)
return NULL;
@@ -635,7 +635,7 @@ int MirandaLoaded(WPARAM, LPARAM)
mi.position = 1000020000;
mi.flags = CMIF_TCHAR | CMIF_NOTOFFLINE;
mi.hIcolibItem = iconList[SendOnEvent ? 1 : 0].hIcolib;
- mi.name.t = SendOnEvent ? DISABLE_SOE_COMMAND : ENABLE_SOE_COMMAND;
+ mi.name.w = SendOnEvent ? DISABLE_SOE_COMMAND : ENABLE_SOE_COMMAND;
mi.pszService = MS_AWAYSYS_AUTOREPLY_TOGGLE;
g_hToggleSOEMenuItem = Menu_AddMainMenuItem(&mi);
@@ -643,7 +643,7 @@ int MirandaLoaded(WPARAM, LPARAM)
SET_UID(mi, 0xd3282acc, 0x9ff1, 0x4ede, 0x8a, 0x1e, 0x36, 0x72, 0x3f, 0x44, 0x4f, 0x84);
mi.position = -2000005000;
mi.flags = CMIF_TCHAR | CMIF_NOTOFFLINE | CMIF_HIDDEN;
- mi.name.t = LPGENT("Read status message"); // never seen...
+ mi.name.w = LPGENW("Read status message"); // never seen...
mi.pszService = MS_AWAYMSG_SHOWAWAYMSG;
g_hReadStatMenuItem = Menu_AddContactMenuItem(&mi);
@@ -651,7 +651,7 @@ int MirandaLoaded(WPARAM, LPARAM)
memset(&mi, 0, sizeof(mi));
SET_UID(mi, 0xc42a4fdb, 0x51b8, 0x4bbe, 0x83, 0xee, 0x2d, 0x32, 0x29, 0x5c, 0x2, 0xb3);
mi.flags = CMIF_TCHAR | CMIF_HIDDEN;
- mi.name.t = LPGENT("Set status message"); // will never be shown
+ mi.name.w = LPGENW("Set status message"); // will never be shown
mi.position = 1000020000;
mi.hIcolibItem = iconList[8].hIcolib;
mi.pszService = MS_AWAYSYS_SETCONTACTSTATMSG;
@@ -662,7 +662,7 @@ int MirandaLoaded(WPARAM, LPARAM)
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = NULL;
mi.position = 1000020000;
- mi.name.t = LPGENT("Autoreply");
+ mi.name.w = LPGENW("Autoreply");
g_hToggleSOEContactMenuItem = Menu_AddContactMenuItem(&mi);
UNSET_UID(mi);
@@ -671,17 +671,17 @@ int MirandaLoaded(WPARAM, LPARAM)
mi.position = 1000020000;
mi.hIcolibItem = iconList[1].hIcolib;
- mi.name.t = LPGENT("On");
+ mi.name.w = LPGENW("On");
mi.pszService = MS_AWAYSYS_AUTOREPLY_ON;
g_hAutoreplyOnContactMenuItem = Menu_AddContactMenuItem(&mi);
mi.hIcolibItem = iconList[0].hIcolib;
- mi.name.t = LPGENT("Off");
+ mi.name.w = LPGENW("Off");
mi.pszService = MS_AWAYSYS_AUTOREPLY_OFF;
g_hAutoreplyOffContactMenuItem = Menu_AddContactMenuItem(&mi);
mi.hIcolibItem = iconList[5].hIcolib;
- mi.name.t = LPGENT("Use the default setting");
+ mi.name.w = LPGENW("Use the default setting");
mi.pszService = MS_AWAYSYS_AUTOREPLY_USEDEFAULT;
g_hAutoreplyUseDefaultContactMenuItem = Menu_AddContactMenuItem(&mi);
}
diff --git a/plugins/NewAwaySysMod/src/CString.cpp b/plugins/NewAwaySysMod/src/CString.cpp
index ebfefce299..c35e6bbeef 100644
--- a/plugins/NewAwaySysMod/src/CString.cpp
+++ b/plugins/NewAwaySysMod/src/CString.cpp
@@ -267,7 +267,7 @@ TString<T>& TString<T>::operator = (const T *pStr)
return *this;
}
-template class TString<TCHAR>;
+template class TString<wchar_t>;
template class TString<char>;
template class TString<WCHAR>;
@@ -277,13 +277,13 @@ CString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting,
return CString(p == NULL ? szDefaultValue : p);
}
-TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue)
+TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue)
{
ptrT p( db_get_tsa(hContact, szModule, szSetting));
return TCString(p == NULL ? szDefaultValue : p);
}
-TCString DBGetContactSettingAsString(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue)
+TCString DBGetContactSettingAsString(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue)
{ // also converts numeric values to a string
DBVARIANT dbv = {0};
int iRes = db_get_ws(hContact, szModule, szSetting, &dbv);
diff --git a/plugins/NewAwaySysMod/src/CString.h b/plugins/NewAwaySysMod/src/CString.h
index 9218a6459d..decedaaac7 100644
--- a/plugins/NewAwaySysMod/src/CString.h
+++ b/plugins/NewAwaySysMod/src/CString.h
@@ -20,7 +20,6 @@
#pragma once
#include <windows.h>
-#include <tchar.h>
#include <crtdbg.h>
#ifdef CHARARRAY_CONVERT
#include "TMyArray.h"
@@ -97,7 +96,7 @@ private:
};
-typedef TString<TCHAR> TCString;
+typedef TString<wchar_t> TCString;
typedef TString<char> CString;
typedef TString<WCHAR> WCString;
@@ -164,9 +163,9 @@ __inline CHARARRAY WCHAR2UTF8(WCString Str)
#undef db_get_s
CString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const char *szDefaultValue);
-TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue);
+TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue);
int db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
-TCString DBGetContactSettingAsString(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue); // also converts numeric values to a string
+TCString DBGetContactSettingAsString(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue); // also converts numeric values to a string
// various string helpers. their return values are valid only while the class is visible
class UTF8Encode
diff --git a/plugins/NewAwaySysMod/src/Client.cpp b/plugins/NewAwaySysMod/src/Client.cpp
index 84c365fbb2..dbee9f8da2 100644
--- a/plugins/NewAwaySysMod/src/Client.cpp
+++ b/plugins/NewAwaySysMod/src/Client.cpp
@@ -47,7 +47,7 @@ void __cdecl UpdateMsgsThreadProc(void *)
}
if (CallProtoService(p->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(Status) && g_ProtoStates[p->szModuleName].CurStatusMsg.GetUpdateTimeDifference() >= MinUpdateTimeDifference) {
TCString CurMsg(GetDynamicStatMsg(INVALID_CONTACT_ID, p->szModuleName));
- if ((TCString)g_ProtoStates[p->szModuleName].CurStatusMsg != (const TCHAR*)CurMsg) { // if the message has changed
+ if ((TCString)g_ProtoStates[p->szModuleName].CurStatusMsg != (const wchar_t*)CurMsg) { // if the message has changed
g_ProtoStates[p->szModuleName].CurStatusMsg = CurMsg;
CallAllowedPS_SETAWAYMSG(p->szModuleName, Status, CurMsg);
}
@@ -179,7 +179,7 @@ TCString VariablesEscape(TCString Str)
};
eState State = ST_QUOTE;
TCString Result(L"`");
- const TCHAR *p = Str;
+ const wchar_t *p = Str;
while (*p) {
if (*p == '`') {
if (State == ST_TEXT) {
diff --git a/plugins/NewAwaySysMod/src/ContactList.cpp b/plugins/NewAwaySysMod/src/ContactList.cpp
index 1f7d3dd17d..12889aaa21 100644
--- a/plugins/NewAwaySysMod/src/ContactList.cpp
+++ b/plugins/NewAwaySysMod/src/ContactList.cpp
@@ -393,7 +393,7 @@ HTREEITEM CCList::AddGroup(TCString GroupName)
TVINSERTSTRUCT tvIns = { 0 };
tvIns.hParent = TVI_ROOT;
- tvIns.item.pszText = _tcsrchr(GroupName, '\\');
+ tvIns.item.pszText = wcsrchr(GroupName, '\\');
if (tvIns.item.pszText) {
TCString ParentGroupName(L"");
tvIns.hParent = AddGroup(ParentGroupName.DiffCat(GroupName, tvIns.item.pszText));
diff --git a/plugins/NewAwaySysMod/src/GroupCheckbox.cpp b/plugins/NewAwaySysMod/src/GroupCheckbox.cpp
index e4d30f9408..913edfe261 100644
--- a/plugins/NewAwaySysMod/src/GroupCheckbox.cpp
+++ b/plugins/NewAwaySysMod/src/GroupCheckbox.cpp
@@ -94,7 +94,7 @@ static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM l
}
else {
SIZE size;
- TCHAR *szText = (TCHAR*)_alloca(Len * sizeof(TCHAR));
+ wchar_t *szText = (wchar_t*)_alloca(Len * sizeof(wchar_t));
GetWindowText(hWnd, szText, Len);
GetTextExtentPoint32(hdc, szText, (int)mir_tstrlen(szText), &size);
rcText.right = size.cx;
@@ -274,7 +274,7 @@ static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM l
rc.left += CG_CHECKBOX_INDENT + CG_CHECKBOX_WIDTH + CG_TEXT_INDENT;
int Len = GetWindowTextLength(hWnd) + 1;
- TCHAR *szTextT = (TCHAR*)_alloca(Len * sizeof(TCHAR));
+ wchar_t *szTextT = (wchar_t*)_alloca(Len * sizeof(wchar_t));
GetWindowText(hWnd, szTextT, Len);
HFONT hOldFont = (HFONT)SelectObject(hdcMem, dat->hFont);
diff --git a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp
index 5efa887ed5..bb9faf5125 100644
--- a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp
+++ b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp
@@ -233,7 +233,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam)
GetDynamicStatMsg(hContact); // it updates VarParseData.Message needed for %extratext% in the format
TCString Reply(*(TCString*)AutoreplyOptData.GetValue(IDC_REPLYDLG_PREFIX));
if (Reply != NULL && ServiceExists(MS_VARS_FORMATSTRING) && !g_SetAwayMsgPage.GetDBValueCopy(IDS_SAWAYMSG_DISABLEVARIABLES)) {
- TCHAR *szResult = variables_parse(Reply, VarParseData.Message, hContact);
+ wchar_t *szResult = variables_parse(Reply, VarParseData.Message, hContact);
if (szResult != NULL) {
Reply = szResult;
mir_free(szResult);
diff --git a/plugins/NewAwaySysMod/src/MsgTree.cpp b/plugins/NewAwaySysMod/src/MsgTree.cpp
index 60ec54710c..57720cc77f 100644
--- a/plugins/NewAwaySysMod/src/MsgTree.cpp
+++ b/plugins/NewAwaySysMod/src/MsgTree.cpp
@@ -302,7 +302,7 @@ LRESULT CALLBACK MsgTreeSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM
if (NewMsg.IsEmpty())
NewMsg = L"";
- if (OldTitle != (const TCHAR*)NewTitle || OldMsg != (const TCHAR*)NewMsg) {
+ if (OldTitle != (const wchar_t*)NewTitle || OldMsg != (const wchar_t*)NewMsg) {
// probably it's better to leave nm.ItemOld = NULL, to prevent accidental rewriting of it with old data from an edit control etc.
nm.hdr.code = MTN_SELCHANGED;
nm.hdr.hwndFrom = hWnd;
@@ -571,7 +571,7 @@ void CMsgTree::UpdateItem(int ID) // updates item title, and expanded/collapsed
tvi.pszText = NewTitle.GetBuffer(TREEITEMTITLE_MAXLEN);
tvi.cchTextMax = TREEITEMTITLE_MAXLEN;
TreeView_GetItem(hTreeView, &tvi);
- if (TreeItem->Title != (const TCHAR*)tvi.pszText) {
+ if (TreeItem->Title != (const wchar_t*)tvi.pszText) {
TreeCtrl->SetModified(true);
NMMSGTREE nm = { 0 };
nm.ItemNew = TreeItem;
diff --git a/plugins/NewAwaySysMod/src/Notification.cpp b/plugins/NewAwaySysMod/src/Notification.cpp
index fdf0b5ebe0..3aaee466f0 100644
--- a/plugins/NewAwaySysMod/src/Notification.cpp
+++ b/plugins/NewAwaySysMod/src/Notification.cpp
@@ -21,7 +21,7 @@
#include "Path.h"
#include "Properties.h"
-void ShowMsg(TCHAR *FirstLine, TCHAR *SecondLine, bool IsErrorMsg, int Timeout)
+void ShowMsg(wchar_t *FirstLine, wchar_t *SecondLine, bool IsErrorMsg, int Timeout)
{
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
POPUPDATAT ppd = { 0 };
@@ -53,7 +53,7 @@ static int CALLBACK MenuWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
static VOID CALLBACK ShowContactMenu(MCONTACT hContact)
{
POINT pt;
- HWND hMenuWnd = CreateWindowEx(WS_EX_TOOLWINDOW, L"static", _T(MOD_NAME)L"_MenuWindow", 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, g_hInstance, NULL);
+ HWND hMenuWnd = CreateWindowEx(WS_EX_TOOLWINDOW, L"static", MOD_NAMEW L"_MenuWindow", 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, g_hInstance, NULL);
SetWindowLongPtr(hMenuWnd, GWLP_WNDPROC, (LONG_PTR)MenuWndProc);
HMENU hMenu = Menu_BuildContactMenu(hContact);
GetCursorPos(&pt);
@@ -68,7 +68,7 @@ void ShowLog(TCString &LogFilePath)
{
INT_PTR Result = (INT_PTR)ShellExecute(NULL, L"open", LogFilePath, NULL, NULL, SW_SHOW);
if (Result <= 32) {
- TCHAR szError[64];
+ wchar_t szError[64];
mir_sntprintf(szError, TranslateT("Error #%d"), Result);
ShowMsg(szError, TranslateT("Can't open log file ") + LogFilePath, true);
}
diff --git a/plugins/NewAwaySysMod/src/Options.cpp b/plugins/NewAwaySysMod/src/Options.cpp
index aea2556676..62463ea611 100644
--- a/plugins/NewAwaySysMod/src/Options.cpp
+++ b/plugins/NewAwaySysMod/src/Options.cpp
@@ -286,7 +286,7 @@ int TreeReadEnum(const char *szSetting, LPARAM lParam)
pItem.Title = db_get_s(NULL, pData->sModule, *pData->sDBSettingPrefix + szSetting, L"");
pItem.User_Str1 = (pData->TreeCtrl->User_Str1_DBName == NULL) ? NULL :
db_get_s(NULL, pData->sModule,
- *pData->sDBSettingPrefix + pData->TreeCtrl->sDBSetting + pData->TreeCtrl->User_Str1_DBName + (szSetting + Len), (TCHAR*)NULL);
+ *pData->sDBSettingPrefix + pData->TreeCtrl->sDBSetting + pData->TreeCtrl->User_Str1_DBName + (szSetting + Len), (wchar_t*)NULL);
}
}
return 0;
@@ -722,7 +722,7 @@ void COptItem_ListCtrl::MemToWnd(HWND hWnd)
SendMessage(hListView, LB_RESETCONTENT, 0, 0);
for (int i = 0; i < m_value.GetSize(); i++)
- SendMessage(hListView, LB_INSERTSTRING, -1, (LPARAM)(TCHAR*)m_value[i].Text);
+ SendMessage(hListView, LB_INSERTSTRING, -1, (LPARAM)(wchar_t*)m_value[i].Text);
SendMessage(hListView, WM_SETREDRAW, true, 0);
COptItem::MemToWnd(hWnd);
@@ -794,7 +794,7 @@ void COptItem_ListCtrl::ModifyItem(HWND hWnd, int ID, CListItem &Item)
int TopIndex = SendMessage(hListView, LB_GETTOPINDEX, 0, 0);
int Res = SendMessage(hListView, LB_DELETESTRING, ID, 0);
_ASSERT(Res != LB_ERR);
- Res = SendMessage(hListView, LB_INSERTSTRING, ID, (LPARAM)(TCHAR*)(Item.Text));
+ Res = SendMessage(hListView, LB_INSERTSTRING, ID, (LPARAM)(wchar_t*)(Item.Text));
_ASSERT(Res != LB_ERR && Res != LB_ERRSPACE);
SendMessage(hListView, LB_SETCURSEL, CurSel, 0);
SendMessage(hListView, LB_SETTOPINDEX, TopIndex, 0);
@@ -808,7 +808,7 @@ CListItem* COptItem_ListCtrl::InsertItem(HWND hWnd, int ID, CListItem &Item)
// ID is position at which to insert the item; -1 = add to the end of the list
{
HWND hListView = GetDlgItem(hWnd, m_dlgItemID);
- int Res = SendMessage(hListView, LB_INSERTSTRING, ID, (LPARAM)(TCHAR*)(Item.Text)); // LB_INSERTSTRING doesn't sort the lists even with LBS_SORT style
+ int Res = SendMessage(hListView, LB_INSERTSTRING, ID, (LPARAM)(wchar_t*)(Item.Text)); // LB_INSERTSTRING doesn't sort the lists even with LBS_SORT style
_ASSERT(Res != LB_ERR && Res != LB_ERRSPACE);
int i = m_value.AddElem(Item);
m_bModified = true;
diff --git a/plugins/NewAwaySysMod/src/Options.h b/plugins/NewAwaySysMod/src/Options.h
index b22a0b902b..aac3e9d1c0 100644
--- a/plugins/NewAwaySysMod/src/Options.h
+++ b/plugins/NewAwaySysMod/src/Options.h
@@ -92,7 +92,7 @@ class COptItem_Edit : public COptItem
{
public:
COptItem_Edit() {}
- COptItem_Edit(int m_dlgItemID, char *szDBSetting, int nMaxLen, TCHAR *szDefValue, int lParam = 0, bool m_bReadOnly = false)
+ COptItem_Edit(int m_dlgItemID, char *szDBSetting, int nMaxLen, wchar_t *szDefValue, int lParam = 0, bool m_bReadOnly = false)
: COptItem(m_dlgItemID, szDBSetting, nMaxLen, lParam, m_bReadOnly), sDefValue(szDefValue)
{}
@@ -323,7 +323,7 @@ class COptItem_StrDBSetting : public COptItem
{
public:
COptItem_StrDBSetting() {}
- COptItem_StrDBSetting(int m_dlgItemID, char *szDBSetting, int nMaxLen, TCHAR *szDefValue, int lParam = 0, bool m_bReadOnly = false) : COptItem(m_dlgItemID, szDBSetting, nMaxLen, lParam, m_bReadOnly), sDefValue(szDefValue) {}
+ COptItem_StrDBSetting(int m_dlgItemID, char *szDBSetting, int nMaxLen, wchar_t *szDefValue, int lParam = 0, bool m_bReadOnly = false) : COptItem(m_dlgItemID, szDBSetting, nMaxLen, lParam, m_bReadOnly), sDefValue(szDefValue) {}
void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { sValue = GetStrDBVal(sModule, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetStrDBVal(sModule, sValue, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
void WndToMem(HWND hWnd) { COptItem::WndToMem(hWnd); }
diff --git a/plugins/NewAwaySysMod/src/Properties.cpp b/plugins/NewAwaySysMod/src/Properties.cpp
index 8056306df5..6e1914257c 100644
--- a/plugins/NewAwaySysMod/src/Properties.cpp
+++ b/plugins/NewAwaySysMod/src/Properties.cpp
@@ -109,7 +109,7 @@ void CContactSettings::SetMsgFormat(int Flags, TCString Message)
if (Flags & SMF_PERSONAL) { // set a personal message for a contact. also it's used to set global status message (hContact = NULL).
// if Message == NULL, then the function deletes the message.
CString DBSetting(StatusToDBSetting(Status, DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPERSONAL));
- if (g_AutoreplyOptPage.GetDBValueCopy(IDC_REPLYDLG_RESETCOUNTERWHENSAMEICON) && GetMsgFormat(SMF_PERSONAL) != (const TCHAR*)Message)
+ if (g_AutoreplyOptPage.GetDBValueCopy(IDC_REPLYDLG_RESETCOUNTERWHENSAMEICON) && GetMsgFormat(SMF_PERSONAL) != (const wchar_t*)Message)
ResetContactSettingsOnStatusChange(m_hContact);
if (Message != NULL)
@@ -135,7 +135,7 @@ TCString CContactSettings::GetMsgFormat(int Flags, int *pOrder, char *szProtoOve
*pOrder = -1;
if (Flags & GMF_PERSONAL) // try getting personal message (it overrides global)
- Message = db_get_s(m_hContact, MOD_NAME, StatusToDBSetting(Status, DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPERSONAL), (TCHAR*)NULL);
+ Message = db_get_s(m_hContact, MOD_NAME, StatusToDBSetting(Status, DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPERSONAL), (wchar_t*)NULL);
if (Flags & (GMF_LASTORDEFAULT | GMF_PROTOORGLOBAL | GMF_TEMPORARY) && Message.IsEmpty()) {
char *szProto = szProtoOverride ? szProtoOverride : (m_hContact ? GetContactProto(m_hContact) : NULL);
@@ -154,7 +154,7 @@ TCString CContactSettings::GetMsgFormat(int Flags, int *pOrder, char *szProtoOve
void CProtoSettings::SetMsgFormat(int Flags, TCString Message)
{
- if (Flags & (SMF_TEMPORARY | SMF_PERSONAL) && g_AutoreplyOptPage.GetDBValueCopy(IDC_REPLYDLG_RESETCOUNTERWHENSAMEICON) && GetMsgFormat(Flags & (SMF_TEMPORARY | SMF_PERSONAL)) != (const TCHAR*)Message)
+ if (Flags & (SMF_TEMPORARY | SMF_PERSONAL) && g_AutoreplyOptPage.GetDBValueCopy(IDC_REPLYDLG_RESETCOUNTERWHENSAMEICON) && GetMsgFormat(Flags & (SMF_TEMPORARY | SMF_PERSONAL)) != (const wchar_t*)Message)
ResetSettingsOnStatusChange(szProto);
if (Flags & SMF_TEMPORARY) {
@@ -190,7 +190,7 @@ void CProtoSettings::SetMsgFormat(int Flags, TCString Message)
// or at least if we'll find an identical message somewhere else, then we'll use its title for our new message
TCString Title(L"");
for (i = 0; i < TreeCtrl->m_value.GetSize(); i++) {
- if (!(TreeCtrl->m_value[i].Flags & TIF_GROUP) && TreeCtrl->m_value[i].User_Str1 == (const TCHAR*)Message) {
+ if (!(TreeCtrl->m_value[i].Flags & TIF_GROUP) && TreeCtrl->m_value[i].User_Str1 == (const wchar_t*)Message) {
if (TreeCtrl->m_value[i].ParentID == RecentGroupID) { // found it in the same group
int GroupOrder = TreeCtrl->IDToOrder(RecentGroupID);
TreeCtrl->m_value.MoveElem(i, (GroupOrder >= 0) ? (GroupOrder + 1) : 0); // now move it to the top of recent messages list
@@ -208,9 +208,9 @@ void CProtoSettings::SetMsgFormat(int Flags, TCString Message)
else
Title = Message;
- TCHAR *p = Title.GetBuffer();
+ wchar_t *p = Title.GetBuffer();
while (*p) { // remove "garbage"
- if (!(p = _tcspbrk(p, L"\r\n\t")))
+ if (!(p = wcspbrk(p, L"\r\n\t")))
break;
*p++ = ' ';
@@ -266,7 +266,7 @@ TCString CProtoSettings::GetMsgFormat(int Flags, int *pOrder)
}
}
if (Flags & GMF_PERSONAL && Message == NULL) // try getting personal message (it overrides global)
- Message = db_get_s(NULL, MOD_NAME, ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS), (TCHAR*)NULL);
+ Message = db_get_s(NULL, MOD_NAME, ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS), (wchar_t*)NULL);
if (Flags & GMF_PROTOORGLOBAL && Message == NULL) {
Message = CProtoSettings().GetMsgFormat(GMF_PERSONAL | (Flags & GMF_TEMPORARY), pOrder);
@@ -279,7 +279,7 @@ TCString CProtoSettings::GetMsgFormat(int Flags, int *pOrder)
TreeCtrl->DBToMem(CString(MOD_NAME));
Message = NULL;
if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_USELASTMSG)) { // if using last message by default...
- Message = db_get_s(NULL, MOD_NAME, ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS), (TCHAR*)NULL); // try per-protocol message first
+ Message = db_get_s(NULL, MOD_NAME, ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS), (wchar_t*)NULL); // try per-protocol message first
if (Message.IsEmpty()) {
Message = NULL; // to be sure it's NULL, not "" - as we're checking 'Message == NULL' later
int RecentGroupID = GetRecentGroupID(Status);
diff --git a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp
index a095882f72..bc8398e62e 100644
--- a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp
+++ b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp
@@ -62,10 +62,10 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
awayData->hSeq = (HANDLE)ProtoChainSend(awayData->hContact, PSS_GETAWAYMSG, 0, 0);
WindowList_Add(g_hReadWndList, hwndDlg, awayData->hContact);
- TCHAR str[256], format[128];
- TCHAR *contactName = pcli->pfnGetContactDisplayName(awayData->hContact, 0);
+ wchar_t str[256], format[128];
+ wchar_t *contactName = pcli->pfnGetContactDisplayName(awayData->hContact, 0);
char *szProto = GetContactProto(awayData->hContact);
- TCHAR *status = pcli->pfnGetStatusModeDescription(db_get_w(awayData->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
+ wchar_t *status = pcli->pfnGetStatusModeDescription(db_get_w(awayData->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
GetWindowText(hwndDlg, format, _countof(format));
mir_sntprintf(str, format, status, contactName);
SetWindowText(hwndDlg, str);
@@ -88,7 +88,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
UnhookEvent(awayData->hAwayMsgEvent);
awayData->hAwayMsgEvent = NULL;
}
- const TCHAR *ptszStatusMsg = (const TCHAR*)ack->lParam;
+ const wchar_t *ptszStatusMsg = (const wchar_t*)ack->lParam;
SetDlgItemText(hwndDlg, IDC_READAWAYMSG_MSG, ptszStatusMsg);
ShowWindow(GetDlgItem(hwndDlg, IDC_READAWAYMSG_RETRIEVE), SW_HIDE);
ShowWindow(GetDlgItem(hwndDlg, IDC_READAWAYMSG_MSG), SW_SHOW);
diff --git a/plugins/NewAwaySysMod/src/Services.cpp b/plugins/NewAwaySysMod/src/Services.cpp
index 46399f0b97..f961e23d84 100644
--- a/plugins/NewAwaySysMod/src/Services.cpp
+++ b/plugins/NewAwaySysMod/src/Services.cpp
@@ -29,7 +29,7 @@ struct NAS_PROTOINFOv1
union {
char *szMsg;
WCHAR *wszMsg;
- TCHAR *tszMsg;
+ wchar_t *tszMsg;
};
WORD status;
};
@@ -68,7 +68,7 @@ INT_PTR SetStatusMode(WPARAM wParam, LPARAM lParam) // called by GamerStatus and
_ASSERT(!g_fNoProcessing && g_ProtoStates[(char*)NULL].m_status == wParam);
g_fNoProcessing = false;
- CProtoSettings(NULL, wParam).SetMsgFormat(SMF_TEMPORARY, lParam ? (TCHAR*)_A2T((char*)lParam) : CProtoSettings(NULL, wParam).GetMsgFormat(GMF_LASTORDEFAULT));
+ CProtoSettings(NULL, wParam).SetMsgFormat(SMF_TEMPORARY, lParam ? (wchar_t*)_A2T((char*)lParam) : CProtoSettings(NULL, wParam).GetMsgFormat(GMF_LASTORDEFAULT));
ChangeProtoMessages(NULL, wParam, TCString());
return 0;
}
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
index 6d124b2157..9d0346a124 100644
--- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
+++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
@@ -78,9 +78,9 @@ static LRESULT CALLBACK MsgEditSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam,
SendMessage(hWnd, WM_KEYDOWN, VK_LEFT, 0);
SendMessage(hWnd, EM_GETSEL, (WPARAM)&start, NULL);
int nLen = GetWindowTextLength(hWnd);
- TCHAR *text = (TCHAR*)_alloca((nLen + 1) * sizeof(TCHAR));
+ wchar_t *text = (wchar_t*)_alloca((nLen + 1) * sizeof(wchar_t));
GetWindowText(hWnd, text, nLen + 1);
- memmove(text + start, text + end, sizeof(TCHAR)* (mir_tstrlen(text) + 1 - end));
+ memmove(text + start, text + end, sizeof(wchar_t)* (mir_tstrlen(text) + 1 - end));
SetWindowText(hWnd, text);
SendMessage(hWnd, EM_SETSEL, start, start);
@@ -439,24 +439,24 @@ HICON g_LoadIconEx(const char* name, bool big)
struct {
int DlgItem, IconIndex;
- TCHAR* Text;
+ wchar_t* Text;
}
static Buttons[] =
{
- { IDC_SAWAYMSG_SAVEMSG, ILI_SAVE, LPGENT("Save, replacing the selected message") },
- { IDC_SAWAYMSG_SAVEASNEW, ILI_SAVEASNEW, LPGENT("Save as a new message") },
- { IDC_SAWAYMSG_NEWCATEGORY, ILI_NEWCATEGORY, LPGENT("Create new category") },
- { IDC_SAWAYMSG_DELETE, ILI_DELETE, LPGENT("Delete") },
- { IDC_SAWAYMSG_VARS, ILI_NOICON, LPGENT("Open Variables help dialog") },
- { IDC_SAWAYMSG_OPTIONS, ILI_SETTINGS, LPGENT("Show settings menu") }
+ { IDC_SAWAYMSG_SAVEMSG, ILI_SAVE, LPGENW("Save, replacing the selected message") },
+ { IDC_SAWAYMSG_SAVEASNEW, ILI_SAVEASNEW, LPGENW("Save as a new message") },
+ { IDC_SAWAYMSG_NEWCATEGORY, ILI_NEWCATEGORY, LPGENW("Create new category") },
+ { IDC_SAWAYMSG_DELETE, ILI_DELETE, LPGENW("Delete") },
+ { IDC_SAWAYMSG_VARS, ILI_NOICON, LPGENW("Open Variables help dialog") },
+ { IDC_SAWAYMSG_OPTIONS, ILI_SETTINGS, LPGENW("Show settings menu") }
};
struct {
int m_dlgItemID;
- TCHAR* Text;
+ wchar_t* Text;
} Tooltips[] = {
- IDC_SAWAYMSG_IGNOREREQ, LPGENT("Don't send the status message to selected contact(s)"),
- IDC_SAWAYMSG_SENDMSG, LPGENT("Send an autoreply to selected contact(s)"),
+ IDC_SAWAYMSG_IGNOREREQ, LPGENW("Don't send the status message to selected contact(s)"),
+ IDC_SAWAYMSG_SENDMSG, LPGENW("Send an autoreply to selected contact(s)"),
};
INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
@@ -727,7 +727,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
if (Message == NULL)
Message = CurMessage;
- else if (CurMessage != (const TCHAR*)Message) {
+ else if (CurMessage != (const wchar_t*)Message) {
Message = L"";
BtnTitle = TranslateT("Apply");
MessageDetermined = true;
@@ -842,7 +842,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
SendMessage(hwndDlg, UM_SAM_APPLYANDCLOSE, 0, 0);
return true;
}
- TCHAR BtnTitle[64];
+ wchar_t BtnTitle[64];
mir_sntprintf(BtnTitle, TranslateT("Closing in %d"), Countdown);
SetDlgItemText(hwndDlg, IDC_OK, BtnTitle);
Countdown--;
@@ -1016,7 +1016,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
switch (HIWORD(wParam)) {
case EN_CHANGE:
if (LOWORD(wParam) == IDC_SAWAYMSG_MSGDATA)
- SetDlgItemText(hwndDlg, IDC_OK, TranslateTS((GetSelContactsNum(CList) > 1) ? LPGENT("Apply") : LPGENT("OK")));
+ SetDlgItemText(hwndDlg, IDC_OK, TranslateTS((GetSelContactsNum(CList) > 1) ? LPGENW("Apply") : LPGENW("OK")));
break;
case EN_KILLFOCUS:
@@ -1127,7 +1127,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
TCString NewMsg;
GetDlgItemText(hwndDlg, IDC_SAWAYMSG_MSGDATA, NewMsg.GetBuffer(AWAY_MSGDATA_MAX), AWAY_MSGDATA_MAX);
NewMsg.ReleaseBuffer();
- if (((CTreeItem*)TreeItem)->User_Str1 != (const TCHAR*)NewMsg) {
+ if (((CTreeItem*)TreeItem)->User_Str1 != (const wchar_t*)NewMsg) {
((CTreeItem*)TreeItem)->User_Str1 = NewMsg;
MsgTree->SetModified(true);
}
@@ -1166,7 +1166,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
GetDlgItemText(hwndDlg, IDC_OK, BtnTitle.GetBuffer(64), 64);
BtnTitle.ReleaseBuffer();
ApplySelContactsMessage(dat, CList);
- if (BtnTitle != (const TCHAR*)TranslateT("Apply"))
+ if (BtnTitle != (const wchar_t*)TranslateT("Apply"))
SendMessage(hwndDlg, UM_SAM_APPLYANDCLOSE, 0, 0);
}
}
diff --git a/plugins/NewAwaySysMod/src/stdafx.h b/plugins/NewAwaySysMod/src/stdafx.h
index d22135d6a1..1c2966b9be 100644
--- a/plugins/NewAwaySysMod/src/stdafx.h
+++ b/plugins/NewAwaySysMod/src/stdafx.h
@@ -34,7 +34,6 @@
#include <time.h>
#include <shellapi.h>
#include <crtdbg.h>
-#include <tchar.h>
#include <stdarg.h>
#include "newpluginapi.h"
@@ -137,13 +136,15 @@
#define WRITE_INTERPRET 4
#define WRITE_CMSG 8
-#define TOGGLE_SOE_COMMAND LPGENT("Toggle autoreply on/off")
-#define DISABLE_SOE_COMMAND LPGENT("Toggle autoreply off")
-#define ENABLE_SOE_COMMAND LPGENT("Toggle autoreply on")
+#define TOGGLE_SOE_COMMAND LPGENW("Toggle autoreply on/off")
+#define DISABLE_SOE_COMMAND LPGENW("Toggle autoreply off")
+#define ENABLE_SOE_COMMAND LPGENW("Toggle autoreply on")
#define STR_XSTATUSDESC TranslateT("extended status")
#define MOD_NAME "NewAwaySys"
+#define MOD_NAMEW L"NewAwaySys"
+
#define LOG_ID MOD_NAME // LogService log ID
#define LOG_PREFIX MOD_NAME ": " // netlib.log prefix for all NAS' messages
@@ -198,7 +199,7 @@
#define VPF_XSTATUS 1 // use "extended status" instead of the usual status description in %nas_statdesc%, and XStatus message in %nas_message%
// options dialog
-#define OPT_TITLE LPGENT("Away System")
+#define OPT_TITLE LPGENW("Away System")
#define OPT_MAINGROUP LPGEN("Status")
#define OPT_POPUPGROUP LPGEN("Popups")
@@ -300,7 +301,7 @@ void InitOptions(); // called once when plugin is loaded
//int ShowPopupNotification(COptPage &PopupNotifyData, MCONTACT hContact, int iStatusMode);
void ShowLog(TCString &LogFilePath);
-void ShowMsg(TCHAR *szFirstLine, TCHAR *szSecondLine = L"", bool IsErrorMsg = false, int Timeout = 0);
+void ShowMsg(wchar_t *szFirstLine, wchar_t *szSecondLine = L"", bool IsErrorMsg = false, int Timeout = 0);
#define AWAYSYS_STATUSMSGREQUEST_SOUND "AwaySysStatusMsgRequest"
#define ME_AWAYSYS_WORKAROUND "AwaySys/_CallService"
@@ -323,7 +324,7 @@ static __inline int LogMessage(const char *Format, ...)
return CallService(MS_NETLIB_LOG, NULL, (LPARAM)szText);
}
-__inline int CallAllowedPS_SETAWAYMSG(const char *szProto, int iMode, const TCHAR *szMsg)
+__inline int CallAllowedPS_SETAWAYMSG(const char *szProto, int iMode, const wchar_t *szMsg)
{ // we must use this function everywhere we want to call PS_SETAWAYMSG, otherwise NAS won't allow to change the message!
LogMessage("PS_SETAWAYMSG called by NAS. szProto=%s, Status=%d, Msg:\n%S", szProto, iMode, szMsg ? szMsg : L"NULL");
return CallProtoService(szProto, PS_SETAWAYMSG, iMode, (LPARAM)szMsg);
diff --git a/plugins/NewEventNotify/src/menuitem.cpp b/plugins/NewEventNotify/src/menuitem.cpp
index 9b4b74abc1..8f32bb2949 100644
--- a/plugins/NewEventNotify/src/menuitem.cpp
+++ b/plugins/NewEventNotify/src/menuitem.cpp
@@ -50,7 +50,7 @@ int MenuitemInit(BOOL bStatus)
{
CreateServiceFunction(MS_NEN_MENUNOTIFY, MenuitemNotifyCmd);
- HGENMENU hRoot = Menu_CreateRoot(MO_MAIN, LPGENT("Popups"), 0);
+ HGENMENU hRoot = Menu_CreateRoot(MO_MAIN, LPGENW("Popups"), 0);
CMenuItem mi;
SET_UID(mi, 0x7aed93f7, 0x835, 0x4ff6, 0xb1, 0x34, 0xae, 0x0, 0x21, 0x2a, 0xd7, 0x81);
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp
index 2202d1de62..41b792d5c6 100644
--- a/plugins/NewEventNotify/src/popup.cpp
+++ b/plugins/NewEventNotify/src/popup.cpp
@@ -168,10 +168,10 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
return DefWindowProc(hWnd, message, wParam, lParam);
}
-static TCHAR* GetEventPreview(DBEVENTINFO *dbei)
+static wchar_t* GetEventPreview(DBEVENTINFO *dbei)
{
- TCHAR *comment1 = NULL;
- TCHAR *comment2 = NULL;
+ wchar_t *comment1 = NULL;
+ wchar_t *comment2 = NULL;
char *commentFix = NULL;
//now get text
@@ -182,9 +182,9 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei)
// utf-8 in blob
comment1 = mir_utf8decodeT((char*)dbei->pBlob);
}
- else if (dbei->cbBlob == (mir_tstrlen((TCHAR *)dbei->pBlob)+1)*(sizeof(TCHAR)+1)) {
+ else if (dbei->cbBlob == (mir_tstrlen((wchar_t *)dbei->pBlob)+1)*(sizeof(wchar_t)+1)) {
// wchar in blob (the old hack)
- comment1 = mir_tstrdup((TCHAR*)dbei->pBlob);
+ comment1 = mir_tstrdup((wchar_t*)dbei->pBlob);
}
else comment1 = mir_a2t((char *)dbei->pBlob);
}
@@ -220,7 +220,7 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei)
char* pcBlob = (char *)dbei->pBlob;
char* pcEnd = (char *)(dbei->pBlob + dbei->cbBlob);
int nContacts;
- TCHAR szBuf[512];
+ wchar_t szBuf[512];
for (nContacts = 1; ; nContacts++) {
// Nick
@@ -247,8 +247,8 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei)
case EVENTTYPE_ADDED:
if (dbei->pBlob) {
char szUin[16];
- TCHAR szBuf[2048];
- TCHAR* szNick = NULL;
+ wchar_t szBuf[2048];
+ wchar_t* szNick = NULL;
char *pszNick = (char *)dbei->pBlob + 8;
char *pszFirst = pszNick + mir_strlen(pszNick) + 1;
char *pszLast = pszFirst + mir_strlen(pszFirst) + 1;
@@ -283,8 +283,8 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei)
case EVENTTYPE_AUTHREQUEST:
if (dbei->pBlob) {
char szUin[16];
- TCHAR szBuf[2048];
- TCHAR* szNick = NULL;
+ wchar_t szBuf[2048];
+ wchar_t* szNick = NULL;
char *pszNick = (char *)dbei->pBlob + 8;
char *pszFirst = pszNick + mir_strlen(pszNick) + 1;
char *pszLast = pszFirst + mir_strlen(pszFirst) + 1;
@@ -342,9 +342,9 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei)
// utf-8 in blob
comment1 = mir_utf8decodeT((char*)dbei->pBlob);
}
- else if (dbei->cbBlob == (mir_tstrlen((TCHAR *)dbei->pBlob)+1)*(sizeof(TCHAR)+1)) {
+ else if (dbei->cbBlob == (mir_tstrlen((wchar_t *)dbei->pBlob)+1)*(sizeof(wchar_t)+1)) {
// wchar in blob (the old hack)
- comment1 = mir_tstrdup((TCHAR*)dbei->pBlob);
+ comment1 = mir_tstrdup((wchar_t*)dbei->pBlob);
}
else comment1 = mir_a2t((char *)dbei->pBlob);
}
@@ -359,9 +359,9 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei)
// utf-8 in blob
comment1 = mir_utf8decodeT((char*)dbei->pBlob);
}
- else if (dbei->cbBlob == (mir_tstrlen((TCHAR *)dbei->pBlob)+1)*(sizeof(TCHAR)+1)) {
+ else if (dbei->cbBlob == (mir_tstrlen((wchar_t *)dbei->pBlob)+1)*(sizeof(wchar_t)+1)) {
// wchar in blob (the old hack)
- comment1 = mir_tstrdup((TCHAR*)dbei->pBlob);
+ comment1 = mir_tstrdup((wchar_t*)dbei->pBlob);
}
else comment1 = mir_a2t((char *)dbei->pBlob);
}
@@ -374,7 +374,7 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei)
// support for custom database event types
if (pei && dbei->pBlob) {
DBEVENTGETTEXT svc = {dbei, DBVT_TCHAR, CP_ACP};
- TCHAR *pet = (TCHAR*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&svc);
+ wchar_t *pet = (wchar_t*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&svc);
if (pet) {
// we've got event text, move to our memory space
comment1 = mir_tstrdup(pet);
@@ -402,7 +402,7 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei)
int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, MEVENT hEvent, UINT eventType)
{
- TCHAR* sampleEvent;
+ wchar_t* sampleEvent;
long iSeconds;
//there has to be a maximum number of popups shown at the same time
@@ -490,12 +490,12 @@ int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, MEVENT hEvent, U
// if hContact is NULL, && hEvent is NULL then popup is only Test
if ((hContact == NULL) && (hEvent == NULL)) {
- _tcsncpy(pudw.lptzContactName, TranslateT("Plugin Test"), MAX_CONTACTNAME);
- _tcsncpy(pudw.lptzText, TranslateTS(sampleEvent), MAX_SECONDLINE);
+ wcsncpy(pudw.lptzContactName, TranslateT("Plugin Test"), MAX_CONTACTNAME);
+ wcsncpy(pudw.lptzText, TranslateTS(sampleEvent), MAX_SECONDLINE);
}
else { // get the needed event data
- _tcsncpy(pudw.lptzContactName, (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
- _tcsncpy(pudw.lptzText, ptrT(GetEventPreview(&dbe)), MAX_SECONDLINE);
+ wcsncpy(pudw.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
+ wcsncpy(pudw.lptzText, ptrT(GetEventPreview(&dbe)), MAX_SECONDLINE);
}
PopupCount++;
@@ -538,7 +538,7 @@ int PopupUpdate(MCONTACT hContact, MEVENT hEvent)
SetTimer(pdata->hWnd, TIMER_TO_ACTION, pdata->iSeconds * 1000, NULL);
}
- TCHAR lpzText[MAX_SECONDLINE*2] = L"\0\0";
+ wchar_t lpzText[MAX_SECONDLINE*2] = L"\0\0";
if (pdata->pluginOptions->bShowHeaders)
mir_sntprintf(lpzText, TranslateT("[b]Number of new message(s): %d[/b]\n"), pdata->countEvent);
@@ -570,19 +570,19 @@ int PopupUpdate(MCONTACT hContact, MEVENT hEvent)
db_event_get(eventData->hEvent, &dbe);
if (pdata->pluginOptions->bShowDate || pdata->pluginOptions->bShowTime) {
- TCHAR timestamp[MAX_DATASIZE];
- TCHAR formatTime[MAX_DATASIZE];
+ wchar_t timestamp[MAX_DATASIZE];
+ wchar_t formatTime[MAX_DATASIZE];
if (pdata->pluginOptions->bShowDate)
- _tcsncpy(formatTime, L"%Y.%m.%d", _countof(formatTime));
+ wcsncpy(formatTime, L"%Y.%m.%d", _countof(formatTime));
else if (pdata->pluginOptions->bShowTime)
mir_tstrncat(formatTime, L" %H:%M", _countof(formatTime) - mir_tstrlen(formatTime));
time_t localTime = dbe.timestamp;
- _tcsftime(timestamp, _countof(timestamp), formatTime, localtime(&localTime));
+ wcsftime(timestamp, _countof(timestamp), formatTime, localtime(&localTime));
mir_sntprintf(lpzText, L"%s[b][i]%s[/i][/b]\n", lpzText, timestamp);
}
// prepare event preview
- TCHAR* szEventPreview = GetEventPreview(&dbe);
+ wchar_t* szEventPreview = GetEventPreview(&dbe);
mir_sntprintf(lpzText, L"%s%s", lpzText, szEventPreview);
mir_free(szEventPreview);
diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp
index d43a0677fb..ee0aae304d 100644
--- a/plugins/NewXstatusNotify/src/indsnd.cpp
+++ b/plugins/NewXstatusNotify/src/indsnd.cpp
@@ -23,7 +23,7 @@
void PreviewSound(HWND hList)
{
- TCHAR buff[MAX_PATH], stzSoundPath[MAX_PATH];
+ wchar_t buff[MAX_PATH], stzSoundPath[MAX_PATH];
LVITEM lvi = { 0 };
lvi.mask = LVIF_PARAM;
@@ -33,7 +33,7 @@ void PreviewSound(HWND hList)
int hlpStatus = lvi.lParam;
ListView_GetItemText(hList, lvi.iItem, 1, buff, _countof(buff));
- if (!mir_tstrcmp(buff, TranslateT(DEFAULT_SOUND))) {
+ if (!mir_tstrcmp(buff, TranslateTS(DEFAULT_SOUND))) {
if (hlpStatus < ID_STATUS_MIN)
SkinPlaySound(StatusListEx[hlpStatus].lpzSkinSoundName);
else
@@ -51,26 +51,26 @@ BOOL RemoveSoundFromList(HWND hList)
if (iSel != -1) {
iSel = -1;
while ((iSel = ListView_GetNextItem(hList, iSel, LVNI_SELECTED)) != -1)
- ListView_SetItemText(hList, iSel, 1, TranslateT(DEFAULT_SOUND));
+ ListView_SetItemText(hList, iSel, 1, TranslateTS(DEFAULT_SOUND));
return TRUE;
}
return FALSE;
}
-TCHAR *SelectSound(HWND hwndDlg, TCHAR *buff, size_t bufflen)
+wchar_t *SelectSound(HWND hwndDlg, wchar_t *buff, size_t bufflen)
{
OPENFILENAME ofn = { 0 };
HWND hList = GetDlgItem(hwndDlg, IDC_INDSNDLIST);
ListView_GetItemText(hList, ListView_GetNextItem(hList, -1, LVNI_SELECTED), 1, buff, (DWORD)bufflen);
- if (!mir_tstrcmp(buff, TranslateT(DEFAULT_SOUND)))
+ if (!mir_tstrcmp(buff, TranslateTS(DEFAULT_SOUND)))
buff = NULL;
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = GetParent(hwndDlg);
ofn.hInstance = hInst;
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
if (GetModuleHandle(L"bass_interface.dll"))
mir_sntprintf(filter, L"%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%s (*.*)%c*%c", TranslateT("Sound files"), 0, 0, TranslateT("All files"), 0, 0);
else
@@ -132,7 +132,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
if (szProto) {
DBVARIANT dbv;
- TCHAR buff[MAX_PATH];
+ wchar_t buff[MAX_PATH];
for (int i = ID_STATUS_MAX; i >= ID_STATUS_MIN; i--) {
int flags = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_2, 0);
@@ -153,8 +153,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
mir_tstrcpy(buff, dbv.ptszVal);
db_free(&dbv);
}
- else
- mir_tstrcpy(buff, TranslateT(DEFAULT_SOUND));
+ else mir_tstrcpy(buff, TranslateTS(DEFAULT_SOUND));
ListView_SetItemText(hList, lvi.iItem, 1, buff);
}
@@ -171,11 +170,10 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
lvi.iItem = ListView_InsertItem(hList, &lvi);
if (!db_get_ts(hContact, MODULE, StatusList[i].lpzSkinSoundName, &dbv)) {
- _tcsncpy(buff, dbv.ptszVal, _countof(buff)-1);
+ wcsncpy(buff, dbv.ptszVal, _countof(buff)-1);
db_free(&dbv);
}
- else
- _tcsncpy(buff, TranslateT(DEFAULT_SOUND), _countof(buff)-1);
+ else wcsncpy(buff, TranslateTS(DEFAULT_SOUND), _countof(buff)-1);
ListView_SetItemText(hList, lvi.iItem, 1, buff);
}
@@ -202,7 +200,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
{
int iSel = ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_INDSNDLIST), -1, LVNI_SELECTED);
if (iSel != -1) {
- TCHAR stzFilePath[MAX_PATH];
+ wchar_t stzFilePath[MAX_PATH];
if (SelectSound(hwndDlg, stzFilePath, MAX_PATH - 1) != NULL) {
iSel = -1;
while ((iSel = ListView_GetNextItem(hList, iSel, LVNI_SELECTED)) != -1)
@@ -229,7 +227,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == PSN_APPLY) {
- TCHAR buff[MAX_PATH];
+ wchar_t buff[MAX_PATH];
LVITEM lvi = { 0 };
lvi.mask = LVIF_PARAM;
@@ -238,14 +236,14 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
ListView_GetItem(hList, &lvi);
ListView_GetItemText(hList, lvi.iItem, 1, buff, _countof(buff));
- if (!mir_tstrcmp(buff, TranslateT(DEFAULT_SOUND))) {
+ if (!mir_tstrcmp(buff, TranslateTS(DEFAULT_SOUND))) {
if (lvi.lParam < ID_STATUS_MIN)
db_unset(hContact, MODULE, StatusListEx[lvi.lParam].lpzSkinSoundName);
else
db_unset(hContact, MODULE, StatusList[Index(lvi.lParam)].lpzSkinSoundName);
}
else {
- TCHAR stzSoundPath[MAX_PATH] = { 0 };
+ wchar_t stzSoundPath[MAX_PATH] = { 0 };
PathToRelativeT(buff, stzSoundPath);
if (lvi.lParam < ID_STATUS_MIN)
db_set_ws(hContact, MODULE, StatusListEx[lvi.lParam].lpzSkinSoundName, stzSoundPath);
@@ -261,7 +259,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
switch (hlpControlID) {
case IDC_INDSNDLIST:
if (((LPNMHDR)lParam)->code == NM_DBLCLK) {
- TCHAR stzFilePath[MAX_PATH];
+ wchar_t stzFilePath[MAX_PATH];
if (SelectSound(hwndDlg, stzFilePath, MAX_PATH - 1) != NULL) {
int iSel = -1;
while ((iSel = ListView_GetNextItem(hList, iSel, LVNI_SELECTED)) != -1)
diff --git a/plugins/NewXstatusNotify/src/indsnd.h b/plugins/NewXstatusNotify/src/indsnd.h
index e3d0245e4a..784f107018 100644
--- a/plugins/NewXstatusNotify/src/indsnd.h
+++ b/plugins/NewXstatusNotify/src/indsnd.h
@@ -34,7 +34,7 @@
#define STATUS_COLUMN 110
-#define DEFAULT_SOUND LPGEN("(default sound)")
+#define DEFAULT_SOUND LPGENW("(default sound)")
int UserInfoInitialise(WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK DlgProcFiltering(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp
index fbf5aac0a4..db07011b5c 100644
--- a/plugins/NewXstatusNotify/src/main.cpp
+++ b/plugins/NewXstatusNotify/src/main.cpp
@@ -182,16 +182,16 @@ static int CompareStatusMsg(STATUSMSGINFO *smi, DBCONTACTWRITESETTING *cws_new,
return ret;
}
-TCHAR* GetStr(STATUSMSGINFO *n, const TCHAR *tmplt)
+wchar_t* GetStr(STATUSMSGINFO *n, const wchar_t *tmplt)
{
- if (n == NULL || tmplt == NULL || tmplt[0] == _T('\0'))
+ if (n == NULL || tmplt == NULL || tmplt[0] == '\0')
return NULL;
CMString res;
size_t len = mir_tstrlen(tmplt);
for (size_t i = 0; i < len; i++) {
- if (tmplt[i] == _T('%')) {
+ if (tmplt[i] == '%') {
i++;
switch (tmplt[i]) {
case 'n':
@@ -202,7 +202,7 @@ TCHAR* GetStr(STATUSMSGINFO *n, const TCHAR *tmplt)
break;
case 'o':
- if (n->oldstatusmsg == NULL || n->oldstatusmsg[0] == _T('\0') || mir_tstrcmp(n->oldstatusmsg, TranslateT("<no status message>")) == 0)
+ if (n->oldstatusmsg == NULL || n->oldstatusmsg[0] == '\0' || mir_tstrcmp(n->oldstatusmsg, TranslateT("<no status message>")) == 0)
res.Append(TranslateT("<no status message>"));
else
AddCR(res, n->oldstatusmsg);
@@ -228,7 +228,7 @@ TCHAR* GetStr(STATUSMSGINFO *n, const TCHAR *tmplt)
break;
}
}
- else if (tmplt[i] == _T('\\')) {
+ else if (tmplt[i] == '\\') {
i++;
switch (tmplt[i]) {
case 'n':
@@ -260,7 +260,7 @@ bool SkipHiddenContact(MCONTACT hContact)
return (!opt.HiddenContactsToo && (db_get_b(hContact, "CList", "Hidden", 0) == 1));
}
-void LogSMsgToDB(STATUSMSGINFO *smi, const TCHAR *tmplt)
+void LogSMsgToDB(STATUSMSGINFO *smi, const wchar_t *tmplt)
{
ptrT str(GetStr(smi, tmplt));
T2Utf blob(str);
@@ -284,32 +284,32 @@ void LogSMsgToDB(STATUSMSGINFO *smi, const TCHAR *tmplt)
}
}
-void GetStatusText(MCONTACT hContact, WORD newStatus, WORD oldStatus, TCHAR *stzStatusText)
+void GetStatusText(MCONTACT hContact, WORD newStatus, WORD oldStatus, wchar_t *stzStatusText)
{
if (opt.UseAlternativeText) {
switch (GetGender(hContact)) {
case GENDER_MALE:
- _tcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzMStatusText, MAX_STATUSTEXT);
+ wcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzMStatusText, MAX_STATUSTEXT);
break;
case GENDER_FEMALE:
- _tcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzFStatusText, MAX_STATUSTEXT);
+ wcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzFStatusText, MAX_STATUSTEXT);
break;
case GENDER_UNSPECIFIED:
- _tcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzUStatusText, MAX_STATUSTEXT);
+ wcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzUStatusText, MAX_STATUSTEXT);
break;
}
}
else
- _tcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzStandardText, MAX_STATUSTEXT);
+ wcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzStandardText, MAX_STATUSTEXT);
if (opt.ShowPreviousStatus) {
- TCHAR buff[MAX_STATUSTEXT];
+ wchar_t buff[MAX_STATUSTEXT];
mir_sntprintf(buff, TranslateTS(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(oldStatus)].lpzStandardText);
mir_tstrcat(mir_tstrcat(stzStatusText, L" "), buff);
}
}
-void BlinkIcon(MCONTACT hContact, HICON hIcon, TCHAR *stzText)
+void BlinkIcon(MCONTACT hContact, HICON hIcon, wchar_t *stzText)
{
CLISTEVENT cle = {};
cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
@@ -325,15 +325,15 @@ void PlayChangeSound(MCONTACT hContact, const char *name)
{
if (opt.UseIndSnd) {
DBVARIANT dbv;
- TCHAR stzSoundFile[MAX_PATH] = { 0 };
+ wchar_t stzSoundFile[MAX_PATH] = { 0 };
if (!db_get_ts(hContact, MODULE, name, &dbv)) {
- _tcsncpy(stzSoundFile, dbv.ptszVal, _countof(stzSoundFile)-1);
+ wcsncpy(stzSoundFile, dbv.ptszVal, _countof(stzSoundFile)-1);
db_free(&dbv);
}
if (stzSoundFile[0]) {
//Now make path to IndSound absolute, as it isn't registered
- TCHAR stzSoundPath[MAX_PATH];
+ wchar_t stzSoundPath[MAX_PATH];
PathToAbsoluteT(stzSoundFile, stzSoundPath);
SkinPlaySoundFile(stzSoundPath);
return;
@@ -347,7 +347,7 @@ void PlayChangeSound(MCONTACT hContact, const char *name)
int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus)
{
if (opt.LogToDB && (!opt.LogToDB_WinOpen || CheckMsgWnd(hContact))) {
- TCHAR stzStatusText[MAX_SECONDLINE] = { 0 };
+ wchar_t stzStatusText[MAX_SECONDLINE] = { 0 };
GetStatusText(hContact, newStatus, oldStatus, stzStatusText);
T2Utf blob(stzStatusText);
@@ -423,7 +423,7 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus)
if (bEnablePopup && db_get_b(hContact, MODULE, "EnablePopups", 1) && !opt.TempDisabled) {
WORD wStatus = (WORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
- TCHAR str[MAX_SECONDLINE] = { 0 };
+ wchar_t str[MAX_SECONDLINE] = { 0 };
if (opt.ShowStatus)
GetStatusText(hContact, newStatus, oldStatus, str);
@@ -440,7 +440,7 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus)
if (opt.BlinkIcon && !opt.TempDisabled) {
HICON hIcon = opt.BlinkIcon_Status ? Skin_LoadProtoIcon(szProto, newStatus) : Skin_LoadIcon(SKINICON_OTHER_USERONLINE);
- TCHAR str[256];
+ wchar_t str[256];
mir_sntprintf(str, TranslateT("%s is now %s"), pcli->pfnGetContactDisplayName(hContact, 0), StatusList[Index(newStatus)].lpzStandardText);
BlinkIcon(hContact, hIcon, str);
}
@@ -453,7 +453,7 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus)
}
if (opt.LogToFile) {
- TCHAR stzDate[MAX_STATUSTEXT], stzTime[MAX_STATUSTEXT], stzText[MAX_TEXT_LEN];
+ wchar_t stzDate[MAX_STATUSTEXT], stzTime[MAX_STATUSTEXT], stzText[MAX_TEXT_LEN];
GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL, L"HH':'mm", stzTime, _countof(stzTime));
GetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, L"dd/MM/yyyy", stzDate, _countof(stzDate));
@@ -628,7 +628,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact)
//don't show popup when mradio connecting and disconnecting
if (_stricmp(szProto, "mRadio") == 0 && !cws->value.type == DBVT_DELETED) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
mir_sntprintf(buf, L" (%s)", TranslateT("connecting"));
T2Utf pszUtf(buf);
mir_sntprintf(buf, L" (%s)", TranslateT("aborting"));
@@ -680,17 +680,17 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact)
if (bEnablePopup && db_get_b(hContact, MODULE, "EnablePopups", 1) && !opt.TempDisabled) {
// cut message if needed
- TCHAR *copyText = NULL;
+ wchar_t *copyText = NULL;
if (opt.PSMsgTruncate && (opt.PSMsgLen > 0) && smi.newstatusmsg && (mir_tstrlen(smi.newstatusmsg) > opt.PSMsgLen)) {
- TCHAR buff[MAX_TEXT_LEN + 3];
+ wchar_t buff[MAX_TEXT_LEN + 3];
copyText = mir_tstrdup(smi.newstatusmsg);
- _tcsncpy(buff, smi.newstatusmsg, opt.PSMsgLen);
+ wcsncpy(buff, smi.newstatusmsg, opt.PSMsgLen);
buff[opt.PSMsgLen] = 0;
mir_tstrcat(buff, L"...");
replaceStrT(smi.newstatusmsg, buff);
}
- TCHAR *str;
+ wchar_t *str;
if (smi.compare == COMPARE_DEL) {
char protoname[MAX_PATH];
mir_snprintf(protoname, "%s_TPopupSMsgRemoved", szProto);
@@ -730,7 +730,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact)
if (opt.BlinkIcon && opt.BlinkIcon_ForMsgs && !opt.TempDisabled) {
HICON hIcon = opt.BlinkIcon_Status ? Skin_LoadProtoIcon(szProto, db_get_w(hContact, szProto, "Status", ID_STATUS_ONLINE)) : Skin_LoadIcon(SKINICON_OTHER_USERONLINE);
- TCHAR str[256];
+ wchar_t str[256];
mir_sntprintf(str, TranslateT("%s changed status message to %s"), pcli->pfnGetContactDisplayName(hContact, 0), smi.newstatusmsg);
BlinkIcon(hContact, hIcon, str);
}
@@ -747,12 +747,12 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact)
LogSMsgToDB(&smi, smi.compare == COMPARE_DEL ? templates.LogSMsgRemoved : templates.LogSMsgChanged);
if (opt.SMsgLogToFile && db_get_b(hContact, MODULE, "EnableSMsgLogging", 1)) {
- TCHAR stzDate[MAX_STATUSTEXT], stzTime[MAX_STATUSTEXT], stzText[MAX_TEXT_LEN];
+ wchar_t stzDate[MAX_STATUSTEXT], stzTime[MAX_STATUSTEXT], stzText[MAX_TEXT_LEN];
GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL, L"HH':'mm", stzTime, _countof(stzTime));
GetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, L"dd/MM/yyyy", stzDate, _countof(stzDate));
- TCHAR *str;
+ wchar_t *str;
if (smi.compare == COMPARE_DEL)
str = GetStr(&smi, templates.LogSMsgRemoved);
else
@@ -855,7 +855,7 @@ void InitStatusList()
mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) is back online!"), MAX_STATUSTEXT);
mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Online"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserOnline", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Online"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Online"), MAX_SKINSOUNDDESC);
mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"global.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40072bg", COLOR_BG_AVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40072tx", COLOR_TX_DEFAULT);
@@ -867,7 +867,7 @@ void InitStatusList()
mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) went offline! :("), MAX_STATUSTEXT);
mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Offline"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserOffline", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Offline"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Offline"), MAX_SKINSOUNDDESC);
mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"offline.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40071bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40071tx", COLOR_TX_DEFAULT);
@@ -879,7 +879,7 @@ void InitStatusList()
mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) hides in shadows..."), MAX_STATUSTEXT);
mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Invisible"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserInvisible", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Invisible"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Invisible"), MAX_SKINSOUNDDESC);
mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"invisible.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40078bg", COLOR_BG_AVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40078tx", COLOR_TX_DEFAULT);
@@ -891,7 +891,7 @@ void InitStatusList()
mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) feels talkative!"), MAX_STATUSTEXT);
mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Free for chat"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserFreeForChat", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Free for chat"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Free for chat"), MAX_SKINSOUNDDESC);
mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"free4chat.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40077bg", COLOR_BG_AVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40077tx", COLOR_TX_DEFAULT);
@@ -903,7 +903,7 @@ void InitStatusList()
mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) went away"), MAX_STATUSTEXT);
mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Away"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserAway", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Away"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Away"), MAX_SKINSOUNDDESC);
mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"away.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40073bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40073tx", COLOR_TX_DEFAULT);
@@ -915,7 +915,7 @@ void InitStatusList()
mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) isn't there anymore!"), MAX_STATUSTEXT);
mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Not available"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserNA", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Not available"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Not available"), MAX_SKINSOUNDDESC);
mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"na.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40075bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40075tx", COLOR_TX_DEFAULT);
@@ -927,7 +927,7 @@ void InitStatusList()
mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) has something else to do"), MAX_STATUSTEXT);
mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Occupied"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserOccupied", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Occupied"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Occupied"), MAX_SKINSOUNDDESC);
mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"occupied.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40076bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40076tx", COLOR_TX_DEFAULT);
@@ -939,7 +939,7 @@ void InitStatusList()
mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) doesn't want to be disturbed!"), MAX_STATUSTEXT);
mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Do not disturb"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserDND", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Do not disturb"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Do not disturb"), MAX_SKINSOUNDDESC);
mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"dnd.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40074bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40074tx", COLOR_TX_DEFAULT);
@@ -951,7 +951,7 @@ void InitStatusList()
mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) is eating something"), MAX_STATUSTEXT);
mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("Out to lunch"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserOutToLunch", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: Out to lunch"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: Out to lunch"), MAX_SKINSOUNDDESC);
mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"lunch.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40080bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40080tx", COLOR_TX_DEFAULT);
@@ -963,7 +963,7 @@ void InitStatusList()
mir_tstrncpy(StatusList[index].lpzUStatusText, TranslateT("(U) had to answer the phone"), MAX_STATUSTEXT);
mir_tstrncpy(StatusList[index].lpzStandardText, TranslateT("On the phone"), MAX_STANDARDTEXT);
mir_strncpy(StatusList[index].lpzSkinSoundName, "UserOnThePhone", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENT("User: On the phone"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusList[index].lpzSkinSoundDesc, LPGENW("User: On the phone"), MAX_SKINSOUNDDESC);
mir_tstrncpy(StatusList[index].lpzSkinSoundFile, L"phone.wav", MAX_PATH);
StatusList[index].colorBack = db_get_dw(NULL, MODULE, "40079bg", COLOR_BG_NAVAILDEFAULT);
StatusList[index].colorText = db_get_dw(NULL, MODULE, "40079tx", COLOR_TX_DEFAULT);
@@ -981,37 +981,37 @@ void InitStatusList()
//From offline
index = ID_STATUS_FROMOFFLINE;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, "UserFromOffline", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("User: from offline (has priority!)"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("User: from offline (has priority!)"), MAX_SKINSOUNDDESC);
//Status message removed
index = ID_STATUS_SMSGREMOVED;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, "StatusMsgRemoved", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Status message removed"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Status message removed"), MAX_SKINSOUNDDESC);
//Status message changed
index = ID_STATUS_SMSGCHANGED;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, "StatusMsgChanged", MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Status message changed"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Status message changed"), MAX_SKINSOUNDDESC);
//Extra status removed
index = ID_STATUS_XREMOVED;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, XSTATUS_SOUND_REMOVED, MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Extra status removed"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Extra status removed"), MAX_SKINSOUNDDESC);
//Extra status message changed
index = ID_STATUS_XMSGCHANGED;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, XSTATUS_SOUND_MSGCHANGED, MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Extra status message changed"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Extra status message changed"), MAX_SKINSOUNDDESC);
//Extra status changed
index = ID_STATUS_XCHANGED;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, XSTATUS_SOUND_CHANGED, MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Extra status changed"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Extra status changed"), MAX_SKINSOUNDDESC);
//Extra status message removed
index = ID_STATUS_XMSGREMOVED;
mir_strncpy(StatusListEx[index].lpzSkinSoundName, XSTATUS_SOUND_MSGREMOVED, MAX_SKINSOUNDNAME);
- mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENT("Extra status message removed"), MAX_SKINSOUNDDESC);
+ mir_tstrncpy(StatusListEx[index].lpzSkinSoundDesc, LPGENW("Extra status message removed"), MAX_SKINSOUNDDESC);
}
void CALLBACK ConnectionTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD)
@@ -1060,9 +1060,9 @@ INT_PTR EnableDisableMenuCommand(WPARAM, LPARAM)
db_set_b(0, MODULE, "TempDisable", opt.TempDisabled = !opt.TempDisabled);
if (opt.TempDisabled)
- Menu_ModifyItem(hEnableDisableMenu, LPGENT("Enable status notification"), GetIconHandle(ICO_NOTIFICATION_OFF));
+ Menu_ModifyItem(hEnableDisableMenu, LPGENW("Enable status notification"), GetIconHandle(ICO_NOTIFICATION_OFF));
else
- Menu_ModifyItem(hEnableDisableMenu, LPGENT("Disable status notification"), GetIconHandle(ICO_NOTIFICATION_ON));
+ Menu_ModifyItem(hEnableDisableMenu, LPGENW("Disable status notification"), GetIconHandle(ICO_NOTIFICATION_ON));
CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hToolbarButton, opt.TempDisabled ? 0 : TTBST_PUSHED);
return 0;
@@ -1074,7 +1074,7 @@ void InitMainMenuItem()
SET_UID(mi, 0x22b7b4db, 0xa9a1, 0x4d43, 0x88, 0x80, 0x4c, 0x23, 0x20, 0x31, 0xc6, 0xa0);
mi.flags = CMIF_TCHAR;
if (ServiceExists(MS_POPUP_ADDPOPUPT))
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Popups"), 0);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Popups"), 0);
mi.pszService = MS_STATUSCHANGE_MENUCOMMAND;
hEnableDisableMenu = Menu_AddMainMenuItem(&mi);
@@ -1096,10 +1096,10 @@ void InitIcolib()
void InitSound()
{
for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX; i++)
- SkinAddNewSoundExT(StatusList[Index(i)].lpzSkinSoundName, LPGENT("Status Notify"), StatusList[Index(i)].lpzSkinSoundDesc);
+ SkinAddNewSoundExT(StatusList[Index(i)].lpzSkinSoundName, LPGENW("Status Notify"), StatusList[Index(i)].lpzSkinSoundDesc);
for (int i = 0; i <= ID_STATUSEX_MAX; i++)
- SkinAddNewSoundExT(StatusListEx[i].lpzSkinSoundName, LPGENT("Status Notify"), StatusListEx[i].lpzSkinSoundDesc);
+ SkinAddNewSoundExT(StatusListEx[i].lpzSkinSoundName, LPGENW("Status Notify"), StatusListEx[i].lpzSkinSoundDesc);
}
int InitTopToolbar(WPARAM, LPARAM)
diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp
index f981556d39..61ca3ad9a7 100644
--- a/plugins/NewXstatusNotify/src/options.cpp
+++ b/plugins/NewXstatusNotify/src/options.cpp
@@ -246,7 +246,7 @@ INT_PTR CALLBACK DlgProcGeneralOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
break;
case IDC_BT_CHOOSELOGFILE:
{
- TCHAR buff[MAX_PATH];
+ wchar_t buff[MAX_PATH];
OPENFILENAME ofn = { 0 };
GetDlgItemText(hwndDlg, IDC_LOGFILE, buff, _countof(buff));
@@ -255,7 +255,7 @@ INT_PTR CALLBACK DlgProcGeneralOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
ofn.lpstrFile = buff;
ofn.nMaxFile = MAX_PATH;
ofn.hwndOwner = hwndDlg;
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
mir_sntprintf(filter, L"%s (*.*)%c*.*%c%s (*.log)%c*.log%c%s (*.txt)%c*.txt%c", TranslateT("All Files"), 0, 0, TranslateT("Log"), 0, 0, TranslateT("Text"), 0, 0);
ofn.lpstrFilter = filter;
ofn.nFilterIndex = 2;
@@ -379,18 +379,18 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
break;
case IDC_PREVIEW:
{
- TCHAR str[MAX_SECONDLINE] = { 0 };
+ wchar_t str[MAX_SECONDLINE] = { 0 };
for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX; i++) {
- _tcsncpy(str, L"", _countof(str));
+ wcsncpy(str, L"", _countof(str));
if (opt.ShowStatus) {
if (opt.UseAlternativeText == 1)
- _tcsncpy(str, StatusList[Index(i)].lpzUStatusText, _countof(str));
+ wcsncpy(str, StatusList[Index(i)].lpzUStatusText, _countof(str));
else
- _tcsncpy(str, StatusList[Index(i)].lpzStandardText, _countof(str));
+ wcsncpy(str, StatusList[Index(i)].lpzStandardText, _countof(str));
if (opt.ShowPreviousStatus) {
- TCHAR buff[MAX_STATUSTEXT];
+ wchar_t buff[MAX_STATUSTEXT];
mir_sntprintf(buff, TranslateTS(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(i)].lpzStandardText);
mir_tstrcat(str, L" ");
mir_tstrcat(str, buff);
@@ -405,9 +405,9 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
ShowChangePopup(NULL, Skin_LoadProtoIcon(NULL, i), i, str);
}
- _tcsncpy(str, TranslateT("This is extra status"), _countof(str));
+ wcsncpy(str, TranslateT("This is extra status"), _countof(str));
ShowChangePopup(NULL, Skin_LoadProtoIcon(NULL, ID_STATUS_ONLINE), ID_STATUS_EXTRASTATUS, str);
- _tcsncpy(str, TranslateT("This is status message"), _countof(str));
+ wcsncpy(str, TranslateT("This is status message"), _countof(str));
ShowChangePopup(NULL, Skin_LoadProtoIcon(NULL, ID_STATUS_ONLINE), ID_STATUS_STATUSMSG, str);
return FALSE;
@@ -557,12 +557,12 @@ INT_PTR CALLBACK DlgProcXPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
EnableWindow(GetDlgItem(hwndDlg, IDC_ED_TREMOVEMSG), templates.PopupXFlags & NOTIFY_REMOVE_MESSAGE);
// Buttons
- SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Show available variables"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show available variables"), BATF_TCHAR);
HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_VARIABLES));
SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
DestroyIcon(hIcon);
- SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Reset all templates to default"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset all templates to default"), BATF_TCHAR);
hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RESET));
SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
DestroyIcon(hIcon);
@@ -691,12 +691,12 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
EnableWindow(GetDlgItem(hwndDlg, IDC_ED_TSMSGREMOVE), templates.PopupSMsgFlags & NOTIFY_REMOVE_MESSAGE);
// Buttons
- SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Show available variables"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show available variables"), BATF_TCHAR);
HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_VARIABLES));
SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
DestroyIcon(hIcon);
- SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Reset all templates to default"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset all templates to default"), BATF_TCHAR);
hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RESET));
SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
DestroyIcon(hIcon);
@@ -731,17 +731,17 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
char protoname[MAX_PATH] = { 0 };
mir_snprintf(protoname, "%s_TPopupSMsgChanged", protos[i]->szModuleName);
if (db_get_ts(NULL, MODULE, protoname, &dbVar))
- _tcsncpy(prototemplate->ProtoTemplateMsg, DEFAULT_POPUP_SMSGCHANGED, _countof(prototemplate->ProtoTemplateMsg));
+ wcsncpy(prototemplate->ProtoTemplateMsg, DEFAULT_POPUP_SMSGCHANGED, _countof(prototemplate->ProtoTemplateMsg));
else {
- _tcsncpy(prototemplate->ProtoTemplateMsg, dbVar.ptszVal, _countof(prototemplate->ProtoTemplateMsg));
+ wcsncpy(prototemplate->ProtoTemplateMsg, dbVar.ptszVal, _countof(prototemplate->ProtoTemplateMsg));
db_free(&dbVar);
}
mir_snprintf(protoname, "%s_TPopupSMsgRemoved", protos[i]->szModuleName);
if (db_get_ts(NULL, MODULE, protoname, &dbVar))
- _tcsncpy(prototemplate->ProtoTemplateRemoved, DEFAULT_POPUP_SMSGREMOVED, _countof(prototemplate->ProtoTemplateRemoved));
+ wcsncpy(prototemplate->ProtoTemplateRemoved, DEFAULT_POPUP_SMSGREMOVED, _countof(prototemplate->ProtoTemplateRemoved));
else {
- _tcsncpy(prototemplate->ProtoTemplateRemoved, dbVar.ptszVal, _countof(prototemplate->ProtoTemplateRemoved));
+ wcsncpy(prototemplate->ProtoTemplateRemoved, dbVar.ptszVal, _countof(prototemplate->ProtoTemplateRemoved));
db_free(&dbVar);
}
diff --git a/plugins/NewXstatusNotify/src/options.h b/plugins/NewXstatusNotify/src/options.h
index 1753401455..adf561dd00 100644
--- a/plugins/NewXstatusNotify/src/options.h
+++ b/plugins/NewXstatusNotify/src/options.h
@@ -49,7 +49,7 @@ typedef struct tagOPTIONS {
BYTE BlinkIcon;
BYTE BlinkIcon_Status;
BYTE BlinkIcon_ForMsgs;
- TCHAR LogFilePath[MAX_PATH];
+ wchar_t LogFilePath[MAX_PATH];
// IDD_AUTODISABLE
BYTE OnlyGlobalChanges;
BYTE DisableSoundGlobally;
@@ -86,18 +86,18 @@ typedef struct tagTEMPLATES {
BYTE PopupSMsgFlags;
BYTE LogXFlags;
BYTE LogSMsgFlags;
- TCHAR PopupXstatusChanged[256];
- TCHAR PopupXstatusRemoved[256];
- TCHAR PopupXMsgChanged[256];
- TCHAR PopupXMsgRemoved[256];
- TCHAR LogXstatusChanged[256];
- TCHAR LogXstatusRemoved[256];
- TCHAR LogXMsgChanged[256];
- TCHAR LogXMsgRemoved[256];
- TCHAR LogXstatusOpening[256];
- TCHAR LogSMsgChanged[256];
- TCHAR LogSMsgRemoved[256];
- TCHAR LogSMsgOpening[256];
+ wchar_t PopupXstatusChanged[256];
+ wchar_t PopupXstatusRemoved[256];
+ wchar_t PopupXMsgChanged[256];
+ wchar_t PopupXMsgRemoved[256];
+ wchar_t LogXstatusChanged[256];
+ wchar_t LogXstatusRemoved[256];
+ wchar_t LogXMsgChanged[256];
+ wchar_t LogXMsgRemoved[256];
+ wchar_t LogXstatusOpening[256];
+ wchar_t LogSMsgChanged[256];
+ wchar_t LogSMsgRemoved[256];
+ wchar_t LogSMsgOpening[256];
} TEMPLATES;
int OptionsInitialize(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/NewXstatusNotify/src/popup.cpp b/plugins/NewXstatusNotify/src/popup.cpp
index c4aad62f4f..a6346e67d9 100644
--- a/plugins/NewXstatusNotify/src/popup.cpp
+++ b/plugins/NewXstatusNotify/src/popup.cpp
@@ -21,7 +21,7 @@
#include "stdafx.h"
-void ShowChangePopup(MCONTACT hContact, HICON hIcon, WORD newStatus, const TCHAR *stzText, PLUGINDATA *pdp)
+void ShowChangePopup(MCONTACT hContact, HICON hIcon, WORD newStatus, const wchar_t *stzText, PLUGINDATA *pdp)
{
POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact;
@@ -34,9 +34,9 @@ void ShowChangePopup(MCONTACT hContact, HICON hIcon, WORD newStatus, const TCHAR
if (tszGroup)
buf.AppendFormat(L" (%s)", tszGroup);
}
- _tcsncpy_s(ppd.lptzContactName, buf, _TRUNCATE);
+ wcsncpy_s(ppd.lptzContactName, buf, _TRUNCATE);
- _tcsncpy(ppd.lptzText, stzText, _countof(ppd.lptzText));
+ wcsncpy(ppd.lptzText, stzText, _countof(ppd.lptzText));
switch (opt.Colors) {
case POPUP_COLOR_OWN:
@@ -79,15 +79,15 @@ static int AwayMsgHook(WPARAM, LPARAM lParam, LPARAM pObj)
MCONTACT hContact = PUGetContact(pdp->hWnd);
ptrT pstzLast(db_get_tsa(hContact, MODULE, "LastPopupText"));
- TCHAR *tszStatus = (TCHAR *)ack->lParam;
+ wchar_t *tszStatus = (wchar_t *)ack->lParam;
if (tszStatus == NULL || *tszStatus == 0)
return 0;
- TCHAR stzText[1024];
+ wchar_t stzText[1024];
if (pstzLast)
mir_sntprintf(stzText, L"%s\n%s", pstzLast, tszStatus);
else
- _tcsncpy(stzText, tszStatus, _countof(stzText));
+ wcsncpy(stzText, tszStatus, _countof(stzText));
SendMessage(pdp->hWnd, WM_SETREDRAW, FALSE, 0);
PUChangeTextT(pdp->hWnd, stzText);
SendMessage(pdp->hWnd, WM_SETREDRAW, TRUE, 0);
diff --git a/plugins/NewXstatusNotify/src/popup.h b/plugins/NewXstatusNotify/src/popup.h
index 5bcce77072..1ffc9b7875 100644
--- a/plugins/NewXstatusNotify/src/popup.h
+++ b/plugins/NewXstatusNotify/src/popup.h
@@ -35,7 +35,7 @@
#define PCA_OPENHISTORY 4 // open contact history
#define PCA_DONOTHING 5 // do nothing
-#define STRING_SHOWPREVIOUSSTATUS LPGENT("(was %s)")
+#define STRING_SHOWPREVIOUSSTATUS LPGENW("(was %s)")
typedef struct tagPLUGINDATA
{
@@ -47,18 +47,18 @@ typedef struct tagPLUGINDATA
} PLUGINDATA;
static struct {
- TCHAR *Text;
+ wchar_t *Text;
int Action;
} PopupActions[] = {
- LPGENT("Open message window"), PCA_OPENMESSAGEWND,
- LPGENT("Close popup"), PCA_CLOSEPOPUP,
- LPGENT("Open contact details window"), PCA_OPENDETAILS,
- LPGENT("Open contact menu"), PCA_OPENMENU,
- LPGENT("Open contact history"), PCA_OPENHISTORY,
- LPGENT("Do nothing"), PCA_DONOTHING
+ LPGENW("Open message window"), PCA_OPENMESSAGEWND,
+ LPGENW("Close popup"), PCA_CLOSEPOPUP,
+ LPGENW("Open contact details window"), PCA_OPENDETAILS,
+ LPGENW("Open contact menu"), PCA_OPENMENU,
+ LPGENW("Open contact history"), PCA_OPENHISTORY,
+ LPGENW("Do nothing"), PCA_DONOTHING
};
-void ShowChangePopup(MCONTACT hContact, HICON hIcon, WORD newStatus, const TCHAR *stzText, PLUGINDATA *pdp = NULL);
+void ShowChangePopup(MCONTACT hContact, HICON hIcon, WORD newStatus, const wchar_t *stzText, PLUGINDATA *pdp = NULL);
LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
#endif \ No newline at end of file
diff --git a/plugins/NewXstatusNotify/src/stdafx.h b/plugins/NewXstatusNotify/src/stdafx.h
index 5b6218084f..32feb569d4 100644
--- a/plugins/NewXstatusNotify/src/stdafx.h
+++ b/plugins/NewXstatusNotify/src/stdafx.h
@@ -109,21 +109,21 @@
typedef struct tagSTATUS
{
- TCHAR lpzMStatusText[MAX_STATUSTEXT];
- TCHAR lpzFStatusText[MAX_STATUSTEXT];
- TCHAR lpzUStatusText[MAX_STATUSTEXT];
- TCHAR lpzStandardText[MAX_STANDARDTEXT];
+ wchar_t lpzMStatusText[MAX_STATUSTEXT];
+ wchar_t lpzFStatusText[MAX_STATUSTEXT];
+ wchar_t lpzUStatusText[MAX_STATUSTEXT];
+ wchar_t lpzStandardText[MAX_STANDARDTEXT];
char lpzSkinSoundName[MAX_SKINSOUNDNAME];
- TCHAR lpzSkinSoundDesc[MAX_SKINSOUNDDESC];
- TCHAR lpzSkinSoundFile[MAX_PATH];
+ wchar_t lpzSkinSoundDesc[MAX_SKINSOUNDDESC];
+ wchar_t lpzSkinSoundFile[MAX_PATH];
COLORREF colorBack;
COLORREF colorText;
} STATUS;
typedef struct {
MCONTACT hContact;
- TCHAR *oldstatusmsg;
- TCHAR *newstatusmsg;
+ wchar_t *oldstatusmsg;
+ wchar_t *newstatusmsg;
char *proto;
int compare;
} STATUSMSGINFO;
@@ -150,8 +150,8 @@ extern HGENMENU hEnableDisableMenu;
extern STATUS StatusList[STATUS_COUNT];
extern STATUS StatusListEx[STATUSEX_COUNT];
-TCHAR* GetStr(STATUSMSGINFO *n, const TCHAR *tmplt);
-void LogSMsgToDB(STATUSMSGINFO *smi, const TCHAR *tmplt);
-void BlinkIcon(MCONTACT hContact, HICON hIcon, TCHAR *stzText);
+wchar_t* GetStr(STATUSMSGINFO *n, const wchar_t *tmplt);
+void LogSMsgToDB(STATUSMSGINFO *smi, const wchar_t *tmplt);
+void BlinkIcon(MCONTACT hContact, HICON hIcon, wchar_t *stzText);
void PlayChangeSound(MCONTACT hContact, const char *name);
#endif //COMMON_H
diff --git a/plugins/NewXstatusNotify/src/utils.cpp b/plugins/NewXstatusNotify/src/utils.cpp
index 3a72826c56..f06b12914c 100644
--- a/plugins/NewXstatusNotify/src/utils.cpp
+++ b/plugins/NewXstatusNotify/src/utils.cpp
@@ -41,20 +41,20 @@ bool CheckMsgWnd(MCONTACT hContact)
return false;
}
-int DBGetStringDefault(MCONTACT hContact, const char *szModule, const char *szSetting, TCHAR *setting, int size, const TCHAR *defaultValue)
+int DBGetStringDefault(MCONTACT hContact, const char *szModule, const char *szSetting, wchar_t *setting, int size, const wchar_t *defaultValue)
{
DBVARIANT dbv;
if (!db_get_ts(hContact, szModule, szSetting, &dbv)) {
- _tcsncpy(setting, dbv.ptszVal, size);
+ wcsncpy(setting, dbv.ptszVal, size);
db_free(&dbv);
return 0;
}
- _tcsncpy(setting, defaultValue, size);
+ wcsncpy(setting, defaultValue, size);
return 1;
}
-void ShowLog(TCHAR *file)
+void ShowLog(wchar_t *file)
{
INT_PTR res = (INT_PTR)ShellExecute(NULL, L"open", file, NULL, NULL, SW_SHOW);
if (res <= 32) // error
@@ -83,16 +83,16 @@ BOOL StatusHasAwayMessage(char *szProto, int status)
}
}
-void LogToFile(TCHAR *stzText)
+void LogToFile(wchar_t *stzText)
{
- FILE *fp = _tfopen(opt.LogFilePath, L"a+b, ccs=UTF-8");
+ FILE *fp = _wfopen(opt.LogFilePath, L"a+b, ccs=UTF-8");
if (fp) {
fprintf(fp, T2Utf(stzText));
fclose(fp);
}
}
-void AddCR(CMString &str, const TCHAR *stzText)
+void AddCR(CMString &str, const wchar_t *stzText)
{
if (stzText == NULL)
return;
diff --git a/plugins/NewXstatusNotify/src/utils.h b/plugins/NewXstatusNotify/src/utils.h
index d7496edf30..bdc32806fb 100644
--- a/plugins/NewXstatusNotify/src/utils.h
+++ b/plugins/NewXstatusNotify/src/utils.h
@@ -23,10 +23,10 @@
#define UTILS_H
bool CheckMsgWnd(MCONTACT hContact);
-int DBGetStringDefault(MCONTACT hContact, const char *szModule, const char *szSetting, TCHAR *setting, int size, const TCHAR *defaultValue);
-void ShowLog(TCHAR *file);
+int DBGetStringDefault(MCONTACT hContact, const char *szModule, const char *szSetting, wchar_t *setting, int size, const wchar_t *defaultValue);
+void ShowLog(wchar_t *file);
BOOL StatusHasAwayMessage(char *szProto, int status);
-void LogToFile(TCHAR *stzText);
-void AddCR(CMString &str, const TCHAR *statusmsg);
+void LogToFile(wchar_t *stzText);
+void AddCR(CMString &str, const wchar_t *statusmsg);
#endif
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp
index 13c6e07f8d..5640113053 100644
--- a/plugins/NewXstatusNotify/src/xstatus.cpp
+++ b/plugins/NewXstatusNotify/src/xstatus.cpp
@@ -19,7 +19,7 @@
#include "stdafx.h"
-XSTATUSCHANGE *NewXSC(MCONTACT hContact, char *szProto, int xstatusType, int action, TCHAR *stzTitle, TCHAR *stzText)
+XSTATUSCHANGE *NewXSC(MCONTACT hContact, char *szProto, int xstatusType, int action, wchar_t *stzTitle, wchar_t *stzText)
{
XSTATUSCHANGE *xsc = (XSTATUSCHANGE *)mir_alloc(sizeof(XSTATUSCHANGE));
xsc->hContact = hContact;
@@ -76,7 +76,7 @@ void RemoveLoggedEventsSMsg(MCONTACT hContact)
}
}
-TCHAR* GetStatusTypeAsString(int type, TCHAR *buff)
+wchar_t* GetStatusTypeAsString(int type, wchar_t *buff)
{
switch (type) {
case TYPE_JABBER_MOOD:
@@ -90,32 +90,32 @@ TCHAR* GetStatusTypeAsString(int type, TCHAR *buff)
}
}
-CMString ReplaceVars(XSTATUSCHANGE *xsc, const TCHAR *tmplt)
+CMString ReplaceVars(XSTATUSCHANGE *xsc, const wchar_t *tmplt)
{
- if (xsc == NULL || tmplt == NULL || tmplt[0] == _T('\0'))
+ if (xsc == NULL || tmplt == NULL || tmplt[0] == '\0')
return CMString();
size_t len = mir_tstrlen(tmplt);
CMString res;
for (size_t i = 0; i < len; i++) {
- if (tmplt[i] == _T('%')) {
+ if (tmplt[i] == '%') {
i++;
switch (tmplt[i]) {
case 'n':
- TCHAR stzType[32];
+ wchar_t stzType[32];
res.Append(GetStatusTypeAsString(xsc->type, stzType));
break;
case 't':
- if (xsc->stzTitle == NULL || xsc->stzTitle[0] == _T('\0'))
+ if (xsc->stzTitle == NULL || xsc->stzTitle[0] == '\0')
res.Append(TranslateT("<no title>"));
else
res.Append(xsc->stzTitle);
break;
case 'm':
- if (xsc->stzText == NULL || xsc->stzText[0] == _T('\0'))
+ if (xsc->stzText == NULL || xsc->stzText[0] == '\0')
res.Append(TranslateT("<no status message>"));
else
AddCR(res, xsc->stzText);
@@ -134,7 +134,7 @@ CMString ReplaceVars(XSTATUSCHANGE *xsc, const TCHAR *tmplt)
break;
}
}
- else if (tmplt[i] == _T('\\')) {
+ else if (tmplt[i] == '\\') {
i++;
switch (tmplt[i]) {
case 'n':
@@ -188,17 +188,17 @@ void ShowXStatusPopup(XSTATUSCHANGE *xsc)
hIcon = Skin_LoadProtoIcon(xsc->szProto, db_get_w(xsc->hContact, xsc->szProto, "Status", ID_STATUS_ONLINE));
// cut message if needed
- TCHAR *copyText = NULL;
+ wchar_t *copyText = NULL;
if (opt.PXMsgTruncate && (opt.PXMsgLen > 0) && xsc->stzText && (mir_tstrlen(xsc->stzText) > opt.PXMsgLen)) {
- TCHAR buff[MAX_TEXT_LEN + 3];
+ wchar_t buff[MAX_TEXT_LEN + 3];
copyText = mir_tstrdup(xsc->stzText);
- _tcsncpy(buff, xsc->stzText, opt.PXMsgLen);
+ wcsncpy(buff, xsc->stzText, opt.PXMsgLen);
buff[opt.PXMsgLen] = 0;
mir_tstrcat(buff, L"...");
replaceStrT(xsc->stzText, buff);
}
- TCHAR *Template = L"";
+ wchar_t *Template = L"";
switch (xsc->action) {
case NOTIFY_NEW_XSTATUS:
Template = templates.PopupXstatusChanged; break;
@@ -224,8 +224,8 @@ void BlinkXStatusIcon(XSTATUSCHANGE *xsc)
return;
HICON hIcon = NULL;
- TCHAR str[256] = { 0 };
- TCHAR stzType[32];
+ wchar_t str[256] = { 0 };
+ wchar_t stzType[32];
mir_sntprintf(str, TranslateT("%s changed %s"), pcli->pfnGetContactDisplayName(xsc->hContact, 0), GetStatusTypeAsString(xsc->type, stzType));
if (opt.BlinkIcon_Status) {
@@ -273,7 +273,7 @@ void LogChangeToDB(XSTATUSCHANGE *xsc)
if (xsc == NULL || (opt.XLogToDB_WinOpen && !CheckMsgWnd(xsc->hContact)))
return;
- TCHAR *Template = L"";
+ wchar_t *Template = L"";
switch (xsc->action) {
case NOTIFY_NEW_XSTATUS:
Template = templates.LogXstatusChanged; break;
@@ -287,7 +287,7 @@ void LogChangeToDB(XSTATUSCHANGE *xsc)
Template = templates.LogXstatusOpening; break;
}
- TCHAR stzLastLog[2 * MAX_TEXT_LEN];
+ wchar_t stzLastLog[2 * MAX_TEXT_LEN];
CMString stzLogText(ReplaceVars(xsc, Template));
DBGetStringDefault(xsc->hContact, MODULE, DB_LASTLOG, stzLastLog, _countof(stzLastLog), L"");
@@ -320,12 +320,12 @@ void LogChangeToFile(XSTATUSCHANGE *xsc)
if (xsc == NULL)
return;
- TCHAR stzDate[32], stzTime[32], stzText[MAX_TEXT_LEN];
+ wchar_t stzDate[32], stzTime[32], stzText[MAX_TEXT_LEN];
GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL, L"HH':'mm", stzTime, _countof(stzTime));
GetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, L"dd/MM/yyyy", stzDate, _countof(stzDate));
- TCHAR *Template = L"";
+ wchar_t *Template = L"";
switch (xsc->action) {
case NOTIFY_NEW_XSTATUS:
Template = templates.LogXstatusChanged; break;
@@ -409,9 +409,9 @@ void ExtraStatusChanged(XSTATUSCHANGE *xsc)
FreeXSC(xsc);
}
-TCHAR* GetDefaultXstatusName(int statusID, char *szProto, TCHAR *buff, int bufflen)
+wchar_t* GetDefaultXstatusName(int statusID, char *szProto, wchar_t *buff, int bufflen)
{
- TCHAR nameBuff[64];
+ wchar_t nameBuff[64];
buff[0] = 0;
CUSTOM_STATUS xstatus = { 0 };
@@ -420,12 +420,12 @@ TCHAR* GetDefaultXstatusName(int statusID, char *szProto, TCHAR *buff, int buffl
xstatus.ptszName = nameBuff;
xstatus.wParam = (WPARAM*)&statusID;
if (!CallProtoService(szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus))
- _tcsncpy_s(buff, bufflen, TranslateTS(nameBuff), _TRUNCATE);
+ wcsncpy_s(buff, bufflen, TranslateTS(nameBuff), _TRUNCATE);
return buff;
}
-TCHAR* GetIcqXStatus(MCONTACT hContact, char *szProto, char *szValue, TCHAR *buff, int bufflen)
+wchar_t* GetIcqXStatus(MCONTACT hContact, char *szProto, char *szValue, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
buff[0] = 0;
@@ -436,7 +436,7 @@ TCHAR* GetIcqXStatus(MCONTACT hContact, char *szProto, char *szValue, TCHAR *buf
if ((mir_strcmp(szValue, "XStatusName") == 0) && dbv.ptszVal[0] == 0)
GetDefaultXstatusName(statusID, szProto, buff, bufflen);
else
- _tcsncpy(buff, dbv.ptszVal, bufflen);
+ wcsncpy(buff, dbv.ptszVal, bufflen);
buff[bufflen - 1] = 0;
db_free(&dbv);
@@ -446,7 +446,7 @@ TCHAR* GetIcqXStatus(MCONTACT hContact, char *szProto, char *szValue, TCHAR *buf
return buff;
}
-TCHAR* GetJabberAdvStatusText(MCONTACT hContact, char *szProto, char *szSlot, char *szValue, TCHAR *buff, int bufflen)
+wchar_t* GetJabberAdvStatusText(MCONTACT hContact, char *szProto, char *szSlot, char *szValue, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
char szSetting[128];
@@ -454,7 +454,7 @@ TCHAR* GetJabberAdvStatusText(MCONTACT hContact, char *szProto, char *szSlot, ch
mir_snprintf(szSetting, "%s/%s/%s", szProto, szSlot, szValue);
if (!db_get_ts(hContact, "AdvStatus", szSetting, &dbv)) {
- _tcsncpy(buff, dbv.ptszVal, bufflen);
+ wcsncpy(buff, dbv.ptszVal, bufflen);
buff[bufflen - 1] = 0;
db_free(&dbv);
}
@@ -462,7 +462,7 @@ TCHAR* GetJabberAdvStatusText(MCONTACT hContact, char *szProto, char *szSlot, ch
return buff;
}
-void LogXstatusChange(MCONTACT hContact, char *szProto, int xstatusType, TCHAR *stzTitle, TCHAR *stzText)
+void LogXstatusChange(MCONTACT hContact, char *szProto, int xstatusType, wchar_t *stzTitle, wchar_t *stzText)
{
XSTATUSCHANGE *xsc = NewXSC(hContact, szProto, xstatusType, NOTIFY_OPENING_ML, stzTitle[0] ? mir_tstrdup(stzTitle) : NULL, stzText[0] ? mir_tstrdup(stzText) : NULL);
@@ -478,7 +478,7 @@ void AddXStatusEventThread(void *arg)
if (szProto == NULL)
return;
- TCHAR stzTitle[MAX_TITLE_LEN], stzText[MAX_TEXT_LEN];
+ wchar_t stzTitle[MAX_TITLE_LEN], stzText[MAX_TEXT_LEN];
if (ProtoServiceExists(szProto, JS_PARSE_XMPP_URI)) {
GetJabberAdvStatusText(hContact, szProto, "mood", "title", stzTitle, _countof(stzTitle));
if (stzTitle[0]) {
diff --git a/plugins/NewXstatusNotify/src/xstatus.h b/plugins/NewXstatusNotify/src/xstatus.h
index 1c82461245..403400caba 100644
--- a/plugins/NewXstatusNotify/src/xstatus.h
+++ b/plugins/NewXstatusNotify/src/xstatus.h
@@ -88,8 +88,8 @@ typedef struct tagXSTATUSCHANGE
char *szProto;
int type;
int action;
- TCHAR *stzTitle;
- TCHAR *stzText;
+ wchar_t *stzTitle;
+ wchar_t *stzText;
} XSTATUSCHANGE;
typedef struct tagDBEVENT
@@ -101,12 +101,12 @@ typedef struct tagDBEVENT
typedef struct tagPROTOTEMPLATE
{
char *ProtoName;
- TCHAR ProtoTemplateMsg[MAX_PATH];
- TCHAR ProtoTemplateRemoved[MAX_PATH];
+ wchar_t ProtoTemplateMsg[MAX_PATH];
+ wchar_t ProtoTemplateRemoved[MAX_PATH];
} PROTOTEMPLATE;
-TCHAR *GetDefaultXstatusName(int statusID, char *szProto, TCHAR *buff, int bufflen);
-XSTATUSCHANGE *NewXSC(MCONTACT hContact, char *szProto, int xstatusType, int action, TCHAR *stzTitle, TCHAR *stzText);
+wchar_t *GetDefaultXstatusName(int statusID, char *szProto, wchar_t *buff, int bufflen);
+XSTATUSCHANGE *NewXSC(MCONTACT hContact, char *szProto, int xstatusType, int action, wchar_t *stzTitle, wchar_t *stzText);
void ExtraStatusChanged(XSTATUSCHANGE *xsc);
void FreeXSC(XSTATUSCHANGE *xsc);
int OnWindowEvent(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/New_GPG/src/globals.h b/plugins/New_GPG/src/globals.h
index a895bfd977..4a8c6f2cb5 100644
--- a/plugins/New_GPG/src/globals.h
+++ b/plugins/New_GPG/src/globals.h
@@ -17,7 +17,7 @@
#ifndef GLOBALS_H
#define GLOBALS_H
extern bool bAppendTags, bPresenceSigning, bStripTags, gpg_valid, gpg_keyexist, tabsrmm_used, bSameAction, bFileTransfers, bDebugLog;
-extern TCHAR *inopentag, *inclosetag, *outopentag, *outclosetag;
+extern wchar_t *inopentag, *inclosetag, *outopentag, *outclosetag;
extern logtofile debuglog;
extern map<int, MCONTACT> user_data;
diff --git a/plugins/New_GPG/src/gpg_wrapper.cpp b/plugins/New_GPG/src/gpg_wrapper.cpp
index 1e2fcfce97..ef52cbe196 100755
--- a/plugins/New_GPG/src/gpg_wrapper.cpp
+++ b/plugins/New_GPG/src/gpg_wrapper.cpp
@@ -25,7 +25,7 @@ pxResult pxExecute(std::vector<std::wstring> &aargv, string *aoutput, LPDWORD ae
extern logtofile debuglog;
- TCHAR *bin_path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"");
+ wchar_t *bin_path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"");
{
if(!boost::filesystem::exists(bin_path))
{
@@ -48,7 +48,7 @@ pxResult pxExecute(std::vector<std::wstring> &aargv, string *aoutput, LPDWORD ae
env.push_back(L"LC_ALL=English");
env.push_back(L"LANG=C");
argv.push_back(bin_path);
- TCHAR *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
+ wchar_t *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
if(mir_tstrlen(home_dir)) //this check are required for first run gpg binary validation
{
argv.push_back(L"--homedir");
@@ -80,7 +80,7 @@ pxResult pxExecute(std::vector<std::wstring> &aargv, string *aoutput, LPDWORD ae
file_descriptor_sink sout(pout.sink, close_handle);
file_descriptor_sink serr(perr.sink, close_handle);
- TCHAR *mir_path = new TCHAR [MAX_PATH];
+ wchar_t *mir_path = new wchar_t [MAX_PATH];
PathToAbsoluteW(L"\\", mir_path);
c = new child(execute(set_args(argv), bind_stdout(sout), bind_stderr(serr), close_stdin(),/*bind_stdin(sin),*/ show_window(SW_HIDE), hide_console(), inherit_env(), set_env(env), start_in_dir(mir_path)));
@@ -175,7 +175,7 @@ pxResult pxExecute_passwd_change(std::vector<std::wstring> &aargv, pxResult *res
return pxNotConfigured;
extern logtofile debuglog;
- TCHAR *bin_path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"");
+ wchar_t *bin_path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"");
{
if(!boost::filesystem::exists(bin_path))
{
@@ -197,7 +197,7 @@ pxResult pxExecute_passwd_change(std::vector<std::wstring> &aargv, pxResult *res
env.push_back(L"LC_ALL=English");
argv.push_back(bin_path);
argv.push_back(L"--homedir");
- TCHAR *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
+ wchar_t *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
argv.push_back(home_dir);
mir_free(home_dir);
argv.push_back(L"--display-charset");
diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp
index 9a84c466ee..a2dee64295 100644
--- a/plugins/New_GPG/src/init.cpp
+++ b/plugins/New_GPG/src/init.cpp
@@ -18,7 +18,7 @@
//global variables
bool bAppendTags = false, bDebugLog = false, bJabberAPI = false, bPresenceSigning = false, bIsMiranda09 = false, bFileTransfers = false, bSameAction = false, bAutoExchange = false, bStripTags = false, tabsrmm_used = false;
-TCHAR *inopentag = NULL, *inclosetag = NULL, *outopentag = NULL, *outclosetag = NULL, *password = NULL;
+wchar_t *inopentag = NULL, *inclosetag = NULL, *outopentag = NULL, *outclosetag = NULL, *password = NULL;
list <JabberAccount*> Accounts;
@@ -186,35 +186,35 @@ extern "C" int __declspec(dllexport) Load()
mi.position = -0x7FFFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- mi.name.t = LPGENT("Load GPG public key");
+ mi.name.w = LPGENW("Load GPG public key");
mi.pszService = "/LoadPubKey";
hLoadPubKey = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0xc8008193, 0x56a9, 0x414a, 0x82, 0x98, 0x78, 0xe8, 0xa8, 0x84, 0x20, 0x67);
mi.position = -0x7FFFFFFe;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- mi.name.t = LPGENT("Toggle GPG encryption");
+ mi.name.w = LPGENW("Toggle GPG encryption");
mi.pszService = "/ToggleEncryption";
hToggleEncryption = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x42bb535f, 0xd58e, 0x4edb, 0xbf, 0x2c, 0xfa, 0x9a, 0xbf, 0x1e, 0xb8, 0x69);
mi.position = -0x7FFFFFFd;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- mi.name.t = LPGENT("Send public key");
+ mi.name.w = LPGENW("Send public key");
mi.pszService = "/SendKey";
hSendKey = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x33a204b2, 0xe3c0, 0x413b, 0xbf, 0xd8, 0x8b, 0x2e, 0x3d, 0xa0, 0xef, 0xa4);
mi.position = -0x7FFFFFFe;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- mi.name.t = LPGENT("Export GPG Public keys");
+ mi.name.w = LPGENW("Export GPG Public keys");
mi.pszService = "/ExportGPGKeys";
hExportGpgKeys = Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0x627fcfc1, 0x4e60, 0x4428, 0xaf, 0x96, 0x11, 0x42, 0x24, 0xeb, 0x7, 0xea);
mi.position = -0x7FFFFFFF;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- mi.name.t = LPGENT("Import GPG Public keys");
+ mi.name.w = LPGENW("Import GPG Public keys");
mi.pszService = "/ImportGPGKeys";
hImportGpgKeys = Menu_AddMainMenuItem(&mi);
diff --git a/plugins/New_GPG/src/jabber_account.cpp b/plugins/New_GPG/src/jabber_account.cpp
index 879e6c7a48..29f561d5e2 100644
--- a/plugins/New_GPG/src/jabber_account.cpp
+++ b/plugins/New_GPG/src/jabber_account.cpp
@@ -16,7 +16,7 @@
#include "stdafx.h"
-void JabberAccount::setAccountName(TCHAR *Name)
+void JabberAccount::setAccountName(wchar_t *Name)
{
AccountName = Name;
}
@@ -42,7 +42,7 @@ void JabberAccount::setMessageHandler(HJHANDLER hHandler)
}
-TCHAR *JabberAccount::getAccountName()
+wchar_t *JabberAccount::getAccountName()
{
return AccountName;
}
diff --git a/plugins/New_GPG/src/jabber_account.h b/plugins/New_GPG/src/jabber_account.h
index b643ed1636..8086c0ea6a 100644
--- a/plugins/New_GPG/src/jabber_account.h
+++ b/plugins/New_GPG/src/jabber_account.h
@@ -18,14 +18,14 @@
class JabberAccount
{
public:
- void setAccountName(TCHAR *Name);
+ void setAccountName(wchar_t *Name);
void setAccountNumber(int Number);
void setJabberInterface(IJabberInterface *JIf);
void setSendHandler(HJHANDLER hHandler);
void setPrescenseHandler(HJHANDLER hHandler);
void setMessageHandler(HJHANDLER hHandler);
- TCHAR *getAccountName();
+ wchar_t *getAccountName();
int getAccountNumber();
IJabberInterface *getJabberInterface();
HJHANDLER getSendHandler();
@@ -34,7 +34,7 @@ public:
~JabberAccount();
JabberAccount();
private:
- TCHAR *AccountName;
+ wchar_t *AccountName;
int AccountNumber;
IJabberInterface *JabberInterface;
HJHANDLER hSendHandler, hPrescenseHandler, hMessageHandler;
diff --git a/plugins/New_GPG/src/log.cpp b/plugins/New_GPG/src/log.cpp
index 87c72605da..362344c46f 100644
--- a/plugins/New_GPG/src/log.cpp
+++ b/plugins/New_GPG/src/log.cpp
@@ -17,7 +17,7 @@
#include "stdafx.h"
-logtofile& logtofile::operator<<(TCHAR *buf)
+logtofile& logtofile::operator<<(wchar_t *buf)
{
if(_bDebugLog != bDebugLog)
init();
diff --git a/plugins/New_GPG/src/log.h b/plugins/New_GPG/src/log.h
index 9d1dcb39e6..9bb7a0dae9 100644
--- a/plugins/New_GPG/src/log.h
+++ b/plugins/New_GPG/src/log.h
@@ -19,7 +19,7 @@
class logtofile
{
public:
- logtofile& operator<<(TCHAR *buf);
+ logtofile& operator<<(wchar_t *buf);
logtofile& operator<<(char *buf);
logtofile& operator<<(string buf);
logtofile& operator<<(wstring buf);
@@ -28,7 +28,7 @@ public:
logtofile();
private:
fstream log;
- TCHAR *path;
+ wchar_t *path;
boost::mutex log_mutex;
bool _bDebugLog;
};
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp
index 8e50ba8998..d3e7d1679b 100755
--- a/plugins/New_GPG/src/main.cpp
+++ b/plugins/New_GPG/src/main.cpp
@@ -30,14 +30,14 @@ int itemnum = 0;
HWND hwndList_g = NULL;
BOOL CheckStateStoreDB(HWND hwndDlg, int idCtrl, const char* szSetting);
-TCHAR key_id_global[17] = { 0 };
+wchar_t key_id_global[17] = { 0 };
static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
HWND hwndList = GetDlgItem(hwndDlg, IDC_KEY_LIST);
hwndList_g = hwndList;
LVITEM item = { 0 };
- TCHAR fp[16] = { 0 };
+ wchar_t fp[16] = { 0 };
switch (uMsg) {
case WM_INITDIALOG:
{
@@ -124,7 +124,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam,
break;
stop = p;
p2 = out.find("/", p) - 1;
- TCHAR *key_len = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str()), *creation_date = NULL, *expire_date = NULL;
+ wchar_t *key_len = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str()), *creation_date = NULL, *expire_date = NULL;
p2 += 2;
p = out.find(" ", p2);
std::wstring key_id = toUTF16(out.substr(p2, p - p2));
@@ -149,19 +149,19 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam,
bool expired = false;
{
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
- TCHAR buf[5];
- _tcsncpy_s(buf, expire_date, _TRUNCATE);
- int year = _ttoi(buf);
+ wchar_t buf[5];
+ wcsncpy_s(buf, expire_date, _TRUNCATE);
+ int year = _wtoi(buf);
if (year < now.date().year())
expired = true;
else if (year == now.date().year()) {
- _tcsncpy_s(buf, (expire_date + 5), _TRUNCATE);
- int month = _ttoi(buf);
+ wcsncpy_s(buf, (expire_date + 5), _TRUNCATE);
+ int month = _wtoi(buf);
if (month < now.date().month())
expired = true;
else if (month == now.date().month()) {
- _tcsncpy_s(buf, (expire_date + 8), _TRUNCATE);
- unsigned day = _ttoi(buf);
+ wcsncpy_s(buf, (expire_date + 8), _TRUNCATE);
+ unsigned day = _wtoi(buf);
if (day <= now.date().day_number())
expired = true;
}
@@ -191,19 +191,19 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam,
}
ListView_SetItemText(hwndList, iRow, 5, key_len);
mir_free(key_len);
- ListView_SetItemText(hwndList, iRow, 0, (TCHAR*)key_id.c_str());
+ ListView_SetItemText(hwndList, iRow, 0, (wchar_t*)key_id.c_str());
p = out.find("uid ", p);
p2 = out.find_first_not_of(" ", p + 5);
p = out.find("<", p2);
wstring tmp = toUTF16(out.substr(p2, p - p2));
- ListView_SetItemText(hwndList, iRow, 2, (TCHAR*)tmp.c_str());
+ ListView_SetItemText(hwndList, iRow, 2, (wchar_t*)tmp.c_str());
p++;
p2 = out.find(">", p);
tmp = toUTF16(out.substr(p, p2 - p));
- ListView_SetItemText(hwndList, iRow, 1, (TCHAR*)tmp.c_str());
+ ListView_SetItemText(hwndList, iRow, 1, (wchar_t*)tmp.c_str());
// get accounts
int count = 0;
@@ -216,7 +216,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam,
setting += accounts[n]->szModuleName;
setting += ")";
setting += "_KeyID";
- TCHAR *str = UniGetContactSettingUtf(NULL, szGPGModuleName, setting.c_str(), L"");
+ wchar_t *str = UniGetContactSettingUtf(NULL, szGPGModuleName, setting.c_str(), L"");
if (key_id == str) {
if (!accs.empty())
accs += L",";
@@ -224,7 +224,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam,
}
mir_free(str);
}
- ListView_SetItemText(hwndList, iRow, 6, (TCHAR*)accs.c_str());
+ ListView_SetItemText(hwndList, iRow, 6, (wchar_t*)accs.c_str());
}
i++;
@@ -274,10 +274,10 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam,
case ID_OK:
{
ListView_GetItemText(hwndList, itemnum, 0, fp, _countof(fp));
- TCHAR *name = new TCHAR[64];
+ wchar_t *name = new wchar_t[64];
ListView_GetItemText(hwndList, itemnum, 2, name, 64);
{
- if (_tcschr(name, _T('('))) {
+ if (wcschr(name, '(')) {
wstring str = name;
wstring::size_type p = str.find(L"(") - 1;
mir_tstrcpy(name, str.substr(0, p).c_str());
@@ -329,7 +329,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam,
SetWindowText(hwndCurKey_p, keyinfo.c_str());
}
}
- TCHAR passwd[64];
+ wchar_t passwd[64];
GetDlgItemText(hwndDlg, IDC_KEY_PASSWORD, passwd, _countof(passwd));
if (passwd[0]) {
string dbsetting = "szKey_";
@@ -386,7 +386,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam,
break;
stop = p;
p2 = out.find("/", p) - 1;
- TCHAR *tmp = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str());
+ wchar_t *tmp = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str());
item.pszText = tmp;
iRow = ListView_InsertItem(hwndList, &item);
ListView_SetItemText(hwndList, iRow, 4, tmp);
@@ -445,7 +445,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam,
string::size_type s = out.find("Key fingerprint = ");
s += mir_strlen("Key fingerprint = ");
string::size_type s2 = out.find("\n", s);
- TCHAR *str = NULL;
+ wchar_t *str = NULL;
{
string tmp = out.substr(s, s2 - s - 1).c_str();
string::size_type p = 0;
@@ -505,7 +505,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam,
wstring path;
{
// generating key file
- TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
+ wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
path = tmp;
mir_free(tmp);
path.append(L"\\new_key");
@@ -660,7 +660,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam,
}
char *szKey = (char*)GlobalLock(hMem);
if (!szKey) {
- TCHAR msg[64];
+ wchar_t msg[64];
mir_sntprintf(msg, TranslateT("Failed to lock memory with error %d"), GetLastError());
MessageBox(0, msg, TranslateT("Error"), MB_OK);
GlobalFree(hMem);
@@ -671,7 +671,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam,
GlobalUnlock(hMem);
if (!SetClipboardData(CF_OEMTEXT, hMem)) {
GlobalFree(hMem);
- TCHAR msg[64];
+ wchar_t msg[64];
mir_sntprintf(msg, TranslateT("Failed write to clipboard with error %d"), GetLastError());
MessageBox(0, msg, TranslateT("Error"), MB_OK);
}
@@ -681,7 +681,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam,
case IDC_EXPORT_PRIVATE:
{
- TCHAR *p = GetFilePath(L"Choose file to export key", L"*", L"Any file", true);
+ wchar_t *p = GetFilePath(L"Choose file to export key", L"*", L"Any file", true);
if (!p || !p[0]) {
delete[] p;
//TODO: handle error
@@ -787,7 +787,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- TCHAR *path = (TCHAR*)mir_alloc(sizeof(TCHAR) * MAX_PATH);
+ wchar_t *path = (wchar_t*)mir_alloc(sizeof(wchar_t) * MAX_PATH);
bool gpg_exists = false, lang_exists = false;
{
ptrA mir_path((char*)mir_alloc(sizeof(char) * MAX_PATH));
@@ -817,7 +817,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
if (!gpg_exists) {
tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", (SHGetValue(HKEY_CURRENT_USER, L"Software\\GNU\\GnuPG", L"gpgProgram", 0, path, &len) == ERROR_SUCCESS) ? path : L"");
if (tmp[0])
- if (!boost::filesystem::exists((TCHAR*)tmp))
+ if (!boost::filesystem::exists((wchar_t*)tmp))
MessageBox(0, TranslateT("Wrong GPG binary location found in system.\nPlease choose another location"), TranslateT("Warning"), MB_OK);
}
else tmp = mir_wstrdup(path);
@@ -887,7 +887,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
case IDC_SET_BIN_PATH:
{
GetFilePath(L"Choose gpg.exe", "szGpgBinPath", L"*.exe", L"EXE Executables");
- TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"gpg.exe");
+ wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"gpg.exe");
SetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp);
char mir_path[MAX_PATH];
char *atmp = mir_t2a(tmp);
@@ -904,7 +904,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
case IDC_SET_HOME_DIR:
{
GetFolderPath(L"Set home directory", "szHomePath");
- TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
+ wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
SetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp);
char mir_path[MAX_PATH];
char *atmp = mir_t2a(tmp);
@@ -920,7 +920,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
case ID_OK:
{
- TCHAR tmp[512];
+ wchar_t tmp[512];
GetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp, _countof(tmp));
if (tmp[0]) {
char *mir_path = new char[MAX_PATH];
@@ -975,7 +975,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
}
db_set_ts(NULL, szGPGModuleName, "szHomePath", tmp);
{
- TCHAR *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
+ wchar_t *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
DWORD dwFileAttr = GetFileAttributes(path);
if (dwFileAttr != INVALID_FILE_ATTRIBUTES) {
dwFileAttr &= ~FILE_ATTRIBUTE_READONLY;
@@ -991,7 +991,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
case IDC_GENERATE_RANDOM:
{
- TCHAR tmp[512];
+ wchar_t tmp[512];
GetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp, _countof(tmp));
if (tmp[0]) {
char *mir_path = new char[MAX_PATH];
@@ -1046,7 +1046,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
}
db_set_ts(NULL, szGPGModuleName, "szHomePath", tmp);
{
- TCHAR *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
+ wchar_t *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
DWORD dwFileAttr = GetFileAttributes(path);
if (dwFileAttr != INVALID_FILE_ATTRIBUTES) {
dwFileAttr &= ~FILE_ATTRIBUTE_READONLY;
@@ -1058,7 +1058,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
{
wstring path;
{ //generating key file
- TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
+ wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
path = tmp;
mir_free(tmp);
path.append(L"\\new_key");
@@ -1190,13 +1190,13 @@ static INT_PTR CALLBACK DlgProcNewKeyDialog(HWND hwndDlg, UINT msg, WPARAM wPara
//new_key_hcnt_mutex.unlock();
SetWindowPos(hwndDlg, 0, new_key_rect.left, new_key_rect.top, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW);
TranslateDialogDefault(hwndDlg);
- TCHAR *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L"");
+ wchar_t *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L"");
SetDlgItemText(hwndDlg, IDC_MESSAGE, tmp[0] ? TranslateT("There is existing key for contact, would you like to replace it with new key?") : TranslateT("New public key was received, do you want to import it?"));
EnableWindow(GetDlgItem(hwndDlg, IDC_IMPORT_AND_USE), db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0) ? 0 : 1);
SetDlgItemText(hwndDlg, ID_IMPORT, tmp[0] ? TranslateT("Replace") : TranslateT("Accept"));
mir_free(tmp);
- tmp = new TCHAR[256];
- mir_sntprintf(tmp, 255 * sizeof(TCHAR), TranslateT("Received key from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ tmp = new wchar_t[256];
+ mir_sntprintf(tmp, 255 * sizeof(wchar_t), TranslateT("Received key from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
SetDlgItemText(hwndDlg, IDC_KEY_FROM, tmp);
delete[] tmp;
}
@@ -1267,7 +1267,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara
{
wstring path;
{ //data sanity checks
- TCHAR *tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 5);
+ wchar_t *tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 5);
GetDlgItemText(hwndDlg, IDC_KEY_TYPE, tmp, 5);
if (mir_tstrlen(tmp) < 3) {
mir_free(tmp); tmp = NULL;
@@ -1276,15 +1276,15 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara
}
if (tmp)
mir_free(tmp);
- tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 6);
+ tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 6);
GetDlgItemText(hwndDlg, IDC_KEY_LENGTH, tmp, 5);
- int length = _ttoi(tmp);
+ int length = _wtoi(tmp);
mir_free(tmp);
if (length < 1024 || length > 4096) {
MessageBox(0, TranslateT("Key length must be of length from 1024 to 4096 bits"), TranslateT("Error"), MB_OK);
break;
}
- tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 12);
+ tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 12);
GetDlgItemText(hwndDlg, IDC_KEY_EXPIRE_DATE, tmp, 11);
if (mir_tstrlen(tmp) != 10 && tmp[0] != '0') {
MessageBox(0, TranslateT("Invalid date"), TranslateT("Error"), MB_OK);
@@ -1292,22 +1292,22 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara
break;
}
mir_free(tmp);
- tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 128);
+ tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 128);
GetDlgItemText(hwndDlg, IDC_KEY_REAL_NAME, tmp, 127);
if (mir_tstrlen(tmp) < 5) {
MessageBox(0, TranslateT("Name must contain at least 5 characters"), TranslateT("Error"), MB_OK);
mir_free(tmp);
break;
}
- else if (_tcschr(tmp, _T('(')) || _tcschr(tmp, _T(')'))) {
+ else if (wcschr(tmp, '(') || wcschr(tmp, ')')) {
MessageBox(0, TranslateT("Name cannot contain '(' or ')'"), TranslateT("Error"), MB_OK);
mir_free(tmp);
break;
}
mir_free(tmp);
- tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 128);
+ tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 128);
GetDlgItemText(hwndDlg, IDC_KEY_EMAIL, tmp, 128);
- if ((mir_tstrlen(tmp)) < 5 || (!_tcschr(tmp, _T('@'))) || (!_tcschr(tmp, _T('.')))) {
+ if ((mir_tstrlen(tmp)) < 5 || (!wcschr(tmp, '@')) || (!wcschr(tmp, '.'))) {
MessageBox(0, TranslateT("Invalid Email"), TranslateT("Error"), MB_OK);
mir_free(tmp);
break;
@@ -1315,7 +1315,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara
mir_free(tmp);
}
{ //generating key file
- TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
+ wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
char *tmp2;// = mir_t2a(tmp);
path = tmp;
mir_free(tmp);
@@ -1327,7 +1327,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara
break;
}
f << "Key-Type: ";
- tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 5);
+ tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 5);
GetDlgItemText(hwndDlg, IDC_KEY_TYPE, tmp, 5);
tmp2 = mir_t2a(tmp);
mir_free(tmp);
@@ -1340,9 +1340,9 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara
mir_free(tmp2);
f << "\n";
f << "Key-Length: ";
- tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 5);
+ tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 5);
GetDlgItemText(hwndDlg, IDC_KEY_LENGTH, tmp, 5);
- int length = _ttoi(tmp);
+ int length = _wtoi(tmp);
mir_free(tmp);
f << length;
f << "\n";
@@ -1353,7 +1353,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara
f << subkeytype;
mir_free(subkeytype);
f << "\n";
- tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 64); //i hope this is enough for password
+ tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 64); //i hope this is enough for password
GetDlgItemText(hwndDlg, IDC_KEY_PASSWD, tmp, 64);
if (tmp[0]) {
f << "Passphrase: ";
@@ -1364,14 +1364,14 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara
}
mir_free(tmp);
f << "Name-Real: ";
- tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 128);
+ tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 128);
GetDlgItemText(hwndDlg, IDC_KEY_REAL_NAME, tmp, 128);
tmp2 = mir_strdup(toUTF8(tmp).c_str());
f << tmp2;
mir_free(tmp2);
mir_free(tmp);
f << "\n";
- tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 512);
+ tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 512);
GetDlgItemText(hwndDlg, IDC_KEY_COMMENT, tmp, 512);
if (tmp[0]) {
tmp2 = mir_strdup(toUTF8(tmp).c_str());
@@ -1382,7 +1382,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara
mir_free(tmp2);
mir_free(tmp);
f << "Name-Email: ";
- tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 128);
+ tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 128);
GetDlgItemText(hwndDlg, IDC_KEY_EMAIL, tmp, 128);
tmp2 = mir_strdup(toUTF8(tmp).c_str());
f << tmp2;
@@ -1390,7 +1390,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara
mir_free(tmp);
f << "\n";
f << "Expire-Date: ";
- tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * 12);
+ tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * 12);
GetDlgItemText(hwndDlg, IDC_KEY_EXPIRE_DATE, tmp, 12);
tmp2 = mir_strdup(toUTF8(tmp).c_str());
f << tmp2;
@@ -1462,7 +1462,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara
break;
stop = p;
p2 = out.find("/", p) - 1;
- TCHAR *tmp = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str());
+ wchar_t *tmp = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str());
item.pszText = tmp;
iRow = ListView_InsertItem(hwndList_g, &item);
ListView_SetItemText(hwndList_g, iRow, 4, tmp);
@@ -1540,7 +1540,7 @@ static INT_PTR CALLBACK DlgProcLoadExistingKey(HWND hwndDlg, UINT msg, WPARAM wP
LVCOLUMN col = { 0 };
LVITEM item = { 0 };
NMLISTVIEW * hdr = (NMLISTVIEW *)lParam;
- TCHAR id[16] = { 0 };
+ wchar_t id[16] = { 0 };
switch (msg) {
case WM_INITDIALOG:
{
@@ -1614,7 +1614,7 @@ static INT_PTR CALLBACK DlgProcLoadExistingKey(HWND hwndDlg, UINT msg, WPARAM wP
break;
stop = p;
p2 = out.find("/", p) - 1;
- TCHAR *tmp = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str());
+ wchar_t *tmp = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str());
item.pszText = tmp;
iRow = ListView_InsertItem(hwndList, &item);
ListView_SetItemText(hwndList, iRow, 5, tmp);
@@ -1714,7 +1714,7 @@ static INT_PTR CALLBACK DlgProcLoadExistingKey(HWND hwndDlg, UINT msg, WPARAM wP
if (p2 != std::string::npos) {
p2 += mir_strlen("-----END PGP PUBLIC KEY BLOCK-----");
out = out.substr(p1, p2 - p1);
- TCHAR *tmp = mir_a2t(out.c_str());
+ wchar_t *tmp = mir_a2t(out.c_str());
SetWindowText(hPubKeyEdit, tmp);
mir_free(tmp);
}
@@ -1786,7 +1786,7 @@ static INT_PTR CALLBACK DlgProcImportKeyDialog(HWND hwndDlg, UINT msg, WPARAM wP
DWORD code;
std::vector<wstring> cmd;
cmd.push_back(L"--keyserver");
- TCHAR *server = new TCHAR[128];
+ wchar_t *server = new wchar_t[128];
GetDlgItemText(hwndDlg, IDC_KEYSERVER, server, 128);
cmd.push_back(server);
delete[] server;
@@ -1875,13 +1875,13 @@ void InitCheck()
{
{
// parse gpg output
- TCHAR *current_home = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
+ wchar_t *current_home = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
db_set_ts(NULL, szGPGModuleName, "szHomePath", L""); //we do not need home for gpg binary validation
gpg_valid = isGPGValid();
db_set_ts(NULL, szGPGModuleName, "szHomePath", current_home); //return current home dir back
mir_free(current_home);
bool home_dir_access = false, temp_access = false;
- TCHAR *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
+ wchar_t *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
std::wstring test_path = home_dir;
mir_free(home_dir);
test_path += L"/";
@@ -1908,8 +1908,8 @@ void InitCheck()
boost::filesystem::remove(test_path);
}
if (!home_dir_access || !temp_access || !gpg_valid) {
- TCHAR buf[4096];
- _tcsncpy(buf, gpg_valid ? TranslateT("GPG binary is set and valid (this is good).\n") : TranslateT("GPG binary unset or invalid (plugin will not work).\n"), _countof(buf));
+ wchar_t buf[4096];
+ wcsncpy(buf, gpg_valid ? TranslateT("GPG binary is set and valid (this is good).\n") : TranslateT("GPG binary unset or invalid (plugin will not work).\n"), _countof(buf));
mir_tstrncat(buf, home_dir_access ? TranslateT("Home dir write access granted (this is good).\n") : TranslateT("Home dir has no write access (plugin most probably will not work).\n"), _countof(buf) - mir_tstrlen(buf));
mir_tstrncat(buf, temp_access ? TranslateT("Temp dir write access granted (this is good).\n") : TranslateT("Temp dir has no write access (plugin should work, but may have some problems, file transfers will not work)."), _countof(buf) - mir_tstrlen(buf));
if (!gpg_valid)
@@ -1977,23 +1977,23 @@ void InitCheck()
p += mir_strlen("expires:");
p++;
p2 = out.find("]", p);
- TCHAR *expire_date = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str());
+ wchar_t *expire_date = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str());
bool expired = false;
{
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
- TCHAR buf[5];
- _tcsncpy_s(buf, expire_date, _TRUNCATE);
- int year = _ttoi(buf);
+ wchar_t buf[5];
+ wcsncpy_s(buf, expire_date, _TRUNCATE);
+ int year = _wtoi(buf);
if (year < now.date().year())
expired = true;
else if (year == now.date().year()) {
- _tcsncpy_s(buf, (expire_date + 5), _TRUNCATE);
- int month = _ttoi(buf);
+ wcsncpy_s(buf, (expire_date + 5), _TRUNCATE);
+ int month = _wtoi(buf);
if (month < now.date().month())
expired = true;
else if (month == now.date().month()) {
- _tcsncpy_s(buf, (expire_date + 8), _TRUNCATE);
- unsigned day = _ttoi(buf);
+ wcsncpy_s(buf, (expire_date + 8), _TRUNCATE);
+ unsigned day = _wtoi(buf);
if (day <= now.date().day_number())
expired = true;
}
@@ -2037,23 +2037,23 @@ void InitCheck()
p += mir_strlen("expires:");
p++;
p2 = out.find("]", p);
- TCHAR *expire_date = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str());
+ wchar_t *expire_date = mir_wstrdup(toUTF16(out.substr(p, p2 - p)).c_str());
bool expired = false;
{
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
- TCHAR buf[5];
- _tcsncpy_s(buf, expire_date, _TRUNCATE);
- int year = _ttoi(buf);
+ wchar_t buf[5];
+ wcsncpy_s(buf, expire_date, _TRUNCATE);
+ int year = _wtoi(buf);
if (year < now.date().year())
expired = true;
else if (year == now.date().year()) {
- _tcsncpy_s(buf, (expire_date + 5), _TRUNCATE);
- int month = _ttoi(buf);
+ wcsncpy_s(buf, (expire_date + 5), _TRUNCATE);
+ int month = _wtoi(buf);
if (month < now.date().month())
expired = true;
else if (month == now.date().month()) {
- _tcsncpy_s(buf, (expire_date + 8), _TRUNCATE);
- unsigned day = _ttoi(buf);
+ wcsncpy_s(buf, (expire_date + 8), _TRUNCATE);
+ unsigned day = _wtoi(buf);
if (day <= now.date().day_number())
expired = true;
}
@@ -2072,7 +2072,7 @@ void InitCheck()
mir_free(key);
}
{
- TCHAR *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
+ wchar_t *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
DWORD dwFileAttr = GetFileAttributes(path);
if (dwFileAttr != INVALID_FILE_ATTRIBUTES) {
dwFileAttr &= ~FILE_ATTRIBUTE_READONLY;
@@ -2135,9 +2135,9 @@ void ImportKey()
// gpg execute block
std::vector<wstring> cmd;
- TCHAR tmp2[MAX_PATH] = { 0 };
+ wchar_t tmp2[MAX_PATH] = { 0 };
{
- _tcsncpy(tmp2, ptrT(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"")), MAX_PATH - 1);
+ wcsncpy(tmp2, ptrT(UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"")), MAX_PATH - 1);
mir_tstrncat(tmp2, L"\\", _countof(tmp2) - mir_tstrlen(tmp2));
mir_tstrncat(tmp2, L"temporary_exported.asc", _countof(tmp2) - mir_tstrlen(tmp2));
boost::filesystem::remove(tmp2);
diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp
index de5940cb32..7ea7e6f1eb 100755
--- a/plugins/New_GPG/src/messages.cpp
+++ b/plugins/New_GPG/src/messages.cpp
@@ -105,14 +105,14 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR
mir_free(tmp);
f.close();
}
- extern TCHAR *password;
+ extern wchar_t *password;
string out;
DWORD code;
std::vector<wstring> cmd;
cmd.push_back(L"--batch");
{
char *inkeyid = UniGetContactSettingUtf(db_mc_isMeta(hContact) ? metaGetMostOnline(hContact) : hContact, szGPGModuleName, "InKeyID", "");
- TCHAR *pass = NULL;
+ wchar_t *pass = NULL;
if (inkeyid[0]) {
string dbsetting = "szKey_";
dbsetting += inkeyid;
@@ -422,7 +422,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l)
db_set_ts(ccs->hContact, szGPGModuleName, "GPGPubKey", str.substr(s1, s2 - s1).c_str());
{ //gpg execute block
std::vector<wstring> cmd;
- TCHAR tmp2[MAX_PATH] = { 0 };
+ wchar_t tmp2[MAX_PATH] = { 0 };
string output;
DWORD exitcode;
{
@@ -430,7 +430,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l)
mir_tstrcpy(tmp2, ptmp);
mir_free(ptmp);
mir_tstrcat(tmp2, L"\\");
- TCHAR *tmp3 = mir_a2t(get_random(5).c_str());
+ wchar_t *tmp3 = mir_a2t(get_random(5).c_str());
mir_tstrcat(tmp2, tmp3);
mir_tstrcat(tmp2, L".asc");
mir_free(tmp3);
@@ -460,7 +460,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l)
}
}
ptmp = UniGetContactSettingUtf(ccs->hContact, szGPGModuleName, "GPGPubKey", L"");
- f << (TCHAR*)ptmp;
+ f << (wchar_t*)ptmp;
f.close();
cmd.push_back(L"--batch");
cmd.push_back(L"--import");
@@ -613,14 +613,14 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l)
}
else
{
- TCHAR *jid = UniGetContactSettingUtf(ccs->hContact, proto, "jid", L"");
+ wchar_t *jid = UniGetContactSettingUtf(ccs->hContact, proto, "jid", L"");
if (jid[0])
{
extern list <JabberAccount*> Accounts;
list<JabberAccount*>::iterator end = Accounts.end();
for (list<JabberAccount*>::iterator p = Accounts.begin(); p != end; p++)
{
- TCHAR *caps = (*p)->getJabberInterface()->GetResourceFeatures(jid);
+ wchar_t *caps = (*p)->getJabberInterface()->GetResourceFeatures(jid);
if (caps)
{
wstring str1;
@@ -666,7 +666,7 @@ void SendMsgSvc_func(MCONTACT hContact, char *msg, DWORD flags)
std::vector<std::wstring> cmd;
extern bool bJabberAPI, bIsMiranda09;
{
- TCHAR *tmp2;
+ wchar_t *tmp2;
{
char *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyID", "");
if (!tmp[0]) {
@@ -695,7 +695,7 @@ void SendMsgSvc_func(MCONTACT hContact, char *msg, DWORD flags)
mir_free(tmp2);
}
{
- TCHAR *tmp2 = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
+ wchar_t *tmp2 = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
path = tmp2;
cmd.push_back(std::wstring(tmp2) + L"\\tmp\\" + file);
mir_free(tmp2);
@@ -813,7 +813,7 @@ void SendMsgSvc_func(MCONTACT hContact, char *msg, DWORD flags)
str.clear();
if (f.is_open()) {
std::wifstream::pos_type size = f.tellg();
- TCHAR *tmp = new TCHAR[(std::ifstream::pos_type)size + (std::ifstream::pos_type)1];
+ wchar_t *tmp = new wchar_t[(std::ifstream::pos_type)size + (std::ifstream::pos_type)1];
f.seekg(0, std::ios::beg);
f.read(tmp, size);
tmp[size] = '\0';
@@ -887,7 +887,7 @@ int HookSendMsg(WPARAM w, LPARAM l)
return 0;
MCONTACT hContact = (MCONTACT)w;
if (dbei->flags & DBEF_SENT) {
- if (isContactSecured(hContact) && strstr((char*)dbei->pBlob, "-----BEGIN PGP MESSAGE-----")) //our service data, can be double added by metacontacts e.t.c.
+ if (isContactSecured(hContact) && strstr((char*)dbei->pBlob, "-----BEGIN PGP MESSAGE-----")) //our service data, can be double added by metacontacts e.w.c.
{
if (bDebugLog)
debuglog << std::string(time_str() + ": info(send handler): block pgp message event, name: " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0)));
@@ -933,14 +933,14 @@ int HookSendMsg(WPARAM w, LPARAM l)
}
}
else {
- TCHAR *jid = UniGetContactSettingUtf(hContact, proto, "jid", L"");
+ wchar_t *jid = UniGetContactSettingUtf(hContact, proto, "jid", L"");
if (jid[0]) {
if (bDebugLog)
debuglog << std::string(time_str() + ": info(autoexchange): protocol looks like jabber, name: " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0)));
extern list <JabberAccount*> Accounts;
list<JabberAccount*>::iterator end = Accounts.end();
for (list<JabberAccount*>::iterator p = Accounts.begin(); p != end; p++) {
- TCHAR *caps = (*p)->getJabberInterface()->GetResourceFeatures(jid);
+ wchar_t *caps = (*p)->getJabberInterface()->GetResourceFeatures(jid);
if (caps) {
wstring str;
for (int i = 0;; i++) {
@@ -1024,10 +1024,10 @@ static INT_PTR CALLBACK DlgProcKeyPassword(HWND hwndDlg, UINT msg, WPARAM wParam
switch (LOWORD(wParam)) {
case IDOK:
{
- TCHAR tmp[64];
+ wchar_t tmp[64];
GetDlgItemText(hwndDlg, IDC_KEY_PASSWORD, tmp, _countof(tmp));
if (tmp[0]) {
- extern TCHAR *password;
+ extern wchar_t *password;
if (IsDlgButtonChecked(hwndDlg, IDC_SAVE_PASSWORD)) {
inkeyid = UniGetContactSettingUtf(new_key_hcnt, szGPGModuleName, "InKeyID", "");
if (inkeyid && inkeyid[0] && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DEFAULT_PASSWORD)) {
@@ -1040,7 +1040,7 @@ static INT_PTR CALLBACK DlgProcKeyPassword(HWND hwndDlg, UINT msg, WPARAM wParam
}
if (password)
mir_free(password);
- password = (TCHAR*)mir_alloc(sizeof(TCHAR)*(mir_tstrlen(tmp) + 1));
+ password = (wchar_t*)mir_alloc(sizeof(wchar_t)*(mir_tstrlen(tmp) + 1));
mir_tstrcpy(password, tmp);
}
mir_free(inkeyid);
diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp
index 2b4caf0911..68595f9ce9 100755
--- a/plugins/New_GPG/src/options.cpp
+++ b/plugins/New_GPG/src/options.cpp
@@ -43,25 +43,25 @@ int GpgOptInit(WPARAM wParam, LPARAM)
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GPG);
- odp.ptszTitle = _T(szGPGModuleName);
- odp.ptszGroup = LPGENT("Services");
- odp.ptszTab = LPGENT("Main");
+ odp.pwszTitle = _T(szGPGModuleName);
+ odp.pwszGroup = LPGENW("Services");
+ odp.pwszTab = LPGENW("Main");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pfnDlgProc = DlgProcGpgOpts;
Options_AddPage(wParam, &odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GPG_BIN);
- odp.ptszTab = LPGENT("GnuPG Variables");
+ odp.pwszTab = LPGENW("GnuPG Variables");
odp.pfnDlgProc = DlgProcGpgBinOpts;
Options_AddPage(wParam, &odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GPG_MESSAGES);
- odp.ptszTab = LPGENT("Messages");
+ odp.pwszTab = LPGENW("Messages");
odp.pfnDlgProc = DlgProcGpgMsgOpts;
Options_AddPage(wParam, &odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GPG_ADVANCED);
- odp.ptszTab = LPGENT("Advanced");
+ odp.pwszTab = LPGENW("Advanced");
odp.pfnDlgProc = DlgProcGpgAdvOpts;
Options_AddPage(wParam, &odp);
return 0;
@@ -120,7 +120,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
int i = 1, iRow = 0;
for (MCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) {
if (isContactHaveKey(hContact)) {
- TCHAR *name = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *name = pcli->pfnGetContactDisplayName(hContact, 0);
item.mask = LVIF_TEXT;
item.iItem = i;
item.iSubItem = 0;
@@ -128,7 +128,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
iRow = ListView_InsertItem(hwndList, &item);
ListView_SetItemText(hwndList, iRow, 0, name);
- TCHAR *tmp = mir_a2t(GetContactProto(hContact));
+ wchar_t *tmp = mir_a2t(GetContactProto(hContact));
ListView_SetItemText(hwndList, iRow, 4, tmp);
mir_free(tmp);
@@ -168,7 +168,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
i++;
}
}
- TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szLogFilePath", L"");
+ wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szLogFilePath", L"");
SetDlgItemText(hwndDlg, IDC_LOG_FILE_EDIT, (mir_tstrlen(tmp) > 1) ? tmp : L"c:\\GPGdebug.log");
mir_free(tmp);
CheckStateLoadDB(hwndDlg, IDC_DEBUG_LOG, "bDebugLog", 0);
@@ -195,7 +195,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
void setClistIcon(MCONTACT hContact);
void setSrmmIcon(MCONTACT hContact);
{ //gpg execute block
- TCHAR *ptmp;
+ wchar_t *ptmp;
char *tmp;
bool keep = false;
bool ismetacontact = false;
@@ -304,7 +304,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
case IDC_SAVE_KEY_BUTTON:
{
- TCHAR *tmp = GetFilePath(TranslateT("Export public key"), L"*", TranslateT(".asc pubkey file"), true);
+ wchar_t *tmp = GetFilePath(TranslateT("Export public key"), L"*", TranslateT(".asc pubkey file"), true);
if (tmp) {
wstring str(ptrT(UniGetContactSettingUtf(user_data[item_num + 1], szGPGModuleName, "GPGPubKey", L"")));
wstring::size_type s = 0;
@@ -332,7 +332,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
}
szKey = (char*)GlobalLock(hMem);
if (!szKey) {
- TCHAR msg[64];
+ wchar_t msg[64];
mir_sntprintf(msg, TranslateT("Failed to lock memory with error %d"), GetLastError());
MessageBox(0, msg, TranslateT("Error"), MB_OK);
GlobalFree(hMem);
@@ -345,7 +345,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
GlobalUnlock(hMem);
if (!SetClipboardData(CF_OEMTEXT, hMem)) {
GlobalFree(hMem);
- TCHAR msg[64];
+ wchar_t msg[64];
mir_sntprintf(msg, TranslateT("Failed write to clipboard with error %d"), GetLastError());
MessageBox(0, msg, TranslateT("Error"), MB_OK);
}
@@ -353,7 +353,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
}
}
else {
- TCHAR msg[64];
+ wchar_t msg[64];
mir_sntprintf(msg, TranslateT("Failed to open clipboard with error %d"), GetLastError());
MessageBox(0, msg, TranslateT("Error"), MB_OK);
}
@@ -397,7 +397,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
}
bAutoExchange = CheckStateStoreDB(hwndDlg, IDC_AUTO_EXCHANGE, "bAutoExchange") != 0;
{
- TCHAR tmp[512];
+ wchar_t tmp[512];
GetDlgItemText(hwndDlg, IDC_LOG_FILE_EDIT, tmp, _countof(tmp));
db_set_ts(NULL, szGPGModuleName, "szLogFilePath", tmp);
}
@@ -424,7 +424,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
case IDC_SET_BIN_PATH:
{
GetFilePath(TranslateT("Choose gpg.exe"), "szGpgBinPath", L"*.exe", TranslateT("EXE Executables"));
- TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"gpg.exe");
+ wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"gpg.exe");
SetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp);
bool gpg_exists = false;
{
@@ -432,7 +432,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
gpg_exists = true;
if (gpg_exists) {
bool bad_version = false;
- TCHAR *tmp_path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"");
+ wchar_t *tmp_path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"");
db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp);
string out;
DWORD code;
@@ -478,7 +478,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
case IDC_SET_HOME_DIR:
{
GetFolderPath(TranslateT("Set home directory"), "szHomePath");
- TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
+ wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
SetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp);
char mir_path[MAX_PATH];
char *atmp = mir_t2a(tmp);
@@ -503,7 +503,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- TCHAR tmp[512];
+ wchar_t tmp[512];
GetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp, _countof(tmp));
db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp);
GetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp, _countof(tmp));
@@ -526,7 +526,7 @@ static INT_PTR CALLBACK DlgProcGpgMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
CheckStateLoadDB(hwndDlg, IDC_APPEND_TAGS, "bAppendTags", 0);
CheckStateLoadDB(hwndDlg, IDC_STRIP_TAGS, "bStripTags", 0);
{
- TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szInOpenTag", L"<GPGdec>");
+ wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szInOpenTag", L"<GPGdec>");
SetDlgItemText(hwndDlg, IDC_IN_OPEN_TAG, tmp);
mir_free(tmp);
tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szInCloseTag", L"</GPGdec>");
@@ -565,26 +565,26 @@ static INT_PTR CALLBACK DlgProcGpgMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
bAppendTags = CheckStateStoreDB(hwndDlg, IDC_APPEND_TAGS, "bAppendTags") != 0;
bStripTags = CheckStateStoreDB(hwndDlg, IDC_STRIP_TAGS, "bStripTags") != 0;
{
- TCHAR tmp[128];
+ wchar_t tmp[128];
GetDlgItemText(hwndDlg, IDC_IN_OPEN_TAG, tmp, _countof(tmp));
db_set_ts(NULL, szGPGModuleName, "szInOpenTag", tmp);
mir_free(inopentag);
- inopentag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (mir_tstrlen(tmp) + 1));
+ inopentag = (wchar_t*)mir_alloc(sizeof(wchar_t)* (mir_tstrlen(tmp) + 1));
mir_tstrcpy(inopentag, tmp);
GetDlgItemText(hwndDlg, IDC_IN_CLOSE_TAG, tmp, _countof(tmp));
db_set_ts(NULL, szGPGModuleName, "szInCloseTag", tmp);
mir_free(inclosetag);
- inclosetag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (mir_tstrlen(tmp) + 1));
+ inclosetag = (wchar_t*)mir_alloc(sizeof(wchar_t)* (mir_tstrlen(tmp) + 1));
mir_tstrcpy(inclosetag, tmp);
GetDlgItemText(hwndDlg, IDC_OUT_OPEN_TAG, tmp, _countof(tmp));
db_set_ts(NULL, szGPGModuleName, "szOutOpenTag", tmp);
mir_free(outopentag);
- outopentag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (mir_tstrlen(tmp) + 1));
+ outopentag = (wchar_t*)mir_alloc(sizeof(wchar_t)* (mir_tstrlen(tmp) + 1));
mir_tstrcpy(outopentag, tmp);
GetDlgItemText(hwndDlg, IDC_OUT_CLOSE_TAG, tmp, _countof(tmp));
db_set_ts(NULL, szGPGModuleName, "szOutCloseTag", tmp);
mir_free(outclosetag);
- outclosetag = (TCHAR*)mir_alloc(sizeof(TCHAR)*(mir_tstrlen(tmp) + 1));
+ outclosetag = (wchar_t*)mir_alloc(sizeof(wchar_t)*(mir_tstrlen(tmp) + 1));
mir_tstrcpy(outclosetag, tmp);
}
return TRUE;
@@ -679,7 +679,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa
CheckDlgButton(hwndDlg, IDC_ENABLE_ENCRYPTION, BST_CHECKED);
}
if (hcnt) {
- TCHAR *tmp = UniGetContactSettingUtf(hcnt, szGPGModuleName, "GPGPubKey", L"");
+ wchar_t *tmp = UniGetContactSettingUtf(hcnt, szGPGModuleName, "GPGPubKey", L"");
wstring str = tmp;
mir_free(tmp); tmp = NULL;
if (!str.empty()) {
@@ -713,7 +713,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa
if ((out.find("-----BEGIN PGP PUBLIC KEY BLOCK-----") != string::npos) && (out.find("-----END PGP PUBLIC KEY BLOCK-----") != string::npos)) {
boost::algorithm::replace_all(out, "\n", "\r\n");
- TCHAR *tmp3 = mir_a2t(out.c_str());
+ wchar_t *tmp3 = mir_a2t(out.c_str());
str.clear();
str.append(tmp3);
mir_free(tmp3);
@@ -747,8 +747,8 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa
switch (LOWORD(wParam)) {
case ID_OK:
{
- TCHAR *tmp = new TCHAR[40960];
- TCHAR *begin, *end;
+ wchar_t *tmp = new wchar_t[40960];
+ wchar_t *begin, *end;
GetDlgItemText(hwndDlg, IDC_PUBLIC_KEY_EDIT, tmp, 40960);
key_buf.append(tmp);
key_buf.append(L"\n"); //no new line at end of file )
@@ -758,15 +758,15 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa
}
ws1 = 0;
if (((ws2 = key_buf.find(L"-----END PGP PUBLIC KEY BLOCK-----")) != wstring::npos) && ((ws1 = key_buf.find(L"-----BEGIN PGP PUBLIC KEY BLOCK-----")) != wstring::npos)) {
- begin = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(L"-----BEGIN PGP PUBLIC KEY BLOCK-----") + 1));
+ begin = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_tstrlen(L"-----BEGIN PGP PUBLIC KEY BLOCK-----") + 1));
mir_tstrcpy(begin, L"-----BEGIN PGP PUBLIC KEY BLOCK-----");
- end = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(L"-----END PGP PUBLIC KEY BLOCK-----") + 1));
+ end = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_tstrlen(L"-----END PGP PUBLIC KEY BLOCK-----") + 1));
mir_tstrcpy(end, L"-----END PGP PUBLIC KEY BLOCK-----");
}
else if (((ws2 = key_buf.find(L"-----END PGP PRIVATE KEY BLOCK-----")) != wstring::npos) && ((ws1 = key_buf.find(L"-----BEGIN PGP PRIVATE KEY BLOCK-----")) != wstring::npos)) {
- begin = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(L"-----BEGIN PGP PRIVATE KEY BLOCK-----") + 1));
+ begin = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_tstrlen(L"-----BEGIN PGP PRIVATE KEY BLOCK-----") + 1));
mir_tstrcpy(begin, L"-----BEGIN PGP PRIVATE KEY BLOCK-----");
- end = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(L"-----END PGP PRIVATE KEY BLOCK-----") + 1));
+ end = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_tstrlen(L"-----END PGP PRIVATE KEY BLOCK-----") + 1));
mir_tstrcpy(end, L"-----END PGP PRIVATE KEY BLOCK-----");
}
else {
@@ -790,18 +790,18 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa
}
else db_set_ts(hContact, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str());
}
- tmp = (TCHAR*)mir_alloc(sizeof(TCHAR) * (key_buf.length() + 1));
+ tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * (key_buf.length() + 1));
mir_tstrcpy(tmp, key_buf.substr(ws1, ws2 - ws1).c_str());
{ //gpg execute block
std::vector<wstring> cmd;
- TCHAR tmp2[MAX_PATH] = { 0 };
- TCHAR *ptmp;
+ wchar_t tmp2[MAX_PATH] = { 0 };
+ wchar_t *ptmp;
string output;
DWORD exitcode;
{
MCONTACT hcnt = db_mc_tryMeta(hContact);
ptmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
- _tcsncpy(tmp2, ptmp, MAX_PATH - 1);
+ wcsncpy(tmp2, ptmp, MAX_PATH - 1);
mir_free(ptmp);
mir_tstrncat(tmp2, L"\\", _countof(tmp2) - mir_tstrlen(tmp2));
mir_tstrncat(tmp2, L"temporary_exported.asc", _countof(tmp2) - mir_tstrlen(tmp2));
@@ -1004,7 +1004,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa
}
}
if (!hContact) {
- TCHAR *fp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyID", L"");
+ wchar_t *fp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyID", L"");
{
string out;
DWORD code;
@@ -1069,7 +1069,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa
break;
case ID_LOAD_FROM_FILE:
{
- TCHAR *tmp = GetFilePath(TranslateT("Set file containing GPG public key"), L"*", TranslateT("GPG public key file"));
+ wchar_t *tmp = GetFilePath(TranslateT("Set file containing GPG public key"), L"*", TranslateT("GPG public key file"));
if (!tmp)
break;
@@ -1081,7 +1081,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa
}
if (f.is_open()) {
std::wifstream::pos_type size = f.tellg();
- TCHAR *temp = new TCHAR[(std::ifstream::pos_type)size + (std::ifstream::pos_type)1];
+ wchar_t *temp = new wchar_t[(std::ifstream::pos_type)size + (std::ifstream::pos_type)1];
f.seekg(0, std::ios::beg);
f.read(temp, size);
temp[size] = '\0';
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp
index 4de5fc75a8..1a169bbcb3 100755
--- a/plugins/New_GPG/src/utilities.cpp
+++ b/plugins/New_GPG/src/utilities.cpp
@@ -24,10 +24,10 @@ extern HINSTANCE hInst;
extern HANDLE hLoadPublicKey;
extern HGENMENU hToggleEncryption, hSendKey;
-TCHAR* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule, const char* szSetting, TCHAR* szDef)
+wchar_t* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule, const char* szSetting, wchar_t* szDef)
{
DBVARIANT dbv = { DBVT_DELETED };
- TCHAR* szRes = NULL;
+ wchar_t* szRes = NULL;
if (db_get_ts(hContact, szModule, szSetting, &dbv))
return mir_tstrdup(szDef);
else if (dbv.pszVal)
@@ -53,22 +53,22 @@ char* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,
return szRes;
}
-void GetFilePath(TCHAR *WindowTittle, char *szSetting, TCHAR *szExt, TCHAR *szExtDesc)
+void GetFilePath(wchar_t *WindowTittle, char *szSetting, wchar_t *szExt, wchar_t *szExtDesc)
{
- TCHAR str[MAX_PATH + 2] = { 0 }, *tmp;
+ wchar_t str[MAX_PATH + 2] = { 0 }, *tmp;
OPENFILENAME ofn = { 0 };
- TCHAR filter[512], *pfilter;
+ wchar_t filter[512], *pfilter;
ofn.lStructSize = CDSIZEOF_STRUCT(OPENFILENAME, lpTemplateName);
ofn.Flags = OFN_EXPLORER;
ofn.lpstrTitle = TranslateW(WindowTittle);
- _tcsncpy(filter, TranslateW(szExtDesc), _countof(filter) - 1);
+ wcsncpy(filter, TranslateW(szExtDesc), _countof(filter) - 1);
pfilter = filter + mir_tstrlen(filter) + 1;
mir_tstrcpy(pfilter, szExt);
pfilter[mir_tstrlen(pfilter) + 1] = '\0';
pfilter[mir_tstrlen(pfilter) + 2] = '\0';
ofn.lpstrFilter = filter;
tmp = UniGetContactSettingUtf(0, szGPGModuleName, szSetting, L"");
- _tcsncpy(str, tmp, _countof(str) - 1);
+ wcsncpy(str, tmp, _countof(str) - 1);
mir_free(tmp);
if (mir_tstrlen(str) < 2)
str[0] = '\0';
@@ -80,11 +80,11 @@ void GetFilePath(TCHAR *WindowTittle, char *szSetting, TCHAR *szExt, TCHAR *szEx
db_set_ts(0, szGPGModuleName, szSetting, str);
}
-TCHAR *GetFilePath(TCHAR *WindowTittle, TCHAR *szExt, TCHAR *szExtDesc, bool save_file)
+wchar_t *GetFilePath(wchar_t *WindowTittle, wchar_t *szExt, wchar_t *szExtDesc, bool save_file)
{
- TCHAR *str = new TCHAR[MAX_PATH + 2];
+ wchar_t *str = new wchar_t[MAX_PATH + 2];
OPENFILENAME ofn = { 0 };
- TCHAR filter[512], *pfilter;
+ wchar_t filter[512], *pfilter;
ofn.lStructSize = CDSIZEOF_STRUCT(OPENFILENAME, lpTemplateName);
ofn.Flags = OFN_EXPLORER;
ofn.lpstrTitle = TranslateW(WindowTittle);
@@ -115,14 +115,14 @@ TCHAR *GetFilePath(TCHAR *WindowTittle, TCHAR *szExt, TCHAR *szExtDesc, bool sav
return str;
}
-void GetFolderPath(TCHAR *WindowTittle, char*)
+void GetFolderPath(wchar_t *WindowTittle, char*)
{
BROWSEINFO pbi = { 0 };
pbi.lpszTitle = WindowTittle;
pbi.ulFlags = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_SHAREABLE;
LPITEMIDLIST pidl = SHBrowseForFolder(&pbi);
if (pidl != 0) {
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
if (SHGetPathFromIDList(pidl, path)) {
db_set_ts(NULL, szGPGModuleName, "szHomePath", path);
}
@@ -213,7 +213,7 @@ INT_PTR ToggleEncryption(WPARAM w, LPARAM)
setSrmmIcon(hContact);
setClistIcon(hContact);
- Menu_ModifyItem(hToggleEncryption, enc ? LPGENT("Turn off GPG encryption") : LPGENT("Turn on GPG encryption"));
+ Menu_ModifyItem(hToggleEncryption, enc ? LPGENW("Turn off GPG encryption") : LPGENW("Turn on GPG encryption"));
return 0;
}
@@ -237,14 +237,14 @@ int OnPreBuildContactMenu(WPARAM w, LPARAM)
mir_free(keyid);
keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", "");
}
- TCHAR buf[128] = { 0 };
+ wchar_t buf[128] = { 0 };
mir_sntprintf(buf, L"%s: %s", TranslateT("Send public key"), toUTF16(keyid).c_str());
mir_free(keyid);
Menu_ModifyItem(hSendKey, buf);
}
int flags;
- TCHAR *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L"");
+ wchar_t *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L"");
if (!tmp[0]) {
db_unset(hContact, szGPGModuleName, "GPGEncryption");
flags = CMIF_GRAYED;
@@ -276,7 +276,7 @@ int onProtoAck(WPARAM, LPARAM l)
break;
PROTOFILETRANSFERSTATUS *f = (PROTOFILETRANSFERSTATUS*)ack->hProcess;
if ((f->flags & PFTS_SENDING) != PFTS_SENDING) {
- TCHAR *filename = NULL;
+ wchar_t *filename = NULL;
if (f->flags & PFTS_UNICODE) {
if (f->tszCurrentFile && f->tszCurrentFile[0])
filename = mir_wstrdup(f->tszCurrentFile);
@@ -289,7 +289,7 @@ int onProtoAck(WPARAM, LPARAM l)
if (!filename)
return 0;
}
- if (_tcsstr(filename, L".gpg")) //decrypt it
+ if (wcsstr(filename, L".gpg")) //decrypt it
{ //process encrypted file
if (!bFileTransfers && !bSameAction) {
void ShowEncryptedFileMsgBox();
@@ -316,9 +316,9 @@ int onProtoAck(WPARAM, LPARAM l)
}
cmd.push_back(file);
boost::filesystem::remove(file);
- extern TCHAR *password;
+ extern wchar_t *password;
{ // password
- TCHAR *pass = NULL;
+ wchar_t *pass = NULL;
char *keyid = UniGetContactSettingUtf(ack->hContact, szGPGModuleName, "KeyID", "");
if (mir_strlen(keyid) > 0) {
string dbsetting = "szKey_";
@@ -421,7 +421,7 @@ int onProtoAck(WPARAM, LPARAM l)
return 0;
}
-std::wstring encrypt_file(MCONTACT hContact, TCHAR *filename)
+std::wstring encrypt_file(MCONTACT hContact, wchar_t *filename)
{
string out;
DWORD code;
@@ -432,13 +432,13 @@ std::wstring encrypt_file(MCONTACT hContact, TCHAR *filename)
cmd.push_back(L"--tes");
cmd.push_back(L"-r");
char *keyid = UniGetContactSettingUtf(hcnt, szGPGModuleName, "KeyID", "");
- TCHAR *szKeyid = mir_a2t(keyid);
- TCHAR *name = _tcsrchr(filename, _T('\\'));
+ wchar_t *szKeyid = mir_a2t(keyid);
+ wchar_t *name = wcsrchr(filename, '\\');
if (!name)
name = filename;
else
name++;
- TCHAR *file_out = new TCHAR[mir_tstrlen(name) + mir_tstrlen(L".gpg") + 1];
+ wchar_t *file_out = new wchar_t[mir_tstrlen(name) + mir_tstrlen(L".gpg") + 1];
mir_sntprintf(file_out, mir_tstrlen(name) + mir_tstrlen(L".gpg") + 1, L"%s.gpg", name);
cmd.push_back(szKeyid);
if (db_get_b(hcnt, szGPGModuleName, "bAlwaysTrust", 0)) {
@@ -448,7 +448,7 @@ std::wstring encrypt_file(MCONTACT hContact, TCHAR *filename)
mir_free(szKeyid);
mir_free(keyid);
cmd.push_back(L"-o");
- TCHAR *temp = _tgetenv(L"TEMP");
+ wchar_t *temp = _tgetenv(L"TEMP");
cmd.push_back(wstring(temp) + L"\\" + file_out);
wstring path_out = temp;
path_out += L"\\";
@@ -501,12 +501,12 @@ INT_PTR onSendFile(WPARAM w, LPARAM l)
}
}
else {
- TCHAR *jid = UniGetContactSettingUtf(ccs->hContact, proto, "jid", L"");
+ wchar_t *jid = UniGetContactSettingUtf(ccs->hContact, proto, "jid", L"");
if (jid[0]) {
extern list <JabberAccount*> Accounts;
list<JabberAccount*>::iterator end = Accounts.end();
for (list<JabberAccount*>::iterator p = Accounts.begin(); p != end; p++) {
- TCHAR *caps = (*p)->getJabberInterface()->GetResourceFeatures(jid);
+ wchar_t *caps = (*p)->getJabberInterface()->GetResourceFeatures(jid);
if (caps) {
supported_proto = true;
wstring str;
@@ -534,11 +534,11 @@ INT_PTR onSendFile(WPARAM w, LPARAM l)
}
HistoryLog(ccs->hContact, db_event(Translate("encrypting file for transfer"), 0, 0, DBEF_SENT));
if (StriStr(ccs->szProtoService, "/sendfilew")) {
- TCHAR **file = (TCHAR **)ccs->lParam;
+ wchar_t **file = (wchar_t **)ccs->lParam;
for (int i = 0; file[i]; i++) {
if (!boost::filesystem::exists(file[i]))
return 0; //we do not want to send file unencrypted (sometimes ack have wrong info)
- if (_tcsstr(file[i], L".gpg"))
+ if (wcsstr(file[i], L".gpg"))
continue;
std::wstring path_out = encrypt_file(ccs->hContact, file[i]);
mir_free(file[i]);
@@ -553,7 +553,7 @@ INT_PTR onSendFile(WPARAM w, LPARAM l)
return 0; //we do not want to send file unencrypted (sometimes ack have wrong info)
if (strstr(file[i], ".gpg"))
continue;
- TCHAR *tmp = mir_utf8decodeT(file[i]);
+ wchar_t *tmp = mir_utf8decodeT(file[i]);
std::wstring path_out = encrypt_file(ccs->hContact, tmp);
mir_free(tmp);
char* tmp2 = mir_utf8encodeW(path_out.c_str());
@@ -583,14 +583,14 @@ void HistoryLog(MCONTACT hContact, db_event evt)
db_event_add(hContact, &Event);
}
-static int ControlAddStringUtf(HWND ctrl, DWORD msg, const TCHAR *szString)
+static int ControlAddStringUtf(HWND ctrl, DWORD msg, const wchar_t *szString)
{
int item = -1;
item = SendMessage(ctrl, msg, 0, (LPARAM)szString);
return item;
}
-int ComboBoxAddStringUtf(HWND hCombo, const TCHAR *szString, DWORD data)
+int ComboBoxAddStringUtf(HWND hCombo, const wchar_t *szString, DWORD data)
{
int item = ControlAddStringUtf(hCombo, CB_ADDSTRING, szString);
SendMessage(hCombo, CB_SETITEMDATA, item, data);
@@ -618,11 +618,11 @@ int GetJabberInterface(WPARAM, LPARAM) //get interface for all jabber accounts,
if (JIftmp) {
(*p)->setJabberInterface(JIftmp);
if (accounts[i]->tszAccountName) {
- TCHAR* tmp = mir_tstrdup(accounts[i]->tszAccountName);
+ wchar_t* tmp = mir_tstrdup(accounts[i]->tszAccountName);
(*p)->setAccountName(tmp);
}
else {
- TCHAR *tmp = mir_a2t(accounts[i]->szModuleName);
+ wchar_t *tmp = mir_a2t(accounts[i]->szModuleName);
(*p)->setAccountName(tmp);
}
(*p)->setAccountNumber(a);
@@ -654,7 +654,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void*)
continue;
// TODO: make following block more readable
- if (_tcsstr(str, L"-----BEGIN PGP MESSAGE-----") && _tcsstr(str, L"-----END PGP MESSAGE-----")) {
+ if (wcsstr(str, L"-----BEGIN PGP MESSAGE-----") && wcsstr(str, L"-----END PGP MESSAGE-----")) {
wstring data = str;
xmlSetText(local_node, L"This message is encrypted.");
wstring::size_type p1 = data.find(L"-----BEGIN PGP MESSAGE-----") + mir_tstrlen(L"-----BEGIN PGP MESSAGE-----");
@@ -681,8 +681,8 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void*)
break;
}
- if (bPresenceSigning && nodename && _tcsstr(nodename, L"status")) {
- TCHAR *path_c = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
+ if (bPresenceSigning && nodename && wcsstr(nodename, L"status")) {
+ wchar_t *path_c = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
wstring path_out = path_c;
wstring file = toUTF16(get_random(10));
mir_free(path_c);
@@ -698,7 +698,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void*)
break;
}
- extern TCHAR *password;
+ extern wchar_t *password;
string out;
DWORD code;
std::vector<wstring> cmd;
@@ -763,7 +763,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void*)
wstring data;
if (f.is_open()) {
std::wifstream::pos_type size = f.tellg();
- TCHAR *tmp = new TCHAR[(std::ifstream::pos_type)size + (std::ifstream::pos_type)1];
+ wchar_t *tmp = new wchar_t[(std::ifstream::pos_type)size + (std::ifstream::pos_type)1];
f.seekg(0, std::ios::beg);
f.read(tmp, size);
tmp[size] = '\0';
@@ -822,16 +822,16 @@ static JABBER_HANDLER_FUNC PrescenseHandler(IJabberInterface*, HXML node, void*)
for (int n = 0; n <= xmlGetChildCount(node); n++) {
LPCTSTR nodename = xmlGetName(local_node);
if (nodename) {
- if (_tcsstr(nodename, L"x")) {
+ if (wcsstr(nodename, L"x")) {
for (int i = 0; i < xmlGetAttrCount(local_node); i++) {
LPCTSTR name = xmlGetAttrName(local_node, i);
LPCTSTR value = xmlGetAttrValue(local_node, name);
- if (_tcsstr(value, L"jabber:x:signed")) {
+ if (wcsstr(value, L"jabber:x:signed")) {
std::wstring status_str;
HXML local_node2 = node;
for (int k = 0; k <= xmlGetChildCount(node); k++) {
LPCTSTR nodename2 = xmlGetName(local_node2);
- if (_tcsstr(nodename2, L"status")) {
+ if (wcsstr(nodename2, L"status")) {
LPCTSTR status = xmlGetText(local_node2);
if (status)
status_str = status;
@@ -844,7 +844,7 @@ static JABBER_HANDLER_FUNC PrescenseHandler(IJabberInterface*, HXML node, void*)
wstring file = toUTF16(get_random(10)), status_file = toUTF16(get_random(10));
sign += data;
sign += L"\n-----END PGP SIGNATURE-----\n";
- TCHAR *path_c = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
+ wchar_t *path_c = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
wstring path_out = path_c, status_file_out = path_c;
mir_free(path_c);
path_out += L"\\tmp\\";
@@ -961,7 +961,7 @@ bool isContactSecured(MCONTACT hContact)
return false;
}
if (!db_mc_isMeta(hContact)) {
- TCHAR *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L"");
+ wchar_t *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L"");
if (!key[0]) {
mir_free(key);
if (bDebugLog)
@@ -977,7 +977,7 @@ bool isContactSecured(MCONTACT hContact)
bool isContactHaveKey(MCONTACT hContact)
{
- TCHAR *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L"");
+ wchar_t *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", L"");
if (mir_tstrlen(key) > 0) {
mir_free(key);
return true;
@@ -988,7 +988,7 @@ bool isContactHaveKey(MCONTACT hContact)
bool isGPGKeyExist()
{
- TCHAR *id = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", L"");
+ wchar_t *id = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", L"");
char *key = UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", "");
if (id[0] && key[0]) {
mir_free(id);
@@ -1001,7 +1001,7 @@ bool isGPGKeyExist()
}
bool isGPGValid()
{
- TCHAR *tmp = NULL;
+ wchar_t *tmp = NULL;
bool gpg_exists = false, is_valid = true;
tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"");
boost::filesystem::path p(tmp);
@@ -1011,14 +1011,14 @@ bool isGPGValid()
else {
mir_free(tmp);
tmp = NULL;
- TCHAR *path = (TCHAR*)mir_alloc(sizeof(TCHAR)*MAX_PATH);
- TCHAR *mir_path = (TCHAR*)mir_alloc(MAX_PATH * sizeof(TCHAR));
+ wchar_t *path = (wchar_t*)mir_alloc(sizeof(wchar_t)*MAX_PATH);
+ wchar_t *mir_path = (wchar_t*)mir_alloc(MAX_PATH * sizeof(wchar_t));
PathToAbsoluteW(L"\\", mir_path);
SetCurrentDirectoryW(mir_path);
tmp = mir_tstrdup(mir_path);
mir_free(mir_path);
- //mir_realloc(path, (mir_tstrlen(path)+64)*sizeof(TCHAR));
- TCHAR *gpg_path = (TCHAR*)mir_alloc(sizeof(TCHAR)*MAX_PATH);
+ //mir_realloc(path, (mir_tstrlen(path)+64)*sizeof(wchar_t));
+ wchar_t *gpg_path = (wchar_t*)mir_alloc(sizeof(wchar_t)*MAX_PATH);
mir_tstrcpy(gpg_path, tmp);
mir_tstrcat(gpg_path, L"\\GnuPG\\gpg.exe");
mir_free(tmp);
@@ -1061,7 +1061,7 @@ bool isGPGValid()
{
wstring path_ = _wgetenv(L"APPDATA");
path_ += L"\\GnuPG";
- tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", (TCHAR*)path_.c_str());
+ tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", (wchar_t*)path_.c_str());
}
if(tmp)
mir_free(tmp); */
@@ -1248,7 +1248,7 @@ bool isTabsrmmUsed()
void ExportGpGKeysFunc(int type)
{
- TCHAR *p = GetFilePath(L"Choose file to export keys", L"*", L"Any file", true);
+ wchar_t *p = GetFilePath(L"Choose file to export keys", L"*", L"Any file", true);
if (!p || !p[0]) {
delete[] p;
//TODO: handle error
@@ -1412,7 +1412,7 @@ void ExportGpGKeysFunc(int type)
}
if (file.is_open())
file.close();
- TCHAR msg[512];
+ wchar_t msg[512];
if (type == 2)
mir_sntprintf(msg, TranslateT("We have successfully exported %d public keys and all private keys."), exported_keys);
else if (type == 1)
@@ -1430,7 +1430,7 @@ INT_PTR ExportGpGKeys(WPARAM, LPARAM)
INT_PTR ImportGpGKeys(WPARAM, LPARAM)
{
- TCHAR *p = GetFilePath(L"Choose file to import keys from", L"*", L"Any file");
+ wchar_t *p = GetFilePath(L"Choose file to import keys from", L"*", L"Any file");
if (!p || !p[0]) {
delete[] p;
//TODO: handle error
@@ -1612,7 +1612,7 @@ INT_PTR ImportGpGKeys(WPARAM, LPARAM)
if (found) {
wstring path;
std::vector<std::wstring> cmd;
- TCHAR *ptmp;
+ wchar_t *ptmp;
string output;
DWORD exitcode;
{
@@ -1716,13 +1716,13 @@ INT_PTR ImportGpGKeys(WPARAM, LPARAM)
}
if (strstr(line, "-----END PGP PRIVATE KEY BLOCK-----")) {
std::vector<wstring> cmd;
- TCHAR tmp2[MAX_PATH] = { 0 };
- TCHAR *ptmp;
+ wchar_t tmp2[MAX_PATH] = { 0 };
+ wchar_t *ptmp;
string output;
DWORD exitcode;
{
ptmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
- _tcsncpy(tmp2, ptmp, MAX_PATH - 1);
+ wcsncpy(tmp2, ptmp, MAX_PATH - 1);
mir_free(ptmp);
mir_tstrncat(tmp2, L"\\", _countof(tmp2) - mir_tstrlen(tmp2));
mir_tstrncat(tmp2, L"temporary_exported.asc", _countof(tmp2) - mir_tstrlen(tmp2));
@@ -1750,7 +1750,7 @@ INT_PTR ImportGpGKeys(WPARAM, LPARAM)
}
if (file.is_open())
file.close();
- TCHAR msg[512];
+ wchar_t msg[512];
if (processed_private_keys)
mir_sntprintf(msg, TranslateT("We have successfully processed %d public keys and some private keys."), processed_keys);
else
@@ -1896,8 +1896,8 @@ static INT_PTR CALLBACK DlgProcChangePasswd(HWND hwndDlg, UINT msg, WPARAM wPara
//TODO: show some prgress
{
std::string old_pass, new_pass;
- extern TCHAR key_id_global[17];
- TCHAR buf[256] = { 0 };
+ extern wchar_t key_id_global[17];
+ wchar_t buf[256] = { 0 };
GetDlgItemText(hwndDlg, IDC_NEW_PASSWD1, buf, _countof(buf));
new_pass = toUTF8(buf);
GetDlgItemText(hwndDlg, IDC_NEW_PASSWD2, buf, _countof(buf));
@@ -1909,7 +1909,7 @@ static INT_PTR CALLBACK DlgProcChangePasswd(HWND hwndDlg, UINT msg, WPARAM wPara
GetDlgItemText(hwndDlg, IDC_OLD_PASSWD, buf, _countof(buf));
old_pass = toUTF8(buf);
bool old_pass_match = false;
- TCHAR *pass = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", L"");
+ wchar_t *pass = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", L"");
if (!mir_tstrcmp(pass, buf))
old_pass_match = true;
mir_free(pass);
@@ -1968,7 +1968,7 @@ static INT_PTR CALLBACK DlgProcChangePasswd(HWND hwndDlg, UINT msg, WPARAM wPara
break;
case WM_DESTROY:
- extern TCHAR key_id_global[17];
+ extern wchar_t key_id_global[17];
key_id_global[0] = 0;
break;
}
@@ -1991,7 +1991,7 @@ void clean_temp_dir()
wstring path = toUTF16(mir_path);
SetCurrentDirectoryA(mir_path);
delete[] mir_path;
- TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
+ wchar_t *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
path += tmp;
mir_free(tmp);
path += L"\\tmp";
diff --git a/plugins/New_GPG/src/utilities.h b/plugins/New_GPG/src/utilities.h
index 2042864468..d677ff400d 100644
--- a/plugins/New_GPG/src/utilities.h
+++ b/plugins/New_GPG/src/utilities.h
@@ -16,11 +16,11 @@
#ifndef UTILITIES_H
#define UTILITIES_H
-TCHAR* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,const char* szSetting, TCHAR* szDef);
+wchar_t* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,const char* szSetting, wchar_t* szDef);
char* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,const char* szSetting, char* szDef);
-void GetFilePath(TCHAR *WindowTittle, char *szSetting, TCHAR *szExt, TCHAR *szExtDesc);
-TCHAR *GetFilePath(TCHAR *WindowTittle, TCHAR *szExt, TCHAR *szExtDesc, bool save_file = false);
-void GetFolderPath(TCHAR *WindowTittle, char *szSetting);
+void GetFilePath(wchar_t *WindowTittle, char *szSetting, wchar_t *szExt, wchar_t *szExtDesc);
+wchar_t *GetFilePath(wchar_t *WindowTittle, wchar_t *szExt, wchar_t *szExtDesc, bool save_file = false);
+void GetFolderPath(wchar_t *WindowTittle, char *szSetting);
void storeOutput(HANDLE ahandle, string *output);
@@ -29,7 +29,7 @@ void setClistIcon(MCONTACT);
void send_encrypted_msgs_thread(void*);
-int ComboBoxAddStringUtf(HWND hCombo, const TCHAR *szString, DWORD data);
+int ComboBoxAddStringUtf(HWND hCombo, const wchar_t *szString, DWORD data);
bool isContactSecured(MCONTACT hContact);
bool isContactHaveKey(MCONTACT hContact);
bool isTabsrmmUsed();
diff --git a/plugins/NewsAggregator/Src/Authentication.cpp b/plugins/NewsAggregator/Src/Authentication.cpp
index c2f23cc1f1..f72bee89fc 100644
--- a/plugins/NewsAggregator/Src/Authentication.cpp
+++ b/plugins/NewsAggregator/Src/Authentication.cpp
@@ -21,13 +21,13 @@ Boston, MA 02111-1307, USA.
void CreateAuthString(char *auth, MCONTACT hContact, HWND hwndDlg)
{
- TCHAR *tlogin = NULL, *tpass = NULL;
+ wchar_t *tlogin = NULL, *tpass = NULL;
if (hContact && db_get_b(hContact, MODULE, "UseAuth", 0)) {
tlogin = db_get_tsa(hContact, MODULE, "Login");
tpass = db_get_tsa(hContact, MODULE, "Password");
}
else if (hwndDlg && IsDlgButtonChecked(hwndDlg, IDC_USEAUTH)) {
- TCHAR buf[MAX_PATH] = {0};
+ wchar_t buf[MAX_PATH] = {0};
GetDlgItemText(hwndDlg, IDC_LOGIN, buf, _countof(buf));
tlogin = mir_tstrdup(buf);
GetDlgItemText(hwndDlg, IDC_PASSWORD, buf, _countof(buf));
@@ -55,7 +55,7 @@ INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)&SelItem);
if (SelItem.hwndList) {
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
if (GetDlgItemText(SelItem.hwndList, IDC_FEEDTITLE, str, _countof(str)))
SetDlgItemText(hwndDlg, IDC_FEEDNAME, str);
else {
@@ -64,13 +64,13 @@ INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
}
}
else if (SelItem.hContact) {
- TCHAR *ptszNick = db_get_tsa(SelItem.hContact, MODULE, "Nick");
+ wchar_t *ptszNick = db_get_tsa(SelItem.hContact, MODULE, "Nick");
if (ptszNick) {
SetDlgItemText(hwndDlg, IDC_FEEDNAME, ptszNick);
mir_free(ptszNick);
}
else {
- TCHAR *ptszURL = db_get_tsa(SelItem.hContact, MODULE, "URL");
+ wchar_t *ptszURL = db_get_tsa(SelItem.hContact, MODULE, "URL");
if (ptszURL) {
SetDlgItemText(hwndDlg, IDC_FEEDNAME, ptszURL);
mir_free(ptszURL);
@@ -85,7 +85,7 @@ INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
case IDOK:
{
ItemInfo &SelItem = *(ItemInfo*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- TCHAR username[MAX_PATH];
+ wchar_t username[MAX_PATH];
char passw[MAX_PATH];
if (!GetDlgItemText(hwndDlg, IDC_FEEDUSERNAME, username, _countof(username))) {
MessageBox(hwndDlg, TranslateT("Enter your username"), TranslateT("Error"), MB_OK | MB_ICONERROR);
diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp
index c9967ba341..4abe1c0395 100644
--- a/plugins/NewsAggregator/Src/CheckFeed.cpp
+++ b/plugins/NewsAggregator/Src/CheckFeed.cpp
@@ -19,13 +19,13 @@ Boston, MA 02111-1307, USA.
#include "stdafx.h"
-LPCTSTR CheckFeed(TCHAR *tszURL, HWND hwndDlg)
+LPCTSTR CheckFeed(wchar_t *tszURL, HWND hwndDlg)
{
Netlib_LogfT(hNetlibUser, L"Started validating feed %s.", tszURL);
char *szData = NULL;
GetNewsData(tszURL, &szData, NULL, hwndDlg);
if (szData) {
- TCHAR *tszData = mir_utf8decodeT(szData);
+ wchar_t *tszData = mir_utf8decodeT(szData);
if (!tszData)
tszData = mir_a2t(szData);
int bytesParsed = 0;
@@ -56,11 +56,11 @@ LPCTSTR CheckFeed(TCHAR *tszURL, HWND hwndDlg)
for (int j = 0; j < xmlGetChildCount(chan); j++) {
HXML child = xmlGetChild(chan, j);
if (!mir_tstrcmpi(xmlGetName(child), L"title")) {
- TCHAR mes[MAX_PATH];
+ wchar_t mes[MAX_PATH];
mir_sntprintf(mes, TranslateT("%s\nis a valid feed's address."), tszURL);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION);
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
return mir_tstrdup(buf);
}
@@ -73,11 +73,11 @@ LPCTSTR CheckFeed(TCHAR *tszURL, HWND hwndDlg)
for (int j = 0; j < xmlGetChildCount(node); j++) {
HXML child = xmlGetChild(node, j);
if (!mir_tstrcmpi(xmlGetName(child), L"title")) {
- TCHAR mes[MAX_PATH];
+ wchar_t mes[MAX_PATH];
mir_sntprintf(mes, TranslateT("%s\nis a valid feed's address."), tszURL);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION);
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
return mir_tstrdup(buf);
}
@@ -92,7 +92,7 @@ LPCTSTR CheckFeed(TCHAR *tszURL, HWND hwndDlg)
xmlDestroyNode(hXml);
}
Netlib_LogfT(hNetlibUser, L"%s is not a valid feed's address.", tszURL);
- TCHAR mes[MAX_PATH];
+ wchar_t mes[MAX_PATH];
mir_sntprintf(mes, TranslateT("%s\nis not a valid feed's address."), tszURL);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONERROR);
return NULL;
@@ -183,7 +183,7 @@ void CheckCurrentFeed(MCONTACT hContact)
if (!db_get_b(hContact, MODULE, "CheckState", 1) != 0)
return;
- TCHAR *szURL = db_get_tsa(hContact, MODULE, "URL");
+ wchar_t *szURL = db_get_tsa(hContact, MODULE, "URL");
if (szURL == NULL)
return;
@@ -194,7 +194,7 @@ void CheckCurrentFeed(MCONTACT hContact)
mir_free(szURL);
if (szData) {
- TCHAR *tszData = mir_utf8decodeT(szData);
+ wchar_t *tszData = mir_utf8decodeT(szData);
if (!tszData)
tszData = mir_a2t(szData);
int bytesParsed = 0;
@@ -228,7 +228,7 @@ void CheckCurrentFeed(MCONTACT hContact)
for (int i = 0; i < xmlGetAttrCount(node); i++) {
LPCTSTR szAttrName = xmlGetAttrName(node, i);
if (!mir_tstrcmpi(szAttrName, L"version")) {
- TCHAR ver[MAX_PATH];
+ wchar_t ver[MAX_PATH];
mir_sntprintf(ver, L"RSS %s", xmlGetAttrValue(node, szAttrName));
db_set_ts(hContact, MODULE, "MirVer", ver);
break;
@@ -245,7 +245,7 @@ void CheckCurrentFeed(MCONTACT hContact)
if (!mir_tstrcmpi(childName, L"title")) {
LPCTSTR szChildText = NULL;
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
}
@@ -257,7 +257,7 @@ void CheckCurrentFeed(MCONTACT hContact)
else if (!mir_tstrcmpi(childName, L"link")) {
LPCTSTR szChildText = NULL;
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
}
@@ -269,7 +269,7 @@ void CheckCurrentFeed(MCONTACT hContact)
else if (!mir_tstrcmpi(childName, L"description")) {
LPCTSTR szChildText = NULL;
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
}
@@ -284,7 +284,7 @@ void CheckCurrentFeed(MCONTACT hContact)
else if (!mir_tstrcmpi(childName, L"language")) {
LPCTSTR szChildText = NULL;
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
}
@@ -296,7 +296,7 @@ void CheckCurrentFeed(MCONTACT hContact)
else if (!mir_tstrcmpi(childName, L"managingEditor")) {
LPCTSTR szChildText = NULL;
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
}
@@ -308,7 +308,7 @@ void CheckCurrentFeed(MCONTACT hContact)
else if (!mir_tstrcmpi(childName, L"category")) {
LPCTSTR szChildText = NULL;
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
}
@@ -320,7 +320,7 @@ void CheckCurrentFeed(MCONTACT hContact)
else if (!mir_tstrcmpi(childName, L"copyright")) {
LPCTSTR szChildText = NULL;
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
}
@@ -339,9 +339,9 @@ void CheckCurrentFeed(MCONTACT hContact)
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
- TCHAR *szNick = db_get_tsa(hContact, MODULE, "Nick");
+ wchar_t *szNick = db_get_tsa(hContact, MODULE, "Nick");
if (szNick) {
- TCHAR *ext = _tcsrchr((TCHAR *)url, _T('.')) + 1;
+ wchar_t *ext = wcsrchr((wchar_t *)url, '.') + 1;
ai.format = ProtoGetAvatarFormat(url);
CMString filename = szNick;
@@ -362,7 +362,7 @@ void CheckCurrentFeed(MCONTACT hContact)
else if (!mir_tstrcmpi(childName, L"lastBuildDate")) {
LPCTSTR szChildText = NULL;
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(child)), -1, buf, _countof(buf));
szChildText = buf;
}
@@ -387,7 +387,7 @@ void CheckCurrentFeed(MCONTACT hContact)
LPCTSTR itemName = xmlGetName(itemval);
LPCTSTR value = NULL;
if (!mir_tstrcmpi(codepage, L"koi8-r")) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
MultiByteToWideChar(20866, 0, _T2A(xmlGetText(itemval)), -1, buf, _countof(buf));
value = buf;
}
@@ -483,10 +483,10 @@ void CheckCurrentFeed(MCONTACT hContact)
if (szNick) {
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
- TCHAR *ext = _tcsrchr((TCHAR *)url, _T('.')) + 1;
+ wchar_t *ext = wcsrchr((wchar_t *)url, '.') + 1;
ai.format = ProtoGetAvatarFormat(ext);
- TCHAR *filename = szNick;
+ wchar_t *filename = szNick;
mir_sntprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
@@ -501,7 +501,7 @@ void CheckCurrentFeed(MCONTACT hContact)
else if (!mir_tstrcmpi(szChildName, L"updated")) {
LPCTSTR szChildText = xmlGetText(child);
if (szChildText) {
- TCHAR *lastupdtime = (TCHAR *)szChildText;
+ wchar_t *lastupdtime = (wchar_t *)szChildText;
time_t stamp = DateToUnixTime(lastupdtime, 1);
double deltaupd = difftime(time(NULL), stamp);
double deltacheck = difftime(time(NULL), (time_t)db_get_dw(hContact, MODULE, "LastCheck", 0));
@@ -587,7 +587,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact)
if (!db_get_b(hContact, MODULE, "CheckState", 1))
return;
- TCHAR *szURL = db_get_tsa(hContact, MODULE, "URL");
+ wchar_t *szURL = db_get_tsa(hContact, MODULE, "URL");
if (szURL == NULL)
return;
@@ -598,7 +598,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact)
if (szData == NULL)
return;
- TCHAR *tszData = mir_utf8decodeT(szData);
+ wchar_t *tszData = mir_utf8decodeT(szData);
if (!tszData)
tszData = mir_a2t(szData);
int bytesParsed = 0;
@@ -626,12 +626,12 @@ void CheckCurrentFeedAvatar(MCONTACT hContact)
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
- TCHAR *szNick = db_get_tsa(hContact, MODULE, "Nick");
+ wchar_t *szNick = db_get_tsa(hContact, MODULE, "Nick");
if (szNick) {
- TCHAR *ext = _tcsrchr((TCHAR *)url, _T('.')) + 1;
+ wchar_t *ext = wcsrchr((wchar_t *)url, '.') + 1;
ai.format = ProtoGetAvatarFormat(ext);
- TCHAR *filename = szNick;
+ wchar_t *filename = szNick;
mir_sntprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
@@ -661,10 +661,10 @@ void CheckCurrentFeedAvatar(MCONTACT hContact)
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
- TCHAR *ext = _tcsrchr((TCHAR *)url, _T('.')) + 1;
+ wchar_t *ext = wcsrchr((wchar_t *)url, '.') + 1;
ai.format = ProtoGetAvatarFormat(ext);
- TCHAR *filename = szNick;
+ wchar_t *filename = szNick;
mir_sntprintf(ai.filename, L"%s\\%s.%s", tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
diff --git a/plugins/NewsAggregator/Src/ExportImport.cpp b/plugins/NewsAggregator/Src/ExportImport.cpp
index cbaac0f4b3..0943dcd303 100644
--- a/plugins/NewsAggregator/Src/ExportImport.cpp
+++ b/plugins/NewsAggregator/Src/ExportImport.cpp
@@ -40,7 +40,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
switch (LOWORD(wParam)) {
case IDOK:
{
- TCHAR FileName[MAX_PATH];
+ wchar_t FileName[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_IMPORTFILEPATH, FileName, _countof(FileName));
int bytesParsed = 0;
HXML hXml = xmlParseFile(FileName, &bytesParsed, NULL);
@@ -56,7 +56,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
while (node) {
int outlineAttr = xmlGetAttrCount(node);
int outlineChildsCount = xmlGetChildCount(node);
- TCHAR *xmlUrl = (TCHAR *)xmlGetAttrValue(node, L"xmlUrl");
+ wchar_t *xmlUrl = (wchar_t *)xmlGetAttrValue(node, L"xmlUrl");
if (!xmlUrl && !outlineChildsCount) {
HXML tmpnode = node;
node = xmlGetNextNode(node);
@@ -74,19 +74,19 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
else if (!xmlUrl && outlineChildsCount)
node = xmlGetFirstChild(node);
else if (xmlUrl) {
- TCHAR *text = NULL, *url = NULL, *siteurl = NULL, *group = NULL;
+ wchar_t *text = NULL, *url = NULL, *siteurl = NULL, *group = NULL;
BYTE NeedToImport = FALSE;
for (int i = 0; i < outlineAttr; i++) {
if (!mir_tstrcmpi(xmlGetAttrName(node, i), L"text")) {
text = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
if (!text) {
isTextUTF = 0;
- text = (TCHAR *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
+ text = (wchar_t *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
} else
isTextUTF = 1;
for (int j = 0; j < count; j++) {
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsImportList, LB_GETTEXT, (WPARAM)j, (LPARAM)item);
if (!mir_tstrcmpi(item, text)) {
NeedToImport = TRUE;
@@ -99,7 +99,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
url = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
if ( !url) {
isURLUTF = false;
- url = (TCHAR *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
+ url = (wchar_t *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
} else
isURLUTF = true;
if (GetContactByURL(url) && NeedToImport) {
@@ -112,7 +112,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
siteurl = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
if ( !siteurl) {
isSiteURLUTF = false;
- siteurl = (TCHAR *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
+ siteurl = (wchar_t *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
} else
isSiteURLUTF = true;
continue;
@@ -123,12 +123,12 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
if (NeedToImport) {
HXML parent = xmlGetParent(node);
- TCHAR tmpgroup[1024];
+ wchar_t tmpgroup[1024];
while (mir_tstrcmpi(xmlGetName(parent), L"body")) {
for (int i = 0; i < xmlGetAttrCount(parent); i++) {
if (!mir_tstrcmpi(xmlGetAttrName(parent, i), L"text")) {
if ( !group)
- group = (TCHAR *)xmlGetAttrValue(parent, xmlGetAttrName(parent, i));
+ group = (wchar_t *)xmlGetAttrValue(parent, xmlGetAttrName(parent, i));
else {
mir_sntprintf(tmpgroup, L"%s\\%s", xmlGetAttrValue(parent, xmlGetAttrName(parent, i)), group);
group = tmpgroup;
@@ -139,7 +139,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
parent = xmlGetParent(parent);
}
- TCHAR *ptszGroup = NULL;
+ wchar_t *ptszGroup = NULL;
if (group) {
ptszGroup = mir_utf8decodeT(_T2A(group));
if ( !ptszGroup) {
@@ -193,7 +193,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
DeleteAllItems(hwndList);
UpdateList(hwndList);
}
- TCHAR mes[MAX_PATH];
+ wchar_t mes[MAX_PATH];
if (DUPES)
mir_sntprintf(mes, TranslateT("Imported %d feed(s)\r\nNot imported %d duplicate(s)."), count - DUPES, DUPES);
else
@@ -208,12 +208,12 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
case IDC_BROWSEIMPORTFILE:
{
- TCHAR FileName[MAX_PATH];
+ wchar_t FileName[MAX_PATH];
VARST tszMirDir(L"%miranda_path%");
OPENFILENAME ofn = {0};
ofn.lStructSize = sizeof(ofn);
- TCHAR tmp[MAX_PATH];
+ wchar_t tmp[MAX_PATH];
mir_sntprintf(tmp, L"%s (*.opml, *.xml)%c*.opml;*.xml%c%c", TranslateT("OPML files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
@@ -236,7 +236,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
while (node) {
int outlineAttr = xmlGetAttrCount(node);
int outlineChildsCount = xmlGetChildCount(node);
- TCHAR *xmlUrl = (TCHAR *)xmlGetAttrValue(node, L"xmlUrl");
+ wchar_t *xmlUrl = (wchar_t *)xmlGetAttrValue(node, L"xmlUrl");
if (!xmlUrl && !outlineChildsCount) {
HXML tmpnode = node;
node = xmlGetNextNode(node);
@@ -256,11 +256,11 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
else if (xmlUrl) {
for (int i = 0; i < outlineAttr; i++) {
if (!mir_tstrcmpi(xmlGetAttrName(node, i), L"text")) {
- TCHAR *text = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
+ wchar_t *text = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
bool isTextUTF;
if (!text) {
isTextUTF = false;
- text = (TCHAR *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
+ text = (wchar_t *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
} else
isTextUTF = true;
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)text);
@@ -310,7 +310,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDOK)))
EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
int cursel = (int)SendMessage(FeedsList, LB_GETCURSEL, 0, 0);
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsList, LB_GETTEXT, (WPARAM)cursel, (LPARAM)item);
SendMessage(FeedsImportList, LB_ADDSTRING, 0, (LPARAM)item);
SendMessage(FeedsList, LB_DELETESTRING, (WPARAM)cursel, 0);
@@ -328,7 +328,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS)))
EnableWindow(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS), TRUE);
int cursel = (int)SendMessage(FeedsImportList, LB_GETCURSEL, 0, 0);
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsImportList, LB_GETTEXT, (WPARAM)cursel, (LPARAM)item);
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)item);
SendMessage(FeedsImportList, LB_DELETESTRING, (WPARAM)cursel, 0);
@@ -351,7 +351,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
int count = (int)SendMessage(FeedsList, LB_GETCOUNT, 0, 0);
for (int i = 0; i < count; i++) {
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsList, LB_GETTEXT, (WPARAM)i, (LPARAM)item);
SendMessage(FeedsImportList, LB_ADDSTRING, 0, (LPARAM)item);
}
@@ -370,7 +370,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
EnableWindow(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS), TRUE);
int count = (int)SendMessage(FeedsImportList, LB_GETCOUNT, 0, 0);
for (int i = 0; i < count; i++) {
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsImportList, LB_GETTEXT, (WPARAM)i, (LPARAM)item);
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)item);
}
@@ -393,7 +393,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDOK)))
EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
int cursel = (int)SendMessage(FeedsList, LB_GETCURSEL, 0, 0);
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsList, LB_GETTEXT, (WPARAM)cursel, (LPARAM)item);
SendMessage(FeedsImportList, LB_ADDSTRING, 0, (LPARAM)item);
SendMessage(FeedsList, LB_DELETESTRING, (WPARAM)cursel, 0);
@@ -414,7 +414,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS)))
EnableWindow(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS), TRUE);
int cursel = (int)SendMessage(FeedsImportList, LB_GETCURSEL, 0, 0);
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsImportList, LB_GETTEXT, (WPARAM)cursel, (LPARAM)item);
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)item);
SendMessage(FeedsImportList, LB_DELETESTRING, (WPARAM)cursel, 0);
@@ -452,7 +452,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
TranslateDialogDefault(hwndDlg);
Utils_RestoreWindowPositionNoSize(hwndDlg, NULL, MODULE, "ExportDlg");
for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
- TCHAR *message = db_get_tsa(hContact, MODULE, "Nick");
+ wchar_t *message = db_get_tsa(hContact, MODULE, "Nick");
if (message != NULL) {
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)message);
mir_free(message);
@@ -471,12 +471,12 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
switch (LOWORD(wParam)) {
case IDOK:
{
- TCHAR FileName[MAX_PATH];
+ wchar_t FileName[MAX_PATH];
VARST tszMirDir(L"%miranda_path%");
OPENFILENAME ofn = {0};
ofn.lStructSize = sizeof(ofn);
- TCHAR tmp[MAX_PATH];
+ wchar_t tmp[MAX_PATH];
mir_sntprintf(tmp, L"%s (*.opml)%c*.opml%c%c", TranslateT("OPML files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
@@ -497,10 +497,10 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
int count = (int)SendMessage(FeedsExportList, LB_GETCOUNT, 0, 0);
for (int i = 0; i < count; i++) {
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsExportList, LB_GETTEXT, (WPARAM)i, (LPARAM)item);
MCONTACT hContact = GetContactByNick(item);
- TCHAR
+ wchar_t
*title = db_get_tsa(hContact, MODULE, "Nick"),
*url = db_get_tsa(hContact, MODULE, "URL"),
*siteurl = db_get_tsa(hContact, MODULE, "Homepage"),
@@ -509,7 +509,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
HXML elem = header;
if (group)
{
- TCHAR *section = _tcstok(group, L"\\");
+ wchar_t *section = wcstok(group, L"\\");
while (section != NULL)
{
HXML existgroup = xmlGetChildByAttrValue(header, L"outline", L"title", section);
@@ -521,7 +521,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
} else {
elem = existgroup;
}
- section = _tcstok(NULL, L"\\");
+ section = wcstok(NULL, L"\\");
}
elem = xmlAddChild(elem, L"outline", NULL);
}
@@ -556,7 +556,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDOK)))
EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
int cursel = (int)SendMessage(FeedsList, LB_GETCURSEL, 0, 0);
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsList, LB_GETTEXT, (WPARAM)cursel, (LPARAM)item);
SendMessage(FeedsExportList, LB_ADDSTRING, 0, (LPARAM)item);
SendMessage(FeedsList, LB_DELETESTRING, (WPARAM)cursel, 0);
@@ -574,7 +574,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS)))
EnableWindow(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS), TRUE);
int cursel = (int)SendMessage(FeedsExportList, LB_GETCURSEL, 0, 0);
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsExportList, LB_GETTEXT, (WPARAM)cursel, (LPARAM)item);
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)item);
SendMessage(FeedsExportList, LB_DELETESTRING, (WPARAM)cursel, 0);
@@ -597,7 +597,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
int count = (int)SendMessage(FeedsList, LB_GETCOUNT, 0, 0);
for (int i = 0; i < count; i++) {
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsList, LB_GETTEXT, (WPARAM)i, (LPARAM)item);
SendMessage(FeedsExportList, LB_ADDSTRING, 0, (LPARAM)item);
}
@@ -616,7 +616,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
EnableWindow(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS), TRUE);
int count = (int)SendMessage(FeedsExportList, LB_GETCOUNT, 0, 0);
for (int i = 0; i < count; i++) {
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsExportList, LB_GETTEXT, (WPARAM)i, (LPARAM)item);
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)item);
}
@@ -639,7 +639,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDOK)))
EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE);
int cursel = (int)SendMessage(FeedsList, LB_GETCURSEL, 0, 0);
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsList, LB_GETTEXT, (WPARAM)cursel, (LPARAM)item);
SendMessage(FeedsExportList, LB_ADDSTRING, 0, (LPARAM)item);
SendMessage(FeedsList, LB_DELETESTRING, (WPARAM)cursel, 0);
@@ -660,7 +660,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS)))
EnableWindow(GetDlgItem(hwndDlg, IDC_ADDALLFEEDS), TRUE);
int cursel = (int)SendMessage(FeedsExportList, LB_GETCURSEL, 0, 0);
- TCHAR item[MAX_PATH];
+ wchar_t item[MAX_PATH];
SendMessage(FeedsExportList, LB_GETTEXT, (WPARAM)cursel, (LPARAM)item);
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)item);
SendMessage(FeedsExportList, LB_DELETESTRING, (WPARAM)cursel, 0);
diff --git a/plugins/NewsAggregator/Src/Menus.cpp b/plugins/NewsAggregator/Src/Menus.cpp
index 6733becea1..44aaf21532 100644
--- a/plugins/NewsAggregator/Src/Menus.cpp
+++ b/plugins/NewsAggregator/Src/Menus.cpp
@@ -25,43 +25,43 @@ void InitMenu()
{
CMenuItem mi;
mi.flags = CMIF_TCHAR | CMIF_NOTOFFLINE;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("News Aggregator"), 500099000);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("News Aggregator"), 500099000);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "D9733E4F-1946-4390-8EB3-591E8687222E");
SET_UID(mi, 0x3ec91864, 0xefa7, 0x4994, 0xb7, 0x75, 0x6c, 0x96, 0xcb, 0x29, 0x2f, 0x93);
mi.position = 10100001;
if (db_get_b(NULL, MODULE, "AutoUpdate", 1))
- mi.name.t = LPGENT("Auto Update Enabled");
+ mi.name.w = LPGENW("Auto Update Enabled");
else
- mi.name.t = LPGENT("Auto Update Disabled");
+ mi.name.w = LPGENW("Auto Update Disabled");
mi.hIcolibItem = GetIconHandle("main");
mi.pszService = MS_NEWSAGGREGATOR_ENABLED;
hService2[0] = Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0x8076bb4d, 0x1e44, 0x43af, 0x97, 0x1e, 0x31, 0xd8, 0xa4, 0xe9, 0xb8, 0x37);
mi.position = 20100001;
- mi.name.t = LPGENT("Check All Feeds");
+ mi.name.w = LPGENW("Check All Feeds");
mi.pszService = MS_NEWSAGGREGATOR_CHECKALLFEEDS;
hService2[1] = Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0xb876484d, 0x28aa, 0x4e03, 0x9e, 0x98, 0xed, 0xbc, 0xd1, 0xcf, 0x31, 0x80);
mi.position = 20100002;
mi.hIcolibItem = GetIconHandle("addfeed");
- mi.name.t = LPGENT("Add Feed");
+ mi.name.w = LPGENW("Add Feed");
mi.pszService = MS_NEWSAGGREGATOR_ADDFEED;
hService2[2] = Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0x600bf2c2, 0xa974, 0x44d3, 0x98, 0xf9, 0xe6, 0x65, 0x7c, 0x1f, 0x63, 0x37);
mi.position = 20100003;
mi.hIcolibItem = GetIconHandle("importfeeds");
- mi.name.t = LPGENT("Import Feeds");
+ mi.name.w = LPGENW("Import Feeds");
mi.pszService = MS_NEWSAGGREGATOR_IMPORTFEEDS;
hService2[3] = Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0xc09c8119, 0x64c2, 0x49bd, 0x81, 0xf, 0x54, 0x20, 0x69, 0xd7, 0x30, 0xcf);
mi.position = 20100004;
mi.hIcolibItem = GetIconHandle("exportfeeds");
- mi.name.t = LPGENT("Export Feeds");
+ mi.name.w = LPGENW("Export Feeds");
mi.pszService = MS_NEWSAGGREGATOR_EXPORTFEEDS;
hService2[4] = Menu_AddMainMenuItem(&mi);
@@ -70,12 +70,12 @@ void InitMenu()
mi.root = NULL;
mi.position = -0x7FFFFFFA;
mi.hIcolibItem = GetIconHandle("checkfeed");
- mi.name.t = LPGENT("Check feed");
+ mi.name.w = LPGENW("Check feed");
mi.pszService = MS_NEWSAGGREGATOR_CHECKFEED;
hService2[5] = Menu_AddContactMenuItem(&mi, MODULE);
SET_UID(mi, 0x41a70fbc, 0x9241, 0x44c0, 0x90, 0x90, 0x87, 0xd2, 0xc5, 0x9f, 0xc9, 0xac);
- mi.name.t = LPGENT("Change feed");
+ mi.name.w = LPGENW("Change feed");
mi.pszService = MS_NEWSAGGREGATOR_CHANGEFEED;
hService2[6] = Menu_AddContactMenuItem(&mi, MODULE);
diff --git a/plugins/NewsAggregator/Src/NewsAggregator.cpp b/plugins/NewsAggregator/Src/NewsAggregator.cpp
index ecfd2009ec..8d040fdcc0 100644
--- a/plugins/NewsAggregator/Src/NewsAggregator.cpp
+++ b/plugins/NewsAggregator/Src/NewsAggregator.cpp
@@ -25,7 +25,7 @@ int hLangpack;
HANDLE hPrebuildMenuHook = NULL;
HWND hAddFeedDlg;
MWindowList hChangeFeedDlgList = NULL;
-TCHAR tszRoot[MAX_PATH] = {0};
+wchar_t tszRoot[MAX_PATH] = {0};
HANDLE hUpdateMutex;
PLUGININFOEX pluginInfoEx = {
@@ -92,8 +92,8 @@ extern "C" __declspec(dllexport) int Load(void)
HOTKEYDESC hkd = { sizeof(hkd) };
hkd.dwFlags = HKD_TCHAR;
hkd.pszName = "NewsAggregator/CheckAllFeeds";
- hkd.ptszDescription = LPGENT("Check All Feeds");
- hkd.ptszSection = LPGENT("News Aggregator");
+ hkd.ptszDescription = LPGENW("Check All Feeds");
+ hkd.ptszSection = LPGENW("News Aggregator");
hkd.pszService = MS_NEWSAGGREGATOR_CHECKALLFEEDS;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL+HKCOMB_A, 'O') | HKF_MIRANDA_LOCAL;
Hotkey_Register(&hkd);
diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp
index 74fdfc6f71..e27cd761d9 100644
--- a/plugins/NewsAggregator/Src/Options.cpp
+++ b/plugins/NewsAggregator/Src/Options.cpp
@@ -37,7 +37,7 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
char passw[MAX_PATH];
{
if (!GetDlgItemText(hwndDlg, IDC_FEEDTITLE, str, _countof(str))) {
@@ -94,7 +94,7 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
break;
case IDC_TAGHELP:
- TCHAR tszTagHelp[1024];
+ wchar_t tszTagHelp[1024];
mir_sntprintf(tszTagHelp, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
L"#<title>#", TranslateT("The title of the item."),
L"#<description>#", TranslateT("The item synopsis."),
@@ -114,10 +114,10 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
case IDC_DISCOVERY:
EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), FALSE);
SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait..."));
- TCHAR tszURL[MAX_PATH] = { 0 };
- TCHAR *tszTitle = NULL;
+ wchar_t tszURL[MAX_PATH] = { 0 };
+ wchar_t *tszTitle = NULL;
if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_tstrcmp(tszURL, L"http://") != 0)
- tszTitle = (TCHAR*)CheckFeed(tszURL, hwndDlg);
+ tszTitle = (wchar_t*)CheckFeed(tszURL, hwndDlg);
else
MessageBox(hwndDlg, TranslateT("Enter Feed URL"), TranslateT("Error"), MB_OK);
SetDlgItemText(hwndDlg, IDC_FEEDTITLE, tszTitle);
@@ -167,7 +167,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SetDlgItemText(hwndDlg, IDC_FEEDTITLE, SelItem.nick);
SetDlgItemInt(hwndDlg, IDC_CHECKTIME, db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME), TRUE);
- TCHAR *szMsgFormat = db_get_tsa(hContact, MODULE, "MsgFormat");
+ wchar_t *szMsgFormat = db_get_tsa(hContact, MODULE, "MsgFormat");
if (szMsgFormat) {
SetDlgItemText(hwndDlg, IDC_TAGSEDIT, szMsgFormat);
mir_free(szMsgFormat);
@@ -177,7 +177,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
EnableWindow(GetDlgItem(hwndDlg, IDC_LOGIN), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_PASSWORD), TRUE);
- TCHAR *szLogin = db_get_tsa(hContact, MODULE, "Login");
+ wchar_t *szLogin = db_get_tsa(hContact, MODULE, "Login");
if (szLogin) {
SetDlgItemText(hwndDlg, IDC_LOGIN, szLogin);
mir_free(szLogin);
@@ -195,7 +195,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
{
ItemInfo *SelItem = (ItemInfo*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
char passw[MAX_PATH];
@@ -254,7 +254,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
break;
case IDC_TAGHELP:
- TCHAR tszTagHelp[1024];
+ wchar_t tszTagHelp[1024];
mir_sntprintf(tszTagHelp, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
L"#<title>#", TranslateT("The title of the item."),
L"#<description>#", TranslateT("The item synopsis."),
@@ -272,11 +272,11 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
break;
case IDC_DISCOVERY:
- TCHAR tszURL[MAX_PATH] = { 0 };
+ wchar_t tszURL[MAX_PATH] = { 0 };
if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_tstrcmp(tszURL, L"http://") != 0) {
EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), FALSE);
SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait..."));
- TCHAR *tszTitle = (TCHAR*)CheckFeed(tszURL, hwndDlg);
+ wchar_t *tszTitle = (wchar_t*)CheckFeed(tszURL, hwndDlg);
SetDlgItemText(hwndDlg, IDC_FEEDTITLE, tszTitle);
mir_free(tszTitle);
EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), TRUE);
@@ -314,13 +314,13 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP
WindowList_Add(hChangeFeedDlgList, hwndDlg, hContact);
Utils_RestoreWindowPositionNoSize(hwndDlg, hContact, MODULE, "ChangeDlg");
- TCHAR *ptszNick = db_get_tsa(hContact, MODULE, "Nick");
+ wchar_t *ptszNick = db_get_tsa(hContact, MODULE, "Nick");
if (ptszNick) {
SetDlgItemText(hwndDlg, IDC_FEEDTITLE, ptszNick);
mir_free(ptszNick);
}
- TCHAR *ptszURL = db_get_tsa(hContact, MODULE, "URL");
+ wchar_t *ptszURL = db_get_tsa(hContact, MODULE, "URL");
if (ptszNick) {
SetDlgItemText(hwndDlg, IDC_FEEDURL, ptszURL);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
@@ -329,7 +329,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SetDlgItemInt(hwndDlg, IDC_CHECKTIME, db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME), TRUE);
- TCHAR *ptszMsgFormat = db_get_tsa(hContact, MODULE, "MsgFormat");
+ wchar_t *ptszMsgFormat = db_get_tsa(hContact, MODULE, "MsgFormat");
if (ptszMsgFormat) {
SetDlgItemText(hwndDlg, IDC_TAGSEDIT, ptszMsgFormat);
mir_free(ptszMsgFormat);
@@ -339,7 +339,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP
CheckDlgButton(hwndDlg, IDC_USEAUTH, BST_CHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_LOGIN), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_PASSWORD), TRUE);
- TCHAR *ptszLogin = db_get_tsa(hContact, MODULE, "Login");
+ wchar_t *ptszLogin = db_get_tsa(hContact, MODULE, "Login");
if (ptszLogin) {
SetDlgItemText(hwndDlg, IDC_LOGIN, ptszLogin);
mir_free(ptszLogin);
@@ -353,7 +353,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
{
MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
char passw[MAX_PATH];
@@ -410,7 +410,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP
break;
case IDC_TAGHELP:
- TCHAR tszTagHelp[1024];
+ wchar_t tszTagHelp[1024];
mir_sntprintf(tszTagHelp, L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
L"#<title>#", TranslateT("The title of the item."),
L"#<description>#", TranslateT("The item synopsis."),
@@ -428,11 +428,11 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP
break;
case IDC_DISCOVERY:
- TCHAR tszURL[MAX_PATH] = { 0 };
+ wchar_t tszURL[MAX_PATH] = { 0 };
if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_tstrcmp(tszURL, L"http://") != 0) {
EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), FALSE);
SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait..."));
- TCHAR *tszTitle = (TCHAR*)CheckFeed(tszURL, hwndDlg);
+ wchar_t *tszTitle = (wchar_t*)CheckFeed(tszURL, hwndDlg);
SetDlgItemText(hwndDlg, IDC_FEEDTITLE, tszTitle);
mir_free(tszTitle);
EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), TRUE);
@@ -492,7 +492,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
case IDC_REMOVE:
if (MessageBox(hwndDlg, TranslateT("Are you sure?"), TranslateT("Contact deleting"), MB_YESNO | MB_ICONWARNING) == IDYES) {
- TCHAR nick[MAX_PATH], url[MAX_PATH];
+ wchar_t nick[MAX_PATH], url[MAX_PATH];
sel = ListView_GetSelectionMark(hwndList);
ListView_GetItemText(hwndList, sel, 0, nick, _countof(nick));
ListView_GetItemText(hwndList, sel, 1, url, _countof(url));
diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp
index bc2d5dabe6..d3cdfb6839 100644
--- a/plugins/NewsAggregator/Src/Services.cpp
+++ b/plugins/NewsAggregator/Src/Services.cpp
@@ -37,10 +37,10 @@ int OnFoldersChanged(WPARAM, LPARAM)
int NewsAggrInit(WPARAM, LPARAM)
{
- if (hNewsAggregatorFolder = FoldersRegisterCustomPathT(LPGEN("Avatars"), LPGEN("News Aggregator"), MIRANDA_USERDATAT L"\\Avatars\\" DEFAULT_AVATARS_FOLDER))
+ if (hNewsAggregatorFolder = FoldersRegisterCustomPathT(LPGEN("Avatars"), LPGEN("News Aggregator"), MIRANDA_USERDATAT L"\\Avatars\\" _A2W(DEFAULT_AVATARS_FOLDER)))
FoldersGetCustomPathT(hNewsAggregatorFolder, tszRoot, MAX_PATH, L"");
else
- mir_tstrncpy(tszRoot, VARST(L"%miranda_userdata%\\Avatars\\" DEFAULT_AVATARS_FOLDER), _countof(tszRoot));
+ mir_tstrncpy(tszRoot, VARST(L"%miranda_userdata%\\Avatars\\" _A2W(DEFAULT_AVATARS_FOLDER)), _countof(tszRoot));
for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
if (!db_get_b(NULL, MODULE, "StartupRetrieve", 1))
@@ -211,7 +211,7 @@ INT_PTR NewsAggrGetAvatarInfo(WPARAM wParam, LPARAM lParam)
if (db_get_b(NULL, MODULE, "AutoUpdate", 1) != 0 && !ThreadRunning)
mir_forkthread(UpdateThreadProc, (void *)TRUE);
- TCHAR *ptszImageURL = db_get_tsa(pai->hContact, MODULE, "ImageURL");
+ wchar_t *ptszImageURL = db_get_tsa(pai->hContact, MODULE, "ImageURL");
if(ptszImageURL == NULL)
return GAIR_NOAVATAR;
@@ -228,9 +228,9 @@ INT_PTR NewsAggrRecvMessage(WPARAM, LPARAM lParam)
void UpdateMenu(bool State)
{
if (!State) // to enable auto-update
- Menu_ModifyItem(hService2[0], LPGENT("Auto Update Enabled"), GetIconHandle("enabled"));
+ Menu_ModifyItem(hService2[0], LPGENW("Auto Update Enabled"), GetIconHandle("enabled"));
else // to disable auto-update
- Menu_ModifyItem(hService2[0], LPGENT("Auto Update Disabled"), GetIconHandle("disabled"));
+ Menu_ModifyItem(hService2[0], LPGENW("Auto Update Disabled"), GetIconHandle("disabled"));
CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTBButton, State ? TTBST_PUSHED : 0);
db_set_b(NULL, MODULE, "AutoUpdate", !State);
diff --git a/plugins/NewsAggregator/Src/Utils.cpp b/plugins/NewsAggregator/Src/Utils.cpp
index d79697cbc4..6a7558ba34 100644
--- a/plugins/NewsAggregator/Src/Utils.cpp
+++ b/plugins/NewsAggregator/Src/Utils.cpp
@@ -43,7 +43,7 @@ void NetlibUnInit()
hNetlibUser = NULL;
}
-void GetNewsData(TCHAR *tszUrl, char **szData, MCONTACT hContact, HWND hwndDlg)
+void GetNewsData(wchar_t *tszUrl, char **szData, MCONTACT hContact, HWND hwndDlg)
{
Netlib_LogfT(hNetlibUser, L"Getting feed data %s.", tszUrl);
NETLIBHTTPREQUEST nlhr = { 0 };
@@ -52,7 +52,7 @@ void GetNewsData(TCHAR *tszUrl, char **szData, MCONTACT hContact, HWND hwndDlg)
nlhr.cbSize = sizeof(nlhr);
nlhr.requestType = REQUEST_GET;
nlhr.flags = NLHRF_DUMPASTEXT | NLHRF_HTTP11 | NLHRF_REDIRECT;
- if (_tcsstr(tszUrl, L"https://") != NULL)
+ if (wcsstr(tszUrl, L"https://") != NULL)
nlhr.flags |= NLHRF_SSL;
char *szUrl = mir_t2a(tszUrl);
nlhr.szUrl = szUrl;
@@ -142,14 +142,14 @@ void UpdateList(HWND hwndList)
UpdateListFlag = TRUE;
lvI.mask = LVIF_TEXT;
lvI.iSubItem = 0;
- TCHAR *ptszNick = db_get_tsa(hContact, MODULE, "Nick");
+ wchar_t *ptszNick = db_get_tsa(hContact, MODULE, "Nick");
if (ptszNick) {
lvI.pszText = ptszNick;
lvI.iItem = i;
ListView_InsertItem(hwndList, &lvI);
lvI.iSubItem = 1;
- TCHAR *ptszURL = db_get_tsa(hContact, MODULE, "URL");
+ wchar_t *ptszURL = db_get_tsa(hContact, MODULE, "URL");
if (ptszURL) {
lvI.pszText = ptszURL;
ListView_SetItem(hwndList, &lvI);
@@ -168,35 +168,35 @@ void DeleteAllItems(HWND hwndList)
ListView_DeleteAllItems(hwndList);
}
-time_t __stdcall DateToUnixTime(const TCHAR *stamp, bool FeedType)
+time_t __stdcall DateToUnixTime(const wchar_t *stamp, bool FeedType)
{
struct tm timestamp;
- TCHAR date[9];
+ wchar_t date[9];
int i, y;
time_t t;
if (stamp == NULL)
return 0;
- TCHAR *p = NEWTSTR_ALLOCA(stamp);
+ wchar_t *p = NEWWSTR_ALLOCA(stamp);
if (FeedType) {
// skip '-' chars
int si = 0, sj = 0;
while (true) {
- if (p[si] == _T('-'))
+ if (p[si] == '-')
si++;
else if (!(p[sj++] = p[si++]))
break;
}
}
else {
- TCHAR *weekday, monthstr[4], timezonesign[2];
+ wchar_t *weekday, monthstr[4], timezonesign[2];
int day, month = 0, year, hour, min, sec, timezoneh, timezonem;
- if (_tcsstr(p, L",")) {
- weekday = _tcstok(p, L",");
- p = _tcstok(NULL, L",");
- _stscanf(p + 1, L"%d %3s %d %d:%d:%d %1s%02d%02d", &day, &monthstr, &year, &hour, &min, &sec, &timezonesign, &timezoneh, &timezonem);
+ if (wcsstr(p, L",")) {
+ weekday = wcstok(p, L",");
+ p = wcstok(NULL, L",");
+ swscanf(p + 1, L"%d %3s %d %d:%d:%d %1s%02d%02d", &day, &monthstr, &year, &hour, &min, &sec, &timezonesign, &timezoneh, &timezonem);
if (!mir_tstrcmpi(monthstr, L"Jan"))
month = 1;
if (!mir_tstrcmpi(monthstr, L"Feb"))
@@ -230,13 +230,13 @@ time_t __stdcall DateToUnixTime(const TCHAR *stamp, bool FeedType)
else
mir_sntprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour, min, sec);
}
- else if (_tcsstr(p, L"T")) {
- _stscanf(p, L"%d-%d-%dT%d:%d:%d", &year, &month, &day, &hour, &min, &sec);
+ else if (wcsstr(p, L"T")) {
+ swscanf(p, L"%d-%d-%dT%d:%d:%d", &year, &month, &day, &hour, &min, &sec);
mir_sntprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour, min, sec);
}
else
{
- _stscanf(p, L"%d-%d-%d %d:%d:%d %1s%02d%02d", &year, &month, &day, &hour, &min, &sec, &timezonesign, &timezoneh, &timezonem);
+ swscanf(p, L"%d-%d-%d %d:%d:%d %1s%02d%02d", &year, &month, &day, &hour, &min, &sec, &timezonesign, &timezoneh, &timezonem);
if (!mir_tstrcmp(timezonesign, L"+"))
mir_sntprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour - timezoneh, min - timezonem, sec);
else if (!mir_tstrcmp(timezonesign, L"-"))
@@ -273,7 +273,7 @@ time_t __stdcall DateToUnixTime(const TCHAR *stamp, bool FeedType)
for (; *p != '\0' && !isdigit(*p); p++);
// Parse time
- if (_stscanf(p, L"%d:%d:%d", &timestamp.tm_hour, &timestamp.tm_min, &timestamp.tm_sec) != 3)
+ if (swscanf(p, L"%d:%d:%d", &timestamp.tm_hour, &timestamp.tm_min, &timestamp.tm_sec) != 3)
return 0;
timestamp.tm_isdst = 0; // DST is already present in _timezone below
@@ -320,16 +320,16 @@ bool DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal)
}
}
if (date != NULL && size != NULL) {
- TCHAR *tdate = mir_a2t(date);
- TCHAR *tsize = mir_a2t(size);
+ wchar_t *tdate = mir_a2t(date);
+ wchar_t *tsize = mir_a2t(size);
struct _stat buf;
- int fh = _topen(tszLocal, _O_RDONLY);
+ int fh = _wopen(tszLocal, _O_RDONLY);
if (fh != -1) {
_fstat(fh, &buf);
time_t modtime = DateToUnixTime(tdate, 0);
time_t filemodtime = mktime(localtime(&buf.st_atime));
- if (modtime > filemodtime && buf.st_size != _ttoi(tsize)) {
+ if (modtime > filemodtime && buf.st_size != _wtoi(tsize)) {
DWORD dwBytes;
HANDLE hFile = CreateFile(tszLocal, GENERIC_READ | GENERIC_WRITE, NULL, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
WriteFile(hFile, pReply->pData, (DWORD)pReply->dataLength, &dwBytes, NULL);
@@ -451,7 +451,7 @@ HRESULT TestDocumentText(IHTMLDocument3 *pHtmlDoc, BSTR &message)
return hr;
}
-LPCTSTR ClearText(CMString &result, const TCHAR *message)
+LPCTSTR ClearText(CMString &result, const wchar_t *message)
{
BSTR bstrHtml = SysAllocString(message), bstrRes = SysAllocString(L"");
HRESULT hr = TestMarkupServices(bstrHtml, &TestDocumentText, bstrRes);
@@ -465,7 +465,7 @@ LPCTSTR ClearText(CMString &result, const TCHAR *message)
return result;
}
-MCONTACT GetContactByNick(const TCHAR *nick)
+MCONTACT GetContactByNick(const wchar_t *nick)
{
MCONTACT hContact = NULL;
@@ -477,7 +477,7 @@ MCONTACT GetContactByNick(const TCHAR *nick)
return hContact;
}
-MCONTACT GetContactByURL(const TCHAR *url)
+MCONTACT GetContactByURL(const wchar_t *url)
{
MCONTACT hContact = NULL;
diff --git a/plugins/NewsAggregator/Src/stdafx.h b/plugins/NewsAggregator/Src/stdafx.h
index b4787929cb..6640bcb4ca 100644
--- a/plugins/NewsAggregator/Src/stdafx.h
+++ b/plugins/NewsAggregator/Src/stdafx.h
@@ -62,14 +62,14 @@ extern UINT_PTR timerId;
// check if Feeds is currently updating
extern bool ThreadRunning;
extern bool UpdateListFlag;
-extern TCHAR tszRoot[MAX_PATH];
+extern wchar_t tszRoot[MAX_PATH];
struct ItemInfo
{
HWND hwndList;
MCONTACT hContact;
int SelNumber;
- TCHAR nick[MAX_PATH];
- TCHAR url[MAX_PATH];
+ wchar_t nick[MAX_PATH];
+ wchar_t url[MAX_PATH];
};
//============ STRUCT USED TO MAKE AN UPDATE LIST ============
@@ -125,24 +125,24 @@ void CALLBACK timerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime
void CALLBACK timerProc2(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
bool IsMyContact(MCONTACT hContact);
-void GetNewsData(TCHAR *szUrl, char **szData, MCONTACT hContact, HWND hwndDlg);
+void GetNewsData(wchar_t *szUrl, char **szData, MCONTACT hContact, HWND hwndDlg);
void CreateList(HWND hwndList);
void UpdateList(HWND hwndList);
void DeleteAllItems(HWND hwndList);
-time_t __stdcall DateToUnixTime(const TCHAR *stamp, bool FeedType);
+time_t __stdcall DateToUnixTime(const wchar_t *stamp, bool FeedType);
void CheckCurrentFeed(MCONTACT hContact);
void CheckCurrentFeedAvatar(MCONTACT hContact);
-LPCTSTR CheckFeed(TCHAR* tszURL, HWND hwndDlg);
+LPCTSTR CheckFeed(wchar_t* tszURL, HWND hwndDlg);
void UpdateMenu(bool State);
int ImportFeedsDialog();
-LPCTSTR ClearText(CMString &value, const TCHAR *message);
+LPCTSTR ClearText(CMString &value, const wchar_t *message);
bool DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal);
void CreateAuthString(char *auth, MCONTACT hContact, HWND hwndDlg);
INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-MCONTACT GetContactByNick(const TCHAR *nick);
-MCONTACT GetContactByURL(const TCHAR *url);
+MCONTACT GetContactByNick(const wchar_t *nick);
+MCONTACT GetContactByURL(const wchar_t *url);
// =============== NewsAggregator SERVICES ================
// Check all Feeds info
diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp
index 038a5cec5c..20afcf6e2e 100644
--- a/plugins/NoHistory/src/dllmain.cpp
+++ b/plugins/NoHistory/src/dllmain.cpp
@@ -150,9 +150,9 @@ int PrebuildContactMenu(WPARAM hContact, LPARAM)
Menu_ShowItem(hMenuToggle, false);
else {
if (remove)
- Menu_ModifyItem(hMenuToggle, LPGENT("Enable History"), hIconKeep);
+ Menu_ModifyItem(hMenuToggle, LPGENW("Enable History"), hIconKeep);
else
- Menu_ModifyItem(hMenuToggle, LPGENT("Disable History"), hIconRemove);
+ Menu_ModifyItem(hMenuToggle, LPGENW("Disable History"), hIconRemove);
}
Menu_ShowItem(hMenuClear, !chat_room && db_event_count(hContact) > 0);
@@ -250,14 +250,14 @@ int ModulesLoaded(WPARAM, LPARAM)
SET_UID(mi, 0xede12697, 0x3e9d, 0x47ca, 0x83, 0xe0, 0xc1, 0x40, 0x69, 0xbf, 0x2d, 0xab);
mi.position = -300010;
- mi.name.t = LPGENT("Disable History");
+ mi.name.w = LPGENW("Disable History");
mi.pszService = MS_NOHISTORY_TOGGLE;
mi.hIcolibItem = hIconRemove;
hMenuToggle = Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x1c4b1c21, 0xc0d1, 0x44d1, 0xb5, 0x3c, 0xc7, 0x8d, 0xcf, 0x96, 0x51, 0xd7);
mi.position = -300005;
- mi.name.t = LPGENT("Clear History");
+ mi.name.w = LPGENW("Clear History");
mi.pszService = MS_NOHISTORY_CLEAR;
mi.hIcolibItem = hIconClear;
hMenuClear = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/NoHistory/src/options.cpp b/plugins/NoHistory/src/options.cpp
index b680e150ae..11f2d04a00 100644
--- a/plugins/NoHistory/src/options.cpp
+++ b/plugins/NoHistory/src/options.cpp
@@ -223,9 +223,9 @@ int OptInit(WPARAM wParam, LPARAM)
odp.position = -790000000;
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT);
- odp.ptszTitle = LPGENT("No History");
- odp.ptszGroup = LPGENT("History");
- odp.ptszTab = LPGENT("Logging");
+ odp.pwszTitle = LPGENW("No History");
+ odp.pwszGroup = LPGENW("History");
+ odp.pwszTab = LPGENW("Logging");
odp.pfnDlgProc = DlgProcOpts;
Options_AddPage(wParam, &odp);
return 0;
diff --git a/plugins/Non-IM Contact/src/contactinfo.cpp b/plugins/Non-IM Contact/src/contactinfo.cpp
index 7e4e27a535..07bd984377 100644
--- a/plugins/Non-IM Contact/src/contactinfo.cpp
+++ b/plugins/Non-IM Contact/src/contactinfo.cpp
@@ -131,7 +131,7 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
}
/* group*/
- TCHAR *szGroup;
+ wchar_t *szGroup;
for (int i = 1; (szGroup = Clist_GroupGetName(i, NULL)) != NULL; i++)
SendDlgItemMessage(hwnd, IDC_GROUP, CB_INSERTSTRING, 0, LPARAM(szGroup));
@@ -154,8 +154,8 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
if (db_get_w(hContact, MODNAME, "Timer", 15)) {
CheckDlgButton(hwnd, CHK_USE_TIMER, BST_CHECKED);
EnableWindow(GetDlgItem(hwnd, IDC_TIMER), 1);
- TCHAR string[512];
- SetDlgItemText(hwnd, IDC_TIMER, _itot(db_get_w(hContact, MODNAME, "Timer", 15), string, 10));
+ wchar_t string[512];
+ SetDlgItemText(hwnd, IDC_TIMER, _itow(db_get_w(hContact, MODNAME, "Timer", 15), string, 10));
if (!db_get_w(NULL, MODNAME, "Timer", 1))
SetDlgItemText(hwnd, IDC_TIMER_INTERVAL_MSG, TranslateT("Non-IM Contact protocol timer is Disabled"));
else {
@@ -234,7 +234,7 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
else db_unset(hContact, MODNAME, "ProgramParamsString");
if (GetWindowTextLength(GetDlgItem(hwnd, IDC_GROUP))) {
- TCHAR text[512];
+ wchar_t text[512];
GetDlgItemText(hwnd, IDC_GROUP, text, _countof(text));
Clist_GroupCreate(NULL, text);
db_set_ts(hContact, "CList", "Group", text);
@@ -253,9 +253,9 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
if (IsDlgButtonChecked(hwnd, CHK_USE_TIMER)) {
if (GetWindowTextLength(GetDlgItem(hwnd, IDC_TIMER))) {
- TCHAR text[512];
+ wchar_t text[512];
GetDlgItemText(hwnd, IDC_TIMER, text, _countof(text));
- db_set_w(hContact, MODNAME, "Timer", (WORD)_ttoi(text));
+ db_set_w(hContact, MODNAME, "Timer", (WORD)_wtoi(text));
}
else db_set_w(hContact, MODNAME, "Timer", 15);
}
diff --git a/plugins/Non-IM Contact/src/dialog.cpp b/plugins/Non-IM Contact/src/dialog.cpp
index 48f4dd5b43..243bc3b761 100644
--- a/plugins/Non-IM Contact/src/dialog.cpp
+++ b/plugins/Non-IM Contact/src/dialog.cpp
@@ -17,7 +17,7 @@ filename(0) <- will display the filename of the 0th file\r\nfile(0)wholeline(
INT_PTR CALLBACK DlgProcNimcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TCHAR tmp[5];
+ wchar_t tmp[5];
switch (msg) {
case WM_INITDIALOG:
@@ -25,7 +25,7 @@ INT_PTR CALLBACK DlgProcNimcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
CheckDlgButton(hwnd, IDC_AWAYISNOTONLINE, db_get_b(NULL, MODNAME, "AwayAsStatus", 0) ? BST_CHECKED : BST_UNCHECKED);
if (db_get_w(NULL, MODNAME, "Timer", 1)) {
EnableWindow(GetDlgItem(hwnd, IDC_TIMER_INT), 1);
- SetDlgItemText(hwnd, IDC_TIMER_INT, _itot(db_get_w(NULL, MODNAME, "Timer", 1), tmp, 10));
+ SetDlgItemText(hwnd, IDC_TIMER_INT, _itow(db_get_w(NULL, MODNAME, "Timer", 1), tmp, 10));
EnableWindow(GetDlgItem(hwnd, IDC_TIMER_TEXT), 1);
}
else {
@@ -61,7 +61,7 @@ INT_PTR CALLBACK DlgProcNimcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
db_set_b(NULL, MODNAME, "AwayAsStatus", (BYTE)IsDlgButtonChecked(hwnd, IDC_AWAYISNOTONLINE));
if (BST_UNCHECKED == IsDlgButtonChecked(hwnd, IDC_DISABLETIMER) && GetWindowTextLength(GetDlgItem(hwnd, IDC_TIMER_INT))) {
GetDlgItemText(hwnd, IDC_TIMER_INT, tmp, _countof(tmp));
- db_set_w(NULL, MODNAME, "Timer", (WORD)_ttoi(tmp));
+ db_set_w(NULL, MODNAME, "Timer", (WORD)_wtoi(tmp));
}
else db_set_w(NULL, MODNAME, "Timer", 0);
return TRUE;
diff --git a/plugins/Non-IM Contact/src/files.cpp b/plugins/Non-IM Contact/src/files.cpp
index aa5302f74b..d1596e2c50 100644
--- a/plugins/Non-IM Contact/src/files.cpp
+++ b/plugins/Non-IM Contact/src/files.cpp
@@ -293,9 +293,9 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
char string[1000];
mir_snprintf(fn, "fn%d", i);
if (GetWindowTextLength(GetDlgItem(hwnd, IDC_WWW_TIMER))) {
- TCHAR text[5];
+ wchar_t text[5];
GetDlgItemText(hwnd, IDC_WWW_TIMER, text, _countof(text));
- timer = _ttoi(text);
+ timer = _wtoi(text);
}
else timer = 60;
diff --git a/plugins/Non-IM Contact/src/main.cpp b/plugins/Non-IM Contact/src/main.cpp
index 87a0194420..24d05d97c3 100644
--- a/plugins/Non-IM Contact/src/main.cpp
+++ b/plugins/Non-IM Contact/src/main.cpp
@@ -144,7 +144,7 @@ extern "C" __declspec(dllexport) int Load()
CreateServiceFunction("NIM_Contact/DoubleClick", doubleClick);
CMenuItem mi;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("&Non-IM Contact"), 600090000);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("&Non-IM Contact"), 600090000);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "D7CE61C5-1178-41BA-B2ED-5A711BB21AE9");
SET_UID(mi, 0x73c11266, 0x153c, 0x4da4, 0x9b, 0x82, 0x5c, 0xce, 0xca, 0x86, 0xd, 0x41);
diff --git a/plugins/NotesAndReminders/src/globals.h b/plugins/NotesAndReminders/src/globals.h
index ce75e5cbd7..b918255061 100644
--- a/plugins/NotesAndReminders/src/globals.h
+++ b/plugins/NotesAndReminders/src/globals.h
@@ -122,7 +122,7 @@ extern int g_Transparency;
extern char *g_RemindSMS;
-extern TCHAR *g_lpszAltBrowser;
+extern char *g_lpszAltBrowser;
extern int g_reminderListGeom[4];
extern int g_reminderListColGeom[2];
diff --git a/plugins/NotesAndReminders/src/hotkeys.cpp b/plugins/NotesAndReminders/src/hotkeys.cpp
index 052e8d4dfd..2e96dd1608 100644
--- a/plugins/NotesAndReminders/src/hotkeys.cpp
+++ b/plugins/NotesAndReminders/src/hotkeys.cpp
@@ -15,32 +15,32 @@ void RegisterKeyBindings()
memset(&desc, 0, sizeof(desc));
desc.cbSize = sizeof(desc);
- desc.ptszSection = _T(SECTIONNAME);
+ desc.ptszSection = _A2W(SECTIONNAME);
desc.dwFlags = HKD_TCHAR;
desc.pszName = MODULENAME"/NewNote";
- desc.ptszDescription = LPGENT("New Note");
+ desc.ptszDescription = LPGENW("New Note");
desc.lParam = KB_NEW_NOTE;
desc.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, VK_INSERT);
desc.pszService = MODULENAME"/MenuCommandAddNew";
Hotkey_Register(&desc);
desc.pszName = MODULENAME"/ToggleNotesVis";
- desc.ptszDescription = LPGENT("Toggle Notes Visibility");
+ desc.ptszDescription = LPGENW("Toggle Notes Visibility");
desc.lParam = KB_TOGGLE_NOTES;
desc.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, VK_ADD);
desc.pszService = MODULENAME"/MenuCommandShowHide";
Hotkey_Register(&desc);
desc.pszName = MODULENAME"/BringNotesFront";
- desc.ptszDescription = LPGENT("Bring All Notes to Front");
+ desc.ptszDescription = LPGENW("Bring All Notes to Front");
desc.lParam = KB_TOGGLE_NOTES;
desc.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, VK_HOME);
desc.pszService = MODULENAME"/MenuCommandBringAllFront";
Hotkey_Register(&desc);
desc.pszName = MODULENAME"/NewReminder";
- desc.ptszDescription = LPGENT("New Reminder");
+ desc.ptszDescription = LPGENW("New Reminder");
desc.lParam = KB_NEW_REMINDER;
desc.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, VK_SUBTRACT);
desc.pszService = MODULENAME"/MenuCommandNewReminder";
diff --git a/plugins/NotesAndReminders/src/main.cpp b/plugins/NotesAndReminders/src/main.cpp
index 30ee8282a4..ca2511778d 100644
--- a/plugins/NotesAndReminders/src/main.cpp
+++ b/plugins/NotesAndReminders/src/main.cpp
@@ -47,7 +47,7 @@ INT_PTR PluginMenuCommandAddNew(WPARAM w, LPARAM l)
INT_PTR PluginMenuCommandDeleteAll(WPARAM w, LPARAM l)
{
- if (g_Stickies && MessageBox(NULL, TranslateT("Are you sure you want to delete all notes?"), TranslateT(SECTIONNAME), MB_OKCANCEL) == IDOK)
+ if (g_Stickies && MessageBox(NULL, Translate("Are you sure you want to delete all notes?"), Translate(SECTIONNAME), MB_OKCANCEL) == IDOK)
DeleteNotes();
return 0;
}
@@ -84,7 +84,7 @@ INT_PTR PluginMenuCommandViewReminders(WPARAM w, LPARAM l)
INT_PTR PluginMenuCommandDeleteReminders(WPARAM w, LPARAM l)
{
- if (RemindersList && MessageBox(NULL, TranslateT("Are you sure you want to delete all reminders?"), TranslateT(SECTIONNAME), MB_OKCANCEL) == IDOK)
+ if (RemindersList && MessageBox(NULL, Translate("Are you sure you want to delete all reminders?"), Translate(SECTIONNAME), MB_OKCANCEL) == IDOK)
DeleteReminders();
return 0;
}
@@ -120,8 +120,8 @@ int OnOptInitialise(WPARAM w, LPARAM L)
odp.position = 900002000;
odp.hInstance = hinstance;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_STNOTEOPTIONS);
- odp.ptszTitle = SECTIONNAME;
- odp.ptszGroup = LPGENT("Plugins");
+ odp.pszTitle = SECTIONNAME;
+ odp.pszGroup = LPGEN("Plugins");
odp.pfnDlgProc = DlgProcOptions;
odp.flags = ODPF_TCHAR;
Options_AddPage(w, &odp);
@@ -151,9 +151,9 @@ static void InitServices()
{
// register sounds
- SkinAddNewSoundExT("AlertReminder", LPGENT("Alerts"), LPGENT("Reminder triggered"));
- SkinAddNewSoundExT("AlertReminder2", LPGENT("Alerts"), LPGENT("Reminder triggered (Alternative 1)"));
- SkinAddNewSoundExT("AlertReminder3", LPGENT("Alerts"), LPGENT("Reminder triggered (Alternative 2)"));
+ SkinAddNewSoundEx("AlertReminder", LPGEN("Alerts"), LPGEN("Reminder triggered"));
+ SkinAddNewSoundEx("AlertReminder2", LPGEN("Alerts"), LPGEN("Reminder triggered (Alternative 1)"));
+ SkinAddNewSoundEx("AlertReminder3", LPGEN("Alerts"), LPGEN("Reminder triggered (Alternative 2)"));
// register menu command services
@@ -202,49 +202,49 @@ int OnModulesLoaded(WPARAM wparam, LPARAM lparam)
mi.position = 1600000000;
mi.hIcolibItem = iconList[2].hIcolib;
- mi.name.t = LPGENT("New &Note");
+ mi.name.w = LPGENW("New &Note");
mi.pszService = MODULENAME"/MenuCommandAddNew";
addMenuItem(mi);
mi.position = 1600000001;
mi.hIcolibItem = iconList[0].hIcolib;
- mi.name.t = LPGENT("New &Reminder");
+ mi.name.w = LPGENW("New &Reminder");
mi.pszService = MODULENAME"/MenuCommandNewReminder";
addMenuItem(mi);
mi.position = 1600100000;
mi.hIcolibItem = iconList[3].hIcolib;
- mi.name.t = LPGENT("&Show / Hide Notes");
+ mi.name.w = LPGENW("&Show / Hide Notes");
mi.pszService = MODULENAME"/MenuCommandShowHide";
addMenuItem(mi);
mi.position = 1600100001;
mi.hIcolibItem = iconList[13].hIcolib;
- mi.name.t = LPGENT("Vie&w Notes");
+ mi.name.w = LPGENW("Vie&w Notes");
mi.pszService = MODULENAME"/MenuCommandViewNotes";
addMenuItem(mi);
mi.position = 1600100002;
mi.hIcolibItem = iconList[1].hIcolib;
- mi.name.t = LPGENT("&Delete All Notes");
+ mi.name.w = LPGENW("&Delete All Notes");
mi.pszService = MODULENAME"/MenuCommandDeleteAll";
addMenuItem(mi);
mi.position = 1600100003;
mi.hIcolibItem = iconList[11].hIcolib;
- mi.name.t = LPGENT("&Bring All to Front");
+ mi.name.w = LPGENW("&Bring All to Front");
mi.pszService = MODULENAME"/MenuCommandBringAllFront";
addMenuItem(mi);
mi.position = 1600200000;
mi.hIcolibItem = iconList[6].hIcolib;
- mi.name.t = LPGENT("&View Reminders");
+ mi.name.w = LPGENW("&View Reminders");
mi.pszService = MODULENAME"/MenuCommandViewReminders";
addMenuItem(mi);
mi.position = 1600200001;
mi.hIcolibItem = iconList[5].hIcolib;
- mi.name.t = LPGENT("D&elete All Reminders");
+ mi.name.w = LPGENW("D&elete All Reminders");
mi.pszService = MODULENAME"/MenuCommandDeleteReminders";
addMenuItem(mi);
@@ -310,7 +310,7 @@ extern "C" __declspec(dllexport) int Load(void)
hRichedDll = LoadLibrary("Msftedit.dll");
if (!hRichedDll) {
- if (MessageBox(0, TranslateT("Miranda could not load the Notes & Reminders plugin, Msftedit.dll is missing. If you are using WINE, please make sure you have Msftedit.dll installed. Press 'Yes' to continue loading Miranda."), _T(SECTIONNAME), MB_YESNO | MB_ICONINFORMATION) != IDYES)
+ if (MessageBox(0, Translate("Miranda could not load the Notes & Reminders plugin, Msftedit.dll is missing. If you are using WINE, please make sure you have Msftedit.dll installed. Press 'Yes' to continue loading Miranda."), SECTIONNAME, MB_YESNO | MB_ICONINFORMATION) != IDYES)
return 1;
return 0;
}
diff --git a/plugins/NotesAndReminders/src/notes.cpp b/plugins/NotesAndReminders/src/notes.cpp
index 8b752336ed..706e245013 100644
--- a/plugins/NotesAndReminders/src/notes.cpp
+++ b/plugins/NotesAndReminders/src/notes.cpp
@@ -59,29 +59,29 @@ static HWND LV;
struct ColorPreset
{
- TCHAR *szName;
+ char *szName;
COLORREF color;
};
static struct ColorPreset clrPresets[] =
{
- {LPGENT("Black"), RGB(0,0,0)},
- {LPGENT("Maroon"), RGB(128,0,0)},
- {LPGENT("Green"), RGB(0,128,0)},
- {LPGENT("Olive"), RGB(128,128,0)},
- {LPGENT("Navy"), RGB(0,0,128)},
- {LPGENT("Purple"), RGB(128,0,128)},
- {LPGENT("Teal"), RGB(0,128,128)},
- {LPGENT("Gray"), RGB(128,128,128)},
- {LPGENT("Silver"), RGB(192,192,192)},
- {LPGENT("Red"), RGB(255,0,0)},
- {LPGENT("Orange"), RGB(255,155,0)},
- {LPGENT("Lime"), RGB(0,255,0)},
- {LPGENT("Yellow"), RGB(255,255,0)},
- {LPGENT("Blue"), RGB(0,0,255)},
- {LPGENT("Fuchsia"), RGB(255,0,255)},
- {LPGENT("Aqua"), RGB(0,255,255)},
- {LPGENT("White"), RGB(255,255,255)}
+ { LPGEN("Black"), RGB(0,0,0) },
+ { LPGEN("Maroon"), RGB(128,0,0) },
+ { LPGEN("Green"), RGB(0,128,0) },
+ { LPGEN("Olive"), RGB(128,128,0) },
+ { LPGEN("Navy"), RGB(0,0,128) },
+ { LPGEN("Purple"), RGB(128,0,128) },
+ { LPGEN("Teal"), RGB(0,128,128) },
+ { LPGEN("Gray"), RGB(128,128,128) },
+ { LPGEN("Silver"), RGB(192,192,192) },
+ { LPGEN("Red"), RGB(255,0,0) },
+ { LPGEN("Orange"), RGB(255,155,0) },
+ { LPGEN("Lime"), RGB(0,255,0) },
+ { LPGEN("Yellow"), RGB(255,255,0) },
+ { LPGEN("Blue"), RGB(0,0,255) },
+ { LPGEN("Fuchsia"), RGB(255,0,255) },
+ { LPGEN("Aqua"), RGB(0,255,255) },
+ { LPGEN("White"), RGB(255,255,255) }
};
@@ -701,7 +701,7 @@ void PurgeNotes(void)
void OnDeleteNote(HWND hdlg, STICKYNOTE *SN)
{
- if (MessageBox(hdlg, TranslateT("Are you sure you want to delete this note?"), TranslateT(SECTIONNAME), MB_OKCANCEL) == IDOK)
+ if (MessageBoxW(hdlg, TranslateT("Are you sure you want to delete this note?"), TranslateT(SECTIONNAME), MB_OKCANCEL) == IDOK)
{
if (SN->SNHwnd)
DestroyWindow(SN->SNHwnd);
@@ -975,7 +975,7 @@ __inline void JustSaveNotes(void)
static int FindMenuItem(HMENU h, LPTSTR lpszName)
{
UINT i;
- TCHAR s[128];
+ char s[128];
int n = GetMenuItemCount(h);
@@ -1040,7 +1040,7 @@ static BOOL DoContextMenu(HWND AhWnd,WPARAM wParam,LPARAM lParam)
static void MeasureColorPresetMenuItem(HWND hdlg, LPMEASUREITEMSTRUCT lpMeasureItem, struct ColorPreset *clrPresets)
{
HDC hdc = GetDC(hdlg);
- LPTSTR lpsz = TranslateTS(clrPresets->szName);
+ LPSTR lpsz = TranslateTS(clrPresets->szName);
SIZE sz;
GetTextExtentPoint32(hdc, lpsz, (int)mir_tstrlen(lpsz), &sz);
ReleaseDC(hdlg, hdc);
@@ -1567,7 +1567,7 @@ INT_PTR CALLBACK StickyNoteWndProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM l
SN->pCustomFont = NULL;
}
- // clear text first to force a reformatting w.r.t scrollbar
+ // clear text first to force a reformatting w.r.w scrollbar
SetWindowText(H, "");
SendMessage(H, WM_SETFONT, (WPARAM)(SN->pCustomFont ? SN->pCustomFont->hFont : hBodyFont), FALSE);
SetNoteTextControl(SN);
@@ -1604,7 +1604,7 @@ INT_PTR CALLBACK StickyNoteWndProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM l
free(SN->pCustomFont);
SN->pCustomFont = NULL;
- // clear text first to force a reformatting w.r.t scrollbar
+ // clear text first to force a reformatting w.r.w scrollbar
SetWindowText(H, "");
SendMessage(H, WM_SETFONT, (WPARAM)hBodyFont, FALSE);
SetNoteTextControl(SN);
@@ -1873,7 +1873,7 @@ INT_PTR CALLBACK DlgProcViewNotes(HWND Dialog,UINT Message,WPARAM wParam,LPARAM
{
LV_COLUMN lvCol;
NMLISTVIEW *NM;
- TCHAR *S;
+ char *S;
int I;
switch (Message)
@@ -1923,7 +1923,7 @@ INT_PTR CALLBACK DlgProcViewNotes(HWND Dialog,UINT Message,WPARAM wParam,LPARAM
{
Window_SetIcon_IcoLib(Dialog, iconList[13].hIcolib);
- SetWindowText(Dialog, LPGENT("Notes"));
+ SetWindowText(Dialog, LPGEN("Notes"));
TranslateDialogDefault(Dialog);
@@ -1932,25 +1932,25 @@ INT_PTR CALLBACK DlgProcViewNotes(HWND Dialog,UINT Message,WPARAM wParam,LPARAM
HWND H = GetDlgItem(Dialog,IDC_LISTREMINDERS);
lvCol.mask = LVCF_TEXT | LVCF_WIDTH;
- S = TranslateT("Note text");
+ S = Translate("Note text");
lvCol.pszText = S;
lvCol.cx = g_notesListColGeom[3];
ListView_InsertColumn(H,0,&lvCol);
lvCol.mask = LVCF_TEXT | LVCF_WIDTH;
- S = TranslateT("Top");
+ S = Translate("Top");
lvCol.pszText = S;
lvCol.cx = g_notesListColGeom[2];
ListView_InsertColumn(H,0,&lvCol);
lvCol.mask = LVCF_TEXT | LVCF_WIDTH;
- S = TranslateT("Visible");
+ S = Translate("Visible");
lvCol.pszText = S;
lvCol.cx = g_notesListColGeom[1];
ListView_InsertColumn(H,0,&lvCol);
lvCol.mask = LVCF_TEXT | LVCF_WIDTH;
- S = TranslateT("Date/Title");
+ S = Translate("Date/Title");
lvCol.pszText = S;
lvCol.cx = g_notesListColGeom[0];
ListView_InsertColumn(H,0,&lvCol);
diff --git a/plugins/NotesAndReminders/src/options.cpp b/plugins/NotesAndReminders/src/options.cpp
index d8c013fa40..a4e498823b 100644
--- a/plugins/NotesAndReminders/src/options.cpp
+++ b/plugins/NotesAndReminders/src/options.cpp
@@ -19,7 +19,7 @@ int g_NoteWidth,g_NoteHeight;
int g_Transparency;
char *g_RemindSMS = NULL;
-TCHAR *g_lpszAltBrowser = NULL;
+char *g_lpszAltBrowser = NULL;
int g_reminderListGeom[4] = {0};
int g_reminderListColGeom[2] = { 150, 205 };
@@ -72,32 +72,32 @@ static timeFormats[] =
struct FontOptionsList
{
- TCHAR *szDescr;
+ char *szDescr;
COLORREF defColour;
- TCHAR *szDefFace;
+ char *szDefFace;
BYTE defStyle;
- char defSize;
- TCHAR *szBkgName;
+ int defSize;
+ char *szBkgName;
}
static fontOptionsList[] =
{
- {LPGENT("Sticky Note Caption"), RGB(0,0,0), "Small Fonts", 0, 7, LPGENT("Sticky Note Background Color")},
- //{LPGENT("Sticky Note Caption"), RGB(0,0,0), L"Terminal", 0, 6, LPGENT("Sticky Note Background Color")},
- //{LPGENT("Sticky Note Caption"), RGB(0,0,0), L"MS Serif", 0, 7, LPGENT("Sticky Note Background Color")},
- //{LPGENT("Sticky Note Body"), RGB(0,0,0), L"Tahoma", 0, 8, LPGENT("Sticky Note Background Color")},
- {LPGENT("Sticky Note Body"), RGB(0,0,0), "System", DBFONTF_BOLD, 10, LPGENT("Sticky Note Background Color")},
+ { LPGEN("Sticky Note Caption"), RGB(0,0,0), "Small Fonts", 0, 7, LPGEN("Sticky Note Background Color")},
+// { LPGEN("Sticky Note Caption"), RGB(0,0,0), L"Terminal", 0, 6, LPGEN("Sticky Note Background Color")},
+// { LPGEN("Sticky Note Caption"), RGB(0,0,0), L"MS Serif", 0, 7, LPGEN("Sticky Note Background Color")},
+// { LPGEN("Sticky Note Body"), RGB(0,0,0), L"Tahoma", 0, 8, LPGEN("Sticky Note Background Color")},
+ { LPGEN("Sticky Note Body"), RGB(0,0,0), "System", DBFONTF_BOLD, 10, LPGEN("Sticky Note Background Color")},
};
struct ColourOptionsList
{
- TCHAR *szName;
+ char *szName;
char *szSettingName;
COLORREF defColour;
}
static colourOptionsList[] =
{
- {LPGENT("Sticky Note Background Color"), "BodyColor", NRCDEFAULT_BODYCLR}
+ { LPGEN("Sticky Note Background Color"), "BodyColor", NRCDEFAULT_BODYCLR}
};
@@ -112,7 +112,7 @@ LPCSTR GetTimeFormatStr()
}
#if defined( _UNICODE )
-static BYTE MsgDlgGetFontDefaultCharset(const TCHAR* szFont)
+static BYTE MsgDlgGetFontDefaultCharset(const wchar_t* szFont)
{
return DEFAULT_CHARSET;
}
@@ -161,12 +161,12 @@ static int CALLBACK EnumFontFamExProc(const LOGFONT *lpelfe, const TEXTMETRIC *l
}
// get font charset according to current CP, if available for specified font
-static BYTE MsgDlgGetFontDefaultCharset(const TCHAR* szFont)
+static BYTE MsgDlgGetFontDefaultCharset(const char *szFont)
{
LOGFONT lf = {0};
int found = 0;
- mir_tstrcpy(lf.lfFaceName, szFont);
+ mir_strcpy(lf.lfFaceName, szFont);
lf.lfCharSet = MsgDlgGetCPDefaultCharset();
// check if the font supports specified charset
@@ -227,11 +227,11 @@ void RegisterFontServiceFonts()
{
char szTemp[100];
- FontIDT fontid = {0};
+ FontID fontid = { 0 };
fontid.cbSize = sizeof(FontIDT);
- _tcsncpy(fontid.group, _T(SECTIONNAME), _countof(fontid.group));
- _tcsncpy(fontid.backgroundGroup, _T(SECTIONNAME), _countof(fontid.backgroundGroup) );
+ strncpy(fontid.group, _T(SECTIONNAME), _countof(fontid.group));
+ strncpy(fontid.backgroundGroup, _T(SECTIONNAME), _countof(fontid.backgroundGroup));
strncpy(fontid.dbSettingsGroup, MODULENAME, _countof(fontid.dbSettingsGroup));
fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID | FIDF_SAVEPOINTSIZE;
@@ -239,12 +239,11 @@ void RegisterFontServiceFonts()
int nFontScale = GetDeviceCaps(hDC, LOGPIXELSY);
ReleaseDC(NULL, hDC);
- for (int i = 0; i < _countof(fontOptionsList); i++)
- {
+ for (int i = 0; i < _countof(fontOptionsList); i++) {
fontid.order = i;
mir_snprintf(szTemp, "Font%d", i);
strncpy(fontid.prefix, szTemp, _countof(fontid.prefix));
- _tcsncpy(fontid.name, fontOptionsList[i].szDescr, _countof(fontid.name));
+ strncpy(fontid.name, fontOptionsList[i].szDescr, _countof(fontid.name));
fontid.deffontsettings.colour = fontOptionsList[i].defColour;
fontid.deffontsettings.size = (char)-MulDiv(fontOptionsList[i].defSize, nFontScale, 72);
@@ -252,23 +251,22 @@ void RegisterFontServiceFonts()
fontid.deffontsettings.style = fontOptionsList[i].defStyle;
fontid.deffontsettings.charset = MsgDlgGetFontDefaultCharset(fontOptionsList[i].szDefFace);
- _tcsncpy(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _countof(fontid.deffontsettings.szFace));
- _tcsncpy(fontid.backgroundName, fontOptionsList[i].szBkgName, _countof(fontid.backgroundName));
+ strncpy(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _countof(fontid.deffontsettings.szFace));
+ strncpy(fontid.backgroundName, fontOptionsList[i].szBkgName, _countof(fontid.backgroundName));
FontRegisterT(&fontid);
}
- ColourIDT colorid = {0};
+ ColourIDT colorid = { 0 };
colorid.cbSize = sizeof(ColourIDT);
- _tcsncpy(colorid.group, _T(SECTIONNAME), _countof(colorid.group));
+ strncpy(colorid.group, _T(SECTIONNAME), _countof(colorid.group));
strncpy(colorid.dbSettingsGroup, MODULENAME, _countof(fontid.dbSettingsGroup));
colorid.flags = 0;
- for (int i = 0; i < _countof(colourOptionsList); i++)
- {
+ for (int i = 0; i < _countof(colourOptionsList); i++) {
colorid.order = i;
- _tcsncpy(colorid.name, colourOptionsList[i].szName, _countof(colorid.name));
+ strncpy(colorid.name, colourOptionsList[i].szName, _countof(colorid.name));
colorid.defcolour = colourOptionsList[i].defColour;
strncpy(colorid.setting, colourOptionsList[i].szSettingName, _countof(colorid.setting));
@@ -281,101 +279,94 @@ void RegisterFontServiceFonts()
void LoadNRFont(int i, LOGFONT *lf, COLORREF *colour)
{
- FontIDT fontid = {0};
+ FontIDT fontid = { 0 };
- fontid.cbSize = sizeof(fontid);
- _tcsncpy(fontid.group, LPGENT(SECTIONNAME), _countof(fontid.group));
- _tcsncpy(fontid.name, fontOptionsList[i].szDescr, _countof(fontid.name));
-
- COLORREF col = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)lf);
+ fontid.cbSize = sizeof(fontid);
+ strncpy(fontid.group, LPGEN(SECTIONNAME), _countof(fontid.group));
+ strncpy(fontid.name, fontOptionsList[i].szDescr, _countof(fontid.name));
+ COLORREF col = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)lf);
if (colour)
- {
*colour = col;
- }
}
-static void TrimString(TCHAR *s)
+static void TrimString(char *s)
{
if (!s || !*s)
return;
- TCHAR *start = s;
- UINT n = UINT(mir_tstrlen(s) - 1);
+ char *start = s;
+ UINT n = UINT(mir_strlen(s) - 1);
- TCHAR *end = s + n;
+ char *end = s + n;
- if (!_istspace(*start) && !_istspace(*end))
- {
+ if (!iswspace(*start) && !iswspace(*end)) {
// nothing to trim
return;
}
// scan past leading spaces
- while (*start && _istspace(*start)) start++;
+ while (*start && iswspace(*start)) start++;
- if (!*start)
- {
+ if (!*start) {
// empty string
*s = 0;
return;
}
// trim trailing spaces
- while ( _istspace(*end) ) end--;
+ while (iswspace(*end)) end--;
end[1] = 0;
- if (start > s)
- {
+ if (start > s) {
// remove leading spaces
- memmove(s, start, ((UINT)(end-start)+2)*sizeof(TCHAR));
+ memmove(s, start, ((UINT)(end - start) + 2) * sizeof(wchar_t));
}
}
-INT_PTR CALLBACK DlgProcOptions(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK DlgProcOptions(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
{
BOOL LB;
WORD SzT;
void *P;
int i;
- switch (message)
- {
- case WM_INITDIALOG:
+ switch (message) {
+ case WM_INITDIALOG:
{
TranslateDialogDefault(hdlg);
- SendDlgItemMessage(hdlg,IDC_SLIDER_TRANSPARENCY,TBM_SETRANGE,TRUE,MAKELONG(0,255-MIN_ALPHA));
- SendDlgItemMessage(hdlg,IDC_SLIDER_TRANSPARENCY,TBM_SETPOS,TRUE,255-g_Transparency);
-
+ SendDlgItemMessage(hdlg, IDC_SLIDER_TRANSPARENCY, TBM_SETRANGE, TRUE, MAKELONG(0, 255 - MIN_ALPHA));
+ SendDlgItemMessage(hdlg, IDC_SLIDER_TRANSPARENCY, TBM_SETPOS, TRUE, 255 - g_Transparency);
+
CheckDlgButton(hdlg, IDC_CHECK_HIDENOTES, !g_ShowNotesAtStart ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hdlg, IDC_CHECK_MENUS, g_AddContListMI ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hdlg, IDC_CHECK_BUTTONS, g_ShowNoteButtons ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hdlg, IDC_CHECK_SCROLLBARS, g_ShowScrollbar ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hdlg, IDC_CHECK_CLOSE, g_CloseAfterAddReminder ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hdlg, IDC_CHECK_MSI, !g_UseDefaultPlaySound ? BST_CHECKED : BST_UNCHECKED);
- SetDlgItemInt(hdlg,IDC_EDIT_WIDTH,g_NoteWidth,FALSE);
- SetDlgItemInt(hdlg,IDC_EDIT_HEIGHT,g_NoteHeight,FALSE);
-
- SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_RESETCONTENT,0,0);
- SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_RESETCONTENT,0,0);
- for (i=0; i<_countof(dateFormats); i++)
- SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_ADDSTRING,0,(LPARAM)dateFormats[i].lpszUI);
- for (i=0; i<_countof(timeFormats); i++)
- SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_ADDSTRING,0,(LPARAM)timeFormats[i].lpszUI);
- SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_ADDSTRING,0,(LPARAM)Translate("None"));
- SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_ADDSTRING,0,(LPARAM)Translate("None"));
-
- SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_SETCURSEL,(WPARAM)(g_NoteTitleDate ? g_NoteTitleDate-1 : SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_GETCOUNT,0,0)-1),0);
- SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_SETCURSEL,(WPARAM)(g_NoteTitleTime ? g_NoteTitleTime-1 : SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_GETCOUNT,0,0)-1),0);
-
- if (g_RemindSMS)
- SetDlgItemText(hdlg,IDC_EDIT_EMAILSMS,g_RemindSMS);
- else
- SetDlgItemText(hdlg,IDC_EDIT_EMAILSMS,"");
-
- SetDlgItemText(hdlg,IDC_EDIT_ALTBROWSER,g_lpszAltBrowser ? g_lpszAltBrowser : "");
+ SetDlgItemInt(hdlg, IDC_EDIT_WIDTH, g_NoteWidth, FALSE);
+ SetDlgItemInt(hdlg, IDC_EDIT_HEIGHT, g_NoteHeight, FALSE);
+
+ SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_RESETCONTENT, 0, 0);
+ SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_RESETCONTENT, 0, 0);
+ for (i = 0; i < _countof(dateFormats); i++)
+ SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_ADDSTRING, 0, (LPARAM)dateFormats[i].lpszUI);
+ for (i = 0; i < _countof(timeFormats); i++)
+ SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_ADDSTRING, 0, (LPARAM)timeFormats[i].lpszUI);
+ SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_ADDSTRING, 0, (LPARAM)Translate("None"));
+ SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_ADDSTRING, 0, (LPARAM)Translate("None"));
+
+ SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_SETCURSEL, (WPARAM)(g_NoteTitleDate ? g_NoteTitleDate - 1 : SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_GETCOUNT, 0, 0) - 1), 0);
+ SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_SETCURSEL, (WPARAM)(g_NoteTitleTime ? g_NoteTitleTime - 1 : SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_GETCOUNT, 0, 0) - 1), 0);
+
+ if (g_RemindSMS)
+ SetDlgItemText(hdlg, IDC_EDIT_EMAILSMS, g_RemindSMS);
+ else
+ SetDlgItemText(hdlg, IDC_EDIT_EMAILSMS, "");
+
+ SetDlgItemText(hdlg, IDC_EDIT_ALTBROWSER, g_lpszAltBrowser ? g_lpszAltBrowser : "");
return TRUE;
}
case WM_HSCROLL:
@@ -384,99 +375,90 @@ INT_PTR CALLBACK DlgProcOptions(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPar
return TRUE;
}
case WM_NOTIFY:
- if (((LPNMHDR)lParam)->code == PSN_APPLY)
- {
- g_ShowNotesAtStart = !(BOOL)IsDlgButtonChecked(hdlg,IDC_CHECK_HIDENOTES);
- g_ShowNoteButtons = (BOOL)IsDlgButtonChecked(hdlg,IDC_CHECK_BUTTONS);
- g_ShowScrollbar = (BOOL)IsDlgButtonChecked(hdlg,IDC_CHECK_SCROLLBARS);
- g_AddContListMI = (BOOL)IsDlgButtonChecked(hdlg,IDC_CHECK_MENUS);
- g_NoteWidth = GetDlgItemInt(hdlg,IDC_EDIT_WIDTH,&LB,FALSE);
- g_NoteHeight = GetDlgItemInt(hdlg,IDC_EDIT_HEIGHT,&LB,FALSE);
- g_Transparency = 255-SendDlgItemMessage(hdlg,IDC_SLIDER_TRANSPARENCY,TBM_GETPOS,0,0);
- g_CloseAfterAddReminder = (BOOL)IsDlgButtonChecked(hdlg,IDC_CHECK_CLOSE);
- g_UseDefaultPlaySound = !(BOOL)IsDlgButtonChecked(hdlg,IDC_CHECK_MSI);
- g_NoteTitleDate = (SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_GETCURSEL,0,0) + 1) % SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_GETCOUNT,0,0);
- g_NoteTitleTime = (SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_GETCURSEL,0,0) + 1) % SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_GETCOUNT,0,0);
- if (g_NoteWidth < 179)
- {
+ if (((LPNMHDR)lParam)->code == PSN_APPLY) {
+ g_ShowNotesAtStart = !(BOOL)IsDlgButtonChecked(hdlg, IDC_CHECK_HIDENOTES);
+ g_ShowNoteButtons = (BOOL)IsDlgButtonChecked(hdlg, IDC_CHECK_BUTTONS);
+ g_ShowScrollbar = (BOOL)IsDlgButtonChecked(hdlg, IDC_CHECK_SCROLLBARS);
+ g_AddContListMI = (BOOL)IsDlgButtonChecked(hdlg, IDC_CHECK_MENUS);
+ g_NoteWidth = GetDlgItemInt(hdlg, IDC_EDIT_WIDTH, &LB, FALSE);
+ g_NoteHeight = GetDlgItemInt(hdlg, IDC_EDIT_HEIGHT, &LB, FALSE);
+ g_Transparency = 255 - SendDlgItemMessage(hdlg, IDC_SLIDER_TRANSPARENCY, TBM_GETPOS, 0, 0);
+ g_CloseAfterAddReminder = (BOOL)IsDlgButtonChecked(hdlg, IDC_CHECK_CLOSE);
+ g_UseDefaultPlaySound = !(BOOL)IsDlgButtonChecked(hdlg, IDC_CHECK_MSI);
+ g_NoteTitleDate = (SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_GETCURSEL, 0, 0) + 1) % SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_GETCOUNT, 0, 0);
+ g_NoteTitleTime = (SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_GETCURSEL, 0, 0) + 1) % SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_GETCOUNT, 0, 0);
+ if (g_NoteWidth < 179) {
g_NoteWidth = 179;
- SetDlgItemInt(hdlg,IDC_EDIT_WIDTH,g_NoteWidth,FALSE);
+ SetDlgItemInt(hdlg, IDC_EDIT_WIDTH, g_NoteWidth, FALSE);
}
- if (g_NoteHeight < 35)
- {
+ if (g_NoteHeight < 35) {
g_NoteHeight = 35;
- SetDlgItemInt(hdlg,IDC_EDIT_HEIGHT,g_NoteHeight,FALSE);
+ SetDlgItemInt(hdlg, IDC_EDIT_HEIGHT, g_NoteHeight, FALSE);
}
- SzT = (WORD)SendDlgItemMessage(hdlg,IDC_EDIT_EMAILSMS,WM_GETTEXTLENGTH,0,0);
- if (SzT != 0)
- {
+ SzT = (WORD)SendDlgItemMessage(hdlg, IDC_EDIT_EMAILSMS, WM_GETTEXTLENGTH, 0, 0);
+ if (SzT != 0) {
g_RemindSMS = (char*)realloc(g_RemindSMS, SzT + 1);
GetDlgItemText(hdlg, IDC_EDIT_EMAILSMS, g_RemindSMS, SzT + 1);
}
P = g_RemindSMS;
- db_set_blob(0,MODULENAME,"RemindEmail",P,SzT);
+ db_set_blob(0, MODULENAME, "RemindEmail", P, SzT);
- SzT = (WORD)SendDlgItemMessage(hdlg,IDC_EDIT_ALTBROWSER,WM_GETTEXTLENGTH,0,0);
- if (SzT != 0)
- {
- g_lpszAltBrowser = (TCHAR*)mir_realloc(g_lpszAltBrowser, SzT + 1);
+ SzT = (WORD)SendDlgItemMessage(hdlg, IDC_EDIT_ALTBROWSER, WM_GETTEXTLENGTH, 0, 0);
+ if (SzT != 0) {
+ g_lpszAltBrowser = (char*)mir_realloc(g_lpszAltBrowser, SzT + 1);
GetDlgItemText(hdlg, IDC_EDIT_ALTBROWSER, g_lpszAltBrowser, SzT + 1);
TrimString(g_lpszAltBrowser);
- if (!*g_lpszAltBrowser)
- {
+ if (!*g_lpszAltBrowser) {
mir_free(g_lpszAltBrowser);
g_lpszAltBrowser = NULL;
}
}
- else if (g_lpszAltBrowser)
- {
+ else if (g_lpszAltBrowser) {
mir_free(g_lpszAltBrowser);
g_lpszAltBrowser = NULL;
}
- SetDlgItemText(hdlg,IDC_EDIT_ALTBROWSER,g_lpszAltBrowser ? g_lpszAltBrowser : "");
+ SetDlgItemText(hdlg, IDC_EDIT_ALTBROWSER, g_lpszAltBrowser ? g_lpszAltBrowser : "");
if (g_lpszAltBrowser)
- db_set_s(0,MODULENAME,"AltBrowser",g_lpszAltBrowser);
+ db_set_s(0, MODULENAME, "AltBrowser", g_lpszAltBrowser);
else
- db_unset(0,MODULENAME,"AltBrowser");
-
- db_set_dw(0,MODULENAME,"ShowNotesAtStart",g_ShowNotesAtStart);
- db_set_dw(0,MODULENAME,"ShowNoteButtons",g_ShowNoteButtons);
- db_set_dw(0,MODULENAME,"ShowScrollbar",g_ShowScrollbar);
- db_set_dw(0,MODULENAME,"AddContactMenuItems",g_AddContListMI);
- db_set_dw(0,MODULENAME,"NoteWidth",g_NoteWidth);
- db_set_dw(0,MODULENAME,"NoteHeight",g_NoteHeight);
- db_set_dw(0,MODULENAME,"Transparency",g_Transparency);
- db_set_dw(0,MODULENAME,"NoteTitleDate",g_NoteTitleDate);
- db_set_dw(0,MODULENAME,"NoteTitleTime",g_NoteTitleTime);
- db_set_dw(0,MODULENAME,"CloseAfterAddReminder",g_CloseAfterAddReminder);
- db_set_dw(0,MODULENAME,"UseMCI",!g_UseDefaultPlaySound);
+ db_unset(0, MODULENAME, "AltBrowser");
+
+ db_set_dw(0, MODULENAME, "ShowNotesAtStart", g_ShowNotesAtStart);
+ db_set_dw(0, MODULENAME, "ShowNoteButtons", g_ShowNoteButtons);
+ db_set_dw(0, MODULENAME, "ShowScrollbar", g_ShowScrollbar);
+ db_set_dw(0, MODULENAME, "AddContactMenuItems", g_AddContListMI);
+ db_set_dw(0, MODULENAME, "NoteWidth", g_NoteWidth);
+ db_set_dw(0, MODULENAME, "NoteHeight", g_NoteHeight);
+ db_set_dw(0, MODULENAME, "Transparency", g_Transparency);
+ db_set_dw(0, MODULENAME, "NoteTitleDate", g_NoteTitleDate);
+ db_set_dw(0, MODULENAME, "NoteTitleTime", g_NoteTitleTime);
+ db_set_dw(0, MODULENAME, "CloseAfterAddReminder", g_CloseAfterAddReminder);
+ db_set_dw(0, MODULENAME, "UseMCI", !g_UseDefaultPlaySound);
SaveNotes();
LoadNotes(FALSE);
return TRUE;
}
break;
case WM_COMMAND:
- switch (LOWORD(wParam))
- {
+ switch (LOWORD(wParam)) {
case IDC_BTN_BROWSEBROWSER:
{
- TCHAR s[MAX_PATH];
+ char s[MAX_PATH];
- OPENFILENAME ofn = {0};
+ OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hdlg;
- ofn.lpstrFilter = TranslateT("Executable Files\0*.exe\0All Files\0*.*\0\0");
+ ofn.lpstrFilter = Translate("Executable Files\0*.exe\0All Files\0*.*\0\0");
ofn.lpstrFile = s;
ofn.nMaxFile = _countof(s);
- ofn.lpstrTitle = TranslateT("Select Executable");
+ ofn.lpstrTitle = Translate("Select Executable");
ofn.lpstrInitialDir = ".";
ofn.Flags = OFN_FILEMUSTEXIST | OFN_LONGNAMES | OFN_ENABLESIZING | OFN_DONTADDTORECENT;
GetDlgItemText(hdlg, IDC_EDIT_ALTBROWSER, s, ofn.nMaxFile);
- if ( GetOpenFileName(&ofn) )
- {
- SetDlgItemText(hdlg,IDC_EDIT_ALTBROWSER,s);
+ if (GetOpenFileName(&ofn)) {
+ SetDlgItemText(hdlg, IDC_EDIT_ALTBROWSER, s);
SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0);
}
}
@@ -485,8 +467,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPar
{
SAFE_FREE((void**)&g_RemindSMS);
SetDlgItemText(hdlg, IDC_EDIT_EMAILSMS, "");
- if (g_lpszAltBrowser)
- {
+ if (g_lpszAltBrowser) {
mir_free(g_lpszAltBrowser);
g_lpszAltBrowser = NULL;
}
@@ -505,16 +486,16 @@ INT_PTR CALLBACK DlgProcOptions(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPar
CheckDlgButton(hdlg, IDC_CHECK_BUTTONS, g_ShowNoteButtons ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hdlg, IDC_CHECK_CLOSE, g_CloseAfterAddReminder ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hdlg, IDC_CHECK_MSI, !g_UseDefaultPlaySound ? BST_CHECKED : BST_UNCHECKED);
- SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_SETCURSEL,(WPARAM)(g_NoteTitleDate-1),0);
- SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_SETCURSEL,(WPARAM)(g_NoteTitleTime-1),0);
+ SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_SETCURSEL, (WPARAM)(g_NoteTitleDate - 1), 0);
+ SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_SETCURSEL, (WPARAM)(g_NoteTitleTime - 1), 0);
g_NoteWidth = 179;
g_NoteHeight = 35;
- SetDlgItemInt(hdlg,IDC_EDIT_WIDTH,g_NoteWidth,FALSE);
- SetDlgItemInt(hdlg,IDC_EDIT_HEIGHT,g_NoteHeight,FALSE);
+ SetDlgItemInt(hdlg, IDC_EDIT_WIDTH, g_NoteWidth, FALSE);
+ SetDlgItemInt(hdlg, IDC_EDIT_HEIGHT, g_NoteHeight, FALSE);
g_Transparency = 255;
- SendDlgItemMessage(hdlg,IDC_SLIDER_TRANSPARENCY,TBM_SETPOS,TRUE,0);
+ SendDlgItemMessage(hdlg, IDC_SLIDER_TRANSPARENCY, TBM_SETPOS, TRUE, 0);
SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0); // JK optim
- return TRUE;
+ return TRUE;
}
case IDC_EDIT_ALTBROWSER:
case IDC_EDIT_EMAILSMS:
@@ -549,34 +530,33 @@ void InitSettings(void)
Sz1 = MAX_PATH; P = NULL;
ReadSettingBlob(0, MODULENAME, "RemindEmail", (WORD*)&Sz1, &P);
- if (!(Sz1 && P))
+ if (!(Sz1 && P))
g_RemindSMS = NULL;
- else
- {
+ else {
g_RemindSMS = (char*)malloc(Sz1 + 1);
memcpy(g_RemindSMS, P, Sz1);
g_RemindSMS[Sz1] = 0;
FreeSettingBlob(Sz1, P);
}
- g_lpszAltBrowser = db_get_sa(0,MODULENAME,"AltBrowser");
-
- g_ShowNotesAtStart = (BOOL)db_get_dw(0,MODULENAME,"ShowNotesAtStart",1);
- g_ShowNoteButtons = (BOOL)db_get_dw(0,MODULENAME,"ShowNoteButtons",1);
- g_ShowScrollbar = (BOOL)db_get_dw(0,MODULENAME,"ShowScrollbar",1);
- g_AddContListMI = (BOOL)db_get_dw(0,MODULENAME,"AddContactMenuItems",1);
- g_NoteWidth = db_get_dw(0,MODULENAME,"NoteWidth",179);
- g_NoteHeight = db_get_dw(0,MODULENAME,"NoteHeight",50);
- g_Transparency = db_get_dw(0,MODULENAME,"Transparency",255);
- g_NoteTitleDate = db_get_dw(0,MODULENAME,"NoteTitleDate",1);
- g_NoteTitleTime = db_get_dw(0,MODULENAME,"NoteTitleTime",1);
- g_CloseAfterAddReminder = (BOOL)db_get_dw(0,MODULENAME,"CloseAfterAddReminder",1);
- g_UseDefaultPlaySound = !(BOOL)db_get_dw(0,MODULENAME,"UseMCI",1);
-
- ReadSettingIntArray(0,MODULENAME,"ReminderListGeom",g_reminderListGeom,_countof(g_reminderListGeom));
- ReadSettingIntArray(0,MODULENAME,"ReminderListColGeom",g_reminderListColGeom,_countof(g_reminderListColGeom));
- ReadSettingIntArray(0,MODULENAME,"NotesListGeom",g_notesListGeom,_countof(g_notesListGeom));
- ReadSettingIntArray(0,MODULENAME,"NotesListColGeom",g_notesListColGeom,_countof(g_notesListColGeom));
+ g_lpszAltBrowser = db_get_sa(0, MODULENAME, "AltBrowser");
+
+ g_ShowNotesAtStart = (BOOL)db_get_dw(0, MODULENAME, "ShowNotesAtStart", 1);
+ g_ShowNoteButtons = (BOOL)db_get_dw(0, MODULENAME, "ShowNoteButtons", 1);
+ g_ShowScrollbar = (BOOL)db_get_dw(0, MODULENAME, "ShowScrollbar", 1);
+ g_AddContListMI = (BOOL)db_get_dw(0, MODULENAME, "AddContactMenuItems", 1);
+ g_NoteWidth = db_get_dw(0, MODULENAME, "NoteWidth", 179);
+ g_NoteHeight = db_get_dw(0, MODULENAME, "NoteHeight", 50);
+ g_Transparency = db_get_dw(0, MODULENAME, "Transparency", 255);
+ g_NoteTitleDate = db_get_dw(0, MODULENAME, "NoteTitleDate", 1);
+ g_NoteTitleTime = db_get_dw(0, MODULENAME, "NoteTitleTime", 1);
+ g_CloseAfterAddReminder = (BOOL)db_get_dw(0, MODULENAME, "CloseAfterAddReminder", 1);
+ g_UseDefaultPlaySound = !(BOOL)db_get_dw(0, MODULENAME, "UseMCI", 1);
+
+ ReadSettingIntArray(0, MODULENAME, "ReminderListGeom", g_reminderListGeom, _countof(g_reminderListGeom));
+ ReadSettingIntArray(0, MODULENAME, "ReminderListColGeom", g_reminderListColGeom, _countof(g_reminderListColGeom));
+ ReadSettingIntArray(0, MODULENAME, "NotesListGeom", g_notesListGeom, _countof(g_notesListGeom));
+ ReadSettingIntArray(0, MODULENAME, "NotesListColGeom", g_notesListColGeom, _countof(g_notesListColGeom));
BodyColor = db_get_dw(NULL, MODULENAME, colourOptionsList[0].szSettingName, colourOptionsList[0].defColour);
@@ -592,19 +572,16 @@ void InitSettings(void)
void TermSettings(void)
{
- if (g_reminderListGeom[2] > 0 && g_reminderListGeom[3] > 0)
- {
- WriteSettingIntArray(0,MODULENAME,"ReminderListGeom",g_reminderListGeom,_countof(g_reminderListGeom));
- WriteSettingIntArray(0,MODULENAME,"ReminderListColGeom",g_reminderListColGeom,_countof(g_reminderListColGeom));
+ if (g_reminderListGeom[2] > 0 && g_reminderListGeom[3] > 0) {
+ WriteSettingIntArray(0, MODULENAME, "ReminderListGeom", g_reminderListGeom, _countof(g_reminderListGeom));
+ WriteSettingIntArray(0, MODULENAME, "ReminderListColGeom", g_reminderListColGeom, _countof(g_reminderListColGeom));
}
- if (g_notesListGeom[2] > 0 && g_notesListGeom[3] > 0)
- {
- WriteSettingIntArray(0,MODULENAME,"NotesListGeom",g_notesListGeom,_countof(g_notesListGeom));
- WriteSettingIntArray(0,MODULENAME,"NotesListColGeom",g_notesListColGeom,_countof(g_notesListColGeom));
+ if (g_notesListGeom[2] > 0 && g_notesListGeom[3] > 0) {
+ WriteSettingIntArray(0, MODULENAME, "NotesListGeom", g_notesListGeom, _countof(g_notesListGeom));
+ WriteSettingIntArray(0, MODULENAME, "NotesListColGeom", g_notesListColGeom, _countof(g_notesListColGeom));
}
- if (g_lpszAltBrowser)
- {
+ if (g_lpszAltBrowser) {
mir_free(g_lpszAltBrowser);
g_lpszAltBrowser = NULL;
}
diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp
index f0a141fd44..cf4e43f807 100644
--- a/plugins/NotesAndReminders/src/reminders.cpp
+++ b/plugins/NotesAndReminders/src/reminders.cpp
@@ -1786,7 +1786,7 @@ INT_PTR CALLBACK DlgProcNotifyReminder(HWND Dialog,UINT Message,WPARAM wParam,LP
m += h * 60;
if (!m)
{
- MessageBox(Dialog, TranslateT("The specified time offset is invalid."), _T(SECTIONNAME), MB_OK | MB_ICONWARNING);
+ MessageBox(Dialog, Translate("The specified time offset is invalid."), _T(SECTIONNAME), MB_OK | MB_ICONWARNING);
return TRUE;
}
@@ -1881,8 +1881,8 @@ INT_PTR CALLBACK DlgProcNewReminder(HWND Dialog,UINT Message,WPARAM wParam,LPARA
if (NewReminderVisible == 2)
{
// opening the edit reminder dialog (uses same dialog resource as add reminder)
- SetWindowText(Dialog, TranslateT("Reminder"));
- SetDlgItemText(Dialog, IDC_ADDREMINDER, TranslateT("&Update Reminder"));
+ SetWindowText(Dialog, Translate("Reminder"));
+ SetDlgItemText(Dialog, IDC_ADDREMINDER, Translate("&Update Reminder"));
ShowWindow(GetDlgItem(Dialog, IDC_VIEWREMINDERS), SW_HIDE);
li = pEditReminder->When;
@@ -2510,7 +2510,7 @@ INT_PTR CALLBACK DlgProcViewReminders(HWND Dialog,UINT Message,WPARAM wParam,LPA
return TRUE;
}
case IDM_DELETEALLREMINDERS:
- if (RemindersList && MessageBox(Dialog, TranslateT("Are you sure you want to delete all reminders?"), TranslateT(SECTIONNAME), MB_OKCANCEL) == IDOK)
+ if (RemindersList && MessageBox(Dialog, Translate("Are you sure you want to delete all reminders?"), Translate(SECTIONNAME), MB_OKCANCEL) == IDOK)
{
SetDlgItemText(Dialog, IDC_REMINDERDATA, "");
DeleteReminders();
@@ -2526,7 +2526,7 @@ INT_PTR CALLBACK DlgProcViewReminders(HWND Dialog,UINT Message,WPARAM wParam,LPA
{
I = ListView_GetSelectionMark(H);
if (I != -1
- && MessageBox(Dialog, TranslateT("Are you sure you want to delete this reminder?"), TranslateT(SECTIONNAME), MB_OKCANCEL) == IDOK)
+ && MessageBox(Dialog, Translate("Are you sure you want to delete this reminder?"), Translate(SECTIONNAME), MB_OKCANCEL) == IDOK)
{
SetDlgItemText(Dialog, IDC_REMINDERDATA, "");
DeleteReminder((REMINDERDATA*)TreeGetAt(RemindersList, I));
diff --git a/plugins/NotifyAnything/src/main.cpp b/plugins/NotifyAnything/src/main.cpp
index cd35e85564..78bdfb9411 100644
--- a/plugins/NotifyAnything/src/main.cpp
+++ b/plugins/NotifyAnything/src/main.cpp
@@ -1,16 +1,16 @@
#include "stdafx.h"
-void cslog(const TCHAR *what, const TCHAR *file, int line)
+void cslog(const wchar_t *what, const wchar_t *file, int line)
{
if (g_settings.log_to_file) {
time_t t_;
time(&t_);
tm *t = localtime(&t_);
//FILE *f = fopen("na.log", "a");
- FILE *f = _tfopen(g_settings.log_filename.c_str(), L"a");
+ FILE *f = _wfopen(g_settings.log_filename.c_str(), L"a");
if (f) {
//fprintf(f, "%s: %s:%i\n", what, file, line);
- _ftprintf(f, L"[%04i-%02i-%02i %02i:%02i:%02i cs] %s: %s:%i\n",
+ fwprintf(f, L"[%04i-%02i-%02i %02i:%02i:%02i cs] %s: %s:%i\n",
int(t->tm_year + 1900), int(t->tm_mon), int(t->tm_mday),
int(t->tm_hour), int(t->tm_min), int(t->tm_sec), what, file, line);
fclose(f);
@@ -21,7 +21,7 @@ void cslog(const TCHAR *what, const TCHAR *file, int line)
HANDLE g_udp_thread, g_tcp_thread;
SOCKET g_udp_socket, g_tcp_socket;
volatile bool g_exit_threads, g_firstrun;
-std::tstring g_mirandaDir;
+std::wstring g_mirandaDir;
mir_cs g_wsocklock;
HINSTANCE hInst;
@@ -56,7 +56,7 @@ enum replace_mode_t {
};
struct popup_t {
- std::tstring id, icon, sound, passwd, contact, message, left, right, opened, closed;
+ std::wstring id, icon, sound, passwd, contact, message, left, right, opened, closed;
COLORREF foreground, background;
int delay;
bool beep;
@@ -64,13 +64,13 @@ struct popup_t {
HWND hwnd;
};
-typedef std::map<std::tstring, popup_t *> popups_t;
+typedef std::map<std::wstring, popup_t *> popups_t;
typedef std::set<popup_t *> anon_popups_t;
popups_t g_popups;
anon_popups_t g_anon_popups;
mir_cs g_popups_cs;
-std::tstring strip(std::tstring str)
+std::wstring strip(std::wstring str)
{
while (!str.empty() && isspace(str[0]))
str.erase(0, 1);
@@ -79,7 +79,7 @@ std::tstring strip(std::tstring str)
return str;
}
-void dbg_msg(std::tstring str, int type)
+void dbg_msg(std::wstring str, int type)
{
str = strip(str);
@@ -91,9 +91,9 @@ void dbg_msg(std::tstring str, int type)
time_t t_;
time(&t_);
tm *t = localtime(&t_);
- FILE *f = _tfopen(g_settings.log_filename.c_str(), L"a");
+ FILE *f = _wfopen(g_settings.log_filename.c_str(), L"a");
if (f) {
- _ftprintf(f, L"[%04i-%02i-%02i %02i:%02i:%02i dbg_msg] %s\n",
+ fwprintf(f, L"[%04i-%02i-%02i %02i:%02i:%02i dbg_msg] %s\n",
int(t->tm_year + 1900), int(t->tm_mon), int(t->tm_mday),
int(t->tm_hour), int(t->tm_min), int(t->tm_sec), str.c_str());
fclose(f);
@@ -109,7 +109,7 @@ void showLastError()
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, NULL);
- dbg_msg((TCHAR *)lpMsgBuf, SM_WARNING);
+ dbg_msg((wchar_t *)lpMsgBuf, SM_WARNING);
LocalFree(lpMsgBuf);
}
@@ -131,31 +131,31 @@ BOOL CALLBACK enum_icons_func(HMODULE, LPCTSTR, LPTSTR name, LONG_PTR data)
return TRUE;
}
-void registerSound(const std::tstring &name)
+void registerSound(const std::wstring &name)
{
- static std::set<std::tstring> sset;
+ static std::set<std::wstring> sset;
if (sset.find(name) != sset.end())
return;
sset.insert(name);
- std::tstring id = L"NotifyAnything_" + name;
- std::tstring desc = L"NotifyAnything: " + name;
- std::tstring file = name + L".wav";
+ std::wstring id = L"NotifyAnything_" + name;
+ std::wstring desc = L"NotifyAnything: " + name;
+ std::wstring file = name + L".wav";
SKINSOUNDDESCEX ssd = { 0 };
ssd.cbSize = sizeof(ssd);
ssd.dwFlags = SSDF_TCHAR;
ssd.pszName = _T2A(id.c_str());
- ssd.ptszSection = LPGENT("Notify Anything");
+ ssd.ptszSection = LPGENW("Notify Anything");
ssd.ptszDescription = desc.c_str();
ssd.ptszDefaultFile = file.c_str();
Skin_AddSound(&ssd);
}
-HICON getIcon(const std::tstring &name)
+HICON getIcon(const std::wstring &name)
{
- static std::map<std::tstring, HICON> icons;
+ static std::map<std::wstring, HICON> icons;
static HICON deficon;
static bool init;
if (!init) {
@@ -185,7 +185,7 @@ HICON getIcon(const std::tstring &name)
icons[L"file"] = Skin_LoadIcon(SKINICON_EVENT_FILE);
}
- std::map<std::tstring, HICON>::iterator i = icons.find(name);
+ std::map<std::wstring, HICON>::iterator i = icons.find(name);
if (i != icons.end())
return i->second;
@@ -200,9 +200,9 @@ HICON getIcon(const std::tstring &name)
return deficon;
}
- std::tstring file((TCHAR*)name.c_str(), 0, p);
+ std::wstring file((wchar_t*)name.c_str(), 0, p);
- std::tstring rname(file.c_str(), p + 1);
+ std::wstring rname(file.c_str(), p + 1);
if (rname.empty()) {
dbg_msg(L"No resource name given.", SM_WARNING);
return deficon;
@@ -218,7 +218,7 @@ HICON getIcon(const std::tstring &name)
if (isdigit(rname[0])) {
enum_icons_t info;
info.found = false;
- info.nr = _ttoi(rname.c_str());
+ info.nr = _wtoi(rname.c_str());
if (info.nr <= 0) {
dbg_msg(L"Icon indices start at 1.", SM_WARNING);
return deficon;
@@ -249,7 +249,7 @@ HICON getIcon(const std::tstring &name)
return icons[name] = (HICON)icon;
}
-bool getNext(std::tstring &out, std::tstring &in, TCHAR sep)
+bool getNext(std::wstring &out, std::wstring &in, wchar_t sep)
{
while (!in.empty() && in[0] == ' ')
in.erase(0, 1);
@@ -289,7 +289,7 @@ bool getNext(std::tstring &out, std::tstring &in, TCHAR sep)
return false;
}
-std::tstring unquote(std::tstring str)
+std::wstring unquote(std::wstring str)
{
size_t p;
while ((p = str.find('\"')) != str.npos)
@@ -297,9 +297,9 @@ std::tstring unquote(std::tstring str)
return str;
}
-void getAll(std::vector<std::tstring> &out, std::tstring &in, TCHAR sep, bool unquote_)
+void getAll(std::vector<std::wstring> &out, std::wstring &in, wchar_t sep, bool unquote_)
{
- std::tstring arg;
+ std::wstring arg;
while (getNext(arg, in, sep))
if (!arg.empty()) {
if (unquote_)
@@ -308,12 +308,12 @@ void getAll(std::vector<std::tstring> &out, std::tstring &in, TCHAR sep, bool un
}
}
-const TCHAR *decode_se_arg(std::tstring &str)
+const wchar_t *decode_se_arg(std::wstring &str)
{
return (str.empty()) ? 0 : str.c_str();
}
-void processSingleAction(const std::tstring &what, bool &closeflag)
+void processSingleAction(const std::wstring &what, bool &closeflag)
{
if (!what.compare(0, 7, L"system:")) {
if (!g_settings.allow_execute) {
@@ -321,7 +321,7 @@ void processSingleAction(const std::tstring &what, bool &closeflag)
return;
}
- std::tstring argstr(what, 7);
+ std::wstring argstr(what, 7);
if (_tsystem(argstr.c_str()) == -1)
dbg_msg(L"Failed to execute: " + argstr, SM_WARNING);
@@ -332,16 +332,16 @@ void processSingleAction(const std::tstring &what, bool &closeflag)
return;
}
- std::tstring argstr(what, 4);
- std::vector<std::tstring> args;
+ std::wstring argstr(what, 4);
+ std::vector<std::wstring> args;
getAll(args, argstr, ' ', true);
if (args.empty())
throw L"Insufficient arguments: " + what;
- std::vector<const TCHAR *> cargs;
- for (std::vector<std::tstring>::iterator i = args.begin(), e = args.end(); i != e; ++i)
+ std::vector<const wchar_t *> cargs;
+ for (std::vector<std::wstring>::iterator i = args.begin(), e = args.end(); i != e; ++i)
cargs.push_back(i->c_str());
cargs.push_back(0);
@@ -355,15 +355,15 @@ void processSingleAction(const std::tstring &what, bool &closeflag)
return;
}
- std::tstring argstr(what, 5);
+ std::wstring argstr(what, 5);
- std::tstring file, args;
+ std::wstring file, args;
if (!getNext(file, argstr, ' '))
throw L"No filename provided: " + what;
file = strip(file);
args = strip(argstr);
- const TCHAR *cargs = decode_se_arg(args);
+ const wchar_t *cargs = decode_se_arg(args);
if ((INT_PTR)ShellExecute(0, L"open", file.c_str(), cargs, 0, SW_SHOWNORMAL) <= 32)
throw L"Failed to open: " + file + L" " + args;
@@ -375,9 +375,9 @@ void processSingleAction(const std::tstring &what, bool &closeflag)
return;
}
- std::tstring argstr(what, 6);
+ std::wstring argstr(what, 6);
- std::tstring verb, file, args, dir;
+ std::wstring verb, file, args, dir;
if (!getNext(verb, argstr, ':'))
throw L"No verb provided: " + what;
if (!getNext(file, argstr, ','))
@@ -398,19 +398,19 @@ void processSingleAction(const std::tstring &what, bool &closeflag)
throw L"Action not recognized: " + what;
}
-void processAction(const std::tstring &what, bool &closeflag)
+void processAction(const std::wstring &what, bool &closeflag)
{
try
{
- std::tstring argstr = what;
- std::vector<std::tstring> actions;
+ std::wstring argstr = what;
+ std::vector<std::wstring> actions;
- std::tstring action;
+ std::wstring action;
while (getNext(action, argstr, ';'))
if (!action.empty())
processSingleAction(action, closeflag);
}
- catch (std::tstring err) {
+ catch (std::wstring err) {
dbg_msg(err, SM_WARNING);
}
}
@@ -425,7 +425,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
case WM_COMMAND:
{
mir_cslock lck(g_popups_cs);
- std::tstring left;
+ std::wstring left;
if (pd)
left = pd->left;
@@ -443,7 +443,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
case WM_CONTEXTMENU:
{
mir_cslock lck(g_popups_cs);
- std::tstring right;
+ std::wstring right;
if (pd)
right = pd->right;
@@ -468,7 +468,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
case UM_FREEPLUGINDATA:
{
mir_cslock lck(g_popups_cs);
- std::tstring closed;
+ std::wstring closed;
if (pd)
closed = pd->closed;
@@ -489,8 +489,8 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
int showMessage(const popup_t &msg)
{
POPUPDATAT ppd = { 0 };
- _tcsncpy(ppd.lptzText, strip(msg.message).c_str(), MAX_SECONDLINE);
- _tcsncpy(ppd.lptzContactName, msg.contact.c_str(), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzText, strip(msg.message).c_str(), MAX_SECONDLINE);
+ wcsncpy(ppd.lptzContactName, msg.contact.c_str(), MAX_CONTACTNAME);
ppd.colorBack = msg.background;
ppd.colorText = msg.foreground;
ppd.lchIcon = getIcon(msg.icon);
@@ -557,7 +557,7 @@ inline int dehex(int c) {
return 0;
}
-COLORREF parseColor(const std::tstring &buf, bool &ok)
+COLORREF parseColor(const std::wstring &buf, bool &ok)
{
ok = false;
for (int i = 0; i != buf.size(); ++i)
@@ -615,7 +615,7 @@ void loadDefaults(popup_t &msg, char ch)
}
}
-bool parseSimpleMessage(const std::tstring &buf, popup_t &msg, char sep)
+bool parseSimpleMessage(const std::wstring &buf, popup_t &msg, char sep)
{
size_t p = buf.find(sep);
if (p == buf.npos)
@@ -627,18 +627,18 @@ bool parseSimpleMessage(const std::tstring &buf, popup_t &msg, char sep)
return true;
}
-bool parseComplexMessage(const std::tstring &buf, popup_t &msg, char sep)
+bool parseComplexMessage(const std::wstring &buf, popup_t &msg, char sep)
{
- const TCHAR *p = buf.c_str();
- const TCHAR *npos = _tcschr(p, sep);
+ const wchar_t *p = buf.c_str();
+ const wchar_t *npos = wcschr(p, sep);
bool passok = false;
while ((p = npos)) {
++p;
- const TCHAR *cpos = _tcschr(p, ':');
- npos = _tcschr(p, sep);
+ const wchar_t *cpos = wcschr(p, ':');
+ npos = wcschr(p, sep);
- const TCHAR *wend = cpos;
+ const wchar_t *wend = cpos;
if (!wend || npos && npos < wend)
wend = npos;
if (!wend) {
@@ -646,8 +646,8 @@ bool parseComplexMessage(const std::tstring &buf, popup_t &msg, char sep)
return false;
}
- std::tstring what(p, wend);
- std::tstring arg;
+ std::wstring what(p, wend);
+ std::wstring arg;
if (wend == cpos && wend && npos)
arg.assign(cpos + 1, npos);
else if (!cpos)
@@ -714,7 +714,7 @@ bool parseComplexMessage(const std::tstring &buf, popup_t &msg, char sep)
msg.closed = arg;
}
else if (what == L"delay") {
- msg.delay = _ttoi(arg.c_str());
+ msg.delay = _wtoi(arg.c_str());
}
else if (what == L"id") {
msg.id = arg;
@@ -753,21 +753,21 @@ bool parseComplexMessage(const std::tstring &buf, popup_t &msg, char sep)
return true;
}
-bool parseMessage(const std::tstring &abuf, popup_t &msg)
+bool parseMessage(const std::wstring &abuf, popup_t &msg)
{
if (abuf.empty()) {
dbg_msg(L"Empty message ignored.", SM_NOTIFY);
return false;
}
- std::tstring buf = abuf;
+ std::wstring buf = abuf;
char sep = '#';
if (buf.size() >= 3 && !isalnum(buf[0]) && buf[0] == buf[1] && buf[1] == buf[2]) {
sep = buf[0];
buf.erase(0, 3);
}
- if (_tcschr(L"*!%", buf[0]) && sep != buf[0]) {
+ if (wcschr(L"*!%", buf[0]) && sep != buf[0]) {
if (buf.size() < 2) return false;
loadDefaults(msg, buf[0]);
buf.erase(0, 1);
@@ -783,15 +783,15 @@ bool parseMessage(const std::tstring &abuf, popup_t &msg)
return false;
}
-void processMessage(std::tstring buf)
+void processMessage(std::wstring buf)
{
if (g_settings.log_to_file) {
time_t t_;
time(&t_);
tm *t = localtime(&t_);
- FILE *f = _tfopen(g_settings.log_filename.c_str(), L"a");
+ FILE *f = _wfopen(g_settings.log_filename.c_str(), L"a");
if (f) {
- bool err = _ftprintf(f, L"[%04i-%02i-%02i %02i:%02i:%02i] %s\n",
+ bool err = fwprintf(f, L"[%04i-%02i-%02i %02i:%02i:%02i] %s\n",
int(t->tm_year + 1900), int(t->tm_mon + 1), int(t->tm_mday),
int(t->tm_hour), int(t->tm_min), int(t->tm_sec), buf.c_str()) < 0;
if (fclose(f) == EOF || err)
@@ -822,7 +822,7 @@ void processMessage(std::tstring buf)
if (g_settings.use_pcspeaker)
Beep(650, 50);
else {
- std::tstring sname = L"NotifyAnything_" + msg.sound;
+ std::wstring sname = L"NotifyAnything_" + msg.sound;
SkinPlaySound(_T2A(sname.c_str()));
}
}
@@ -891,7 +891,7 @@ void __cdecl udptcpThreadFunc(void *useUdp)
buf[err] = '\0';
if (err > 0)
- processMessage((TCHAR*)_A2T(buf));
+ processMessage((wchar_t*)_A2T(buf));
}
}
else {
@@ -923,7 +923,7 @@ void __cdecl udptcpThreadFunc(void *useUdp)
}
}
if (!totalbuf.empty())
- processMessage((TCHAR*)_A2T(buf));
+ processMessage((wchar_t*)_A2T(buf));
}
}
return;
@@ -981,7 +981,7 @@ extern "C" int __declspec(dllexport) Load()
g_firstrun = true;
mir_getLP(&pluginInfo);
- TCHAR buf[MAX_PATH + 1];
+ wchar_t buf[MAX_PATH + 1];
mir_tstrcpy(buf, L".");
g_mirandaDir = _tgetcwd(buf, MAX_PATH);
diff --git a/plugins/NotifyAnything/src/options.cpp b/plugins/NotifyAnything/src/options.cpp
index 238354357b..42ca149146 100644
--- a/plugins/NotifyAnything/src/options.cpp
+++ b/plugins/NotifyAnything/src/options.cpp
@@ -25,9 +25,9 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
}
{
- TCHAR buf[10];
+ wchar_t buf[10];
SetDlgItemText(hwndDlg, NA_LOG_FILENAME, g_settings.log_filename.c_str());
- SetDlgItemText(hwndDlg, NA_PORT, _itot(g_settings.port, buf, 10));
+ SetDlgItemText(hwndDlg, NA_PORT, _itow(g_settings.port, buf, 10));
SetDlgItemText(hwndDlg, NA_PASSWORD, g_settings.password.c_str());
UINT state;
switch (g_settings.sound) {
@@ -56,7 +56,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
case NA_LOG_BROWSE:
if (HIWORD(wParam) == BN_CLICKED) {
- TCHAR szTemp[MAX_PATH + 1], szTemp1[MAX_PATH + 1], szProfileDir[MAX_PATH + 1];
+ wchar_t szTemp[MAX_PATH + 1], szTemp1[MAX_PATH + 1], szProfileDir[MAX_PATH + 1];
GetDlgItemText(hwndDlg, NA_LOG_FILENAME, szTemp, _countof(szTemp));
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
@@ -107,10 +107,10 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
s.use_pcspeaker = IsDlgButtonChecked(hwndDlg, NA_PCSPEAKER_CHECK) != BST_UNCHECKED;
s.allow_execute = IsDlgButtonChecked(hwndDlg, NA_ALLOW_EXECUTE) != BST_UNCHECKED;
- TCHAR buf[1000];
+ wchar_t buf[1000];
if (!GetDlgItemText(hwndDlg, NA_PORT, buf, _countof(buf)))
buf[0] = '\0';
- int port = _ttoi(buf);
+ int port = _wtoi(buf);
if (port <= 0 || port > 65535)
MessageBox(0, TranslateT("Invalid port number"), TranslateT("NotifyAnything"), MB_ICONWARNING | MB_OK);
else
diff --git a/plugins/NotifyAnything/src/stdafx.h b/plugins/NotifyAnything/src/stdafx.h
index ee5af5344a..497a5666f0 100644
--- a/plugins/NotifyAnything/src/stdafx.h
+++ b/plugins/NotifyAnything/src/stdafx.h
@@ -33,7 +33,7 @@ struct NASettings {
bool local_only, debug_messages, log_to_file, use_pcspeaker, allow_execute;
sound_t sound;
int port;
- std::tstring password, log_filename;
+ std::wstring password, log_filename;
};
extern NASettings g_settings;
@@ -46,5 +46,5 @@ void load_settings();
int OptionsInitialize(WPARAM wParam, LPARAM lParam);
-extern std::tstring g_mirandaDir;
+extern std::wstring g_mirandaDir;
#define LOG_ID LPGEN("NotifyAnything")
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp
index 0c8bff05f9..c474591f69 100644
--- a/plugins/Nudge/src/main.cpp
+++ b/plugins/Nudge/src/main.cpp
@@ -50,7 +50,7 @@ INT_PTR NudgeSend(WPARAM hContact, LPARAM lParam)
char *protoName = GetContactProto(hContact);
int diff = time(NULL) - db_get_dw(hContact, "Nudge", "LastSent", time(NULL) - 30);
if (diff < GlobalNudge.sendTimeSec) {
- TCHAR msg[500];
+ wchar_t msg[500];
mir_sntprintf(msg, TranslateT("You are not allowed to send too much nudge (only 1 each %d sec, %d sec left)"), GlobalNudge.sendTimeSec, 30 - diff);
if (GlobalNudge.useByProtocol) {
for (int i = 0; i < arNudges.getCount(); i++) {
@@ -250,7 +250,7 @@ static int TabsrmmButtonInit(WPARAM, LPARAM)
{
BBButton bbd = { sizeof(bbd) };
bbd.pszModuleName = "Nudge";
- bbd.ptszTooltip = LPGENT("Send Nudge");
+ bbd.ptszTooltip = LPGENW("Send Nudge");
bbd.dwDefPos = 300;
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISLSIDEBUTTON | BBBF_CANBEHIDDEN;
bbd.hIcon = iconList[0].hIcolib;
@@ -341,7 +341,7 @@ extern "C" int __declspec(dllexport) Load(void)
mi.flags = CMIF_NOTOFFLINE | CMIF_TCHAR;
mi.position = -500050004;
mi.hIcolibItem = iconList[0].hIcolib;
- mi.name.t = LPGENT("Send &Nudge");
+ mi.name.w = LPGENW("Send &Nudge");
mi.pszService = MS_NUDGE_SEND;
g_hContactMenu = Menu_AddContactMenuItem(&mi);
@@ -393,7 +393,7 @@ void LoadPopupClass()
POPUPCLASS ppc = { sizeof(ppc) };
ppc.flags = PCF_TCHAR;
ppc.pszName = "Nudge";
- ppc.ptszDescription = LPGENT("Show Nudge");
+ ppc.ptszDescription = LPGENW("Show Nudge");
ppc.hIcon = IcoLib_GetIconByHandle(iconList[0].hIcolib);
ppc.colorBack = NULL;
ppc.colorText = NULL;
@@ -442,17 +442,17 @@ int Preview()
return 0;
}
-void Nudge_ShowPopup(CNudgeElement*, MCONTACT hContact, TCHAR * Message)
+void Nudge_ShowPopup(CNudgeElement*, MCONTACT hContact, wchar_t * Message)
{
hContact = db_mc_tryMeta(hContact);
- TCHAR *lpzContactName = (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *lpzContactName = (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0);
if (ServiceExists(MS_POPUP_ADDPOPUPCLASS)) {
POPUPDATACLASS NudgePopup = { 0 };
NudgePopup.cbSize = sizeof(NudgePopup);
NudgePopup.hContact = hContact;
- NudgePopup.ptszText = Message;
- NudgePopup.ptszTitle = lpzContactName;
+ NudgePopup.pwszText = Message;
+ NudgePopup.pwszTitle = lpzContactName;
NudgePopup.pszClassName = "nudge";
CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&NudgePopup);
}
@@ -466,8 +466,8 @@ void Nudge_ShowPopup(CNudgeElement*, MCONTACT hContact, TCHAR * Message)
NudgePopup.PluginWindowProc = NudgePopupProc;
NudgePopup.PluginData = (void *)1;
- _tcscpy_s(NudgePopup.lptzText, Message);
- _tcscpy_s(NudgePopup.lptzContactName, lpzContactName);
+ wcscpy_s(NudgePopup.lptzText, Message);
+ wcscpy_s(NudgePopup.lptzContactName, lpzContactName);
CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&NudgePopup, 0);
}
@@ -517,14 +517,14 @@ void Nudge_AddAccount(PROTOACCOUNT *proto)
mir_snprintf(p->NudgeSoundname, "%s: Nudge", proto->szModuleName);
strcpy_s(p->ProtocolName, proto->szModuleName);
- _tcscpy_s(p->AccountName, proto->tszAccountName);
+ wcscpy_s(p->AccountName, proto->tszAccountName);
p->Load();
p->hEvent = hevent;
- TCHAR soundDesc[MAXMODULELABELLENGTH + 10];
- mir_sntprintf(soundDesc, LPGENT("Nudge for %s"), proto->tszAccountName);
- SkinAddNewSoundExT(p->NudgeSoundname, LPGENT("Nudge"), soundDesc);
+ wchar_t soundDesc[MAXMODULELABELLENGTH + 10];
+ mir_sntprintf(soundDesc, LPGENW("Nudge for %s"), proto->tszAccountName);
+ SkinAddNewSoundExT(p->NudgeSoundname, LPGENW("Nudge"), soundDesc);
arNudges.insert(p);
}
diff --git a/plugins/Nudge/src/nudge.cpp b/plugins/Nudge/src/nudge.cpp
index 1e0d6a0576..7c0ac3646b 100644
--- a/plugins/Nudge/src/nudge.cpp
+++ b/plugins/Nudge/src/nudge.cpp
@@ -82,19 +82,19 @@ void CNudgeElement::Load(void)
mir_snprintf(SectionName, "%s-recText", ProtocolName);
if (!db_get_ts(NULL, MODULENAME, SectionName, &dbv)) {
- _tcsncpy(this->recText, dbv.ptszVal, TEXT_LEN);
- if (_tcsclen(this->recText) < 1)
- _tcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
+ wcsncpy(this->recText, dbv.ptszVal, TEXT_LEN);
+ if (wcslen(this->recText) < 1)
+ wcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
db_free(&dbv);
}
- else _tcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
+ else wcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
mir_snprintf(SectionName, "%s-senText", ProtocolName);
if (!db_get_ts(NULL, MODULENAME, SectionName, &dbv)) {
- _tcsncpy(this->senText, dbv.ptszVal, TEXT_LEN);
- if (_tcsclen(this->senText) < 1)
- _tcsncpy(this->senText, TranslateT("You sent a nudge"), TEXT_LEN);
+ wcsncpy(this->senText, dbv.ptszVal, TEXT_LEN);
+ if (wcslen(this->senText) < 1)
+ wcsncpy(this->senText, TranslateT("You sent a nudge"), TEXT_LEN);
db_free(&dbv);
}
- else _tcsncpy(this->senText, TranslateT("You sent a nudge"), TEXT_LEN);
+ else wcsncpy(this->senText, TranslateT("You sent a nudge"), TEXT_LEN);
}
diff --git a/plugins/Nudge/src/nudge.h b/plugins/Nudge/src/nudge.h
index 71b3bcd366..d1fd358795 100644
--- a/plugins/Nudge/src/nudge.h
+++ b/plugins/Nudge/src/nudge.h
@@ -31,10 +31,10 @@ struct CNudge
struct CNudgeElement : public MZeroedObject
{
char ProtocolName[64];
- TCHAR AccountName[128];
+ wchar_t AccountName[128];
char NudgeSoundname[100];
- TCHAR recText[TEXT_LEN];
- TCHAR senText[TEXT_LEN];
+ wchar_t recText[TEXT_LEN];
+ wchar_t senText[TEXT_LEN];
bool showPopup;
bool showStatus;
bool openMessageWindow;
diff --git a/plugins/Nudge/src/options.cpp b/plugins/Nudge/src/options.cpp
index eca4c9d061..57dcaf9c0a 100644
--- a/plugins/Nudge/src/options.cpp
+++ b/plugins/Nudge/src/options.cpp
@@ -93,7 +93,7 @@ static INT_PTR CALLBACK DlgProcShakeOpt(HWND hwnd,UINT msg,WPARAM wParam,LPARAM
case WM_INITDIALOG:
TranslateDialogDefault(hwnd);
{
- TCHAR szBuf[20];
+ wchar_t szBuf[20];
mir_sntprintf(szBuf, L"%d", shake.nMoveClist);
SetDlgItemText(hwnd, IDC_LNUMBER_CLIST, szBuf);
mir_sntprintf(szBuf, L"%d", shake.nMoveChat);
@@ -130,7 +130,7 @@ static INT_PTR CALLBACK DlgProcShakeOpt(HWND hwnd,UINT msg,WPARAM wParam,LPARAM
if ((HWND)lParam == GetDlgItem(hwnd, IDC_SNUMBER_CLIST) || (HWND)lParam == GetDlgItem(hwnd, IDC_SNUMBER_CHAT)
|| (HWND)lParam == GetDlgItem(hwnd, IDC_SSCALE_CLIST) || (HWND)lParam == GetDlgItem(hwnd, IDC_SSCALE_CHAT))
{
- TCHAR szBuf[20];
+ wchar_t szBuf[20];
DWORD dwPos = SendMessage((HWND)lParam, TBM_GETPOS, 0, 0);
mir_sntprintf(szBuf, L"%d", dwPos);
if ((HWND)lParam == GetDlgItem(hwnd, IDC_SNUMBER_CLIST))
diff --git a/plugins/Nudge/src/stdafx.h b/plugins/Nudge/src/stdafx.h
index 80422dd571..0ee06f2245 100644
--- a/plugins/Nudge/src/stdafx.h
+++ b/plugins/Nudge/src/stdafx.h
@@ -42,7 +42,7 @@ int Preview();
/*
*
****************************/
-void Nudge_ShowPopup(CNudgeElement*, MCONTACT, TCHAR *);
+void Nudge_ShowPopup(CNudgeElement*, MCONTACT, wchar_t *);
/*
*
diff --git a/plugins/OpenFolder/src/openFolder.cpp b/plugins/OpenFolder/src/openFolder.cpp
index ed9cb35cf4..8c6e7e62ad 100644
--- a/plugins/OpenFolder/src/openFolder.cpp
+++ b/plugins/OpenFolder/src/openFolder.cpp
@@ -29,9 +29,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
static INT_PTR MenuCommand_OpenFolder(WPARAM, LPARAM)
{
- TCHAR szMirandaPath[MAX_PATH];
+ wchar_t szMirandaPath[MAX_PATH];
GetModuleFileName(GetModuleHandle(NULL), szMirandaPath, _countof(szMirandaPath));
- TCHAR *p = _tcsrchr(szMirandaPath, '\\');
+ wchar_t *p = wcsrchr(szMirandaPath, '\\');
if (p)
p[1] = 0;
@@ -91,8 +91,8 @@ extern "C" int __declspec(dllexport) Load()
hotkey.cbSize = sizeof(hotkey);
hotkey.dwFlags = HKD_TCHAR;
hotkey.pszName = "Open Folder";
- hotkey.ptszDescription = LPGENT("Open Folder");
- hotkey.ptszSection = LPGENT("Main");
+ hotkey.ptszDescription = LPGENW("Open Folder");
+ hotkey.ptszSection = LPGENW("Main");
hotkey.pszService = MS_OPENFOLDER_OPEN;
hotkey.DefHotKey = MAKEWORD( 'O', HOTKEYF_SHIFT | HOTKEYF_ALT );
Hotkey_Register(&hotkey);
@@ -102,7 +102,7 @@ extern "C" int __declspec(dllexport) Load()
mi.position = 0x7FFFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = icon.hIcolib;
- mi.name.t = LPGENT("Open Folder");
+ mi.name.w = LPGENW("Open Folder");
mi.pszService = MS_OPENFOLDER_OPEN;
Menu_AddMainMenuItem(&mi);
diff --git a/plugins/OpenSSL/src/ssl_openssl.cpp b/plugins/OpenSSL/src/ssl_openssl.cpp
index d9bcdbd89b..158c7d7c5b 100644
--- a/plugins/OpenSSL/src/ssl_openssl.cpp
+++ b/plugins/OpenSSL/src/ssl_openssl.cpp
@@ -126,7 +126,7 @@ static void ReportSslError(SECURITY_STATUS scRet, int line, bool = false)
break;
default:
- TCHAR szMsgBuf[256];
+ wchar_t szMsgBuf[256];
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, scRet, LANG_USER_DEFAULT, szMsgBuf, _countof(szMsgBuf), NULL);
tszMsg += szMsgBuf;
}
diff --git a/plugins/OpenSSL/src/stdafx.h b/plugins/OpenSSL/src/stdafx.h
index e577d911df..966baded3b 100644
--- a/plugins/OpenSSL/src/stdafx.h
+++ b/plugins/OpenSSL/src/stdafx.h
@@ -27,7 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
typedef struct SslHandle *HSSL;
-#include <tchar.h>
#include <shlobj.h>
#include <delayimp.h>
#include <security.h>
diff --git a/plugins/PackUpdater/Src/Events.cpp b/plugins/PackUpdater/Src/Events.cpp
index ad126ec69b..bc12d5359b 100644
--- a/plugins/PackUpdater/Src/Events.cpp
+++ b/plugins/PackUpdater/Src/Events.cpp
@@ -29,8 +29,8 @@ int ModulesLoaded(WPARAM, LPARAM)
hkd.cbSize = sizeof(hkd);
hkd.dwFlags = HKD_TCHAR;
hkd.pszName = "Check for pack updates";
- hkd.ptszDescription = LPGENT("Check for pack updates");
- hkd.ptszSection = LPGENT("Pack Updater");
+ hkd.ptszDescription = LPGENW("Check for pack updates");
+ hkd.ptszSection = LPGENW("Pack Updater");
hkd.pszService = MODNAME"/CheckUpdates";
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, VK_F10) | HKF_MIRANDA_LOCAL;
hkd.lParam = FALSE;
diff --git a/plugins/PackUpdater/Src/Notifications.cpp b/plugins/PackUpdater/Src/Notifications.cpp
index 9bb3df6958..b22066e480 100644
--- a/plugins/PackUpdater/Src/Notifications.cpp
+++ b/plugins/PackUpdater/Src/Notifications.cpp
@@ -326,8 +326,8 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam
{
vector<FILEINFO> &todo = *(vector<FILEINFO> *)GetWindowLongPtr(hDlg, GWLP_USERDATA);
ShowWindow(hDlg, SW_HIDE);
- TCHAR tszBuff[2048] = { 0 }, tszFileDest[MAX_PATH] = { 0 }, tszFilePathDest[MAX_PATH] = { 0 }, tszFilePathBack[MAX_PATH] = { 0 }, tszFileName[MAX_PATH] = { 0 };
- TCHAR* tszExt = NULL;
+ wchar_t tszBuff[2048] = { 0 }, tszFileDest[MAX_PATH] = { 0 }, tszFilePathDest[MAX_PATH] = { 0 }, tszFilePathBack[MAX_PATH] = { 0 }, tszFileName[MAX_PATH] = { 0 };
+ wchar_t* tszExt = NULL;
char szKey[64] = { 0 };
vector<int> arFileType;
vector<tString> arFilePath;
@@ -426,10 +426,10 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam
rc = MessageBox(NULL, tszBuff, Title, MB_YESNO | MB_ICONQUESTION);
if (rc == IDYES) {
for (int i = 0; i < UpdatesCount; i++) {
- TCHAR* tszUtilRootPlug = NULL;
- TCHAR* tszUtilRootIco = NULL;
- TCHAR* tszUtilRoot = NULL;
- TCHAR tszCurrentDir[MAX_PATH];
+ wchar_t* tszUtilRootPlug = NULL;
+ wchar_t* tszUtilRootIco = NULL;
+ wchar_t* tszUtilRoot = NULL;
+ wchar_t tszCurrentDir[MAX_PATH];
switch (arFileType[i]) {
case 0:
@@ -441,8 +441,8 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam
memset(&pi, 0, sizeof(PROCESS_INFORMATION));
si.cb = sizeof(STARTUPINFO);
{
- _tcsncpy_s(tszCurrentDir, arFilePath[i].c_str(), _TRUNCATE);
- TCHAR *p = _tcsrchr(tszCurrentDir, '\\');
+ wcsncpy_s(tszCurrentDir, arFilePath[i].c_str(), _TRUNCATE);
+ wchar_t *p = wcsrchr(tszCurrentDir, '\\');
if (p) *p = 0;
}
CreateProcess(arFilePath[i].c_str(), L"", NULL, NULL, FALSE, NULL, NULL, tszCurrentDir, &si, &pi);
diff --git a/plugins/PackUpdater/Src/Notifications.h b/plugins/PackUpdater/Src/Notifications.h
index 6a92fb41b9..125e77f98b 100644
--- a/plugins/PackUpdater/Src/Notifications.h
+++ b/plugins/PackUpdater/Src/Notifications.h
@@ -64,9 +64,9 @@ typedef struct tagMYOPTIONS {
} MYOPTIONS;
static struct {
- TCHAR *Text;
+ wchar_t *Text;
int Action;
} PopupActions[] = {
- LPGENT("Close popup"), PCA_CLOSEPOPUP,
- LPGENT("Do nothing"), PCA_DONOTHING
+ LPGENW("Close popup"), PCA_CLOSEPOPUP,
+ LPGENW("Do nothing"), PCA_DONOTHING
};
diff --git a/plugins/PackUpdater/Src/Options.cpp b/plugins/PackUpdater/Src/Options.cpp
index 143cde8828..ef4e41fd39 100644
--- a/plugins/PackUpdater/Src/Options.cpp
+++ b/plugins/PackUpdater/Src/Options.cpp
@@ -390,15 +390,15 @@ int OptInit(WPARAM wParam, LPARAM)
odp.hInstance = hInst;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_UPDATENOTIFY);
- odp.ptszGroup = LPGENT("Services");
- odp.ptszTitle = LPGENT("Pack Updater");
+ odp.pwszGroup = LPGENW("Services");
+ odp.pwszTitle = LPGENW("Pack Updater");
odp.pfnDlgProc = UpdateNotifyOptsProc;
Options_AddPage(wParam, &odp);
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUP);
- odp.ptszGroup = LPGENT("Popups");
- odp.ptszTitle = LPGENT("Pack Updater");
+ odp.pwszGroup = LPGENW("Popups");
+ odp.pwszTitle = LPGENW("Pack Updater");
odp.pfnDlgProc = DlgPopupOpts;
Options_AddPage(wParam, &odp);
}
diff --git a/plugins/PackUpdater/Src/PackUpdater.cpp b/plugins/PackUpdater/Src/PackUpdater.cpp
index c4e3a97cad..eabc12dbba 100644
--- a/plugins/PackUpdater/Src/PackUpdater.cpp
+++ b/plugins/PackUpdater/Src/PackUpdater.cpp
@@ -22,7 +22,7 @@ Boston, MA 02111-1307, USA.
HINSTANCE hInst = NULL;
HANDLE hPackUpdaterFolder = NULL;
-TCHAR tszRoot[MAX_PATH] = { 0 };
+wchar_t tszRoot[MAX_PATH] = { 0 };
int hLangpack;
PLUGININFOEX pluginInfoEx = {
@@ -54,7 +54,7 @@ extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfoEx);
- TCHAR *tszFolder = Utils_ReplaceVarsT(L"%miranda_userdata%\\" DEFAULT_UPDATES_FOLDER);
+ wchar_t *tszFolder = Utils_ReplaceVarsT(L"%miranda_userdata%\\" DEFAULT_UPDATES_FOLDER);
mir_tstrncpy(tszRoot, tszFolder, _countof(tszRoot));
hPackUpdaterFolder = FoldersRegisterCustomPathT(MODULEA, LPGEN("Pack Updater"), MIRANDA_USERDATAT L"\\" DEFAULT_UPDATES_FOLDER);
@@ -75,7 +75,7 @@ extern "C" __declspec(dllexport) int Load(void)
mi.position = -0x7FFFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = IcoLib_GetIcon("check_update");
- mi.name.t = LPGENT("Check for pack updates");
+ mi.name.w = LPGENW("Check for pack updates");
mi.pszService = MODNAME"/CheckUpdates";
Menu_AddMainMenuItem(&mi);
// Add empty updates folder menu item
@@ -85,7 +85,7 @@ extern "C" __declspec(dllexport) int Load(void)
mi.position = -0x7FFFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = IcoLib_GetIcon("empty_folder");
- mi.name.t = LPGENT("Clear pack updates folder");
+ mi.name.w = LPGENW("Clear pack updates folder");
mi.pszService = MODNAME"/EmptyFolder";
Menu_AddMainMenuItem(&mi);
diff --git a/plugins/PackUpdater/Src/Utils.cpp b/plugins/PackUpdater/Src/Utils.cpp
index 622ee25cab..62fa5d83e1 100644
--- a/plugins/PackUpdater/Src/Utils.cpp
+++ b/plugins/PackUpdater/Src/Utils.cpp
@@ -25,7 +25,7 @@ INT FileCount = 0, CurrentFile = 0, Number = 0;
BYTE Reminder, AutoUpdate;
BYTE UpdateOnStartup, UpdateOnPeriod, OnlyOnceADay, PeriodMeasure;
INT Period;
-TCHAR tszDialogMsg[2048] = { 0 };
+wchar_t tszDialogMsg[2048] = { 0 };
FILEINFO* pFileInfo = NULL;
FILEURL* pFileUrl = NULL;
HANDLE hCheckThread = NULL, hNetlibUser = NULL;
@@ -162,7 +162,7 @@ BOOL Exists(LPCTSTR strName)
return GetFileAttributes(strName) != INVALID_FILE_ATTRIBUTES;
}
-BOOL IsPluginDisabled(TCHAR* filename)
+BOOL IsPluginDisabled(wchar_t* filename)
{
char* fname = mir_t2a(filename);
int res = db_get_b(NULL, "PluginDisable", fname, 0);
@@ -170,16 +170,16 @@ BOOL IsPluginDisabled(TCHAR* filename)
return res;
}
-size_t getVer(const TCHAR* verStr)
+size_t getVer(const wchar_t* verStr)
{
int v1 = 0, v2 = 0, v3 = 0, v4 = 0;
- _stscanf(verStr, L"%d.%d.%d.%d", &v1, &v2, &v3, &v4);
+ swscanf(verStr, L"%d.%d.%d.%d", &v1, &v2, &v3, &v4);
return v1 * 10000000 + v2 * 100000 + v3 * 1000 + v4;
}
static void CheckUpdates(void *)
{
- TCHAR tszBuff[2048] = { 0 }, tszFileInfo[30] = { 0 }, tszTmpIni[MAX_PATH] = { 0 };
+ wchar_t tszBuff[2048] = { 0 }, tszFileInfo[30] = { 0 }, tszTmpIni[MAX_PATH] = { 0 };
char szKey[64] = { 0 };
vector<FILEINFO> UpdateFiles;
@@ -246,7 +246,7 @@ static void CheckUpdates(void *)
GetPrivateProfileString(tszFileInfo, L"Descr", L"", Files[CurrentFile].tszDescr, _countof(Files[CurrentFile].tszDescr), tszTmpIni);
GetPrivateProfileString(tszFileInfo, L"DiskFileName", L"", tszBuff, MAX_PATH, tszTmpIni);
- if (_tcsstr(tszBuff, L"\\")) { //check update name
+ if (wcsstr(tszBuff, L"\\")) { //check update name
Title = TranslateT("Pack Updater");
Text = TranslateT("Name of Update's file is not supported.");
if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups1", DEFAULT_POPUP_ENABLED)) {
@@ -268,7 +268,7 @@ static void CheckUpdates(void *)
mir_sntprintf(tszBuff, L"Plugins\\%s", Files[CurrentFile].File.tszDiskPath);
else
mir_sntprintf(tszBuff, L"Plugins\\%s\\%s", Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
- TCHAR pluginFolderName[MAX_PATH];
+ wchar_t pluginFolderName[MAX_PATH];
PathToAbsoluteT(tszBuff, pluginFolderName);
if (!Files[CurrentFile].Force && (IsPluginDisabled(Files[CurrentFile].File.tszDiskPath) || !Exists(pluginFolderName))) //check if plugin disabled or not exists
continue;
@@ -278,7 +278,7 @@ static void CheckUpdates(void *)
VARST tszSysRoot(L"%SystemRoot%");
VARST tszProgFiles(L"%ProgramFiles%");
- if (Files[CurrentFile].FileType != 1 && !IsUserAnAdmin() && (_tcsstr(tszRoot, tszSysRoot) || _tcsstr(tszRoot, tszProgFiles))) {
+ if (Files[CurrentFile].FileType != 1 && !IsUserAnAdmin() && (wcsstr(tszRoot, tszSysRoot) || wcsstr(tszRoot, tszProgFiles))) {
MessageBox(NULL, TranslateT("Update is not possible!\nYou have no Administrator's rights.\nPlease run Miranda NG with Administrator's rights."), Title, MB_ICONINFORMATION);
DeleteFile(tszTmpIni);
hCheckThread = NULL;
@@ -286,7 +286,7 @@ static void CheckUpdates(void *)
} // user have not admin's rights
//äîáàâèòü ïðîâåðêó íà ñóùåñòâîâàíèå ôàéëà
- TCHAR tszFilePathDest[MAX_PATH] = { 0 };
+ wchar_t tszFilePathDest[MAX_PATH] = { 0 };
switch (Files[CurrentFile].FileType) {
case 0:
case 1:
@@ -309,7 +309,7 @@ static void CheckUpdates(void *)
break;
case 4:
case 5: {
- TCHAR *tszUtilRoot = VARST(L"%miranda_path%");
+ wchar_t *tszUtilRoot = VARST(L"%miranda_path%");
if (mir_tstrcmp(Files[CurrentFile].tszAdvFolder, L"") == 0)
mir_sntprintf(tszFilePathDest, L"%s\\%s", tszUtilRoot, Files[CurrentFile].File.tszDiskPath);
else
diff --git a/plugins/PackUpdater/Src/stdafx.h b/plugins/PackUpdater/Src/stdafx.h
index 4c8786e114..e1c681cc64 100644
--- a/plugins/PackUpdater/Src/stdafx.h
+++ b/plugins/PackUpdater/Src/stdafx.h
@@ -51,19 +51,19 @@ typedef std::wstring tString;
struct FILEURL
{
- TCHAR tszDownloadURL[2048];
- TCHAR tszDiskPath[MAX_PATH];
+ wchar_t tszDownloadURL[2048];
+ wchar_t tszDiskPath[MAX_PATH];
};
struct FILEINFO
{
- TCHAR tszCurVer[16];
- TCHAR tszNewVer[16];
- TCHAR tszLastVer[16];
- TCHAR tszAdvFolder[256];
- TCHAR tszInfoURL[2048];
- TCHAR tszMessage[5000];
- TCHAR tszDescr[256];
+ wchar_t tszCurVer[16];
+ wchar_t tszNewVer[16];
+ wchar_t tszLastVer[16];
+ wchar_t tszAdvFolder[256];
+ wchar_t tszInfoURL[2048];
+ wchar_t tszMessage[5000];
+ wchar_t tszDescr[256];
FILEURL File;
BOOL enabled;
BYTE FileType;
@@ -91,7 +91,7 @@ extern HINSTANCE hInst;
extern INT FileCount, CurrentFile, Number, UpdatesCount, Period;
extern BOOL Silent, DlgDld;
extern BYTE Reminder, UpdateOnStartup, UpdateOnPeriod, OnlyOnceADay, PeriodMeasure;
-extern TCHAR tszRoot[MAX_PATH], tszDialogMsg[2048];
+extern wchar_t tszRoot[MAX_PATH], tszDialogMsg[2048];
extern FILEINFO* pFileInfo;
extern FILEURL* pFileUrl;
extern HANDLE hCheckThread;
diff --git a/plugins/PasteIt/src/Options.cpp b/plugins/PasteIt/src/Options.cpp
index 61d4c27130..628fdd9182 100644
--- a/plugins/PasteIt/src/Options.cpp
+++ b/plugins/PasteIt/src/Options.cpp
@@ -23,30 +23,30 @@ Options *Options::instance;
struct TCpTable
{
UINT cpId;
- TCHAR *cpName;
+ wchar_t *cpName;
}
cpTable[] = {
- { CP_ACP, LPGENT("Use default codepage") },
- { CP_UTF8, LPGENT("UTF-8") },
- { 874, LPGENT("Thai") },
- { 932, LPGENT("Japanese") },
- { 936, LPGENT("Simplified Chinese") },
- { 949, LPGENT("Korean") },
- { 950, LPGENT("Traditional Chinese") },
- { 1250, LPGENT("Central European") },
- { 1251, LPGENT("Cyrillic") },
- { 20866, LPGENT("Cyrillic KOI8-R") },
- { 1252, LPGENT("Latin I") },
- { 1253, LPGENT("Greek") },
- { 1254, LPGENT("Turkish") },
- { 1255, LPGENT("Hebrew") },
- { 1256, LPGENT("Arabic") },
- { 1257, LPGENT("Baltic") },
- { 1258, LPGENT("Vietnamese") },
- { 1361, LPGENT("Korean (Johab)") },
- { CP_UTF7, LPGENT("UTF-7") },
- { 1200, LPGENT("UTF-16") },
- { 1201, LPGENT("UTF-16BE") }
+ { CP_ACP, LPGENW("Use default codepage") },
+ { CP_UTF8, LPGENW("UTF-8") },
+ { 874, LPGENW("Thai") },
+ { 932, LPGENW("Japanese") },
+ { 936, LPGENW("Simplified Chinese") },
+ { 949, LPGENW("Korean") },
+ { 950, LPGENW("Traditional Chinese") },
+ { 1250, LPGENW("Central European") },
+ { 1251, LPGENW("Cyrillic") },
+ { 20866, LPGENW("Cyrillic KOI8-R") },
+ { 1252, LPGENW("Latin I") },
+ { 1253, LPGENW("Greek") },
+ { 1254, LPGENW("Turkish") },
+ { 1255, LPGENW("Hebrew") },
+ { 1256, LPGENW("Arabic") },
+ { 1257, LPGENW("Baltic") },
+ { 1258, LPGENW("Vietnamese") },
+ { 1361, LPGENW("Korean (Johab)") },
+ { CP_UTF7, LPGENW("UTF-7") },
+ { 1200, LPGENW("UTF-16") },
+ { 1201, LPGENW("UTF-16BE") }
};
Options::Options()
@@ -209,7 +209,7 @@ void GetPagesSettings(HWND hwndDlg, OptsPagesData* optsPagesData)
optsPagesData->webOptions[selected]->pastebinUserKey = L"";
}
else {
- TCHAR buf[100];
+ wchar_t buf[100];
Edit_GetText(GetDlgItem(hwndDlg, IDC_PASTEBIN_KEY), buf, 100);
optsPagesData->webOptions[selected]->pastebinUserKey = buf;
}
@@ -584,7 +584,7 @@ INT_PTR CALLBACK Options::DlgProcOptsLogin(HWND hwndDlg, UINT msg, WPARAM wParam
{
if (HIWORD(wParam) == BN_CLICKED) {
if (LOWORD(wParam) == IDOK) {
- TCHAR buf[100];
+ wchar_t buf[100];
OptsLoginData* optsLoginData = (OptsLoginData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
Edit_GetText(GetDlgItem(hwndDlg, IDC_PASTEBIN_USER), buf, 100);
optsLoginData->user = buf;
@@ -611,10 +611,10 @@ unsigned int Options::GetCodepageCB(HWND hwndCB, bool errorReport, unsigned int
{
int selCpIdx = ComboBox_GetCurSel(hwndCB);
if (selCpIdx < 0) {
- TCHAR text[128];
+ wchar_t text[128];
ComboBox_GetText(hwndCB, text, 128);
- TCHAR * stopOn = NULL;
- long cp = _tcstol(text, &stopOn, 10);
+ wchar_t * stopOn = NULL;
+ long cp = wcstol(text, &stopOn, 10);
if (errorReport && (stopOn == text || *stopOn != '\0' || cp < 0 || cp > 0xffff)) {
MessageBox(GetParent(hwndCB), TranslateT("You've entered invalid codepage. Select codepage from combo box or enter correct number."), TranslateT("Invalid codepage"), MB_OK | MB_ICONERROR);
SetFocus(hwndCB);
@@ -645,7 +645,7 @@ void Options::InitCodepageCB(HWND hwndCB, unsigned int codepage)
}
if (selCpIdx == -1) {
- TCHAR buf[10];
+ wchar_t buf[10];
mir_sntprintf(buf, L"%d", codepage);
ComboBox_SetText(hwndCB, buf);
}
@@ -666,7 +666,7 @@ void Options::SetCodepageCB(HWND hwndCB, unsigned int codepage)
}
if (selCpIdx == -1) {
- TCHAR buf[10];
+ wchar_t buf[10];
mir_sntprintf(buf, L"%d", codepage);
ComboBox_SetText(hwndCB, buf);
}
@@ -681,15 +681,15 @@ int Options::InitOptions(WPARAM wParam, LPARAM)
odp.position = 100000000;
odp.hInstance = hInst;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.ptszTitle = LPGENT("Paste It");
- odp.ptszGroup = LPGENT("Services");
+ odp.pwszTitle = LPGENW("Paste It");
+ odp.pwszGroup = LPGENW("Services");
- odp.ptszTab = LPGENT("Main");
+ odp.pwszTab = LPGENW("Main");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MAIN);
odp.pfnDlgProc = Options::DlgProcOptsMain;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Web page");
+ odp.pwszTab = LPGENW("Web page");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_PAGES);
odp.pfnDlgProc = Options::DlgProcOptsPages;
Options_AddPage(wParam, &odp);
@@ -705,7 +705,7 @@ void Options::Save()
db_set_b(0, MODULE, "autoSend", autoSend ? 1 : 0);
for (int i = 0; i < PasteToWeb::pages; ++i) {
char buf[256];
- TCHAR* name = pasteToWebs[i]->GetName();
+ wchar_t* name = pasteToWebs[i]->GetName();
int j = 0;
while (name[j]) {
buf[j] = (char)name[j];
@@ -766,7 +766,7 @@ void Options::Load()
char buf[256];
int j = 0;
{
- TCHAR *name = pasteToWebs[i]->GetName();
+ wchar_t *name = pasteToWebs[i]->GetName();
while (name[j]) {
buf[j] = (char)name[j];
++j;
diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp
index d852b79f42..6c96d4d1ba 100644
--- a/plugins/PasteIt/src/PasteIt.cpp
+++ b/plugins/PasteIt/src/PasteIt.cpp
@@ -70,10 +70,10 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
std::wstring GetFile()
{
- TCHAR filter[512];
+ wchar_t filter[512];
mir_tstrncpy(filter, TranslateT("All Files (*.*)"), _countof(filter));
- memcpy(filter + mir_tstrlen(filter), L"\0*.*\0", 6 * sizeof(TCHAR));
- TCHAR stzFilePath[1024];
+ memcpy(filter + mir_tstrlen(filter), L"\0*.*\0", 6 * sizeof(wchar_t));
+ wchar_t stzFilePath[1024];
stzFilePath[0] = 0;
stzFilePath[1] = 0;
OPENFILENAME ofn = { 0 };
@@ -297,7 +297,7 @@ void InitMenuItems()
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = icon.hIcolib;
mi.position = 3000090005;
- mi.name.t = LPGENT("Paste It");
+ mi.name.w = LPGENW("Paste It");
hContactMenu = Menu_AddContactMenuItem(&mi);
memset(&mi, 0, sizeof(mi));
@@ -305,15 +305,15 @@ void InitMenuItems()
mi.flags = CMIF_TCHAR;
mi.pszService = MS_PASTEIT_CONTACTMENU;
mi.root = hContactMenu;
- mi.name.t = LPGENT("Paste from clipboard");
+ mi.name.w = LPGENW("Paste from clipboard");
Menu_ConfigureItem(Menu_AddContactMenuItem(&mi), MCI_OPT_EXECPARAM, FROM_CLIPBOARD);
SET_UID(mi, 0x7af7c3cb, 0xedc4, 0x4f3e, 0xb5, 0xe1, 0x42, 0x64, 0x5b, 0x7d, 0xd8, 0x1e);
- mi.name.t = LPGENT("Paste from file");
+ mi.name.w = LPGENW("Paste from file");
Menu_ConfigureItem(Menu_AddContactMenuItem(&mi), MCI_OPT_EXECPARAM, FROM_FILE);
SET_UID(mi, 0xe58410ad, 0xa723, 0x48b9, 0xab, 0x7e, 0x5e, 0x42, 0x8b, 0x8, 0x32, 0x2f);
- mi.name.t = LPGENT("Default web page");
+ mi.name.w = LPGENW("Default web page");
HGENMENU hDefWebMenu = Menu_AddContactMenuItem(&mi);
Menu_ConfigureItem(hDefWebMenu, MCI_OPT_EXECPARAM, DEF_PAGES_START - 1);
@@ -325,7 +325,7 @@ void InitMenuItems()
mi2.flags = CMIF_TCHAR | CMIF_UNMOVABLE;
if (Options::instance->defWeb == i)
mi2.flags |= CMIF_CHECKED;
- mi2.name.t = pasteToWebs[i]->GetName();
+ mi2.name.w = pasteToWebs[i]->GetName();
hWebPageMenus[i] = Menu_AddContactMenuItem(&mi2);
Menu_ConfigureItem(hWebPageMenus[i], MCI_OPT_EXECPARAM, mi2.position = DEF_PAGES_START + i);
}
diff --git a/plugins/PasteIt/src/PasteToWeb.h b/plugins/PasteIt/src/PasteToWeb.h
index 51e2141790..fdedc388ac 100644
--- a/plugins/PasteIt/src/PasteToWeb.h
+++ b/plugins/PasteIt/src/PasteToWeb.h
@@ -30,14 +30,14 @@ protected:
virtual void SendToServer(std::wstring str, std::wstring fileName, std::wstring format) = 0;
wchar_t* SendToWeb(char* url, std::map<std::string, std::string>& headers, std::wstring content);
PasteToWeb();
- TCHAR bufErr[1024];
+ wchar_t bufErr[1024];
public:
virtual ~PasteToWeb();
char szFileLink[256];
- TCHAR* error;
+ wchar_t* error;
void FromClipboard();
void FromFile(std::wstring file);
- virtual TCHAR* GetName() = 0;
+ virtual wchar_t* GetName() = 0;
virtual void ConfigureSettings() = 0;
int pageIndex;
virtual std::list<PasteFormat> GetFormats() = 0;
diff --git a/plugins/PasteIt/src/PasteToWeb1.h b/plugins/PasteIt/src/PasteToWeb1.h
index 79c9f7dc06..50f835af4f 100644
--- a/plugins/PasteIt/src/PasteToWeb1.h
+++ b/plugins/PasteIt/src/PasteToWeb1.h
@@ -28,7 +28,7 @@ protected:
public:
PasteToWeb1();
virtual ~PasteToWeb1();
- virtual TCHAR* GetName()
+ virtual wchar_t* GetName()
{
return L"pastebin.com";
}
diff --git a/plugins/PasteIt/src/PasteToWeb2.h b/plugins/PasteIt/src/PasteToWeb2.h
index 6bbee7b455..891c92223f 100644
--- a/plugins/PasteIt/src/PasteToWeb2.h
+++ b/plugins/PasteIt/src/PasteToWeb2.h
@@ -27,7 +27,7 @@ protected:
public:
PasteToWeb2();
virtual ~PasteToWeb2();
- virtual TCHAR* GetName()
+ virtual wchar_t* GetName()
{
return L"wklej.to";
}
diff --git a/plugins/Ping/src/log.cpp b/plugins/Ping/src/log.cpp
index 59538f577e..01bb07e671 100644
--- a/plugins/Ping/src/log.cpp
+++ b/plugins/Ping/src/log.cpp
@@ -2,7 +2,7 @@
INT_PTR Log(WPARAM wParam, LPARAM) {
- TCHAR buf[1024], tbuf[512], dbuf[512];
+ wchar_t buf[1024], tbuf[512], dbuf[512];
CallService(PLUG "/GetLogFilename", (WPARAM)1024, (LPARAM)buf);
//char TBcapt[255];
@@ -13,15 +13,15 @@ INT_PTR Log(WPARAM wParam, LPARAM) {
GetTimeFormat(LOCALE_USER_DEFAULT, 0, &systime, 0, tbuf, 512);
GetDateFormat(LOCALE_USER_DEFAULT, 0, &systime, 0, dbuf, 512);
- TCHAR *line = (TCHAR *)wParam;
+ wchar_t *line = (wchar_t *)wParam;
- FILE *f = _tfopen(buf, L"a+");
+ FILE *f = _wfopen(buf, L"a+");
if (f) {
if (options.log_csv) {
- _ftprintf(f, L"%s, %s, %s\n", dbuf, tbuf, line);
+ fwprintf(f, L"%s, %s, %s\n", dbuf, tbuf, line);
}
else {
- _ftprintf(f, L"%s, %s: %s\n", dbuf, tbuf, line);
+ fwprintf(f, L"%s, %s: %s\n", dbuf, tbuf, line);
}
fclose(f);
}
@@ -31,7 +31,7 @@ INT_PTR Log(WPARAM wParam, LPARAM) {
INT_PTR GetLogFilename(WPARAM wParam, LPARAM lParam) {
DBVARIANT dbv;
- TCHAR *filename = (TCHAR *)lParam;
+ wchar_t *filename = (wchar_t *)lParam;
if (db_get_ts(0, PLUG, "LogFilename", &dbv)) {
CallService(MS_DB_GETPROFILEPATHT, wParam, (LPARAM)filename);
mir_tstrncat(filename, L"\\ping_log.txt", wParam - mir_tstrlen(filename));
@@ -41,18 +41,18 @@ INT_PTR GetLogFilename(WPARAM wParam, LPARAM lParam) {
db_free(&dbv);
}
- ((TCHAR *)lParam)[wParam - 1] = 0;
+ ((wchar_t *)lParam)[wParam - 1] = 0;
return 0;
}
INT_PTR SetLogFilename(WPARAM, LPARAM lParam) {
- db_set_ts(0, PLUG, "LogFilename", (TCHAR *)lParam);
+ db_set_ts(0, PLUG, "LogFilename", (wchar_t *)lParam);
return 0;
}
INT_PTR ViewLogData(WPARAM wParam, LPARAM) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
CallService(PLUG "/GetLogFilename", (WPARAM)MAX_PATH, (LPARAM)buf);
return (INT_PTR)ShellExecute((HWND)wParam, L"edit", buf, L"", L"", SW_SHOW);
}
diff --git a/plugins/Ping/src/menu.cpp b/plugins/Ping/src/menu.cpp
index 4d886697dc..1fd1ce70dd 100644
--- a/plugins/Ping/src/menu.cpp
+++ b/plugins/Ping/src/menu.cpp
@@ -8,20 +8,20 @@ void InitMenus()
// main menu
CMenuItem mi;
mi.flags = CMIF_TCHAR;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Ping"), 500099900);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Ping"), 500099900);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "FF273885-6AEC-4C8A-B8BC-9247D920F223");
SET_UID(mi, 0xc9a4d17a, 0xd5fa, 0x40d9, 0xbe, 0x7b, 0x9e, 0x2e, 0x5b, 0xbf, 0x8, 0x59);
mi.position = 2000060000;
mi.hIcolibItem = hIconResponding;
- mi.name.t = LPGENT("Enable all pings");
+ mi.name.w = LPGENW("Enable all pings");
mi.pszService = PLUG "/EnableAll";
Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0x1dac6ea6, 0x116e, 0x41a3, 0xa6, 0xe8, 0x42, 0xdf, 0xf7, 0x27, 0xc4, 0x7c);
mi.position = 2000060001;
mi.hIcolibItem = hIconDisabled;
- mi.name.t = LPGENT("Disable all pings");
+ mi.name.w = LPGENW("Disable all pings");
mi.pszService = PLUG "/DisableAll";
Menu_AddMainMenuItem(&mi);
}
diff --git a/plugins/Ping/src/options.cpp b/plugins/Ping/src/options.cpp
index 56e501ee40..853473e3cc 100644
--- a/plugins/Ping/src/options.cpp
+++ b/plugins/Ping/src/options.cpp
@@ -81,7 +81,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
break;
case IDC_BTN_LOGBROWSE:
{
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
mir_sntprintf(filter, L"%s%c*.txt%c%s%c*.*%c", TranslateT("Text Files (*.txt)"), 0, 0, TranslateT("All Files"), 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
@@ -169,7 +169,7 @@ INT_PTR CALLBACK DlgProcDestEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM)
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
- TCHAR *ret = pcli->pfnGetStatusModeDescription(i, 0);
+ wchar_t *ret = pcli->pfnGetStatusModeDescription(i, 0);
SendDlgItemMessage(hwndDlg, IDC_COMBO_DESTSTAT, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)ret);
SendDlgItemMessage(hwndDlg, IDC_COMBO_DESTSTAT2, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)ret);
}
@@ -506,15 +506,15 @@ int PingOptInit(WPARAM wParam, LPARAM)
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.ptszGroup = LPGENT("Network");
- odp.ptszTitle = LPGENT("Ping");
+ odp.pwszGroup = LPGENW("Network");
+ odp.pwszTitle = LPGENW("Ping");
- odp.ptszTab = LPGENT("Settings");
+ odp.pwszTab = LPGENW("Settings");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG1);
odp.pfnDlgProc = DlgProcOpts;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Hosts");
+ odp.pwszTab = LPGENW("Hosts");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG2);
odp.pfnDlgProc = DlgProcOpts2;
Options_AddPage(wParam, &odp);
diff --git a/plugins/Ping/src/pinggraph.cpp b/plugins/Ping/src/pinggraph.cpp
index bb9b2f94b3..a303aae062 100644
--- a/plugins/Ping/src/pinggraph.cpp
+++ b/plugins/Ping/src/pinggraph.cpp
@@ -187,7 +187,7 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
SetBkMode(hdc, TRANSPARENT);
SetTextColor(hdc, GetSysColor(COLOR_3DDKSHADOW));
- TCHAR buff[64];
+ wchar_t buff[64];
if (wd->show_grid)
{
mir_sntprintf(buff, TranslateT("%d ms"), MARK_TIME);
@@ -275,11 +275,11 @@ INT_PTR ShowGraph(WPARAM wParam, LPARAM lParam) {
wndclass.lpszClassName = _T(PLUG) L"GraphWindow";
RegisterClass(&wndclass);
- TCHAR title[256];
+ wchar_t title[256];
mir_tstrncpy(title, TranslateT("Ping Graph"), _countof(title));
if (lParam) {
mir_tstrncat(title, L" - ", _countof(title) - mir_tstrlen(title));
- mir_tstrncat(title, (TCHAR *)lParam, _countof(title) - mir_tstrlen(title));
+ mir_tstrncat(title, (wchar_t *)lParam, _countof(title) - mir_tstrlen(title));
}
HWND parent = 0;
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp
index 16a160387b..76fab1eb0e 100644
--- a/plugins/Ping/src/pingthread.cpp
+++ b/plugins/Ping/src/pingthread.cpp
@@ -55,7 +55,7 @@ void set_list_changed(bool f)
list_changed = f;
}
-void SetProtoStatus(TCHAR *pszLabel, char *pszProto, int if_status, int new_status)
+void SetProtoStatus(wchar_t *pszLabel, char *pszProto, int if_status, int new_status)
{
if (mir_strcmp(pszProto, Translate("<all>")) == 0) {
int num_protocols;
@@ -69,7 +69,7 @@ void SetProtoStatus(TCHAR *pszLabel, char *pszProto, int if_status, int new_stat
if (ProtoServiceExists(pszProto, PS_GETSTATUS)) {
if (CallProtoService(pszProto, PS_GETSTATUS, 0, 0) == if_status) {
if (options.logging) {
- TCHAR buf[1024];
+ wchar_t buf[1024];
mir_sntprintf(buf, TranslateT("%s - setting status of protocol '%S' (%d)"), pszLabel, pszProto, new_status);
CallService(PLUG "/Log", (WPARAM)buf, 0);
}
@@ -194,7 +194,7 @@ void __cdecl sttCheckStatusThreadProc(void*)
}
}
if (pa.miss_count == -1 - options.retries && options.logging) {
- TCHAR buf[512];
+ wchar_t buf[512];
mir_sntprintf(buf, TranslateT("%s - reply, %d"), pa.pszLabel, pa.round_trip_time);
CallService(PLUG "/Log", (WPARAM)buf, 0);
}
@@ -208,7 +208,7 @@ void __cdecl sttCheckStatusThreadProc(void*)
ShowPopup(TranslateT("Ping Timeout"), pa.pszLabel, 0);
}
if (pa.miss_count == 1 + options.retries && options.logging) {
- TCHAR buf[512];
+ wchar_t buf[512];
mir_sntprintf(buf, TranslateT("%s - timeout"), pa.pszLabel);
CallService(PLUG "/Log", (WPARAM)buf, 0);
}
@@ -306,7 +306,7 @@ INT_PTR PingPlugShowWindow(WPARAM, LPARAM)
void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
{
if (frame_id != -1 && ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
- TCHAR TBcapt[255];
+ wchar_t TBcapt[255];
if (total > 0)
mir_sntprintf(TBcapt, L"Ping (%d/%d)", upCount, total);
else
@@ -388,7 +388,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
TextOut(dis->hDC, dis->rcItem.left + 16 + 4, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, itemData.pszLabel, (int)mir_tstrlen(itemData.pszLabel));
if (itemData.status != PS_DISABLED) {
- TCHAR buf[256];
+ wchar_t buf[256];
if (itemData.responding) {
mir_sntprintf(buf, TranslateT("%d ms"), itemData.round_trip_time);
GetTextExtentPoint32(dis->hDC, buf, (int)mir_tstrlen(buf), &textSize);
@@ -716,7 +716,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
if (wake) SetEvent(hWakeEvent);
if (options.logging) {
- TCHAR buf[1024];
+ wchar_t buf[1024];
mir_sntprintf(buf, L"%s - %s", pItemData->pszLabel, (wake ? TranslateT("enabled") : TranslateT("double clicked")));
CallService(PLUG "/Log", (WPARAM)buf, 0);
}
@@ -902,13 +902,13 @@ void InitList()
CreateServiceFunction(PLUG "/ShowWindow", PingPlugShowWindow);
CMenuItem mi;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Ping"), 1000200001);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Ping"), 1000200001);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "7CFBF239-86B5-48B2-8D5B-39E09A7DB514");
SET_UID(mi, 0x4adbd753, 0x27d6, 0x457a, 0xa6, 0x6, 0xdf, 0x4f, 0x2c, 0xd8, 0xb9, 0x3b);
mi.flags = CMIF_TCHAR;
mi.position = 3000320001;
- mi.name.t = LPGENT("Show/Hide &Ping Window");
+ mi.name.w = LPGENW("Show/Hide &Ping Window");
mi.pszService = PLUG "/ShowWindow";
Menu_AddMainMenuItem(&mi);
@@ -917,8 +917,8 @@ void InitList()
}
font_id.cbSize = sizeof(FontIDT);
- mir_tstrncpy(font_id.group, LPGENT("Ping"), _countof(font_id.group));
- mir_tstrncpy(font_id.name, LPGENT("List"), _countof(font_id.name));
+ mir_tstrncpy(font_id.group, LPGENW("Ping"), _countof(font_id.group));
+ mir_tstrncpy(font_id.name, LPGENW("List"), _countof(font_id.name));
mir_strncpy(font_id.dbSettingsGroup, "PING", _countof(font_id.dbSettingsGroup));
mir_strncpy(font_id.prefix, "Font", _countof(font_id.prefix));
mir_tstrncpy(font_id.backgroundGroup, L"Ping", _countof(font_id.backgroundGroup));
diff --git a/plugins/Ping/src/stdafx.h b/plugins/Ping/src/stdafx.h
index 746a2d596b..1e92a443d8 100644
--- a/plugins/Ping/src/stdafx.h
+++ b/plugins/Ping/src/stdafx.h
@@ -56,7 +56,7 @@
typedef struct {
int ping_period, ping_timeout;
bool show_popup, show_popup2, block_reps, logging;
- TCHAR log_filename[MAX_PATH];
+ wchar_t log_filename[MAX_PATH];
bool no_test_icon;
int row_height;
int indent;
@@ -83,16 +83,16 @@ typedef LinkedList< HistPair > HistoryList;
struct PINGADDRESS {
int cbSize; //size in bytes of this structure
DWORD item_id;
- TCHAR pszName[MAX_PINGADDRESS_STRING_LENGTH]; //IP address or domain name
- TCHAR pszLabel[MAX_PINGADDRESS_STRING_LENGTH];
+ wchar_t pszName[MAX_PINGADDRESS_STRING_LENGTH]; //IP address or domain name
+ wchar_t pszLabel[MAX_PINGADDRESS_STRING_LENGTH];
bool responding;
int status;
short round_trip_time;
int miss_count;
int port; // -1 for ICMP, non-zero for TCP
char pszProto[MAX_PINGADDRESS_STRING_LENGTH];
- TCHAR pszCommand[MAX_PATH];
- TCHAR pszParams[MAX_PATH];
+ wchar_t pszCommand[MAX_PATH];
+ wchar_t pszParams[MAX_PATH];
unsigned int get_status; // on success, if status equals this
unsigned int set_status; // set it to this
int index;
diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp
index dedd9cf470..c5f99d431d 100644
--- a/plugins/Ping/src/utils.cpp
+++ b/plugins/Ping/src/utils.cpp
@@ -26,7 +26,7 @@ void CALLBACK sttMainThreadCallback(ULONG_PTR dwParam)
free(ppd);
}
-void __stdcall ShowPopup(TCHAR *line1, TCHAR *line2, int flags)
+void __stdcall ShowPopup(wchar_t *line1, wchar_t *line2, int flags)
{
if (CallService(MS_SYSTEM_TERMINATED, 0, 0)) return;
diff --git a/plugins/Ping/src/utils.h b/plugins/Ping/src/utils.h
index f3be0598b6..d084a4ae9a 100644
--- a/plugins/Ping/src/utils.h
+++ b/plugins/Ping/src/utils.h
@@ -1,7 +1,7 @@
#ifndef _PING_UTILS
#define _PING_UTILS
-void __stdcall ShowPopup(TCHAR *line1, TCHAR *line2, int flags);
+void __stdcall ShowPopup(wchar_t *line1, wchar_t *line2, int flags);
INT_PTR PluginPing(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/PluginUpdater/pu_stub/pu_stub.cpp b/plugins/PluginUpdater/pu_stub/pu_stub.cpp
index 8167c32d83..e7d346533d 100644
--- a/plugins/PluginUpdater/pu_stub/pu_stub.cpp
+++ b/plugins/PluginUpdater/pu_stub/pu_stub.cpp
@@ -7,38 +7,37 @@
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
-#include <tchar.h>
#include <varargs.h>
#include <stdio.h>
// Global Variables:
HINSTANCE hInst; // current instance
-void log(const TCHAR *tszFormat, ...)
+void log(const wchar_t *tszFormat, ...)
{
#if defined(_DEBUG)
- FILE *out = fopen("c:\\temp\\pu.log", "a");
- if (out) {
- va_list params;
- va_start(params, tszFormat);
- _vftprintf(out, tszFormat, params);
- va_end(params);
- fputc('\n', out);
- fclose(out);
- }
+ FILE *out = fopen("c:\\temp\\pu.log", "a");
+ if (out) {
+ va_list params;
+ va_start(params, tszFormat);
+ vfwprintf(out, tszFormat, params);
+ va_end(params);
+ fputc('\n', out);
+ fclose(out);
+ }
#endif
}
int CreateDirectoryTreeW(const WCHAR* szDir)
{
- DWORD dwAttributes;
- WCHAR* pszLastBackslash, szTestDir[ MAX_PATH ];
-
+ wchar_t szTestDir[MAX_PATH];
lstrcpynW(szTestDir, szDir, MAX_PATH);
- if ((dwAttributes = GetFileAttributesW(szTestDir)) != INVALID_FILE_ATTRIBUTES && (dwAttributes & FILE_ATTRIBUTE_DIRECTORY))
+
+ DWORD dwAttributes = GetFileAttributesW(szTestDir);
+ if (dwAttributes != INVALID_FILE_ATTRIBUTES && (dwAttributes & FILE_ATTRIBUTE_DIRECTORY))
return 0;
- pszLastBackslash = wcsrchr(szTestDir, '\\');
+ WCHAR *pszLastBackslash = wcsrchr(szTestDir, '\\');
if (pszLastBackslash == NULL)
return 0;
@@ -59,42 +58,42 @@ void CreatePathToFileW(WCHAR* wszFilePath)
*pszLastBackslash = '\\';
}
-int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR lpCmdLine, int)
+int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR lpCmdLine, int)
{
DWORD dwError;
hInst = hInstance;
- TCHAR tszPipeName[MAX_PATH];
+ wchar_t tszPipeName[MAX_PATH];
#if _MSC_VER < 1400
- _stprintf(tszPipeName, L"\\\\.\\pipe\\Miranda_Pu_%s", lpCmdLine);
+ swprintf(tszPipeName, L"\\\\.\\pipe\\Miranda_Pu_%s", lpCmdLine);
#else
- _stprintf_s(tszPipeName, MAX_PATH, L"\\\\.\\pipe\\Miranda_Pu_%s", lpCmdLine);
+ swprintf_s(tszPipeName, L"\\\\.\\pipe\\Miranda_Pu_%s", lpCmdLine);
#endif
- log( L"Opening pipe %s...", tszPipeName);
+ log(L"Opening pipe %s...", tszPipeName);
HANDLE hPipe = CreateFile(tszPipeName, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
if (hPipe == INVALID_HANDLE_VALUE) {
dwError = GetLastError();
- log( L"Failed to open a pipe: error %d", dwError);
+ log(L"Failed to open a pipe: error %d", dwError);
return dwError;
}
- log( L"Entering the reading cycle...");
+ log(L"Entering the reading cycle...");
BYTE szReadBuffer[1024] = { 0 };
DWORD dwBytes;
- while ( ReadFile(hPipe, szReadBuffer, sizeof(szReadBuffer), &dwBytes, NULL)) {
+ while (ReadFile(hPipe, szReadBuffer, sizeof(szReadBuffer), &dwBytes, NULL)) {
DWORD dwAction = *(DWORD*)szReadBuffer;
- TCHAR *ptszFile1 = (TCHAR*)(szReadBuffer + sizeof(DWORD));
- TCHAR *ptszFile2 = ptszFile1 + _tcslen(ptszFile1)+1;
- log( L"Received command: %d <%s> <%s>", dwAction, ptszFile1, ptszFile2);
- switch(dwAction) {
+ wchar_t *ptszFile1 = (wchar_t*)(szReadBuffer + sizeof(DWORD));
+ wchar_t *ptszFile2 = ptszFile1 + wcslen(ptszFile1) + 1;
+ log(L"Received command: %d <%s> <%s>", dwAction, ptszFile1, ptszFile2);
+ switch (dwAction) {
case 1: // copy
dwError = CopyFile(ptszFile1, ptszFile2, FALSE);
break;
case 2: // move
DeleteFile(ptszFile2);
- if ( MoveFile(ptszFile1, ptszFile2) == 0) // use copy on error
+ if (MoveFile(ptszFile1, ptszFile2) == 0) // use copy on error
dwError = CopyFile(ptszFile1, ptszFile2, FALSE);
else
dwError = 0;
@@ -122,7 +121,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR lpCmdLine, int)
}
dwError = GetLastError();
- log( L"Pipe is closed (%d), exiting", dwError);
+ log(L"Pipe is closed (%d), exiting", dwError);
CloseHandle(hPipe);
return 0;
}
diff --git a/plugins/PluginUpdater/src/DlgListNew.cpp b/plugins/PluginUpdater/src/DlgListNew.cpp
index 3d6b7ed772..89ccf41904 100644
--- a/plugins/PluginUpdater/src/DlgListNew.cpp
+++ b/plugins/PluginUpdater/src/DlgListNew.cpp
@@ -53,7 +53,7 @@ static void ApplyDownloads(void *param)
HWND hwndList = GetDlgItem(hDlg, IDC_LIST_UPDATES);
OBJLIST<FILEINFO> &todo = *(OBJLIST<FILEINFO> *)GetWindowLongPtr(hDlg, GWLP_USERDATA);
//create needed folders after escalating priviledges. Folders creates when we actually install updates
- TCHAR tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
+ wchar_t tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
mir_sntprintf(tszFileBack, L"%s\\Backups", g_tszRoot);
SafeCreateDirectory(tszFileBack);
@@ -111,11 +111,11 @@ static LRESULT CALLBACK PluginListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LP
if (ListView_GetItem(hwnd, &lvi) && lvi.iGroupId == 1) {
FILEINFO *info = (FILEINFO *)lvi.lParam;
- TCHAR tszFileName[MAX_PATH];
- _tcscpy(tszFileName, _tcsrchr(info->tszNewName, L'\\') + 1);
- TCHAR *p = _tcschr(tszFileName, L'.'); *p = 0;
+ wchar_t tszFileName[MAX_PATH];
+ wcscpy(tszFileName, wcsrchr(info->tszNewName, L'\\') + 1);
+ wchar_t *p = wcschr(tszFileName, L'.'); *p = 0;
- TCHAR link[MAX_PATH];
+ wchar_t link[MAX_PATH];
mir_sntprintf(link, PLUGIN_INFO_URL, tszFileName);
Utils_OpenUrlT(link);
}
@@ -165,10 +165,10 @@ INT_PTR CALLBACK DlgList(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
if (GetVersionEx(&osver) && osver.dwMajorVersion >= 6) {
wchar_t szPath[MAX_PATH];
GetModuleFileName(NULL, szPath, _countof(szPath));
- TCHAR *ext = _tcsrchr(szPath, '.');
+ wchar_t *ext = wcsrchr(szPath, '.');
if (ext != NULL)
*ext = '\0';
- _tcscat(szPath, L".test");
+ wcscat(szPath, L".test");
HANDLE hFile = CreateFile(szPath, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
// Running Windows Vista or later (major version >= 6).
@@ -229,8 +229,8 @@ INT_PTR CALLBACK DlgList(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
lvi.mask = LVIF_PARAM | LVIF_GROUPID | LVIF_TEXT | LVIF_IMAGE;
int groupId = 4;
- if (_tcschr(todo[i].tszOldName, L'\\') != NULL)
- groupId = (_tcsstr(todo[i].tszOldName, L"Plugins") != NULL) ? 1 : ((_tcsstr(todo[i].tszOldName, L"Languages") != NULL) ? 3 : 2);
+ if (wcschr(todo[i].tszOldName, L'\\') != NULL)
+ groupId = (wcsstr(todo[i].tszOldName, L"Plugins") != NULL) ? 1 : ((wcsstr(todo[i].tszOldName, L"Languages") != NULL) ? 3 : 2);
lvi.iItem = i;
lvi.lParam = (LPARAM)&todo[i];
@@ -344,27 +344,27 @@ static void __stdcall LaunchListDialog(void *param)
hwndDialog = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_LIST), GetDesktopWindow(), DlgList, (LPARAM)param);
}
-static FILEINFO* ServerEntryToFileInfo(const ServListEntry &hash, const TCHAR* tszBaseUrl, const TCHAR* tszPath)
+static FILEINFO* ServerEntryToFileInfo(const ServListEntry &hash, const wchar_t* tszBaseUrl, const wchar_t* tszPath)
{
FILEINFO *FileInfo = new FILEINFO;
FileInfo->bDeleteOnly = FALSE;
// copy the relative old name
- _tcsncpy(FileInfo->tszOldName, hash.m_name, _countof(FileInfo->tszOldName));
- _tcsncpy(FileInfo->tszNewName, hash.m_name, _countof(FileInfo->tszNewName));
+ wcsncpy(FileInfo->tszOldName, hash.m_name, _countof(FileInfo->tszOldName));
+ wcsncpy(FileInfo->tszNewName, hash.m_name, _countof(FileInfo->tszNewName));
- TCHAR tszFileName[MAX_PATH];
- _tcsncpy(tszFileName, _tcsrchr(tszPath, L'\\') + 1, _countof(tszFileName));
- TCHAR *tp = _tcschr(tszFileName, L'.'); if (tp) *tp = 0;
+ wchar_t tszFileName[MAX_PATH];
+ wcsncpy(tszFileName, wcsrchr(tszPath, L'\\') + 1, _countof(tszFileName));
+ wchar_t *tp = wcschr(tszFileName, L'.'); if (tp) *tp = 0;
- TCHAR tszRelFileName[MAX_PATH];
- _tcsncpy(tszRelFileName, hash.m_name, MAX_PATH);
- tp = _tcsrchr(tszRelFileName, L'.'); if (tp) *tp = 0;
- tp = _tcschr(tszRelFileName, L'\\'); if (tp) tp++; else tp = tszRelFileName;
- _tcslwr(tp);
+ wchar_t tszRelFileName[MAX_PATH];
+ wcsncpy(tszRelFileName, hash.m_name, MAX_PATH);
+ tp = wcsrchr(tszRelFileName, L'.'); if (tp) *tp = 0;
+ tp = wcschr(tszRelFileName, L'\\'); if (tp) tp++; else tp = tszRelFileName;
+ wcslwr(tp);
mir_sntprintf(FileInfo->File.tszDiskPath, L"%s\\Temp\\%s.zip", g_tszRoot, tszFileName);
mir_sntprintf(FileInfo->File.tszDownloadURL, L"%s/%s.zip", tszBaseUrl, tszRelFileName);
- for (tp = _tcschr(FileInfo->File.tszDownloadURL, '\\'); tp != 0; tp = _tcschr(tp, '\\'))
+ for (tp = wcschr(FileInfo->File.tszDownloadURL, '\\'); tp != 0; tp = wcschr(tp, '\\'))
*tp++ = '/';
FileInfo->File.CRCsum = hash.m_crc;
// Load list of checked Plugins from database
@@ -380,7 +380,7 @@ static void GetList(void *)
{
Thread_SetName("PluginUpdater: GetList");
- TCHAR tszTempPath[MAX_PATH];
+ wchar_t tszTempPath[MAX_PATH];
DWORD dwLen = GetTempPath(_countof(tszTempPath), tszTempPath);
if (tszTempPath[dwLen-1] == '\\')
tszTempPath[dwLen-1] = 0;
@@ -398,7 +398,7 @@ static void GetList(void *)
for (int i=0; i < hashes.getCount(); i++) {
ServListEntry &hash = hashes[i];
- TCHAR tszPath[MAX_PATH];
+ wchar_t tszPath[MAX_PATH];
mir_sntprintf(tszPath, L"%s\\%s", dirname, hash.m_name);
if (GetFileAttributes(tszPath) == INVALID_FILE_ATTRIBUTES) {
@@ -450,21 +450,21 @@ void UnloadListNew()
static INT_PTR ParseUriService(WPARAM, LPARAM lParam)
{
- TCHAR *arg = (TCHAR *)lParam;
+ wchar_t *arg = (wchar_t *)lParam;
if (arg == NULL)
return 1;
- TCHAR uri[1024];
- _tcsncpy_s(uri, arg, _TRUNCATE);
+ wchar_t uri[1024];
+ wcsncpy_s(uri, arg, _TRUNCATE);
- TCHAR *p = _tcschr(uri, _T(':'));
+ wchar_t *p = wcschr(uri, ':');
if (p == NULL)
return 1;
- TCHAR pluginPath[MAX_PATH];
+ wchar_t pluginPath[MAX_PATH];
mir_tstrcpy(pluginPath, p + 1);
- p = _tcschr(pluginPath, _T('/'));
- if (p) *p = _T('\\');
+ p = wcschr(pluginPath, '/');
+ if (p) *p = '\\';
if (GetFileAttributes(pluginPath) != INVALID_FILE_ATTRIBUTES)
return 0;
@@ -481,7 +481,7 @@ static INT_PTR ParseUriService(WPARAM, LPARAM lParam)
return 0;
VARST dirName(L"%miranda_path%");
- TCHAR tszPath[MAX_PATH];
+ wchar_t tszPath[MAX_PATH];
mir_sntprintf(tszPath, L"%s\\%s", dirName, hash->m_name);
FILEINFO *fileInfo = ServerEntryToFileInfo(*hash, baseUrl, tszPath);
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp
index 38e3646421..f09070bd43 100644
--- a/plugins/PluginUpdater/src/DlgUpdate.cpp
+++ b/plugins/PluginUpdater/src/DlgUpdate.cpp
@@ -36,7 +36,7 @@ static void SelectAll(HWND hDlg, bool bEnable)
}
}
-static void SetStringText(HWND hWnd, size_t i, TCHAR *ptszText)
+static void SetStringText(HWND hWnd, size_t i, wchar_t *ptszText)
{
ListView_SetItemText(hWnd, i, 1, ptszText);
}
@@ -60,7 +60,7 @@ static void ApplyUpdates(void *param)
AutoHandle pipe(hPipe);
HWND hwndList = GetDlgItem(hDlg, IDC_LIST_UPDATES);
//create needed folders after escalating priviledges. Folders creates when we actually install updates
- TCHAR tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
+ wchar_t tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
mir_sntprintf(tszFileBack, L"%s\\Backups", g_tszRoot);
SafeCreateDirectory(tszFileBack);
mir_sntprintf(tszFileTemp, L"%s\\Temp", g_tszRoot);
@@ -102,7 +102,7 @@ static void ApplyUpdates(void *param)
if (p.bEnabled) {
if (p.bDeleteOnly) {
// we need only to backup the old file
- TCHAR *ptszRelPath = p.tszNewName + _tcslen(tszMirandaPath) + 1, tszBackFile[MAX_PATH];
+ wchar_t *ptszRelPath = p.tszNewName + wcslen(tszMirandaPath) + 1, tszBackFile[MAX_PATH];
mir_sntprintf(tszBackFile, L"%s\\%s", tszFileBack, ptszRelPath);
BackupFile(p.tszNewName, tszBackFile);
}
@@ -110,7 +110,7 @@ static void ApplyUpdates(void *param)
// if file name differs, we also need to backup the old file here
// otherwise it would be replaced by unzip
if ( _tcsicmp(p.tszOldName, p.tszNewName)) {
- TCHAR tszSrcPath[MAX_PATH], tszBackFile[MAX_PATH];
+ wchar_t tszSrcPath[MAX_PATH], tszBackFile[MAX_PATH];
mir_sntprintf(tszSrcPath, L"%s\\%s", tszMirandaPath, p.tszOldName);
mir_sntprintf(tszBackFile, L"%s\\%s", tszFileBack, p.tszOldName);
BackupFile(tszSrcPath, tszBackFile);
@@ -136,7 +136,7 @@ static void ApplyUpdates(void *param)
CallService(MS_AB_BACKUP);
if (opts.bChangePlatform) {
- TCHAR mirandaPath[MAX_PATH];
+ wchar_t mirandaPath[MAX_PATH];
GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath));
db_set_ts(NULL, MODNAME, "OldBin2", mirandaPath);
@@ -162,7 +162,7 @@ static void ApplyUpdates(void *param)
#if MIRANDA_VER >= 0x0A00
BOOL bRestartCurrentProfile = db_get_b(NULL, MODNAME, "RestartCurrentProfile", 1) ? 1 : 0;
if (opts.bChangePlatform) {
- TCHAR mirstartpath[MAX_PATH];
+ wchar_t mirstartpath[MAX_PATH];
#ifdef _WIN64
mir_sntprintf(mirstartpath, L"%s\\miranda32.exe", tszMirandaPath);
@@ -207,10 +207,10 @@ static INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM
{
wchar_t szPath[MAX_PATH];
GetModuleFileName(NULL, szPath, _countof(szPath));
- TCHAR *ext = _tcsrchr(szPath, '.');
+ wchar_t *ext = wcsrchr(szPath, '.');
if (ext != NULL)
*ext = '\0';
- _tcscat(szPath, L".test");
+ wcscat(szPath, L".test");
HANDLE hFile = CreateFile(szPath, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
// Running Windows Vista or later (major version >= 6).
@@ -268,9 +268,9 @@ static INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM
for (int i = 0; i < todo.getCount(); ++i) {
LVITEM lvI = {0};
lvI.mask = LVIF_TEXT | LVIF_PARAM | LVIF_GROUPID | LVIF_NORECOMPUTE;
- lvI.iGroupId = (_tcsstr(todo[i].tszOldName, L"Plugins") != NULL) ? 1 :
- ((_tcsstr(todo[i].tszOldName, L"Languages") != NULL) ? 3 :
- ((_tcsstr(todo[i].tszOldName, L"Icons") != NULL) ? 4 : 2));
+ lvI.iGroupId = (wcsstr(todo[i].tszOldName, L"Plugins") != NULL) ? 1 :
+ ((wcsstr(todo[i].tszOldName, L"Languages") != NULL) ? 3 :
+ ((wcsstr(todo[i].tszOldName, L"Icons") != NULL) ? 4 : 2));
lvI.iSubItem = 0;
lvI.lParam = (LPARAM)&todo[i];
lvI.pszText = todo[i].tszOldName;
@@ -410,7 +410,7 @@ static void DlgUpdateSilent(void *param)
AutoHandle pipe(hPipe);
//create needed folders after escalating priviledges. Folders creates when we actually install updates
- TCHAR tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
+ wchar_t tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
mir_sntprintf(tszFileBack, L"%s\\Backups", g_tszRoot);
SafeCreateDirectory(tszFileBack);
@@ -452,7 +452,7 @@ static void DlgUpdateSilent(void *param)
if (p.bEnabled) {
if (p.bDeleteOnly) {
// we need only to backup the old file
- TCHAR *ptszRelPath = p.tszNewName + _tcslen(tszMirandaPath) + 1, tszBackFile[MAX_PATH];
+ wchar_t *ptszRelPath = p.tszNewName + wcslen(tszMirandaPath) + 1, tszBackFile[MAX_PATH];
mir_sntprintf(tszBackFile, L"%s\\%s", tszFileBack, ptszRelPath);
BackupFile(p.tszNewName, tszBackFile);
}
@@ -460,7 +460,7 @@ static void DlgUpdateSilent(void *param)
// if file name differs, we also need to backup the old file here
// otherwise it would be replaced by unzip
if (_tcsicmp(p.tszOldName, p.tszNewName)) {
- TCHAR tszSrcPath[MAX_PATH], tszBackFile[MAX_PATH];
+ wchar_t tszSrcPath[MAX_PATH], tszBackFile[MAX_PATH];
mir_sntprintf(tszSrcPath, L"%s\\%s", tszMirandaPath, p.tszOldName);
mir_sntprintf(tszBackFile, L"%s\\%s", tszFileBack, p.tszOldName);
BackupFile(tszSrcPath, tszBackFile);
@@ -492,7 +492,7 @@ static void DlgUpdateSilent(void *param)
db_set_b(NULL, MODNAME, DB_SETTING_NEED_RESTART, 1);
// 5) Prepare Restart
- TCHAR tszTitle[100];
+ wchar_t tszTitle[100];
mir_sntprintf(tszTitle, TranslateT("%d component(s) was updated"), count);
if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1)) {
@@ -514,7 +514,7 @@ static void DlgUpdateSilent(void *param)
if (!notified) {
// Error, let's try to show MessageBox as last way to inform user about successful update
- TCHAR tszText[200];
+ wchar_t tszText[200];
mir_sntprintf(tszText, L"%s\n\n%s", TranslateT("You need to restart your Miranda to apply installed updates."), TranslateT("Would you like to restart it now?"));
if (MessageBox(NULL, tszText, tszTitle, MB_ICONINFORMATION | MB_YESNO) == IDYES)
@@ -540,7 +540,7 @@ static void __stdcall LaunchDialog(void *param)
struct
{
- TCHAR *oldName, *newName;
+ wchar_t *oldName, *newName;
}
static renameTable[] =
{
@@ -603,18 +603,18 @@ static renameTable[] =
// Checks if file needs to be renamed and copies it in pNewName
// Returns true if smth. was copied
-static bool CheckFileRename(const TCHAR *ptszOldName, TCHAR *pNewName)
+static bool CheckFileRename(const wchar_t *ptszOldName, wchar_t *pNewName)
{
for (int i = 0; i < _countof(renameTable); i++) {
if (wildcmpit(ptszOldName, renameTable[i].oldName)) {
- TCHAR *ptszDest = renameTable[i].newName;
+ wchar_t *ptszDest = renameTable[i].newName;
if (ptszDest == NULL)
*pNewName = 0;
else {
- _tcsncpy_s(pNewName, MAX_PATH, ptszDest, _TRUNCATE);
- size_t cbLen = _tcslen(ptszDest) - 1;
+ wcsncpy_s(pNewName, MAX_PATH, ptszDest, _TRUNCATE);
+ size_t cbLen = wcslen(ptszDest) - 1;
if (pNewName[cbLen] == '*')
- _tcsncpy_s(pNewName + cbLen, MAX_PATH - cbLen, ptszOldName, _TRUNCATE);
+ wcsncpy_s(pNewName + cbLen, MAX_PATH - cbLen, ptszOldName, _TRUNCATE);
}
return true;
}
@@ -625,23 +625,23 @@ static bool CheckFileRename(const TCHAR *ptszOldName, TCHAR *pNewName)
/////////////////////////////////////////////////////////////////////////////////////////
// We only update ".dll", ".exe" and ".ico"
-static bool isValidExtension(const TCHAR *ptszFileName)
+static bool isValidExtension(const wchar_t *ptszFileName)
{
- const TCHAR *pExt = _tcsrchr(ptszFileName, '.');
+ const wchar_t *pExt = wcsrchr(ptszFileName, '.');
return (pExt != NULL) && (!_tcsicmp(pExt, L".dll") || !_tcsicmp(pExt, L".exe") || !_tcsicmp(pExt, L".txt"));
}
// We only scan subfolders "Plugins", "Icons", "Languages", "Libs", "Core"
-static bool isValidDirectory(const TCHAR *ptszDirName)
+static bool isValidDirectory(const wchar_t *ptszDirName)
{
return !_tcsicmp(ptszDirName, L"Plugins") || !_tcsicmp(ptszDirName, L"Icons") || !_tcsicmp(ptszDirName, L"Languages") || !_tcsicmp(ptszDirName, L"Libs") || !_tcsicmp(ptszDirName, L"Core");
}
// Scans folders recursively
-static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, const TCHAR *tszBaseUrl, SERVLIST& hashes, OBJLIST<FILEINFO> *UpdateFiles, int level = 0)
+static int ScanFolder(const wchar_t *tszFolder, size_t cbBaseLen, const wchar_t *tszBaseUrl, SERVLIST& hashes, OBJLIST<FILEINFO> *UpdateFiles, int level = 0)
{
- TCHAR tszBuf[MAX_PATH];
+ wchar_t tszBuf[MAX_PATH];
mir_sntprintf(tszBuf, L"%s\\*", tszFolder);
WIN32_FIND_DATA ffd;
@@ -662,7 +662,7 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, const TCHAR *tsz
}
else if (isValidExtension(ffd.cFileName)) {
// calculate the current file's relative name and store it into tszNewName
- TCHAR tszNewName[MAX_PATH];
+ wchar_t tszNewName[MAX_PATH];
if (CheckFileRename(ffd.cFileName, tszNewName)) {
Netlib_LogfT(hNetlibUser, L"File %s will be renamed to %s.", ffd.cFileName, tszNewName);
// Yes, we need the old file name, because this will be hashed later
@@ -671,7 +671,7 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, const TCHAR *tsz
else {
if (level == 0) {
// Rename Miranda*.exe
- _tcsncpy_s(tszNewName, opts.bChangePlatform && !mir_tstrcmpi(ffd.cFileName, OLD_FILENAME) ? NEW_FILENAME : ffd.cFileName, _TRUNCATE);
+ wcsncpy_s(tszNewName, opts.bChangePlatform && !mir_tstrcmpi(ffd.cFileName, OLD_FILENAME) ? NEW_FILENAME : ffd.cFileName, _TRUNCATE);
mir_sntprintf(tszBuf, L"%s\\%s", tszFolder, tszNewName);
}
else {
@@ -680,17 +680,17 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, const TCHAR *tsz
}
}
- TCHAR *ptszUrl;
+ wchar_t *ptszUrl;
int MyCRC;
bool bDeleteOnly = (tszNewName[0] == 0);
// this file is not marked for deletion
if (!bDeleteOnly) {
- TCHAR *pName = tszNewName;
+ wchar_t *pName = tszNewName;
ServListEntry *item = hashes.find((ServListEntry*)&pName);
// Not in list? Check for trailing 'W' or 'w'
if (item == NULL) {
- TCHAR *p = _tcsrchr(tszNewName, '.');
+ wchar_t *p = wcsrchr(tszNewName, '.');
if (p[-1] != 'w' && p[-1] != 'W') {
Netlib_LogfT(hNetlibUser, L"File %s: Not found on server, skipping", ffd.cFileName);
continue;
@@ -744,26 +744,26 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, const TCHAR *tsz
// Yeah, we've got new version.
FILEINFO *FileInfo = new FILEINFO;
// copy the relative old name
- _tcsncpy(FileInfo->tszOldName, tszBuf + cbBaseLen, _countof(FileInfo->tszOldName));
+ wcsncpy(FileInfo->tszOldName, tszBuf + cbBaseLen, _countof(FileInfo->tszOldName));
FileInfo->bDeleteOnly = bDeleteOnly;
if (FileInfo->bDeleteOnly) {
// save the full old name for deletion
- _tcsncpy(FileInfo->tszNewName, tszBuf, _countof(FileInfo->tszNewName));
+ wcsncpy(FileInfo->tszNewName, tszBuf, _countof(FileInfo->tszNewName));
}
else {
- _tcsncpy(FileInfo->tszNewName, ptszUrl, _countof(FileInfo->tszNewName));
+ wcsncpy(FileInfo->tszNewName, ptszUrl, _countof(FileInfo->tszNewName));
}
- _tcsncpy(tszBuf, ptszUrl, _countof(tszBuf));
- TCHAR *p = _tcsrchr(tszBuf, '.');
+ wcsncpy(tszBuf, ptszUrl, _countof(tszBuf));
+ wchar_t *p = wcsrchr(tszBuf, '.');
if (p) *p = 0;
- p = _tcsrchr(tszBuf, '\\');
+ p = wcsrchr(tszBuf, '\\');
p = (p) ? p + 1 : tszBuf;
- _tcslwr(p);
+ wcslwr(p);
mir_sntprintf(FileInfo->File.tszDiskPath, L"%s\\Temp\\%s.zip", g_tszRoot, p);
mir_sntprintf(FileInfo->File.tszDownloadURL, L"%s/%s.zip", tszBaseUrl, tszBuf);
- for (p = _tcschr(FileInfo->File.tszDownloadURL, '\\'); p != 0; p = _tcschr(p, '\\'))
+ for (p = wcschr(FileInfo->File.tszDownloadURL, '\\'); p != 0; p = wcschr(p, '\\'))
*p++ = '/';
// remember whether the user has decided not to update this component with this particular new version
@@ -789,7 +789,7 @@ static void CheckUpdates(void *)
Netlib_LogfT(hNetlibUser, L"Checking for updates");
Thread_SetName("PluginUpdater: CheckUpdates");
- TCHAR tszTempPath[MAX_PATH];
+ wchar_t tszTempPath[MAX_PATH];
DWORD dwLen = GetTempPath(_countof(tszTempPath), tszTempPath);
if (tszTempPath[dwLen - 1] == '\\')
tszTempPath[dwLen - 1] = 0;
diff --git a/plugins/PluginUpdater/src/Events.cpp b/plugins/PluginUpdater/src/Events.cpp
index 1afbe741cc..ea4c6e8ddf 100644
--- a/plugins/PluginUpdater/src/Events.cpp
+++ b/plugins/PluginUpdater/src/Events.cpp
@@ -24,7 +24,7 @@ HANDLE hPluginUpdaterFolder;
int OnFoldersChanged(WPARAM, LPARAM)
{
FoldersGetCustomPathT(hPluginUpdaterFolder, g_tszRoot, MAX_PATH, L"");
- size_t len = _tcslen(g_tszRoot);
+ size_t len = wcslen(g_tszRoot);
if (g_tszRoot[len-1] == '\\' || g_tszRoot[len-1] == '/')
g_tszRoot[len-1] = 0;
return 0;
diff --git a/plugins/PluginUpdater/src/Notifications.cpp b/plugins/PluginUpdater/src/Notifications.cpp
index f21dd3481f..5741de81bd 100644
--- a/plugins/PluginUpdater/src/Notifications.cpp
+++ b/plugins/PluginUpdater/src/Notifications.cpp
@@ -70,7 +70,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hPopup, UINT uMsg, WPARAM wParam, LPAR
static void _stdcall RestartPrompt(void *)
{
- TCHAR tszText[200];
+ wchar_t tszText[200];
mir_sntprintf(tszText, L"%s\n\n%s", TranslateT("You need to restart your Miranda to apply installed updates."), TranslateT("Would you like to restart it now?"));
if (MessageBox(0, tszText, TranslateT("Plugin Updater"), MB_YESNO | MB_ICONQUESTION | MB_TOPMOST) == IDYES)
diff --git a/plugins/PluginUpdater/src/Notifications.h b/plugins/PluginUpdater/src/Notifications.h
index 1d8544ba63..2819baf04b 100644
--- a/plugins/PluginUpdater/src/Notifications.h
+++ b/plugins/PluginUpdater/src/Notifications.h
@@ -60,9 +60,9 @@ extern struct POPUP_OPTIONS {
} PopupOptions;
static struct {
- TCHAR *Text;
+ wchar_t *Text;
int Action;
} PopupActions[] = {
- LPGENT("Close popup"), PCA_CLOSEPOPUP,
- LPGENT("Do nothing"), PCA_DONOTHING
+ LPGENW("Close popup"), PCA_CLOSEPOPUP,
+ LPGENW("Do nothing"), PCA_DONOTHING
};
diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp
index 4586df734a..1e379e7264 100644
--- a/plugins/PluginUpdater/src/Options.cpp
+++ b/plugins/PluginUpdater/src/Options.cpp
@@ -34,7 +34,7 @@ static int GetUpdateMode()
// Check if there is url for custom mode
if (UpdateMode == UPDATE_MODE_CUSTOM) {
ptrT url(db_get_tsa(NULL, MODNAME, DB_SETTING_UPDATE_URL));
- if (url == NULL || !_tcslen(url)) {
+ if (url == NULL || !wcslen(url)) {
// No url for custom mode, reset that setting so it will be determined automatically
db_unset(NULL, MODNAME, DB_SETTING_UPDATE_MODE);
UpdateMode = -1;
@@ -51,9 +51,9 @@ static int GetUpdateMode()
return UpdateMode;
}
-TCHAR* GetDefaultUrl()
+wchar_t* GetDefaultUrl()
{
- TCHAR url[MAX_PATH];
+ wchar_t url[MAX_PATH];
switch (GetUpdateMode()) {
case UPDATE_MODE_STABLE:
mir_sntprintf(url, _T(DEFAULT_UPDATE_URL), opts.bChangePlatform ? DEFAULT_OPP_BITS : DEFAULT_BITS);
@@ -71,7 +71,7 @@ TCHAR* GetDefaultUrl()
static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TCHAR defurl[MAX_PATH];
+ wchar_t defurl[MAX_PATH];
switch (msg) {
case WM_INITDIALOG:
@@ -98,7 +98,7 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar
if (ServiceExists(MS_AB_BACKUP)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_BACKUP), TRUE);
- SetDlgItemText(hwndDlg, IDC_BACKUP, LPGENT("Backup database before update"));
+ SetDlgItemText(hwndDlg, IDC_BACKUP, LPGENW("Backup database before update"));
if(opts.bBackup)
CheckDlgButton(hwndDlg, IDC_BACKUP, BST_CHECKED);
}
@@ -111,7 +111,7 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar
int UpdateMode = db_get_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE);
if (UpdateMode == UPDATE_MODE_STABLE)
db_set_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK);
- SetDlgItemText(hwndDlg,IDC_STABLE,LPGENT("Stable version (incompatible with current development version)"));
+ SetDlgItemText(hwndDlg,IDC_STABLE,LPGENW("Stable version (incompatible with current development version)"));
}
TranslateDialogDefault(hwndDlg);
@@ -266,9 +266,9 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar
db_set_b(NULL, MODNAME, "PeriodMeasure", opts.bPeriodMeasure = ComboBox_GetCurSel(GetDlgItem(hwndDlg, IDC_PERIODMEASURE)));
db_set_b(NULL, MODNAME, "SilentMode", opts.bSilentMode = IsDlgButtonChecked(hwndDlg, IDC_SILENTMODE));
db_set_b(NULL, MODNAME, "Backup", opts.bBackup = IsDlgButtonChecked(hwndDlg, IDC_BACKUP));
- TCHAR buffer[3] = {0};
+ wchar_t buffer[3] = {0};
Edit_GetText(GetDlgItem(hwndDlg, IDC_PERIOD), buffer, _countof(buffer));
- db_set_dw(NULL, MODNAME, "Period", opts.Period = _ttoi(buffer));
+ db_set_dw(NULL, MODNAME, "Period", opts.Period = _wtoi(buffer));
mir_forkthread(InitTimer, (void*)1);
@@ -293,7 +293,7 @@ static INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wPar
}
}
else {
- TCHAR tszUrl[100];
+ wchar_t tszUrl[100];
GetDlgItemText(hwndDlg, IDC_CUSTOMURL, tszUrl, _countof(tszUrl));
db_set_ts(NULL, MODNAME, DB_SETTING_UPDATE_URL, tszUrl);
db_set_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_CUSTOM);
@@ -512,15 +512,15 @@ static int OptInit(WPARAM wParam, LPARAM)
odp.hInstance = hInst;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_UPDATENOTIFY);
- odp.ptszGroup = LPGENT("Services");
- odp.ptszTitle = LPGENT("Plugin Updater");
+ odp.pwszGroup = LPGENW("Services");
+ odp.pwszTitle = LPGENW("Plugin Updater");
odp.pfnDlgProc = UpdateNotifyOptsProc;
Options_AddPage(wParam, &odp);
if ( ServiceExists(MS_POPUP_ADDPOPUPT)) {
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUP);
- odp.ptszGroup = LPGENT("Popups");
- odp.ptszTitle = LPGENT("Plugin Updater");
+ odp.pwszGroup = LPGENW("Popups");
+ odp.pwszTitle = LPGENW("Plugin Updater");
odp.pfnDlgProc = DlgPopupOpts;
Options_AddPage(wParam, &odp);
}
diff --git a/plugins/PluginUpdater/src/PluginUpdater.cpp b/plugins/PluginUpdater/src/PluginUpdater.cpp
index 4a07853828..a10066806b 100644
--- a/plugins/PluginUpdater/src/PluginUpdater.cpp
+++ b/plugins/PluginUpdater/src/PluginUpdater.cpp
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA.
#include "stdafx.h"
HINSTANCE hInst = NULL;
-TCHAR g_tszRoot[MAX_PATH] = {0}, g_tszTempPath[MAX_PATH];
+wchar_t g_tszRoot[MAX_PATH] = {0}, g_tszTempPath[MAX_PATH];
int hLangpack;
DWORD g_mirandaVersion;
diff --git a/plugins/PluginUpdater/src/Services.cpp b/plugins/PluginUpdater/src/Services.cpp
index 4111fca483..bd12b68f17 100644
--- a/plugins/PluginUpdater/src/Services.cpp
+++ b/plugins/PluginUpdater/src/Services.cpp
@@ -29,7 +29,7 @@ static INT_PTR srvParseHashes(WPARAM wParam, LPARAM lParam)
SERVLIST *pList = new SERVLIST(50, CompareHashes);
ptrT baseUrl;
if ( ParseHashes(ptszUrl, baseUrl, *pList)) {
- _tcsncpy(ptszBaseUrl, baseUrl, MAX_PATH);
+ wcsncpy(ptszBaseUrl, baseUrl, MAX_PATH);
return (INT_PTR)pList;
}
diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp
index 2d3923b7cd..b298f38345 100644
--- a/plugins/PluginUpdater/src/Utils.cpp
+++ b/plugins/PluginUpdater/src/Utils.cpp
@@ -43,9 +43,9 @@ void LoadOptions()
#if MIRANDA_VER >= 0x0A00
IconItemT iconList[] =
{
- { LPGENT("Check for updates"),"check_update", IDI_MENU },
- { LPGENT("Plugin info"), "info", IDI_INFO },
- { LPGENT("Component list"),"plg_list", IDI_PLGLIST }
+ { LPGENW("Check for updates"),"check_update", IDI_MENU },
+ { LPGENW("Plugin info"), "info", IDI_INFO },
+ { LPGENW("Component list"),"plg_list", IDI_PLGLIST }
};
void InitIcoLib()
@@ -128,17 +128,17 @@ int CompareHashes(const ServListEntry *p1, const ServListEntry *p2)
return _tcsicmp(p1->m_name, p2->m_name);
}
-bool ParseHashes(const TCHAR *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes)
+bool ParseHashes(const wchar_t *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes)
{
REPLACEVARSARRAY vars[2];
#if MIRANDA_VER >=0x0A00
- vars[0].key.t = L"platform";
+ vars[0].key.w = L"platform";
#ifdef _WIN64
- vars[0].value.t = L"64";
+ vars[0].value.w = L"64";
#else
- vars[0].value.t = L"32";
+ vars[0].value.w = L"32";
#endif
- vars[1].key.t = vars[1].value.t = 0;
+ vars[1].key.w = vars[1].value.w = 0;
#else
vars[0].lptzKey = L"platform";
#ifdef _WIN64
@@ -176,9 +176,9 @@ bool ParseHashes(const TCHAR *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes)
DeleteFile(pFileUrl.tszDiskPath);
- TCHAR tszTmpIni[MAX_PATH] = {0};
+ wchar_t tszTmpIni[MAX_PATH] = {0};
mir_sntprintf(tszTmpIni, L"%s\\hashes.txt", g_tszTempPath);
- FILE *fp = _tfopen(tszTmpIni, L"r");
+ FILE *fp = _wfopen(tszTmpIni, L"r");
if (!fp) {
Netlib_LogfT(hNetlibUser,L"Opening %s failed", g_tszTempPath);
ShowPopup(TranslateT("Plugin Updater"), TranslateT("An error occurred while checking for new updates."), POPUP_TYPE_ERROR);
@@ -284,7 +284,7 @@ bool DownloadFile(FILEURL *pFileURL, HANDLE &nlc)
}
else {
// try to write it via PU stub
- TCHAR tszTempFile[MAX_PATH];
+ wchar_t tszTempFile[MAX_PATH];
mir_sntprintf(tszTempFile, L"%s\\pulocal.tmp", g_tszTempPath);
hFile = CreateFile(tszTempFile, GENERIC_READ | GENERIC_WRITE, NULL, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
@@ -482,12 +482,12 @@ Cleanup:
bool PrepareEscalation()
{
// First try to create a file near Miranda32.exe
- TCHAR szPath[MAX_PATH];
+ wchar_t szPath[MAX_PATH];
GetModuleFileName(NULL, szPath, _countof(szPath));
- TCHAR *ext = _tcsrchr(szPath, '.');
+ wchar_t *ext = wcsrchr(szPath, '.');
if (ext != NULL)
*ext = '\0';
- _tcscat(szPath, L".test");
+ wcscat(szPath, L".test");
HANDLE hFile = CreateFile(szPath, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
// we are admins or UAC is disable, cool
@@ -501,17 +501,17 @@ bool PrepareEscalation()
}
else {
// Elevate the process. Create a pipe for a stub first
- TCHAR tszPipeName[MAX_PATH];
+ wchar_t tszPipeName[MAX_PATH];
mir_sntprintf(tszPipeName, L"\\\\.\\pipe\\Miranda_Pu_%d", GetCurrentProcessId());
hPipe = CreateNamedPipe(tszPipeName, PIPE_ACCESS_DUPLEX, PIPE_READMODE_BYTE | PIPE_WAIT, 1, 1024, 1024, NMPWAIT_USE_DEFAULT_WAIT, NULL);
if (hPipe == INVALID_HANDLE_VALUE) {
hPipe = NULL;
}
else {
- TCHAR cmdLine[100], *p;
+ wchar_t cmdLine[100], *p;
GetModuleFileName(NULL, szPath, ARRAYSIZE(szPath));
- if ((p = _tcsrchr(szPath, '\\')) != 0)
- _tcscpy(p+1, L"pu_stub.exe");
+ if ((p = wcsrchr(szPath, '\\')) != 0)
+ wcscpy(p+1, L"pu_stub.exe");
mir_sntprintf(cmdLine, L"%d", GetCurrentProcessId());
// Launch a stub
@@ -540,7 +540,7 @@ bool PrepareEscalation()
/////////////////////////////////////////////////////////////////////////////////////////
-int TransactPipe(int opcode, const TCHAR *p1, const TCHAR *p2)
+int TransactPipe(int opcode, const wchar_t *p1, const wchar_t *p2)
{
BYTE buf[1024];
DWORD l1 = lstrlen(p1), l2 = lstrlen(p2);
@@ -548,7 +548,7 @@ int TransactPipe(int opcode, const TCHAR *p1, const TCHAR *p2)
return 0;
*(DWORD*)buf = opcode;
- TCHAR *dst = (TCHAR*)&buf[sizeof(DWORD)];
+ wchar_t *dst = (wchar_t*)&buf[sizeof(DWORD)];
lstrcpy(dst, p1);
dst += l1+1;
if (p2) {
@@ -568,7 +568,7 @@ int TransactPipe(int opcode, const TCHAR *p1, const TCHAR *p2)
return dwError == ERROR_SUCCESS;
}
-int SafeCopyFile(const TCHAR *pSrc, const TCHAR *pDst)
+int SafeCopyFile(const wchar_t *pSrc, const wchar_t *pDst)
{
if (hPipe == NULL)
return CopyFile(pSrc, pDst, FALSE);
@@ -576,7 +576,7 @@ int SafeCopyFile(const TCHAR *pSrc, const TCHAR *pDst)
return TransactPipe(1, pSrc, pDst);
}
-int SafeMoveFile(const TCHAR *pSrc, const TCHAR *pDst)
+int SafeMoveFile(const wchar_t *pSrc, const wchar_t *pDst)
{
if (hPipe == NULL) {
DeleteFile(pDst);
@@ -588,7 +588,7 @@ int SafeMoveFile(const TCHAR *pSrc, const TCHAR *pDst)
return TransactPipe(2, pSrc, pDst);
}
-int SafeDeleteFile(const TCHAR *pFile)
+int SafeDeleteFile(const wchar_t *pFile)
{
if (hPipe == NULL)
return DeleteFile(pFile);
@@ -596,7 +596,7 @@ int SafeDeleteFile(const TCHAR *pFile)
return TransactPipe(3, pFile, NULL);
}
-int SafeCreateDirectory(const TCHAR *pFolder)
+int SafeCreateDirectory(const wchar_t *pFolder)
{
if (hPipe == NULL)
return CreateDirectoryTreeT(pFolder);
@@ -604,7 +604,7 @@ int SafeCreateDirectory(const TCHAR *pFolder)
return TransactPipe(4, pFolder, NULL);
}
-int SafeCreateFilePath(TCHAR *pFolder)
+int SafeCreateFilePath(wchar_t *pFolder)
{
if (hPipe == NULL) {
CreatePathToFileT(pFolder);
@@ -614,7 +614,7 @@ int SafeCreateFilePath(TCHAR *pFolder)
return TransactPipe(5, pFolder, NULL);
}
-void BackupFile(TCHAR *ptszSrcFileName, TCHAR *ptszBackFileName)
+void BackupFile(wchar_t *ptszSrcFileName, wchar_t *ptszBackFileName)
{
SafeCreateFilePath(ptszBackFileName);
SafeMoveFile(ptszSrcFileName, ptszBackFileName);
diff --git a/plugins/PluginUpdater/src/checksum.cpp b/plugins/PluginUpdater/src/checksum.cpp
index 48d2d9ee26..ba895515b4 100644
--- a/plugins/PluginUpdater/src/checksum.cpp
+++ b/plugins/PluginUpdater/src/checksum.cpp
@@ -23,7 +23,7 @@ struct MFileMapping
PBYTE ptr;
HANDLE hMap, hFile;
- MFileMapping(const TCHAR* ptszFileName)
+ MFileMapping(const wchar_t* ptszFileName)
{
ptr = NULL;
hMap = NULL;
@@ -69,7 +69,7 @@ static void PatchResourcesDirectory(PIMAGE_RESOURCE_DIRECTORY pIRD, PBYTE pBase)
PatchResourceEntry(pIRDE, pBase);
}
-int CalculateModuleHash(const TCHAR *filename, char *szDest)
+int CalculateModuleHash(const wchar_t *filename, char *szDest)
{
MFileMapping map(filename);
if (map.hFile == INVALID_HANDLE_VALUE)
diff --git a/plugins/PluginUpdater/src/stdafx.h b/plugins/PluginUpdater/src/stdafx.h
index 501363d3e2..179f0c4879 100644
--- a/plugins/PluginUpdater/src/stdafx.h
+++ b/plugins/PluginUpdater/src/stdafx.h
@@ -70,14 +70,14 @@ Boston, MA 02111-1307, USA.
struct FILEURL
{
- TCHAR tszDownloadURL[2048];
- TCHAR tszDiskPath[MAX_PATH];
+ wchar_t tszDownloadURL[2048];
+ wchar_t tszDiskPath[MAX_PATH];
int CRCsum;
};
struct FILEINFO
{
- TCHAR tszOldName[MAX_PATH], tszNewName[MAX_PATH];
+ wchar_t tszOldName[MAX_PATH], tszNewName[MAX_PATH];
FILEURL File;
BOOL bEnabled, bDeleteOnly;
};
@@ -158,7 +158,7 @@ using namespace std;
extern HINSTANCE hInst;
extern DWORD g_mirandaVersion;
-extern TCHAR g_tszRoot[MAX_PATH], g_tszTempPath[MAX_PATH];
+extern wchar_t g_tszRoot[MAX_PATH], g_tszTempPath[MAX_PATH];
extern aPopups PopupsList[POPUPS];
extern HANDLE hPipe, hNetlibUser;
#if MIRANDA_VER >= 0x0A00
@@ -199,7 +199,7 @@ struct ServListEntry
mir_free(m_name);
}
- TCHAR *m_name;
+ wchar_t *m_name;
DWORD m_crc;
char m_szHash[32+1];
};
@@ -223,12 +223,12 @@ void UnloadCheck();
void UnloadListNew();
void UnloadNetlib();
-void BackupFile(TCHAR *ptszSrcFileName, TCHAR *ptszBackFileName);
+void BackupFile(wchar_t *ptszSrcFileName, wchar_t *ptszBackFileName);
-bool ParseHashes(const TCHAR *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes);
+bool ParseHashes(const wchar_t *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes);
int CompareHashes(const ServListEntry *p1, const ServListEntry *p2);
-TCHAR* GetDefaultUrl();
+wchar_t* GetDefaultUrl();
bool DownloadFile(FILEURL *pFileURL, HANDLE &nlc);
void ShowPopup(LPCTSTR Title, LPCTSTR Text, int Number);
@@ -237,19 +237,19 @@ void __stdcall OpenPluginOptions(void*);
void CheckUpdateOnStartup();
void InitTimer(void *type);
-bool unzip(const TCHAR *ptszZipFile, TCHAR *ptszDestPath, TCHAR *ptszBackPath,bool ch);
+bool unzip(const wchar_t *ptszZipFile, wchar_t *ptszDestPath, wchar_t *ptszBackPath,bool ch);
///////////////////////////////////////////////////////////////////////////////
-int CalculateModuleHash(const TCHAR *tszFileName, char *dest);
+int CalculateModuleHash(const wchar_t *tszFileName, char *dest);
BOOL IsProcessElevated();
bool PrepareEscalation();
-int SafeCreateDirectory(const TCHAR *ptszDirName);
-int SafeCopyFile(const TCHAR *ptszSrc, const TCHAR *ptszDst);
-int SafeMoveFile(const TCHAR *ptszSrc, const TCHAR *ptszDst);
-int SafeDeleteFile(const TCHAR *ptszSrc);
-int SafeCreateFilePath(TCHAR *pFolder);
+int SafeCreateDirectory(const wchar_t *ptszDirName);
+int SafeCopyFile(const wchar_t *ptszSrc, const wchar_t *ptszDst);
+int SafeMoveFile(const wchar_t *ptszSrc, const wchar_t *ptszDst);
+int SafeDeleteFile(const wchar_t *ptszSrc);
+int SafeCreateFilePath(wchar_t *pFolder);
char *StrToLower(char *str);
diff --git a/plugins/PluginUpdater/src/unzipfile.cpp b/plugins/PluginUpdater/src/unzipfile.cpp
index 2a64019ada..979dcd289e 100644
--- a/plugins/PluginUpdater/src/unzipfile.cpp
+++ b/plugins/PluginUpdater/src/unzipfile.cpp
@@ -30,16 +30,16 @@ extern "C"
void fill_fopen64_filefunc(zlib_filefunc64_def *pzlib_filefunc_def);
}
-static void PrepareFileName(TCHAR *dest, size_t destSize, const TCHAR *ptszPath, const TCHAR *ptszFileName)
+static void PrepareFileName(wchar_t *dest, size_t destSize, const wchar_t *ptszPath, const wchar_t *ptszFileName)
{
mir_sntprintf(dest, destSize, L"%s\\%s", ptszPath, ptszFileName);
- for (TCHAR *p = dest; *p; ++p)
+ for (wchar_t *p = dest; *p; ++p)
if (*p == '/')
*p = '\\';
}
-bool extractCurrentFile(unzFile uf, TCHAR *ptszDestPath, TCHAR *ptszBackPath, bool ch)
+bool extractCurrentFile(unzFile uf, wchar_t *ptszDestPath, wchar_t *ptszBackPath, bool ch)
{
unz_file_info64 file_info;
char filename[MAX_PATH], buf[8192];
@@ -56,8 +56,8 @@ bool extractCurrentFile(unzFile uf, TCHAR *ptszDestPath, TCHAR *ptszBackPath, bo
if (ch && !db_get_b(NULL, DB_MODULE_FILES, StrToLower(ptrA(mir_strdup(filename))), 1))
return true;
- TCHAR tszDestFile[MAX_PATH], tszBackFile[MAX_PATH];
- TCHAR *ptszNewName = mir_utf8decodeT(filename);
+ wchar_t tszDestFile[MAX_PATH], tszBackFile[MAX_PATH];
+ wchar_t *ptszNewName = mir_utf8decodeT(filename);
if (ptszNewName == NULL)
ptszNewName = mir_a2t(filename);
@@ -77,11 +77,11 @@ bool extractCurrentFile(unzFile uf, TCHAR *ptszDestPath, TCHAR *ptszBackPath, bo
PrepareFileName(tszDestFile, _countof(tszDestFile), ptszDestPath, ptszNewName);
SafeCreateFilePath(tszDestFile);
- TCHAR *ptszFile2unzip;
+ wchar_t *ptszFile2unzip;
if (hPipe == NULL) // direct mode
ptszFile2unzip = tszDestFile;
else {
- TCHAR tszTempPath[MAX_PATH];
+ wchar_t tszTempPath[MAX_PATH];
GetTempPath( _countof(tszTempPath), tszTempPath);
GetTempFileName(tszTempPath, L"PUtemp", GetCurrentProcessId(), tszBackFile);
ptszFile2unzip = tszBackFile;
@@ -120,7 +120,7 @@ bool extractCurrentFile(unzFile uf, TCHAR *ptszDestPath, TCHAR *ptszBackPath, bo
return true;
}
-bool unzip(const TCHAR *ptszZipFile, TCHAR *ptszDestPath, TCHAR *ptszBackPath,bool ch)
+bool unzip(const wchar_t *ptszZipFile, wchar_t *ptszDestPath, wchar_t *ptszBackPath,bool ch)
{
bool bResult = true;
diff --git a/plugins/Popup/src/bitmap_funcs.cpp b/plugins/Popup/src/bitmap_funcs.cpp
index 547ab99a0f..9e2c094464 100644
--- a/plugins/Popup/src/bitmap_funcs.cpp
+++ b/plugins/Popup/src/bitmap_funcs.cpp
@@ -55,7 +55,7 @@ MyBitmap::MyBitmap(int w, int h)
allocate(w, h);
}
-MyBitmap::MyBitmap(const TCHAR *fn)
+MyBitmap::MyBitmap(const wchar_t *fn)
{
dcBmp = 0;
hBmp = 0;
@@ -594,7 +594,7 @@ void MyBitmap::DrawIcon(HICON hic, int x, int y, int w, int h)
DeleteObject(info.hbmMask);
}
-void MyBitmap::Draw_Text(TCHAR *str, int x, int y)
+void MyBitmap::Draw_Text(wchar_t *str, int x, int y)
{
SIZE sz; GetTextExtentPoint32(this->getDC(), str, (int)mir_tstrlen(str), &sz);
RECT rc; SetRect(&rc, x, y, x + 10000, y + 10000);
@@ -676,11 +676,11 @@ static int hex2dec(char hex)
return 0;
}
-bool MyBitmap::loadFromFile_pixel(const TCHAR *fn)
+bool MyBitmap::loadFromFile_pixel(const wchar_t *fn)
{
allocate(1, 1);
int r, g, b, a = 255;
- const TCHAR *p = fn + mir_tstrlen(L"pixel:");
+ const wchar_t *p = fn + mir_tstrlen(L"pixel:");
r = (hex2dec(p[0]) << 4) + hex2dec(p[1]);
g = (hex2dec(p[2]) << 4) + hex2dec(p[3]);
b = (hex2dec(p[4]) << 4) + hex2dec(p[5]);
@@ -688,9 +688,9 @@ bool MyBitmap::loadFromFile_pixel(const TCHAR *fn)
return true;
}
-bool MyBitmap::loadFromFile_gradient(const TCHAR *fn)
+bool MyBitmap::loadFromFile_gradient(const wchar_t *fn)
{
- const TCHAR *p = fn + mir_tstrlen(L"gradient:");
+ const wchar_t *p = fn + mir_tstrlen(L"gradient:");
if (*p == 'h') allocate(256, 1);
else allocate(1, 256);
@@ -720,14 +720,14 @@ bool MyBitmap::loadFromFile_gradient(const TCHAR *fn)
return true;
}
-bool MyBitmap::loadFromFile(const TCHAR *fn)
+bool MyBitmap::loadFromFile(const wchar_t *fn)
{
if (bits) freemem();
- if (!_tcsncmp(fn, L"pixel:", mir_tstrlen(L"pixel:")))
+ if (!wcsncmp(fn, L"pixel:", mir_tstrlen(L"pixel:")))
return loadFromFile_pixel(fn);
- if (!_tcsncmp(fn, L"gradient:", mir_tstrlen(L"gradient:")))
+ if (!wcsncmp(fn, L"gradient:", mir_tstrlen(L"gradient:")))
return loadFromFile_gradient(fn);
SIZE sz;
diff --git a/plugins/Popup/src/bitmap_funcs.h b/plugins/Popup/src/bitmap_funcs.h
index 64150200ee..bc1ab377eb 100644
--- a/plugins/Popup/src/bitmap_funcs.h
+++ b/plugins/Popup/src/bitmap_funcs.h
@@ -43,18 +43,18 @@ private:
void freemem();
- bool loadFromFile_pixel(const TCHAR *fn);
- bool loadFromFile_gradient(const TCHAR *fn);
+ bool loadFromFile_pixel(const wchar_t *fn);
+ bool loadFromFile_gradient(const wchar_t *fn);
void premultipleChannels();
public:
MyBitmap();
MyBitmap(int w, int h);
- MyBitmap(const TCHAR *fn);
+ MyBitmap(const wchar_t *fn);
~MyBitmap();
void allocate(int w, int h);
- bool loadFromFile(const TCHAR *fn);
+ bool loadFromFile(const wchar_t *fn);
int getWidth() { return width; }
int getHeight() { return height; }
@@ -87,7 +87,7 @@ public:
// void DrawPartColorized(MyBitmap *bmp, int x, int y, int w, int h, COLOR32 color);
void DrawIcon(HICON hic, int x, int y, int w = 0, int h = 0);
- void Draw_Text(TCHAR *str, int x, int y);
+ void Draw_Text(wchar_t *str, int x, int y);
__forceinline COLOR32 *getBits() { return bits; }
__forceinline COLOR32 *getRow(int row) { return bits + row * width; }
diff --git a/plugins/Popup/src/config.cpp b/plugins/Popup/src/config.cpp
index 29178f9182..233fcdf811 100644
--- a/plugins/Popup/src/config.cpp
+++ b/plugins/Popup/src/config.cpp
@@ -89,12 +89,12 @@ void LoadOptions()
void PopupPreview()
{
- TCHAR *lptzTitle1Eng = TranslateT("The Jabberwocky");
- TCHAR *lptzText1Eng = TranslateT("`Twas brillig, and the slithy toves\r\nDid gyre and gimble in the wabe:\r\nAll mimsy were the borogoves,\r\nAnd the mome raths outgrabe.\r\n\t[b][i]Lewis Carroll, 1855[/i][/b]");
+ wchar_t *lptzTitle1Eng = TranslateT("The Jabberwocky");
+ wchar_t *lptzText1Eng = TranslateT("`Twas brillig, and the slithy toves\r\nDid gyre and gimble in the wabe:\r\nAll mimsy were the borogoves,\r\nAnd the mome raths outgrabe.\r\n\t[b][i]Lewis Carroll, 1855[/i][/b]");
- TCHAR *lptzTitle2 = TranslateT("Test preview for the popup plugin settings. This is supposed to be long enough not to fit in one line...");
- TCHAR *lptzText2 = TranslateTS(
- LPGENT("This is a special test preview for the popup plugin settings. The text and title are quite long so you can tweak your skin and plugin settings to best fit your needs :)")
+ wchar_t *lptzTitle2 = TranslateT("Test preview for the popup plugin settings. This is supposed to be long enough not to fit in one line...");
+ wchar_t *lptzText2 = TranslateTS(
+ LPGENW("This is a special test preview for the popup plugin settings. The text and title are quite long so you can tweak your skin and plugin settings to best fit your needs :)")
);
POPUPDATA2 ppd = { 0 };
diff --git a/plugins/Popup/src/config.h b/plugins/Popup/src/config.h
index 60af91a679..34bc824053 100644
--- a/plugins/Popup/src/config.h
+++ b/plugins/Popup/src/config.h
@@ -193,7 +193,7 @@ typedef struct TestStruct{
} TESTSIZE;
// Generic Message Box for Errors
-#define MSGERROR(text) MessageBox(NULL, text, _T(MODULNAME_LONG), MB_OK | MB_ICONERROR)
-#define MSGINFO (text) MessageBox(NULL, text, _T(MODULNAME_LONG), MB_OK | MB_ICONINFORMATION)
+#define MSGERROR(text) MessageBox(NULL, text, MODULNAME_LONG, MB_OK | MB_ICONERROR)
+#define MSGINFO (text) MessageBox(NULL, text, MODULNAME_LONG, MB_OK | MB_ICONINFORMATION)
#endif // __config_h__
diff --git a/plugins/Popup/src/font.cpp b/plugins/Popup/src/font.cpp
index 5c76722063..56b9c26eca 100644
--- a/plugins/Popup/src/font.cpp
+++ b/plugins/Popup/src/font.cpp
@@ -30,44 +30,44 @@ void InitFonts()
// Fonts
FontIDT fid = { 0 };
fid.cbSize = sizeof(FontIDT);
- mir_tstrncpy(fid.group, _T(PU_FNT_AND_COLOR), _countof(fid.group));
+ mir_tstrncpy(fid.group, PU_FNT_AND_COLORW, _countof(fid.group));
mir_strncpy(fid.dbSettingsGroup, PU_FNT_AND_COLOR_DB, _countof(fid.dbSettingsGroup));
fid.flags = FIDF_DEFAULTVALID;
fid.deffontsettings.charset = DEFAULT_CHARSET;
fid.deffontsettings.size = -11;
- mir_tstrncpy(fid.backgroundGroup, _T(PU_FNT_AND_COLOR), _countof(fid.backgroundGroup));
+ mir_tstrncpy(fid.backgroundGroup, PU_FNT_AND_COLORW, _countof(fid.backgroundGroup));
mir_tstrncpy(fid.backgroundName, PU_COL_BACK_NAME, _countof(fid.backgroundName));
mir_tstrncpy(fid.deffontsettings.szFace, L"Tahoma", _countof(fid.deffontsettings.szFace));
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TITLE), _countof(fid.name));
+ mir_tstrncpy(fid.name, PU_FNT_NAME_TITLE, _countof(fid.name));
mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_TITLE);
fid.deffontsettings.style = DBFONTF_BOLD;
fid.deffontsettings.colour = RGB(0, 0, 0);
FontRegisterT(&fid);
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_CLOCK), _countof(fid.name));
+ mir_tstrncpy(fid.name, PU_FNT_NAME_CLOCK, _countof(fid.name));
mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_CLOCK);
FontRegisterT(&fid);
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TEXT), _countof(fid.name));
+ mir_tstrncpy(fid.name, PU_FNT_NAME_TEXT, _countof(fid.name));
mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_TEXT);
fid.deffontsettings.style = 0;
FontRegisterT(&fid);
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_ACTION), _countof(fid.name));
+ mir_tstrncpy(fid.name, PU_FNT_NAME_ACTION, _countof(fid.name));
mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_ACTION);
fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS;
fid.deffontsettings.colour = RGB(0, 0, 255);
FontRegisterT(&fid);
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_HOVERED_ACTION), _countof(fid.name));
+ mir_tstrncpy(fid.name, PU_FNT_NAME_HOVERED_ACTION, _countof(fid.name));
mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_HOVERED_ACTION);
fid.deffontsettings.style = DBFONTF_UNDERLINE;
FontRegisterT(&fid);
ColourIDT cid = { 0 };
cid.cbSize = sizeof(ColourIDT);
- mir_tstrncpy(cid.group, _T(PU_FNT_AND_COLOR), _countof(cid.group));
+ mir_tstrncpy(cid.group, PU_FNT_AND_COLORW, _countof(cid.group));
mir_strncpy(cid.dbSettingsGroup, PU_FNT_AND_COLOR_DB, _countof(cid.dbSettingsGroup));
mir_tstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name));
@@ -95,35 +95,35 @@ void ReloadFonts()
LOGFONT lf = { 0 };
FontIDT fid = { 0 };
fid.cbSize = sizeof(FontIDT);
- mir_tstrncpy(fid.group, _T(PU_FNT_AND_COLOR), _countof(fid.name));
+ mir_tstrncpy(fid.group, PU_FNT_AND_COLORW, _countof(fid.name));
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TITLE), _countof(fid.name));
+ mir_tstrncpy(fid.name, PU_FNT_NAME_TITLE, _countof(fid.name));
fonts.clTitle = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
fonts.title = CreateFontIndirect(&lf);
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_CLOCK), _countof(fid.name));
+ mir_tstrncpy(fid.name, PU_FNT_NAME_CLOCK, _countof(fid.name));
fonts.clClock = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
fonts.clock = CreateFontIndirect(&lf);
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TEXT), _countof(fid.name));
+ mir_tstrncpy(fid.name, PU_FNT_NAME_TEXT, _countof(fid.name));
fonts.clText = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
fonts.text = CreateFontIndirect(&lf);
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_ACTION), _countof(fid.name));
+ mir_tstrncpy(fid.name, PU_FNT_NAME_ACTION, _countof(fid.name));
fonts.clAction = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
fonts.action = CreateFontIndirect(&lf);
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_HOVERED_ACTION), _countof(fid.name));
+ mir_tstrncpy(fid.name, PU_FNT_NAME_HOVERED_ACTION, _countof(fid.name));
fonts.clActionHover = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf);
fonts.actionHover = CreateFontIndirect(&lf);
ColourIDT cid = { 0 };
cid.cbSize = sizeof(ColourIDT);
- mir_tstrncpy(cid.group, _T(PU_FNT_AND_COLOR), _countof(cid.group));
+ mir_tstrncpy(cid.group, PU_FNT_AND_COLORW, _countof(cid.group));
mir_tstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name));
fonts.clBack = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, (LPARAM)&lf);
- mir_tstrncpy(cid.group, _T(PU_FNT_AND_COLOR), _countof(cid.group));
+ mir_tstrncpy(cid.group, PU_FNT_AND_COLORW, _countof(cid.group));
mir_tstrncpy(cid.name, PU_COL_AVAT_NAME, _countof(cid.name));
fonts.clAvatarBorder = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, (LPARAM)&lf);
diff --git a/plugins/Popup/src/font.h b/plugins/Popup/src/font.h
index 0b6c53a307..0967bb4c12 100644
--- a/plugins/Popup/src/font.h
+++ b/plugins/Popup/src/font.h
@@ -25,26 +25,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define __font_h__
//basic constants for all popup plugins
-#define PU_FNT_AND_COLOR LPGEN("Popups") //common main group for customice\font&color
-#define PU_FNT_AND_COLOR_DB MODULNAME //use eg mir_strcpy(fid.dbSettingsGroup, PU_FNT_GROUP_DB);
+#define PU_FNT_AND_COLOR LPGEN("Popups") //common main group for customice\font&color
+#define PU_FNT_AND_COLORW LPGENW("Popups") //common main group for customice\font&color
+#define PU_FNT_AND_COLOR_DB MODULNAME //use eg mir_strcpy(fid.dbSettingsGroup, PU_FNT_GROUP_DB);
#define PU_FNT_PREFIX "fnt%s" //use eg mir_snprintf(fid.prefix, _countof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_....);
-#define PU_FNT_NAME_TITLE LPGEN("Title") //use eg mir_tstrcpy(fid.name, _T(FNT_NAME_....)) for FontIDT
-#define PU_FNT_NAME_CLOCK LPGEN("Clock")
-#define PU_FNT_NAME_TEXT LPGEN("Text")
-#define PU_FNT_NAME_ACTION LPGEN("Action")
-#define PU_FNT_NAME_HOVERED_ACTION LPGEN("Hovered action")
-
-#define PU_COL_BACK_NAME LPGENT("Background")
-#define PU_COL_BACK_SETTING "ColourBg"
-#define PU_COL_BORD_NAME LPGENT("Border")
-#define PU_COL_BORD_SETTING "ColourBorder"
-#define PU_COL_SIDE_NAME LPGENT("Sidebar")
-#define PU_COL_SIDE_SETTING "ColourSidebar"
-#define PU_COL_LINE_NAME LPGENT("Title underline")
-#define PU_COL_LINE_SETTING "ColourUnderline"
-#define PU_COL_AVAT_NAME LPGENT("Avatar border")
-#define PU_COL_AVAT_SETTING "ColourAvatarBorder"
+#define PU_FNT_NAME_TITLE LPGENW("Title") //use eg mir_tstrcpy(fid.name, _T(FNT_NAME_....)) for FontIDT
+#define PU_FNT_NAME_CLOCK LPGENW("Clock")
+#define PU_FNT_NAME_TEXT LPGENW("Text")
+#define PU_FNT_NAME_ACTION LPGENW("Action")
+#define PU_FNT_NAME_HOVERED_ACTION LPGENW("Hovered action")
+
+#define PU_COL_BACK_NAME LPGENW("Background")
+#define PU_COL_BACK_SETTING "ColourBg"
+#define PU_COL_BORD_NAME LPGENW("Border")
+#define PU_COL_BORD_SETTING "ColourBorder"
+#define PU_COL_SIDE_NAME LPGENW("Sidebar")
+#define PU_COL_SIDE_SETTING "ColourSidebar"
+#define PU_COL_LINE_NAME LPGENW("Title underline")
+#define PU_COL_LINE_SETTING "ColourUnderline"
+#define PU_COL_AVAT_NAME LPGENW("Avatar border")
+#define PU_COL_AVAT_SETTING "ColourAvatarBorder"
struct PopupFonts
{
diff --git a/plugins/Popup/src/formula.cpp b/plugins/Popup/src/formula.cpp
index c328f32503..601d0e6cca 100644
--- a/plugins/Popup/src/formula.cpp
+++ b/plugins/Popup/src/formula.cpp
@@ -28,7 +28,7 @@ static inline bool myisspace(char ch)
return (ch >= 0) && (ch <= 32);
}
-int Formula::eval_neq(TCHAR *&s, Args *args, bool *vars) const
+int Formula::eval_neq(wchar_t *&s, Args *args, bool *vars) const
{
int left = eval_sum(s, args, vars);
while (*s) {
@@ -50,7 +50,7 @@ int Formula::eval_neq(TCHAR *&s, Args *args, bool *vars) const
return left;
}
-int Formula::eval_sum(TCHAR *&s, Args *args, bool *vars) const
+int Formula::eval_sum(wchar_t *&s, Args *args, bool *vars) const
{
int left = eval_mul(s, args, vars);
while (*s) {
@@ -68,7 +68,7 @@ int Formula::eval_sum(TCHAR *&s, Args *args, bool *vars) const
return left;
}
-int Formula::eval_mul(TCHAR *&s, Args *args, bool *vars) const
+int Formula::eval_mul(wchar_t *&s, Args *args, bool *vars) const
{
int left = eval_atom(s, args, vars);
while (*s) {
@@ -91,7 +91,7 @@ int Formula::eval_mul(TCHAR *&s, Args *args, bool *vars) const
return left;
}
-int Formula::eval_atom(TCHAR *&s, Args *args, bool *vars) const
+int Formula::eval_atom(wchar_t *&s, Args *args, bool *vars) const
{
while (*s) {
if (myisspace(*s)) {
@@ -137,7 +137,7 @@ int Formula::eval_atom(TCHAR *&s, Args *args, bool *vars) const
int Formula::eval(Args *args, bool *vars) const
{
if (vars) *vars = false;
- TCHAR *s = m_str;
+ wchar_t *s = m_str;
int res = eval_neq(s, args, vars);
return res;
}
diff --git a/plugins/Popup/src/formula.h b/plugins/Popup/src/formula.h
index a73908dd77..0abbc50565 100644
--- a/plugins/Popup/src/formula.h
+++ b/plugins/Popup/src/formula.h
@@ -72,17 +72,17 @@ public:
};
private:
- TCHAR *m_str;
- int eval_neq(TCHAR *&s, Args *args, bool *vars) const;
- int eval_sum(TCHAR *&s, Args *args, bool *vars) const;
- int eval_mul(TCHAR *&s, Args *args, bool *vars) const;
- int eval_atom(TCHAR *&s, Args *args, bool *vars) const;
+ wchar_t *m_str;
+ int eval_neq(wchar_t *&s, Args *args, bool *vars) const;
+ int eval_sum(wchar_t *&s, Args *args, bool *vars) const;
+ int eval_mul(wchar_t *&s, Args *args, bool *vars) const;
+ int eval_atom(wchar_t *&s, Args *args, bool *vars) const;
public:
Formula() :m_str(mir_tstrdup(L"")) {}
- Formula(TCHAR *s) :m_str(mir_tstrdup(s)) {}
+ Formula(wchar_t *s) :m_str(mir_tstrdup(s)) {}
~Formula() { mir_free(m_str); }
- void set(TCHAR *s){ mir_free(m_str); m_str = mir_tstrdup(s); }
+ void set(wchar_t *s){ mir_free(m_str); m_str = mir_tstrdup(s); }
int eval(Args *args, bool *vars = 0) const;
};
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp
index 39e20dae06..ff38a8977a 100644
--- a/plugins/Popup/src/main.cpp
+++ b/plugins/Popup/src/main.cpp
@@ -148,14 +148,14 @@ INT_PTR svcEnableDisableMenuCommand(WPARAM, LPARAM)
// The action to do is "disable popups" (show disabled) and we must write "enable popup" in the new item.
PopupOptions.ModuleIsEnabled = FALSE;
db_set_b(NULL, "Popup", "ModuleIsEnabled", FALSE);
- Menu_ModifyItem(hMenuItem, LPGENT("Enable Popups"), hIcon = GetIconHandle(IDI_NOPOPUP));
+ Menu_ModifyItem(hMenuItem, LPGENW("Enable Popups"), hIcon = GetIconHandle(IDI_NOPOPUP));
}
else {
// The module is disabled.
// The action to do is enable popups (show enabled), then write "disable popup" in the new item.
PopupOptions.ModuleIsEnabled = TRUE;
db_set_b(NULL, "Popup", "ModuleIsEnabled", TRUE);
- Menu_ModifyItem(hMenuItem, LPGENT("Disable Popups"), hIcon = GetIconHandle(IDI_POPUP));
+ Menu_ModifyItem(hMenuItem, LPGENW("Disable Popups"), hIcon = GetIconHandle(IDI_POPUP));
}
Menu_ModifyItem(hMenuRoot, NULL, hIcon);
@@ -180,14 +180,14 @@ void InitMenuItems(void)
HANDLE hIcon = GetIconHandle(PopupOptions.ModuleIsEnabled ? IDI_POPUP : IDI_NOPOPUP);
// Build main menu
- hMenuRoot = mi.root = Menu_CreateRoot(MO_MAIN, LPGENT(MODULNAME_PLU), -1000000000, hIcon);
+ hMenuRoot = mi.root = Menu_CreateRoot(MO_MAIN, MODULNAME_PLUW, -1000000000, hIcon);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "3F5B5AB5-46D8-469E-8951-50B287C59037");
// Add item to main menu
SET_UID(mi, 0x4353d44e, 0x177, 0x4843, 0x88, 0x30, 0x25, 0x5d, 0x91, 0xad, 0xdf, 0x3f);
mi.pszService = MENUCOMMAND_SVC;
CreateServiceFunction(mi.pszService, svcEnableDisableMenuCommand);
- mi.name.t = PopupOptions.ModuleIsEnabled ? LPGENT("Disable Popups") : LPGENT("Enable Popups");
+ mi.name.w = PopupOptions.ModuleIsEnabled ? LPGENW("Disable Popups") : LPGENW("Enable Popups");
mi.hIcolibItem = hIcon;
hMenuItem = Menu_AddMainMenuItem(&mi);
@@ -196,7 +196,7 @@ void InitMenuItems(void)
mi.pszService = MENUCOMMAND_HISTORY;
CreateServiceFunction(mi.pszService, svcShowHistory);
mi.position = 1000000000;
- mi.name.t = LPGENT("Popup History");
+ mi.name.w = LPGENW("Popup History");
mi.hIcolibItem = GetIconHandle(IDI_HISTORY);
hMenuItemHistory = Menu_AddMainMenuItem(&mi);
}
@@ -213,14 +213,14 @@ void LoadHotkey()
HOTKEYDESC hk = { sizeof(hk) };
hk.dwFlags = HKD_TCHAR;
hk.pszName = "Toggle Popups";
- hk.ptszDescription = LPGENT("Toggle Popups");
- hk.ptszSection = LPGENT(MODULNAME_PLU);
+ hk.ptszDescription = LPGENW("Toggle Popups");
+ hk.ptszSection = MODULNAME_PLUW;
hk.pszService = MENUCOMMAND_SVC;
Hotkey_Register(&hk);
// 'Popup History' Hotkey
hk.pszName = "Popup History";
- hk.ptszDescription = LPGENT("Popup History");
+ hk.ptszDescription = LPGENW("Popup History");
hk.pszService = MENUCOMMAND_HISTORY;
Hotkey_Register(&hk);
}
@@ -339,7 +339,7 @@ MIRAPI int Load(void)
PopupHistoryLoad();
LoadPopupThread();
if (!LoadPopupWnd2()) {
- MessageBox(0, TranslateT("Error: I could not register the Popup Window class.\r\nThe plugin will not operate."), _T(MODULNAME_LONG), MB_ICONSTOP | MB_OK);
+ MessageBox(0, TranslateT("Error: I could not register the Popup Window class.\r\nThe plugin will not operate."), MODULNAME_LONG, MB_ICONSTOP | MB_OK);
return 0; // We couldn't register our Window Class, don't hook any event: the plugin will act as if it was disabled.
}
RegisterOptPrevBox();
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp
index be9c78a595..9958db8c7d 100644
--- a/plugins/Popup/src/notifications.cpp
+++ b/plugins/Popup/src/notifications.cpp
@@ -87,7 +87,7 @@ void UnloadTreeData()
gTreeData.destroy();
}
-void SaveNotificationSettings(POPUPTREEDATA *ptd, char* szModul)
+void SaveNotificationSettings(POPUPTREEDATA *ptd, char *szModul)
{
if (ptd->typ == 1) {
char setting[2 * MAXMODULELABELLENGTH];
@@ -137,7 +137,6 @@ void LoadNotificationSettings(POPUPTREEDATA *ptd, char* szModul)
{
if (ptd->typ == 1) {
char setting[2 * MAXMODULELABELLENGTH];
- char *szTmp = NULL;
mir_snprintf(setting, "{%s/%s}enabled", ptd->notification.lpzGroup, ptd->notification.lpzName);
ptd->enabled =
@@ -157,7 +156,7 @@ void LoadNotificationSettings(POPUPTREEDATA *ptd, char* szModul)
db_get_b(NULL, szModul, setting, 0);
mir_snprintf(setting, "{%s/%s}leftAction", ptd->notification.lpzGroup, ptd->notification.lpzName);
- szTmp = db_get_s(NULL, szModul, setting, ptd->notification.lpzLAction);
+ char *szTmp = db_get_s(NULL, szModul, setting, ptd->notification.lpzLAction);
mir_strncpy(ptd->leftAction, szTmp, sizeof(ptd->leftAction));
mir_free(szTmp); szTmp = NULL;
@@ -186,7 +185,7 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification)
FontID fontid = { 0 };
fontid.cbSize = sizeof(fontid);
- mir_snprintf(fontid.group, PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
+ mir_snprintf(fontid.group, PU_FNT_AND_COLOR "/%s", notification->lpzGroup);
mir_strcpy(fontid.dbSettingsGroup, "PopupNotifications");
fontid.flags = FIDF_DEFAULTVALID;
fontid.deffontsettings.charset = DEFAULT_CHARSET;
@@ -297,7 +296,7 @@ bool PerformAction(HANDLE hNotification, HWND hwnd, UINT message, WPARAM wparam,
}
for (int i = 0; i < ptd->notification.actionCount; ++i) {
- if (!(ptd->notification.lpActions[i].dwFlags&PNAF_CALLBACK))
+ if (!(ptd->notification.lpActions[i].dwFlags & PNAF_CALLBACK))
continue;
if (mir_strcmp(ptd->notification.lpActions[i].lpzTitle, lpzAction))
continue;
diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp
index 48c3c75b59..323bd1ce7b 100644
--- a/plugins/Popup/src/opt_adv.cpp
+++ b/plugins/Popup/src/opt_adv.cpp
@@ -29,7 +29,7 @@ LRESULT CALLBACK AvatarTrackBarWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
LRESULT CALLBACK AlphaTrackBarWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
// effekt name for drop down box
-LIST<TCHAR> g_lstPopupVfx(5, _tcsicmp);
+LIST<wchar_t> g_lstPopupVfx(5, wcsicmp);
void OptAdv_RegisterVfx(char *name)
{
g_lstPopupVfx.insert(mir_a2t(name));
@@ -78,7 +78,7 @@ void LoadOption_AdvOpts()
INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TCHAR tstr[64];
+ wchar_t tstr[64];
static bool bDlgInit = false; // some controls send WM_COMMAND before or during WM_INITDIALOG
UINT idCtrl;
@@ -88,7 +88,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
{
hwndBox = CreateWindowEx(
WS_EX_TOOLWINDOW | WS_EX_TOPMOST, // dwStyleEx
- _T(BOXPREVIEW_WNDCLASS), // Class name
+ BOXPREVIEW_WNDCLASS, // Class name
NULL, // Title
DS_SETFONT | DS_FIXEDSYS | WS_POPUP, // dwStyle
CW_USEDEFAULT, // x
diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp
index abfb394d88..170603d799 100644
--- a/plugins/Popup/src/opt_class.cpp
+++ b/plugins/Popup/src/opt_class.cpp
@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//---------------------------------------------------------------------------
// Workaround for MS bug ComboBox_SelectItemData
-int ComboBox_SelectItem(HWND hwndCtl, char* data) {
+int ComboBox_SelectItem(HWND hwndCtl, char *data) {
int i = 0;
for (i; i < ComboBox_GetCount(hwndCtl); i++) {
if (mir_strcmp(data, (char*)ComboBox_GetItemData(hwndCtl, i)) == 0) {
@@ -186,7 +186,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
for (i = 0; i < gTreeData.getCount(); ++i) {
POPUPTREEDATA *p = gTreeData[i];
- TCHAR itemName[MAXMODULELABELLENGTH];
+ wchar_t itemName[MAXMODULELABELLENGTH];
int iconIndex;
if (p->typ == 1) { // Treeview part for typ 1 (notification)
@@ -195,7 +195,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
}
else { // Treeview part typ 2 (popup class api)
iconIndex = ImageList_ReplaceIcon(hImgLst, -1, p->pupClass.hIcon);
- mir_sntprintf(itemName, L"%s/%s", LPGENT("CLASS Plugins"), p->pszDescription);
+ mir_sntprintf(itemName, L"%s/%s", LPGENW("CLASS Plugins"), p->pszDescription);
}
OptTree_AddItem(hwndTree, itemName, (LPARAM)p, iconIndex);
}
@@ -396,14 +396,14 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
switch (idCtrl) {
case IDC_LACTION:
mir_strncpy(ptd->leftAction,
- (char *)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)),
- sizeof(ptd->leftAction));
+ (char*)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)),
+ _countof(ptd->leftAction));
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
case IDC_RACTION:
mir_strncpy(ptd->rightAction,
- (char *)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)),
- sizeof(ptd->rightAction));
+ (char*)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)),
+ _countof(ptd->rightAction));
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
}
@@ -490,8 +490,6 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
void LoadClassSettings(POPUPTREEDATA *ptd, char* szModul)
{
char setting[2 * MAXMODULELABELLENGTH];
- char *szTmp = NULL;
-
mir_snprintf(setting, "%s/enabled", ptd->pupClass.pszName);
ptd->enabled =
(signed char)db_get_b(NULL, szModul, setting, TRUE);
@@ -506,14 +504,14 @@ void LoadClassSettings(POPUPTREEDATA *ptd, char* szModul)
ptd->pupClass.iSeconds ? ptd->pupClass.iSeconds : PopupOptions.Seconds);
mir_snprintf(setting, "%s/leftAction", ptd->pupClass.pszName);
- szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_NOTHING); // standart ??
- mir_strncpy(ptd->leftAction, szTmp, sizeof(ptd->leftAction));
- mir_free(szTmp); szTmp = NULL;
+ char *szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_NOTHING); // standart ??
+ mir_strncpy(ptd->leftAction, szTmp, _countof(ptd->leftAction));
+ mir_free(szTmp);
mir_snprintf(setting, "%s/rightAction", ptd->pupClass.pszName);
szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_DISMISS); // standart ??
- mir_strncpy(ptd->rightAction, szTmp, sizeof(ptd->rightAction));
- mir_free(szTmp); szTmp = NULL;
+ mir_strncpy(ptd->rightAction, szTmp, _countof(ptd->rightAction));
+ mir_free(szTmp);
}
void SaveClassSettings(POPUPTREEDATA *ptd, char* szModul)
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp
index d10a95f507..70272f8176 100644
--- a/plugins/Popup/src/opt_gen.cpp
+++ b/plugins/Popup/src/opt_gen.cpp
@@ -47,7 +47,7 @@ int AddStatusMode(OPTTREE_OPTION *options, int pos, LPTSTR prefix, DWORD flag)
if (!flag) return pos;
options[pos].dwFlag = flag;
options[pos].groupId = OPTTREE_CHECK;
- options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR) * mir_tstrlen(prefix) + 32);
+ options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(wchar_t) * mir_tstrlen(prefix) + 32);
options[pos].pszSettingName = mir_tstrdup(prefix);
options[pos].iconIndex = 0;
@@ -55,16 +55,16 @@ int AddStatusMode(OPTTREE_OPTION *options, int pos, LPTSTR prefix, DWORD flag)
mir_tstrcat(options[pos].pszOptionName, L"/");
switch (flag)
{
- case PF2_IDLE: mir_tstrcat(options[pos].pszOptionName, LPGENT("Offline")); break;
- case PF2_ONLINE: mir_tstrcat(options[pos].pszOptionName, LPGENT("Online")); break;
- case PF2_INVISIBLE: mir_tstrcat(options[pos].pszOptionName, LPGENT("Invisible")); break;
- case PF2_SHORTAWAY: mir_tstrcat(options[pos].pszOptionName, LPGENT("Away")); break;
- case PF2_LONGAWAY: mir_tstrcat(options[pos].pszOptionName, LPGENT("Not available")); break;
- case PF2_LIGHTDND: mir_tstrcat(options[pos].pszOptionName, LPGENT("Occupied")); break;
- case PF2_HEAVYDND: mir_tstrcat(options[pos].pszOptionName, LPGENT("Do not disturb")); break;
- case PF2_FREECHAT: mir_tstrcat(options[pos].pszOptionName, LPGENT("Free for chat")); break;
- case PF2_OUTTOLUNCH: mir_tstrcat(options[pos].pszOptionName, LPGENT("Out to lunch")); break;
- case PF2_ONTHEPHONE: mir_tstrcat(options[pos].pszOptionName, LPGENT("On the phone")); break;
+ case PF2_IDLE: mir_tstrcat(options[pos].pszOptionName, LPGENW("Offline")); break;
+ case PF2_ONLINE: mir_tstrcat(options[pos].pszOptionName, LPGENW("Online")); break;
+ case PF2_INVISIBLE: mir_tstrcat(options[pos].pszOptionName, LPGENW("Invisible")); break;
+ case PF2_SHORTAWAY: mir_tstrcat(options[pos].pszOptionName, LPGENW("Away")); break;
+ case PF2_LONGAWAY: mir_tstrcat(options[pos].pszOptionName, LPGENW("Not available")); break;
+ case PF2_LIGHTDND: mir_tstrcat(options[pos].pszOptionName, LPGENW("Occupied")); break;
+ case PF2_HEAVYDND: mir_tstrcat(options[pos].pszOptionName, LPGENW("Do not disturb")); break;
+ case PF2_FREECHAT: mir_tstrcat(options[pos].pszOptionName, LPGENW("Free for chat")); break;
+ case PF2_OUTTOLUNCH: mir_tstrcat(options[pos].pszOptionName, LPGENW("Out to lunch")); break;
+ case PF2_ONTHEPHONE: mir_tstrcat(options[pos].pszOptionName, LPGENW("On the phone")); break;
}
return pos + 1;
}
@@ -151,7 +151,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
// Dynamic Resize
CheckDlgButton(hwnd, IDC_DYNAMICRESIZE, PopupOptions.DynamicResize ? BST_CHECKED : BST_UNCHECKED);
- SetDlgItemText(hwnd, IDC_USEMAXIMUMWIDTH, PopupOptions.DynamicResize ? LPGENT("Maximum width") : LPGENT("Width"));
+ SetDlgItemText(hwnd, IDC_USEMAXIMUMWIDTH, PopupOptions.DynamicResize ? LPGENW("Maximum width") : LPGENW("Width"));
// Minimum Width
CheckDlgButton(hwnd, IDC_USEMINIMUMWIDTH, PopupOptions.UseMinimumWidth ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwnd, IDC_MINIMUMWIDTH_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_MAXIMUMWIDTH_MAX, SETTING_MINIMUMWIDTH_MIN));
@@ -217,15 +217,15 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
statusOptions = new OPTTREE_OPTION[statusOptionsCount];
- int pos = AddStatusModes(statusOptions, 0, LPGENT("Global Status"), globalFlags);
+ int pos = AddStatusModes(statusOptions, 0, LPGENW("Global Status"), globalFlags);
for (int i = 0; i < protocolCount; ++i) {
if (!protocols[i]->bIsVirtual) {
DWORD protoFlags = CallProtoService(protocols[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0);
if (!CountStatusModes(protoFlags))
continue;
- TCHAR prefix[128];
- mir_sntprintf(prefix, LPGENT("Protocol Status")L"/%s", protocols[i]->tszAccountName);
+ wchar_t prefix[128];
+ mir_sntprintf(prefix, LPGENW("Protocol Status")L"/%s", protocols[i]->tszAccountName);
pos = AddStatusModes(statusOptions, pos, prefix, protoFlags);
}
}
@@ -242,12 +242,12 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
char prefix[128];
mir_snprintf(prefix, "Protocol Status/%s", protocols[i]->szModuleName);
- TCHAR pszSettingName[256];
- mir_sntprintf(pszSettingName, LPGENT("Protocol Status")L"/%s", protocols[i]->tszAccountName);
+ wchar_t pszSettingName[256];
+ mir_sntprintf(pszSettingName, LPGENW("Protocol Status")L"/%s", protocols[i]->tszAccountName);
OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, db_get_dw(NULL, MODULNAME, prefix, 0), pszSettingName);
}
}
- OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, db_get_dw(NULL, MODULNAME, "Global Status", 0), LPGENT("Global Status"));
+ OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, db_get_dw(NULL, MODULNAME, "Global Status", 0), LPGENW("Global Status"));
}
TranslateDialogDefault(hwnd); // do it on end of WM_INITDIALOG
@@ -528,7 +528,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
char prefix[128];
mir_snprintf(prefix, "Protocol Status/%s", protocols[i]->szModuleName);
- TCHAR pszSettingName[256];
+ wchar_t pszSettingName[256];
mir_sntprintf(pszSettingName, L"Protocol Status/%s", protocols[i]->tszAccountName);
db_set_dw(NULL, MODULNAME, prefix, OptTree_GetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, pszSettingName));
}
@@ -580,7 +580,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
void ErrorMSG(int minValue, int maxValue)
{
- TCHAR str[128];
+ wchar_t str[128];
mir_sntprintf(str, TranslateT("You cannot specify a value lower than %d and higher than %d."), minValue, maxValue);
MSGERROR(str);
}
diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp
index 867d70319b..a86b82c380 100644
--- a/plugins/Popup/src/opt_skins.cpp
+++ b/plugins/Popup/src/opt_skins.cpp
@@ -42,12 +42,12 @@ void RegisterOptPrevBox()
wcl.hCursor = LoadCursor(NULL, IDC_ARROW);
wcl.hbrBackground = NULL; // (HBRUSH)GetStockObject(LTGRAY_BRUSH);
wcl.lpszMenuName = NULL;
- wcl.lpszClassName = _T(BOXPREVIEW_WNDCLASS);
+ wcl.lpszClassName = BOXPREVIEW_WNDCLASS;
wcl.hIconSm = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
g_wndClass.cPopupPreviewBoxWndclass = RegisterClassEx(&wcl);
err = GetLastError();
if (!g_wndClass.cPopupPreviewBoxWndclass) {
- TCHAR msg[1024];
+ wchar_t msg[1024];
mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MSGERROR(msg);
}
@@ -61,7 +61,7 @@ void RegisterOptPrevBox()
g_wndClass.cPopupPlusDlgBox = RegisterClassEx(&wcl);
err = GetLastError();
if (!g_wndClass.cPopupPlusDlgBox) {
- TCHAR msg[1024];
+ wchar_t msg[1024];
mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MSGERROR(msg);
}
@@ -185,7 +185,7 @@ int SkinOptionList_AddSkin(OPTTREE_OPTION* &options, int *OptionsCount, int pos
options[pos].groupId = OPTTREE_CHECK;
options[pos].iconIndex = 0;
options[pos].pszSettingName = mir_tstrdup(L"Skin options");
- options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR)*(
+ options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(wchar_t)*(
mir_tstrlen(options[pos].pszSettingName) +
mir_strlen(skin->getFlagName(i)) + 10));
wsprintf(options[pos].pszOptionName, L"%s/%hs", options[pos].pszSettingName, skin->getFlagName(i)); // !!!!!!!!!!!!!
@@ -201,12 +201,12 @@ int SkinOptionList_AddSkin(OPTTREE_OPTION* &options, int *OptionsCount, int pos
/////////////////////////////////////////////////////////////////////////////////////////
static LPTSTR mainOption[] = {
- LPGENT("Show clock"),
- LPGENT("Drop shadow effect"),
- LPGENT("Drop shadow effect") L"/" LPGENT("non rectangular"),
- LPGENT("Enable Aero Glass (Vista+)"),
- LPGENT("Use Windows colors"),
- LPGENT("Use advanced text render") };
+ LPGENW("Show clock"),
+ LPGENW("Drop shadow effect"),
+ LPGENW("Drop shadow effect") L"/" LPGENW("non rectangular"),
+ LPGENW("Enable Aero Glass (Vista+)"),
+ LPGENW("Use Windows colors"),
+ LPGENW("Use advanced text render") };
int SkinOptionList_AddMain(OPTTREE_OPTION* &options, int *OptionsCount, int pos, DWORD *dwGlobalOptions)
{
@@ -245,8 +245,8 @@ int SkinOptionList_AddMain(OPTTREE_OPTION* &options, int *OptionsCount, int pos,
options[pos].dwFlag = (1 << i);
options[pos].groupId = OPTTREE_CHECK;
options[pos].iconIndex = 0;
- options[pos].pszSettingName = mir_tstrdup(LPGENT("Global settings"));
- options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR)*(
+ options[pos].pszSettingName = mir_tstrdup(LPGENW("Global settings"));
+ options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(wchar_t)*(
mir_tstrlen(options[pos].pszSettingName) +
mir_tstrlen(mainOption[i]) + 10));
wsprintf(options[pos].pszOptionName, L"%s/%s", options[pos].pszSettingName, mainOption[i]); // !!!!!!!!!!!!!
@@ -403,7 +403,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
break;
case IDC_BTN_RELOAD:
- LPTSTR pszOldSkin = NEWTSTR_ALLOCA(PopupOptions.SkinPack);
+ LPTSTR pszOldSkin = NEWWSTR_ALLOCA(PopupOptions.SkinPack);
skins.load();
hCtrl = GetDlgItem(hwndDlg, IDC_SKINLIST);
ListBox_ResetContent(hCtrl);
@@ -414,7 +414,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
ListBox_SetCurSel(hCtrl, ListBox_FindString(hCtrl, 0, PopupOptions.SkinPack));
// make shure we have select skin (ListBox_SetCurSel may be fail)
- TCHAR szNewSkin[128];
+ wchar_t szNewSkin[128];
ListBox_GetText(hCtrl, ListBox_GetCurSel(hCtrl), &szNewSkin);
if (mir_tstrcmp(pszOldSkin, szNewSkin) != 0) {
mir_free(PopupOptions.SkinPack);
@@ -440,7 +440,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
{
// Skin list change
mir_free(PopupOptions.SkinPack);
- PopupOptions.SkinPack = mir_tstrdup((TCHAR *)SendDlgItemMessage(
+ PopupOptions.SkinPack = mir_tstrdup((wchar_t *)SendDlgItemMessage(
hwndDlg,
IDC_SKINLIST,
LB_GETITEMDATA,
@@ -550,12 +550,12 @@ static void BoxPreview_OnPaint(HWND hwnd, HDC mydc, int mode)
rc.left += 30; // 10+16+4 -- icon
rc.right -= (rc.right - rc.left) / 3;
rc.bottom -= (rc.bottom - rc.top) / 3;
- DrawText(mydc, _T(MODULNAME_LONG), -1, &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
+ DrawText(mydc, MODULNAME_LONG, -1, &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
GetClientRect(hwnd, &rc);
rc.left += 30; // 10+16+4 -- icon
rc.left += (rc.right - rc.left) / 3;
rc.top += (rc.bottom - rc.top) / 3;
- DrawText(mydc, _T(MODULNAME_LONG), -1, &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
+ DrawText(mydc, MODULNAME_LONG, -1, &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
GetClientRect(hwnd, &rc);
FrameRect(mydc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
SelectObject(mydc, hfnt);
diff --git a/plugins/Popup/src/opt_skins.h b/plugins/Popup/src/opt_skins.h
index 6179ad35fb..e6200d6e25 100644
--- a/plugins/Popup/src/opt_skins.h
+++ b/plugins/Popup/src/opt_skins.h
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef CS_DROPSHADOW
#define CS_DROPSHADOW 0x00020000
#endif
-#define BOXPREVIEW_WNDCLASS "PopupPreviewBoxWndclass"
+#define BOXPREVIEW_WNDCLASS L"PopupPreviewBoxWndclass"
void RegisterOptPrevBox();
diff --git a/plugins/Popup/src/opttree.cpp b/plugins/Popup/src/opttree.cpp
index 1bacdf0212..c86ec17fb2 100644
--- a/plugins/Popup/src/opttree.cpp
+++ b/plugins/Popup/src/opttree.cpp
@@ -27,7 +27,7 @@ enum { IMG_GROUP, IMG_CHECK, IMG_NOCHECK, IMG_RCHECK, IMG_NORCHECK, IMG_GRPOPEN,
static void OptTree_TranslateItem(HWND hwndTree, HTREEITEM hItem)
{
- TCHAR buf[64];
+ wchar_t buf[64];
TVITEM tvi = { 0 };
tvi.mask = TVIF_HANDLE | TVIF_TEXT;
@@ -65,10 +65,10 @@ void OptTree_Translate(HWND hwndTree)
}
}
-HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TCHAR *name)
+HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const wchar_t *name)
{
TVITEM tvi = { 0 };
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
if (hItem)
tvi.hItem = TreeView_GetChild(hwndTree, hItem);
@@ -95,9 +95,9 @@ HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TCHA
HTREEITEM OptTree_AddItem(HWND hwndTree, LPTSTR name, LPARAM lParam, int iconIndex)
{
- TCHAR itemName[1024];
+ wchar_t itemName[1024];
- TCHAR *sectionName;
+ wchar_t *sectionName;
int sectionLevel = 0;
HTREEITEM hSection = NULL, result = NULL;
@@ -106,10 +106,10 @@ HTREEITEM OptTree_AddItem(HWND hwndTree, LPTSTR name, LPARAM lParam, int iconInd
while (sectionName) {
// allow multi-level tree
- TCHAR *pItemName = sectionName;
+ wchar_t *pItemName = sectionName;
HTREEITEM hItem;
- if (sectionName = _tcschr(sectionName, '/')) {
+ if (sectionName = wcschr(sectionName, '/')) {
// one level deeper
*sectionName = 0;
sectionName++;
@@ -154,7 +154,7 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, int *res
case WM_INITDIALOG:
{
int indx;
- TCHAR itemName[1024];
+ wchar_t itemName[1024];
HIMAGELIST hImgLst;
TreeView_SelectItem(hwndTree, NULL);
@@ -172,7 +172,7 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, int *res
/* build options tree. based on code from IcoLib */
for (indx = 0; indx < optionCount; indx++) {
- TCHAR *sectionName;
+ wchar_t *sectionName;
int sectionLevel = 0;
HTREEITEM hSection = NULL;
@@ -181,10 +181,10 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, int *res
while (sectionName) {
// allow multi-level tree
- TCHAR *pItemName = sectionName;
+ wchar_t *pItemName = sectionName;
HTREEITEM hItem;
- if (sectionName = _tcschr(sectionName, '/')) {
+ if (sectionName = wcschr(sectionName, '/')) {
// one level deeper
*sectionName = 0;
sectionName++;
diff --git a/plugins/Popup/src/popup_gdiplus.cpp b/plugins/Popup/src/popup_gdiplus.cpp
index 0f6212d7e9..4c788a0679 100644
--- a/plugins/Popup/src/popup_gdiplus.cpp
+++ b/plugins/Popup/src/popup_gdiplus.cpp
@@ -99,7 +99,7 @@ HBITMAP SkinEngine_CreateDIB32(int cx, int cy)
}
-BOOL GDIPlus_IsAnimatedGIF(TCHAR * szName)
+BOOL GDIPlus_IsAnimatedGIF(wchar_t * szName)
{
int nFrameCount = 0;
Image image(szName);
@@ -118,7 +118,7 @@ BOOL GDIPlus_IsAnimatedGIF(TCHAR * szName)
return (BOOL)(nFrameCount > 1) && image.GetWidth() && image.GetHeight();
}
-void GDIPlus_GetGIFSize(TCHAR *szName, int *width, int *height)
+void GDIPlus_GetGIFSize(wchar_t *szName, int *width, int *height)
{
Image image(szName);
@@ -126,7 +126,7 @@ void GDIPlus_GetGIFSize(TCHAR *szName, int *width, int *height)
*height = image.GetHeight();
}
-void GDIPlus_ExtractAnimatedGIF(TCHAR *szName, int width, int height, HBITMAP &pBitmap, int* &pframesDelay, int &pframesCount, SIZE &pSizeAvatar)
+void GDIPlus_ExtractAnimatedGIF(wchar_t *szName, int width, int height, HBITMAP &pBitmap, int* &pframesDelay, int &pframesCount, SIZE &pSizeAvatar)
{
int nFrameCount = 0;
Bitmap image(szName);
diff --git a/plugins/Popup/src/popup_gdiplus.h b/plugins/Popup/src/popup_gdiplus.h
index bd67c5efd2..a398e686f9 100644
--- a/plugins/Popup/src/popup_gdiplus.h
+++ b/plugins/Popup/src/popup_gdiplus.h
@@ -26,8 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void LoadGDIPlus();
void UnloadGDIPlus();
-BOOL GDIPlus_IsAnimatedGIF(TCHAR * szName);
-void GDIPlus_GetGIFSize(TCHAR * szName, int * width, int * height);
-void GDIPlus_ExtractAnimatedGIF(TCHAR *szName, int width, int height, HBITMAP &pBitmap, int* &pframesDelay, int &pframesCount, SIZE &pSizeAvatar);
+BOOL GDIPlus_IsAnimatedGIF(wchar_t * szName);
+void GDIPlus_GetGIFSize(wchar_t * szName, int * width, int * height);
+void GDIPlus_ExtractAnimatedGIF(wchar_t *szName, int width, int height, HBITMAP &pBitmap, int* &pframesDelay, int &pframesCount, SIZE &pSizeAvatar);
#endif // __popup_gdiplus_h__
diff --git a/plugins/Popup/src/popup_thread.cpp b/plugins/Popup/src/popup_thread.cpp
index 6b2a5e70bd..a2a42b263d 100644
--- a/plugins/Popup/src/popup_thread.cpp
+++ b/plugins/Popup/src/popup_thread.cpp
@@ -231,7 +231,7 @@ static unsigned __stdcall PopupThread(void *)
g_wndClass.cPopupThreadManagerWnd = RegisterClassEx(&wcl);
err = GetLastError();
if (!g_wndClass.cPopupThreadManagerWnd) {
- TCHAR msg[1024];
+ wchar_t msg[1024];
mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MSGERROR(msg);
}
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp
index 1527c641de..b64c225c26 100644
--- a/plugins/Popup/src/popup_wnd2.cpp
+++ b/plugins/Popup/src/popup_wnd2.cpp
@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "bitmap_funcs.h"
#include <math.h>
-#define POPUP_WNDCLASS "PopupWnd2"
+#define POPUP_WNDCLASS L"PopupWnd2"
#ifndef CS_DROPSHADOW
#define CS_DROPSHADOW 0x00020000
@@ -54,15 +54,15 @@ bool LoadPopupWnd2()
wcl.hInstance = hInst;
wcl.hCursor = LoadCursor(NULL, IDC_ARROW);
wcl.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
- wcl.lpszClassName = _T(POPUP_WNDCLASS);
+ wcl.lpszClassName = POPUP_WNDCLASS;
wcl.hIconSm = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
g_wndClass.cPopupWnd2 = RegisterClassEx(&wcl);
DWORD err = GetLastError();
if (!g_wndClass.cPopupWnd2) {
res = false;
- TCHAR msg[1024];
+ wchar_t msg[1024];
mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
- MessageBox(NULL, msg, _T(MODULNAME_LONG), MB_ICONSTOP | MB_OK);
+ MessageBox(NULL, msg, MODULNAME_LONG, MB_ICONSTOP | MB_OK);
}
WNDCLASSEX wclw = { 0 };
@@ -75,7 +75,7 @@ bool LoadPopupWnd2()
g_wndClass.cPopupEditBox = RegisterClassEx(&wclw);
err = GetLastError();
if (!g_wndClass.cPopupEditBox) {
- TCHAR msg[2048];
+ wchar_t msg[2048];
mir_sntprintf(msg, TranslateT("Failed to register custom edit box window class.\r\n\r\ncbSize: %i\r\nstyle: %p\r\nlpfnWndProc: %i\r\ncbClsExtra: %i\r\ncbWndExtra: %i\r\nhInstance: %i\r\nhIcon: %i\r\nhCursor: %i\r\nhbrBackground: %i\r\nlpszMenuName: %s\r\nlpszClassName: %s\r\nhIconSm: %i\r\n"),
wclw.cbSize, wclw.style, wclw.lpfnWndProc, wclw.cbClsExtra, wclw.cbWndExtra, wclw.hInstance, wclw.hIcon, wclw.hCursor,
wclw.hbrBackground, wclw.lpszMenuName, wclw.lpszClassName, wclw.hIconSm);
@@ -100,7 +100,7 @@ bool LoadPopupWnd2()
err = GetLastError();
if (!g_wndClass.cPopupMenuHostWnd) {
res = false;
- TCHAR msg[1024];
+ wchar_t msg[1024];
mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MSGERROR(msg);
}
@@ -166,7 +166,7 @@ void PopupWnd2::create()
m_hwnd = CreateWindowEx(
WS_EX_TRANSPARENT | // prevents unwanted clicks
WS_EX_TOOLWINDOW | WS_EX_TOPMOST, // dwStyleEx
- _T(POPUP_WNDCLASS), // Class name
+ POPUP_WNDCLASS, // Class name
NULL, // Title
DS_SETFONT | DS_FIXEDSYS | WS_POPUP, // dwStyle
CW_USEDEFAULT, // x
@@ -485,7 +485,7 @@ void PopupWnd2::hide()
// hwnd = 0;
}
-bool __forceinline isTextEmpty(TCHAR *text)
+bool __forceinline isTextEmpty(wchar_t *text)
{
if (!text)
return true;
@@ -765,7 +765,7 @@ void PopupWnd2::buildMText()
}
}
-void PopupWnd2::updateText(TCHAR *text)
+void PopupWnd2::updateText(wchar_t *text)
{
if (m_lptzText) {
replaceStrT(m_lptzText, text);
@@ -775,7 +775,7 @@ void PopupWnd2::updateText(TCHAR *text)
m_bTextEmpty = ::isTextEmpty(m_lptzText);
}
-void PopupWnd2::updateTitle(TCHAR *title)
+void PopupWnd2::updateTitle(wchar_t *title)
{
if (m_lptzTitle) {
replaceStrT(m_lptzTitle, title);
@@ -831,7 +831,7 @@ LRESULT CALLBACK ReplyEditWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
case WM_KEYDOWN:
switch (wParam) {
case VK_RETURN:
- TCHAR msg[2048];
+ wchar_t msg[2048];
GetWindowText(hwnd, msg, _countof(msg));
if (mir_wstrlen(msg) == 0) {
DestroyWindow(hwnd);
@@ -983,8 +983,8 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
if (OpenClipboard(m_hwnd)) {
EmptyClipboard();
- HGLOBAL clipbuffer = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, (tszText.GetLength() + 1) * sizeof(TCHAR));
- TCHAR *buffer = (TCHAR *)GlobalLock(clipbuffer);
+ HGLOBAL clipbuffer = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, (tszText.GetLength() + 1) * sizeof(wchar_t));
+ wchar_t *buffer = (wchar_t *)GlobalLock(clipbuffer);
mir_tstrcpy(buffer, tszText);
GlobalUnlock(clipbuffer);
SetClipboardData(CF_UNICODETEXT, clipbuffer);
@@ -1132,8 +1132,8 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
case UM_CHANGEPOPUP:
switch (wParam) {
- case CPT_TEXTW: updateText((TCHAR *)lParam); mir_free((void *)lParam); break;
- case CPT_TITLEW: updateTitle((TCHAR *)lParam); mir_free((void *)lParam); break;
+ case CPT_TEXTW: updateText((wchar_t *)lParam); mir_free((void *)lParam); break;
+ case CPT_TITLEW: updateTitle((wchar_t *)lParam); mir_free((void *)lParam); break;
case CPT_DATAW: updateData((POPUPDATAW_V2 *)lParam); mir_free((void *)lParam); break;
}
update();
diff --git a/plugins/Popup/src/popup_wnd2.h b/plugins/Popup/src/popup_wnd2.h
index 7e0af55bd4..96bf23ff97 100644
--- a/plugins/Popup/src/popup_wnd2.h
+++ b/plugins/Popup/src/popup_wnd2.h
@@ -54,13 +54,13 @@ private:
// content
TextType m_textType;
- TCHAR *m_lptzTitle, *m_lptzText;
+ wchar_t *m_lptzTitle, *m_lptzText;
HANDLE m_mtTitle, m_mtText;
bool m_bTextEmpty, m_bIcoLib;
HFONT m_hfnTitle, m_hfnText;
HICON m_hIcon;
HBITMAP m_hbmAvatar;
- TCHAR m_time[2 + 1 + 2 + 1];
+ wchar_t m_time[2 + 1 + 2 + 1];
ActionInfo* m_actions;
int m_actionCount;
HANDLE m_hNotification;
@@ -131,8 +131,8 @@ public:
void updateData(POPUPDATAW_V2 *ppd);
void updateData(POPUPDATA2 *ppd);
void buildMText();
- void updateText(TCHAR *text);
- void updateTitle(TCHAR *title);
+ void updateText(wchar_t *text);
+ void updateTitle(wchar_t *title);
void updateTimer();
@@ -146,15 +146,15 @@ public:
bool isTextEmpty() { return m_bTextEmpty; }
bool isIcolib() { return m_bIcoLib; }
TextType getTextType() { return m_textType; }
- TCHAR *getText() { return m_lptzText; }
+ wchar_t *getText() { return m_lptzText; }
HANDLE getTextM() { return m_mtText; }
- TCHAR *getTitle() { return m_lptzTitle; }
+ wchar_t *getTitle() { return m_lptzTitle; }
HANDLE getTitleM() { return m_mtTitle; }
int getActionCount() { return m_actionCount; }
ActionInfo *getActions() { return m_actions; }
- TCHAR *getTime() { return m_time; }
+ wchar_t *getTime() { return m_time; }
HICON getIcon() { return m_hIcon; }
MCONTACT getContact() { return m_hContact; }
MCONTACT getContactPassed() { return m_hContactPassed; }
@@ -210,8 +210,8 @@ public:
LRESULT m_updateData_POPUPDATAW_V2(LPARAM arg) { updateData((POPUPDATAW_V2 *)arg); update(); return 0; }
LRESULT m_updateData_POPUPDATA2(LPARAM arg) { updateData((POPUPDATA2 *)arg); update(); return 0; }
- LRESULT m_updateText(LPARAM arg) { updateText((TCHAR *)arg); update(); return 0; }
- LRESULT m_updateTitle(LPARAM arg) { updateTitle((TCHAR *)arg); update(); return 0; }
+ LRESULT m_updateText(LPARAM arg) { updateText((wchar_t *)arg); update(); return 0; }
+ LRESULT m_updateTitle(LPARAM arg) { updateTitle((wchar_t *)arg); update(); return 0; }
LRESULT m_show(LPARAM) { show(); return 0; }
LRESULT m_hide(LPARAM) { hide(); return 0; }
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp
index ce5b1da030..676ac0beab 100644
--- a/plugins/Popup/src/services.cpp
+++ b/plugins/Popup/src/services.cpp
@@ -237,7 +237,7 @@ INT_PTR Popup_ShowMessageW(WPARAM wParam, LPARAM lParam)
POPUPDATA2 ppd2 = { 0 };
ppd2.cbSize = sizeof(ppd2);
ppd2.flags = PU2_UNICODE;
- ppd2.lptzText = (TCHAR*)wParam;
+ ppd2.lptzText = (wchar_t*)wParam;
switch (lParam & 0x7fffffff) {
case SM_ERROR:
ppd2.lchIcon = LoadIconEx(IDI_MB_STOP, 0);
@@ -381,13 +381,13 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam)
ptd->pupClass.colorText = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, fonts.clText/*pc->colorText*/);
FontIDT fid = { 0 };
fid.cbSize = sizeof(FontIDT);
- mir_sntprintf(fid.group, _T(PU_FNT_AND_COLOR)L"/%S", ptd->pupClass.pszName);
+ mir_sntprintf(fid.group, _A2W(PU_FNT_AND_COLOR) L"/%S", ptd->pupClass.pszName);
mir_strncpy(fid.dbSettingsGroup, PU_MODULCLASS, _countof(fid.dbSettingsGroup) - 1);
fid.flags = FIDF_DEFAULTVALID;
fid.deffontsettings.charset = DEFAULT_CHARSET;
fid.deffontsettings.size = -11;
mir_tstrncpy(fid.deffontsettings.szFace, L"Verdana", _countof(fid.deffontsettings.szFace) - 1);
- mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TEXT), _countof(fid.name) - 1);
+ mir_tstrncpy(fid.name, PU_FNT_NAME_TEXT, _countof(fid.name) - 1);
mir_strncpy(fid.prefix, setting, _countof(fid.prefix));
mir_snprintf(fid.prefix, "%s/Text", ptd->pupClass.pszName); // result is "%s/TextCol"
fid.deffontsettings.style = 0;
@@ -399,7 +399,7 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam)
ptd->pupClass.colorBack = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, (DWORD)fonts.clBack/*pc->colorBack*/);
ColourIDT cid = { 0 };
cid.cbSize = sizeof(ColourIDT);
- mir_sntprintf(cid.group, _T(PU_FNT_AND_COLOR)L"/%S", ptd->pupClass.pszName);
+ mir_sntprintf(cid.group, _A2W(PU_FNT_AND_COLOR) L"/%S", ptd->pupClass.pszName);
mir_strncpy(cid.dbSettingsGroup, PU_MODULCLASS, _countof(fid.dbSettingsGroup));
mir_tstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name));
mir_snprintf(cid.setting, "%s/BgCol", ptd->pupClass.pszName);
@@ -457,8 +457,8 @@ INT_PTR Popup_CreateClassPopup(WPARAM wParam, LPARAM lParam)
ppd2.PluginWindowProc = pc->PluginWindowProc;
if (pc->flags & PCF_UNICODE) {
ppd2.flags = PU2_UNICODE;
- ppd2.lptzTitle = (TCHAR*)pdc->ptszTitle;
- ppd2.lptzText = (TCHAR*)pdc->ptszText;
+ ppd2.lptzTitle = (wchar_t*)pdc->pwszTitle;
+ ppd2.lptzText = (wchar_t*)pdc->pwszText;
}
else {
ppd2.flags = PU2_ANSI;
diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp
index 96913d57cf..242bf7b4c2 100644
--- a/plugins/Popup/src/skin.cpp
+++ b/plugins/Popup/src/skin.cpp
@@ -62,7 +62,7 @@ SIZE PopupSkin::measureAction(HDC hdc, POPUPACTION *act) const
SIZE szText, szSpace;
LPTSTR wname = mir_a2t(name);
- TCHAR *str = TranslateTS(wname);
+ wchar_t *str = TranslateTS(wname);
GetTextExtentPoint32(hdc, str, (int)mir_tstrlen(str), &szText);
mir_free(wname);
GetTextExtentPoint32(hdc, L" ", 1, &szSpace);
@@ -125,7 +125,7 @@ void PopupSkin::drawAction(MyBitmap *bmp, POPUPACTION *act, int x, int y, bool h
GetTextExtentPoint32(bmp->getDC(), L" ", 1, &szSpace);
LPTSTR wname = mir_a2t(name);
- TCHAR *str = TranslateTS(wname);
+ wchar_t *str = TranslateTS(wname);
GetTextExtentPoint32(bmp->getDC(), str, (int)mir_tstrlen(str), &szText);
bmp->Draw_Text(str,
(PopupOptions.actions&ACT_LARGE) ? (x + szSpace.cx + 32) : (x + szSpace.cx + 16),
@@ -185,7 +185,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options
SIZE szNew;
szNew.cx = head->clocksize[CLOCK_LEFT] + head->clocksize[CLOCK_RIGHT];
szNew.cy = head->myBmp->getHeight();
- for (TCHAR *p = wnd->getTime(); *p; p++) {
+ for (wchar_t *p = wnd->getTime(); *p; p++) {
if (*p == ':')
szNew.cx += head->clocksize[CLOCK_SEPARATOR];
else if ((*p >= '0') && (*p <= '9'))
@@ -333,7 +333,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options
if (head && head->myBmp) {
szNew.cx = head->clocksize[CLOCK_LEFT] + head->clocksize[CLOCK_RIGHT];
szNew.cy = head->myBmp->getHeight();
- for (TCHAR *p = wnd->getTime(); *p; p++) {
+ for (wchar_t *p = wnd->getTime(); *p; p++) {
if (*p == ':')
szNew.cx += head->clocksize[CLOCK_SEPARATOR];
else if ((*p >= '0') && (*p <= '9'))
@@ -429,7 +429,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW
SIZE szNew;
szNew.cx = head->clocksize[CLOCK_LEFT] + head->clocksize[CLOCK_RIGHT];
szNew.cy = head->myBmp->getHeight();
- for (TCHAR *p = wnd->getTime(); *p; p++) {
+ for (wchar_t *p = wnd->getTime(); *p; p++) {
if (*p == ':')
szNew.cx += head->clocksize[CLOCK_SEPARATOR];
else if ((*p >= '0') && (*p <= '9'))
@@ -661,7 +661,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW
bmp->BlendPart(head->myBmp, head->clockstart[CLOCK_LEFT], 0, head->clocksize[CLOCK_LEFT], sy, x, y, head->clocksize[CLOCK_LEFT], sy);
x += head->clocksize[CLOCK_LEFT];
- for (TCHAR *p = wnd->getTime(); *p; p++) {
+ for (wchar_t *p = wnd->getTime(); *p; p++) {
int clock_idx = -1;
if (*p == ':')
clock_idx = CLOCK_SEPARATOR;
@@ -741,7 +741,7 @@ bool PopupSkin::onMouseLeave(PopupWnd2 *wnd) const
void PopupSkin::loadOptions(std::wistream &f)
{
- TCHAR *buf = new TCHAR[1024];
+ wchar_t *buf = new wchar_t[1024];
while (!f.eof()) {
f >> buf;
if (*buf == '#') {
@@ -755,10 +755,10 @@ void PopupSkin::loadOptions(std::wistream &f)
id--;
if (m_flag_names[id])
mir_free(m_flag_names[id]);
- TCHAR *p = buf;
+ wchar_t *p = buf;
while (isspace(*p))
p++;
- TCHAR *q = p + mir_tstrlen(p) - 1;
+ wchar_t *q = p + mir_tstrlen(p) - 1;
while ((q >= p) && isspace(*q))
*q-- = 0;
m_flag_names[id] = mir_t2a(p);
@@ -783,11 +783,11 @@ bool PopupSkin::load(LPCTSTR dir)
}
m_flags = 0;
- if (!_tcsncmp(L"res:", dir, 4)) // resource
+ if (!wcsncmp(L"res:", dir, 4)) // resource
loadSkin(dir + 4, L"Skin");
else { // filesystem
// skin info
- TCHAR dir_save[1024];
+ wchar_t dir_save[1024];
GetCurrentDirectory(1024, dir_save);
SetCurrentDirectory(dir);
@@ -829,7 +829,7 @@ void PopupSkin::loadSkin(std::wistream &f)
head->next = NULL;
while (!f.eof()) {
- TCHAR buf[1024];
+ wchar_t buf[1024];
f >> buf;
if (!*buf)
@@ -900,7 +900,7 @@ void PopupSkin::loadSkin(LPCTSTR lpName, LPCTSTR lpType)
HRSRC hRes = FindResource(hInst, lpName, lpType);
HRSRC hResLoad = (HRSRC)LoadResource(hInst, hRes);
char *lpResLock = (char *)LockResource(hResLoad);
- std::wistringstream stream((TCHAR*)_A2T(lpResLock));
+ std::wistringstream stream((wchar_t*)_A2T(lpResLock));
loadSkin(stream);
UnlockResource(lpResLock);
FreeResource(hRes);
@@ -917,7 +917,7 @@ PopupSkin::SKINELEMENT *PopupSkin::loadObject(std::wistream &f)
element->myBmp = NULL;
while (!f.eof()) {
- TCHAR buf[1024];
+ wchar_t buf[1024];
f >> buf;
if (!*buf)
@@ -1087,11 +1087,11 @@ bool Skins::load()
skin->next = m_skins;
m_skins = skin;
m_skins->name = mir_tstrdup(L"* Popup Classic");
- m_skins->dir = new TCHAR[1024];
+ m_skins->dir = new wchar_t[1024];
mir_tstrcpy(m_skins->dir, L"res:classic.popupskin");
m_skins->skin = 0;
- TCHAR dir[1024] = { '\0' };
+ wchar_t dir[1024] = { '\0' };
if (ServiceExists(MS_FOLDERS_GET_PATH)) {
if (FoldersGetCustomPathT(folderId, dir, _countof(dir), NULL) != 0)
@@ -1104,7 +1104,7 @@ bool Skins::load()
return false;
}
- TCHAR dir_save[1024];
+ wchar_t dir_save[1024];
GetCurrentDirectory(1024, dir_save);
SetCurrentDirectory(dir);
@@ -1118,7 +1118,7 @@ bool Skins::load()
skin->next = m_skins;
m_skins = skin;
m_skins->name = mir_tstrdup(ffd.cFileName);
- m_skins->dir = new TCHAR[1024];
+ m_skins->dir = new wchar_t[1024];
GetCurrentDirectory(1024, m_skins->dir);
m_skins->skin = 0;
@@ -1158,7 +1158,7 @@ const PopupSkin *Skins::getSkin(LPCTSTR name)
if (!any->skin->isCompatible())
MessageBox(NULL,
TranslateT("The skin you are trying to load is designed\r\nfor newer version of Popup plus. And will not\r\ndisplay properly.\r\n\r\nPlease choose another skin."),
- _T(MODULNAME_LONG), MB_ICONSTOP | MB_OK);
+ MODULNAME_LONG, MB_ICONSTOP | MB_OK);
return any->skin;
}
diff --git a/plugins/Popup/src/stdafx.h b/plugins/Popup/src/stdafx.h
index bc6507a35f..044916d971 100644
--- a/plugins/Popup/src/stdafx.h
+++ b/plugins/Popup/src/stdafx.h
@@ -129,8 +129,9 @@ http://miranda-ng.org/distr/
#define PU_MODULCLASS "PopupCLASS" // temp DB modul for this plugin
#define MODULNAME "Popup"
-#define MODULNAME_LONG "Popup Plus"
+#define MODULNAME_LONG L"Popup Plus"
#define MODULNAME_PLU "Popups"
+#define MODULNAME_PLUW L"Popups"
INT_PTR svcEnableDisableMenuCommand(WPARAM, LPARAM);
diff --git a/plugins/ProfileManager/src/pmanagerEx.cpp b/plugins/ProfileManager/src/pmanagerEx.cpp
index 39346ae714..44c62b11c6 100644
--- a/plugins/ProfileManager/src/pmanagerEx.cpp
+++ b/plugins/ProfileManager/src/pmanagerEx.cpp
@@ -48,7 +48,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
static INT_PTR ChangePM(WPARAM, LPARAM)
{
- TCHAR fn[MAX_PATH];
+ wchar_t fn[MAX_PATH];
GetModuleFileName(GetModuleHandle(NULL), fn, _countof(fn));
ShellExecute(0, L"open", fn, L"/ForceShowPM", L"", 1);
CallService("CloseAction", 0, 0);
@@ -57,7 +57,7 @@ static INT_PTR ChangePM(WPARAM, LPARAM)
static INT_PTR LoadPM(WPARAM, LPARAM)
{
- TCHAR fn[MAX_PATH];
+ wchar_t fn[MAX_PATH];
GetModuleFileName(GetModuleHandle(NULL), fn, _countof(fn));
ShellExecute(0, L"open", fn, L"/ForceShowPM", L"", 1);
return 0;
@@ -66,7 +66,7 @@ static INT_PTR LoadPM(WPARAM, LPARAM)
static INT_PTR CheckDb(WPARAM, LPARAM)
{
if (MessageBox(0, TranslateT("Miranda NG will exit and Database checker will start.\n\nAre you sure you want to do this?"), TranslateT("Check database"), MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2) == IDYES) {
- TCHAR mirandaPath[MAX_PATH], cmdLine[100];
+ wchar_t mirandaPath[MAX_PATH], cmdLine[100];
PROCESS_INFORMATION pi;
STARTUPINFO si = { 0 };
si.cb = sizeof(si);
@@ -112,7 +112,7 @@ extern "C" __declspec(dllexport) int Load(void)
CreateServiceFunction(SRV_RESTART_ME, RestartMe);
CMenuItem mi;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Database"), -500200000);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Database"), -500200000);
for (int i = 0; i < _countof(iconList); i++) {
mi.name.a = iconList[i].szDescr;
diff --git a/plugins/QuickContacts/src/options.cpp b/plugins/QuickContacts/src/options.cpp
index 1c04ebf43b..21d23ef10f 100644
--- a/plugins/QuickContacts/src/options.cpp
+++ b/plugins/QuickContacts/src/options.cpp
@@ -51,8 +51,8 @@ int InitOptionsCallback(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
- odp.ptszGroup = LPGENT("Contacts");
- odp.ptszTitle = LPGENT("Quick Contacts");
+ odp.pwszGroup = LPGENW("Contacts");
+ odp.pwszTitle = LPGENW("Quick Contacts");
odp.pfnDlgProc = OptionsDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp
index 5d2e988a71..a50b89881c 100644
--- a/plugins/QuickContacts/src/quickcontacts.cpp
+++ b/plugins/QuickContacts/src/quickcontacts.cpp
@@ -126,8 +126,8 @@ int ModulesLoaded(WPARAM, LPARAM)
hkd.cbSize = sizeof(hkd);
hkd.dwFlags = HKD_TCHAR;
hkd.pszName = "Quick Contacts/Open dialog";
- hkd.ptszDescription = LPGENT("Open dialog");
- hkd.ptszSection = LPGENT("Quick Contacts");
+ hkd.ptszDescription = LPGENW("Open dialog");
+ hkd.ptszSection = LPGENW("Quick Contacts");
hkd.pszService = MS_QC_SHOW_DIALOG;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_ALT, 'Q');
Hotkey_Register(&hkd);
@@ -137,37 +137,37 @@ int ModulesLoaded(WPARAM, LPARAM)
hkd.lParam = HOTKEY_FILE;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'F');
hkd.pszName = "Quick Contacts/File";
- hkd.ptszDescription = LPGENT("Send file");
+ hkd.ptszDescription = LPGENW("Send file");
Hotkey_Register(&hkd);
hkd.lParam = HOTKEY_URL;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'U');
hkd.pszName = "Quick Contacts/URL";
- hkd.ptszDescription = LPGENT("Send URL");
+ hkd.ptszDescription = LPGENW("Send URL");
Hotkey_Register(&hkd);
hkd.lParam = HOTKEY_INFO;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'I');
hkd.pszName = "Quick Contacts/Info";
- hkd.ptszDescription = LPGENT("Open user info");
+ hkd.ptszDescription = LPGENW("Open user info");
Hotkey_Register(&hkd);
hkd.lParam = HOTKEY_HISTORY;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'H');
hkd.pszName = "Quick Contacts/History";
- hkd.ptszDescription = LPGENT("Open history");
+ hkd.ptszDescription = LPGENW("Open history");
Hotkey_Register(&hkd);
hkd.lParam = HOTKEY_MENU;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'M');
hkd.pszName = "Quick Contacts/Menu";
- hkd.ptszDescription = LPGENT("Open contact menu");
+ hkd.ptszDescription = LPGENW("Open contact menu");
Hotkey_Register(&hkd);
hkd.lParam = HOTKEY_ALL_CONTACTS;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'A');
hkd.pszName = "Quick Contacts/All Contacts";
- hkd.ptszDescription = LPGENT("Show all contacts");
+ hkd.ptszDescription = LPGENW("Show all contacts");
Hotkey_Register(&hkd);
if (ServiceExists(MS_SKIN_ADDHOTKEY))
@@ -190,7 +190,7 @@ int ModulesLoaded(WPARAM, LPARAM)
SET_UID(mi, 0x3a3f768a, 0xcf47, 0x43d5, 0x92, 0x16, 0xe4, 0xeb, 0x93, 0xf6, 0x72, 0xfa);
mi.position = 500100001;
mi.flags = CMIF_TCHAR;
- mi.name.t = LPGENT("Quick Contacts...");
+ mi.name.w = LPGENW("Quick Contacts...");
mi.pszService = MS_QC_SHOW_DIALOG;
Menu_AddMainMenuItem(&mi);
return 0;
@@ -223,10 +223,10 @@ int EventAdded(WPARAM wparam, LPARAM hDbEvent)
// array where the contacts are put into
struct c_struct {
- TCHAR szname[120];
- TCHAR szgroup[50];
+ wchar_t szname[120];
+ wchar_t szgroup[50];
MCONTACT hcontact;
- TCHAR proto[20];
+ wchar_t proto[20];
c_struct()
{
@@ -243,11 +243,11 @@ long max_proto_width;
// Get the name the contact has in list
// This was not made to be called by more than one thread!
-TCHAR tmp_list_name[120];
+wchar_t tmp_list_name[120];
-TCHAR *GetListName(c_struct *cs)
+wchar_t *GetListName(c_struct *cs)
{
- if (opts.group_append && cs->szgroup[0] != _T('\0'))
+ if (opts.group_append && cs->szgroup[0] != '\0')
{
mir_sntprintf(tmp_list_name, L"%s (%s)", cs->szname, cs->szgroup);
return tmp_list_name;
@@ -259,13 +259,13 @@ TCHAR *GetListName(c_struct *cs)
}
-int lstreq(TCHAR *a, TCHAR *b, size_t len = -1)
+int lstreq(wchar_t *a, wchar_t *b, size_t len = -1)
{
- a = CharLower(_tcsdup(a));
- b = CharLower(_tcsdup(b));
+ a = CharLower(wcsdup(a));
+ b = CharLower(wcsdup(b));
int ret;
if (len > 0)
- ret = _tcsncmp(a, b, len);
+ ret = wcsncmp(a, b, len);
else
ret = mir_tstrcmp(a, b);
free(a);
@@ -410,7 +410,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all)
}
// Make contact name
- TCHAR *tmp = (TCHAR *) pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *tmp = (wchar_t *) pcli->pfnGetContactDisplayName(hContact, 0);
mir_tstrncpy(contact->szname, tmp, _countof(contact->szname));
PROTOACCOUNT *acc = Proto_GetAccount(pszProto);
@@ -476,11 +476,11 @@ void EnableButtons(HWND hwndDlg, MCONTACT hContact)
// check if the char(s) entered appears in a contacts name
-int CheckText(HWND hdlg, TCHAR *sztext, BOOL only_enable = FALSE)
+int CheckText(HWND hdlg, wchar_t *sztext, BOOL only_enable = FALSE)
{
EnableButtons(hwndMain, NULL);
- if(sztext == NULL || sztext[0] == _T('\0'))
+ if(sztext == NULL || sztext[0] == '\0')
return 0;
size_t len = mir_tstrlen(sztext);
@@ -527,7 +527,7 @@ MCONTACT GetSelectedContact(HWND hwndDlg)
}
// Now try the name
- TCHAR cname[120] = L"";
+ wchar_t cname[120] = L"";
GetDlgItemText(hwndDlg, IDC_USERNAME, cname, _countof(cname));
@@ -562,7 +562,7 @@ LRESULT CALLBACK EditProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
if (wparam<32 && wparam != VK_BACK)
break;
- TCHAR sztext[120] = L"";
+ wchar_t sztext[120] = L"";
DWORD start;
DWORD end;
@@ -597,7 +597,7 @@ LRESULT CALLBACK EditProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
}
case WM_KEYUP:
{
- TCHAR sztext[120] = L"";
+ wchar_t sztext[120] = L"";
if (wparam == VK_RETURN)
{
@@ -708,10 +708,10 @@ BOOL MoveWindow(HWND hWnd, const RECT &rect, BOOL bRepaint)
}
-static void FillButton(HWND hwndDlg, int dlgItem, TCHAR *name, TCHAR *key, HICON icon)
+static void FillButton(HWND hwndDlg, int dlgItem, wchar_t *name, wchar_t *key, HICON icon)
{
- TCHAR tmp[256];
- TCHAR *full = tmp;
+ wchar_t tmp[256];
+ wchar_t *full = tmp;
if (key == NULL)
full = TranslateTS(name);
@@ -724,10 +724,10 @@ static void FillButton(HWND hwndDlg, int dlgItem, TCHAR *name, TCHAR *key, HICON
}
-static void FillCheckbox(HWND hwndDlg, int dlgItem, TCHAR *name, TCHAR *key)
+static void FillCheckbox(HWND hwndDlg, int dlgItem, wchar_t *name, wchar_t *key)
{
- TCHAR tmp[256];
- TCHAR *full = tmp;
+ wchar_t tmp[256];
+ wchar_t *full = tmp;
if (key == NULL)
full = TranslateTS(name);
@@ -762,13 +762,13 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
mir_subclassWindow(GetWindow(GetDlgItem(hwndDlg, IDC_USERNAME),GW_CHILD), EditProc);
// Buttons
- FillCheckbox(hwndDlg, IDC_SHOW_ALL_CONTACTS, LPGENT("Show all contacts"), hasNewHotkeyModule ? NULL : L"Ctrl+A");
- FillButton(hwndDlg, IDC_MESSAGE, LPGENT("Send message"), NULL, Skin_LoadIcon(SKINICON_EVENT_MESSAGE));
- FillButton(hwndDlg, IDC_FILE, LPGENT("Send file"), hasNewHotkeyModule ? NULL : L"Ctrl+F", Skin_LoadIcon(SKINICON_EVENT_FILE));
- FillButton(hwndDlg, IDC_URL, LPGENT("Send URL"), hasNewHotkeyModule ? NULL : L"Ctrl+U", Skin_LoadIcon(SKINICON_EVENT_URL));
- FillButton(hwndDlg, IDC_USERINFO, LPGENT("Open user info"), hasNewHotkeyModule ? NULL : L"Ctrl+I", Skin_LoadIcon(SKINICON_OTHER_USERDETAILS));
- FillButton(hwndDlg, IDC_HISTORY, LPGENT("Open history"), hasNewHotkeyModule ? NULL : L"Ctrl+H", Skin_LoadIcon(SKINICON_OTHER_HISTORY));
- FillButton(hwndDlg, IDC_MENU, LPGENT("Open contact menu"), hasNewHotkeyModule ? NULL : L"Ctrl+M", Skin_LoadIcon(SKINICON_OTHER_DOWNARROW));
+ FillCheckbox(hwndDlg, IDC_SHOW_ALL_CONTACTS, LPGENW("Show all contacts"), hasNewHotkeyModule ? NULL : L"Ctrl+A");
+ FillButton(hwndDlg, IDC_MESSAGE, LPGENW("Send message"), NULL, Skin_LoadIcon(SKINICON_EVENT_MESSAGE));
+ FillButton(hwndDlg, IDC_FILE, LPGENW("Send file"), hasNewHotkeyModule ? NULL : L"Ctrl+F", Skin_LoadIcon(SKINICON_EVENT_FILE));
+ FillButton(hwndDlg, IDC_URL, LPGENW("Send URL"), hasNewHotkeyModule ? NULL : L"Ctrl+U", Skin_LoadIcon(SKINICON_EVENT_URL));
+ FillButton(hwndDlg, IDC_USERINFO, LPGENW("Open user info"), hasNewHotkeyModule ? NULL : L"Ctrl+I", Skin_LoadIcon(SKINICON_OTHER_USERDETAILS));
+ FillButton(hwndDlg, IDC_HISTORY, LPGENW("Open history"), hasNewHotkeyModule ? NULL : L"Ctrl+H", Skin_LoadIcon(SKINICON_OTHER_HISTORY));
+ FillButton(hwndDlg, IDC_MENU, LPGENW("Open contact menu"), hasNewHotkeyModule ? NULL : L"Ctrl+M", Skin_LoadIcon(SKINICON_OTHER_DOWNARROW));
SendDlgItemMessage(hwndDlg, IDC_USERNAME, CB_SETEXTENDEDUI, TRUE, 0);
@@ -956,7 +956,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
{
// Get old text
HWND hEdit = GetWindow(GetWindow(hwndDlg,GW_CHILD),GW_CHILD);
- TCHAR sztext[120] = L"";
+ wchar_t sztext[120] = L"";
if (SendMessage(hEdit, EM_GETSEL, 0, 0) != -1)
SendMessage(hEdit, EM_REPLACESEL, 0, (LPARAM)L"");
@@ -1076,7 +1076,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
}
// Draw text
- TCHAR *name;
+ wchar_t *name;
if (opts.group_append && !opts.group_column)
name = GetListName(contacts[lpdis->itemData]);
else
diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp
index 9067c7ac12..82aa13cd5a 100644
--- a/plugins/QuickMessages/src/Utils.cpp
+++ b/plugins/QuickMessages/src/Utils.cpp
@@ -224,7 +224,7 @@ BYTE getEntryByte(int buttonnum, int entrynum, BOOL mode)
static HANDLE AddIcon(char* szIcoName)
{
- TCHAR tszPath[MAX_PATH];
+ wchar_t tszPath[MAX_PATH];
GetModuleFileName(hinstance, tszPath, _countof(tszPath));
SKINICONDESC sid = { 0 };
@@ -232,7 +232,7 @@ static HANDLE AddIcon(char* szIcoName)
sid.section.a = "Quick Messages";
sid.description.a = szIcoName;
sid.pszName = szIcoName;
- sid.defaultFile.t = tszPath;
+ sid.defaultFile.w = tszPath;
sid.iDefaultIndex = -IDI_QICON;
return IcoLib_AddIcon(&sid);
}
@@ -269,7 +269,7 @@ void InitButtonsList()
int i, j, k = 0;
QuickList = List_Create(0, 1);
for (i = 0; i < g_iButtonsCount; i++) {
- TCHAR* pszBName = NULL;
+ wchar_t* pszBName = NULL;
ListData* ld = NULL;
if (!(pszBName = getMenuEntry(i, 0, 3))) {
g_iButtonsCount = i;
@@ -286,7 +286,7 @@ void InitButtonsList()
ld->dwOPFlags = 0;
ld->bIsServName = ld->bIsOpServName = getEntryByte(i, 0, 3);
for (j = 0;; j++) {
- TCHAR* pszEntry = NULL;
+ wchar_t* pszEntry = NULL;
ButtonData *bd = NULL;
if (!(pszEntry = getMenuEntry(i, j, 0)))
@@ -331,9 +331,9 @@ void DestructButtonsList()
}
}
-TCHAR* getMenuEntry(int buttonnum, int entrynum, BYTE mode)
+wchar_t* getMenuEntry(int buttonnum, int entrynum, BYTE mode)
{
- TCHAR* buffer = NULL;
+ wchar_t* buffer = NULL;
char szMEntry[256];
DBVARIANT dbv;
@@ -387,18 +387,18 @@ int RegisterCustomButton(WPARAM, LPARAM)
return 0;
}
-TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR* ptszClip, int QVSize, int TextSize, int ClipSize)
+wchar_t* ParseString(MCONTACT hContact, wchar_t* ptszQValIn, wchar_t* ptszText, wchar_t* ptszClip, int QVSize, int TextSize, int ClipSize)
{
int i = 0, iOffset = 0;
- TCHAR* tempPointer = NULL;
- TCHAR* ptszQValue = _tcsdup(ptszQValIn);
- TCHAR* tempQValue = ptszQValue;
- TCHAR varstr = _T('%');
- TCHAR* p = NULL;
+ wchar_t* tempPointer = NULL;
+ wchar_t* ptszQValue = wcsdup(ptszQValIn);
+ wchar_t* tempQValue = ptszQValue;
+ wchar_t varstr = '%';
+ wchar_t* p = NULL;
int NameLenght = 0;
- TCHAR* ptszName = NULL;
+ wchar_t* ptszName = NULL;
- if (!_tcschr(ptszQValue, varstr))
+ if (!wcschr(ptszQValue, varstr))
return ptszQValue;
if (TextSize && ptszText[TextSize - 1] == '\0')
@@ -414,18 +414,18 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR*
switch (ptszQValue[i + 1]) {
case 't':
- p = (TCHAR *)realloc(tempQValue, (QVSize + TextSize + 1) * sizeof(TCHAR));
+ p = (wchar_t *)realloc(tempQValue, (QVSize + TextSize + 1) * sizeof(wchar_t));
if (!p)
break;
i = iOffset;
tempQValue = ptszQValue = p;
- tempPointer = (TCHAR *)memmove(ptszQValue + i + TextSize, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(TCHAR));
- memcpy(ptszQValue + i, ptszText, TextSize * sizeof(TCHAR));
+ tempPointer = (wchar_t *)memmove(ptszQValue + i + TextSize, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(wchar_t));
+ memcpy(ptszQValue + i, ptszText, TextSize * sizeof(wchar_t));
QVSize += (TextSize - 2);
ptszQValue[QVSize] = '\0';
- if (!_tcschr(ptszQValue, varstr))
+ if (!wcschr(ptszQValue, varstr))
return ptszQValue;
ptszQValue = tempPointer;
@@ -433,18 +433,18 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR*
i = -1;
break;
case 'c':
- p = (TCHAR *)realloc(tempQValue, (QVSize + ClipSize + 1) * sizeof(TCHAR));
+ p = (wchar_t *)realloc(tempQValue, (QVSize + ClipSize + 1) * sizeof(wchar_t));
if (!p)
break;
i = iOffset;
tempQValue = ptszQValue = p;
- tempPointer = (TCHAR *)memmove(ptszQValue + i + ClipSize, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(TCHAR));
- memcpy(ptszQValue + i, ptszClip, ClipSize * sizeof(TCHAR));
+ tempPointer = (wchar_t *)memmove(ptszQValue + i + ClipSize, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(wchar_t));
+ memcpy(ptszQValue + i, ptszClip, ClipSize * sizeof(wchar_t));
QVSize += (ClipSize - 2);
ptszQValue[QVSize] = '\0';
- if (!_tcschr(ptszQValue, varstr))
+ if (!wcschr(ptszQValue, varstr))
return ptszQValue;
ptszQValue = tempPointer;
@@ -454,7 +454,7 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR*
case 'P':
ptszName = mir_a2u(GetContactProto(hContact));
NameLenght = (int)mir_tstrlen(ptszName);
- p = (TCHAR *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(TCHAR));
+ p = (wchar_t *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(wchar_t));
if (!p) {
mir_free(ptszName);
break;
@@ -462,13 +462,13 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR*
i = iOffset;
tempQValue = ptszQValue = p;
- tempPointer = (TCHAR *)memmove(ptszQValue + i + NameLenght, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(TCHAR));
- memcpy(ptszQValue + i, ptszName, NameLenght * sizeof(TCHAR));
+ tempPointer = (wchar_t *)memmove(ptszQValue + i + NameLenght, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(wchar_t));
+ memcpy(ptszQValue + i, ptszName, NameLenght * sizeof(wchar_t));
QVSize += (NameLenght - 2);
mir_free(ptszName);
ptszQValue[QVSize] = '\0';
- if (!_tcschr(ptszQValue, varstr))
+ if (!wcschr(ptszQValue, varstr))
return ptszQValue;
ptszQValue = tempPointer;
@@ -477,20 +477,20 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR*
break;
case 'n':
- ptszName = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0);
+ ptszName = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0);
NameLenght = (int)mir_tstrlen(ptszName);
- p = (TCHAR *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(TCHAR));
+ p = (wchar_t *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(wchar_t));
if (!p)
break;
i = iOffset;
tempQValue = ptszQValue = p;
- tempPointer = (TCHAR *)memmove(ptszQValue + i + NameLenght, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(TCHAR));
- memcpy(ptszQValue + i, ptszName, NameLenght * sizeof(TCHAR));
+ tempPointer = (wchar_t *)memmove(ptszQValue + i + NameLenght, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(wchar_t));
+ memcpy(ptszQValue + i, ptszName, NameLenght * sizeof(wchar_t));
QVSize += (NameLenght - 2);
ptszQValue[QVSize] = '\0';
- if (!_tcschr(ptszQValue, varstr))
+ if (!wcschr(ptszQValue, varstr))
return ptszQValue;
ptszQValue = tempPointer;
@@ -502,7 +502,7 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR*
if (ptszName == NULL)
break;
NameLenght = (int)mir_tstrlen(ptszName);
- p = (TCHAR *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(TCHAR));
+ p = (wchar_t *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(wchar_t));
if (!p) {
mir_free(ptszName);
break;
@@ -510,13 +510,13 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR*
i = iOffset;
tempQValue = ptszQValue = p;
- tempPointer = (TCHAR *)memmove(ptszQValue + i + NameLenght, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(TCHAR));
- memcpy(ptszQValue + i, ptszName, NameLenght * sizeof(TCHAR));
+ tempPointer = (wchar_t *)memmove(ptszQValue + i + NameLenght, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(wchar_t));
+ memcpy(ptszQValue + i, ptszName, NameLenght * sizeof(wchar_t));
QVSize += (NameLenght - 2);
mir_free(ptszName);
ptszQValue[QVSize] = '\0';
- if (!_tcschr(ptszQValue, varstr))
+ if (!wcschr(ptszQValue, varstr))
return ptszQValue;
ptszQValue = tempPointer;
@@ -529,7 +529,7 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR*
break;
NameLenght = (int)mir_tstrlen(ptszName);
- p = (TCHAR *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(TCHAR));
+ p = (wchar_t *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(wchar_t));
if (!p) {
mir_free(ptszName);
break;
@@ -537,13 +537,13 @@ TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR*
i = iOffset;
tempQValue = ptszQValue = p;
- tempPointer = (TCHAR *)memmove(ptszQValue + i + NameLenght, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(TCHAR));
- memcpy(ptszQValue + i, ptszName, NameLenght * sizeof(TCHAR));
+ tempPointer = (wchar_t *)memmove(ptszQValue + i + NameLenght, ptszQValue + i + 2, (QVSize - i - 1) * sizeof(wchar_t));
+ memcpy(ptszQValue + i, ptszName, NameLenght * sizeof(wchar_t));
QVSize += (NameLenght - 2);
mir_free(ptszName);
ptszQValue[QVSize] = '\0';
- if (!_tcschr(ptszQValue, varstr))
+ if (!wcschr(ptszQValue, varstr))
return ptszQValue;
ptszQValue = tempPointer;
diff --git a/plugins/QuickMessages/src/Utils.h b/plugins/QuickMessages/src/Utils.h
index 3f4d11770c..adfd0ffa76 100644
--- a/plugins/QuickMessages/src/Utils.h
+++ b/plugins/QuickMessages/src/Utils.h
@@ -34,10 +34,10 @@ typedef struct _tagButtonData
BYTE bInQMenu;
BYTE bOpInQMenu;
DWORD dwOPFlags;
- TCHAR *pszName;
- TCHAR *pszValue;
- TCHAR *pszOpValue;
- TCHAR *pszOpName;
+ wchar_t *pszName;
+ wchar_t *pszValue;
+ wchar_t *pszOpValue;
+ wchar_t *pszOpName;
}ButtonData;
typedef struct _tagListData
@@ -45,9 +45,9 @@ typedef struct _tagListData
SortedList* sl;
DWORD dwPos;
DWORD dwOPPos;
- TCHAR* ptszQValue;
- TCHAR* ptszOPQValue;
- TCHAR* ptszButtonName;
+ wchar_t* ptszQValue;
+ wchar_t* ptszOPQValue;
+ wchar_t* ptszButtonName;
BYTE bIsServName;
BYTE bIsOpServName;
DWORD dwOPFlags;
@@ -58,8 +58,8 @@ typedef struct _tagQuickData
DWORD dwPos;
BOOL bIsService;
BYTE fEntryType;
- TCHAR* ptszValue;
- TCHAR* ptszValueName;
+ wchar_t* ptszValue;
+ wchar_t* ptszValueName;
}QuickData;
void InitButtonsList();
@@ -68,11 +68,11 @@ int sstSortButtons(const void * vmtbi1, const void * vmtbi2);
int sstOpSortButtons(const void * vmtbi1, const void * vmtbi2);
int sstQuickSortButtons(const void * vmtbi1, const void * vmtbi2);
void li_ZeroQuickList(SortedList *pList);
-TCHAR* getMenuEntry(int entrynum,int buttonnum,BYTE mode) ;
+wchar_t* getMenuEntry(int entrynum,int buttonnum,BYTE mode) ;
int RegisterCustomButton(WPARAM wParam,LPARAM lParam);
void RemoveMenuEntryNode(SortedList *pList, int index);
void DestroyButton(int listnum);
void SaveModuleSettings(int buttonnum,ButtonData* bd);
void CleanSettings(int buttonnum,int from);
DWORD BalanceButtons(int buttonsWas,int buttonsNow);
-TCHAR* ParseString(MCONTACT hContact,TCHAR* ptszQValueIn,TCHAR* ptszText,TCHAR* ptszClip,int QVSize,int TextSize ,int ClipSize);
+wchar_t* ParseString(MCONTACT hContact,wchar_t* ptszQValueIn,wchar_t* ptszText,wchar_t* ptszClip,int QVSize,int TextSize ,int ClipSize);
diff --git a/plugins/QuickMessages/src/main.cpp b/plugins/QuickMessages/src/main.cpp
index 83eca17bda..6dc22694c7 100644
--- a/plugins/QuickMessages/src/main.cpp
+++ b/plugins/QuickMessages/src/main.cpp
@@ -74,26 +74,26 @@ static int InputMenuPopup(WPARAM, LPARAM lParam)
AppendMenu(hSubMenu, MF_STRING, qd->dwPos + 254, qd->ptszValueName);
}
}
- else if (mwpd->uType == MSG_WINDOWPOPUP_SELECTED&&mwpd->selection >= 254) {
+ else if (mwpd->uType == MSG_WINDOWPOPUP_SELECTED && mwpd->selection >= 254) {
for (i = 0; i < QuickList->realCount; i++) {
QuickData* qd = (QuickData *)QuickList->items[i];
if ((qd->dwPos + 254) == mwpd->selection) {
CHARRANGE cr;
UINT textlenght = 0;
- TCHAR* pszText = NULL;
- TCHAR* ptszQValue = NULL;
- TCHAR* pszCBText = NULL;
+ wchar_t* pszText = NULL;
+ wchar_t* ptszQValue = NULL;
+ wchar_t* pszCBText = NULL;
BOOL bIsService = 0;
if (IsClipboardFormatAvailable(CF_TEXT)) {
if (OpenClipboard(mwpd->hwnd)) {
HANDLE hData = NULL;
- TCHAR* chBuffer = NULL;
+ wchar_t* chBuffer = NULL;
int textLength = 0;
hData = GetClipboardData(CF_UNICODETEXT);
- chBuffer = (TCHAR*)GlobalLock(hData);
+ chBuffer = (wchar_t*)GlobalLock(hData);
textLength = (int)mir_tstrlen(chBuffer);
pszCBText = mir_tstrdup(chBuffer);
GlobalUnlock(hData);
@@ -105,8 +105,8 @@ static int InputMenuPopup(WPARAM, LPARAM lParam)
textlenght = cr.cpMax - cr.cpMin;
if (textlenght) {
- pszText = (TCHAR *)mir_alloc((textlenght + 10)*sizeof(TCHAR));
- memset(pszText, 0, ((textlenght + 10) * sizeof(TCHAR)));
+ pszText = (wchar_t *)mir_alloc((textlenght + 10)*sizeof(wchar_t));
+ memset(pszText, 0, ((textlenght + 10) * sizeof(wchar_t)));
SendMessage(mwpd->hwnd, EM_GETSELTEXT, 0, (LPARAM)pszText);
}
if (qd->ptszValue) {
@@ -139,9 +139,9 @@ static int CustomButtonPressed(WPARAM, LPARAM lParam)
HWND hEdit = NULL;
BOOL bCTRL = 0;
BOOL bIsService = 0;
- TCHAR* pszText = NULL;
- TCHAR* pszCBText = NULL;
- TCHAR* ptszQValue = NULL;
+ wchar_t* pszText = NULL;
+ wchar_t* pszCBText = NULL;
+ wchar_t* ptszQValue = NULL;
UINT textlenght = 0;
SortedList* sl = NULL;
int state = 0;
@@ -157,12 +157,12 @@ static int CustomButtonPressed(WPARAM, LPARAM lParam)
if (IsClipboardFormatAvailable(CF_TEXT)) {
if (OpenClipboard(cbcd->hwndFrom)) {
HANDLE hData = NULL;
- TCHAR* chBuffer = NULL;
+ wchar_t* chBuffer = NULL;
int textLength = 0;
hData = GetClipboardData(CF_UNICODETEXT);
- chBuffer = (TCHAR*)GlobalLock(hData);
+ chBuffer = (wchar_t*)GlobalLock(hData);
textLength = (int)mir_tstrlen(chBuffer);
pszCBText = mir_tstrdup(chBuffer);
GlobalUnlock(hData);
@@ -180,8 +180,8 @@ static int CustomButtonPressed(WPARAM, LPARAM lParam)
textlenght = cr.cpMax - cr.cpMin;
if (textlenght) {
- pszText = (TCHAR *)mir_alloc((textlenght + 10)*sizeof(TCHAR));
- memset(pszText, 0, ((textlenght + 10) * sizeof(TCHAR)));
+ pszText = (wchar_t *)mir_alloc((textlenght + 10)*sizeof(wchar_t));
+ memset(pszText, 0, ((textlenght + 10) * sizeof(wchar_t)));
SendMessage(hEdit, EM_GETSELTEXT, 0, (LPARAM)pszText);
}
diff --git a/plugins/QuickMessages/src/options.cpp b/plugins/QuickMessages/src/options.cpp
index 412d57f2cb..65d55d874a 100644
--- a/plugins/QuickMessages/src/options.cpp
+++ b/plugins/QuickMessages/src/options.cpp
@@ -119,7 +119,7 @@ void SetMenuEntryProperties(HWND hdlg)
if (tvi.lParam) {
ListData* ld = (ListData*)tvi.lParam;
- TCHAR szValue[256];
+ wchar_t szValue[256];
GetDlgItemText(hdlg, IDC_RCLICKVALUE, szValue, _countof(szValue));
if (mir_tstrlen(szValue)) {
if (ld->ptszOPQValue && (ld->ptszOPQValue != ld->ptszQValue))
@@ -137,7 +137,7 @@ void SetMenuEntryProperties(HWND hdlg)
if (tvi.lParam) {
ButtonData *bd = (ButtonData*)tvi.lParam;
- TCHAR szValue[256];
+ wchar_t szValue[256];
GetDlgItemText(hdlg, IDC_MENUVALUE, szValue, _countof(szValue));
if (mir_tstrlen(szValue)) {
if (mir_tstrlen(bd->pszOpValue) && (bd->pszOpValue != bd->pszValue))
@@ -177,7 +177,7 @@ void SetMenuEntryProperties(HWND hdlg)
}
else {
if (!bd->pszOpValue)
- bd->pszOpValue = mir_tstrdup(LPGENT("Enter Value"));
+ bd->pszOpValue = mir_tstrdup(LPGENW("Enter Value"));
}
if (TreeView_GetParent(hMenuTree, tvi.hItem))
bd->fEntryOpType |= QMF_EX_CHILD;
@@ -198,7 +198,7 @@ void SaveMenuTree()
int iBtd = g_iButtonsCount;
BOOL bDeleted = FALSE;
char szMEntry[256] = { '\0' };
- TCHAR strbuf[256];
+ wchar_t strbuf[256];
HTREEITEM hti = NULL;
TVITEM tvi;
@@ -439,7 +439,7 @@ static int BuildButtonsList(HWND hToolBarTree)
void MoveItem(HTREEITEM hItem, HTREEITEM hInsertAfter, BOOLEAN bAsChild)
{
TVINSERTSTRUCT tvis;
- //TCHAR strbuf[128];
+ //wchar_t strbuf[128];
HTREEITEM hParent, hChild, hNewItem;
if (!hItem || !hInsertAfter)
@@ -464,7 +464,7 @@ void MoveItem(HTREEITEM hItem, HTREEITEM hInsertAfter, BOOLEAN bAsChild)
// prepare the insert structure
{
- TCHAR strbuf[128];
+ wchar_t strbuf[128];
tvis.item.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT;
tvis.item.pszText = strbuf;
@@ -737,8 +737,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
{
TVITEM tvi;
ButtonData* bd = NULL;
- TCHAR strbuf[256];
- TCHAR szLabel[256];
+ wchar_t strbuf[256];
+ wchar_t szLabel[256];
tvi.pszText = strbuf;
tvi.cchTextMax = _countof(strbuf);
@@ -802,7 +802,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
ButtonData *bd = (ButtonData*)tvi.lParam;
if (bd) {
- TCHAR szValue[256];
+ wchar_t szValue[256];
GetDlgItemText(hdlg, IDC_MENUVALUE, szValue, _countof(szValue));
if (mir_tstrlen(szValue)) {
if (bd->pszOpValue && (bd->pszOpValue != bd->pszValue))
@@ -866,8 +866,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
case TVN_ENDLABELEDIT:
{
TVITEM tvi;
- TCHAR strbuf[128];
- TCHAR szLabel[128];
+ wchar_t strbuf[128];
+ wchar_t szLabel[128];
tvi.pszText = strbuf;
tvi.cchTextMax = _countof(strbuf);
@@ -941,7 +941,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
{
TVINSERTSTRUCT tvis;
ListData* ld = NULL;
- TCHAR namebuff[MAX_PATH] = { '\0' };
+ wchar_t namebuff[MAX_PATH] = { '\0' };
int count = TreeView_GetCount(hButtonsList);
if (count > 10) break;
if (g_iOPButtonsCount == 99) {
@@ -1003,7 +1003,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
TVITEM tvi;
ButtonData *bd = NULL;
SortedList *sl = NULL;
- TCHAR namebuff[MAX_PATH] = { '\0' };
+ wchar_t namebuff[MAX_PATH] = { '\0' };
if (!TreeView_GetCount(hButtonsList)) break;
if (!(tvi.hItem = TreeView_GetSelection(hButtonsList))) break;
@@ -1054,7 +1054,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
bd->dwOPFlags |= QMF_DELETNEEDED;
if (tvi.hItem = TreeView_GetChild(hMenuTree, tvi.hItem)) {
- TCHAR strbuf[128];
+ wchar_t strbuf[128];
while (tvi.hItem) {
tvis.hInsertAfter = hti;
tvi.pszText = strbuf;
diff --git a/plugins/QuickReplies/src/events.cpp b/plugins/QuickReplies/src/events.cpp
index 2a6cf0a8b2..4a3b57da5c 100644
--- a/plugins/QuickReplies/src/events.cpp
+++ b/plugins/QuickReplies/src/events.cpp
@@ -59,7 +59,7 @@ int OnModulesLoaded(WPARAM, LPARAM)
bbd.cbSize = sizeof(BBButton);
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON;
bbd.pszModuleName = buttonName;
- bbd.ptszTooltip = LPGENT("Quick Replies\r\nLeft button - open menu\r\nRight button - options page");
+ bbd.ptszTooltip = LPGENW("Quick Replies\r\nLeft button - open menu\r\nRight button - options page");
bbd.hIcon = icon.hIcolib;
bbd.dwButtonID = iNumber;
bbd.dwDefPos = 220;
diff --git a/plugins/Quotes/src/CreateFilePath.cpp b/plugins/Quotes/src/CreateFilePath.cpp
index 4e2c47a96c..6c73da75b0 100644
--- a/plugins/Quotes/src/CreateFilePath.cpp
+++ b/plugins/Quotes/src/CreateFilePath.cpp
@@ -1,12 +1,12 @@
#include "StdAfx.h"
-static TCHAR InvalidSymbols[] = { _T('\\'), _T('/'), _T(':'), _T('*'), _T('?'), _T('"'), _T('<'), _T('>'), _T('|') };
+static wchar_t InvalidSymbols[] = { '\\', '/', ':', '*', '?', '"', '<', '>', '|' };
-static TCHAR replace_invalid_symbol(TCHAR chr)
+static wchar_t replace_invalid_symbol(wchar_t chr)
{
for (int i = 0; i < _countof(InvalidSymbols); ++i)
if (chr == InvalidSymbols[i])
- return _T('_');
+ return '_';
return chr;
}
@@ -18,10 +18,10 @@ void prepare_name(tstring& rsName)
tstring CreateFilePath(const tstring& rsName)
{
- TCHAR szPath[_MAX_PATH];
+ wchar_t szPath[_MAX_PATH];
::GetModuleFileName(g_hInstance, szPath, _MAX_PATH);
- TCHAR* p = _tcsrchr(szPath, _T('\\'));
+ wchar_t* p = wcsrchr(szPath, '\\');
if (p)
*p = 0;
diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp
index b92535800b..5ce786b6b5 100644
--- a/plugins/Quotes/src/Forex.cpp
+++ b/plugins/Quotes/src/Forex.cpp
@@ -43,9 +43,9 @@ PLUGININFOEX Global_pluginInfo =
void UpdateMenu(bool bAutoUpdate)
{
if (bAutoUpdate) // to enable auto-update
- Menu_ModifyItem(g_hEnableDisableMenu, LPGENT("Auto Update Enabled"), Quotes_GetIconHandle(IDI_ICON_MAIN));
+ Menu_ModifyItem(g_hEnableDisableMenu, LPGENW("Auto Update Enabled"), Quotes_GetIconHandle(IDI_ICON_MAIN));
else // to disable auto-update
- Menu_ModifyItem(g_hEnableDisableMenu, LPGENT("Auto Update Disabled"), Quotes_GetIconHandle(IDI_ICON_DISABLED));
+ Menu_ModifyItem(g_hEnableDisableMenu, LPGENW("Auto Update Disabled"), Quotes_GetIconHandle(IDI_ICON_DISABLED));
CallService(MS_TTB_SETBUTTONSTATE, reinterpret_cast<WPARAM>(g_hTBButton), !bAutoUpdate ? TTBST_PUSHED : 0);
}
@@ -78,11 +78,11 @@ void InitMenu()
{
CMenuItem mi;
mi.flags = CMIF_TCHAR;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Quotes"), 0, Quotes_GetIconHandle(IDI_ICON_MAIN));
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Quotes"), 0, Quotes_GetIconHandle(IDI_ICON_MAIN));
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "B474F556-22B6-42A1-A91E-22FE4F671388");
SET_UID(mi, 0x9de6716, 0x3591, 0x48c4, 0x9f, 0x64, 0x1b, 0xfd, 0xc6, 0xd1, 0x34, 0x97);
- mi.name.t = LPGENT("Enable/Disable Auto Update");
+ mi.name.w = LPGENW("Enable/Disable Auto Update");
mi.position = 10100001;
mi.hIcolibItem = Quotes_GetIconHandle(IDI_ICON_MAIN);
mi.pszService = g_pszAutoUpdateCmd;
@@ -91,7 +91,7 @@ void InitMenu()
UpdateMenu(g_bAutoUpdate);
SET_UID(mi, 0x91cbabf6, 0x5073, 0x4a78, 0x84, 0x8, 0x34, 0x61, 0xc1, 0x8a, 0x34, 0xd9);
- mi.name.t = LPGENT("Refresh All Quotes\\Rates");
+ mi.name.w = LPGENW("Refresh All Quotes\\Rates");
mi.position = 20100001;
mi.hIcolibItem = Quotes_GetIconHandle(IDI_ICON_MAIN);
mi.pszService = "Quotes/RefreshAll";
@@ -99,7 +99,7 @@ void InitMenu()
CreateServiceFunction(mi.pszService, QuotesMenu_RefreshAll);
SET_UID(mi, 0x3663409c, 0xbd36, 0x473b, 0x9b, 0x4f, 0xff, 0x80, 0xf6, 0x2c, 0xdf, 0x9b);
- mi.name.t = LPGENT("Currency Converter...");
+ mi.name.w = LPGENW("Currency Converter...");
mi.position = 20100002;
mi.hIcolibItem = Quotes_GetIconHandle(IDI_ICON_CURRENCY_CONVERTER);
mi.pszService = g_pszCurrencyConverter;
@@ -107,7 +107,7 @@ void InitMenu()
CreateServiceFunction(mi.pszService, QuotesMenu_CurrencyConverter);
SET_UID(mi, 0x7cca4fd9, 0x903f, 0x4b7d, 0x93, 0x7a, 0x18, 0x63, 0x23, 0xd4, 0xa9, 0xa9);
- mi.name.t = LPGENT("Export All Quotes");
+ mi.name.w = LPGENW("Export All Quotes");
mi.hIcolibItem = Quotes_GetIconHandle(IDI_ICON_EXPORT);
mi.pszService = "Quotes/ExportAll";
mi.position = 20100003;
@@ -115,7 +115,7 @@ void InitMenu()
CreateServiceFunction(mi.pszService, QuotesMenu_ExportAll);
SET_UID(mi, 0xa994d3b, 0x77c2, 0x4612, 0x8d, 0x5, 0x6a, 0xae, 0x8c, 0x21, 0xbd, 0xc9);
- mi.name.t = LPGENT("Import All Quotes");
+ mi.name.w = LPGENW("Import All Quotes");
mi.hIcolibItem = Quotes_GetIconHandle(IDI_ICON_IMPORT);
mi.pszService = "Quotes/ImportAll";
mi.position = 20100004;
@@ -128,7 +128,7 @@ void InitMenu()
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "C259BE01-642C-461E-997D-0E756B2A3AD6");
SET_UID(mi, 0xb9812194, 0x3235, 0x4e76, 0xa3, 0xa4, 0x73, 0x32, 0x96, 0x1c, 0x1c, 0xf4);
- mi.name.t = LPGENT("Refresh");
+ mi.name.w = LPGENW("Refresh");
mi.hIcolibItem = Quotes_GetIconHandle(IDI_ICON_REFRESH);
mi.pszService = "Quotes/RefreshContact";
g_hMenuRefresh = Menu_AddContactMenuItem(&mi, QUOTES_PROTOCOL_NAME);
@@ -136,7 +136,7 @@ void InitMenu()
CreateServiceFunction(mi.pszService, QuotesMenu_RefreshContact);
SET_UID(mi, 0x19a16fa2, 0xf370, 0x4201, 0x92, 0x9, 0x25, 0xde, 0x4e, 0x55, 0xf9, 0x1a);
- mi.name.t = LPGENT("Open Log File...");
+ mi.name.w = LPGENW("Open Log File...");
mi.hIcolibItem = NULL;
mi.pszService = "Quotes/OpenLogFile";
g_hMenuOpenLogFile = Menu_AddContactMenuItem(&mi, QUOTES_PROTOCOL_NAME);
@@ -145,7 +145,7 @@ void InitMenu()
#ifdef CHART_IMPLEMENT
SET_UID(mi, 0x65da7256, 0x43a2, 0x4857, 0xac, 0x52, 0x1c, 0xb7, 0xff, 0xd7, 0x96, 0xfa);
- mi.name.t = LPGENT("Chart...");
+ mi.name.w = LPGENW("Chart...");
mi.popupPosition = 2;
mi.hIcolibItem = NULL;
mi.pszService = "Quotes/Chart";
@@ -154,7 +154,7 @@ void InitMenu()
#endif
SET_UID(mi, 0xac5fc17, 0x5640, 0x4f81, 0xa3, 0x44, 0x8c, 0xb6, 0x9a, 0x5c, 0x98, 0xf);
- mi.name.t = LPGENT("Edit Settings...");
+ mi.name.w = LPGENW("Edit Settings...");
mi.hIcolibItem = NULL;
mi.pszService = "Quotes/EditSettings";
g_hMenuEditSettings = Menu_AddContactMenuItem(&mi, QUOTES_PROTOCOL_NAME);
@@ -269,8 +269,8 @@ int QuotesEventFunc_OptInitialise(WPARAM wp, LPARAM/* lp*/)
OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 910000000;
odp.hInstance = g_hInstance;
- odp.ptszTitle = _T(QUOTES_PROTOCOL_NAME);
- odp.ptszGroup = LPGENT("Network");
+ odp.pwszTitle = _T(QUOTES_PROTOCOL_NAME);
+ odp.pwszGroup = LPGENW("Network");
odp.hIcon = Quotes_LoadIconEx(IDI_ICON_MAIN);
odp.flags = ODPF_USERINFOTAB | ODPF_TCHAR;
diff --git a/plugins/Quotes/src/HTTPSession.cpp b/plugins/Quotes/src/HTTPSession.cpp
index ebe919e9f9..16583b071a 100644
--- a/plugins/Quotes/src/HTTPSession.cpp
+++ b/plugins/Quotes/src/HTTPSession.cpp
@@ -97,7 +97,7 @@ public:
char* pResult = &*(apBuffer.begin());
int nIndex = find_header(pReply, "Content-Type");
if ((-1 != nIndex) && (NULL != strstr(_strlwr(pReply->headers[nIndex].szValue), "utf-8"))) {
- TCHAR* p = mir_utf8decodeT(pResult);
+ wchar_t* p = mir_utf8decodeT(pResult);
rsResponce = p;
mir_free(p);
}
diff --git a/plugins/Quotes/src/ImportExport.cpp b/plugins/Quotes/src/ImportExport.cpp
index 9e7d15d711..ca9e9440fa 100644
--- a/plugins/Quotes/src/ImportExport.cpp
+++ b/plugins/Quotes/src/ImportExport.cpp
@@ -164,15 +164,15 @@ LPCTSTR prepare_filter(LPTSTR pszBuffer, size_t cBuffer)
}
if (nLen < cBuffer)
- *p = _T('\0');
+ *p = '\0';
return pszBuffer;
}
bool show_open_file_dialog(bool bOpen, tstring& rsFile)
{
- TCHAR szBuffer[MAX_PATH];
- TCHAR szFilter[MAX_PATH];
+ wchar_t szBuffer[MAX_PATH];
+ wchar_t szFilter[MAX_PATH];
OPENFILENAME ofn;
memset(&ofn, 0, sizeof(ofn));
@@ -189,7 +189,7 @@ bool show_open_file_dialog(bool bOpen, tstring& rsFile)
ofn.nMaxFile = MAX_PATH;
ofn.lpstrFile = szBuffer;
- ofn.lpstrFile[0] = _T('\0');
+ ofn.lpstrFile[0] = '\0';
if (bOpen) {
if (FALSE == GetOpenFileName(&ofn))
diff --git a/plugins/Quotes/src/Locale.cpp b/plugins/Quotes/src/Locale.cpp
index 07c9f1a105..ae79f71eb6 100644
--- a/plugins/Quotes/src/Locale.cpp
+++ b/plugins/Quotes/src/Locale.cpp
@@ -16,7 +16,7 @@ tstring get_int_registry_value(LPCTSTR pszValueName)
DWORD dwSize = 0;
lResult = ::RegQueryValueEx(hKey, pszValueName, nullptr, &dwType, nullptr, &dwSize);
if ((ERROR_SUCCESS == lResult) && ((REG_SZ == dwType) || (REG_EXPAND_SZ == dwType))) {
- std::vector<TCHAR> aBuffer(dwSize);
+ std::vector<wchar_t> aBuffer(dwSize);
lResult = ::RegQueryValueEx(hKey, pszValueName, nullptr, nullptr, reinterpret_cast<LPBYTE>(&*aBuffer.begin()), &dwSize);
if (ERROR_SUCCESS == lResult)
std::copy(aBuffer.begin(), aBuffer.end(), std::back_inserter(sResult));
diff --git a/plugins/Quotes/src/Log.cpp b/plugins/Quotes/src/Log.cpp
index 055fb22937..f3a038d2a7 100644
--- a/plugins/Quotes/src/Log.cpp
+++ b/plugins/Quotes/src/Log.cpp
@@ -24,7 +24,7 @@ namespace
tofstream file(rsFileName.c_str(), std::ios::ate | std::ios::app);
if (file.good())
{
- TCHAR szTime[20];
+ wchar_t szTime[20];
_tstrtime_s(szTime);
file << szTime << L" ================================>\n" << rsMsg << L"\n\n";
}
diff --git a/plugins/Quotes/src/OptionDukasCopy.cpp b/plugins/Quotes/src/OptionDukasCopy.cpp
index f5506cada2..6a5b8b0fc6 100644
--- a/plugins/Quotes/src/OptionDukasCopy.cpp
+++ b/plugins/Quotes/src/OptionDukasCopy.cpp
@@ -314,6 +314,6 @@ void ShowDukasCopyPropPage(CQuotesProviderDukasCopy* pProvider, WPARAM wp, OPTIO
odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG_ECONOMIC_RATES);
odp.pfnDlgProc = EconomicRatesDlgProc;
- odp.ptszTab = const_cast<LPTSTR>(pi.m_sName.c_str());
+ odp.pwszTab = const_cast<LPTSTR>(pi.m_sName.c_str());
Options_AddPage(wp, &odp);
}
diff --git a/plugins/Quotes/src/QuoteChart.cpp b/plugins/Quotes/src/QuoteChart.cpp
index 47dca6bfce..25aa422995 100644
--- a/plugins/Quotes/src/QuoteChart.cpp
+++ b/plugins/Quotes/src/QuoteChart.cpp
@@ -47,7 +47,7 @@ bool read_log_file(MCONTACT hContact, TChart& rChart)
line.imbue(loc);
tstring sName;
- std::getline(line, sName, _T('\t'));
+ std::getline(line, sName, '\t');
line >> oDateTime >> dRate;
if ((false == line.fail()) && (true == line.eof())) {
rChart.AddValue(oDateTime, dRate);
@@ -205,8 +205,8 @@ INT_PTR CALLBACK ChartDlgProc(HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
::SetWindowLongPtr(hDlg, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(hContact));
- static LPCTSTR szSources[] = { LPGENT("Log File"), LPGENT("Miranda's History") };
- static LPCTSTR szFilters[] = { LPGENT("All"), LPGENT("Last Day"), LPGENT("Last Week"), LPGENT("Last Month"), LPGENT("Last Year"), LPGENT("User-Defined") };
+ static LPCTSTR szSources[] = { LPGENW("Log File"), LPGENW("Miranda's History") };
+ static LPCTSTR szFilters[] = { LPGENW("All"), LPGENW("Last Day"), LPGENW("Last Week"), LPGENW("Last Month"), LPGENW("Last Year"), LPGENW("User-Defined") };
for (int i = 0; i < sizeof(szSources) / sizeof(szSources[0]); ++i) {
LPCTSTR p = TranslateTS(szSources[i]);
diff --git a/plugins/Quotes/src/QuoteInfoDlg.cpp b/plugins/Quotes/src/QuoteInfoDlg.cpp
index da74285271..ac9471c959 100644
--- a/plugins/Quotes/src/QuoteInfoDlg.cpp
+++ b/plugins/Quotes/src/QuoteInfoDlg.cpp
@@ -60,7 +60,7 @@ INT_PTR CALLBACK QuoteInfoDlgProcImpl(MCONTACT hContact, HWND hdlg, UINT msg, WP
time_t nFetchTime;
if (true == get_fetch_time(nFetchTime, hContact)) {
- TCHAR szTime[50] = { 0 };
+ wchar_t szTime[50] = { 0 };
if (0 == _tctime_s(szTime, 50, &nFetchTime)) {
::SetDlgItemText(hdlg, IDC_EDIT_RATE_FETCH_TIME, szTime);
}
@@ -253,7 +253,7 @@ int Quotes_PrebuildContactMenu(WPARAM wp, LPARAM)
tstring sLogFileName;
bool bThereIsLogFile = (true == get_log_file(hContact, sLogFileName))
- && (false == sLogFileName.empty()) && (0 == _taccess(sLogFileName.c_str(), 04));
+ && (false == sLogFileName.empty()) && (0 == _waccess(sLogFileName.c_str(), 04));
if (true == bThereIsLogFile) {
#ifdef CHART_IMPLEMENT
Menu_EnableItem(g_hMenuChart, true);
diff --git a/plugins/Quotes/src/QuotesProviderBase.cpp b/plugins/Quotes/src/QuotesProviderBase.cpp
index b98dd35d51..263df84fac 100644
--- a/plugins/Quotes/src/QuotesProviderBase.cpp
+++ b/plugins/Quotes/src/QuotesProviderBase.cpp
@@ -263,7 +263,7 @@ public:
bool bValid = true;
int nCurValue = 0;
for (tstring::const_iterator i = rsFrmt.begin(); i != rsFrmt.end() && bValid && nCurValue < NumValues;) {
- TCHAR chr = *i;
+ wchar_t chr = *i;
switch (chr) {
default:
if (false == std::isspace(chr))
@@ -272,10 +272,10 @@ public:
++i;
break;
- case _T('%'):
+ case '%':
++i;
if (i != rsFrmt.end()) {
- TCHAR t = *i;
+ wchar_t t = *i;
++i;
CQuotesProviderVisitorTendency visitor(hContact, t);
pProvider->Accept(visitor);
@@ -291,15 +291,15 @@ public:
}
else bValid = false;
break;
- case _T('>'):
+ case '>':
m_nComparison = Greater;
++i;
break;
- case _T('<'):
+ case '<':
m_nComparison = Less;
++i;
break;
- case _T('='):
+ case '=':
switch (m_nComparison) {
default:
bValid = false;
@@ -372,22 +372,22 @@ tstring format_rate(const IQuotesProvider *pProvider, MCONTACT hContact, const t
tstring sResult;
for (tstring::const_iterator i = rsFrmt.begin(); i != rsFrmt.end();) {
- TCHAR chr = *i;
+ wchar_t chr = *i;
switch (chr) {
default:
sResult += chr;
++i;
break;
- case _T('\\'):
+ case '\\':
++i;
if (i != rsFrmt.end()) {
- TCHAR t = *i;
+ wchar_t t = *i;
switch (t) {
- case _T('%'): sResult += L"%"; break;
- case _T('t'): sResult += L"\t"; break;
- case _T('n'): sResult += L"\n"; break;
- case _T('\\'): sResult += L"\\"; break;
+ case '%': sResult += L"%"; break;
+ case 't': sResult += L"\t"; break;
+ case 'n': sResult += L"\n"; break;
+ case '\\': sResult += L"\\"; break;
default: sResult += chr; sResult += t; break;
}
++i;
@@ -395,7 +395,7 @@ tstring format_rate(const IQuotesProvider *pProvider, MCONTACT hContact, const t
else sResult += chr;
break;
- case _T('%'):
+ case '%':
++i;
if (i != rsFrmt.end()) {
chr = *i;
@@ -505,12 +505,12 @@ bool show_popup(const IQuotesProvider* pProvider,
ppd.lchIcon = Quotes_LoadIconEx(IDI_ICON_DOWN);
}
- CQuotesProviderVisitorFormater visitor(hContact, _T('s'), 0);
+ CQuotesProviderVisitorFormater visitor(hContact, 's', 0);
pProvider->Accept(visitor);
const tstring& sTitle = visitor.GetResult();
mir_tstrncpy(ppd.lptzContactName, sTitle.c_str(), MAX_CONTACTNAME);
{
- ptrT ss(variables_parsedup((TCHAR*)rsFormat.c_str(), 0, hContact));
+ ptrT ss(variables_parsedup((wchar_t*)rsFormat.c_str(), 0, hContact));
tstring sText = format_rate(pProvider, hContact, tstring(ss));
mir_tstrncpy(ppd.lptzText, sText.c_str(), MAX_SECONDLINE);
}
@@ -572,7 +572,7 @@ void CQuotesProviderBase::WriteContactRate(MCONTACT hContact, double dRate, cons
if (true == sSymbol.empty())
sSymbol = Quotes_DBGetStringT(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_SYMBOL);
- oNick << std::setfill(_T(' ')) << std::setw(10) << std::left << sSymbol << std::setw(6) << std::right << dRate;
+ oNick << std::setfill(L' ') << std::setw(10) << std::left << sSymbol << std::setw(6) << std::right << dRate;
}
CTendency tendency;
diff --git a/plugins/Quotes/src/QuotesProviderDukasCopy.cpp b/plugins/Quotes/src/QuotesProviderDukasCopy.cpp
index e010f98577..8404c2b479 100644
--- a/plugins/Quotes/src/QuotesProviderDukasCopy.cpp
+++ b/plugins/Quotes/src/QuotesProviderDukasCopy.cpp
@@ -86,7 +86,7 @@ struct CEconomicRateInfo
typedef std::vector<CEconomicRateInfo> TEconomicRates;
typedef IHTMLNode::THTMLNodePtr THTMLNodePtr;
-bool string2double(const TCHAR* pszText, double& rValue)
+bool string2double(const wchar_t* pszText, double& rValue)
{
assert(pszText);
try {
diff --git a/plugins/Quotes/src/QuotesProviderFinance.cpp b/plugins/Quotes/src/QuotesProviderFinance.cpp
index b200715fa5..9403611d54 100644
--- a/plugins/Quotes/src/QuotesProviderFinance.cpp
+++ b/plugins/Quotes/src/QuotesProviderFinance.cpp
@@ -260,6 +260,6 @@ void CQuotesProviderFinance::ShowPropertyPage(WPARAM wp, OPTIONSDIALOGPAGE &odp)
odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG_OPT_FINANCE);
odp.pfnDlgProc = GoogleFinanceOptDlgProc;
odp.dwInitParam = LPARAM(this);
- odp.ptszTab = const_cast<LPTSTR>(GetInfo().m_sName.c_str());
+ odp.pwszTab = const_cast<LPTSTR>(GetInfo().m_sName.c_str());
Options_AddPage(wp, &odp);
}
diff --git a/plugins/Quotes/src/QuotesProviderGoogle.cpp b/plugins/Quotes/src/QuotesProviderGoogle.cpp
index 096def469d..95e15ca85b 100644
--- a/plugins/Quotes/src/QuotesProviderGoogle.cpp
+++ b/plugins/Quotes/src/QuotesProviderGoogle.cpp
@@ -382,7 +382,7 @@ void CQuotesProviderGoogle::ShowPropertyPage(WPARAM wp, OPTIONSDIALOGPAGE &odp)
{
odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG_OPT_GOOGLE);
odp.pfnDlgProc = GoogleOptDlgProc;
- odp.ptszTab = const_cast<LPTSTR>(GetInfo().m_sName.c_str());
+ odp.pwszTab = const_cast<LPTSTR>(GetInfo().m_sName.c_str());
Options_AddPage(wp, &odp);
}
diff --git a/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp b/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp
index 8219497148..cfcda85e76 100644
--- a/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp
+++ b/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp
@@ -66,8 +66,8 @@ tstring get_var_value(const tstring& rsHTML, LPCTSTR pszVarName, size_t cVarName
if (tstring::npos != n) {
size_t cLengthHTML = rsHTML.size();
for (size_t i = n + cVarNameLength; i < cLengthHTML; ++i) {
- TCHAR c = rsHTML[i];
- if (_T(';') == c)
+ wchar_t c = rsHTML[i];
+ if (';' == c)
break;
sResult.push_back(c);
@@ -87,8 +87,8 @@ tstring get_company_id(const tstring& rsHTML)
if (tstring::npos != n) {
size_t cLengthHTML = rsHTML.size();
for (size_t i = n + cVarNameLength; i < cLengthHTML; ++i) {
- TCHAR c = rsHTML[i];
- if (_T(')') == c)
+ wchar_t c = rsHTML[i];
+ if (')' == c)
break;
sResult.push_back(c);
@@ -103,10 +103,10 @@ tstring get_company_name(const tstring& rsHTML)
static size_t cVarNameLength = mir_tstrlen(pszVarName);
tstring s = get_var_value(rsHTML, pszVarName, cVarNameLength);
- if (s.size() > 0 && _T('\'') == s[0])
+ if (s.size() > 0 && '\'' == s[0])
s.erase(s.begin());
- if (s.size() > 0 && _T('\'') == s[s.size() - 1])
+ if (s.size() > 0 && '\'' == s[s.size() - 1])
s.erase(s.rbegin().base() - 1);
return s;
@@ -171,8 +171,8 @@ bool get_dif_value(const IHTMLNode::THTMLNodePtr& pNode, CGoogleInfo& rInfo, int
// this value is in brackets and it has percentage sign.
// Remove these symbols.
for (tstring::iterator i = sDiff.begin(); i != sDiff.end();) {
- TCHAR s = *i;
- if (_T('(') == s || _T(')') == s || _T('%') == s)
+ wchar_t s = *i;
+ if ('(' == s || ')' == s || '%' == s)
i = sDiff.erase(i);
else
++i;
diff --git a/plugins/Quotes/src/QuotesProviderVisitorFormater.cpp b/plugins/Quotes/src/QuotesProviderVisitorFormater.cpp
index 04d3fe7662..f421813bf7 100644
--- a/plugins/Quotes/src/QuotesProviderVisitorFormater.cpp
+++ b/plugins/Quotes/src/QuotesProviderVisitorFormater.cpp
@@ -1,6 +1,6 @@
#include "StdAfx.h"
-CQuotesProviderVisitorFormater::CQuotesProviderVisitorFormater(MCONTACT hContact, TCHAR chr, int nWidth)
+CQuotesProviderVisitorFormater::CQuotesProviderVisitorFormater(MCONTACT hContact, wchar_t chr, int nWidth)
: m_hContact(hContact),
m_chr(chr),
m_nWidth(nWidth)
@@ -18,23 +18,23 @@ const tstring& CQuotesProviderVisitorFormater::GetResult()const
void CQuotesProviderVisitorFormater::Visit(const CQuotesProviderDukasCopy&)
{
- if (_T('d') == m_chr || _T('D') == m_chr)
+ if ('d' == m_chr || 'D' == m_chr)
m_sResult = Quotes_DBGetStringT(m_hContact, QUOTES_MODULE_NAME, DB_STR_QUOTE_DESCRIPTION);
}
void CQuotesProviderVisitorFormater::Visit(const CQuotesProviderGoogle&)
{
switch (m_chr) {
- case _T('F'):
+ case 'F':
m_sResult = Quotes_DBGetStringT(m_hContact, QUOTES_MODULE_NAME, DB_STR_FROM_DESCRIPTION);
break;
- case _T('f'):
+ case 'f':
m_sResult = Quotes_DBGetStringT(m_hContact, QUOTES_MODULE_NAME, DB_STR_FROM_ID);
break;
- case _T('I'):
+ case 'I':
m_sResult = Quotes_DBGetStringT(m_hContact, QUOTES_MODULE_NAME, DB_STR_TO_DESCRIPTION);
break;
- case _T('i'):
+ case 'i':
m_sResult = Quotes_DBGetStringT(m_hContact, QUOTES_MODULE_NAME, DB_STR_TO_ID);
break;
}
@@ -67,24 +67,24 @@ static tstring format_fetch_time(const CQuotesProviderBase&, MCONTACT hContact,
void CQuotesProviderVisitorFormater::Visit(const CQuotesProviderBase& rProvider)
{
switch (m_chr) {
- case _T('%'):
- case _T('\t'):
- case _T('\\'):
+ case '%':
+ case '\t':
+ case '\\':
m_sResult = m_chr;
break;
- case _T('S'):
+ case 'S':
m_sResult = Quotes_DBGetStringT(m_hContact, QUOTES_MODULE_NAME, DB_STR_QUOTE_PROVIDER);
break;
- case _T('s'):
+ case 's':
m_sResult = Quotes_DBGetStringT(m_hContact, QUOTES_MODULE_NAME, DB_STR_QUOTE_SYMBOL);
break;
- case _T('X'):
+ case 'X':
m_sResult = format_fetch_time(rProvider, m_hContact, Quotes_GetTimeFormat(true));
break;
- case _T('x'):
+ case 'x':
m_sResult = format_fetch_time(rProvider, m_hContact, Quotes_GetDateFormat(true));
break;
- case _T('t'):
+ case 't':
{
tstring sFrmt = Quotes_GetDateFormat(true);
sFrmt += L" ";
@@ -92,11 +92,11 @@ void CQuotesProviderVisitorFormater::Visit(const CQuotesProviderBase& rProvider)
m_sResult = format_fetch_time(rProvider, m_hContact, sFrmt);
}
break;
- case _T('r'):
- case _T('R'):
+ case 'r':
+ case 'R':
FormatDoubleHelper(DB_STR_QUOTE_CURR_VALUE);
break;
- case _T('p'):
+ case 'p':
FormatDoubleHelper(DB_STR_QUOTE_PREV_VALUE);
break;
}
@@ -105,16 +105,16 @@ void CQuotesProviderVisitorFormater::Visit(const CQuotesProviderBase& rProvider)
void CQuotesProviderVisitorFormater::Visit(const CQuotesProviderGoogleFinance&/* rProvider*/)
{
switch (m_chr) {
- case _T('o'):
+ case 'o':
FormatDoubleHelper(DB_STR_GOOGLE_FINANCE_OPEN_VALUE);
break;
- case _T('d'):
+ case 'd':
FormatDoubleHelper(DB_STR_GOOGLE_FINANCE_DIFF, L"0");
break;
- case _T('y'):
+ case 'y':
FormatDoubleHelper(DB_STR_GOOGLE_FINANCE_PERCENT_CHANGE_TO_YERSTERDAY_CLOSE, L"0");
break;
- case _T('n'):
+ case 'n':
m_sResult = Quotes_DBGetStringT(m_hContact, QUOTES_MODULE_NAME, DB_STR_QUOTE_DESCRIPTION);
break;
}
@@ -146,22 +146,22 @@ void CQuotesProviderVisitorFormater::FormatDoubleHelper(LPCSTR pszDbSet,
void CQuotesProviderVisitorFormater::Visit(const CQuotesProviderYahoo&)
{
switch (m_chr) {
- case _T('o'):
+ case 'o':
FormatDoubleHelper(DB_STR_YAHOO_OPEN_VALUE);
break;
- case _T('h'):
+ case 'h':
FormatDoubleHelper(DB_STR_YAHOO_DAY_HIGH);
break;
- case _T('P'):
+ case 'P':
FormatDoubleHelper(DB_STR_YAHOO_PREVIOUS_CLOSE);
break;
- case _T('c'):
+ case 'c':
FormatDoubleHelper(DB_STR_YAHOO_CHANGE);
break;
- case _T('g'):
+ case 'g':
FormatDoubleHelper(DB_STR_YAHOO_DAY_LOW);
break;
- case _T('n'):
+ case 'n':
m_sResult = Quotes_DBGetStringT(m_hContact, QUOTES_MODULE_NAME, DB_STR_QUOTE_DESCRIPTION);
break;
}
diff --git a/plugins/Quotes/src/QuotesProviderVisitorFormater.h b/plugins/Quotes/src/QuotesProviderVisitorFormater.h
index 9ae3408d6a..0b03842a35 100644
--- a/plugins/Quotes/src/QuotesProviderVisitorFormater.h
+++ b/plugins/Quotes/src/QuotesProviderVisitorFormater.h
@@ -4,7 +4,7 @@
class CQuotesProviderVisitorFormater : public CQuotesProviderVisitor
{
public:
- CQuotesProviderVisitorFormater(MCONTACT hContact, TCHAR chr, int nWidth);
+ CQuotesProviderVisitorFormater(MCONTACT hContact, wchar_t chr, int nWidth);
~CQuotesProviderVisitorFormater();
const tstring& GetResult()const;
@@ -22,7 +22,7 @@ private:
private:
MCONTACT m_hContact;
- TCHAR m_chr;
+ wchar_t m_chr;
tstring m_sResult;
int m_nWidth;
};
diff --git a/plugins/Quotes/src/QuotesProviderVisitorTendency.cpp b/plugins/Quotes/src/QuotesProviderVisitorTendency.cpp
index a4899909e1..1e6d4fe384 100644
--- a/plugins/Quotes/src/QuotesProviderVisitorTendency.cpp
+++ b/plugins/Quotes/src/QuotesProviderVisitorTendency.cpp
@@ -1,6 +1,6 @@
#include "stdafx.h"
-CQuotesProviderVisitorTendency::CQuotesProviderVisitorTendency(MCONTACT hContact, TCHAR chr)
+CQuotesProviderVisitorTendency::CQuotesProviderVisitorTendency(MCONTACT hContact, wchar_t chr)
: m_hContact(hContact), m_chr(chr), m_bValid(false), m_dResult(0.0)
{
}
@@ -8,11 +8,11 @@ CQuotesProviderVisitorTendency::CQuotesProviderVisitorTendency(MCONTACT hContact
void CQuotesProviderVisitorTendency::Visit(const CQuotesProviderBase&)
{
switch (m_chr) {
- case _T('r'):
- case _T('R'):
+ case 'r':
+ case 'R':
GetValue(DB_STR_QUOTE_CURR_VALUE);
break;
- case _T('p'):
+ case 'p':
GetValue(DB_STR_QUOTE_PREV_VALUE);
break;
}
@@ -21,13 +21,13 @@ void CQuotesProviderVisitorTendency::Visit(const CQuotesProviderBase&)
void CQuotesProviderVisitorTendency::Visit(const CQuotesProviderGoogleFinance&)
{
switch (m_chr) {
- case _T('o'):
+ case 'o':
GetValue(DB_STR_GOOGLE_FINANCE_OPEN_VALUE);
break;
- case _T('d'):
+ case 'd':
GetValue(DB_STR_GOOGLE_FINANCE_DIFF);
break;
- case _T('y'):
+ case 'y':
GetValue(DB_STR_GOOGLE_FINANCE_PERCENT_CHANGE_TO_YERSTERDAY_CLOSE);
break;
}
@@ -36,19 +36,19 @@ void CQuotesProviderVisitorTendency::Visit(const CQuotesProviderGoogleFinance&)
void CQuotesProviderVisitorTendency::Visit(const CQuotesProviderYahoo&)
{
switch (m_chr) {
- case _T('o'):
+ case 'o':
GetValue(DB_STR_YAHOO_OPEN_VALUE);
break;
- case _T('h'):
+ case 'h':
GetValue(DB_STR_YAHOO_DAY_HIGH);
break;
- case _T('P'):
+ case 'P':
GetValue(DB_STR_YAHOO_PREVIOUS_CLOSE);
break;
- case _T('c'):
+ case 'c':
GetValue(DB_STR_YAHOO_CHANGE);
break;
- case _T('g'):
+ case 'g':
GetValue(DB_STR_YAHOO_DAY_LOW);
break;
}
diff --git a/plugins/Quotes/src/QuotesProviderVisitorTendency.h b/plugins/Quotes/src/QuotesProviderVisitorTendency.h
index 9f81605220..537f8bd0a6 100644
--- a/plugins/Quotes/src/QuotesProviderVisitorTendency.h
+++ b/plugins/Quotes/src/QuotesProviderVisitorTendency.h
@@ -4,7 +4,7 @@
class CQuotesProviderVisitorTendency : public CQuotesProviderVisitor
{
public:
- CQuotesProviderVisitorTendency(MCONTACT hContact, TCHAR chr);
+ CQuotesProviderVisitorTendency(MCONTACT hContact, wchar_t chr);
bool IsValid()const{ return m_bValid; }
double GetResult()const{ return m_dResult; }
@@ -19,7 +19,7 @@ private:
private:
MCONTACT m_hContact;
- TCHAR m_chr;
+ wchar_t m_chr;
bool m_bValid;
double m_dResult;
};
diff --git a/plugins/Quotes/src/QuotesProviderYahoo.cpp b/plugins/Quotes/src/QuotesProviderYahoo.cpp
index e590472834..cef09471c2 100644
--- a/plugins/Quotes/src/QuotesProviderYahoo.cpp
+++ b/plugins/Quotes/src/QuotesProviderYahoo.cpp
@@ -2,10 +2,10 @@
void remove_quotes(tstring& s)
{
- if (*s.begin() == _T('"'))
+ if (*s.begin() == '"')
s.erase(s.begin());
- if (*s.rbegin() == _T('"')) {
+ if (*s.rbegin() == '"') {
tstring::iterator i(s.begin());
std::advance(i, s.size() - 1);
s.erase(i);
@@ -14,12 +14,12 @@ void remove_quotes(tstring& s)
void remove_end_of_line(tstring& s)
{
- if (*s.rbegin() == _T('\n')) {
+ if (*s.rbegin() == '\n') {
tstring::iterator i(s.begin());
std::advance(i, s.size() - 1);
s.erase(i);
}
- if (*s.rbegin() == _T('\r')) {
+ if (*s.rbegin() == '\r') {
tstring::iterator i(s.begin());
std::advance(i, s.size() - 1);
s.erase(i);
@@ -83,7 +83,7 @@ void CQuotesProviderYahoo::RefreshQuotes(TContracts& anContacts)
remove_end_of_line(sLine);
TStrings asStrings;
- for (tstring::size_type nPos = sLine.find(_T(',')); nPos != tstring::npos; nPos = sLine.find(_T(','))) {
+ for (tstring::size_type nPos = sLine.find(','); nPos != tstring::npos; nPos = sLine.find(',')) {
tstring::iterator i(sLine.begin());
std::advance(i, nPos);
tstring s(sLine.begin(), i);
diff --git a/plugins/Quotes/src/SettingsDlg.cpp b/plugins/Quotes/src/SettingsDlg.cpp
index ee548a211e..5e8b0f0751 100644
--- a/plugins/Quotes/src/SettingsDlg.cpp
+++ b/plugins/Quotes/src/SettingsDlg.cpp
@@ -82,25 +82,25 @@ void update_all_controls(HWND hDlg)
::EnableWindow(::GetDlgItem(hDlg, IDC_BUTTON_POPUP_SETTINGS), (bIsCheckedContactSpec&&bIsPopupServiceEnabled));
}
-std::vector<TCHAR> get_filter()
+std::vector<wchar_t> get_filter()
{
- std::vector<TCHAR> aFilter;
- LPCTSTR pszFilterParts[] = { LPGENT("Log Files (*.txt,*.log)"), L"*.txt;*.log", LPGENT("All files (*.*)"), L"*.*" };
+ std::vector<wchar_t> aFilter;
+ LPCTSTR pszFilterParts[] = { LPGENW("Log Files (*.txt,*.log)"), L"*.txt;*.log", LPGENW("All files (*.*)"), L"*.*" };
for (int i = 0; i < sizeof(pszFilterParts) / sizeof(pszFilterParts[0]); ++i) {
tstring sPart = TranslateTS(pszFilterParts[i]);
std::copy(sPart.begin(), sPart.end(), std::back_inserter(aFilter));
- aFilter.push_back(_T('\0'));
+ aFilter.push_back('\0');
}
- aFilter.push_back(_T('\0'));
+ aFilter.push_back('\0');
return aFilter;
}
void select_log_file(HWND hDlg)
{
- std::vector<TCHAR> aFileBuffer(_MAX_PATH * 2, _T('\0'));
+ std::vector<wchar_t> aFileBuffer(_MAX_PATH * 2, '\0');
LPTSTR pszFile = &*aFileBuffer.begin();
- std::vector<TCHAR> aFilterBuffer = get_filter();
+ std::vector<wchar_t> aFilterBuffer = get_filter();
LPCTSTR pszFilter = &*aFilterBuffer.begin();
OPENFILENAME ofn = { 0 };
@@ -957,7 +957,7 @@ bool ShowSettingsDlg(HWND hWndParent, CAdvProviderSettings* pAdvSettings)
static void replace_invalid_char(tstring::value_type& rChar, tstring::value_type repl)
{
- static const TCHAR charInvalidSigns[] = { _T('\\'), _T('/'), _T(':'), _T('*'), _T('?'), _T('\"'), _T('<'), _T('>'), _T('|') };
+ static const wchar_t charInvalidSigns[] = { '\\', '/', ':', '*', '?', '\"', '<', '>', '|' };
for (int i = 0; i < sizeof(charInvalidSigns) / sizeof(charInvalidSigns[0]); ++i) {
if (rChar == charInvalidSigns[i]) {
@@ -976,13 +976,13 @@ tstring GenerateLogFileName(const tstring &rsLogFilePattern, const tstring &rsQu
tstring::size_type n = sPath.find(g_pszVariableQuoteName);
if (tstring::npos != n) {
tstring s = rsQuoteSymbol;
- std::for_each(s.begin(), s.end(), boost::bind(replace_invalid_char, _1, _T('_')));
+ std::for_each(s.begin(), s.end(), boost::bind(replace_invalid_char, _1, '_'));
sPath.replace(n, mir_tstrlen(g_pszVariableQuoteName), s.c_str());
}
}
if (nFlags & glfnResolveUserProfile) {
- TCHAR *ptszParsedName = Utils_ReplaceVarsT(sPath.c_str());
+ wchar_t *ptszParsedName = Utils_ReplaceVarsT(sPath.c_str());
if (ptszParsedName) {
sPath = ptszParsedName;
mir_free(ptszParsedName);
diff --git a/plugins/Quotes/src/WinCtrlHelper.cpp b/plugins/Quotes/src/WinCtrlHelper.cpp
index 18662cb0cd..78be2d2ced 100644
--- a/plugins/Quotes/src/WinCtrlHelper.cpp
+++ b/plugins/Quotes/src/WinCtrlHelper.cpp
@@ -15,7 +15,7 @@ static INT_PTR CALLBACK VariableListDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPAR
std::for_each(raSpec.begin(), raSpec.end(),
[&o](const CQuotesProviderVisitorFormatSpecificator::CFormatSpecificator& spec)
{
- o << spec.m_sSymbol << _T('\t') << spec.m_sDesc << L"\r\n";
+ o << spec.m_sSymbol << '\t' << spec.m_sDesc << L"\r\n";
});
::SetDlgItemText(hWnd, IDC_EDIT_VARIABLE, o.str().c_str());
}
diff --git a/plugins/Quotes/src/WinCtrlHelper.h b/plugins/Quotes/src/WinCtrlHelper.h
index 52e4521f24..1c5777d45d 100644
--- a/plugins/Quotes/src/WinCtrlHelper.h
+++ b/plugins/Quotes/src/WinCtrlHelper.h
@@ -7,7 +7,7 @@ inline tstring get_window_text(HWND hWnd)
{
int cBytes = ::GetWindowTextLength(hWnd);
- std::vector<TCHAR> aBuf(cBytes + 1);
+ std::vector<wchar_t> aBuf(cBytes + 1);
LPTSTR pBuffer = &*(aBuf.begin());
::GetWindowText(hWnd, pBuffer, cBytes + 1);
diff --git a/plugins/Quotes/src/stdafx.h b/plugins/Quotes/src/stdafx.h
index bb38b5b290..d4c5d2ffc1 100644
--- a/plugins/Quotes/src/stdafx.h
+++ b/plugins/Quotes/src/stdafx.h
@@ -50,7 +50,7 @@ typedef std::wistream tistream;
typedef boost::posix_time::wtime_input_facet ttime_input_facet;
typedef boost::posix_time::wtime_facet ttime_facet;
-inline std::string quotes_t2a(const TCHAR* t)
+inline std::string quotes_t2a(const wchar_t* t)
{
std::string s;
char* p = mir_t2a(t);
@@ -64,7 +64,7 @@ inline std::string quotes_t2a(const TCHAR* t)
inline tstring quotes_a2t(const char* s)
{
tstring t;
- TCHAR* p = mir_a2t(s);
+ wchar_t* p = mir_a2t(s);
if (p) {
t = p;
mir_free(p);
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp
index 45e07dd431..86758e4288 100644
--- a/plugins/RecentContacts/src/RecentContacts.cpp
+++ b/plugins/RecentContacts/src/RecentContacts.cpp
@@ -222,7 +222,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
int i=0;
cmultimap::iterator curContact;
- std::tstring str;
+ std::wstring str;
char strtim[256 + 16];
string strtimformat;
@@ -237,7 +237,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
for(curContact = DlgDat->Contacts->begin(); curContact != DlgDat->Contacts->end(); curContact++) {
if (curContact->second != NULL && db_get_b(curContact->second, dbLastUC_ModuleName, dbLastUC_IgnoreContact, 0) == 0 ) {
- TCHAR *cname = ( TCHAR* )pcli->pfnGetContactDisplayName(curContact->second, 0);
+ wchar_t *cname = ( wchar_t* )pcli->pfnGetContactDisplayName(curContact->second, 0);
if ( cname == NULL )
continue;
@@ -504,9 +504,9 @@ int OnMsgEvent(WPARAM, LPARAM lParam)
static int OnPrebuildContactMenu(WPARAM hContact, LPARAM)
{
if (db_get_b(hContact, dbLastUC_ModuleName, dbLastUC_IgnoreContact, 0) == 0)
- Menu_ModifyItem(hMenuItemRemove, LPGENT("Ignore Contact"));
+ Menu_ModifyItem(hMenuItemRemove, LPGENW("Ignore Contact"));
else
- Menu_ModifyItem(hMenuItemRemove, LPGENT("Show Contact"));
+ Menu_ModifyItem(hMenuItemRemove, LPGENW("Show Contact"));
return 0;
}
diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp
index e40c5d048b..5df0d124b5 100644
--- a/plugins/RemovePersonalSettings/src/rps.cpp
+++ b/plugins/RemovePersonalSettings/src/rps.cpp
@@ -144,11 +144,11 @@ extern "C" int __declspec(dllexport) Unload(void)
INT_PTR RemoveAllService(WPARAM, LPARAM)
{
if (gIniFile[0] == '\0') {
- MessageBox(NULL, TranslateT("Configuration file could not be found!"), TranslateT(MSGBOX_TITLE), MB_OK | MB_ICONERROR);
+ MessageBox(NULL, TranslateT("Configuration file could not be found!"), TranslateW(MSGBOX_TITLE), MB_OK | MB_ICONERROR);
return -1;
}
- if (MessageBox(NULL, TranslateT(NOTICE_TEXT), TranslateT(MSGBOX_TITLE), MB_YESNO) == IDYES) {
+ if (MessageBox(NULL, TranslateW(NOTICE_TEXT), TranslateW(MSGBOX_TITLE), MB_YESNO) == IDYES) {
SetProtocolsOffline();
RemoveUsers();
RemoveSettings();
@@ -156,7 +156,7 @@ INT_PTR RemoveAllService(WPARAM, LPARAM)
RemoveDirectories();
DisablePlugins();
- MessageBox(NULL, TranslateT("Settings are deleted now."), TranslateT(MSGBOX_TITLE), MB_OK | MB_ICONINFORMATION);
+ MessageBox(NULL, TranslateT("Settings are deleted now."), TranslateW(MSGBOX_TITLE), MB_OK | MB_ICONINFORMATION);
}
return 0;
diff --git a/plugins/RemovePersonalSettings/src/stdafx.h b/plugins/RemovePersonalSettings/src/stdafx.h
index ed36365f1d..482fbbad7f 100644
--- a/plugins/RemovePersonalSettings/src/stdafx.h
+++ b/plugins/RemovePersonalSettings/src/stdafx.h
@@ -39,10 +39,10 @@
#define METACONTACTS_PROTOCOL_NAME "MetaContacts"
-#define NOTICE_TEXT LPGEN("All your personal settings will be erased!\n\
+#define NOTICE_TEXT LPGENW("All your personal settings will be erased!\n\
Make sure you are running this from a copy of your profile (and not over the original one).\n\
Running this will erase files/folders under Miranda main folder.\n\n\
Are you sure you want to remove all your personal settings?\n\n\
(You cannot say that I don't told you about the risks :P)")
-#define MSGBOX_TITLE LPGEN("Remove Personal Settings")
+#define MSGBOX_TITLE LPGENW("Remove Personal Settings")
diff --git a/plugins/SMS/src/SMSConstans.h b/plugins/SMS/src/SMSConstans.h
index b347620cbf..b212510210 100644
--- a/plugins/SMS/src/SMSConstans.h
+++ b/plugins/SMS/src/SMSConstans.h
@@ -33,7 +33,7 @@
struct FontOptionsList
{
COLORREF defColour;
- TCHAR* szDefFace;
+ wchar_t* szDefFace;
BYTE defStyle;
char defSize;
}
@@ -66,8 +66,8 @@ int SendSMSMenuCommand(WPARAM wParam,LPARAM lParam);
#define SMS_READ "/ReadSms"
#define SMS_READ_ACK "/ReadSmsAck"
#define SMS_SEND "/SendSMS"
-#define SMS_SEND_STR LPGENT("Send &SMS...")
-#define SMS_SEND_CM_STR LPGENT("&SMS Message")
+#define SMS_SEND_STR LPGENW("Send &SMS...")
+#define SMS_SEND_CM_STR LPGENW("&SMS Message")
// ñòðóêòóðà ñîäåðæàùàÿ èíôîðìàöèþ î ñåðâèñàõ/ôóíêöèÿõ
struct SERVICE_ITEM
diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp
index d7a411f20b..3ad9cc6b53 100644
--- a/plugins/SMS/src/SMS_svc.cpp
+++ b/plugins/SMS/src/SMS_svc.cpp
@@ -32,7 +32,7 @@ int LoadModules(void)
SET_UID(mi, 0x3ce387db, 0xbaac, 0x490f, 0xac, 0xab, 0x8c, 0xf7, 0xe9, 0xcd, 0x86, 0xa1);
mi.position = 300050000;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_SMS);
- mi.name.t = SMS_SEND_STR;
+ mi.name.w = SMS_SEND_STR;
mi.pszService = szServiceFunction;
mi.flags = CMIF_TCHAR;
Menu_AddMainMenuItem(&mi);
@@ -40,7 +40,7 @@ int LoadModules(void)
SET_UID(mi, 0x736e4cff, 0x769e, 0x45dc, 0x8b, 0x78, 0x83, 0xf9, 0xe4, 0xbb, 0x81, 0x9e);
mi.position = -2000070000;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_SMS);
- mi.name.t = SMS_SEND_CM_STR;
+ mi.name.w = SMS_SEND_CM_STR;
mi.pszService = szServiceFunction;
mi.flags = CMIF_TCHAR;
ssSMSSettings.hContactMenuItems[0] = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/SMS/src/functions.cpp b/plugins/SMS/src/functions.cpp
index 7c42dc769c..d6256e4726 100644
--- a/plugins/SMS/src/functions.cpp
+++ b/plugins/SMS/src/functions.cpp
@@ -402,31 +402,31 @@ DWORD ReplaceInBuff(LPVOID lpInBuff, size_t dwInBuffSize, size_t dwReplaceItemsC
static const LPTSTR lpszXMLTags[] = { TEXT("&apos;"), TEXT("&quot;"), TEXT("&amp;"), TEXT("&lt;"), TEXT("&gt;") };
-static const size_t dwXMLTagsCount[] = { (6 * sizeof(TCHAR)), (6 * sizeof(TCHAR)), (5 * sizeof(TCHAR)), (4 * sizeof(TCHAR)), (4 * sizeof(TCHAR)) };
+static const size_t dwXMLTagsCount[] = { (6 * sizeof(wchar_t)), (6 * sizeof(wchar_t)), (5 * sizeof(wchar_t)), (4 * sizeof(wchar_t)), (4 * sizeof(wchar_t)) };
static const LPTSTR lpszXMLSymbols[] = { TEXT("\'"), TEXT("\""), TEXT("&"), TEXT("<"), TEXT(">") };
-static const size_t dwXMLSymbolsCount[] = { sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR) };
+static const size_t dwXMLSymbolsCount[] = { sizeof(wchar_t), sizeof(wchar_t), sizeof(wchar_t), sizeof(wchar_t), sizeof(wchar_t) };
//Decode XML coded string. The function translate special xml code into standard characters.
DWORD DecodeXML(LPTSTR lptszMessage, size_t dwMessageSize, LPTSTR lptszMessageConverted, size_t dwMessageConvertedBuffSize, size_t *pdwMessageConvertedSize)
{
- DWORD dwRet = ReplaceInBuff(lptszMessage, (dwMessageSize*sizeof(TCHAR)), _countof(lpszXMLTags), (LPVOID*)lpszXMLTags, (size_t*)dwXMLTagsCount, (LPVOID*)lpszXMLSymbols, (size_t*)dwXMLSymbolsCount, lptszMessageConverted, (dwMessageConvertedBuffSize*sizeof(TCHAR)), pdwMessageConvertedSize);
+ DWORD dwRet = ReplaceInBuff(lptszMessage, (dwMessageSize*sizeof(wchar_t)), _countof(lpszXMLTags), (LPVOID*)lpszXMLTags, (size_t*)dwXMLTagsCount, (LPVOID*)lpszXMLSymbols, (size_t*)dwXMLSymbolsCount, lptszMessageConverted, (dwMessageConvertedBuffSize*sizeof(wchar_t)), pdwMessageConvertedSize);
- if (pdwMessageConvertedSize) (*pdwMessageConvertedSize) /= sizeof(TCHAR);
+ if (pdwMessageConvertedSize) (*pdwMessageConvertedSize) /= sizeof(wchar_t);
return(dwRet);
}
//Encode XML coded string. The function translate special saved xml characters into special characters.
DWORD EncodeXML(LPTSTR lptszMessage, size_t dwMessageSize, LPTSTR lptszMessageConverted, size_t dwMessageConvertedBuffSize, size_t *pdwMessageConvertedSize)
{
- DWORD dwRet = ReplaceInBuff(lptszMessage, (dwMessageSize*sizeof(TCHAR)), _countof(lpszXMLTags), (LPVOID*)lpszXMLSymbols, (size_t*)dwXMLSymbolsCount, (LPVOID*)lpszXMLTags, (size_t*)dwXMLTagsCount, lptszMessageConverted, (dwMessageConvertedBuffSize*sizeof(TCHAR)), pdwMessageConvertedSize);
+ DWORD dwRet = ReplaceInBuff(lptszMessage, (dwMessageSize*sizeof(wchar_t)), _countof(lpszXMLTags), (LPVOID*)lpszXMLSymbols, (size_t*)dwXMLSymbolsCount, (LPVOID*)lpszXMLTags, (size_t*)dwXMLTagsCount, lptszMessageConverted, (dwMessageConvertedBuffSize*sizeof(wchar_t)), pdwMessageConvertedSize);
- if (pdwMessageConvertedSize) (*pdwMessageConvertedSize) /= sizeof(TCHAR);
+ if (pdwMessageConvertedSize) (*pdwMessageConvertedSize) /= sizeof(wchar_t);
return(dwRet);
}
//(Taken from Miranda-IM source code:)
-BYTE MsgDlgGetFontDefaultCharset(const TCHAR*)
+BYTE MsgDlgGetFontDefaultCharset(const wchar_t*)
{
return(DEFAULT_CHARSET);
}
diff --git a/plugins/SMS/src/options.cpp b/plugins/SMS/src/options.cpp
index 2d59221d13..5a464a79c5 100644
--- a/plugins/SMS/src/options.cpp
+++ b/plugins/SMS/src/options.cpp
@@ -31,7 +31,7 @@ WORD wSMSSignControlsList[] = { IDC_BEGIN, IDC_END, IDC_SIGNATURE, IDC_SIGNGROUP
INT_PTR CALLBACK DlgProcEditorOptions(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TCHAR tszSign[1024];
+ wchar_t tszSign[1024];
switch(msg){
case WM_INITDIALOG:
diff --git a/plugins/SMS/src/receive.cpp b/plugins/SMS/src/receive.cpp
index fad6ded482..9779f46907 100644
--- a/plugins/SMS/src/receive.cpp
+++ b/plugins/SMS/src/receive.cpp
@@ -36,7 +36,7 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam)
return 0;
char szPhone[MAX_PHONE_LEN] = { 0 };
- TCHAR tszPhone[MAX_PHONE_LEN] = { 0 };
+ wchar_t tszPhone[MAX_PHONE_LEN] = { 0 };
LPSTR lpszXML = (LPSTR)((ACKDATA*)lParam)->lParam, lpszData, lpszPhone;
size_t dwXMLSize = 0, dwDataSize, dwPhoneSize;
ACKDATA *ack = ((ACKDATA*)lParam);
@@ -138,7 +138,7 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam)
if (ack->result == ACKRESULT_FAILED || CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszData, (int)dwDataSize, "no", 2) == CSTR_EQUAL) {
char szBuff[1024];
- TCHAR tszErrorMessage[1028];
+ wchar_t tszErrorMessage[1028];
LPSTR lpszErrorDescription;
if (SendSMSWindowMultipleGet(hWndDlg)) {
@@ -209,7 +209,7 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam)
int handleNewMessage(WPARAM hContact, LPARAM hDbEvent)
{
char szServiceFunction[MAX_PATH], *pszServiceFunctionName;
- TCHAR szToolTip[MAX_PATH];
+ wchar_t szToolTip[MAX_PATH];
DBEVENTINFO dbei = { sizeof(dbei) };
if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == -1)
diff --git a/plugins/SMS/src/senddlg.cpp b/plugins/SMS/src/senddlg.cpp
index 66f7581eeb..96f36d700a 100644
--- a/plugins/SMS/src/senddlg.cpp
+++ b/plugins/SMS/src/senddlg.cpp
@@ -142,7 +142,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA
SendSMSWindowUpdateAccountList(hWndDlg);
{
- TCHAR tszSign[1024];
+ wchar_t tszSign[1024];
size_t dwSignLen = 0;
if (DB_SMS_GetByte(NULL, "UseSignature", SMS_DEFAULT_USESIGNATURE))
@@ -209,7 +209,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA
case WM_TIMER:
if (wParam == TIMERID_MSGSEND) {
HWND hwndTimeOut;
- TCHAR tszMessage[1028], tszPhone[MAX_PHONE_LEN];
+ wchar_t tszMessage[1028], tszPhone[MAX_PHONE_LEN];
if (psswdWindowData->bMultiple) {
TVITEM tvi;
@@ -268,11 +268,11 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA
break;
case TIMEDOUT_RETRY:
{
- TCHAR tszPhone[MAX_PHONE_LEN];
+ wchar_t tszPhone[MAX_PHONE_LEN];
size_t dwPhoneSize;
size_t dwMessageSize = GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MESSAGE);
- LPTSTR lpwszMessage = (LPTSTR)MEMALLOC(((dwMessageSize + 4)*sizeof(TCHAR)));
+ LPTSTR lpwszMessage = (LPTSTR)MEMALLOC(((dwMessageSize + 4)*sizeof(wchar_t)));
if (lpwszMessage) {
if (psswdWindowData->bMultiple) {
TVITEM tvi;
@@ -303,7 +303,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA
case IDC_ADDNUMBER:
{
- TCHAR tszPhone[MAX_PHONE_LEN];
+ wchar_t tszPhone[MAX_PHONE_LEN];
if (IsPhoneW(tszPhone, GetDlgItemText(hWndDlg, IDC_ADDRESS, tszPhone, _countof(tszPhone)))) {
TVINSERTSTRUCT tvis = { 0 };
tvis.item.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
@@ -345,7 +345,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA
}
}
else {
- TCHAR tszPhone[MAX_PHONE_LEN];
+ wchar_t tszPhone[MAX_PHONE_LEN];
size_t dwPhoneSize = GetDlgItemText(hWndDlg, IDC_ADDRESS, tszPhone, _countof(tszPhone));
if (IsPhoneW(tszPhone, dwPhoneSize)) {
size_t dwMessageSize = GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MESSAGE);
@@ -382,7 +382,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA
break;
case IDC_MESSAGE:
if (HIWORD(wParam) == EN_CHANGE) {
- TCHAR tszBuff[MAX_PATH];
+ wchar_t tszBuff[MAX_PATH];
size_t dwMessageSize = GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MESSAGE);
EnableWindow(GetDlgItem(hWndDlg, IDOK), dwMessageSize != 0);
@@ -394,7 +394,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA
{
BOOL bCont = TRUE;
char szBuff[MAX_PATH];
- TCHAR tszPhone[MAX_PHONE_LEN];
+ wchar_t tszPhone[MAX_PHONE_LEN];
DBVARIANT dbv;
size_t dwPhoneSize = GetDlgItemText(hWndDlg, IDC_ADDRESS, tszPhone, (_countof(tszPhone) - 4));
@@ -558,7 +558,7 @@ HWND SendSMSWindowAdd(MCONTACT hContact)
ListMTUnLock(&ssSMSSettings.lmtSendSMSWindowsListMT);
LPTSTR lptszContactDisplayName = pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR tszTitle[MAX_PATH];
+ wchar_t tszTitle[MAX_PATH];
mir_sntprintf(tszTitle, L"%s - %s", lptszContactDisplayName, TranslateT("Send SMS"));
SetWindowText(psswdWindowData->hWnd, tszTitle);
SendDlgItemMessage(psswdWindowData->hWnd, IDC_NAME, CB_ADDSTRING, 0, (LPARAM)lptszContactDisplayName);
@@ -841,12 +841,12 @@ HWND SendSMSWindowIsOtherInstanceHContact(MCONTACT hContact)
//
void SendSMSWindowNext(HWND hWndDlg)
{
- TCHAR tszPhone[MAX_PHONE_LEN];
+ wchar_t tszPhone[MAX_PHONE_LEN];
size_t dwPhoneSize, dwMessageSize;
TVITEM tvi = { 0 };
dwMessageSize = GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MESSAGE);
- LPTSTR lptszMessage = (LPTSTR)MEMALLOC(((dwMessageSize + 4)*sizeof(TCHAR)));
+ LPTSTR lptszMessage = (LPTSTR)MEMALLOC(((dwMessageSize + 4)*sizeof(wchar_t)));
if (!lptszMessage)
return;
@@ -952,7 +952,7 @@ void SendSMSWindowsUpdateAllAccountLists()
void AddContactPhonesToComboToListParam(MCONTACT hContact, LPSTR lpszModule, LPSTR lpszValueName, HWND hWndList)
{
char szBuff[MAX_PATH];
- TCHAR tszPhone[MAX_PHONE_LEN], tszPhoneRaw[MAX_PHONE_LEN];
+ wchar_t tszPhone[MAX_PHONE_LEN], tszPhoneRaw[MAX_PHONE_LEN];
size_t i, dwPhoneSize;
if (DB_GetStaticStringW(hContact, lpszModule, lpszValueName, tszPhoneRaw, _countof(tszPhoneRaw), &dwPhoneSize)) {
@@ -1003,7 +1003,7 @@ void AddContactPhonesToCombo(HWND hWnd, MCONTACT hContact)
void AddContactPhonesToTreeViewParam(MCONTACT hContact, LPSTR lpszModule, LPSTR lpszValueName, HWND hWndList, HTREEITEM *phParent)
{
char szBuff[MAX_PATH];
- TCHAR tszPhone[MAX_PHONE_LEN], tszPhoneRaw[MAX_PHONE_LEN];
+ wchar_t tszPhone[MAX_PHONE_LEN], tszPhoneRaw[MAX_PHONE_LEN];
size_t i, dwPhoneSize;
TVINSERTSTRUCT tvis = { 0 };
@@ -1073,7 +1073,7 @@ size_t GetSMSMessageLenMax(HWND hWndDlg)
size_t dwMessageSize, dwLenght = 160;
dwMessageSize = GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MESSAGE);
- LPTSTR lptszMessage = (LPTSTR)MEMALLOC(((dwMessageSize + 4)*sizeof(TCHAR)));
+ LPTSTR lptszMessage = (LPTSTR)MEMALLOC(((dwMessageSize + 4)*sizeof(wchar_t)));
if (lptszMessage) {
dwMessageSize = GetDlgItemText(hWndDlg, IDC_MESSAGE, lptszMessage, (int)dwMessageSize + 2);
if (dwMessageSize != WideCharToMultiByte(CP_UTF8, 0, lptszMessage, (int)dwMessageSize, NULL, 0, NULL, NULL))
diff --git a/plugins/Scriver/src/chat/chat.h b/plugins/Scriver/src/chat/chat.h
index 949202712a..e1d2c3a693 100644
--- a/plugins/Scriver/src/chat/chat.h
+++ b/plugins/Scriver/src/chat/chat.h
@@ -60,7 +60,7 @@ struct LOGSTREAMDATA : public GCLogStreamDataBase
struct SESSION_INFO : public GCSessionInfoBase, public CommonWindowData
{
- TCHAR szSearch[255];
+ wchar_t szSearch[255];
int desiredInputAreaHeight;
};
@@ -79,7 +79,7 @@ void LoadMsgLogBitmaps(void);
void FreeMsgLogBitmaps(void);
// window.c
-int GetTextPixelSize( TCHAR* pszText, HFONT hFont, BOOL bWidth);
+int GetTextPixelSize( wchar_t* pszText, HFONT hFont, BOOL bWidth);
// options.c
int OptionsInit(void);
@@ -89,13 +89,13 @@ void ShowRoom(SESSION_INFO *si, WPARAM wp, BOOL bSetForeground);
// manager.c
HWND SM_FindWindowByContact(MCONTACT hContact);
-SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const TCHAR* pszOriginal, const TCHAR* pszCurrent);
+SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const wchar_t* pszOriginal, const wchar_t* pszCurrent);
char SM_GetStatusIndicator(SESSION_INFO *si, USERINFO *ui);
// tools.c
BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight, int bManyFix);
-TCHAR* my_strstri(const TCHAR* s1, const TCHAR* s2) ;
-UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, TCHAR* pszUID, TCHAR* pszWordText);
+wchar_t* my_strstri(const wchar_t* s1, const wchar_t* s2) ;
+UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, wchar_t* pszUID, wchar_t* pszWordText);
void DestroyGCMenu(HMENU *hMenu, int iIndex);
//////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/Scriver/src/chat/main.cpp b/plugins/Scriver/src/chat/main.cpp
index 29b88790d4..a223f9898d 100644
--- a/plugins/Scriver/src/chat/main.cpp
+++ b/plugins/Scriver/src/chat/main.cpp
@@ -154,7 +154,7 @@ static void OnLoadSettings()
int Chat_Load()
{
- CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENT("Messaging") L"/" LPGENT("Group chats"), FONTMODE_SKIP };
+ CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Messaging") L"/" LPGENW("Group chats"), FONTMODE_SKIP };
mir_getCI(&data);
saveCI = *pci;
diff --git a/plugins/Scriver/src/chat/manager.cpp b/plugins/Scriver/src/chat/manager.cpp
index 823547751c..e71eecc249 100644
--- a/plugins/Scriver/src/chat/manager.cpp
+++ b/plugins/Scriver/src/chat/manager.cpp
@@ -34,13 +34,13 @@ HWND SM_FindWindowByContact(MCONTACT hContact)
return NULL;
}
-SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const TCHAR* pszOriginal, const TCHAR* pszCurrent)
+SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const wchar_t* pszOriginal, const wchar_t* pszCurrent)
{
SESSION_INFO* pResult = NULL;
if (prevSession == NULL && my_strstri(currSession->ptszName, pszOriginal) == currSession->ptszName)
pResult = currSession;
else {
- TCHAR* pszName = NULL;
+ wchar_t* pszName = NULL;
SESSION_INFO* pTemp = pci->wndList;
if (currSession == prevSession)
pszCurrent = pszOriginal;
diff --git a/plugins/Scriver/src/chat/options.cpp b/plugins/Scriver/src/chat/options.cpp
index db8d646289..6f83994009 100644
--- a/plugins/Scriver/src/chat/options.cpp
+++ b/plugins/Scriver/src/chat/options.cpp
@@ -27,7 +27,7 @@ static HWND hPathTip = 0;
struct branch_t
{
- TCHAR* szDescr;
+ wchar_t* szDescr;
char* szDBName;
int iMode;
BYTE bDefault;
@@ -35,79 +35,79 @@ struct branch_t
};
static struct branch_t branch1[] = {
- { LPGENT("Flash when someone speaks"), "FlashWindow", 0, 0, NULL },
- { LPGENT("Flash when a word is highlighted"), "FlashWindowHighlight", 0, 1, NULL },
- { LPGENT("Show chat nick list"), "ShowNicklist", 0, 1, NULL },
- { LPGENT("Enable button context menus"), "RightClickFilter", 0, 0, NULL },
- { LPGENT("Show topic on your contact list (if supported)"), "TopicOnClist", 0, 0, NULL },
- { LPGENT("Do not play sounds when focused"), "SoundsFocus", 0, 0, NULL },
- { LPGENT("Do not pop up when joining"), "PopupOnJoin", 0, 0, NULL },
- { LPGENT("Show and hide by double clicking in the contact list"), "ToggleVisibility", 0, 0, NULL },
- { LPGENT("Show contact statuses (if supported)"), "ShowContactStatus", 0, 0, NULL },
- { LPGENT("Display contact status icon before role icon"), "ContactStatusFirst", 0, 0, NULL },
- { LPGENT("Add ':' to auto-completed names"), "AddColonToAutoComplete", 0, 1, NULL }
+ { LPGENW("Flash when someone speaks"), "FlashWindow", 0, 0, NULL },
+ { LPGENW("Flash when a word is highlighted"), "FlashWindowHighlight", 0, 1, NULL },
+ { LPGENW("Show chat nick list"), "ShowNicklist", 0, 1, NULL },
+ { LPGENW("Enable button context menus"), "RightClickFilter", 0, 0, NULL },
+ { LPGENW("Show topic on your contact list (if supported)"), "TopicOnClist", 0, 0, NULL },
+ { LPGENW("Do not play sounds when focused"), "SoundsFocus", 0, 0, NULL },
+ { LPGENW("Do not pop up when joining"), "PopupOnJoin", 0, 0, NULL },
+ { LPGENW("Show and hide by double clicking in the contact list"), "ToggleVisibility", 0, 0, NULL },
+ { LPGENW("Show contact statuses (if supported)"), "ShowContactStatus", 0, 0, NULL },
+ { LPGENW("Display contact status icon before role icon"), "ContactStatusFirst", 0, 0, NULL },
+ { LPGENW("Add ':' to auto-completed names"), "AddColonToAutoComplete", 0, 1, NULL }
};
static struct branch_t branch2[] = {
- { LPGENT("Show icons"), "IconFlags", GC_EVENT_TOPIC | GC_EVENT_JOIN | GC_EVENT_QUIT |
+ { LPGENW("Show icons"), "IconFlags", GC_EVENT_TOPIC | GC_EVENT_JOIN | GC_EVENT_QUIT |
GC_EVENT_MESSAGE | GC_EVENT_ACTION | GC_EVENT_HIGHLIGHT | GC_EVENT_PART |
GC_EVENT_KICK | GC_EVENT_NOTICE | GC_EVENT_NICK | GC_EVENT_INFORMATION | GC_EVENT_ADDSTATUS, 0, NULL },
- { LPGENT("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1, NULL },
- { LPGENT("Only prefix with timestamp if it has changed"), "ShowTimeStampIfChanged", 0, 0, NULL },
- { LPGENT("Timestamp has same color as event"), "TimeStampEventColour", 0, 0, NULL },
- { LPGENT("Indent the second line of a message"), "LogIndentEnabled", 0, 1, NULL },
- { LPGENT("Limit user names to 20 characters"), "LogLimitNames", 0, 1, NULL },
- { LPGENT("Strip colors from messages"), "StripFormatting", 0, 0, NULL },
- { LPGENT("Enable 'event filter' for new rooms"), "FilterEnabled", 0, 0, NULL }
+ { LPGENW("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1, NULL },
+ { LPGENW("Only prefix with timestamp if it has changed"), "ShowTimeStampIfChanged", 0, 0, NULL },
+ { LPGENW("Timestamp has same color as event"), "TimeStampEventColour", 0, 0, NULL },
+ { LPGENW("Indent the second line of a message"), "LogIndentEnabled", 0, 1, NULL },
+ { LPGENW("Limit user names to 20 characters"), "LogLimitNames", 0, 1, NULL },
+ { LPGENW("Strip colors from messages"), "StripFormatting", 0, 0, NULL },
+ { LPGENW("Enable 'event filter' for new rooms"), "FilterEnabled", 0, 0, NULL }
};
static struct branch_t branch3[] = {
- { LPGENT("Show topic changes"), "FilterFlags", GC_EVENT_TOPIC, 0, NULL },
- { LPGENT("Show users joining"), "FilterFlags", GC_EVENT_JOIN, 0, NULL },
- { LPGENT("Show users disconnecting"), "FilterFlags", GC_EVENT_QUIT, 0, NULL },
- { LPGENT("Show messages"), "FilterFlags", GC_EVENT_MESSAGE, 1, NULL },
- { LPGENT("Show actions"), "FilterFlags", GC_EVENT_ACTION, 1, NULL },
- { LPGENT("Show users leaving"), "FilterFlags", GC_EVENT_PART, 0, NULL },
- { LPGENT("Show users being kicked"), "FilterFlags", GC_EVENT_KICK, 1, NULL },
- { LPGENT("Show notices"), "FilterFlags", GC_EVENT_NOTICE, 1, NULL },
- { LPGENT("Show users changing name"), "FilterFlags", GC_EVENT_NICK, 0, NULL },
- { LPGENT("Show information messages"), "FilterFlags", GC_EVENT_INFORMATION, 1, NULL },
- { LPGENT("Show status changes of users"), "FilterFlags", GC_EVENT_ADDSTATUS, 0, NULL },
+ { LPGENW("Show topic changes"), "FilterFlags", GC_EVENT_TOPIC, 0, NULL },
+ { LPGENW("Show users joining"), "FilterFlags", GC_EVENT_JOIN, 0, NULL },
+ { LPGENW("Show users disconnecting"), "FilterFlags", GC_EVENT_QUIT, 0, NULL },
+ { LPGENW("Show messages"), "FilterFlags", GC_EVENT_MESSAGE, 1, NULL },
+ { LPGENW("Show actions"), "FilterFlags", GC_EVENT_ACTION, 1, NULL },
+ { LPGENW("Show users leaving"), "FilterFlags", GC_EVENT_PART, 0, NULL },
+ { LPGENW("Show users being kicked"), "FilterFlags", GC_EVENT_KICK, 1, NULL },
+ { LPGENW("Show notices"), "FilterFlags", GC_EVENT_NOTICE, 1, NULL },
+ { LPGENW("Show users changing name"), "FilterFlags", GC_EVENT_NICK, 0, NULL },
+ { LPGENW("Show information messages"), "FilterFlags", GC_EVENT_INFORMATION, 1, NULL },
+ { LPGENW("Show status changes of users"), "FilterFlags", GC_EVENT_ADDSTATUS, 0, NULL },
};
static struct branch_t branch4[] = {
- { LPGENT("Show icons in tray only when the chat room is not active"), "TrayIconInactiveOnly", 0, 1, NULL },
- { LPGENT("Show icon in tray for topic changes"), "TrayIconFlags", GC_EVENT_TOPIC, 0, NULL },
- { LPGENT("Show icon in tray for users joining"), "TrayIconFlags", GC_EVENT_JOIN, 0, NULL },
- { LPGENT("Show icon in tray for users disconnecting"), "TrayIconFlags", GC_EVENT_QUIT, 0, NULL },
- { LPGENT("Show icon in tray for messages"), "TrayIconFlags", GC_EVENT_MESSAGE, 0, NULL },
- { LPGENT("Show icon in tray for actions"), "TrayIconFlags", GC_EVENT_ACTION, 0, NULL },
- { LPGENT("Show icon in tray for highlights"), "TrayIconFlags", GC_EVENT_HIGHLIGHT, 1, NULL },
- { LPGENT("Show icon in tray for users leaving"), "TrayIconFlags", GC_EVENT_PART, 0, NULL },
- { LPGENT("Show icon in tray for users kicking other user"), "TrayIconFlags", GC_EVENT_KICK, 0, NULL },
- { LPGENT("Show icon in tray for notices"), "TrayIconFlags", GC_EVENT_NOTICE, 0, NULL },
- { LPGENT("Show icon in tray for name changes"), "TrayIconFlags", GC_EVENT_NICK, 0, NULL },
- { LPGENT("Show icon in tray for information messages"), "TrayIconFlags", GC_EVENT_INFORMATION, 0, NULL },
- { LPGENT("Show icon in tray for status changes"), "TrayIconFlags", GC_EVENT_ADDSTATUS, 0, NULL },
+ { LPGENW("Show icons in tray only when the chat room is not active"), "TrayIconInactiveOnly", 0, 1, NULL },
+ { LPGENW("Show icon in tray for topic changes"), "TrayIconFlags", GC_EVENT_TOPIC, 0, NULL },
+ { LPGENW("Show icon in tray for users joining"), "TrayIconFlags", GC_EVENT_JOIN, 0, NULL },
+ { LPGENW("Show icon in tray for users disconnecting"), "TrayIconFlags", GC_EVENT_QUIT, 0, NULL },
+ { LPGENW("Show icon in tray for messages"), "TrayIconFlags", GC_EVENT_MESSAGE, 0, NULL },
+ { LPGENW("Show icon in tray for actions"), "TrayIconFlags", GC_EVENT_ACTION, 0, NULL },
+ { LPGENW("Show icon in tray for highlights"), "TrayIconFlags", GC_EVENT_HIGHLIGHT, 1, NULL },
+ { LPGENW("Show icon in tray for users leaving"), "TrayIconFlags", GC_EVENT_PART, 0, NULL },
+ { LPGENW("Show icon in tray for users kicking other user"), "TrayIconFlags", GC_EVENT_KICK, 0, NULL },
+ { LPGENW("Show icon in tray for notices"), "TrayIconFlags", GC_EVENT_NOTICE, 0, NULL },
+ { LPGENW("Show icon in tray for name changes"), "TrayIconFlags", GC_EVENT_NICK, 0, NULL },
+ { LPGENW("Show icon in tray for information messages"), "TrayIconFlags", GC_EVENT_INFORMATION, 0, NULL },
+ { LPGENW("Show icon in tray for status changes"), "TrayIconFlags", GC_EVENT_ADDSTATUS, 0, NULL },
};
static struct branch_t branch6[] = {
- { LPGENT("Show popups only when the chat room is not active"), "PopupInactiveOnly", 0, 1, NULL },
- { LPGENT("Show popup for topic changes"), "PopupFlags", GC_EVENT_TOPIC, 0, NULL },
- { LPGENT("Show popup for users joining"), "PopupFlags", GC_EVENT_JOIN, 0, NULL },
- { LPGENT("Show popup for users disconnecting"), "PopupFlags", GC_EVENT_QUIT, 0, NULL },
- { LPGENT("Show popup for messages"), "PopupFlags", GC_EVENT_MESSAGE, 0, NULL },
- { LPGENT("Show popup for actions"), "PopupFlags", GC_EVENT_ACTION, 0, NULL },
- { LPGENT("Show popup for highlights"), "PopupFlags", GC_EVENT_HIGHLIGHT, 0, NULL },
- { LPGENT("Show popup for users leaving"), "PopupFlags", GC_EVENT_PART, 0, NULL },
- { LPGENT("Show popup for users kicking other user"), "PopupFlags", GC_EVENT_KICK, 0, NULL },
- { LPGENT("Show popup for notices"), "PopupFlags", GC_EVENT_NOTICE, 0, NULL },
- { LPGENT("Show popup for name changes"), "PopupFlags", GC_EVENT_NICK, 0, NULL },
- { LPGENT("Show popup for information messages"), "PopupFlags", GC_EVENT_INFORMATION, 0, NULL },
- { LPGENT("Show popup for status changes"), "PopupFlags", GC_EVENT_ADDSTATUS, 0, NULL },
+ { LPGENW("Show popups only when the chat room is not active"), "PopupInactiveOnly", 0, 1, NULL },
+ { LPGENW("Show popup for topic changes"), "PopupFlags", GC_EVENT_TOPIC, 0, NULL },
+ { LPGENW("Show popup for users joining"), "PopupFlags", GC_EVENT_JOIN, 0, NULL },
+ { LPGENW("Show popup for users disconnecting"), "PopupFlags", GC_EVENT_QUIT, 0, NULL },
+ { LPGENW("Show popup for messages"), "PopupFlags", GC_EVENT_MESSAGE, 0, NULL },
+ { LPGENW("Show popup for actions"), "PopupFlags", GC_EVENT_ACTION, 0, NULL },
+ { LPGENW("Show popup for highlights"), "PopupFlags", GC_EVENT_HIGHLIGHT, 0, NULL },
+ { LPGENW("Show popup for users leaving"), "PopupFlags", GC_EVENT_PART, 0, NULL },
+ { LPGENW("Show popup for users kicking other user"), "PopupFlags", GC_EVENT_KICK, 0, NULL },
+ { LPGENW("Show popup for notices"), "PopupFlags", GC_EVENT_NOTICE, 0, NULL },
+ { LPGENW("Show popup for name changes"), "PopupFlags", GC_EVENT_NICK, 0, NULL },
+ { LPGENW("Show popup for information messages"), "PopupFlags", GC_EVENT_INFORMATION, 0, NULL },
+ { LPGENW("Show popup for status changes"), "PopupFlags", GC_EVENT_ADDSTATUS, 0, NULL },
};
-static HTREEITEM InsertBranch(HWND hwndTree, TCHAR* pszDescr, BOOL bExpanded)
+static HTREEITEM InsertBranch(HWND hwndTree, wchar_t* pszDescr, BOOL bExpanded)
{
TVINSERTSTRUCT tvis;
tvis.hParent = NULL;
@@ -222,7 +222,7 @@ static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM p
return 0;
}
-static void InitSetting(TCHAR **ppPointer, char *pszSetting, TCHAR *pszDefault)
+static void InitSetting(wchar_t **ppPointer, char *pszSetting, wchar_t *pszDefault)
{
DBVARIANT dbv;
if ( !db_get_ts(NULL, CHAT_MODULE, pszSetting, &dbv )) {
@@ -250,7 +250,7 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
FillBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), hListHeading4, branch4, _countof(branch4), 0x1000);
SendMessage(hwndDlg, OPT_FIXHEADINGS, 0, 0);
{
- TCHAR* pszGroup = NULL;
+ wchar_t* pszGroup = NULL;
InitSetting(&pszGroup, "AddToGroup", L"Chat rooms");
SetDlgItemText(hwndDlg, IDC_CHAT_GROUP, pszGroup);
mir_free(pszGroup);
@@ -357,12 +357,12 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN3,UDM_SETRANGE,0,MAKELONG(10000,0));
SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN3,UDM_SETPOS,0,MAKELONG(db_get_w(NULL,CHAT_MODULE,"LoggingLimit",100),0));
{
- TCHAR tszTemp[MAX_PATH];
+ wchar_t tszTemp[MAX_PATH];
PathToRelativeT(g_Settings.pszLogDir, tszTemp);
SetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, tszTemp);
}
- TCHAR tszTooltipText[2048];
+ wchar_t tszTooltipText[2048];
RECT rect;
mir_sntprintf(tszTooltipText,
@@ -452,7 +452,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
case IDC_CHAT_LOGDIRCHOOSE:
LPMALLOC psMalloc;
if (SUCCEEDED(CoGetMalloc(1, &psMalloc))) {
- TCHAR tszDirectory[MAX_PATH], tszTemp[MAX_PATH];
+ wchar_t tszDirectory[MAX_PATH], tszTemp[MAX_PATH];
BROWSEINFO bi = { 0 };
bi.hwndOwner = hwndDlg;
bi.pszDisplayName = tszDirectory;
@@ -519,15 +519,15 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_HIGHLIGHTWORDS));
if (iLen > 0) {
- TCHAR *ptszText = (TCHAR*)mir_alloc((iLen + 2) * sizeof(TCHAR));
- TCHAR *p2 = NULL;
+ wchar_t *ptszText = (wchar_t*)mir_alloc((iLen + 2) * sizeof(wchar_t));
+ wchar_t *p2 = NULL;
if (ptszText) {
GetDlgItemText(hwndDlg, IDC_CHAT_HIGHLIGHTWORDS, ptszText, iLen + 1);
- p2 = _tcschr(ptszText, (TCHAR)',');
+ p2 = wcschr(ptszText, (wchar_t)',');
while (p2) {
*p2 = ' ';
- p2 = _tcschr(ptszText, (TCHAR)',');
+ p2 = wcschr(ptszText, (wchar_t)',');
}
db_set_ts(NULL, CHAT_MODULE, "HighlightWords", ptszText);
mir_free(ptszText);
@@ -537,7 +537,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRECTORY));
if (iLen > 0) {
- TCHAR *pszText1 = (TCHAR*)malloc(iLen*sizeof(TCHAR)+2);
+ wchar_t *pszText1 = (wchar_t*)malloc(iLen*sizeof(wchar_t)+2);
GetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, pszText1, iLen + 1);
db_set_ts(NULL, CHAT_MODULE, "LogDirectory", pszText1);
free(pszText1);
diff --git a/plugins/Scriver/src/chat/tools.cpp b/plugins/Scriver/src/chat/tools.cpp
index 1a9be6ca87..eebd6fdd00 100644
--- a/plugins/Scriver/src/chat/tools.cpp
+++ b/plugins/Scriver/src/chat/tools.cpp
@@ -21,17 +21,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../stdafx.h"
-TCHAR* my_strstri(const TCHAR* s1, const TCHAR* s2)
+wchar_t* my_strstri(const wchar_t* s1, const wchar_t* s2)
{
for (int i = 0; s1[i]; i++)
- for (int j = i, k = 0; _totlower(s1[j]) == _totlower(s2[k]); j++, k++)
+ for (int j = i, k = 0; towlower(s1[j]) == towlower(s2[k]); j++, k++)
if (!s2[k + 1])
- return (TCHAR*)(s1 + i);
+ return (wchar_t*)(s1 + i);
return NULL;
}
-UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, TCHAR* pszUID, TCHAR* pszWordText)
+UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, wchar_t* pszUID, wchar_t* pszWordText)
{
GCMENUITEMS gcmi = { 0 };
HMENU hSubMenu = 0;
@@ -52,7 +52,7 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s
}
if (pszWordText && pszWordText[0]) {
- TCHAR szMenuText[4096];
+ wchar_t szMenuText[4096];
mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText);
ModifyMenu(*hMenu, 4, MF_STRING | MF_BYPOSITION, 4, szMenuText);
SetSearchEngineIcons(*hMenu, g_dat.hSearchEngineIconList);
@@ -61,7 +61,7 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s
gcmi.Type = MENU_ON_LOG;
}
else if (iIndex == 0) {
- TCHAR szTemp[50];
+ wchar_t szTemp[50];
if (pszWordText)
mir_sntprintf(szTemp, TranslateT("&Message %s"), pszWordText);
else
@@ -79,7 +79,7 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s
AppendMenu(*hMenu, MF_SEPARATOR, 0, 0);
for (int i = 0; i < gcmi.nItems; i++) {
- TCHAR *ptszText = TranslateTS(gcmi.Item[i].pszDesc);
+ wchar_t *ptszText = TranslateTS(gcmi.Item[i].pszDesc);
DWORD dwState = gcmi.Item[i].bDisabled ? MF_GRAYED : 0;
if (gcmi.Item[i].uType == MENU_NEWPOPUP) {
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp
index 53eaba0c5a..9e5d799407 100644
--- a/plugins/Scriver/src/chat/window.cpp
+++ b/plugins/Scriver/src/chat/window.cpp
@@ -22,23 +22,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../stdafx.h"
static ToolbarButton toolbarButtons[] = {
- { LPGENT("Bold"), IDC_CHAT_BOLD, 0, 4, 24 },
- { LPGENT("Italic"), IDC_CHAT_ITALICS, 0, 0, 24 },
- { LPGENT("Underline"), IDC_CHAT_UNDERLINE, 0, 0, 24 },
- { LPGENT("Text color"), IDC_CHAT_COLOR, 0, 0, 24 },
- { LPGENT("Background color"), IDC_CHAT_BKGCOLOR, 0, 0, 24 },
- { LPGENT("History"), IDC_CHAT_HISTORY, 1, 0, 24 },
- { LPGENT("Filter"), IDC_CHAT_FILTER, 1, 0, 24 },
- { LPGENT("Manager"), IDC_CHAT_CHANMGR, 1, 0, 24 },
- { LPGENT("Nick list"), IDC_CHAT_SHOWNICKLIST, 1, 0, 24 },
- { LPGENT("Send"), IDOK, 1, 0, 38 },
+ { LPGENW("Bold"), IDC_CHAT_BOLD, 0, 4, 24 },
+ { LPGENW("Italic"), IDC_CHAT_ITALICS, 0, 0, 24 },
+ { LPGENW("Underline"), IDC_CHAT_UNDERLINE, 0, 0, 24 },
+ { LPGENW("Text color"), IDC_CHAT_COLOR, 0, 0, 24 },
+ { LPGENW("Background color"), IDC_CHAT_BKGCOLOR, 0, 0, 24 },
+ { LPGENW("History"), IDC_CHAT_HISTORY, 1, 0, 24 },
+ { LPGENW("Filter"), IDC_CHAT_FILTER, 1, 0, 24 },
+ { LPGENW("Manager"), IDC_CHAT_CHANMGR, 1, 0, 24 },
+ { LPGENW("Nick list"), IDC_CHAT_SHOWNICKLIST, 1, 0, 24 },
+ { LPGENW("Send"), IDOK, 1, 0, 38 },
};
struct MESSAGESUBDATA
{
time_t lastEnterTime;
- TCHAR *szSearchQuery;
- TCHAR *szSearchResult;
+ wchar_t *szSearchQuery;
+ wchar_t *szSearchResult;
SESSION_INFO *lastSession;
};
@@ -207,9 +207,9 @@ static void TabAutoComplete(HWND hwnd, MESSAGESUBDATA *dat, SESSION_INFO *si)
return;
bool isTopic = false, isRoom = false;
- TCHAR *pszName = NULL;
- TCHAR* pszText = (TCHAR*)mir_alloc(iLen + 100 * sizeof(TCHAR));
- gt.cb = iLen + 99 * sizeof(TCHAR);
+ wchar_t *pszName = NULL;
+ wchar_t* pszText = (wchar_t*)mir_alloc(iLen + 100 * sizeof(wchar_t));
+ gt.cb = iLen + 99 * sizeof(wchar_t);
gt.flags = GT_DEFAULT;
SendMessage(hwnd, EM_GETTEXTEX, (WPARAM)&gt, (LPARAM)pszText);
@@ -218,7 +218,7 @@ static void TabAutoComplete(HWND hwnd, MESSAGESUBDATA *dat, SESSION_INFO *si)
if (dat->szSearchResult != NULL) {
int cbResult = (int)mir_tstrlen(dat->szSearchResult);
- if (start >= cbResult && !_tcsncicmp(dat->szSearchResult, pszText + start - cbResult, cbResult)) {
+ if (start >= cbResult && !wcsnicmp(dat->szSearchResult, pszText + start - cbResult, cbResult)) {
start -= cbResult;
goto LBL_SkipEnd;
}
@@ -237,12 +237,12 @@ LBL_SkipEnd:
int topicStart = start;
while (topicStart >0 && (pszText[topicStart - 1] == ' ' || pszText[topicStart - 1] == 13 || pszText[topicStart - 1] == VK_TAB))
topicStart--;
- if (topicStart > 5 && _tcsstr(&pszText[topicStart - 6], L"/topic") == &pszText[topicStart - 6])
+ if (topicStart > 5 && wcsstr(&pszText[topicStart - 6], L"/topic") == &pszText[topicStart - 6])
isTopic = true;
}
if (dat->szSearchQuery == NULL) {
- dat->szSearchQuery = (TCHAR*)mir_alloc(sizeof(TCHAR)*(end - start + 1));
+ dat->szSearchQuery = (wchar_t*)mir_alloc(sizeof(wchar_t)*(end - start + 1));
mir_tstrncpy(dat->szSearchQuery, pszText + start, end - start + 1);
dat->szSearchResult = mir_tstrdup(dat->szSearchQuery);
dat->lastSession = NULL;
@@ -272,7 +272,7 @@ LBL_SkipEnd:
if (end != start) {
ptrT szReplace;
if (!isRoom && !isTopic && g_Settings.bAddColonToAutoComplete && start == 0) {
- szReplace = (TCHAR*)mir_alloc((mir_tstrlen(pszName) + 4) * sizeof(TCHAR));
+ szReplace = (wchar_t*)mir_alloc((mir_tstrlen(pszName) + 4) * sizeof(wchar_t));
mir_tstrcpy(szReplace, pszName);
mir_tstrcat(szReplace, L": ");
pszName = szReplace;
@@ -783,13 +783,13 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO * p
ti.uId = 1;
ti.rect = clientRect;
- TCHAR tszBuf[1024]; tszBuf[0] = 0;
+ wchar_t tszBuf[1024]; tszBuf[0] = 0;
USERINFO *ui = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, currentHovered);
if (ui) {
if (ProtoServiceExists(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT)) {
- TCHAR *p = (TCHAR*)CallProtoService(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)parentdat->ptszID, (LPARAM)ui->pszUID);
+ wchar_t *p = (wchar_t*)CallProtoService(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)parentdat->ptszID, (LPARAM)ui->pszUID);
if (p != NULL) {
- _tcsncpy_s(tszBuf, p, _TRUNCATE);
+ wcsncpy_s(tszBuf, p, _TRUNCATE);
mir_free(p);
}
}
@@ -960,8 +960,8 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
else if (wParam < ' ')
break;
else {
- TCHAR szNew[2];
- szNew[0] = (TCHAR)wParam;
+ wchar_t szNew[2];
+ szNew[0] = (wchar_t)wParam;
szNew[1] = '\0';
if (mir_tstrlen(si->szSearch) >= _countof(si->szSearch) - 2) {
MessageBeep(MB_OK);
@@ -976,7 +976,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
for (int i = 0; i < iItems; i++) {
USERINFO *ui = pci->UM_FindUserFromIndex(si->pUsers, i);
if (ui) {
- if (!_tcsnicmp(ui->pszNick, si->szSearch, mir_tstrlen(si->szSearch))) {
+ if (!wcsnicmp(ui->pszNick, si->szSearch, mir_tstrlen(si->szSearch))) {
SendMessage(hwnd, LB_SETCURSEL, i, 0);
InvalidateRect(hwnd, NULL, FALSE);
return 0;
@@ -1018,7 +1018,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
return mir_callNextSubclass(hwnd, NicklistSubclassProc, msg, wParam, lParam);
}
-int GetTextPixelSize(TCHAR* pszText, HFONT hFont, BOOL bWidth)
+int GetTextPixelSize(wchar_t* pszText, HFONT hFont, BOOL bWidth)
{
if (!pszText || !hFont)
return 0;
@@ -1051,7 +1051,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR
HICON hIcon;
TabControlData tcd;
TitleBarData tbd;
- TCHAR szTemp[512];
+ wchar_t szTemp[512];
SESSION_INFO *si = (SESSION_INFO *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (!si && uMsg != WM_INITDIALOG)
@@ -1088,7 +1088,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR
int mask = (int)SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_GETEVENTMASK, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_SETEVENTMASK, 0, mask | ENM_LINK | ENM_MOUSEEVENTS);
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_SETEVENTMASK, 0, ENM_MOUSEEVENTS | ENM_KEYEVENTS | ENM_CHANGE | ENM_REQUESTRESIZE);
- SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_LIMITTEXT, sizeof(TCHAR) * 0x7FFFFFFF, 0);
+ SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_LIMITTEXT, sizeof(wchar_t) * 0x7FFFFFFF, 0);
SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_SETOLECALLBACK, 0, (LPARAM)&reOleCallback);
if (db_get_b(NULL, CHAT_MODULE, "UseIEView", 0)) {
@@ -1427,7 +1427,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR
if (ui) {
char szIndicator = SM_GetStatusIndicator(si, ui);
if (szIndicator > '\0') {
- static TCHAR ptszBuf[128];
+ static wchar_t ptszBuf[128];
mir_sntprintf(ptszBuf, L"%c%s", szIndicator, ui->pszNick);
SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_ADDSTRING, 0, (LPARAM)ptszBuf);
}
@@ -1636,7 +1636,7 @@ LABEL_SHOWWINDOW:
int item = LOWORD(SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_ITEMFROMPOINT, 0, MAKELPARAM(p.x, p.y)));
USERINFO *ui = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, item);
if (ui != NULL) {
- static TCHAR ptszBuf[1024];
+ static wchar_t ptszBuf[1024];
mir_sntprintf(ptszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s",
TranslateT("Nickname"), ui->pszNick,
TranslateT("Unique ID"), ui->pszUID,
@@ -1668,7 +1668,7 @@ LABEL_SHOWWINDOW:
LRESULT lResult = (LRESULT)SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETSEL, 0, 0);
int start = LOWORD(lResult);
size_t dwNameLenMax = (mir_tstrlen(ui->pszUID) + 4);
- TCHAR* pszName = (TCHAR*)alloca(sizeof(TCHAR) * dwNameLenMax);
+ wchar_t* pszName = (wchar_t*)alloca(sizeof(wchar_t) * dwNameLenMax);
if (start == 0)
mir_sntprintf(pszName, dwNameLenMax, L"%s: ", ui->pszUID);
else
diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp
index 78259fb1ef..42ec8e52c0 100644
--- a/plugins/Scriver/src/globals.cpp
+++ b/plugins/Scriver/src/globals.cpp
@@ -254,23 +254,23 @@ void LoadGlobalIcons()
}
}
-static struct { UINT cpId; const TCHAR *cpName; } cpTable[] =
+static struct { UINT cpId; const wchar_t *cpName; } cpTable[] =
{
- { 874, LPGENT("Thai") }, //
- { 932, LPGENT("Japanese") }, //
- { 936, LPGENT("Simplified Chinese") }, //
- { 949, LPGENT("Korean") }, //
- { 950, LPGENT("Traditional Chinese") }, //
- { 1250, LPGENT("Central European") }, //
- { 1251, LPGENT("Cyrillic") }, //
- { 1252, LPGENT("Latin I") }, //
- { 1253, LPGENT("Greek") }, //
- { 1254, LPGENT("Turkish") }, //
- { 1255, LPGENT("Hebrew") }, //
- { 1256, LPGENT("Arabic") }, //
- { 1257, LPGENT("Baltic") }, //
- { 1258, LPGENT("Vietnamese") }, //
- { 1361, LPGENT("Korean (Johab)") }
+ { 874, LPGENW("Thai") }, //
+ { 932, LPGENW("Japanese") }, //
+ { 936, LPGENW("Simplified Chinese") }, //
+ { 949, LPGENW("Korean") }, //
+ { 950, LPGENW("Traditional Chinese") }, //
+ { 1250, LPGENW("Central European") }, //
+ { 1251, LPGENW("Cyrillic") }, //
+ { 1252, LPGENW("Latin I") }, //
+ { 1253, LPGENW("Greek") }, //
+ { 1254, LPGENW("Turkish") }, //
+ { 1255, LPGENW("Hebrew") }, //
+ { 1256, LPGENW("Arabic") }, //
+ { 1257, LPGENW("Baltic") }, //
+ { 1258, LPGENW("Vietnamese") }, //
+ { 1361, LPGENW("Korean (Johab)") }
};
void LoadInfobarFonts()
diff --git a/plugins/Scriver/src/infobar.cpp b/plugins/Scriver/src/infobar.cpp
index c8485ed218..0175199ccc 100644
--- a/plugins/Scriver/src/infobar.cpp
+++ b/plugins/Scriver/src/infobar.cpp
@@ -40,7 +40,7 @@ void SetupInfobar(InfobarWindowData* idat)
cf2.cbSize = sizeof(cf2);
cf2.crTextColor = colour;
cf2.bCharSet = lf.lfCharSet;
- _tcsncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE);
+ wcsncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE);
cf2.dwEffects = ((lf.lfWeight >= FW_BOLD) ? CFE_BOLD : 0) | (lf.lfItalic ? CFE_ITALIC : 0);
cf2.wWeight = (WORD)lf.lfWeight;
cf2.bPitchAndFamily = lf.lfPitchAndFamily;
@@ -54,7 +54,7 @@ void SetupInfobar(InfobarWindowData* idat)
cf2.cbSize = sizeof(cf2);
cf2.crTextColor = colour;
cf2.bCharSet = lf.lfCharSet;
- _tcsncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE);
+ wcsncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE);
cf2.dwEffects = ((lf.lfWeight >= FW_BOLD) ? CFE_BOLD : 0) | (lf.lfItalic ? CFE_ITALIC : 0);
cf2.wWeight = (WORD)lf.lfWeight;
cf2.bPitchAndFamily = lf.lfPitchAndFamily;
@@ -83,12 +83,12 @@ void RefreshInfobar(InfobarWindowData* idat)
ptrT szXStatusName(db_get_tsa(idat->mwd->hContact, idat->mwd->szProto, "XStatusName"));
ptrT szXStatusMsg(db_get_tsa(idat->mwd->hContact, idat->mwd->szProto, "XStatusMsg"));
HICON hIcon = GetExtraStatusIcon(idat);
- TCHAR szText[2048];
+ wchar_t szText[2048];
SETTEXTEX st;
if (szXStatusMsg && *szXStatusMsg)
mir_sntprintf(szText, L"%s (%s)", TranslateTS(szXStatusName), szXStatusMsg);
else
- _tcsncpy_s(szText, TranslateTS(szXStatusName), _TRUNCATE);
+ wcsncpy_s(szText, TranslateTS(szXStatusName), _TRUNCATE);
st.flags = ST_DEFAULT;
st.codepage = 1200;
SendDlgItemMessage(hwnd, IDC_INFOBAR_NAME, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)pcli->pfnGetContactDisplayName(dat->hContact, 0));
diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp
index fcc305a9f4..d9ecad41e3 100644
--- a/plugins/Scriver/src/input.cpp
+++ b/plugins/Scriver/src/input.cpp
@@ -372,11 +372,11 @@ BOOL HandleLinkClick(HINSTANCE hInstance, HWND hwndDlg, HWND hwndFocus, ENLINK *
TEXTRANGE tr;
tr.chrg = lParam->chrg;
- tr.lpstrText = (LPWSTR)mir_alloc(sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 8));
+ tr.lpstrText = (LPWSTR)mir_alloc(sizeof(wchar_t)*(tr.chrg.cpMax - tr.chrg.cpMin + 8));
SendMessage(lParam->nmhdr.hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
- if (_tcschr(tr.lpstrText, _T('@')) != NULL && _tcschr(tr.lpstrText, _T(':')) == NULL && _tcschr(tr.lpstrText, _T('/')) == NULL) {
- memmove(tr.lpstrText + 7, tr.lpstrText, sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 1));
- memcpy(tr.lpstrText, L"mailto:", sizeof(TCHAR) * 7);
+ if (wcschr(tr.lpstrText, '@') != NULL && wcschr(tr.lpstrText, ':') == NULL && wcschr(tr.lpstrText, '/') == NULL) {
+ memmove(tr.lpstrText + 7, tr.lpstrText, sizeof(wchar_t)*(tr.chrg.cpMax - tr.chrg.cpMin + 1));
+ memcpy(tr.lpstrText, L"mailto:", sizeof(wchar_t) * 7);
}
BOOL bOpenLink = TRUE;
@@ -399,7 +399,7 @@ BOOL HandleLinkClick(HINSTANCE hInstance, HWND hwndDlg, HWND hwndFocus, ENLINK *
if (!OpenClipboard(hwndDlg))
break;
EmptyClipboard();
- HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(mir_tstrlen(tr.lpstrText) + 1));
+ HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(wchar_t)*(mir_tstrlen(tr.lpstrText) + 1));
mir_tstrcpy((LPWSTR)GlobalLock(hData), tr.lpstrText);
GlobalUnlock(hData);
SetClipboardData(CF_UNICODETEXT, hData);
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp
index 34637e2010..341c9c6a3a 100644
--- a/plugins/Scriver/src/msgdialog.cpp
+++ b/plugins/Scriver/src/msgdialog.cpp
@@ -34,24 +34,24 @@ static void UpdateReadChars(HWND hwndDlg, SrmmWindowData * dat);
static ToolbarButton toolbarButtons[] =
{
- { LPGENT("Quote"), IDC_QUOTE, 0, 4, 24 },
- { LPGENT("Add contact"), IDC_ADD, 0, 10, 24 },
- { LPGENT("User menu"), IDC_USERMENU, 1, 0, 24 },
- { LPGENT("User details"), IDC_DETAILS, 1, 0, 24 },
- { LPGENT("History"), IDC_HISTORY, 1, 0, 24 },
- { LPGENT("Send"), IDOK, 1, 0, 38 }
+ { LPGENW("Quote"), IDC_QUOTE, 0, 4, 24 },
+ { LPGENW("Add contact"), IDC_ADD, 0, 10, 24 },
+ { LPGENW("User menu"), IDC_USERMENU, 1, 0, 24 },
+ { LPGENW("User details"), IDC_DETAILS, 1, 0, 24 },
+ { LPGENW("History"), IDC_HISTORY, 1, 0, 24 },
+ { LPGENW("Send"), IDOK, 1, 0, 38 }
};
-static TCHAR* GetIEViewSelection(SrmmWindowData *dat)
+static wchar_t* GetIEViewSelection(SrmmWindowData *dat)
{
IEVIEWEVENT evt = { sizeof(evt) };
evt.hwnd = dat->hwndLog;
evt.hContact = dat->hContact;
evt.iType = IEE_GET_SELECTION;
- return mir_tstrdup((TCHAR*)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&evt));
+ return mir_tstrdup((wchar_t*)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&evt));
}
-static TCHAR* GetQuotedTextW(TCHAR *text)
+static wchar_t* GetQuotedTextW(wchar_t *text)
{
size_t i, j, l = mir_wstrlen(text);
int newLine = 1;
@@ -79,7 +79,7 @@ static TCHAR* GetQuotedTextW(TCHAR *text)
}
j += 3;
- TCHAR *out = (TCHAR*)mir_alloc(sizeof(TCHAR)* j);
+ wchar_t *out = (wchar_t*)mir_alloc(sizeof(wchar_t)* j);
newLine = 1;
wasCR = 0;
for (i = j = 0; i < l; i++) {
@@ -156,15 +156,15 @@ int RTL_Detect(WCHAR *pszwText)
return 0;
}
-static void AddToFileList(TCHAR ***pppFiles, int *totalCount, const TCHAR* szFilename)
+static void AddToFileList(wchar_t ***pppFiles, int *totalCount, const wchar_t* szFilename)
{
- *pppFiles = (TCHAR**)mir_realloc(*pppFiles, (++*totalCount + 1)*sizeof(TCHAR*));
+ *pppFiles = (wchar_t**)mir_realloc(*pppFiles, (++*totalCount + 1)*sizeof(wchar_t*));
(*pppFiles)[*totalCount] = NULL;
(*pppFiles)[*totalCount - 1] = mir_tstrdup(szFilename);
if (GetFileAttributes(szFilename) & FILE_ATTRIBUTE_DIRECTORY) {
WIN32_FIND_DATA fd;
- TCHAR szPath[MAX_PATH];
+ wchar_t szPath[MAX_PATH];
mir_sntprintf(szPath, L"%s\\*", szFilename);
HANDLE hFind = FindFirstFile(szPath, &fd);
if (hFind != INVALID_HANDLE_VALUE) {
@@ -297,7 +297,7 @@ static LRESULT CALLBACK LogEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
ScreenToClient(hwnd, (LPPOINT)&ptl);
ptrT pszWord(GetRichTextWord(hwnd, &ptl));
if (pszWord && pszWord[0]) {
- TCHAR szMenuText[4096];
+ wchar_t szMenuText[4096];
mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWord);
ModifyMenu(hSubMenu, 5, MF_STRING | MF_BYPOSITION, 5, szMenuText);
SetSearchEngineIcons(hMenu, g_dat.hSearchEngineIconList);
@@ -544,7 +544,7 @@ static void MessageDialogResize(HWND hwndDlg, SrmmWindowData *dat, int w, int h)
static void UpdateReadChars(HWND hwndDlg, SrmmWindowData *dat)
{
if (dat->parent->hwndActive == hwndDlg) {
- TCHAR szText[256];
+ wchar_t szText[256];
int len = GetRichTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE), 1200, FALSE);
StatusBarData sbd;
@@ -754,7 +754,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (newData->szInitialText) {
if (newData->isWchar)
- SetDlgItemText(hwndDlg, IDC_MESSAGE, (TCHAR*)newData->szInitialText);
+ SetDlgItemText(hwndDlg, IDC_MESSAGE, (wchar_t*)newData->szInitialText);
else
SetDlgItemTextA(hwndDlg, IDC_MESSAGE, newData->szInitialText);
}
@@ -795,7 +795,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_LIMITTEXT, nMax, 0);
}
/* get around a lame bug in the Windows template resource code where richedits are limited to 0x7FFF */
- SendDlgItemMessage(hwndDlg, IDC_LOG, EM_LIMITTEXT, sizeof(TCHAR) * 0x7FFFFFFF, 0);
+ SendDlgItemMessage(hwndDlg, IDC_LOG, EM_LIMITTEXT, sizeof(wchar_t) * 0x7FFFFFFF, 0);
SubclassLogEdit(GetDlgItem(hwndDlg, IDC_LOG));
SubclassMessageEdit(GetDlgItem(hwndDlg, IDC_MESSAGE));
dat->infobarData = CreateInfobar(hwndDlg, dat);
@@ -951,10 +951,10 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (!(CallProtoService(dat->szProto, PS_GETCAPS, PFLAGNUM_1, 0)&PF1_FILESEND)) break;
if (dat->wStatus == ID_STATUS_OFFLINE) break;
if (dat->hContact != NULL) {
- TCHAR szFilename[MAX_PATH];
+ wchar_t szFilename[MAX_PATH];
HDROP hDrop = (HDROP)wParam;
int fileCount = DragQueryFile(hDrop, -1, NULL, 0), totalCount = 0, i;
- TCHAR** ppFiles = NULL;
+ wchar_t** ppFiles = NULL;
for (i = 0; i < fileCount; i++) {
DragQueryFile(hDrop, i, szFilename, _countof(szFilename));
AddToFileList(&ppFiles, &totalCount, szFilename);
@@ -1088,7 +1088,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
cf2.dwMask = CFM_COLOR | CFM_FACE | CFM_CHARSET | CFM_SIZE | CFM_WEIGHT | CFM_BOLD | CFM_ITALIC;
cf2.crTextColor = colour;
cf2.bCharSet = lf.lfCharSet;
- _tcsncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE);
+ wcsncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE);
cf2.dwEffects = ((lf.lfWeight >= FW_BOLD) ? CFE_BOLD : 0) | (lf.lfItalic ? CFE_ITALIC : 0);
cf2.wWeight = (WORD)lf.lfWeight;
cf2.bPitchAndFamily = lf.lfPitchAndFamily;
@@ -1345,7 +1345,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
case DM_UPDATESTATUSBAR:
if (dat->parent->hwndActive == hwndDlg) {
- TCHAR szText[256];
+ wchar_t szText[256];
StatusBarData sbd = { 0 };
sbd.iFlags = SBDF_TEXT | SBDF_ICON;
if (dat->messagesInProgress && (g_dat.flags & SMF_SHOWPROGRESS)) {
@@ -1360,7 +1360,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
dat->nTypeSecs--;
}
else if (dat->lastMessage) {
- TCHAR date[64], time[64];
+ wchar_t date[64], time[64];
TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"d", date, _countof(date), 0);
TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"t", time, _countof(time), 0);
mir_sntprintf(szText, TranslateT("Last message received on %s at %s."), date, time);
@@ -1576,7 +1576,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_GETPARAFORMAT, 0, (LPARAM)&pf2);
int bufSize = GetRichTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE), 1200, TRUE) + 2;
- ptrT ptszUnicode((TCHAR*)mir_alloc(bufSize * sizeof(TCHAR)));
+ ptrT ptszUnicode((wchar_t*)mir_alloc(bufSize * sizeof(wchar_t)));
MessageSendQueueItem msi = { 0 };
if (pf2.wEffects & PFE_RTLPARA)
@@ -1650,14 +1650,14 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
st.flags = ST_SELECTION;
st.codepage = 1200;
- TCHAR *buffer = NULL;
+ wchar_t *buffer = NULL;
if (dat->hwndLog != NULL)
buffer = GetIEViewSelection(dat);
else
buffer = GetRichEditSelection(GetDlgItem(hwndDlg, IDC_LOG));
if (buffer != NULL) {
- TCHAR *quotedBuffer = GetQuotedTextW(buffer);
+ wchar_t *quotedBuffer = GetQuotedTextW(buffer);
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)quotedBuffer);
mir_free(quotedBuffer);
mir_free(buffer);
@@ -1672,7 +1672,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (DbEventIsMessageOrCustom(&dbei)) {
buffer = DbGetEventTextT(&dbei, CP_ACP);
if (buffer != NULL) {
- TCHAR *quotedBuffer = GetQuotedTextW(buffer);
+ wchar_t *quotedBuffer = GetQuotedTextW(buffer);
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)quotedBuffer);
mir_free(quotedBuffer);
mir_free(buffer);
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp
index 43a81f12b8..fc1bdea405 100644
--- a/plugins/Scriver/src/msglog.cpp
+++ b/plugins/Scriver/src/msglog.cpp
@@ -51,17 +51,17 @@ struct EventData
COLORREF color;
union {
char *pszNick; // Nick, usage depends on type of event
- TCHAR *pszNickT;
+ wchar_t *pszNickT;
wchar_t *pszNickW; // Nick - Unicode
};
union {
char *pszText; // Text, usage depends on type of event
- TCHAR *pszTextT;
+ wchar_t *pszTextT;
wchar_t *pszTextW; // Text - Unicode
};
union {
char *pszText2; // Text, usage depends on type of event
- TCHAR *pszText2T;
+ wchar_t *pszText2T;
wchar_t *pszText2W; // Text - Unicode
};
DWORD time;
@@ -346,11 +346,11 @@ static char* SetToStyle(int style)
}
// mode: 0 - date & time, 1 - date, 2 - time
-TCHAR* TimestampToString(DWORD dwFlags, time_t check, int mode)
+wchar_t* TimestampToString(DWORD dwFlags, time_t check, int mode)
{
- static TCHAR szResult[512];
- TCHAR str[80];
- TCHAR format[20];
+ static wchar_t szResult[512];
+ wchar_t str[80];
+ wchar_t format[20];
szResult[0] = '\0';
format[0] = '\0';
@@ -574,7 +574,7 @@ static char* CreateRTFFromEvent(SrmmWindowData *dat, EventData *evt, GlobalMessa
if (gdat->flags & SMF_SHOWTIME && (evt->eventType != EVENTTYPE_MESSAGE ||
(gdat->flags & SMF_MARKFOLLOWUPS || isGroupBreak || !(gdat->flags & SMF_GROUPMESSAGES)))) {
- TCHAR *timestampString = NULL;
+ wchar_t *timestampString = NULL;
if (gdat->flags & SMF_GROUPMESSAGES && evt->eventType == EVENTTYPE_MESSAGE) {
if (isGroupBreak) {
if (!(gdat->flags & SMF_MARKFOLLOWUPS))
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp
index 41e9ebd30b..85f3f26fcc 100644
--- a/plugins/Scriver/src/msgoptions.cpp
+++ b/plugins/Scriver/src/msgoptions.cpp
@@ -51,48 +51,48 @@ static const TabDef tabPages[] = {
typedef struct FontOptionsListStruct
{
- const TCHAR *szDescr;
+ const wchar_t *szDescr;
COLORREF defColour;
- const TCHAR *szDefFace;
+ const wchar_t *szDefFace;
BYTE defStyle;
char defSize;
- const TCHAR *szBkgName;
+ const wchar_t *szBkgName;
} FontOptionsList;
static const FontOptionsList fontOptionsList[] = {
- { LPGENT("Outgoing messages"), RGB(106, 106, 106), L"Arial", 0, -12, LPGENT("Outgoing background")},
- { LPGENT("Incoming messages"), RGB(0, 0, 0), L"Arial", 0, -12, LPGENT("Incoming background")},
- { LPGENT("Outgoing name"), RGB(89, 89, 89), L"Arial", FONTF_BOLD, -12, LPGENT("Outgoing background")},
- { LPGENT("Outgoing time"), RGB(0, 0, 0), L"Terminal", FONTF_BOLD, -9, LPGENT("Outgoing background")},
- { LPGENT("Outgoing colon"), RGB(89, 89, 89), L"Arial", 0, -11, LPGENT("Outgoing background")},
- { LPGENT("Incoming name"), RGB(215, 0, 0), L"Arial", FONTF_BOLD, -12, LPGENT("Incoming background")},
- { LPGENT("Incoming time"), RGB(0, 0, 0), L"Terminal", FONTF_BOLD, -9, LPGENT("Incoming background")},
- { LPGENT("Incoming colon"), RGB(215, 0, 0), L"Arial", 0, -11, LPGENT("Incoming background")},
- { LPGENT("Message area"), RGB(0, 0, 0), L"Arial", 0, -12, LPGENT("Input area background")},
- { LPGENT("Notices"), RGB(90, 90, 160), L"Arial", 0, -12, LPGENT("Incoming background")},
- { LPGENT("Outgoing URL"), RGB(0, 0, 255), L"Arial", 0, -12, LPGENT("Outgoing background")},
- { LPGENT("Incoming URL"), RGB(0, 0, 255), L"Arial", 0, -12, LPGENT("Incoming background")},
- { LPGENT("Info bar contact name"), RGB(0, 0, 0), L"Arial", FONTF_BOLD, -19, LPGENT("Info bar background")},
- { LPGENT("Info bar status message"), RGB(50, 50, 50), L"Arial", FONTF_ITALIC, -11, LPGENT("Info bar background")}
+ { LPGENW("Outgoing messages"), RGB(106, 106, 106), L"Arial", 0, -12, LPGENW("Outgoing background")},
+ { LPGENW("Incoming messages"), RGB(0, 0, 0), L"Arial", 0, -12, LPGENW("Incoming background")},
+ { LPGENW("Outgoing name"), RGB(89, 89, 89), L"Arial", FONTF_BOLD, -12, LPGENW("Outgoing background")},
+ { LPGENW("Outgoing time"), RGB(0, 0, 0), L"Terminal", FONTF_BOLD, -9, LPGENW("Outgoing background")},
+ { LPGENW("Outgoing colon"), RGB(89, 89, 89), L"Arial", 0, -11, LPGENW("Outgoing background")},
+ { LPGENW("Incoming name"), RGB(215, 0, 0), L"Arial", FONTF_BOLD, -12, LPGENW("Incoming background")},
+ { LPGENW("Incoming time"), RGB(0, 0, 0), L"Terminal", FONTF_BOLD, -9, LPGENW("Incoming background")},
+ { LPGENW("Incoming colon"), RGB(215, 0, 0), L"Arial", 0, -11, LPGENW("Incoming background")},
+ { LPGENW("Message area"), RGB(0, 0, 0), L"Arial", 0, -12, LPGENW("Input area background")},
+ { LPGENW("Notices"), RGB(90, 90, 160), L"Arial", 0, -12, LPGENW("Incoming background")},
+ { LPGENW("Outgoing URL"), RGB(0, 0, 255), L"Arial", 0, -12, LPGENW("Outgoing background")},
+ { LPGENW("Incoming URL"), RGB(0, 0, 255), L"Arial", 0, -12, LPGENW("Incoming background")},
+ { LPGENW("Info bar contact name"), RGB(0, 0, 0), L"Arial", FONTF_BOLD, -19, LPGENW("Info bar background")},
+ { LPGENW("Info bar status message"), RGB(50, 50, 50), L"Arial", FONTF_ITALIC, -11, LPGENW("Info bar background")}
};
int fontOptionsListSize = _countof(fontOptionsList);
struct ColourOptionsList
{
- const TCHAR *szName;
+ const wchar_t *szName;
const char *szSettingName;
COLORREF defColour;
int systemColor;
}
static const colourOptionsList[] = {
- { LPGENT("Background"), SRMSGSET_BKGCOLOUR, 0, COLOR_WINDOW},
- { LPGENT("Input area background"), SRMSGSET_INPUTBKGCOLOUR, 0, COLOR_WINDOW},
- { LPGENT("Incoming background"), SRMSGSET_INCOMINGBKGCOLOUR, 0, COLOR_WINDOW},
- { LPGENT("Outgoing background"), SRMSGSET_OUTGOINGBKGCOLOUR, 0, COLOR_WINDOW},
- { LPGENT("Info bar background"), SRMSGSET_INFOBARBKGCOLOUR, 0, COLOR_3DLIGHT},
- { LPGENT("Line between messages"), SRMSGSET_LINECOLOUR, 0, COLOR_3DLIGHT},
+ { LPGENW("Background"), SRMSGSET_BKGCOLOUR, 0, COLOR_WINDOW},
+ { LPGENW("Input area background"), SRMSGSET_INPUTBKGCOLOUR, 0, COLOR_WINDOW},
+ { LPGENW("Incoming background"), SRMSGSET_INCOMINGBKGCOLOUR, 0, COLOR_WINDOW},
+ { LPGENW("Outgoing background"), SRMSGSET_OUTGOINGBKGCOLOUR, 0, COLOR_WINDOW},
+ { LPGENW("Info bar background"), SRMSGSET_INFOBARBKGCOLOUR, 0, COLOR_3DLIGHT},
+ { LPGENW("Line between messages"), SRMSGSET_LINECOLOUR, 0, COLOR_3DLIGHT},
};
int FontServiceFontsChanged(WPARAM, LPARAM)
@@ -106,8 +106,8 @@ int FontServiceFontsChanged(WPARAM, LPARAM)
void RegisterFontServiceFonts()
{
FontIDT fid = { sizeof(fid) };
- _tcsncpy_s(fid.group, LPGENT("Messaging"), _TRUNCATE);
- _tcsncpy_s(fid.backgroundGroup, LPGENT("Messaging"), _TRUNCATE);
+ wcsncpy_s(fid.group, LPGENW("Messaging"), _TRUNCATE);
+ wcsncpy_s(fid.backgroundGroup, LPGENW("Messaging"), _TRUNCATE);
strncpy(fid.dbSettingsGroup, SRMMMOD, _countof(fid.dbSettingsGroup));
fid.flags = FIDF_DEFAULTVALID | FIDF_DEFAULTVALID;
for (int i = 0; i < _countof(fontOptionsList); i++) {
@@ -116,23 +116,23 @@ void RegisterFontServiceFonts()
char szTemp[100];
mir_snprintf(szTemp, "SRMFont%d", i);
strncpy(fid.prefix, szTemp, _countof(fid.prefix));
- _tcsncpy(fid.name, fontOptionsList[i].szDescr, _countof(fid.name));
+ wcsncpy(fid.name, fontOptionsList[i].szDescr, _countof(fid.name));
fid.deffontsettings.colour = fontOptionsList[i].defColour;
fid.deffontsettings.size = fontOptionsList[i].defSize;
fid.deffontsettings.style = fontOptionsList[i].defStyle;
fid.deffontsettings.charset = DEFAULT_CHARSET;
- _tcsncpy(fid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _countof(fid.deffontsettings.szFace));
- _tcsncpy(fid.backgroundName, fontOptionsList[i].szBkgName, _countof(fid.backgroundName));
+ wcsncpy(fid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _countof(fid.deffontsettings.szFace));
+ wcsncpy(fid.backgroundName, fontOptionsList[i].szBkgName, _countof(fid.backgroundName));
FontRegisterT(&fid);
}
ColourIDT cid = { sizeof(cid) };
- _tcsncpy_s(cid.group, LPGENT("Messaging"), _TRUNCATE);
+ wcsncpy_s(cid.group, LPGENW("Messaging"), _TRUNCATE);
strncpy(cid.dbSettingsGroup, SRMMMOD, _countof(fid.dbSettingsGroup));
cid.flags = 0;
for (int i = 0; i < _countof(colourOptionsList); i++) {
cid.order = i;
- _tcsncpy(cid.name, colourOptionsList[i].szName, _countof(cid.name));
+ wcsncpy(cid.name, colourOptionsList[i].szName, _countof(cid.name));
if (colourOptionsList[i].systemColor != -1)
cid.defcolour = GetSysColor(colourOptionsList[i].systemColor);
else
@@ -192,7 +192,7 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour)
if (tszFace == NULL)
mir_tstrcpy(lf->lfFaceName, fontOptionsList[i].szDefFace);
else
- _tcsncpy(lf->lfFaceName, tszFace, _countof(lf->lfFaceName));
+ wcsncpy(lf->lfFaceName, tszFace, _countof(lf->lfFaceName));
mir_snprintf(str, "%s%dSet", "SRMFont", i);
lf->lfCharSet = db_get_b(NULL, SRMMMOD, str, DEFAULT_CHARSET);
@@ -202,21 +202,21 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour)
struct CheckBoxValues_t
{
DWORD style;
- const TCHAR *szDescr;
+ const wchar_t *szDescr;
};
static const struct CheckBoxValues_t statusValues[] =
{
- { MODEF_OFFLINE, LPGENT("Offline") },
- { PF2_ONLINE, LPGENT("Online") },
- { PF2_SHORTAWAY, LPGENT("Away") },
- { PF2_LONGAWAY, LPGENT("Not available") },
- { PF2_LIGHTDND, LPGENT("Occupied") },
- { PF2_HEAVYDND, LPGENT("Do not disturb") },
- { PF2_FREECHAT, LPGENT("Free for chat") },
- { PF2_INVISIBLE, LPGENT("Invisible") },
- { PF2_OUTTOLUNCH, LPGENT("Out to lunch") },
- { PF2_ONTHEPHONE, LPGENT("On the phone") }
+ { MODEF_OFFLINE, LPGENW("Offline") },
+ { PF2_ONLINE, LPGENW("Online") },
+ { PF2_SHORTAWAY, LPGENW("Away") },
+ { PF2_LONGAWAY, LPGENW("Not available") },
+ { PF2_LIGHTDND, LPGENW("Occupied") },
+ { PF2_HEAVYDND, LPGENW("Do not disturb") },
+ { PF2_FREECHAT, LPGENW("Free for chat") },
+ { PF2_INVISIBLE, LPGENW("Invisible") },
+ { PF2_OUTTOLUNCH, LPGENW("Out to lunch") },
+ { PF2_ONTHEPHONE, LPGENW("On the phone") }
};
static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *values, int nValues, DWORD style)
@@ -862,9 +862,9 @@ static INT_PTR CALLBACK DlgProcTypeOptions(HWND hwndDlg, UINT msg, WPARAM wParam
{
CLCINFOITEM cii = { sizeof(cii) };
cii.flags = CLCIIF_GROUPFONT | CLCIIF_CHECKBOX;
- cii.pszText = (TCHAR*)TranslateT("** New contacts **");
+ cii.pszText = (wchar_t*)TranslateT("** New contacts **");
hItemNew = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
- cii.pszText = (TCHAR*)TranslateT("** Unknown contacts **");
+ cii.pszText = (wchar_t*)TranslateT("** Unknown contacts **");
hItemUnknown = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
}
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST), GWL_STYLE) | CLS_SHOWHIDDEN | CLS_NOHIDEOFFLINE);
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp
index d397964eae..41c9fc09e9 100644
--- a/plugins/Scriver/src/msgs.cpp
+++ b/plugins/Scriver/src/msgs.cpp
@@ -120,7 +120,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam)
}
}
if (hwnd == NULL || !IsWindowVisible(GetParent(hwnd))) {
- TCHAR toolTip[256];
+ wchar_t toolTip[256];
mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
CLISTEVENT cle = {};
@@ -205,7 +205,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam)
if (hwnd)
SendMessage(hwnd, DM_TYPING, 0, lParam);
else if (lParam && (g_dat.flags2 & SMF2_SHOWTYPINGTRAY)) {
- TCHAR szTip[256];
+ wchar_t szTip[256];
mir_sntprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0));
if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && !(g_dat.flags2 & SMF2_SHOWTYPINGCLIST)) {
@@ -292,7 +292,7 @@ static void RestoreUnreadMessageAlerts(void)
}
}
- TCHAR toolTip[256];
+ wchar_t toolTip[256];
CLISTEVENT cle = {};
cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
@@ -523,8 +523,7 @@ int OnLoadModule(void)
hMsftEdit = LoadLibrary(L"Msftedit.dll");
if (hMsftEdit == NULL) {
if (IDYES != MessageBox(0,
- TranslateT
- ("Miranda could not load the built-in message module, Msftedit.dll is missing. If you are using WINE, please make sure you have Msftedit.dll installed. Press 'Yes' to continue loading Miranda."),
+ TranslateT("Miranda could not load the built-in message module, Msftedit.dll is missing. If you are using WINE, please make sure you have Msftedit.dll installed. Press 'Yes' to continue loading Miranda."),
TranslateT("Information"), MB_YESNO | MB_ICONINFORMATION))
return 1;
return 0;
@@ -647,7 +646,7 @@ STDMETHODIMP CREOleCallback::GetInPlaceContext(LPOLEINPLACEFRAME*, LPOLEINPLACEU
STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE *lplpstg)
{
- TCHAR sztName[64];
+ wchar_t sztName[64];
mir_sntprintf(sztName, L"s%u", nextStgId++);
if (pictStg == NULL)
return STG_E_MEDIUMFULL;
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h
index e4a8a19660..a4e6d42553 100644
--- a/plugins/Scriver/src/msgs.h
+++ b/plugins/Scriver/src/msgs.h
@@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct ToolbarButton
{
- TCHAR *name;
+ wchar_t *name;
UINT controlId;
int alignment;
int spacing;
@@ -38,9 +38,9 @@ struct ToolbarButton
struct ErrorWindowData
{
- TCHAR *szName;
- TCHAR *szDescription;
- TCHAR *szText;
+ wchar_t *szName;
+ wchar_t *szDescription;
+ wchar_t *szText;
MessageSendQueueItem *queueItem;
HWND hwndParent;
};
diff --git a/plugins/Scriver/src/msgtimedout.cpp b/plugins/Scriver/src/msgtimedout.cpp
index e50504a340..1db437ddbf 100644
--- a/plugins/Scriver/src/msgtimedout.cpp
+++ b/plugins/Scriver/src/msgtimedout.cpp
@@ -31,7 +31,7 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
case WM_INITDIALOG:
{
RECT rc, rcParent;
- TCHAR szText[2048];
+ wchar_t szText[2048];
ewd = (ErrorWindowData *) lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) ewd);
TranslateDialogDefault(hwndDlg);
@@ -52,7 +52,7 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
if (ewd->szName)
mir_sntprintf(szText, L"%s - %s", TranslateT("Send error"), ewd->szName);
else
- _tcsncpy_s(szText, TranslateT("Send error"), _TRUNCATE);
+ wcsncpy_s(szText, TranslateT("Send error"), _TRUNCATE);
SetWindowText(hwndDlg, szText);
GetWindowRect(hwndDlg, &rc);
diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp
index 53348f2bdb..3bf73b1fb3 100644
--- a/plugins/Scriver/src/msgwindow.cpp
+++ b/plugins/Scriver/src/msgwindow.cpp
@@ -33,12 +33,12 @@ static void DrawTab(ParentWindowData *dat, HWND hwnd, WPARAM wParam, LPARAM lPar
/////////////////////////////////////////////////////////////////////////////////////////
-static const TCHAR *titleTokenNames[] = { L"%name%", L"%status%", L"%statusmsg%", L"%account%" };
+static const wchar_t *titleTokenNames[] = { L"%name%", L"%status%", L"%statusmsg%", L"%account%" };
-TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto)
+wchar_t* GetWindowTitle(MCONTACT hContact, const char *szProto)
{
ptrT tmplt;
- const TCHAR* tokens[4] = { 0 };
+ const wchar_t* tokens[4] = { 0 };
CMString tszTemplate, tszStatus, tszTitle;
if (hContact && szProto) {
@@ -67,12 +67,12 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto)
}
}
- for (const TCHAR *p = tszTemplate; *p; p++) {
+ for (const wchar_t *p = tszTemplate; *p; p++) {
if (*p == '%') {
int i;
for (i = 0; i < _countof(titleTokenNames); i++) {
size_t tnlen = mir_tstrlen(titleTokenNames[i]);
- if (!_tcsncmp(p, titleTokenNames[i], tnlen)) {
+ if (!wcsncmp(p, titleTokenNames[i], tnlen)) {
if (tokens[i] != NULL)
tszTitle.Append(tokens[i]);
@@ -461,7 +461,7 @@ LRESULT CALLBACK TabCtrlProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
dat->destTab = TabCtrl_HitTest(hwnd, &thinfo);
if (thinfo.flags != TCHT_NOWHERE && dat->destTab != dat->srcTab) {
NMHDR nmh;
- TCHAR sBuffer[501];
+ wchar_t sBuffer[501];
TCITEM item;
int curSel;
curSel = TabCtrl_GetCurSel(hwnd);
@@ -1207,7 +1207,7 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
TitleBarData *tbd = (TitleBarData *)wParam;
if (tbd != NULL && dat->hwndActive == hwnd) {
if (tbd->iFlags & TBDF_TEXT) {
- TCHAR oldtitle[256];
+ wchar_t oldtitle[256];
GetWindowText(hwndDlg, oldtitle, _countof(oldtitle));
if (mir_tstrcmp(tbd->pszText, oldtitle))
SetWindowText(hwndDlg, tbd->pszText);
@@ -1248,7 +1248,7 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
TabControlData *tcd = (TabControlData*)wParam;
int tabId = GetTabFromHWND(dat, (HWND)lParam);
if (tabId >= 0 && tcd != NULL) {
- TCHAR *ptszTemp = NULL;
+ wchar_t *ptszTemp = NULL;
TCITEM tci;
tci.mask = 0;
@@ -1256,7 +1256,7 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
tci.mask |= TCIF_TEXT;
tci.pszText = tcd->pszText;
if (g_dat.flags2 & SMF2_LIMITNAMES) {
- TCHAR *ltext = limitText(tcd->pszText, g_dat.limitNamesLength);
+ wchar_t *ltext = limitText(tcd->pszText, g_dat.limitNamesLength);
if (ltext != tcd->pszText)
tci.pszText = ptszTemp = ltext;
}
@@ -1345,7 +1345,7 @@ static void DrawTab(ParentWindowData *dat, HWND hwnd, WPARAM, LPARAM lParam)
TabCtrlData *tcdat = (TabCtrlData*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
HANDLE hTheme = NULL;
int tstate = 0;
- TCHAR szLabel[1024];
+ wchar_t szLabel[1024];
TCITEM tci;
tci.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_STATE;
tci.pszText = szLabel;
diff --git a/plugins/Scriver/src/msgwindow.h b/plugins/Scriver/src/msgwindow.h
index d3e8092b8b..df0c822d16 100644
--- a/plugins/Scriver/src/msgwindow.h
+++ b/plugins/Scriver/src/msgwindow.h
@@ -60,7 +60,7 @@ struct StatusBarData
{
int iItem;
int iFlags;
- TCHAR *pszText;
+ wchar_t *pszText;
HICON hIcon;
};
@@ -70,7 +70,7 @@ struct StatusBarData
struct TitleBarData
{
int iFlags;
- TCHAR *pszText;
+ wchar_t *pszText;
HICON hIcon;
HICON hIconBig;
HICON hIconNot;
@@ -82,11 +82,11 @@ struct TitleBarData
struct TabControlData
{
int iFlags;
- TCHAR *pszText;
+ wchar_t *pszText;
HICON hIcon;
};
-TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto);
+wchar_t* GetWindowTitle(MCONTACT hContact, const char *szProto);
HWND GetParentWindow(MCONTACT hContact, BOOL bChat);
void NotifyLocalWinEvent(MCONTACT hContact, HWND hwnd, unsigned int type);
diff --git a/plugins/Scriver/src/sendqueue.cpp b/plugins/Scriver/src/sendqueue.cpp
index 908056ee08..770d00dc9c 100644
--- a/plugins/Scriver/src/sendqueue.cpp
+++ b/plugins/Scriver/src/sendqueue.cpp
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static MessageSendQueueItem *global_sendQueue = NULL;
static mir_cs queueMutex;
-TCHAR* GetSendBufferMsg(MessageSendQueueItem *item)
+wchar_t* GetSendBufferMsg(MessageSendQueueItem *item)
{
return mir_utf8decodeW(item->sendBuffer);
}
diff --git a/plugins/Scriver/src/sendqueue.h b/plugins/Scriver/src/sendqueue.h
index 8445a2dbac..470e3d5553 100644
--- a/plugins/Scriver/src/sendqueue.h
+++ b/plugins/Scriver/src/sendqueue.h
@@ -41,7 +41,7 @@ struct MessageSendQueueItem
};
MessageSendQueueItem* CreateSendQueueItem(HWND hwndSender);
-TCHAR * GetSendBufferMsg(MessageSendQueueItem *item);
+wchar_t * GetSendBufferMsg(MessageSendQueueItem *item);
MessageSendQueueItem* FindOldestPendingSendQueueItem(HWND hwndSender, MCONTACT hContact);
MessageSendQueueItem* FindSendQueueItem(MCONTACT hContact, HANDLE hSendId);
BOOL RemoveSendQueueItem(MessageSendQueueItem* item);
diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp
index 43461d070b..8e771e2485 100644
--- a/plugins/Scriver/src/utils.cpp
+++ b/plugins/Scriver/src/utils.cpp
@@ -81,7 +81,7 @@ char* GetRichTextUtf(HWND hwnd)
return textBuffer;
}
-int SetRichText(HWND hwnd, const TCHAR *text)
+int SetRichText(HWND hwnd, const wchar_t *text)
{
SETTEXTEX st;
st.flags = ST_DEFAULT;
@@ -140,32 +140,32 @@ char* GetRichTextRTF(HWND hwnd)
return pszText; // pszText contains the text
}
-void rtrimText(TCHAR *text)
+void rtrimText(wchar_t *text)
{
- static TCHAR szTrimString[] = L":;,.!?\'\"><()[]- \r\n";
+ static wchar_t szTrimString[] = L":;,.!?\'\"><()[]- \r\n";
size_t iLen = mir_tstrlen(text) - 1;
- while (_tcschr(szTrimString, text[iLen])) {
- text[iLen] = _T('\0');
+ while (wcschr(szTrimString, text[iLen])) {
+ text[iLen] = '\0';
iLen--;
}
}
-TCHAR* limitText(TCHAR *text, int limit)
+wchar_t* limitText(wchar_t *text, int limit)
{
size_t len = mir_tstrlen(text);
if (len > g_dat.limitNamesLength) {
- TCHAR *ptszTemp = (TCHAR*)mir_alloc(sizeof(TCHAR) * (limit + 4));
- _tcsncpy(ptszTemp, text, limit + 1);
- _tcsncpy(ptszTemp + limit, L"...", 4);
+ wchar_t *ptszTemp = (wchar_t*)mir_alloc(sizeof(wchar_t) * (limit + 4));
+ wcsncpy(ptszTemp, text, limit + 1);
+ wcsncpy(ptszTemp + limit, L"...", 4);
return ptszTemp;
}
return text;
}
-TCHAR* GetRichTextWord(HWND hwnd, POINTL *ptl)
+wchar_t* GetRichTextWord(HWND hwnd, POINTL *ptl)
{
long iCharIndex, start, end, iRes;
- TCHAR *pszWord = GetRichEditSelection(hwnd);
+ wchar_t *pszWord = GetRichEditSelection(hwnd);
if (pszWord == NULL) {
iCharIndex = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM)ptl);
if (iCharIndex >= 0) {
@@ -175,7 +175,7 @@ TCHAR* GetRichTextWord(HWND hwnd, POINTL *ptl)
TEXTRANGE tr;
CHARRANGE cr;
memset(&tr, 0, sizeof(TEXTRANGE));
- pszWord = (TCHAR*)mir_alloc(sizeof(TCHAR) * (end - start + 1));
+ pszWord = (wchar_t*)mir_alloc(sizeof(wchar_t) * (end - start + 1));
cr.cpMin = start;
cr.cpMax = end;
tr.chrg = cr;
@@ -200,12 +200,12 @@ static DWORD CALLBACK StreamOutCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG
msi->sendBuffer = (char*)mir_realloc(msi->sendBuffer, msi->sendBufferSize + cb + 2);
memcpy(msi->sendBuffer + msi->sendBufferSize, pbBuff, cb);
msi->sendBufferSize += cb;
- *((TCHAR*)(msi->sendBuffer + msi->sendBufferSize)) = '\0';
+ *((wchar_t*)(msi->sendBuffer + msi->sendBufferSize)) = '\0';
*pcb = cb;
return 0;
}
-TCHAR *GetRichEditSelection(HWND hwnd)
+wchar_t *GetRichEditSelection(HWND hwnd)
{
CHARRANGE sel;
SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&sel);
@@ -221,7 +221,7 @@ TCHAR *GetRichEditSelection(HWND hwnd)
stream.pfnCallback = StreamOutCallback;
stream.dwCookie = (DWORD_PTR)&msi;
SendMessage(hwnd, EM_STREAMOUT, SF_TEXT | SF_UNICODE | SFF_SELECTION, (LPARAM)&stream);
- return (TCHAR*)msi.sendBuffer;
+ return (wchar_t*)msi.sendBuffer;
}
void AppendToBuffer(char *&buffer, size_t &cbBufferEnd, size_t &cbBufferAlloced, const char *fmt, ...)
@@ -245,9 +245,9 @@ void AppendToBuffer(char *&buffer, size_t &cbBufferEnd, size_t &cbBufferAlloced,
int MeasureMenuItem(WPARAM, LPARAM lParam)
{
LPMEASUREITEMSTRUCT mis = (LPMEASUREITEMSTRUCT)lParam;
- if (mis->itemData != (ULONG_PTR)g_dat.hButtonIconList && mis->itemData != (ULONG_PTR)g_dat.hSearchEngineIconList && mis->itemData != (ULONG_PTR)g_dat.hChatButtonIconList) {
+ if (mis->itemData != (ULONG_PTR)g_dat.hButtonIconList && mis->itemData != (ULONG_PTR)g_dat.hSearchEngineIconList && mis->itemData != (ULONG_PTR)g_dat.hChatButtonIconList)
return FALSE;
- }
+
mis->itemWidth = max(0, GetSystemMetrics(SM_CXSMICON) - GetSystemMetrics(SM_CXMENUCHECK) + 4);
mis->itemHeight = GetSystemMetrics(SM_CYSMICON) + 2;
return TRUE;
@@ -335,7 +335,7 @@ char *url_encode(char *str)
return buf;
}
-void SearchWord(TCHAR *word, int engine)
+void SearchWord(wchar_t *word, int engine)
{
char szURL[4096];
if (word && word[0]) {
diff --git a/plugins/Scriver/src/utils.h b/plugins/Scriver/src/utils.h
index 89ee584390..de18f2d2b5 100644
--- a/plugins/Scriver/src/utils.h
+++ b/plugins/Scriver/src/utils.h
@@ -34,16 +34,16 @@ enum SEARCHENGINES {
SEARCHENGINE_FOODNETWORK = 8
};
-TCHAR *limitText(TCHAR *text, int limit);
+wchar_t *limitText(wchar_t *text, int limit);
void logInfo(const char *fmt, ...);
int GetRichTextLength(HWND hwnd, int codepage, BOOL inBytes);
-TCHAR *GetRichEditSelection(HWND hwnd);
+wchar_t *GetRichEditSelection(HWND hwnd);
char* GetRichTextRTF(HWND hwnd);
char* GetRichTextUtf(HWND hwnd);
-TCHAR *GetRichTextWord(HWND hwnd, POINTL *pt);
-int SetRichText(HWND hwnd, const TCHAR *text);
+wchar_t *GetRichTextWord(HWND hwnd, POINTL *pt);
+int SetRichText(HWND hwnd, const wchar_t *text);
int SetRichTextRTF(HWND hwnd, const char *text);
-void SearchWord(TCHAR * word, int engine);
+void SearchWord(wchar_t * word, int engine);
HDWP ResizeToolbar(HWND hwnd, HDWP hdwp, int width, int vPos, int height, int cControls, const ToolbarButton * buttons, int controlVisibility);
void ShowToolbarControls(HWND hwndDlg, int cControls, const ToolbarButton * buttons, int controlVisibility, int state);
void AppendToBuffer(char *&buffer, size_t &cbBufferEnd, size_t &cbBufferAlloced, const char *fmt, ...);
diff --git a/plugins/SecureIM/src/loadicons.cpp b/plugins/SecureIM/src/loadicons.cpp
index a36986d8d9..ceb5a545cd 100644
--- a/plugins/SecureIM/src/loadicons.cpp
+++ b/plugins/SecureIM/src/loadicons.cpp
@@ -76,8 +76,8 @@ void InitIcons(void)
HINSTANCE hNewIconInst = NULL;
if (g_hFolders) {
- TCHAR pathname[MAX_PATH];
- FoldersGetCustomPathExT(g_hFolders, pathname, MAX_PATH, "icons\\");
+ char pathname[MAX_PATH];
+ FoldersGetCustomPath(g_hFolders, pathname, MAX_PATH, "icons\\");
if (hNewIconInst == NULL)
hNewIconInst = LoadIconsPack(pathname);
}
@@ -93,12 +93,12 @@ void InitIcons(void)
else
g_hIconInst = hNewIconInst;
- TCHAR tszPath[MAX_PATH];
+ char tszPath[MAX_PATH];
GetModuleFileName(g_hIconInst, tszPath, _countof(tszPath));
SKINICONDESC sid = { 0 };
sid.section.a = "SecureIM";
- sid.defaultFile.t = tszPath;
+ sid.defaultFile.a = tszPath;
for (int i = 0; i < _countof(icons); i++) {
sid.section.a = icons[i].section;
diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp
index 5a02a2cf66..91443d4d5c 100644
--- a/plugins/SecureIM/src/main.cpp
+++ b/plugins/SecureIM/src/main.cpp
@@ -43,7 +43,7 @@ static HGENMENU MyAddMenuItem(LPCWSTR name, int pos, LPCSTR szUid, HICON hicon,
mi.flags = flags | CMIF_HIDDEN | CMIF_UNICODE;
mi.position = pos;
mi.hIcolibItem = hicon;
- mi.name.t = (TCHAR*)name;
+ mi.name.w = (wchar_t*)name;
mi.pszService = (char*)service;
HGENMENU res = Menu_AddContactMenuItem(&mi);
Menu_ConfigureItem(res, MCI_OPT_UID, szUid);
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp
index 6c05088389..0adf09a814 100644
--- a/plugins/SecureIM/src/options.cpp
+++ b/plugins/SecureIM/src/options.cpp
@@ -1573,7 +1573,7 @@ BOOL ShowSelectKeyDlg(HWND hParent, LPSTR KeyPath)
char temp[MAX_PATH];
mir_snprintf(temp, "%s (*.asc)%c*.asc%c%s (*.*)%c*.*%c%c", Translate("ASC files"), 0, 0, Translate("All files"), 0, 0, 0);
ofn.lpstrFilter = temp;
- ofn.lpstrTitle = TranslateT("Open Key File");
+ ofn.lpstrTitle = Translate("Open Key File");
if (!GetOpenFileName(&ofn)) return FALSE;
return TRUE;
@@ -1622,7 +1622,7 @@ LPSTR LoadKeys(LPCSTR file, BOOL priv)
BOOL SaveExportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv)
{
- TCHAR szFile[MAX_PATH] = "rsa_pub.asc";
+ char szFile[MAX_PATH] = "rsa_pub.asc";
if (priv)
mir_tstrcpy(szFile, "rsa_priv.asc");
@@ -1635,11 +1635,11 @@ BOOL SaveExportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv)
ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_NONETWORKBUTTON;
ofn.lpstrFile = szFile;
- ofn.lpstrTitle = (priv) ? TranslateT("Save Private Key File") : TranslateT("Save Public Key File");
+ ofn.lpstrTitle = (priv) ? Translate("Save Private Key File") : Translate("Save Public Key File");
if (!GetSaveFileName(&ofn))
return FALSE;
- FILE *f = _tfopen(szFile, "wb");
+ FILE *f = fopen(szFile, "wb");
if (!f)
return FALSE;
fwrite(key, mir_strlen(key), 1, f);
@@ -1650,7 +1650,7 @@ BOOL SaveExportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv)
BOOL LoadImportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv)
{
- TCHAR szFile[MAX_PATH] = "rsa_pub.asc";
+ char szFile[MAX_PATH] = "rsa_pub.asc";
if (priv)
mir_tstrcpy(szFile, "rsa_priv.asc");
@@ -1663,11 +1663,11 @@ BOOL LoadImportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv)
char temp[MAX_PATH];
mir_snprintf(temp, "%s (*.asc)%c*.asc%c%s (*.*)%c*.*%c%c", Translate("ASC files"), 0, 0, Translate("All files"), 0, 0, 0);
ofn.lpstrFilter = temp;
- ofn.lpstrTitle = (priv) ? TranslateT("Load Private Key File") : TranslateT("Load Public Key File");
+ ofn.lpstrTitle = (priv) ? Translate("Load Private Key File") : Translate("Load Public Key File");
if (!GetOpenFileName(&ofn))
return FALSE;
- FILE *f = _tfopen(szFile, "rb");
+ FILE *f = fopen(szFile, "rb");
if (!f)
return FALSE;
diff --git a/plugins/SeenPlugin/src/file.cpp b/plugins/SeenPlugin/src/file.cpp
index 3417e06dd2..5337d2ecb5 100644
--- a/plugins/SeenPlugin/src/file.cpp
+++ b/plugins/SeenPlugin/src/file.cpp
@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
BOOL g_bFileActive;
-static TCHAR *g_ptszFileStamp, *g_ptszFileName;
+static wchar_t *g_ptszFileStamp, *g_ptszFileName;
/////////////////////////////////////////////////////////////////////////////////////////
// Prepares the log file:
@@ -35,8 +35,8 @@ void InitFileOutput(void)
tszFileName = mir_tstrdup(DEFAULT_FILENAME);
replaceStrT(g_ptszFileName, VARST(tszFileName));
- TCHAR *tszPath = NEWTSTR_ALLOCA(g_ptszFileName);
- TCHAR *p = _tcsrchr(tszPath, '\\');
+ wchar_t *tszPath = NEWWSTR_ALLOCA(g_ptszFileName);
+ wchar_t *p = wcsrchr(tszPath, '\\');
if (p) *p = 0;
CreateDirectoryTreeT(tszPath);
@@ -55,9 +55,9 @@ void UninitFileOutput()
void FileWrite(MCONTACT hcontact)
{
- FILE *log = _tfopen(ParseString(g_ptszFileName, hcontact), L"a");
+ FILE *log = _wfopen(ParseString(g_ptszFileName, hcontact), L"a");
if (log != NULL) {
- _fputts(ParseString(g_ptszFileStamp, hcontact), log);
+ fputws(ParseString(g_ptszFileStamp, hcontact), log);
fputs("\r\n", log);
fclose(log);
}
diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp
index 7d589a95c8..4aa5d23d1b 100644
--- a/plugins/SeenPlugin/src/history.cpp
+++ b/plugins/SeenPlugin/src/history.cpp
@@ -50,7 +50,7 @@ void HistoryWrite(MCONTACT hContact)
if (historyLast >= historyMax)
historyLast = historyMax - 1;
- TCHAR *ptszString;
+ wchar_t *ptszString;
DBVARIANT dbv;
if (!db_get_ts(NULL, S_MOD, "HistoryStamp", &dbv)) {
ptszString = ParseString(dbv.ptszVal, hContact);
@@ -167,7 +167,7 @@ void MyResizeGetOffset(HWND hwndControl, int nWidth, int nHeight, int* nDx, int*
INT_PTR CALLBACK HistoryDlgProc(HWND hwndDlg, UINT Message, WPARAM wparam, LPARAM lparam)
{
MCONTACT hContact;
- TCHAR sztemp[1024];
+ wchar_t sztemp[1024];
switch (Message) {
case WM_INITDIALOG:
@@ -234,7 +234,7 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwndDlg, UINT Message, WPARAM wparam, LPARA
CallService(MS_MSG_SENDMESSAGE, hContact, 0);
break;
case IDC_TEST:
- debug(ParseString(LPGENT("Date: %d.%m.%y(%Y) \n Date desc: %W - %w - %E - %e \n Time: %H:%M:%S (%h-%p) \n user: %n - %u \n Status: %s \n IP: %i - %r"), hContact));
+ debug(ParseString(LPGENW("Date: %d.%m.%y(%Y) \n Date desc: %W - %w - %E - %e \n Time: %H:%M:%S (%h-%p) \n user: %n - %u \n Status: %s \n IP: %i - %r"), hContact));
break;
}
break;
diff --git a/plugins/SeenPlugin/src/main.cpp b/plugins/SeenPlugin/src/main.cpp
index e3d6c714e6..cb98026c61 100644
--- a/plugins/SeenPlugin/src/main.cpp
+++ b/plugins/SeenPlugin/src/main.cpp
@@ -104,10 +104,10 @@ extern "C" __declspec(dllexport) int Load(void)
LoadWatchedProtos();
- SkinAddNewSoundExT("LastSeenTrackedStatusChange", LPGENT("LastSeen"), LPGENT("User status change"));
- SkinAddNewSoundExT("LastSeenTrackedStatusOnline", LPGENT("LastSeen"), LPGENT("Changed to Online"));
- SkinAddNewSoundExT("LastSeenTrackedStatusOffline", LPGENT("LastSeen"), LPGENT("User Logged Off"));
- SkinAddNewSoundExT("LastSeenTrackedStatusFromOffline", LPGENT("LastSeen"), LPGENT("User Logged In"));
+ SkinAddNewSoundExT("LastSeenTrackedStatusChange", LPGENW("LastSeen"), LPGENW("User status change"));
+ SkinAddNewSoundExT("LastSeenTrackedStatusOnline", LPGENW("LastSeen"), LPGENW("Changed to Online"));
+ SkinAddNewSoundExT("LastSeenTrackedStatusOffline", LPGENW("LastSeen"), LPGENW("User Logged Off"));
+ SkinAddNewSoundExT("LastSeenTrackedStatusFromOffline", LPGENW("LastSeen"), LPGENW("User Logged In"));
return 0;
}
diff --git a/plugins/SeenPlugin/src/missed.cpp b/plugins/SeenPlugin/src/missed.cpp
index eeb15431f4..5288c204f5 100644
--- a/plugins/SeenPlugin/src/missed.cpp
+++ b/plugins/SeenPlugin/src/missed.cpp
@@ -105,9 +105,9 @@ int ShowMissed(void)
if (!mcs.count)
return 0;
- TCHAR sztemp[1024], szcount[7];
+ wchar_t sztemp[1024], szcount[7];
for (int loop = 0; loop < mcs.count; loop++) {
- mir_tstrncat(sztemp, (TCHAR*)pcli->pfnGetContactDisplayName(mcs.wpcontact[loop], 0), _countof(sztemp) - mir_tstrlen(sztemp));
+ mir_tstrncat(sztemp, (wchar_t*)pcli->pfnGetContactDisplayName(mcs.wpcontact[loop], 0), _countof(sztemp) - mir_tstrlen(sztemp));
if (db_get_b(NULL, S_MOD, "MissedOnes_Count", 0)) {
mir_sntprintf(szcount, L" [%i]", mcs.times[loop]);
mir_tstrcat(sztemp, szcount);
diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp
index adc23838ba..178eaf301d 100644
--- a/plugins/SeenPlugin/src/options.cpp
+++ b/plugins/SeenPlugin/src/options.cpp
@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
INT_PTR CALLBACK OptsPopupsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
{
DBVARIANT dbv;
- TCHAR szstamp[256];
+ wchar_t szstamp[256];
BOOL hasPopups;
BYTE bchecked;
@@ -91,10 +91,10 @@ INT_PTR CALLBACK OptsPopupsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp
ppd.lchIcon = Skin_LoadProtoIcon(NULL, idBack);
GetDlgItemText(hdlg, IDC_POPUPSTAMP, szstamp, _countof(szstamp));
- _tcsncpy(ppd.lptzContactName, ParseString(szstamp, NULL), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzContactName, ParseString(szstamp, NULL), MAX_CONTACTNAME);
GetDlgItemText(hdlg, IDC_POPUPSTAMPTEXT, szstamp, _countof(szstamp));
- _tcsncpy(ppd.lptzText, ParseString(szstamp, NULL), MAX_SECONDLINE);
+ wcsncpy(ppd.lptzText, ParseString(szstamp, NULL), MAX_SECONDLINE);
PUAddPopupT(&ppd);
SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0);
@@ -164,7 +164,7 @@ INT_PTR CALLBACK OptsPopupsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp
INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
{
DBVARIANT dbv;
- TCHAR szstamp[256];
+ wchar_t szstamp[256];
switch (msg) {
case WM_INITDIALOG:
@@ -434,15 +434,15 @@ int OptionsInit(WPARAM wparam, LPARAM)
odp.hInstance = hInstance;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_SETTINGS);
- odp.ptszGroup = LPGENT("Contacts");
- odp.ptszTitle = LPGENT("Last seen");
+ odp.pwszGroup = LPGENW("Contacts");
+ odp.pwszTitle = LPGENW("Last seen");
odp.pfnDlgProc = OptsSettingsDlgProc;
Options_AddPage(wparam, &odp);
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPS);
- odp.ptszGroup = LPGENT("Popups");
- odp.ptszTitle = LPGENT("Last seen");
+ odp.pwszGroup = LPGENW("Popups");
+ odp.pwszTitle = LPGENW("Last seen");
odp.pfnDlgProc = OptsPopupsDlgProc;
Options_AddPage(wparam, &odp);
}
diff --git a/plugins/SeenPlugin/src/stdafx.h b/plugins/SeenPlugin/src/stdafx.h
index 48999ed4c2..67fb460e2f 100644
--- a/plugins/SeenPlugin/src/stdafx.h
+++ b/plugins/SeenPlugin/src/stdafx.h
@@ -94,7 +94,7 @@ typedef struct{
} MISSEDCONTACTS;
int IsWatchedProtocol(const char* szProto);
-TCHAR *ParseString(TCHAR*, MCONTACT);
+wchar_t *ParseString(wchar_t*, MCONTACT);
void GetColorsFromDWord(LPCOLORREF First, LPCOLORREF Second, DWORD colDword);
DWORD GetDWordFromColors(COLORREF First, COLORREF Second);
int OptionsInit(WPARAM,LPARAM);
diff --git a/plugins/SeenPlugin/src/userinfo.cpp b/plugins/SeenPlugin/src/userinfo.cpp
index 25844a0435..318e336278 100644
--- a/plugins/SeenPlugin/src/userinfo.cpp
+++ b/plugins/SeenPlugin/src/userinfo.cpp
@@ -42,7 +42,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar
case WM_REFRESH_UI:
{
ptrT szout(db_get_tsa(NULL, S_MOD, "UserStamp"));
- TCHAR *str = ParseString((szout != NULL) ? szout : DEFAULT_USERSTAMP, wparam);
+ wchar_t *str = ParseString((szout != NULL) ? szout : DEFAULT_USERSTAMP, wparam);
SetDlgItemText(hdlg, IDC_INFOTEXT, str);
if (!mir_tstrcmp(str, TranslateT("<unknown>")))
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp
index 8b281dd3f9..e820fa97b6 100644
--- a/plugins/SeenPlugin/src/utils.cpp
+++ b/plugins/SeenPlugin/src/utils.cpp
@@ -141,17 +141,17 @@ DWORD isSeen(MCONTACT hcontact, SYSTEMTIME *st)
return res;
}
-TCHAR *weekdays[] = { LPGENT("Sunday"), LPGENT("Monday"), LPGENT("Tuesday"), LPGENT("Wednesday"), LPGENT("Thursday"), LPGENT("Friday"), LPGENT("Saturday") };
-TCHAR *wdays_short[] = { LPGENT("Sun."), LPGENT("Mon."), LPGENT("Tue."), LPGENT("Wed."), LPGENT("Thu."), LPGENT("Fri."), LPGENT("Sat.") };
-TCHAR *monthnames[] = { LPGENT("January"), LPGENT("February"), LPGENT("March"), LPGENT("April"), LPGENT("May"), LPGENT("June"), LPGENT("July"), LPGENT("August"), LPGENT("September"), LPGENT("October"), LPGENT("November"), LPGENT("December") };
-TCHAR *mnames_short[] = { LPGENT("Jan."), LPGENT("Feb."), LPGENT("Mar."), LPGENT("Apr."), LPGENT("May"), LPGENT("Jun."), LPGENT("Jul."), LPGENT("Aug."), LPGENT("Sep."), LPGENT("Oct."), LPGENT("Nov."), LPGENT("Dec.") };
+wchar_t *weekdays[] = { LPGENW("Sunday"), LPGENW("Monday"), LPGENW("Tuesday"), LPGENW("Wednesday"), LPGENW("Thursday"), LPGENW("Friday"), LPGENW("Saturday") };
+wchar_t *wdays_short[] = { LPGENW("Sun."), LPGENW("Mon."), LPGENW("Tue."), LPGENW("Wed."), LPGENW("Thu."), LPGENW("Fri."), LPGENW("Sat.") };
+wchar_t *monthnames[] = { LPGENW("January"), LPGENW("February"), LPGENW("March"), LPGENW("April"), LPGENW("May"), LPGENW("June"), LPGENW("July"), LPGENW("August"), LPGENW("September"), LPGENW("October"), LPGENW("November"), LPGENW("December") };
+wchar_t *mnames_short[] = { LPGENW("Jan."), LPGENW("Feb."), LPGENW("Mar."), LPGENW("Apr."), LPGENW("May"), LPGENW("Jun."), LPGENW("Jul."), LPGENW("Aug."), LPGENW("Sep."), LPGENW("Oct."), LPGENW("Nov."), LPGENW("Dec.") };
-TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact)
+wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact)
{
#define MAXSIZE 1024
- static TCHAR sztemp[MAXSIZE + 1];
- TCHAR szdbsetting[128];
- TCHAR *charPtr;
+ static wchar_t sztemp[MAXSIZE + 1];
+ wchar_t szdbsetting[128];
+ wchar_t *charPtr;
int isetting = 0;
DWORD dwsetting = 0;
struct in_addr ia;
@@ -168,8 +168,8 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact)
char *szProto = hcontact ? GetContactProto(hcontact) : courProtoName;
ptrT info;
- TCHAR *d = sztemp;
- for (TCHAR *p = szstring; *p; p++) {
+ wchar_t *d = sztemp;
+ for (wchar_t *p = szstring; *p; p++) {
if (d >= sztemp + MAXSIZE)
break;
@@ -182,18 +182,18 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact)
switch (*++p) {
case 'Y':
if (!st.wYear) goto LBL_noData;
- d += _stprintf(d, L"%04i", st.wYear); //!!!!!!!!!!!!
+ d += swprintf(d, L"%04i", st.wYear); //!!!!!!!!!!!!
break;
case 'y':
if (!st.wYear) goto LBL_noData;
- d += _stprintf(d, L"%02i", st.wYear % 100); //!!!!!!!!!!!!
+ d += swprintf(d, L"%02i", st.wYear % 100); //!!!!!!!!!!!!
break;
case 'm':
if (!(isetting = st.wMonth)) goto LBL_noData;
LBL_2DigNum:
- d += _stprintf(d, L"%02i", isetting); //!!!!!!!!!!!!
+ d += swprintf(d, L"%02i", isetting); //!!!!!!!!!!!!
break;
case 'd':
@@ -252,7 +252,7 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact)
goto LBL_2DigNum;
case 'n':
- charPtr = hcontact ? (TCHAR*)pcli->pfnGetContactDisplayName(hcontact, 0) : (wantempty ? L"" : L"---");
+ charPtr = hcontact ? (wchar_t*)pcli->pfnGetContactDisplayName(hcontact, 0) : (wantempty ? L"" : L"---");
goto LBL_charPtr;
case 'N':
@@ -264,7 +264,7 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact)
case 'G':
if (!db_get_ts(hcontact, "CList", "Group", &dbv)) {
- _tcsncpy(szdbsetting, dbv.ptszVal, _countof(szdbsetting));
+ wcsncpy(szdbsetting, dbv.ptszVal, _countof(szdbsetting));
db_free(&dbv);
charPtr = szdbsetting;
goto LBL_charPtr;
@@ -280,7 +280,7 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact)
case 's':
if (isetting = db_get_w(hcontact, S_MOD, hcontact ? "StatusTriger" : courProtoName, 0)) {
- _tcsncpy(szdbsetting, pcli->pfnGetStatusModeDescription(isetting | 0x8000, 0), _countof(szdbsetting));
+ wcsncpy(szdbsetting, pcli->pfnGetStatusModeDescription(isetting | 0x8000, 0), _countof(szdbsetting));
if (!(isetting & 0x8000)) {
mir_tstrncat(szdbsetting, L"/", _countof(szdbsetting) - mir_tstrlen(szdbsetting));
mir_tstrncat(szdbsetting, TranslateT("Idle"), _countof(szdbsetting) - mir_tstrlen(szdbsetting));
@@ -300,7 +300,7 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact)
case 'o':
if (isetting = db_get_w(hcontact, S_MOD, hcontact ? "OldStatus" : courProtoName, 0)) {
- _tcsncpy(szdbsetting, pcli->pfnGetStatusModeDescription(isetting, 0), _countof(szdbsetting));
+ wcsncpy(szdbsetting, pcli->pfnGetStatusModeDescription(isetting, 0), _countof(szdbsetting));
if (includeIdle && hcontact && db_get_b(hcontact, S_MOD, "OldIdle", 0)) {
mir_tstrncat(szdbsetting, L"/", _countof(szdbsetting) - mir_tstrlen(szdbsetting));
mir_tstrncat(szdbsetting, TranslateT("Idle"), _countof(szdbsetting) - mir_tstrlen(szdbsetting));
@@ -325,13 +325,13 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact)
goto LBL_noData;
ia.S_un.S_addr = htonl(dwsetting);
- _tcsncpy(szdbsetting, _A2T(inet_ntoa(ia)), _countof(szdbsetting));
+ wcsncpy(szdbsetting, _A2T(inet_ntoa(ia)), _countof(szdbsetting));
charPtr = szdbsetting;
}
goto LBL_charPtr;
case 'P':
- _tcsncpy(szdbsetting, szProto ? _A2T(szProto) : (wantempty ? L"" : L"ProtoUnknown"), _countof(szdbsetting));
+ wcsncpy(szdbsetting, szProto ? _A2T(szProto) : (wantempty ? L"" : L"ProtoUnknown"), _countof(szdbsetting));
charPtr = szdbsetting;
goto LBL_charPtr;
@@ -356,7 +356,7 @@ TCHAR* ParseString(TCHAR *szstring, MCONTACT hcontact)
if (!pa)
goto LBL_noData;
- _tcsncpy(szdbsetting, pa->tszAccountName, _countof(szdbsetting));
+ wcsncpy(szdbsetting, pa->tszAccountName, _countof(szdbsetting));
charPtr = szdbsetting;
}
goto LBL_charPtr;
@@ -477,16 +477,16 @@ void ShowPopup(MCONTACT hcontact, const char * lpzProto, int newStatus)
ppd.lchIcon = Skin_LoadProtoIcon(lpzProto, newStatus);
if (!db_get_ts(NULL, S_MOD, "PopupStamp", &dbv)) {
- _tcsncpy(ppd.lptzContactName, ParseString(dbv.ptszVal, hcontact), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzContactName, ParseString(dbv.ptszVal, hcontact), MAX_CONTACTNAME);
db_free(&dbv);
}
- else _tcsncpy(ppd.lptzContactName, ParseString(DEFAULT_POPUPSTAMP, hcontact), MAX_CONTACTNAME);
+ else wcsncpy(ppd.lptzContactName, ParseString(DEFAULT_POPUPSTAMP, hcontact), MAX_CONTACTNAME);
if (!db_get_ts(NULL, S_MOD, "PopupStampText", &dbv)) {
- _tcsncpy(ppd.lptzText, ParseString(dbv.ptszVal, hcontact), MAX_SECONDLINE);
+ wcsncpy(ppd.lptzText, ParseString(dbv.ptszVal, hcontact), MAX_SECONDLINE);
db_free(&dbv);
}
- else _tcsncpy(ppd.lptzText, ParseString(DEFAULT_POPUPSTAMPTEXT, hcontact), MAX_SECONDLINE);
+ else wcsncpy(ppd.lptzText, ParseString(DEFAULT_POPUPSTAMPTEXT, hcontact), MAX_SECONDLINE);
ppd.PluginWindowProc = PopupDlgProc;
PUAddPopupT(&ppd);
}
@@ -731,24 +731,24 @@ short int isDbZero(MCONTACT hContact, const char *module_name, const char *setti
return -1;
}
-TCHAR* any_to_IdleNotidleUnknown(MCONTACT hContact, const char *module_name, const char *setting_name, TCHAR *buff, int bufflen)
+wchar_t* any_to_IdleNotidleUnknown(MCONTACT hContact, const char *module_name, const char *setting_name, wchar_t *buff, int bufflen)
{
short int r = isDbZero(hContact, module_name, setting_name);
if (r == -1) {
- _tcsncpy(buff, TranslateT("Unknown"), bufflen);
+ wcsncpy(buff, TranslateT("Unknown"), bufflen);
}
else {
- _tcsncpy(buff, r ? TranslateT("Not Idle") : TranslateT("Idle"), bufflen);
+ wcsncpy(buff, r ? TranslateT("Not Idle") : TranslateT("Idle"), bufflen);
};
buff[bufflen - 1] = 0;
return buff;
}
-TCHAR* any_to_Idle(MCONTACT hContact, const char *module_name, const char *setting_name, TCHAR *buff, int bufflen)
+wchar_t* any_to_Idle(MCONTACT hContact, const char *module_name, const char *setting_name, wchar_t *buff, int bufflen)
{
if (isDbZero(hContact, module_name, setting_name) == 0) { //DB setting is NOT zero and exists
buff[0] = L'/';
- _tcsncpy(&buff[1], TranslateT("Idle"), bufflen - 1);
+ wcsncpy(&buff[1], TranslateT("Idle"), bufflen - 1);
}
else buff[0] = 0;
buff[bufflen - 1] = 0;
diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp
index eb4b9dcc61..1a9f0de514 100644
--- a/plugins/SendScreenshotPlus/src/CSend.cpp
+++ b/plugins/SendScreenshotPlus/src/CSend.cpp
@@ -94,7 +94,7 @@ INT_PTR CALLBACK CSend::ResultDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
Window_SetIcon_IcoLib(hwndDlg, GetIconHandle(ICO_MAIN));
{
CSend* self = (CSend*)lParam;
- TCHAR* tmp = mir_tstrdup(TranslateT("Resulting URL from\n"));
+ wchar_t* tmp = mir_tstrdup(TranslateT("Resulting URL from\n"));
mir_tstradd(tmp, self->m_pszSendTyp);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, tmp);
mir_free(tmp);
@@ -124,16 +124,16 @@ INT_PTR CALLBACK CSend::ResultDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
case ID_btnCopy:
case ID_btnThumbCopy:
SendDlgItemMessage(hwndDlg, i, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIconBtn(ICO_BTN_COPY));
- SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Copy"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Copy"), BATF_TCHAR);
break;
case ID_btnBBC:
case ID_btnThumbBBC:
SendDlgItemMessage(hwndDlg, i, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIconBtn(ICO_BTN_BBC));
- SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Copy BBCode"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Copy BBCode"), BATF_TCHAR);
break;
default:
SendDlgItemMessage(hwndDlg, i, BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetIconBtn(ICO_BTN_BBCLNK));
- SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Copy BBCode w/ link"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, i, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Copy BBCode w/ link"), BATF_TCHAR);
}
}
}
@@ -151,7 +151,7 @@ INT_PTR CALLBACK CSend::ResultDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
case ID_btnBBC:
case ID_btnThumbBBC:
case ID_btnThumbBBC2:
- TCHAR tmp[2048];
+ wchar_t tmp[2048];
int edtID = ID_edtURL;
int bbc = 0;
switch (LOWORD(wParam)) {
@@ -166,16 +166,16 @@ INT_PTR CALLBACK CSend::ResultDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
size_t len;
if (bbc) {
if (bbc == 1) {
- memcpy(tmp, L"[img]", 5 * sizeof(TCHAR)); len = 5;
+ memcpy(tmp, L"[img]", 5 * sizeof(wchar_t)); len = 5;
len += GetDlgItemText(hwndDlg, edtID, tmp + len, 2048 - 11);
- memcpy(tmp + len, L"[/img]", 7 * sizeof(TCHAR)); len += 7;
+ memcpy(tmp + len, L"[/img]", 7 * sizeof(wchar_t)); len += 7;
}
else {
- memcpy(tmp, L"[url=", 5 * sizeof(TCHAR)); len = 5;
+ memcpy(tmp, L"[url=", 5 * sizeof(wchar_t)); len = 5;
len += GetDlgItemText(hwndDlg, ID_edtURL, tmp + len, 1024);
- memcpy(tmp + len, L"][img]", 6 * sizeof(TCHAR)); len += 6;
+ memcpy(tmp + len, L"][img]", 6 * sizeof(wchar_t)); len += 6;
len += GetDlgItemText(hwndDlg, edtID, tmp + len, 1024);
- memcpy(tmp + len, L"[/img][/url]", 13 * sizeof(TCHAR)); len += 12;
+ memcpy(tmp + len, L"[/img][/url]", 13 * sizeof(wchar_t)); len += 12;
}
}
else
@@ -187,8 +187,8 @@ INT_PTR CALLBACK CSend::ResultDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
continue;
}
EmptyClipboard();
- HGLOBAL clipbuffer = GlobalAlloc(GMEM_MOVEABLE, len*sizeof(TCHAR) + sizeof(TCHAR));
- TCHAR* tmp2 = (TCHAR*)GlobalLock(clipbuffer);
+ HGLOBAL clipbuffer = GlobalAlloc(GMEM_MOVEABLE, len*sizeof(wchar_t) + sizeof(wchar_t));
+ wchar_t* tmp2 = (wchar_t*)GlobalLock(clipbuffer);
mir_tstrncpy(tmp2, tmp, len + 1); tmp2[len] = '\0';
GlobalUnlock(clipbuffer);
SetClipboardData(CF_UNICODETEXT, clipbuffer);
@@ -215,7 +215,7 @@ void CSend::svcSendMsgExit(const char* szMessage)
Exit(CSEND_DIALOG); return;
}
if (m_ChatRoom) {
- TCHAR* tmp = mir_a2t(szMessage);
+ wchar_t* tmp = mir_a2t(szMessage);
if (m_pszFileDesc) {
mir_tstradd(tmp, L"\r\n");
mir_tstradd(tmp, m_pszFileDesc);
@@ -282,7 +282,7 @@ void CSend::svcSendFileExit()
Exit(ACKRESULT_SUCCESS); return;
}
if (!m_hContact) {
- Error(LPGENT("%s requires a valid contact!"), m_pszSendTyp);
+ Error(LPGENW("%s requires a valid contact!"), m_pszSendTyp);
Exit(ACKRESULT_FAILED); return;
}
mir_freeAndNil(m_szEventMsg);
@@ -307,8 +307,8 @@ void CSend::svcSendFileExit()
}
// Start miranda PSS_FILE based on mir ver (T)
- TCHAR* ppFile[2] = { 0, 0 };
- TCHAR* pDesc = mir_tstrdup(m_pszFileDesc);
+ wchar_t* ppFile[2] = { 0, 0 };
+ wchar_t* pDesc = mir_tstrdup(m_pszFileDesc);
ppFile[0] = mir_tstrdup(m_pszFile);
ppFile[1] = NULL;
m_hSend = (HANDLE)ProtoChainSend(m_hContact, PSS_FILE, (WPARAM)pDesc, (LPARAM)ppFile);
@@ -336,13 +336,13 @@ int CSend::OnSend(void *obj, WPARAM, LPARAM lParam)
*/
switch (ack->result) {
- case ACKRESULT_INITIALISING: //SetFtStatus(hwndDlg, LPGENT("Initialising..."), FTS_TEXT); break;
- case ACKRESULT_CONNECTING: //SetFtStatus(hwndDlg, LPGENT("Connecting..."), FTS_TEXT); break;
- case ACKRESULT_CONNECTPROXY: //SetFtStatus(hwndDlg, LPGENT("Connecting to proxy..."), FTS_TEXT); break;
- case ACKRESULT_LISTENING: //SetFtStatus(hwndDlg, LPGENT("Waiting for connection..."), FTS_TEXT); break;
- case ACKRESULT_CONNECTED: //SetFtStatus(hwndDlg, LPGENT("Connected"), FTS_TEXT); break;
- case ACKRESULT_SENTREQUEST: //SetFtStatus(hwndDlg, LPGENT("Decision sent"), FTS_TEXT); break;
- case ACKRESULT_NEXTFILE: //SetFtStatus(hwndDlg, LPGENT("Moving to next file..."), FTS_TEXT);
+ case ACKRESULT_INITIALISING: //SetFtStatus(hwndDlg, LPGENW("Initialising..."), FTS_TEXT); break;
+ case ACKRESULT_CONNECTING: //SetFtStatus(hwndDlg, LPGENW("Connecting..."), FTS_TEXT); break;
+ case ACKRESULT_CONNECTPROXY: //SetFtStatus(hwndDlg, LPGENW("Connecting to proxy..."), FTS_TEXT); break;
+ case ACKRESULT_LISTENING: //SetFtStatus(hwndDlg, LPGENW("Waiting for connection..."), FTS_TEXT); break;
+ case ACKRESULT_CONNECTED: //SetFtStatus(hwndDlg, LPGENW("Connected"), FTS_TEXT); break;
+ case ACKRESULT_SENTREQUEST: //SetFtStatus(hwndDlg, LPGENW("Decision sent"), FTS_TEXT); break;
+ case ACKRESULT_NEXTFILE: //SetFtStatus(hwndDlg, LPGENW("Moving to next file..."), FTS_TEXT);
case ACKRESULT_FILERESUME: //
case ACKRESULT_DATA: //transfer is on progress
break;
@@ -397,7 +397,7 @@ void CSend::DB_EventAdd(WORD EventType)
//---------------------------------------------------------------------------
void CSend::Error(LPCTSTR pszFormat, ...)
{
- TCHAR tszMsg[MAX_SECONDLINE];
+ wchar_t tszMsg[MAX_SECONDLINE];
mir_sntprintf(tszMsg, L"%s - %s", _T(SZ_SENDSS), TranslateT("Error"));
mir_free(m_ErrorTitle), m_ErrorTitle = mir_tstrdup(tszMsg);
@@ -456,7 +456,7 @@ void CSend::Exit(unsigned int Result)
if (err) {
SkinPlaySound("FileFailed");
if (m_ErrorMsg) MsgBoxService(NULL, (LPARAM)&m_box);
- else MsgErr(NULL, LPGENT("An unknown error has occurred."));
+ else MsgErr(NULL, LPGENW("An unknown error has occurred."));
}
}
if (m_pszFile && *m_pszFile && m_bDeleteAfterSend && m_EnableItem&SS_DLG_DELETEAFTERSSEND) {
diff --git a/plugins/SendScreenshotPlus/src/CSend.h b/plugins/SendScreenshotPlus/src/CSend.h
index 9ff63828de..293e34f077 100644
--- a/plugins/SendScreenshotPlus/src/CSend.h
+++ b/plugins/SendScreenshotPlus/src/CSend.h
@@ -42,10 +42,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define GC_RESULT_ERROR 202
#define GC_RESULT_NOSESSION 209
-const TCHAR SS_ERR_INIT[] =LPGENT("Unable to initiate %s.");
-const TCHAR SS_ERR_MAPI[] =LPGENT("MAPI error (%i):\n%s.");
-const TCHAR SS_ERR_RESPONSE[] =LPGENT("Unknown response from %s (%i)");
-const TCHAR SS_ERR_NORESPONSE[] =LPGENT("Got no response from %s (%i)");
+const wchar_t SS_ERR_INIT[] =LPGENW("Unable to initiate %s.");
+const wchar_t SS_ERR_MAPI[] =LPGENW("MAPI error (%i):\n%s.");
+const wchar_t SS_ERR_RESPONSE[] =LPGENW("Unknown response from %s (%i)");
+const wchar_t SS_ERR_NORESPONSE[] =LPGENW("Got no response from %s (%i)");
//---------------------------------------------------------------------------
class CSend {
@@ -56,25 +56,25 @@ class CSend {
virtual int Send() = NULL; // returns 1 if sent (you must delete class) and 0 when still sending (class deletes itself)
int SendSilent() {m_bAsync=m_bSilent=true; return Send();};
- void SetFile(TCHAR* file){mir_free(m_pszFile), m_pszFile=mir_tstrdup(file);};
+ void SetFile(wchar_t* file){mir_free(m_pszFile), m_pszFile=mir_tstrdup(file);};
void SetFile(char* file){mir_free(m_pszFile), m_pszFile=mir_a2t(file);};
- void SetDescription(TCHAR* descr){mir_free(m_pszFileDesc), m_pszFileDesc=mir_tstrdup(descr);};
+ void SetDescription(wchar_t* descr){mir_free(m_pszFileDesc), m_pszFileDesc=mir_tstrdup(descr);};
void SetContact(MCONTACT hContact);
char* GetURL(){return m_URL;};
char* GetURLthumbnail(){return m_URLthumb;};
BYTE GetEnableItem() {return m_EnableItem;};
- TCHAR* GetErrorMsg() {return m_ErrorMsg;};
+ wchar_t* GetErrorMsg() {return m_ErrorMsg;};
bool m_bDeleteAfterSend;
protected:
bool m_bAsync;
bool m_bSilent;
- TCHAR* m_pszFile;
- TCHAR* m_pszFileDesc;
+ wchar_t* m_pszFile;
+ wchar_t* m_pszFileDesc;
char* m_URL;
char* m_URLthumb;
static int OnSend(void *obj, WPARAM wParam, LPARAM lParam);
- TCHAR* m_pszSendTyp; //hold string for error mess
+ wchar_t* m_pszSendTyp; //hold string for error mess
char* m_pszProto; //Contact Proto Modul
MCONTACT m_hContact; //Contact handle
BYTE m_EnableItem; //hold flag for send type
@@ -94,8 +94,8 @@ class CSend {
HANDLE m_hOnSend; //HookEventObj on ME_PROTO_ACK
MSGBOX m_box;
- TCHAR* m_ErrorMsg;
- TCHAR* m_ErrorTitle;
+ wchar_t* m_ErrorMsg;
+ wchar_t* m_ErrorTitle;
void Unhook(){if(m_hOnSend) {UnhookEvent(m_hOnSend);m_hOnSend = NULL;}}
void DB_EventAdd(WORD EventType);
diff --git a/plugins/SendScreenshotPlus/src/CSendDropbox.cpp b/plugins/SendScreenshotPlus/src/CSendDropbox.cpp
index 62203d6ccd..47b7f778e6 100644
--- a/plugins/SendScreenshotPlus/src/CSendDropbox.cpp
+++ b/plugins/SendScreenshotPlus/src/CSendDropbox.cpp
@@ -60,7 +60,7 @@ void CSendDropbox::SendThread()
if (CallService(MS_DROPBOX_UPLOAD, (WPARAM)&m_URL, (LPARAM)&ui))
{
- Error(LPGENT("%s (%i):\nCould not add a share to the Dropbox plugin."), TranslateTS(m_pszSendTyp), 0);
+ Error(LPGENW("%s (%i):\nCould not add a share to the Dropbox plugin."), TranslateTS(m_pszSendTyp), 0);
Exit(ACKRESULT_FAILED); return;
}
diff --git a/plugins/SendScreenshotPlus/src/CSendEmail.cpp b/plugins/SendScreenshotPlus/src/CSendEmail.cpp
index 99fa9304ea..dc91c4a867 100644
--- a/plugins/SendScreenshotPlus/src/CSendEmail.cpp
+++ b/plugins/SendScreenshotPlus/src/CSendEmail.cpp
@@ -35,7 +35,7 @@ CSendEmail::CSendEmail(HWND Owner, MCONTACT hContact, bool /*bAsync*/)
: CSend(Owner, hContact, true)
{
m_EnableItem = SS_DLG_DESCRIPTION | SS_DLG_DELETEAFTERSSEND; // SS_DLG_AUTOSEND | ;
- m_pszSendTyp = LPGENT("Email transfer");
+ m_pszSendTyp = LPGENW("Email transfer");
m_pszFileA = NULL;
m_pszFileName = NULL;
m_Email = NULL;
@@ -136,53 +136,53 @@ void CSendEmail::SendThread()
int res = lpMAPISendMail(NULL, NULL, &Msg, MAPI_LOGON_UI | MAPI_DIALOG, 0);
::FreeLibrary(hMAPILib);
- TCHAR* err;
+ wchar_t* err;
switch (res) {
case SUCCESS_SUCCESS:
//The call succeeded and the message was sent.
Exit(ACKRESULT_SUCCESS); return;
// No message was sent
case MAPI_E_AMBIGUOUS_RECIPIENT:
- err = LPGENT("A recipient matched more than one of the recipient descriptor structures and MAPI_DIALOG was not set");
+ err = LPGENW("A recipient matched more than one of the recipient descriptor structures and MAPI_DIALOG was not set");
break;
case MAPI_E_ATTACHMENT_NOT_FOUND:
- err = LPGENT("The specified attachment was not found");
+ err = LPGENW("The specified attachment was not found");
break;
case MAPI_E_ATTACHMENT_OPEN_FAILURE:
- err = LPGENT("The specified attachment could not be opened");
+ err = LPGENW("The specified attachment could not be opened");
break;
case MAPI_E_BAD_RECIPTYPE:
- err = LPGENT("The type of a recipient was not MAPI_TO, MAPI_CC, or MAPI_BCC");
+ err = LPGENW("The type of a recipient was not MAPI_TO, MAPI_CC, or MAPI_BCC");
break;
case MAPI_E_FAILURE:
- err = LPGENT("One or more unspecified errors occurred");
+ err = LPGENW("One or more unspecified errors occurred");
break;
case MAPI_E_INSUFFICIENT_MEMORY:
- err = LPGENT("There was insufficient memory to proceed");
+ err = LPGENW("There was insufficient memory to proceed");
break;
case MAPI_E_INVALID_RECIPS:
- err = LPGENT("One or more recipients were invalid or did not resolve to any address");
+ err = LPGENW("One or more recipients were invalid or did not resolve to any address");
break;
case MAPI_E_LOGIN_FAILURE:
- err = LPGENT("There was no default logon, and the user failed to log on successfully when the logon dialog box was displayed");
+ err = LPGENW("There was no default logon, and the user failed to log on successfully when the logon dialog box was displayed");
break;
case MAPI_E_TEXT_TOO_LARGE:
- err = LPGENT("The text in the message was too large");
+ err = LPGENW("The text in the message was too large");
break;
case MAPI_E_TOO_MANY_FILES:
- err = LPGENT("There were too many file attachments");
+ err = LPGENW("There were too many file attachments");
break;
case MAPI_E_TOO_MANY_RECIPIENTS:
- err = LPGENT("There were too many recipients");
+ err = LPGENW("There were too many recipients");
break;
case MAPI_E_UNKNOWN_RECIPIENT:
- err = LPGENT("A recipient did not appear in the address list");
+ err = LPGENW("A recipient did not appear in the address list");
break;
case MAPI_E_USER_ABORT:
- err = LPGENT("The user canceled one of the dialog boxes");
+ err = LPGENW("The user canceled one of the dialog boxes");
break;
default:
- err = LPGENT("Unknown Error");
+ err = LPGENW("Unknown Error");
break;
}
Error(SS_ERR_MAPI, res, err);
diff --git a/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp b/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp
index a6cd2dcc29..3267ecdd14 100644
--- a/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp
+++ b/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp
@@ -35,7 +35,7 @@ CSendFTPFile::CSendFTPFile(HWND Owner, MCONTACT hContact, bool /*bAsync*/)
: CSend(Owner, hContact, true)
{
m_EnableItem = 0; //SS_DLG_DESCRIPTION | SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND;
- m_pszSendTyp = LPGENT("FTPFile transfer");
+ m_pszSendTyp = LPGENW("FTPFile transfer");
m_pszFileName = NULL;
}
@@ -74,7 +74,7 @@ void CSendFTPFile::SendThread()
INT_PTR ret = FTPFileUploadA(m_hContact, FNUM_DEFAULT, FMODE_RAWFILE, &m_pszFileName, 1);
if (ret != 0) {
- Error(LPGENT("%s (%i):\nCould not add a share to the FTP File plugin."), TranslateTS(m_pszSendTyp), ret);
+ Error(LPGENW("%s (%i):\nCould not add a share to the FTP File plugin."), TranslateTS(m_pszSendTyp), ret);
Exit(ret); return;
}
diff --git a/plugins/SendScreenshotPlus/src/CSendFile.cpp b/plugins/SendScreenshotPlus/src/CSendFile.cpp
index 4c6ce014ee..d94aa4c5cf 100644
--- a/plugins/SendScreenshotPlus/src/CSendFile.cpp
+++ b/plugins/SendScreenshotPlus/src/CSendFile.cpp
@@ -34,7 +34,7 @@ CSendFile::CSendFile(HWND Owner, MCONTACT hContact, bool /*bAsync*/)
: CSend(Owner, hContact, true)
{
m_EnableItem = SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND | SS_DLG_DESCRIPTION;
- m_pszSendTyp = LPGENT("File transfer");
+ m_pszSendTyp = LPGENW("File transfer");
}
CSendFile::~CSendFile()
diff --git a/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp b/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp
index cea7ece543..636b49d1b3 100644
--- a/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp
+++ b/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp
@@ -38,7 +38,7 @@ CSendHTTPServer::CSendHTTPServer(HWND Owner, MCONTACT hContact, bool /*bAsync*/)
: CSend(Owner, hContact, true)
{
m_EnableItem = SS_DLG_DESCRIPTION; //| SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND;
- m_pszSendTyp = LPGENT("HTTPServer transfer");
+ m_pszSendTyp = LPGENW("HTTPServer transfer");
m_pszFileName = NULL;
m_fsi_pszSrvPath = NULL;
m_fsi_pszRealPath = NULL;
@@ -56,7 +56,7 @@ int CSendHTTPServer::Send()
{
if (!m_hContact) return 1;
if (CallService(MS_HTTP_ACCEPT_CONNECTIONS, TRUE, 0) != 0) {
- Error(LPGENT("Could not start the HTTP Server plugin."));
+ Error(LPGENW("Could not start the HTTP Server plugin."));
Exit(ACKRESULT_FAILED);
return !m_bAsync;
}
@@ -102,7 +102,7 @@ void CSendHTTPServer::SendThread()
}
if (ret != 0) {
- Error(LPGENT("%s (%i):\nCould not add a share to the HTTP Server plugin."), TranslateTS(m_pszSendTyp), ret);
+ Error(LPGENW("%s (%i):\nCould not add a share to the HTTP Server plugin."), TranslateTS(m_pszSendTyp), ret);
Exit(ret); return;
}
diff --git a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp
index cb5abc8e20..870ae89f82 100644
--- a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp
+++ b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp
@@ -34,7 +34,7 @@ CSendHost_ImageShack::CSendHost_ImageShack(HWND Owner, MCONTACT hContact, bool b
: CSend(Owner, hContact, bAsync)
{
m_EnableItem = SS_DLG_DESCRIPTION | SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND;
- m_pszSendTyp = LPGENT("Image upload");
+ m_pszSendTyp = LPGENW("Image upload");
}
CSendHost_ImageShack::~CSendHost_ImageShack()
@@ -100,7 +100,7 @@ void CSendHost_ImageShack::SendThread()
}
else {/// check error mess from server
url = GetHTMLContent(reply->pData, "<error ", "</error>");
- TCHAR* err = NULL;
+ wchar_t* err = NULL;
if (url) err = mir_a2t(url);
if (!err || !*err) {/// fallback to server response mess
mir_free(err);
diff --git a/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp b/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp
index d3fe40ce74..a6eb7c6e57 100644
--- a/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp
+++ b/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp
@@ -19,7 +19,7 @@ CSendHost_Imgur::CSendHost_Imgur(HWND Owner, MCONTACT hContact, bool bAsync)
: CSend(Owner, hContact, bAsync)
{
m_EnableItem = SS_DLG_DESCRIPTION | SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND;
- m_pszSendTyp = LPGENT("Image upload");
+ m_pszSendTyp = LPGENW("Image upload");
}
CSendHost_Imgur::~CSendHost_Imgur()
diff --git a/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp b/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp
index 6d210953b0..68232006ce 100644
--- a/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp
+++ b/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp
@@ -19,7 +19,7 @@ CSendHost_UploadPie::CSendHost_UploadPie(HWND Owner, MCONTACT hContact, bool bAs
: m_expire(expire), CSend(Owner, hContact, bAsync)
{
m_EnableItem = SS_DLG_DESCRIPTION | SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND;
- m_pszSendTyp = LPGENT("Image upload");
+ m_pszSendTyp = LPGENW("Image upload");
}
CSendHost_UploadPie::~CSendHost_UploadPie()
@@ -92,7 +92,7 @@ void CSendHost_UploadPie::SendThread(void* obj)
}
else {/// check error mess from server
const char* err = GetHTMLContent(reply->pData, "<p id=\"error\"", "</p>");
- TCHAR* werr;
+ wchar_t* werr;
if (err) werr = mir_a2t(err);
else werr = mir_a2t(reply->pData);
self->Error(L"%s", werr);
diff --git a/plugins/SendScreenshotPlus/src/Main.cpp b/plugins/SendScreenshotPlus/src/Main.cpp
index fa4d8277e4..c2db7bff90 100644
--- a/plugins/SendScreenshotPlus/src/Main.cpp
+++ b/plugins/SendScreenshotPlus/src/Main.cpp
@@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "Main.h"
// Prototypes ///////////////////////////////////////////////////////////////////////////
-CLIST_INTERFACE *pcli;
+CLIST_INTERFACE *pcli;
HINSTANCE g_hSendSS;
MGLOBAL g_myGlobals;
HANDLE g_hNetlibUser=0;//!< Netlib Register User
@@ -68,11 +68,11 @@ IconItem ICONS_BTN[ICO_BTN_END_] =
};
static HANDLE m_hFolderScreenshot = 0;
-TCHAR* GetCustomPath()
+wchar_t* GetCustomPath()
{
- TCHAR* pszPath = Utils_ReplaceVarsT(L"%miranda_userdata%\\Screenshots");
+ wchar_t* pszPath = Utils_ReplaceVarsT(L"%miranda_userdata%\\Screenshots");
if (m_hFolderScreenshot) {
- TCHAR szPath[1024] = { 0 };
+ wchar_t szPath[1024] = { 0 };
FoldersGetCustomPathT(m_hFolderScreenshot, szPath, 1024, pszPath);
mir_free(pszPath);
pszPath = mir_tstrdup(szPath);
@@ -83,7 +83,7 @@ TCHAR* GetCustomPath()
}
int result = CreateDirectoryTreeT(pszPath);
if (result) {
- TCHAR szError[MAX_PATH];
+ wchar_t szError[MAX_PATH];
mir_sntprintf(szError, MAX_PATH, TranslateT("Could not create screenshot folder (error code: %d):\n%s\nDo you have write permissions?"), result, pszPath);
MessageBox(NULL, szError, L"SendSS", MB_OK | MB_ICONERROR | MB_APPLMODAL);
mir_free(pszPath);
@@ -107,7 +107,7 @@ INT_PTR service_OpenCaptureDialog(WPARAM wParam, LPARAM lParam)
MessageBox(NULL, TranslateT("Could not create main dialog."), TranslateT("Error"), MB_OK | MB_ICONERROR | MB_APPLMODAL);
return -1;
}
- TCHAR* pszPath = GetCustomPath();
+ wchar_t* pszPath = GetCustomPath();
if (!pszPath) {
delete frmMain;
return -1;
@@ -135,7 +135,7 @@ INT_PTR service_SendDesktop(WPARAM wParam, LPARAM)
MessageBox(NULL, TranslateT("Could not create main dialog."), TranslateT("Error"), MB_OK | MB_ICONERROR | MB_APPLMODAL);
return -1;
}
- TCHAR* pszPath = GetCustomPath();
+ wchar_t* pszPath = GetCustomPath();
if (!pszPath) {
delete frmMain;
return -1;
@@ -289,19 +289,19 @@ DLL_EXPORT int Load(void)
mi.hIcolibItem = GetIconHandle(ICO_MAINXS);
SET_UID(mi, 0xa559a22e, 0xd0f9, 0x4553, 0x8e, 0x68, 0x55, 0xb3, 0xae, 0xc4, 0x5d, 0x93);
- mi.name.t = LPGENT("Take a screenshot");
+ mi.name.w = LPGENW("Take a screenshot");
mi.pszService = MS_SENDSS_OPENDIALOG;
mi.position = 1000001;
Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0xfea0a84, 0x1767, 0x4605, 0x99, 0xf0, 0xa9, 0x48, 0x1a, 0xa6, 0x6f, 0xce);
- mi.name.t = LPGENT("Send screenshot");
+ mi.name.w = LPGENW("Send screenshot");
mi.pszService = MS_SENDSS_OPENDIALOG;
mi.position = 1000000;
Menu_AddContactMenuItem(&mi);
SET_UID(mi, 0x8d5b0d9a, 0x68d4, 0x4594, 0x9f, 0x41, 0x0, 0x64, 0x20, 0xe7, 0xf8, 0x9f);
- mi.name.t = LPGENT("Send desktop screenshot");
+ mi.name.w = LPGENW("Send desktop screenshot");
mi.pszService = MS_SENDSS_SENDDESKTOP;
mi.position = 1000001;
Menu_AddContactMenuItem(&mi);
@@ -309,7 +309,7 @@ DLL_EXPORT int Load(void)
/// hotkey's
HOTKEYDESC hkd = { sizeof(hkd) };
hkd.pszName = "Open SendSS+";
- hkd.ptszDescription = LPGENT("Open SendSS+");
+ hkd.ptszDescription = LPGENW("Open SendSS+");
hkd.ptszSection = L"SendSS+";
hkd.pszService = MS_SENDSS_OPENDIALOG;
//hkd.DefHotKey=HOTKEYCODE(HOTKEYF_CONTROL, VK_F10) | HKF_MIRANDA_LOCAL;
@@ -329,6 +329,6 @@ DLL_EXPORT int Load(void)
DLL_EXPORT int Unload(void)
{
if (g_clsTargetHighlighter)
- UnregisterClass((TCHAR*)g_clsTargetHighlighter, g_hSendSS), g_clsTargetHighlighter = 0;
+ UnregisterClass((wchar_t*)g_clsTargetHighlighter, g_hSendSS), g_clsTargetHighlighter = 0;
return 0;
}
diff --git a/plugins/SendScreenshotPlus/src/UAboutForm.cpp b/plugins/SendScreenshotPlus/src/UAboutForm.cpp
index 6d7e0a57a6..7a468f99c4 100644
--- a/plugins/SendScreenshotPlus/src/UAboutForm.cpp
+++ b/plugins/SendScreenshotPlus/src/UAboutForm.cpp
@@ -93,7 +93,7 @@ LRESULT TfrmAbout::wmInitdialog(WPARAM, LPARAM)
//License
{
- TCHAR* pszText = NULL;
+ wchar_t* pszText = NULL;
mir_tstradd(pszText, _T(__COPYRIGHT));
mir_tstradd(pszText, L"\r\n\r\n");
@@ -102,7 +102,7 @@ LRESULT TfrmAbout::wmInitdialog(WPARAM, LPARAM)
char* data = (char*)mir_alloc(size + 1);
memcpy(data, LockResource(LoadResource(g_hSendSS, hRes)), size);
data[size] = '\0';
- TCHAR* pszCopyright = mir_a2t(data);
+ wchar_t* pszCopyright = mir_a2t(data);
mir_free(data);
mir_tstradd(pszText, pszCopyright);
mir_free(pszCopyright);
@@ -117,7 +117,7 @@ LRESULT TfrmAbout::wmInitdialog(WPARAM, LPARAM)
char* data = (char*)mir_alloc(size + 1);
memcpy(data, LockResource(LoadResource(g_hSendSS, hRes)), size);
data[size] = '\0';
- TCHAR* pszText = mir_a2t(data);
+ wchar_t* pszText = mir_a2t(data);
mir_free(data);
SetDlgItemText(m_hWnd, IDC_CREDIT, pszText);
mir_free(pszText);
@@ -183,10 +183,10 @@ TfrmAbout::~TfrmAbout()
void TfrmAbout::btnPageClick()
{
HWND hCtrl = GetDlgItem(m_hWnd, IDA_CONTRIBLINK);
- const TCHAR* credits = TranslateT("Credits");
- const TCHAR* copyright = TranslateT("Copyright");
- const TCHAR* title;
- const TCHAR* button;
+ const wchar_t* credits = TranslateT("Credits");
+ const wchar_t* copyright = TranslateT("Copyright");
+ const wchar_t* title;
+ const wchar_t* button;
if (!m_Page) {
ShowWindow(GetDlgItem(m_hWnd, IDC_CREDIT), SW_HIDE);
ShowWindow(GetDlgItem(m_hWnd, IDC_LICENSE), SW_SHOW);
@@ -202,9 +202,9 @@ void TfrmAbout::btnPageClick()
button = copyright;
}
SetWindowText(hCtrl, button);
- TCHAR newTitle[128];
- TCHAR* pszPlug = mir_a2t(__PLUGIN_NAME);
- TCHAR* pszVer = mir_a2t(__VERSION_STRING_DOTS);
+ wchar_t newTitle[128];
+ wchar_t* pszPlug = mir_a2t(__PLUGIN_NAME);
+ wchar_t* pszVer = mir_a2t(__VERSION_STRING_DOTS);
mir_sntprintf(newTitle, L"%s - %s\nv%s", pszPlug, title, pszVer);
mir_free(pszPlug);
mir_free(pszVer);
diff --git a/plugins/SendScreenshotPlus/src/UMainForm.cpp b/plugins/SendScreenshotPlus/src/UMainForm.cpp
index 92e894894c..bf8edb1658 100644
--- a/plugins/SendScreenshotPlus/src/UMainForm.cpp
+++ b/plugins/SendScreenshotPlus/src/UMainForm.cpp
@@ -71,7 +71,7 @@ INT_PTR CALLBACK TfrmMain::DlgProc_CaptureTabPage(HWND hDlg, UINT uMsg, WPARAM w
case WM_COMMAND:
if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == ID_btnExplore) { /// local file tab
OPENFILENAME ofn = { sizeof(OPENFILENAME) };
- TCHAR filename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
GetDlgItemText(hDlg, ID_edtSize, filename, _countof(filename));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hDlg;
@@ -129,7 +129,7 @@ INT_PTR CALLBACK TfrmMain::DlgTfrmMain(HWND hWnd, UINT msg, WPARAM wParam, LPARA
switch (msg) {
case WM_DROPFILES:{ /// Drag&Drop of local files
- TCHAR filename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
if (!DragQueryFile((HDROP)wParam, 0, filename, MAX_PATH)) *filename = '\0';
DragFinish((HDROP)wParam);
if (wnd->second->m_hwndTabPage)
@@ -175,7 +175,7 @@ void TfrmMain::wmInitdialog(WPARAM, LPARAM)
/// Taskbar and Window icon
Window_SetIcon_IcoLib(m_hWnd, GetIconHandle(ICO_MAIN));
- TCHAR *pt = mir_tstrdup(pcli->pfnGetContactDisplayName(m_hContact, 0));
+ wchar_t *pt = mir_tstrdup(pcli->pfnGetContactDisplayName(m_hContact, 0));
if (pt && (m_hContact != 0)) {
CMString string;
string.AppendFormat(TranslateT("Send screenshot to %s"), pt);
@@ -238,7 +238,7 @@ void TfrmMain::wmInitdialog(WPARAM, LPARAM)
ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("<Entire Desktop>")), 0);
ComboBox_SetCurSel(hCtrl, 0);
if (m_MonitorCount > 1) {
- TCHAR tszTemp[120];
+ wchar_t tszTemp[120];
for (size_t mon = 0; mon < m_MonitorCount; ++mon) { /// @todo : fix format for non MSVC compilers
mir_sntprintf(tszTemp, L"%Iu. %s%s",
mon + 1, TranslateT("Monitor"),
@@ -496,13 +496,13 @@ void TfrmMain::SetTargetWindow(HWND hwnd)
}
m_hTargetWindow = hwnd;
int len = GetWindowTextLength(m_hTargetWindow) + 1;
- TCHAR* lpTitle;
+ wchar_t* lpTitle;
if (len > 1) {
- lpTitle = (TCHAR*)mir_alloc(len*sizeof(TCHAR));
+ lpTitle = (wchar_t*)mir_alloc(len*sizeof(wchar_t));
GetWindowText(m_hTargetWindow, lpTitle, len);
}
else {//no WindowText present, use WindowClass
- lpTitle = (TCHAR*)mir_alloc(64 * sizeof(TCHAR));
+ lpTitle = (wchar_t*)mir_alloc(64 * sizeof(wchar_t));
RealGetWindowClass(m_hTargetWindow, lpTitle, 64);
}
SetDlgItemText(m_hwndTabPage, ID_edtCaption, lpTitle);
@@ -516,7 +516,7 @@ void TfrmMain::wmTimer(WPARAM wParam, LPARAM)
static int primarymouse;
if (!m_hTargetHighlighter) {
primarymouse = GetSystemMetrics(SM_SWAPBUTTON) ? VK_RBUTTON : VK_LBUTTON;
- m_hTargetHighlighter = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW, (TCHAR*)g_clsTargetHighlighter, NULL, WS_POPUP, 0, 0, 0, 0, NULL, NULL, g_hSendSS, NULL);
+ m_hTargetHighlighter = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW, (wchar_t*)g_clsTargetHighlighter, NULL, WS_POPUP, 0, 0, 0, 0, NULL, NULL, g_hSendSS, NULL);
if (!m_hTargetHighlighter) return;
SetLayeredWindowAttributes(m_hTargetHighlighter, 0, 123, LWA_ALPHA);
SetSystemCursor(CopyCursor(GetIcon(ICO_TARGET)), OCR_IBEAM);//text cursor
@@ -658,7 +658,7 @@ void TfrmMain::UMevent(WPARAM, LPARAM lParam)
switch (lParam) {
case EVT_CaptureDone:
if (!m_Screenshot && m_opt_tabCapture != 2) {
- TCHAR *err = TranslateT("Couldn't take a screenshot");
+ wchar_t *err = TranslateT("Couldn't take a screenshot");
MessageBox(NULL, err, ERROR_TITLE, MB_OK | MB_ICONWARNING);
Show();
return;
@@ -781,7 +781,7 @@ void TfrmMain::SaveOptions(void)
}
//---------------------------------------------------------------------------
-void TfrmMain::Init(TCHAR* DestFolder, MCONTACT Contact)
+void TfrmMain::Init(wchar_t* DestFolder, MCONTACT Contact)
{
m_FDestFolder = mir_tstrdup(DestFolder);
m_hContact = Contact;
@@ -801,11 +801,11 @@ void TfrmMain::btnCaptureClick()
{
if (m_opt_tabCapture == 1) m_hTargetWindow = GetDesktopWindow();
else if (m_opt_tabCapture == 2) {
- TCHAR filename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
GetDlgItemText(m_hwndTabPage, ID_edtSize, filename, _countof(filename));
FILE* fp = _wfopen(filename, L"rb");
if (!fp) {
- TCHAR *err = TranslateT("Select a file");
+ wchar_t *err = TranslateT("Select a file");
MessageBox(m_hWnd, err, ERROR_TITLE, MB_OK | MB_ICONWARNING);
return;
}
@@ -813,7 +813,7 @@ void TfrmMain::btnCaptureClick()
mir_free(m_pszFile); m_pszFile = mir_tstrdup(filename);
}
else if (!m_hTargetWindow) {
- TCHAR *err = TranslateT("Select a target window.");
+ wchar_t *err = TranslateT("Select a target window.");
MessageBox(m_hWnd, err, ERROR_TITLE, MB_OK | MB_ICONWARNING);
return;
}
@@ -928,7 +928,7 @@ void TfrmMain::edtSizeUpdate(HWND hWnd, BOOL ClientArea, HWND hTarget, UINT Ctrl
// get window dimensions
RECT rect = { 0 };
RECT cliRect = { 0 };
- TCHAR B[33], H[16];
+ wchar_t B[33], H[16];
GetWindowRect(hWnd, &rect);
if (ClientArea) {
POINT pt = { 0 };
@@ -941,9 +941,9 @@ void TfrmMain::edtSizeUpdate(HWND hWnd, BOOL ClientArea, HWND hTarget, UINT Ctrl
rect = cliRect;
}
// _itot_s(rect.right - rect.left, B, 33, 10);
- _itot(rect.right - rect.left, B, 10);
+ _itow(rect.right - rect.left, B, 10);
// _itot_s(rect.bottom - rect.top, H, 16, 10);
- _itot(rect.bottom - rect.top, H, 10);
+ _itow(rect.bottom - rect.top, H, 10);
mir_tstrncat(B, L"x", _countof(B) - mir_tstrlen(B));
mir_tstrncat(B, H, _countof(B) - mir_tstrlen(B));
SetDlgItemText(hTarget, Ctrl, B);
@@ -951,11 +951,11 @@ void TfrmMain::edtSizeUpdate(HWND hWnd, BOOL ClientArea, HWND hTarget, UINT Ctrl
void TfrmMain::edtSizeUpdate(RECT rect, HWND hTarget, UINT Ctrl)
{
- TCHAR B[33], H[16];
+ wchar_t B[33], H[16];
// _itot_s(ABS(rect.right - rect.left), B, 33, 10);
- _itot(ABS(rect.right - rect.left), B, 10);
+ _itow(ABS(rect.right - rect.left), B, 10);
// _itot_s(ABS(rect.bottom - rect.top), H, 16, 10);
- _itot(ABS(rect.bottom - rect.top), H, 10);
+ _itow(ABS(rect.bottom - rect.top), H, 10);
mir_tstrncat(B, L"x", _countof(B) - mir_tstrlen(B));
mir_tstrncat(B, H, _countof(B) - mir_tstrlen(B));
SetDlgItemText(hTarget, Ctrl, B);
@@ -966,25 +966,25 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib)
{
//generate File name
FREE_IMAGE_FORMAT fif = FIF_UNKNOWN;
- TCHAR* ret;
- TCHAR* path = NULL;
- TCHAR* pszFilename = NULL;
- TCHAR* pszFileDesc = NULL;
+ wchar_t* ret;
+ wchar_t* path = NULL;
+ wchar_t* pszFilename = NULL;
+ wchar_t* pszFileDesc = NULL;
if (!dib) return 1; //error
unsigned FileNumber = db_get_dw(NULL, SZ_SENDSS, "FileNumber", 0) + 1;
if (FileNumber > 99999) FileNumber = 1;
//Generate FileName
mir_tstradd(path, m_FDestFolder);
- if (path[mir_tstrlen(path) - 1] != _T('\\')) mir_tstradd(path, L"\\");
+ if (path[mir_tstrlen(path) - 1] != '\\') mir_tstradd(path, L"\\");
mir_tstradd(path, L"shot%.5u");//on format change, adapt "len" below
size_t len = mir_tstrlen(path) + 2;
- pszFilename = (TCHAR*)mir_alloc(sizeof(TCHAR)*(len));
+ pszFilename = (wchar_t*)mir_alloc(sizeof(wchar_t)*(len));
mir_sntprintf(pszFilename, len, path, FileNumber);
mir_free(path);
//Generate a description according to the screenshot
- TCHAR winText[1024];
+ wchar_t winText[1024];
GetDlgItemText(m_hwndTabPage, ID_edtCaption, winText, _countof(winText));
@@ -1064,7 +1064,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib)
case 3: //TIFF (miranda freeimage interface do not support save tiff, we udse GDI+)
{
- TCHAR* pszFile = NULL;
+ wchar_t* pszFile = NULL;
mir_tstradd(pszFile, pszFilename);
mir_tstradd(pszFile, L".tif");
@@ -1085,7 +1085,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib)
//dib24 = FIP->FI_ConvertTo8Bits(dib_new);
//ret = SaveImage(FIF_GIF,dib24, pszFilename, L"gif");
//FIP->FI_Unload(dib24);
- TCHAR* pszFile = NULL;
+ wchar_t* pszFile = NULL;
mir_tstradd(pszFile, pszFilename);
mir_tstradd(pszFile, L".gif");
HBITMAP hBmp = FIP->FI_CreateHBITMAPFromDIB(dib_new);
@@ -1100,8 +1100,8 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib)
}
/* //load PNG and save file in user format (if differ)
//this get better result for transparent aereas
- //TCHAR* pszFormat = (TCHAR*)ComboBox_GetItemData(hwndCombo, ComboBox_GetCurSel(hwndCombo));
- TCHAR pszFormat[6];
+ //wchar_t* pszFormat = (wchar_t*)ComboBox_GetItemData(hwndCombo, ComboBox_GetCurSel(hwndCombo));
+ wchar_t pszFormat[6];
ComboBox_GetText(hwndCombo, pszFormat, 6);
if(ret && (mir_tstrcmpi (pszFormat,L"png") != 0)) {
@@ -1148,7 +1148,7 @@ void TfrmMain::FormClose()
{
bool bCanDelete = m_opt_btnDeleteAfterSend;
if (m_opt_tabCapture == 2) { /// existing file
- TCHAR description[1024];
+ wchar_t description[1024];
GetDlgItemText(m_hwndTabPage, ID_edtCaption, description, _countof(description));
if (!IsWindowEnabled(GetDlgItem(m_hWnd, ID_chkDesc)) || !m_opt_btnDesc)
*description = '\0';
diff --git a/plugins/SendScreenshotPlus/src/UMainForm.h b/plugins/SendScreenshotPlus/src/UMainForm.h
index 2a715a52f2..f0595bbce1 100644
--- a/plugins/SendScreenshotPlus/src/UMainForm.h
+++ b/plugins/SendScreenshotPlus/src/UMainForm.h
@@ -74,7 +74,7 @@ class TfrmMain{
bool m_bOnExitSave;
static void Unload();
- void Init(TCHAR* DestFolder, MCONTACT Contact);
+ void Init(wchar_t* DestFolder, MCONTACT Contact);
void Close(){SendMessage(m_hWnd,WM_CLOSE,0,0);}
void Show(){ShowWindow(m_hWnd,SW_SHOW);}
void Hide(){ShowWindow(m_hWnd,SW_HIDE);}
@@ -88,9 +88,9 @@ class TfrmMain{
bool m_bFormAbout;
HWND m_hTargetWindow, m_hLastWin;
HWND m_hTargetHighlighter;
- TCHAR* m_FDestFolder;
- TCHAR* m_pszFile;
- TCHAR* m_pszFileDesc;
+ wchar_t* m_FDestFolder;
+ wchar_t* m_pszFile;
+ wchar_t* m_pszFileDesc;
FIBITMAP* m_Screenshot;//Graphics::TBitmap *Screenshot;
RGBQUAD m_AlphaColor;
CSend* m_cSend;
diff --git a/plugins/SendScreenshotPlus/src/Utils.cpp b/plugins/SendScreenshotPlus/src/Utils.cpp
index d36a4a9cc6..260631038f 100644
--- a/plugins/SendScreenshotPlus/src/Utils.cpp
+++ b/plugins/SendScreenshotPlus/src/Utils.cpp
@@ -142,7 +142,7 @@ FIBITMAP* CaptureWindow(HWND hCapture, BOOL bClientArea, BOOL bIndirectCapture)
return dib;
}
-FIBITMAP* CaptureMonitor(const TCHAR* szDevice, const RECT* cropRect/*=NULL*/)
+FIBITMAP* CaptureMonitor(const wchar_t* szDevice, const RECT* cropRect/*=NULL*/)
{
HDC hScrDC;
RECT rect;
@@ -308,11 +308,11 @@ FIBITMAP* CreateDIBFromDC(HDC hDC, const RECT* rect, HWND hCapture/*=NULL*/)
return dib;
}
-TCHAR* SaveImage(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, const TCHAR* pszFilename, const TCHAR* pszExt, int flag)
+wchar_t* SaveImage(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, const wchar_t* pszFilename, const wchar_t* pszExt, int flag)
{
int ret = 0;
- TCHAR* pszFile = NULL;
- TCHAR* FileExt = GetFileExt(pszFilename);
+ wchar_t* pszFile = NULL;
+ wchar_t* FileExt = GetFileExt(pszFilename);
if (!FileExt) {
if (!pszExt) return NULL;
mir_tstradd(pszFile, pszFilename);
@@ -338,35 +338,35 @@ TCHAR* SaveImage(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, const TCHAR* pszFilename,
}
//---------------------------------------------------------------------------
-TCHAR* GetFileNameW(const TCHAR* pszPath)
+wchar_t* GetFileNameW(const wchar_t* pszPath)
{
- const TCHAR* slash = _tcsrchr(pszPath, _T('\\'));
- if (!slash) slash = _tcsrchr(pszPath, _T('/'));
+ const wchar_t* slash = wcsrchr(pszPath, '\\');
+ if (!slash) slash = wcsrchr(pszPath, '/');
if (slash)
return mir_t2u(slash + 1);
else
return mir_t2u(pszPath);
}
-TCHAR* GetFileExtW(const TCHAR* pszPath)
+wchar_t* GetFileExtW(const wchar_t* pszPath)
{
- const TCHAR* slash = _tcsrchr(pszPath, _T('.'));
+ const wchar_t* slash = wcsrchr(pszPath, '.');
if (slash)
return mir_t2u(slash);
return NULL;
}
-char* GetFileNameA(const TCHAR* pszPath)
+char* GetFileNameA(const wchar_t* pszPath)
{
- const TCHAR* slash = _tcsrchr(pszPath, _T('\\'));
- if (!slash) slash = _tcsrchr(pszPath, _T('/'));
+ const wchar_t* slash = wcsrchr(pszPath, '\\');
+ if (!slash) slash = wcsrchr(pszPath, '/');
if (slash)
return mir_t2a(slash + 1);
else
return mir_t2a(pszPath);
}
-char* GetFileExtA(const TCHAR* pszPath)
+char* GetFileExtA(const wchar_t* pszPath)
{
- const TCHAR* slash = _tcsrchr(pszPath, _T('.'));
+ const wchar_t* slash = wcsrchr(pszPath, '.');
if (slash)
return mir_t2a(slash);
return NULL;
@@ -395,7 +395,7 @@ BOOL GetEncoderClsid(wchar_t *wchMimeType, CLSID& clsidEncoder)
return bOk;
}
-void SaveGIF(HBITMAP hBmp, TCHAR* szFilename)
+void SaveGIF(HBITMAP hBmp, wchar_t* szFilename)
{
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
@@ -415,7 +415,7 @@ void SaveGIF(HBITMAP hBmp, TCHAR* szFilename)
Gdiplus::GdiplusShutdown(gdiplusToken);
}
-void SaveTIF(HBITMAP hBmp, TCHAR* szFilename)
+void SaveTIF(HBITMAP hBmp, wchar_t* szFilename)
{
//http://www.codeproject.com/Messages/1406708/How-to-reduce-the-size-of-an-Image-using-GDIplus.aspx
ULONG_PTR gdiplusToken;
diff --git a/plugins/SendScreenshotPlus/src/Utils.h b/plugins/SendScreenshotPlus/src/Utils.h
index 354244457f..5c22a17b7e 100644
--- a/plugins/SendScreenshotPlus/src/Utils.h
+++ b/plugins/SendScreenshotPlus/src/Utils.h
@@ -50,13 +50,13 @@ size_t MonitorInfoEnum(MONITORINFOEX* & myMonitors, RECT & virtualScreen);
BOOL CALLBACK MonitorInfoEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData);
FIBITMAP* CaptureWindow(HWND hCapture, BOOL bClientArea, BOOL bIndirectCapture);
-FIBITMAP* CaptureMonitor(const TCHAR* szDevice,const RECT* cropRect=NULL);
-TCHAR* SaveImage(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, const TCHAR* pszFilename, const TCHAR* pszExt, int flag=0);
+FIBITMAP* CaptureMonitor(const wchar_t* szDevice,const RECT* cropRect=NULL);
+wchar_t* SaveImage(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, const wchar_t* pszFilename, const wchar_t* pszExt, int flag=0);
-TCHAR* GetFileNameW(const TCHAR* pszPath);
-TCHAR* GetFileExtW (const TCHAR* pszPath);
-char* GetFileNameA(const TCHAR* pszPath);
-char* GetFileExtA (const TCHAR* pszPath);
+wchar_t* GetFileNameW(const wchar_t* pszPath);
+wchar_t* GetFileExtW (const wchar_t* pszPath);
+char* GetFileNameA(const wchar_t* pszPath);
+char* GetFileExtA (const wchar_t* pszPath);
#ifdef _UNICODE
# define GetFileName GetFileNameW
# define GetFileExt GetFileExtW
@@ -66,9 +66,9 @@ char* GetFileExtA (const TCHAR* pszPath);
#endif // _UNICODE
BOOL GetEncoderClsid(wchar_t *wchMimeType, CLSID& clsidEncoder);
-//void SavePNG(HBITMAP hBmp, TCHAR* szFilename);
-void SaveGIF(HBITMAP hBmp, TCHAR* szFilename);
-void SaveTIF(HBITMAP hBmp, TCHAR* szFilename);
+//void SavePNG(HBITMAP hBmp, wchar_t* szFilename);
+void SaveGIF(HBITMAP hBmp, wchar_t* szFilename);
+void SaveTIF(HBITMAP hBmp, wchar_t* szFilename);
//---------------------------------------------------------------------------
/* Old stuff from Borland C++
@@ -76,16 +76,16 @@ void SaveTIF(HBITMAP hBmp, TCHAR* szFilename);
*/
-class EventHandle
-{
- HANDLE _hEvent;
-public:
- inline EventHandle() { _hEvent = CreateEvent(NULL, 0, 0, NULL); }
- inline ~EventHandle() { CloseHandle(_hEvent); }
- inline void Set() { SetEvent(_hEvent); }
- inline void Wait() { WaitForSingleObject(_hEvent, INFINITE); }
- inline void Wait(DWORD dwMilliseconds) { WaitForSingleObject(_hEvent, dwMilliseconds); }
- inline operator HANDLE() { return _hEvent; }
+class EventHandle
+{
+ HANDLE _hEvent;
+public:
+ inline EventHandle() { _hEvent = CreateEvent(NULL, 0, 0, NULL); }
+ inline ~EventHandle() { CloseHandle(_hEvent); }
+ inline void Set() { SetEvent(_hEvent); }
+ inline void Wait() { WaitForSingleObject(_hEvent, INFINITE); }
+ inline void Wait(DWORD dwMilliseconds) { WaitForSingleObject(_hEvent, dwMilliseconds); }
+ inline operator HANDLE() { return _hEvent; }
};
#endif
diff --git a/plugins/SendScreenshotPlus/src/ctrl_button.cpp b/plugins/SendScreenshotPlus/src/ctrl_button.cpp
index 06fdadea88..d68cb3ed14 100644
--- a/plugins/SendScreenshotPlus/src/ctrl_button.cpp
+++ b/plugins/SendScreenshotPlus/src/ctrl_button.cpp
@@ -42,7 +42,7 @@ typedef struct TMBCtrl
int stateId; // button state
int defbutton; // default button
int pbState;
- TCHAR cHot;
+ wchar_t cHot;
} BTNCTRL, *LPBTNCTRL;
// External theme methods and properties
@@ -258,7 +258,7 @@ static void __fastcall PaintThemeButton(BTNCTRL *ctl, HDC hdcMem, LPRECT rcClien
static void __fastcall PaintButton(BTNCTRL *ctl, HDC hdcMem, LPRECT rcClient)
{
RECT rcText = { 0, 0, 0, 0 };
- TCHAR szText[MAX_PATH] = { 0 };
+ wchar_t szText[MAX_PATH] = { 0 };
WORD ccText;
// Draw the flat button
@@ -416,7 +416,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L
while (*tmp) {
if (*tmp == '&' && *(tmp + 1)) {
- bct->cHot = _totlower(*(tmp + 1));
+ bct->cHot = towlower(*(tmp + 1));
break;
}
tmp++;
@@ -426,7 +426,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L
break;
case WM_SYSKEYUP:
- if (bct->stateId != PBS_DISABLED && bct->cHot && bct->cHot == _totlower((TCHAR)wParam)) {
+ if (bct->stateId != PBS_DISABLED && bct->cHot && bct->cHot == towlower((wchar_t)wParam)) {
if (bct->dwStyle & MBS_PUSHBUTTON) {
if (bct->pbState) bct->pbState = 0;
else bct->pbState = 1;
@@ -564,7 +564,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L
break;
case BUTTONTRANSLATE:
- TCHAR szButton[MAX_PATH];
+ wchar_t szButton[MAX_PATH];
GetWindowText(bct->hwnd, szButton, _countof(szButton));
SetWindowText(bct->hwnd, TranslateTS(szButton));
break;
diff --git a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp
index 5801dcd7fb..5562180bbb 100644
--- a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp
+++ b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp
@@ -334,9 +334,9 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l
case MB_OKCANCEL:
retOk = IDRETRY;
- SetDlgItemText(hDlg, IDOK, LPGENT("OK"));
+ SetDlgItemText(hDlg, IDOK, LPGENW("OK"));
retCancel = IDCANCEL;
- SetDlgItemText(hDlg, IDCANCEL, LPGENT("Cancel"));
+ SetDlgItemText(hDlg, IDCANCEL, LPGENW("Cancel"));
rcOk.left = dlgMid - okWidth - 10;
rcOk.right = rcOk.left + okWidth;
rcCancel.left = dlgMid + 10;
@@ -347,9 +347,9 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l
case MB_RETRYCANCEL:
retOk = IDRETRY;
- SetDlgItemText(hDlg, IDOK, LPGENT("Retry"));
+ SetDlgItemText(hDlg, IDOK, LPGENW("Retry"));
retCancel = IDCANCEL;
- SetDlgItemText(hDlg, IDCANCEL, LPGENT("Cancel"));
+ SetDlgItemText(hDlg, IDCANCEL, LPGENW("Cancel"));
rcOk.left = dlgMid - okWidth - 10;
rcOk.right = rcOk.left + okWidth;
rcCancel.left = dlgMid + 10;
@@ -360,9 +360,9 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l
case MB_YESNO:
retOk = IDYES;
- SetDlgItemText(hDlg, IDOK, LPGENT("Yes"));
+ SetDlgItemText(hDlg, IDOK, LPGENW("Yes"));
retCancel = IDNO;
- SetDlgItemText(hDlg, IDCANCEL, LPGENT("No"));
+ SetDlgItemText(hDlg, IDCANCEL, LPGENW("No"));
rcOk.left = dlgMid - okWidth - 10;
rcOk.right = rcOk.left + okWidth;
rcCancel.left = dlgMid + 10;
@@ -373,11 +373,11 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l
case MB_ABORTRETRYIGNORE:
retOk = IDABORT;
- SetDlgItemText(hDlg, IDOK, LPGENT("Abort"));
+ SetDlgItemText(hDlg, IDOK, LPGENW("Abort"));
retAll = IDABORT;
- SetDlgItemText(hDlg, IDALL, LPGENT("Retry"));
+ SetDlgItemText(hDlg, IDALL, LPGENW("Retry"));
retCancel = IDCANCEL;
- SetDlgItemText(hDlg, IDCANCEL, LPGENT("Ignore"));
+ SetDlgItemText(hDlg, IDCANCEL, LPGENW("Ignore"));
rcAll.left = dlgMid - (allWidth / 2);
rcAll.right = rcAll.left + allWidth;
rcOk.left = rcAll.left - okWidth - 5;
@@ -391,11 +391,11 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l
case MB_YESNOCANCEL:
retOk = IDYES;
- SetDlgItemText(hDlg, IDOK, LPGENT("Yes"));
+ SetDlgItemText(hDlg, IDOK, LPGENW("Yes"));
retAll = IDNO;
- SetDlgItemText(hDlg, IDALL, LPGENT("No"));
+ SetDlgItemText(hDlg, IDALL, LPGENW("No"));
retCancel = IDCANCEL;
- SetDlgItemText(hDlg, IDCANCEL, LPGENT("Cancel"));
+ SetDlgItemText(hDlg, IDCANCEL, LPGENW("Cancel"));
rcAll.left = dlgMid - (allWidth / 2);
rcAll.right = rcAll.left + allWidth;
rcOk.left = rcAll.left - okWidth - 5;
@@ -409,13 +409,13 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l
case MB_YESALLNO:
retOk = IDYES;
- SetDlgItemText(hDlg, IDOK, LPGENT("Yes"));
+ SetDlgItemText(hDlg, IDOK, LPGENW("Yes"));
retAll = IDALL;
- SetDlgItemText(hDlg, IDALL, LPGENT("All"));
+ SetDlgItemText(hDlg, IDALL, LPGENW("All"));
//retNon = IDNONE;
- SetDlgItemText(hDlg, IDNONE, LPGENT("None"));
+ SetDlgItemText(hDlg, IDNONE, LPGENW("None"));
retCancel = IDNO;
- SetDlgItemText(hDlg, IDCANCEL, LPGENT("No"));
+ SetDlgItemText(hDlg, IDCANCEL, LPGENW("No"));
rcCancel.right = rcDlg.right - rcDlg.left - 10;
rcCancel.left = rcCancel.right - caWidth;
rcNone.right = rcCancel.left - 5;
@@ -673,7 +673,7 @@ INT_PTR MsgBoxService(WPARAM, LPARAM lParam)
**/
INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszInfo, LPCTSTR pszFormat, ...)
{
- TCHAR tszMsg[MAX_SECONDLINE];
+ wchar_t tszMsg[MAX_SECONDLINE];
va_list vl;
va_start(vl, pszFormat);
@@ -699,7 +699,7 @@ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszI
**/
INT_PTR CALLBACK MsgErr(HWND hParent, LPCTSTR pszFormat, ...)
{
- TCHAR tszTitle[MAX_SECONDLINE], tszMsg[MAX_SECONDLINE];
+ wchar_t tszTitle[MAX_SECONDLINE], tszMsg[MAX_SECONDLINE];
mir_sntprintf(tszTitle, L"%s - %s", _T(MODNAME), TranslateT("Error"));
va_list vl;
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp
index 91e1ac7203..7a88a5816f 100644
--- a/plugins/Sessions/Src/Main.cpp
+++ b/plugins/Sessions/Src/Main.cpp
@@ -161,7 +161,7 @@ INT_PTR CALLBACK SaveSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l
dy = 20;
dx = 150;
dd = 5;
- hClistControl = CreateWindowEx(WS_EX_CLIENTEDGE, _T(CLISTCONTROL_CLASS), L"",
+ hClistControl = CreateWindowEx(WS_EX_CLIENTEDGE, CLISTCONTROL_CLASSW, L"",
WS_TABSTOP | WS_VISIBLE | WS_CHILD,
x, y, dx, dy, hdlg, (HMENU)IDC_CLIST, g_hInst, 0);
@@ -196,7 +196,7 @@ INT_PTR CALLBACK SaveSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l
break;
case IDOK:
- TCHAR szUserSessionName[MAX_PATH];
+ wchar_t szUserSessionName[MAX_PATH];
{
DWORD session_list_temp[255] = { 0 };
int i = 0, length = GetWindowTextLength(GetDlgItem(hdlg, IDC_LIST));
@@ -475,21 +475,21 @@ int SaveSessionDate()
{
if (session_list[0] != 0) {
int TimeSize = GetTimeFormat(LOCALE_USER_DEFAULT, 0/*TIME_NOSECONDS*/, NULL, NULL, NULL, 0);
- TCHAR *szTimeBuf = (TCHAR*)mir_alloc((TimeSize + 1)*sizeof(TCHAR));
+ wchar_t *szTimeBuf = (wchar_t*)mir_alloc((TimeSize + 1)*sizeof(wchar_t));
GetTimeFormat(LOCALE_USER_DEFAULT, 0/*TIME_NOSECONDS*/, NULL, NULL, szTimeBuf, TimeSize);
int DateSize = GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, NULL, 0);
- TCHAR *szDateBuf = (TCHAR*)mir_alloc((DateSize + 1)*sizeof(TCHAR));
+ wchar_t *szDateBuf = (wchar_t*)mir_alloc((DateSize + 1)*sizeof(wchar_t));
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, szDateBuf, DateSize);
int lenn = (DateSize + TimeSize + 5);
- TCHAR *szSessionTime = (TCHAR*)mir_alloc(lenn*sizeof(TCHAR));
+ wchar_t *szSessionTime = (wchar_t*)mir_alloc(lenn*sizeof(wchar_t));
mir_sntprintf(szSessionTime, lenn, L"%s - %s", szTimeBuf, szDateBuf);
char szSetting[256];
mir_snprintf(szSetting, "%s_%d", "SessionDate", 0);
- TCHAR *ptszSaveSessionDate = db_get_tsa(NULL, MODNAME, szSetting);
+ wchar_t *ptszSaveSessionDate = db_get_tsa(NULL, MODNAME, szSetting);
db_set_ts(NULL, MODNAME, szSetting, szSessionTime);
mir_free(szSessionTime);
@@ -507,14 +507,14 @@ int SaveSessionDate()
return 0;
}
-int SaveUserSessionName(TCHAR *szUSessionName)
+int SaveUserSessionName(wchar_t *szUSessionName)
{
if (session_list[0] == 0)
return 1;
char szSetting[256];
mir_snprintf(szSetting, "%s_%u", "UserSessionDsc", 0);
- TCHAR *ptszUserSessionName = db_get_tsa(NULL, MODNAME, szSetting);
+ wchar_t *ptszUserSessionName = db_get_tsa(NULL, MODNAME, szSetting);
if (ptszUserSessionName)
ResaveSettings("UserSessionDsc", 1, 255, ptszUserSessionName);
@@ -789,7 +789,7 @@ static int PluginInit(WPARAM, LPARAM)
// Main menu
CMenuItem mi;
mi.position = 1000000000;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Sessions Manager"), 1000000000);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Sessions Manager"), 1000000000);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "D77B9AB4-AF7E-43DB-A487-BD581704D635");
SET_UID(mi, 0xd35302fa, 0x8326, 0x4323, 0xa3, 0xe5, 0xb4, 0x41, 0xff, 0xfb, 0xaa, 0x2d);
diff --git a/plugins/Sessions/Src/Options.cpp b/plugins/Sessions/Src/Options.cpp
index 7df7a2b1f9..6f98c5a005 100644
--- a/plugins/Sessions/Src/Options.cpp
+++ b/plugins/Sessions/Src/Options.cpp
@@ -334,7 +334,7 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l
EnableWindow(GetDlgItem(hdlg, IDC_DEL), FALSE);
//EnableWindow(GetDlgItem(hdlg,IDC_SAVE),TRUE);
SetDlgItemText(hdlg, IDC_EDIT, TranslateT("View"));
- hOpClistControl = CreateWindowEx(WS_EX_STATICEDGE, _T(CLISTCONTROL_CLASS), L"",
+ hOpClistControl = CreateWindowEx(WS_EX_STATICEDGE, CLISTCONTROL_CLASSW, L"",
WS_TABSTOP | WS_VISIBLE | WS_CHILD,
14, 198, 161, 163, hdlg, (HMENU)IDC_EMCLIST, g_hInst, 0);
@@ -376,7 +376,7 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l
}
if (bSesssionNameChanged) {
if (GetWindowTextLength(hComboBoxEdit)) {
- TCHAR szUserSessionName[MAX_PATH] = { '\0' };
+ wchar_t szUserSessionName[MAX_PATH] = { '\0' };
GetWindowText(hComboBoxEdit, szUserSessionName, _countof(szUserSessionName));
RenameUserDefSession(opses_count, szUserSessionName);
SendDlgItemMessage(hdlg, IDC_LIST, CB_RESETCONTENT, 0, 0);
diff --git a/plugins/Sessions/Src/Utils.cpp b/plugins/Sessions/Src/Utils.cpp
index 1672a81dda..5b0fe2e88a 100644
--- a/plugins/Sessions/Src/Utils.cpp
+++ b/plugins/Sessions/Src/Utils.cpp
@@ -222,7 +222,7 @@ void SetInSessionOrder(MCONTACT hContact, int mode, int count, unsigned int orde
}
}
-BOOL ResaveSettings(char *szName, int iFirst, int iLimit, TCHAR *szBuffer)
+BOOL ResaveSettings(char *szName, int iFirst, int iLimit, wchar_t *szBuffer)
{
for (int i = iFirst; i < iLimit; i++) {
if (szBuffer == NULL)
@@ -231,7 +231,7 @@ BOOL ResaveSettings(char *szName, int iFirst, int iLimit, TCHAR *szBuffer)
char szNameBuf[256];
mir_snprintf(szNameBuf, "%s_%u", szName, i);
- TCHAR *ptszTemp = db_get_tsa(NULL, MODNAME, szNameBuf);
+ wchar_t *ptszTemp = db_get_tsa(NULL, MODNAME, szNameBuf);
db_set_ts(NULL, MODNAME, szNameBuf, szBuffer);
mir_free(szBuffer);
@@ -298,7 +298,7 @@ int LoadSessionToCombobox(HWND hdlg, BOOL mode, int iLimit, char* pszSetting, in
for (int i = 0; i < iLimit; i++) {
mir_snprintf(szBuffer, "%s_%u", pszSetting, i);
- TCHAR *pszBuffer = db_get_tsa(NULL, MODNAME, szBuffer);
+ wchar_t *pszBuffer = db_get_tsa(NULL, MODNAME, szBuffer);
if (pszBuffer) {
if (!IsMarkedUserDefSession(i + iFirstNum) || mode == 1) {
index = SendDlgItemMessage(hdlg, IDC_LIST, CB_ADDSTRING, 0, (LPARAM)pszBuffer);
@@ -327,7 +327,7 @@ int FillFavoritesMenu(HMENU hMenu, int iLimit)
if (IsMarkedUserDefSession(i)) {
char szBuffer[256];
mir_snprintf(szBuffer, "%s_%u", "UserSessionDsc", i);
- TCHAR *pszBuffer = db_get_tsa(NULL, MODNAME, szBuffer);
+ wchar_t *pszBuffer = db_get_tsa(NULL, MODNAME, szBuffer);
if (pszBuffer) {
AppendMenu(hMenu, MF_STRING, i + 1, pszBuffer);
iItems++;
@@ -358,7 +358,7 @@ int CheckContactVisibility(MCONTACT hContact)
return !db_get_b(hContact, "CList", "Hidden", 0);
}
-void RenameUserDefSession(int ses_count, TCHAR* ptszNewName)
+void RenameUserDefSession(int ses_count, wchar_t* ptszNewName)
{
char szSession[256];
mir_snprintf(szSession, "%s_%u", "UserSessionDsc", ses_count);
diff --git a/plugins/Sessions/Src/Utils.h b/plugins/Sessions/Src/Utils.h
index ed1a8fd000..c474393433 100644
--- a/plugins/Sessions/Src/Utils.h
+++ b/plugins/Sessions/Src/Utils.h
@@ -30,7 +30,7 @@ bool LoadContactsFromMask(MCONTACT hContact, int mode, int count);
int AddToCurSession(MCONTACT hContact, LPARAM lparam);
int DelFromCurSession(MCONTACT hContact,LPARAM lparam);
int CheckForDuplicate(MCONTACT contact_list[], MCONTACT lparam);
-BOOL ResaveSettings(char* szName,int iFirst,int iLimit,TCHAR* pszPrevSetting);
+BOOL ResaveSettings(char* szName,int iFirst,int iLimit,wchar_t* pszPrevSetting);
void OffsetWindow(HWND parent, HWND hwnd, int dx, int dy);
int LoadSessionToCombobox (HWND hdlg,BOOL mode,int iLimit,char* pszSetting,int iFirstNum);
int MarkUserDefSession(int ses_count,BYTE bCheck);
@@ -38,7 +38,7 @@ BYTE IsMarkedUserDefSession(int ses_count);
void SavePosition(HWND hWnd, char *wndName);
void LoadPosition(HWND hWnd, char *wndName);
int CheckContactVisibility(MCONTACT hContact);
-void RenameUserDefSession(int ses_count,TCHAR* ptszNewName);
+void RenameUserDefSession(int ses_count,wchar_t* ptszNewName);
int FillFavoritesMenu (HMENU hMenu,int iLimit);
#endif // __UTILS_H__ \ No newline at end of file
diff --git a/plugins/Sessions/Src/stdafx.h b/plugins/Sessions/Src/stdafx.h
index b193b5c79e..d6cad97c92 100644
--- a/plugins/Sessions/Src/stdafx.h
+++ b/plugins/Sessions/Src/stdafx.h
@@ -55,7 +55,7 @@ int DeleteAutoSession(int ses_count);
int LoadSession(WPARAM, LPARAM);
int SaveSessionHandles(WPARAM, LPARAM);
INT_PTR SaveUserSessionHandles(WPARAM, LPARAM);
-int SaveUserSessionName(TCHAR*);
+int SaveUserSessionName(wchar_t*);
INT_PTR CloseCurrentSession(WPARAM, LPARAM);
int SaveSessionDate();
diff --git a/plugins/ShellExt/src/main.cpp b/plugins/ShellExt/src/main.cpp
index 83d5842fb2..1c16adb12d 100644
--- a/plugins/ShellExt/src/main.cpp
+++ b/plugins/ShellExt/src/main.cpp
@@ -6,7 +6,7 @@ HINSTANCE hInst;
int hLangpack;
bool bIsVistaPlus;
-TCHAR tszLogPath[MAX_PATH];
+wchar_t tszLogPath[MAX_PATH];
PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
@@ -28,7 +28,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID)
bIsVistaPlus = GetProcAddress( GetModuleHandleA("kernel32.dll"), "GetProductInfo") != NULL;
GetTempPath(_countof(tszLogPath), tszLogPath);
- _tcscat_s(tszLogPath, _countof(tszLogPath), L"shlext.log");
+ wcscat_s(tszLogPath, _countof(tszLogPath), L"shlext.log");
hInst = hinstDLL;
DisableThreadLibraryCalls(hinstDLL);
@@ -83,7 +83,7 @@ STDAPI DllCanUnloadNow()
struct HRegKey
{
- HRegKey(HKEY hRoot, const TCHAR *ptszKey) : m_key(NULL)
+ HRegKey(HKEY hRoot, const wchar_t *ptszKey) : m_key(NULL)
{ RegCreateKeyEx(hRoot, ptszKey, 0, 0, 0, KEY_SET_VALUE | KEY_CREATE_SUB_KEY, 0, &m_key, 0);
}
@@ -127,9 +127,9 @@ STDAPI DllRegisterServer()
if (kInprocServer == NULL)
return E_FAIL;
- TCHAR tszFileName[MAX_PATH];
+ wchar_t tszFileName[MAX_PATH];
GetModuleFileName(hInst, tszFileName, _countof(tszFileName));
- if ( RegSetValueEx(kInprocServer, NULL, 0, REG_SZ, (LPBYTE)tszFileName, sizeof(TCHAR)*(lstrlen(tszFileName)+1)))
+ if ( RegSetValueEx(kInprocServer, NULL, 0, REG_SZ, (LPBYTE)tszFileName, sizeof(wchar_t)*(lstrlen(tszFileName)+1)))
return E_FAIL;
if ( RegSetValueExA(kInprocServer, "ThreadingModel", 0, REG_SZ, (PBYTE)str4, sizeof(str4)))
return E_FAIL;
diff --git a/plugins/ShellExt/src/options.cpp b/plugins/ShellExt/src/options.cpp
index 0a0c837ee4..e052f2fda7 100644
--- a/plugins/ShellExt/src/options.cpp
+++ b/plugins/ShellExt/src/options.cpp
@@ -7,7 +7,7 @@ static void AutoSize(HWND hwnd)
HFONT hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
HFONT hOldFont = (HFONT)SelectObject(hDC, hFont);
- TCHAR szBuf[MAX_PATH];
+ wchar_t szBuf[MAX_PATH];
int i = GetWindowText(hwnd, szBuf, _countof(szBuf));
SIZE tS;
@@ -20,16 +20,16 @@ static void AutoSize(HWND hwnd)
////////////////////////////////////////////////////////////////////////////////////////////
-static TCHAR* COM_OKSTR[2] = {
- LPGENT("Problem, registration missing/deleted."),
- LPGENT("Successfully created shell registration.") };
-static TCHAR* COM_APPROVEDSTR[2] = { LPGENT("Not Approved"), LPGENT("Approved") };
+static wchar_t* COM_OKSTR[2] = {
+ LPGENW("Problem, registration missing/deleted."),
+ LPGENW("Successfully created shell registration.") };
+static wchar_t* COM_APPROVEDSTR[2] = { LPGENW("Not Approved"), LPGENW("Approved") };
static void InitControls(HWND hwndDlg)
{
int comReg = IsCOMRegistered();
- TCHAR szBuf[MAX_PATH];
+ wchar_t szBuf[MAX_PATH];
mir_sntprintf(szBuf, L"%s (%s)",
TranslateTS(COM_OKSTR[(comReg & COMREG_OK) != 0]),
TranslateTS(COM_APPROVEDSTR[(comReg & COMREG_APPROVED) != 0]));
diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp
index 17915853ec..f711fb1512 100644
--- a/plugins/ShellExt/src/shlcom.cpp
+++ b/plugins/ShellExt/src/shlcom.cpp
@@ -550,7 +550,7 @@ void CheckUnregisterServer()
{
if (bIsVistaPlus) {
// launches regsvr to remove the dll under admin.
- TCHAR szFileName[MAX_PATH], szBuf[MAX_PATH * 2];
+ wchar_t szFileName[MAX_PATH], szBuf[MAX_PATH * 2];
GetModuleFileName(hInst, szFileName, _countof(szFileName));
mir_sntprintf(szBuf, L"/s /u \"%s\"", szFileName);
@@ -570,7 +570,7 @@ void CheckUnregisterServer()
// for permission before installing the shell extension. note the filepath arg has to be quoted }
void CheckRegisterServer()
{
- TCHAR szFileName[MAX_PATH], szBuf[MAX_PATH * 2];
+ wchar_t szFileName[MAX_PATH], szBuf[MAX_PATH * 2];
HKEY hRegKey;
if (!RegOpenKeyEx(HKEY_CLASSES_ROOT, L"miranda.shlext", 0, KEY_READ, &hRegKey))
diff --git a/plugins/ShellExt/src/utils.cpp b/plugins/ShellExt/src/utils.cpp
index 834850073d..275224388e 100644
--- a/plugins/ShellExt/src/utils.cpp
+++ b/plugins/ShellExt/src/utils.cpp
@@ -1,11 +1,11 @@
#include "stdafx.h"
#ifdef LOG_ENABLED
-extern TCHAR tszLogPath[];
+extern wchar_t tszLogPath[];
void logA(const char *format, ...)
{
- FILE *out = _tfopen(tszLogPath, L"a+");
+ FILE *out = _wfopen(tszLogPath, L"a+");
if (out) {
va_list args;
va_start(args, format);
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp
index 917ab2ae7d..451539ba83 100644
--- a/plugins/SimpleAR/src/Main.cpp
+++ b/plugins/SimpleAR/src/Main.cpp
@@ -24,13 +24,13 @@ BOOL gbVarsServiceExist = FALSE;
INT interval;
int hLangpack;
-TCHAR* ptszDefaultMsg[] = {
- LPGENT("I am currently away. I will reply to you when I am back."),
- LPGENT("I am currently very busy and can't spare any time to talk with you. Sorry..."),
- LPGENT("I am not available right now."),
- LPGENT("I am now doing something, I will talk to you later."),
- LPGENT("I am on the phone right now. I will get back to you very soon."),
- LPGENT("I am having meal right now. I will get back to you very soon.")
+wchar_t* ptszDefaultMsg[] = {
+ LPGENW("I am currently away. I will reply to you when I am back."),
+ LPGENW("I am currently very busy and can't spare any time to talk with you. Sorry..."),
+ LPGENW("I am not available right now."),
+ LPGENW("I am now doing something, I will talk to you later."),
+ LPGENW("I am on the phone right now. I will get back to you very soon."),
+ LPGENW("I am having meal right now. I will get back to you very soon.")
};
PLUGININFOEX pluginInfoEx = {
@@ -64,9 +64,9 @@ INT_PTR ToggleEnable(WPARAM, LPARAM)
db_set_b(NULL, protocolname, KEY_ENABLED, fEnabled);
if (fEnabled)
- Menu_ModifyItem(hEnableMenu, LPGENT("Disable Auto&reply"), iconList[0].hIcolib);
+ Menu_ModifyItem(hEnableMenu, LPGENW("Disable Auto&reply"), iconList[0].hIcolib);
else
- Menu_ModifyItem(hEnableMenu, LPGENT("Enable Auto&reply"), iconList[1].hIcolib);
+ Menu_ModifyItem(hEnableMenu, LPGENW("Enable Auto&reply"), iconList[1].hIcolib);
return 0;
}
@@ -77,9 +77,9 @@ INT_PTR Toggle(WPARAM hContact, LPARAM)
on = !on;
if (on)
- Menu_ModifyItem(hToggle, LPGENT("Turn off Autoanswer"), iconList[0].hIcolib);
+ Menu_ModifyItem(hToggle, LPGENW("Turn off Autoanswer"), iconList[0].hIcolib);
else
- Menu_ModifyItem(hToggle, LPGENT("Turn on Autoanswer"), iconList[1].hIcolib);
+ Menu_ModifyItem(hToggle, LPGENW("Turn on Autoanswer"), iconList[1].hIcolib);
return 0;
}
@@ -87,9 +87,9 @@ INT OnPreBuildContactMenu(WPARAM hContact, LPARAM)
{
BOOL on = !db_get_b(hContact, protocolname, "TurnedOn", 0);
if (on)
- Menu_ModifyItem(hToggle, LPGENT("Turn off Autoanswer"), iconList[0].hIcolib);
+ Menu_ModifyItem(hToggle, LPGENW("Turn off Autoanswer"), iconList[0].hIcolib);
else
- Menu_ModifyItem(hToggle, LPGENT("Turn on Autoanswer"), iconList[1].hIcolib);
+ Menu_ModifyItem(hToggle, LPGENW("Turn on Autoanswer"), iconList[1].hIcolib);
return 0;
}
@@ -97,7 +97,7 @@ INT CheckDefaults(WPARAM, LPARAM)
{
interval = db_get_w(NULL, protocolname, KEY_REPEATINTERVAL, 300);
- TCHAR *ptszVal = db_get_tsa(NULL, protocolname, KEY_HEADING);
+ wchar_t *ptszVal = db_get_tsa(NULL, protocolname, KEY_HEADING);
if (ptszVal == 0)
// Heading not set
db_set_ts(NULL, protocolname, KEY_HEADING, TranslateT("Dear %user%, the owner left the following message:"));
@@ -112,7 +112,7 @@ INT CheckDefaults(WPARAM, LPARAM)
mir_snprintf(szStatus, "%d", c);
ptszVal = db_get_tsa(NULL, protocolname, szStatus);
if (ptszVal == 0) {
- TCHAR *ptszDefault;
+ wchar_t *ptszDefault;
if (c < ID_STATUS_FREECHAT)
// This mode does not have a preset message
ptszDefault = ptszDefaultMsg[c - ID_STATUS_ONLINE - 1];
@@ -133,9 +133,9 @@ INT CheckDefaults(WPARAM, LPARAM)
BOOL fEnabled = db_get_b(NULL, protocolname, KEY_ENABLED, 1);
if (fEnabled)
- Menu_ModifyItem(hEnableMenu, LPGENT("Disable Auto&reply"), iconList[0].hIcolib);
+ Menu_ModifyItem(hEnableMenu, LPGENW("Disable Auto&reply"), iconList[0].hIcolib);
else
- Menu_ModifyItem(hEnableMenu, LPGENT("Enable Auto&reply"), iconList[1].hIcolib);
+ Menu_ModifyItem(hEnableMenu, LPGENW("Enable Auto&reply"), iconList[1].hIcolib);
return 0;
}
@@ -164,7 +164,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent)
if (!dbei.cbBlob) /// invalid size
return FALSE;
- TCHAR *ptszVal = db_get_tsa(hContact, "Protocol", "p");
+ wchar_t *ptszVal = db_get_tsa(hContact, "Protocol", "p");
if (ptszVal == NULL) // Contact with no protocol ?!!
return FALSE;
mir_free(ptszVal);
@@ -190,7 +190,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent)
if (*ptszVal) {
CMString ptszTemp;
- TCHAR *ptszNick = db_get_tsa(hContact, pszProto, "Nick");
+ wchar_t *ptszNick = db_get_tsa(hContact, pszProto, "Nick");
if (ptszNick == 0) {
mir_free(ptszVal);
return FALSE;
@@ -198,7 +198,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent)
msgLen += mir_tstrlen(ptszVal);
- TCHAR *ptszHead = db_get_tsa(NULL, protocolname, KEY_HEADING);
+ wchar_t *ptszHead = db_get_tsa(NULL, protocolname, KEY_HEADING);
if (ptszHead != NULL) {
ptszTemp = ptszHead;
ptszTemp.Replace(L"%user%", ptszNick);
@@ -206,7 +206,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent)
mir_free(ptszHead);
}
- TCHAR *ptszTemp2 = (TCHAR*)mir_alloc(sizeof(TCHAR) * (msgLen + 5));
+ wchar_t *ptszTemp2 = (wchar_t*)mir_alloc(sizeof(wchar_t) * (msgLen + 5));
mir_sntprintf(ptszTemp2, msgLen + 5, L"%s\r\n\r\n%s", ptszTemp.c_str(), ptszVal);
if (ServiceExists(MS_VARS_FORMATSTRING)) {
ptszTemp = variables_parse(ptszTemp2, 0, hContact);
@@ -241,8 +241,8 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent)
IconItemT iconList[] =
{
- { LPGENT("Disable Auto&reply"), "Disable Auto&reply", IDI_OFF },
- { LPGENT("Enable Auto&reply"), "Enable Auto&reply", IDI_ON }
+ { LPGENW("Disable Auto&reply"), "Disable Auto&reply", IDI_OFF },
+ { LPGENW("Enable Auto&reply"), "Enable Auto&reply", IDI_ON }
};
extern "C" int __declspec(dllexport)Load(void)
@@ -257,13 +257,13 @@ extern "C" int __declspec(dllexport)Load(void)
SET_UID(mi, 0xac1c64a, 0x82ca, 0x4845, 0x86, 0x89, 0x59, 0x76, 0x12, 0x74, 0x72, 0x7b);
mi.position = 500090000;
- mi.name.t = L"";
+ mi.name.w = L"";
mi.pszService = protocolname"/ToggleEnable";
hEnableMenu = Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0xb290cccd, 0x4ecc, 0x475e, 0x87, 0xcb, 0x51, 0xf4, 0x3b, 0xc3, 0x44, 0x9c);
mi.position = -0x7FFFFFFF;
- mi.name.t = L"";
+ mi.name.w = L"";
mi.pszService = protocolname"/ToggleAutoanswer";
hToggle = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/SimpleAR/src/Options.cpp b/plugins/SimpleAR/src/Options.cpp
index 038988fe43..59dbbe5ad6 100644
--- a/plugins/SimpleAR/src/Options.cpp
+++ b/plugins/SimpleAR/src/Options.cpp
@@ -1,6 +1,6 @@
#include "stdafx.h"
-TCHAR* ptszMessage[6]={0};
+wchar_t* ptszMessage[6]={0};
INT lastIndex=-1;
INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -22,7 +22,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
for (INT c = ID_STATUS_ONLINE; c < ID_STATUS_IDLE; c++) {
mir_snprintf(tszStatus, "%d", c);
- TCHAR *pszStatus = pcli->pfnGetStatusModeDescription(c, 0);
+ wchar_t *pszStatus = pcli->pfnGetStatusModeDescription(c, 0);
if (c == ID_STATUS_ONLINE || c == ID_STATUS_FREECHAT || c == ID_STATUS_INVISIBLE)
continue;
else {
@@ -30,9 +30,9 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
if (!db_get_ts(NULL, protocolname, tszStatus, &dbv)) {
if (c < ID_STATUS_FREECHAT)
- ptszMessage[c - ID_STATUS_ONLINE - 1] = _tcsdup(dbv.ptszVal);
+ ptszMessage[c - ID_STATUS_ONLINE - 1] = wcsdup(dbv.ptszVal);
else if (c > ID_STATUS_INVISIBLE)
- ptszMessage[c - ID_STATUS_ONLINE - 3] = _tcsdup(dbv.ptszVal);
+ ptszMessage[c - ID_STATUS_ONLINE - 3] = wcsdup(dbv.ptszVal);
db_free(&dbv);
}
}
@@ -76,16 +76,16 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- TCHAR ptszText[1024];
+ wchar_t ptszText[1024];
BOOL translated;
BOOL fEnabled = IsDlgButtonChecked(hwndDlg, IDC_ENABLEREPLIER) == 1;
db_set_b(NULL, protocolname, KEY_ENABLED, (BYTE)fEnabled);
if (fEnabled)
- Menu_ModifyItem(hEnableMenu, LPGENT("Disable Auto&reply"), iconList[0].hIcolib);
+ Menu_ModifyItem(hEnableMenu, LPGENW("Disable Auto&reply"), iconList[0].hIcolib);
else
- Menu_ModifyItem(hEnableMenu, LPGENT("Enable Auto&reply"), iconList[1].hIcolib);
+ Menu_ModifyItem(hEnableMenu, LPGENW("Enable Auto&reply"), iconList[1].hIcolib);
GetDlgItemText(hwndDlg, IDC_HEADING, ptszText, _countof(ptszText));
db_set_ts(NULL, protocolname, KEY_HEADING, ptszText);
diff --git a/plugins/SimpleAR/src/stdafx.h b/plugins/SimpleAR/src/stdafx.h
index 1994df2a7c..ff19f084ef 100644
--- a/plugins/SimpleAR/src/stdafx.h
+++ b/plugins/SimpleAR/src/stdafx.h
@@ -23,7 +23,7 @@
//General
extern HINSTANCE hinstance;
extern INT interval;
-extern TCHAR *ptszDefaultMsg[6];
+extern wchar_t *ptszDefaultMsg[6];
extern HGENMENU hEnableMenu;
extern IconItemT iconList[];
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp
index c8b0f37e56..dc3896efa3 100644
--- a/plugins/SimpleStatusMsg/src/awaymsg.cpp
+++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp
@@ -30,7 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
static HGENMENU hAwayMsgMenuItem, hCopyMsgMenuItem, hGoToURLMenuItem;
static MWindowList hWindowList, hWindowList2;
-static TCHAR *StrNormNewline(TCHAR *tszStr)
+static wchar_t *StrNormNewline(wchar_t *tszStr)
{
if (tszStr == NULL)
return NULL;
@@ -43,7 +43,7 @@ static TCHAR *StrNormNewline(TCHAR *tszStr)
if (!nCR)
return mir_tstrdup(tszStr);
- TCHAR *tszNewStr = (TCHAR *)mir_alloc((mir_tstrlen(tszStr) + nCR + 1) * sizeof(TCHAR)), *ptszStr = tszNewStr;
+ wchar_t *tszNewStr = (wchar_t *)mir_alloc((mir_tstrlen(tszStr) + nCR + 1) * sizeof(wchar_t)), *ptszStr = tszNewStr;
while (*tszStr) {
if (*tszStr == 0x0A)
*ptszStr++ = 0x0D;
@@ -79,11 +79,11 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP
dat->hAwayMsgEvent = dat->hSeq ? HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_AWAYMSG) : NULL;
WindowList_Add(hWindowList, hwndDlg, dat->hContact);
{
- TCHAR str[256], format[128];
- TCHAR *contactName = (TCHAR *)pcli->pfnGetContactDisplayName(dat->hContact, 0);
+ wchar_t str[256], format[128];
+ wchar_t *contactName = (wchar_t *)pcli->pfnGetContactDisplayName(dat->hContact, 0);
char *szProto = GetContactProto(dat->hContact);
WORD dwStatus = db_get_w(dat->hContact, szProto, "Status", ID_STATUS_OFFLINE);
- TCHAR *status = pcli->pfnGetStatusModeDescription(dwStatus, 0);
+ wchar_t *status = pcli->pfnGetStatusModeDescription(dwStatus, 0);
GetWindowText(hwndDlg, format, _countof(format));
mir_sntprintf(str, format, status, contactName);
@@ -115,7 +115,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP
dat->hAwayMsgEvent = NULL;
}
- TCHAR *tszMsg = StrNormNewline((TCHAR *)ack->lParam);
+ wchar_t *tszMsg = StrNormNewline((wchar_t *)ack->lParam);
SetDlgItemText(hwndDlg, IDC_MSG, tszMsg);
mir_free(tszMsg);
@@ -138,18 +138,18 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP
if (!OpenClipboard(hwndDlg))
break;
if (EmptyClipboard()) {
- TCHAR msg[1024];
+ wchar_t msg[1024];
int len = GetDlgItemText(hwndDlg, IDC_MSG, msg, _countof(msg));
if (len) {
LPTSTR lptstrCopy;
- HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(TCHAR));
+ HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(wchar_t));
if (hglbCopy == NULL) {
CloseClipboard();
break;
}
lptstrCopy = (LPTSTR)GlobalLock(hglbCopy);
- memcpy(lptstrCopy, msg, len * sizeof(TCHAR));
- lptstrCopy[len] = (TCHAR)0;
+ memcpy(lptstrCopy, msg, len * sizeof(wchar_t));
+ lptstrCopy[len] = (wchar_t)0;
GlobalUnlock(hglbCopy);
SetClipboardData(CF_UNICODETEXT, hglbCopy);
@@ -202,8 +202,8 @@ static INT_PTR CALLBACK CopyAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP
dat->hSeq = (HANDLE)ProtoChainSend(dat->hContact, PSS_GETAWAYMSG, 0, 0);
dat->hAwayMsgEvent = dat->hSeq ? HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_AWAYMSG) : NULL;
WindowList_Add(hWindowList2, hwndDlg, dat->hContact);
- TCHAR *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
- TCHAR str[256], format[128];
+ wchar_t *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
+ wchar_t str[256], format[128];
GetWindowText(hwndDlg, format, _countof(format));
mir_sntprintf(str, format, contactName);
SetWindowText(hwndDlg, str);
@@ -233,22 +233,22 @@ static INT_PTR CALLBACK CopyAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP
break;
}
if (EmptyClipboard()) {
- TCHAR msg[1024];
- TCHAR *tszMsg = StrNormNewline((TCHAR *)ack->lParam);
- _tcsncpy_s(msg, tszMsg, _TRUNCATE);
+ wchar_t msg[1024];
+ wchar_t *tszMsg = StrNormNewline((wchar_t *)ack->lParam);
+ wcsncpy_s(msg, tszMsg, _TRUNCATE);
mir_free(tszMsg);
size_t len = mir_tstrlen(msg);
if (len) {
LPTSTR lptstrCopy;
- HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(TCHAR));
+ HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(wchar_t));
if (hglbCopy == NULL) {
CloseClipboard();
DestroyWindow(hwndDlg);
break;
}
lptstrCopy = (LPTSTR)GlobalLock(hglbCopy);
- memcpy(lptstrCopy, msg, len * sizeof(TCHAR));
- lptstrCopy[len] = (TCHAR)0;
+ memcpy(lptstrCopy, msg, len * sizeof(wchar_t));
+ lptstrCopy[len] = (wchar_t)0;
GlobalUnlock(hglbCopy);
SetClipboardData(CF_UNICODETEXT, hglbCopy);
@@ -339,7 +339,7 @@ static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM)
if (szProto == NULL || db_get_b(hContact, szProto, "ChatRoom", 0))
return 0;
- TCHAR str[128];
+ wchar_t str[128];
int iStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGRECV) {
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iStatus == ID_STATUS_OFFLINE ? ID_STATUS_INVISIBLE : iStatus)) {
@@ -388,7 +388,7 @@ int LoadAwayMsgModule(void)
SET_UID(mi, 0xd3282acc, 0x9ff1, 0x4ede, 0x8a, 0x1e, 0x36, 0x72, 0x3f, 0x44, 0x4f, 0x84);
CreateServiceFunction(MS_AWAYMSG_SHOWAWAYMSG, GetMessageCommand);
mi.position = -2000005000;
- mi.name.t = LPGENT("Re&ad Away message");
+ mi.name.w = LPGENW("Re&ad Away message");
mi.pszService = MS_AWAYMSG_SHOWAWAYMSG;
hAwayMsgMenuItem = Menu_AddContactMenuItem(&mi);
@@ -396,7 +396,7 @@ int LoadAwayMsgModule(void)
CreateServiceFunction(MS_SIMPLESTATUSMSG_COPYMSG, CopyAwayMsgCommand);
mi.position = -2000006000;
mi.hIcolibItem = GetIconHandle(IDI_COPY);
- mi.name.t = LPGENT("Copy Away message");
+ mi.name.w = LPGENW("Copy Away message");
mi.pszService = MS_SIMPLESTATUSMSG_COPYMSG;
hCopyMsgMenuItem = Menu_AddContactMenuItem(&mi);
@@ -404,7 +404,7 @@ int LoadAwayMsgModule(void)
CreateServiceFunction(MS_SIMPLESTATUSMSG_GOTOURLMSG, GoToURLMsgCommand);
mi.position = -2000007000;
mi.hIcolibItem = GetIconHandle(IDI_GOTOURL);
- mi.name.t = LPGENT("&Go to URL in Away message");
+ mi.name.w = LPGENW("&Go to URL in Away message");
mi.pszService = MS_SIMPLESTATUSMSG_GOTOURLMSG;
hGoToURLMenuItem = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp
index 5bcc8ea109..942eaa19a5 100644
--- a/plugins/SimpleStatusMsg/src/main.cpp
+++ b/plugins/SimpleStatusMsg/src/main.cpp
@@ -28,7 +28,7 @@ PROTOACCOUNTS *accounts;
static int g_iIdleTime = -1;
UINT_PTR g_uUpdateMsgTimer = 0, *g_uSetStatusTimer;
-static TCHAR *g_ptszWinampSong;
+static wchar_t *g_ptszWinampSong;
HANDLE hTTBButton = 0, h_statusmodechange;
HWND hwndSAMsgDialog;
static HANDLE *hProtoStatusMenuItem;
@@ -90,9 +90,9 @@ void log2file(const char *fmt, ...)
}
#endif
-static TCHAR *GetWinampSong(void)
+static wchar_t *GetWinampSong(void)
{
- TCHAR *szTitle, *pstr, *res = NULL;
+ wchar_t *szTitle, *pstr, *res = NULL;
HWND hwndWinamp = FindWindow(L"STUDIO", NULL);
int iTitleLen;
@@ -103,7 +103,7 @@ static TCHAR *GetWinampSong(void)
return NULL;
iTitleLen = GetWindowTextLength(hwndWinamp);
- szTitle = (TCHAR *)mir_alloc((iTitleLen + 1) * sizeof(TCHAR));
+ szTitle = (wchar_t *)mir_alloc((iTitleLen + 1) * sizeof(wchar_t));
if (szTitle == NULL)
return NULL;
@@ -113,7 +113,7 @@ static TCHAR *GetWinampSong(void)
return NULL;
}
- pstr = _tcsstr(szTitle, L" - Winamp");
+ pstr = wcsstr(szTitle, L" - Winamp");
if (pstr == NULL)
{
mir_free(szTitle);
@@ -122,8 +122,8 @@ static TCHAR *GetWinampSong(void)
if (pstr < szTitle + (iTitleLen / 2))
{
- memmove(szTitle, pstr + 9, mir_tstrlen(pstr + 9) * sizeof(TCHAR));
- pstr = _tcsstr(pstr + 1, L" - Winamp");
+ memmove(szTitle, pstr + 9, mir_tstrlen(pstr + 9) * sizeof(wchar_t));
+ pstr = wcsstr(pstr + 1, L" - Winamp");
if (pstr == NULL)
{
mir_free(szTitle);
@@ -132,7 +132,7 @@ static TCHAR *GetWinampSong(void)
}
*pstr = 0;
- pstr = _tcschr(szTitle, _T('.'));
+ pstr = wcschr(szTitle, '.');
if (pstr == NULL)
{
mir_free(szTitle);
@@ -146,16 +146,16 @@ static TCHAR *GetWinampSong(void)
return res;
}
-TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int)
+wchar_t* InsertBuiltinVarsIntoMsg(wchar_t *in, const char *szProto, int)
{
int i, count = 0, len;
- TCHAR substituteStr[1024], *msg = mir_tstrdup(in);
+ wchar_t substituteStr[1024], *msg = mir_tstrdup(in);
for (i = 0; msg[i]; i++)
{
if (msg[i] == 0x0D && db_get_b(NULL, "SimpleStatusMsg", "RemoveCR", 0))
{
- TCHAR *p = msg + i;
+ wchar_t *p = msg + i;
if (i + 1 <= 1024 && msg[i + 1])
{
if (msg[i + 1] == 0x0A)
@@ -163,7 +163,7 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int)
if (i + 2 <= 1024 && msg[i + 2])
{
count++;
- memmove(p, p + 1, (mir_tstrlen(p) - 1) * sizeof(TCHAR));
+ memmove(p, p + 1, (mir_tstrlen(p) - 1) * sizeof(wchar_t));
}
else
{
@@ -177,9 +177,9 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int)
if (msg[i] != '%')
continue;
- if (!_tcsnicmp(msg+i, L"%winampsong%", 12))
+ if (!wcsnicmp(msg+i, L"%winampsong%", 12))
{
- TCHAR *ptszWinampTitle = GetWinampSong();
+ wchar_t *ptszWinampTitle = GetWinampSong();
if (ptszWinampTitle != NULL)
{
@@ -195,14 +195,14 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int)
continue;
if (mir_tstrlen(ptszWinampTitle) > 12)
- msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(ptszWinampTitle) - 12) * sizeof(TCHAR));
+ msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(ptszWinampTitle) - 12) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(ptszWinampTitle), msg + i + 12, (mir_tstrlen(msg) - i - 11) * sizeof(TCHAR));
- memcpy(msg + i, ptszWinampTitle, mir_tstrlen(ptszWinampTitle) * sizeof(TCHAR));
+ memmove(msg + i + mir_tstrlen(ptszWinampTitle), msg + i + 12, (mir_tstrlen(msg) - i - 11) * sizeof(wchar_t));
+ memcpy(msg + i, ptszWinampTitle, mir_tstrlen(ptszWinampTitle) * sizeof(wchar_t));
mir_free(ptszWinampTitle);
}
- else if (!_tcsnicmp(msg + i, L"%time%", 6))
+ else if (!wcsnicmp(msg + i, L"%time%", 6))
{
MIRANDA_IDLE_INFO mii = {0};
mii.cbSize = sizeof(mii);
@@ -230,31 +230,31 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int)
else GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, NULL, NULL, substituteStr, _countof(substituteStr));
if (mir_tstrlen(substituteStr) > 6)
- msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(TCHAR));
+ msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 6, (mir_tstrlen(msg) - i - 5) * sizeof(TCHAR));
- memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
+ memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 6, (mir_tstrlen(msg) - i - 5) * sizeof(wchar_t));
+ memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
}
- else if (!_tcsnicmp(msg + i, L"%date%", 6))
+ else if (!wcsnicmp(msg + i, L"%date%", 6))
{
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, substituteStr, _countof(substituteStr));
if (mir_tstrlen(substituteStr) > 6)
- msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(TCHAR));
+ msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 6, (mir_tstrlen(msg) - i - 5) * sizeof(TCHAR));
- memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
+ memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 6, (mir_tstrlen(msg) - i - 5) * sizeof(wchar_t));
+ memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
}
- else if (!_tcsnicmp(msg+i, L"%rand(", 6))
+ else if (!wcsnicmp(msg+i, L"%rand(", 6))
{
- TCHAR *temp, *token;
+ wchar_t *temp, *token;
int ran_from, ran_to, k;
temp = mir_tstrdup(msg + i + 6);
- token = _tcstok(temp, L",)");
- ran_from = _ttoi(token);
- token = _tcstok(NULL, L",)%%");
- ran_to = _ttoi(token);
+ token = wcstok(temp, L",)");
+ ran_from = _wtoi(token);
+ token = wcstok(NULL, L",)%%");
+ ran_to = _wtoi(token);
if (ran_to > ran_from)
{
@@ -262,14 +262,14 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int)
for (k = i + 1; msg[k]; k++) if (msg[k] == '%') { k++; break; }
if (mir_tstrlen(substituteStr) > k - i)
- msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - (k - i)) * sizeof(TCHAR));
+ msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - (k - i)) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(substituteStr), msg + i + (k - i), (mir_tstrlen(msg) - i - (k - i - 1)) * sizeof(TCHAR));
- memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
+ memmove(msg + i + mir_tstrlen(substituteStr), msg + i + (k - i), (mir_tstrlen(msg) - i - (k - i - 1)) * sizeof(wchar_t));
+ memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
}
mir_free(temp);
}
- else if (!_tcsnicmp(msg+i, L"%randmsg%", 9))
+ else if (!wcsnicmp(msg+i, L"%randmsg%", 9))
{
char buff[16];
int k, k2 = 0;
@@ -289,7 +289,7 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int)
mir_snprintf(buff, "SMsg%d", k);
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
if (tszStatusMsg == NULL)
continue;
@@ -299,7 +299,7 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int)
if (!mir_tstrlen(substituteStr))
continue;
- if (_tcsstr(substituteStr, L"%randmsg%") != NULL || _tcsstr(substituteStr, L"%randdefmsg%") != NULL)
+ if (wcsstr(substituteStr, L"%randmsg%") != NULL || wcsstr(substituteStr, L"%randdefmsg%") != NULL)
{
if (k == maxk) maxk--;
}
@@ -309,12 +309,12 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int)
if (k2 == maxk || k2 > maxk) mir_tstrcpy(substituteStr, L"");
if (mir_tstrlen(substituteStr) > 9)
- msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 9) * sizeof(TCHAR));
+ msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 9) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 9, (mir_tstrlen(msg) - i - 8) * sizeof(TCHAR));
- memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
+ memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 9, (mir_tstrlen(msg) - i - 8) * sizeof(wchar_t));
+ memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
}
- else if (!_tcsnicmp(msg+i, L"%randdefmsg%", 12))
+ else if (!wcsnicmp(msg+i, L"%randdefmsg%", 12))
{
char buff[16];
int k, k2 = 0;
@@ -334,7 +334,7 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int)
mir_snprintf(buff, "DefMsg%d", k);
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
if (tszStatusMsg == NULL)
continue;
@@ -344,7 +344,7 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int)
if (!mir_tstrlen(substituteStr))
continue;
- if (_tcsstr(substituteStr, L"%randmsg%") != NULL || _tcsstr(substituteStr, L"%randdefmsg%") != NULL)
+ if (wcsstr(substituteStr, L"%randmsg%") != NULL || wcsstr(substituteStr, L"%randdefmsg%") != NULL)
{
if (k == maxk) maxk--;
}
@@ -354,10 +354,10 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int)
if (k2 == maxk || k2 > maxk) mir_tstrcpy(substituteStr, L"");
if (mir_tstrlen(substituteStr) > 12)
- msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg)+1+mir_tstrlen(substituteStr)-12) * sizeof(TCHAR));
+ msg = (wchar_t *)mir_realloc(msg, (mir_tstrlen(msg)+1+mir_tstrlen(substituteStr)-12) * sizeof(wchar_t));
- memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 12, (mir_tstrlen(msg) - i - 11) * sizeof(TCHAR));
- memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
+ memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 12, (mir_tstrlen(msg) - i - 11) * sizeof(wchar_t));
+ memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
}
}
@@ -370,7 +370,7 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int)
len = db_get_w(NULL, "SimpleStatusMsg", szSetting, 1024);
if (len < mir_tstrlen(msg))
{
- msg = (TCHAR *)mir_realloc(msg, len * sizeof(TCHAR));
+ msg = (wchar_t *)mir_realloc(msg, len * sizeof(wchar_t));
msg[len] = 0;
}
}
@@ -378,14 +378,14 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int)
return msg;
}
-TCHAR *InsertVarsIntoMsg(TCHAR *tszMsg, const char *szProto, int iStatus, MCONTACT hContact)
+wchar_t *InsertVarsIntoMsg(wchar_t *tszMsg, const char *szProto, int iStatus, MCONTACT hContact)
{
if (ServiceExists(MS_VARS_FORMATSTRING) && db_get_b(NULL, "SimpleStatusMsg", "EnableVariables", 1))
{
- TCHAR *tszVarsMsg = variables_parse(tszMsg, NULL, hContact);
+ wchar_t *tszVarsMsg = variables_parse(tszMsg, NULL, hContact);
if (tszVarsMsg != NULL)
{
- TCHAR *format = InsertBuiltinVarsIntoMsg(tszVarsMsg, szProto, iStatus);
+ wchar_t *format = InsertBuiltinVarsIntoMsg(tszVarsMsg, szProto, iStatus);
mir_free(tszVarsMsg);
return format;
}
@@ -394,10 +394,10 @@ TCHAR *InsertVarsIntoMsg(TCHAR *tszMsg, const char *szProto, int iStatus, MCONTA
return InsertBuiltinVarsIntoMsg(tszMsg, szProto, iStatus);
}
-static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto)
+static wchar_t *GetAwayMessageFormat(int iStatus, const char *szProto)
{
char szSetting[80];
- TCHAR *format;
+ wchar_t *format;
mir_snprintf(szSetting, "%sFlags", szProto ? szProto : "");
int flags = db_get_b(NULL, "SimpleStatusMsg", StatusModeToDbSetting(iStatus, szSetting), STATUS_DEFAULT);
@@ -446,7 +446,7 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto)
return format;
}
-void DBWriteMessage(char *szSetting, TCHAR *tszMsg)
+void DBWriteMessage(char *szSetting, wchar_t *tszMsg)
{
if (tszMsg && mir_tstrlen(tszMsg))
db_set_ts(NULL, "SimpleStatusMsg", szSetting, tszMsg);
@@ -454,7 +454,7 @@ void DBWriteMessage(char *szSetting, TCHAR *tszMsg)
db_unset(NULL, "SimpleStatusMsg", szSetting);
}
-void SaveMessageToDB(const char *szProto, TCHAR *tszMsg, BOOL bIsFormat)
+void SaveMessageToDB(const char *szProto, wchar_t *tszMsg, BOOL bIsFormat)
{
char szSetting[80];
@@ -504,9 +504,9 @@ void SaveStatusAsCurrent(const char *szProto, int iStatus)
db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)iStatus);
}
-static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, MCONTACT hContact)
+static wchar_t *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, MCONTACT hContact)
{
- TCHAR *format;
+ wchar_t *format;
char szSetting[80];
if ((!iStatus || iStatus == ID_STATUS_CURRENT) && szProto)
@@ -553,7 +553,7 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars,
if (bInsertVars && format != NULL)
{
- TCHAR *tszVarsMsg = InsertVarsIntoMsg(format, szProto, iStatus, hContact); // TODO random values not the same!
+ wchar_t *tszVarsMsg = InsertVarsIntoMsg(format, szProto, iStatus, hContact); // TODO random values not the same!
mir_free(format);
return tszVarsMsg;
}
@@ -583,13 +583,13 @@ int CheckProtoSettings(const char *szProto, int iInitialStatus)
return iInitialStatus;
}
-static void Proto_SetAwayMsgT(const char *szProto, int iStatus, TCHAR *tszMsg)
+static void Proto_SetAwayMsgT(const char *szProto, int iStatus, wchar_t *tszMsg)
{
if (!(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_INDIVMODEMSG))
CallProtoService(szProto, PS_SETAWAYMSG, (WPARAM)iStatus, (LPARAM)tszMsg);
}
-static void Proto_SetStatus(const char *szProto, int iInitialStatus, int iStatus, TCHAR *tszMsg)
+static void Proto_SetStatus(const char *szProto, int iInitialStatus, int iStatus, wchar_t *tszMsg)
{
if (iStatus == ID_STATUS_OFFLINE && iStatus != iInitialStatus)
{
@@ -627,11 +627,11 @@ int HasProtoStaticStatusMsg(const char *szProto, int iInitialStatus, int iStatus
else if (flags & PROTO_THIS_MSG)
{
mir_snprintf(szSetting, "Proto%sDefault", szProto);
- TCHAR *szSimpleStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *szSimpleStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
if (szSimpleStatusMsg != NULL)
{
SaveMessageToDB(szProto, szSimpleStatusMsg, TRUE);
- TCHAR *msg = InsertVarsIntoMsg(szSimpleStatusMsg, szProto, iStatus, NULL);
+ wchar_t *msg = InsertVarsIntoMsg(szSimpleStatusMsg, szProto, iStatus, NULL);
mir_free(szSimpleStatusMsg);
Proto_SetStatus(szProto, iInitialStatus, iStatus, msg);
SaveMessageToDB(szProto, msg, FALSE);
@@ -679,15 +679,15 @@ INT_PTR SetStatusModeFromExtern(WPARAM wParam, LPARAM lParam)
if ((Proto_Status2Flag(newStatus) & status_modes_msg) || (newStatus == ID_STATUS_OFFLINE && (Proto_Status2Flag(ID_STATUS_INVISIBLE) & status_modes_msg)))
{
- TCHAR *msg = NULL;
+ wchar_t *msg = NULL;
if (HasProtoStaticStatusMsg(accounts->pa[i]->szModuleName, GetCurrentStatus(accounts->pa[i]->szModuleName), newStatus))
continue;
if (lParam)
- msg = InsertVarsIntoMsg((TCHAR *)lParam, accounts->pa[i]->szModuleName, newStatus, NULL);
+ msg = InsertVarsIntoMsg((wchar_t *)lParam, accounts->pa[i]->szModuleName, newStatus, NULL);
- SaveMessageToDB(accounts->pa[i]->szModuleName, (TCHAR *)lParam, TRUE);
+ SaveMessageToDB(accounts->pa[i]->szModuleName, (wchar_t *)lParam, TRUE);
SaveMessageToDB(accounts->pa[i]->szModuleName, msg, FALSE);
Proto_SetStatus(accounts->pa[i]->szModuleName, GetCurrentStatus(accounts->pa[i]->szModuleName), newStatus, msg /*? msg : L""*/);
mir_free(msg);
@@ -701,9 +701,9 @@ INT_PTR SetStatusModeFromExtern(WPARAM wParam, LPARAM lParam)
int ChangeStatusMessage(WPARAM wParam, LPARAM lParam);
-void SetStatusMessage(const char *szProto, int iInitialStatus, int iStatus, TCHAR *message, BOOL bOnStartup)
+void SetStatusMessage(const char *szProto, int iInitialStatus, int iStatus, wchar_t *message, BOOL bOnStartup)
{
- TCHAR *msg = NULL;
+ wchar_t *msg = NULL;
#ifdef _DEBUG
log2file("SetStatusMessage(\"%s\", %d, %d, \"%S\", %d)", szProto, iInitialStatus, iStatus, message, bOnStartup);
#endif
@@ -1012,7 +1012,7 @@ int ChangeStatusMessage(WPARAM wParam, LPARAM lParam)
}
else if (iProtoFlags & PROTO_NOCHANGE && !bOnStartup) {
mir_snprintf(szSetting, "FCur%sMsg", szProto);
- TCHAR *msg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *msg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
#ifdef _DEBUG
log2file("ChangeStatusMessage(): Set %s status and \"%S\" status message for %s.", StatusModeToDbSetting(iStatus, ""), msg, szProto);
@@ -1023,7 +1023,7 @@ int ChangeStatusMessage(WPARAM wParam, LPARAM lParam)
}
if (!bShowDlg || bScreenSaverRunning) {
- TCHAR *msg = GetAwayMessageFormat(iStatus, szProto);
+ wchar_t *msg = GetAwayMessageFormat(iStatus, szProto);
#ifdef _DEBUG
log2file("ChangeStatusMessage(): Set %s status and \"%S\" status message for %s.", StatusModeToDbSetting(iStatus, ""), msg, szProto);
#endif
@@ -1073,7 +1073,7 @@ int ChangeStatusMessage(WPARAM wParam, LPARAM lParam)
!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
- TCHAR *msg;
+ wchar_t *msg;
if (iProtoFlags & PROTO_NOCHANGE) {
mir_snprintf(szSetting, "FCur%sMsg", accounts->pa[i]->szModuleName);
msg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
@@ -1134,7 +1134,7 @@ static int ProcessProtoAck(WPARAM , LPARAM lParam)
int SetStartupStatus(int i)
{
char szSetting[80];
- TCHAR *fmsg, *msg = NULL;
+ wchar_t *fmsg, *msg = NULL;
int iStatus = GetStartupStatus(accounts->pa[i]->szModuleName);
if (iStatus == ID_STATUS_OFFLINE)
@@ -1277,7 +1277,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND, UINT, UINT_PTR, DWORD)
if (!hwndSAMsgDialog)
{
char szBuffer[64];
- TCHAR *tszMsg;
+ wchar_t *tszMsg;
int iCurrentStatus;
for (int i = 0; i < accounts->count; ++i)
@@ -1296,7 +1296,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND, UINT, UINT_PTR, DWORD)
continue;
mir_snprintf(szBuffer, "FCur%sMsg", accounts->pa[i]->szModuleName);
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szBuffer);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szBuffer);
if (tszStatusMsg == NULL)
continue;
@@ -1348,8 +1348,8 @@ void RegisterHotkey(void)
hkd.cbSize = sizeof(hkd);
hkd.dwFlags = HKD_TCHAR;
hkd.pszName = "SimpleStatusMsg_OpenDialog";
- hkd.ptszDescription = LPGENT("Open status message dialog");
- hkd.ptszSection = LPGENT("Status message");
+ hkd.ptszDescription = LPGENW("Open status message dialog");
+ hkd.ptszSection = LPGENW("Status message");
hkd.pszService = MS_SIMPLESTATUSMSG_SHOWDIALOGINT;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, VK_OEM_3);
Hotkey_Register(&hkd);
@@ -1389,7 +1389,7 @@ static int ChangeStatusMsgPrebuild(WPARAM, LPARAM)
mi.flags |= CMIF_HIDDEN;
mi.hIcolibItem = GetIconHandle(IDI_CSMSG);
mi.pszService = MS_SIMPLESTATUSMSG_SHOWDIALOGINT;
- mi.name.t = LPGENT("Status message...");
+ mi.name.w = LPGENW("Status message...");
mi.position = 2000200000;
Menu_AddStatusMenuItem(&mi);
@@ -1418,7 +1418,7 @@ static int ChangeStatusMsgPrebuild(WPARAM, LPARAM)
if (Proto_IsAccountLocked(pa[i]))
{
- TCHAR szBuffer[256];
+ wchar_t szBuffer[256];
mir_sntprintf(szBuffer, TranslateT("%s (locked)"), pa[i]->tszAccountName);
mi.root = Menu_CreateRoot(MO_STATUS, szBuffer, mi.position);
}
@@ -1477,8 +1477,8 @@ static int OnIdleChanged(WPARAM, LPARAM lParam)
{
if (!(lParam & IDF_ISIDLE))
iStatus = ID_STATUS_ONLINE;
- TCHAR *tszMsg = GetAwayMessage(iStatus, accounts->pa[i]->szModuleName, FALSE, NULL);
- TCHAR *tszVarsMsg = InsertVarsIntoMsg(tszMsg, accounts->pa[i]->szModuleName, iStatus, NULL);
+ wchar_t *tszMsg = GetAwayMessage(iStatus, accounts->pa[i]->szModuleName, FALSE, NULL);
+ wchar_t *tszVarsMsg = InsertVarsIntoMsg(tszMsg, accounts->pa[i]->szModuleName, iStatus, NULL);
SaveMessageToDB(accounts->pa[i]->szModuleName, tszMsg, TRUE);
SaveMessageToDB(accounts->pa[i]->szModuleName, tszVarsMsg, FALSE);
mir_free(tszMsg);
@@ -1494,7 +1494,7 @@ static int CSStatusChange(WPARAM wParam, LPARAM)
PROTOCOLSETTINGEX **ps = *(PROTOCOLSETTINGEX***)wParam;
int status_mode, CSProtoCount;
char szSetting[80];
- TCHAR *msg = NULL;
+ wchar_t *msg = NULL;
if (ps == NULL) return -1;
@@ -1530,7 +1530,7 @@ static int CSStatusChange(WPARAM wParam, LPARAM)
for (int j = 1; j <= max_hist_msgs; j++)
{
mir_snprintf(buff, "SMsg%d", j);
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
if (tszStatusMsg != NULL)
{
if (!mir_tstrcmp(tszStatusMsg, szMsgW))
@@ -1568,13 +1568,13 @@ static int CSStatusChange(WPARAM wParam, LPARAM)
return 0;
}
-static TCHAR *ParseWinampSong(ARGUMENTSINFO *ai)
+static wchar_t *ParseWinampSong(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
ai->flags |= AIF_DONTPARSE;
- TCHAR *ptszWinampTitle = GetWinampSong();
+ wchar_t *ptszWinampTitle = GetWinampSong();
if (ptszWinampTitle != NULL) {
mir_free(g_ptszWinampSong);
@@ -1586,12 +1586,12 @@ static TCHAR *ParseWinampSong(ARGUMENTSINFO *ai)
return ptszWinampTitle;
}
-static TCHAR *ParseDate(ARGUMENTSINFO *ai)
+static wchar_t *ParseDate(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
- TCHAR szStr[128] = {0};
+ wchar_t szStr[128] = {0};
ai->flags |= AIF_DONTPARSE;
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, szStr, _countof(szStr));
@@ -1634,7 +1634,7 @@ static int OnICQStatusMsgRequest(WPARAM wParam, LPARAM lParam, LPARAM lMirParam)
return 0;
int iStatus = ICQMsgTypeToStatus(wParam);
- TCHAR *tszMsg = GetAwayMessage(iStatus, szProto, TRUE, hContact);
+ wchar_t *tszMsg = GetAwayMessage(iStatus, szProto, TRUE, hContact);
Proto_SetAwayMsgT(szProto, iStatus, tszMsg);
mir_free(tszMsg);
diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp
index c6099f9aef..6162d10dbe 100644
--- a/plugins/SimpleStatusMsg/src/msgbox.cpp
+++ b/plugins/SimpleStatusMsg/src/msgbox.cpp
@@ -99,7 +99,7 @@ HIMAGELIST AddStatusIconsToImageList(const char *szProto, int status_flags)
HWND WINAPI CreateStatusComboBoxEx(HWND hwndDlg, struct MsgBoxData *data)
{
int j = 0, cur_sel = 0;
- TCHAR *status_desc;
+ wchar_t *status_desc;
if (!(data->m_iDlgFlags & DLG_SHOW_STATUS))
return NULL;
@@ -115,9 +115,9 @@ HWND WINAPI CreateStatusComboBoxEx(HWND hwndDlg, struct MsgBoxData *data)
cbei.mask = CBEIF_LPARAM | CBEIF_TEXT | CBEIF_IMAGE | CBEIF_SELECTEDIMAGE;
if (data->m_bOnStartup)
- status_desc = (TCHAR *)TranslateT("<startup>");
+ status_desc = (wchar_t *)TranslateT("<startup>");
else
- status_desc = (TCHAR *)TranslateT("<current>");
+ status_desc = (wchar_t *)TranslateT("<current>");
cbei.iItem = j;
cbei.pszText = (LPTSTR)status_desc;
@@ -171,7 +171,7 @@ HWND WINAPI CreateStatusComboBoxEx(HWND hwndDlg, struct MsgBoxData *data)
int profileCount = (int)CallService(MS_SS_GETPROFILECOUNT, (WPARAM)&defaultProfile, 0);
for (int i = 0; i < profileCount; ++i) {
- TCHAR tszProfileName[128];
+ wchar_t tszProfileName[128];
CallService(MS_SS_GETPROFILENAME, (WPARAM)i, (LPARAM)tszProfileName);
cbei.iItem = j;
@@ -217,7 +217,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data)
{
char buff[16];
BOOL found = FALSE;
- TCHAR text[128];
+ wchar_t text[128];
HWND handle = CreateWindowEx(0, WC_COMBOBOXEX, NULL,
WS_TABSTOP | CBS_NOINTEGRALHEIGHT | WS_VISIBLE | WS_CHILD | CBS_DROPDOWNLIST,
@@ -238,7 +238,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data)
mir_snprintf(buff, "SMsg%d", j);
j--;
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
if (tszStatusMsg != NULL) {
if (*tszStatusMsg != '\0') {
found = TRUE;
@@ -332,7 +332,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data)
for (int i = 1; i <= data->num_def_msgs; ++i) {
// predefined messages
mir_snprintf(buff, "DefMsg%d", i);
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
if (tszStatusMsg != NULL) {
if (*tszStatusMsg != '\0') {
cbei.iItem = -1;
@@ -465,20 +465,20 @@ VOID APIENTRY HandlePopupMenu(HWND hwnd, POINT pt, HWND edit_control)
break;
if (EmptyClipboard()) {
- TCHAR item_string[128];
+ wchar_t item_string[128];
GetMenuString(hmenu, m_selection, (LPTSTR)&item_string, 128, MF_BYCOMMAND);
int len = (int)mir_tstrlen(item_string);
if (len) {
LPTSTR lptstrCopy;
- HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(TCHAR));
+ HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(wchar_t));
if (hglbCopy == NULL) {
CloseClipboard();
break;
}
lptstrCopy = (LPTSTR)GlobalLock(hglbCopy);
- memcpy(lptstrCopy, item_string, len * sizeof(TCHAR));
- lptstrCopy[len] = (TCHAR)0;
+ memcpy(lptstrCopy, item_string, len * sizeof(wchar_t));
+ lptstrCopy[len] = (wchar_t)0;
GlobalUnlock(hglbCopy);
SetClipboardData(CF_UNICODETEXT, hglbCopy);
@@ -531,15 +531,15 @@ static LRESULT CALLBACK EditBoxSubProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
}
if (wParam == 127 && GetKeyState(VK_CONTROL) & 0x8000) { // Ctrl + Backspace
DWORD start, end;
- TCHAR *text;
+ wchar_t *text;
int textLen;
SendMessage(hwndDlg, EM_GETSEL, (WPARAM)&end, NULL);
SendMessage(hwndDlg, WM_KEYDOWN, VK_LEFT, 0);
SendMessage(hwndDlg, EM_GETSEL, (WPARAM)&start, NULL);
textLen = GetWindowTextLength(hwndDlg);
- text = (TCHAR *)mir_alloc(sizeof(TCHAR) * (textLen + 1));
+ text = (wchar_t *)mir_alloc(sizeof(wchar_t) * (textLen + 1));
GetWindowText(hwndDlg, text, textLen + 1);
- memmove(text + start, text + end, sizeof(TCHAR) * (textLen + 1 - end));
+ memmove(text + start, text + end, sizeof(wchar_t) * (textLen + 1 - end));
SetWindowText(hwndDlg, text);
mir_free(text);
SendMessage(hwndDlg, EM_SETSEL, start, start);
@@ -593,7 +593,7 @@ int AddToPredefined(HWND hwndDlg, struct MsgBoxData *data)
{
COMBOBOXEXITEM newitem = {0};
int len = 0, num_items;
- TCHAR msg[1024], text[1024];
+ wchar_t msg[1024], text[1024];
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_EDIT1)))
len = GetDlgItemText(hwndDlg, IDC_EDIT1, msg, _countof(msg));
@@ -676,8 +676,8 @@ void ClearHistory(struct MsgBoxData *data, int cur_sel)
void DisplayCharsCount(struct MsgBoxData *dlg_data, HWND hwndDlg)
{
- TCHAR msg[1024];
- TCHAR status_text[128];
+ wchar_t msg[1024];
+ wchar_t status_text[128];
int len, lines = 1;
if (dlg_data->m_iCountdown != -2)
@@ -716,7 +716,7 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus)
char *szSetting = db_get_sa(NULL, "SimpleStatusMsg", setting);
if (szSetting != NULL) {
if (*szSetting != '\0') {
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
if (tszStatusMsg != NULL) {
if (*tszStatusMsg != '\0') {
SetDlgItemText(hwndDlg, IDC_EDIT1, tszStatusMsg);
@@ -745,7 +745,7 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus)
else
mir_snprintf(setting, "Default");
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting));
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting));
if (tszStatusMsg != NULL) {
SetDlgItemText(hwndDlg, IDC_EDIT1, tszStatusMsg);
fcursel = SendMessage(data->recent_cbex, CB_FINDSTRINGEXACT, num_start, (LPARAM)tszStatusMsg);
@@ -760,7 +760,7 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus)
else
mir_snprintf(setting, "Msg");
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting));
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting));
if (tszStatusMsg != NULL) {
SetDlgItemText(hwndDlg, IDC_EDIT1, tszStatusMsg);
fcursel = SendMessage(data->recent_cbex, CB_FINDSTRINGEXACT, num_start, (LPARAM)tszStatusMsg);
@@ -776,7 +776,7 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus)
void ChangeDlgStatus(HWND hwndDlg, struct MsgBoxData *msgbox_data, int iStatus)
{
- TCHAR szTitle[256], szProtoName[128];
+ wchar_t szTitle[256], szProtoName[128];
BOOL bDisabled = msgbox_data->m_szProto && !(CallProtoService(msgbox_data->m_szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND);
mir_sntprintf(szProtoName, msgbox_data->m_szProto ? Proto_GetAccount(msgbox_data->m_szProto)->tszAccountName : TranslateT("global"));
@@ -787,7 +787,7 @@ void ChangeDlgStatus(HWND hwndDlg, struct MsgBoxData *msgbox_data, int iStatus)
mir_sntprintf(szTitle, TranslateT("%s message (%s)"), TranslateT("<current>"), szProtoName);
}
else if (iStatus > ID_STATUS_CURRENT) {
- TCHAR buff[128];
+ wchar_t buff[128];
char buff1[128];
CallService(MS_SS_GETPROFILENAME, iStatus - 40083, (LPARAM)buff1);
@@ -812,7 +812,7 @@ void ChangeDlgStatus(HWND hwndDlg, struct MsgBoxData *msgbox_data, int iStatus)
{
int num_items = SendMessage(msgbox_data->recent_cbex, CB_GETCOUNT, 0, 0);
int fcursel = CB_ERR, num_start = num_items - msgbox_data->num_def_msgs - 1;
- TCHAR msg[1024];
+ wchar_t msg[1024];
if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_EDIT1)))
EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT1), TRUE);
@@ -890,7 +890,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
switch (uMsg) {
case WM_INITDIALOG:
{
- TCHAR szTitle[256], szFormat[256], szProtoName[128];
+ wchar_t szTitle[256], szFormat[256], szProtoName[128];
struct MsgBoxInitData *init_data;
struct MsgBoxData *copy_init_data;
INITCOMMONCONTROLSEX icex = {0};
@@ -997,7 +997,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
SetEditControlText(copy_init_data, hwndDlg, copy_init_data->m_iStatus);
if ((copy_init_data->m_iDlgFlags & DLG_SHOW_BUTTONS) || (copy_init_data->m_iDlgFlags & DLG_SHOW_BUTTONS_FLAT)) {
- TCHAR msg[1024];
+ wchar_t msg[1024];
if (!GetDlgItemText(hwndDlg, IDC_EDIT1, msg, _countof(msg)))
EnableWindow(GetDlgItem(hwndDlg, IDC_BADD), FALSE);
@@ -1096,7 +1096,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
break;
}
else {
- TCHAR str[64];
+ wchar_t str[64];
mir_sntprintf(str, TranslateT("Closing in %d"), msgbox_data->m_iCountdown);
SetDlgItemText(hwndDlg, IDC_OK, str);
}
@@ -1107,7 +1107,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
switch (LOWORD(wParam)) {
case IDC_OK:
{
- TCHAR tszMsg[1024];
+ wchar_t tszMsg[1024];
int iStatus, iMsgLen = 0, iProfileStatus = 0;
BOOL bCurrentStatus = FALSE;
@@ -1172,7 +1172,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
for (int i = 1; i <= msgbox_data->max_hist_msgs; i++) {
mir_snprintf(buff, "SMsg%d", i);
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", buff);
if (tszStatusMsg != NULL) {
if (!mir_tstrcmp(tszStatusMsg, tszMsg)) {
found = true;
@@ -1285,7 +1285,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
DisplayCharsCount(msgbox_data, hwndDlg);
SendMessage(msgbox_data->recent_cbex, CB_SETCURSEL, -1, 0);
if ((msgbox_data->m_iDlgFlags & DLG_SHOW_BUTTONS) || (msgbox_data->m_iDlgFlags & DLG_SHOW_BUTTONS_FLAT)) {
- TCHAR msg[1024];
+ wchar_t msg[1024];
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_BDEL)))
EnableWindow(GetDlgItem(hwndDlg, IDC_BDEL), FALSE);
@@ -1337,7 +1337,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
switch (HIWORD(wParam)) {
case CBN_SELENDOK:
{
- TCHAR text[1024];
+ wchar_t text[1024];
int cur_sel = SendMessage(msgbox_data->recent_cbex, CB_GETCURSEL, 0, 0);
COMBOBOXEXITEM cbitem = {0};
@@ -1366,7 +1366,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
if (MessageBox(NULL, TranslateT("Are you sure you want to clear status message history?"), TranslateT("Confirm clearing history"), MB_ICONQUESTION | MB_YESNO) == IDYES)
ClearHistory(msgbox_data, cur_sel);
else if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_EDIT1))) {
- TCHAR msg[1024];
+ wchar_t msg[1024];
int fcursel = CB_ERR, num_start;
num_start = SendMessage(msgbox_data->recent_cbex, CB_GETCOUNT, 0, 0);
num_start -= msgbox_data->num_def_msgs + 1;
@@ -1518,7 +1518,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
EnableWindow(GetDlgItem(hwndDlg, IDC_BDEL), FALSE);
}
else {
- TCHAR text[1024];
+ wchar_t text[1024];
if (cur_sel - 1 >= 0)
cur_sel--;
@@ -1583,7 +1583,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
if (msgbox_data->m_bPredefChanged) {
int i, num_items, new_num_def_msgs = 0;
COMBOBOXEXITEM cbitem = {0};
- TCHAR text[1024];
+ wchar_t text[1024];
char buff[64];
num_items = SendMessage(msgbox_data->recent_cbex, CB_GETCOUNT, 0, 0);
diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp
index e990901469..e7695ca304 100644
--- a/plugins/SimpleStatusMsg/src/options.cpp
+++ b/plugins/SimpleStatusMsg/src/options.cpp
@@ -61,15 +61,15 @@ static LRESULT CALLBACK OptEditBoxSubProc(HWND hwndDlg, UINT uMsg, WPARAM wParam
if (wParam == 127 && GetKeyState(VK_CONTROL) & 0x8000) // Ctrl + Backspace
{
DWORD start, end;
- TCHAR *text;
+ wchar_t *text;
int textLen;
SendMessage(hwndDlg, EM_GETSEL, (WPARAM)&end, NULL);
SendMessage(hwndDlg, WM_KEYDOWN, VK_LEFT, 0);
SendMessage(hwndDlg, EM_GETSEL, (WPARAM)&start, NULL);
textLen = GetWindowTextLength(hwndDlg);
- text = (TCHAR *)mir_alloc(sizeof(TCHAR) * (textLen + 1));
+ text = (wchar_t *)mir_alloc(sizeof(wchar_t) * (textLen + 1));
GetWindowText(hwndDlg, text, textLen + 1);
- memmove(text + start, text + end, sizeof(TCHAR) * (textLen + 1 - end));
+ memmove(text + start, text + end, sizeof(wchar_t) * (textLen + 1 - end));
SetWindowText(hwndDlg, text);
mir_free(text);
SendMessage(hwndDlg, EM_SETSEL, start, start);
@@ -85,14 +85,14 @@ static LRESULT CALLBACK OptEditBoxSubProc(HWND hwndDlg, UINT uMsg, WPARAM wParam
struct SingleProtoMsg
{
int flags;
- TCHAR *msg;
+ wchar_t *msg;
int max_length;
};
struct SingleStatusMsg
{
int flags[9];
- TCHAR msg[9][1024];
+ wchar_t msg[9][1024];
};
struct OptDlgData
@@ -451,7 +451,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
char *szSetting = db_get_sa(NULL, "SimpleStatusMsg", setting);
if (szSetting)
{
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
if (tszStatusMsg && mir_tstrlen(tszStatusMsg))
{
if (tszStatusMsg && mir_tstrlen(tszStatusMsg))
@@ -489,7 +489,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
else
mir_snprintf(setting, "Msg");
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting));
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting));
if (tszStatusMsg)
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, tszStatusMsg);
@@ -602,7 +602,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
char *szSetting = db_get_sa(NULL, "SimpleStatusMsg", setting);
if (szSetting != NULL)
{
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
if (tszStatusMsg)
{
if (tszStatusMsg[0])
@@ -639,7 +639,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
else
mir_snprintf(setting, "Msg");
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting));
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting));
if (tszStatusMsg != NULL)
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, tszStatusMsg);
@@ -697,7 +697,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
char *szSetting = db_get_sa(NULL, "SimpleStatusMsg", setting);
if (szSetting != NULL)
{
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
if (tszStatusMsg)
{
if (tszStatusMsg[0])
@@ -726,7 +726,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
else
mir_snprintf(setting, "Msg");
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting));
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting));
if (tszStatusMsg != NULL)
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, tszStatusMsg);
@@ -807,7 +807,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
char *szSetting = db_get_sa(NULL, "SimpleStatusMsg", setting);
if (szSetting != NULL)
{
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
if (tszStatusMsg)
{
if (tszStatusMsg[0])
@@ -837,7 +837,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
else
mir_snprintf(setting, "Msg");
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(i + ID_STATUS_ONLINE, setting));
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(i + ID_STATUS_ONLINE, setting));
if (tszStatusMsg != NULL)
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, tszStatusMsg);
@@ -862,7 +862,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
if (HIWORD(wParam) == EN_KILLFOCUS)
{
- TCHAR msg[1024];
+ wchar_t msg[1024];
if (data->proto_msg[j].flags & PROTO_THIS_MSG)
{
@@ -1181,7 +1181,7 @@ static bool IsHistoryMsgsFound(HWND, int histMax)
if (j < 1)
j = histMax;
mir_snprintf(szSetting, "SMsg%d", j);
- TCHAR *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
+ wchar_t *tszStatusMsg = db_get_tsa(NULL, "SimpleStatusMsg", szSetting);
if (tszStatusMsg != NULL) {
if (*tszStatusMsg != '\0') {
mir_free(tszStatusMsg);
@@ -1234,7 +1234,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w
SendDlgItemMessage(hwndDlg, IDC_CBOPTBUTTONS, CB_SETCURSEL, (WPARAM)i_btnhide, 0);
if (!ServiceExists(MS_SS_GETPROFILECOUNT)) {
- TCHAR szText[100];
+ wchar_t szText[100];
mir_sntprintf(szText, L"%s *", TranslateT("Show status profiles in status list"));
SetDlgItemText(hwndDlg, IDC_CPROFILES, szText);
EnableWindow(GetDlgItem(hwndDlg, IDC_CPROFILES), FALSE);
diff --git a/plugins/SimpleStatusMsg/src/simplestatusmsg.h b/plugins/SimpleStatusMsg/src/simplestatusmsg.h
index c1ca255b19..c5fd123b6d 100644
--- a/plugins/SimpleStatusMsg/src/simplestatusmsg.h
+++ b/plugins/SimpleStatusMsg/src/simplestatusmsg.h
@@ -81,7 +81,7 @@ int LoadAwayMsgModule(void);
int AwayMsgPreShutdown(void);
/* main.cpp */
-void SetStatusMessage(const char *szProto, int initial_status_mode, int status_mode, TCHAR *message, BOOL on_startup);
+void SetStatusMessage(const char *szProto, int initial_status_mode, int status_mode, wchar_t *message, BOOL on_startup);
/* msgbox.cpp */
INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
@@ -97,7 +97,7 @@ void ReleaseIconEx(const char* name);
HANDLE HookProtoEvent(const char *szModule, const char *szEvent, MIRANDAHOOKPARAM hookProc);
void UnhookProtoEvents(void);
int GetRandom(int from, int to);
-const TCHAR *GetDefaultMessage(int status);
+const wchar_t *GetDefaultMessage(int status);
const char *StatusModeToDbSetting(int status, const char *suffix);
int GetCurrentStatus(const char *szProto);
int GetStartupStatus(const char *szProto);
diff --git a/plugins/SimpleStatusMsg/src/utils.cpp b/plugins/SimpleStatusMsg/src/utils.cpp
index d27b1ad5ae..f0bbf520b5 100644
--- a/plugins/SimpleStatusMsg/src/utils.cpp
+++ b/plugins/SimpleStatusMsg/src/utils.cpp
@@ -89,7 +89,7 @@ int GetRandom(int from, int to)
}
// From SRAway module
-const TCHAR *GetDefaultMessage(int status)
+const wchar_t *GetDefaultMessage(int status)
{
switch (status) {
case ID_STATUS_AWAY: return TranslateT("I've been away since %time%.");
diff --git a/plugins/SkypeStatusChange/src/main.cpp b/plugins/SkypeStatusChange/src/main.cpp
index fe36751074..a8329b8598 100644
--- a/plugins/SkypeStatusChange/src/main.cpp
+++ b/plugins/SkypeStatusChange/src/main.cpp
@@ -187,12 +187,12 @@ LRESULT APIENTRY SkypeAPI_WindowProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
oCopyData.cbData = cLength + 1;
SendMessage(wndSkypeAPIWindow, WM_COPYDATA, (WPARAM)hWnd, (LPARAM)&oCopyData);
if (g_Options.GetSyncStatusMsgFlag()) {
- TCHAR* pszStatusMsg = NULL;
+ wchar_t* pszStatusMsg = NULL;
if (ProtoServiceExists(si.Module(), PS_GETMYAWAYMSG))
- pszStatusMsg = reinterpret_cast<TCHAR*>(CallProtoService(si.Module(), PS_GETMYAWAYMSG, (WPARAM)ms.m_nMirandaStatus, SGMA_TCHAR));
+ pszStatusMsg = reinterpret_cast<wchar_t*>(CallProtoService(si.Module(), PS_GETMYAWAYMSG, (WPARAM)ms.m_nMirandaStatus, SGMA_TCHAR));
if ((NULL == pszStatusMsg) || (CALLSERVICE_NOTFOUND == INT_PTR(pszStatusMsg)))
- pszStatusMsg = reinterpret_cast<TCHAR*>(CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)ms.m_nMirandaStatus, 0));
+ pszStatusMsg = reinterpret_cast<wchar_t*>(CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)ms.m_nMirandaStatus, 0));
if (pszStatusMsg && reinterpret_cast<LPARAM>(pszStatusMsg) != CALLSERVICE_NOTFOUND) {
T2Utf pMsg(pszStatusMsg);
diff --git a/plugins/SkypeStatusChange/src/options.cpp b/plugins/SkypeStatusChange/src/options.cpp
index a600cb3e12..cb789436a4 100644
--- a/plugins/SkypeStatusChange/src/options.cpp
+++ b/plugins/SkypeStatusChange/src/options.cpp
@@ -26,7 +26,7 @@ enum ETreeCheckBoxState
TCBS_DISABLE_CHECKED = 4,
};
-HTREEITEM tree_insert_item(HWND hwndTree, TCHAR *pName, HTREEITEM htiParent, ETreeCheckBoxState nState, CTreeItemData *pData)
+HTREEITEM tree_insert_item(HWND hwndTree, wchar_t *pName, HTREEITEM htiParent, ETreeCheckBoxState nState, CTreeItemData *pData)
{
TVINSERTSTRUCT tvi = { 0 };
tvi.hParent = htiParent;
diff --git a/plugins/SkypeStatusChange/src/stdafx.h b/plugins/SkypeStatusChange/src/stdafx.h
index 307fa73413..8fc6dec0ea 100644
--- a/plugins/SkypeStatusChange/src/stdafx.h
+++ b/plugins/SkypeStatusChange/src/stdafx.h
@@ -1,6 +1,5 @@
#include <windows.h>
#include <stdio.h>
-#include <tchar.h>
#include <assert.h>
#include <commctrl.h>
diff --git a/plugins/SmileyAdd/src/SmileyBase.cpp b/plugins/SmileyAdd/src/SmileyBase.cpp
index 8d9a58b94f..583396fbe7 100644
--- a/plugins/SmileyAdd/src/SmileyBase.cpp
+++ b/plugins/SmileyAdd/src/SmileyBase.cpp
@@ -91,7 +91,7 @@ void ISmileyBase::SendOnViewChange(void)
}
}
-bool ISmileyBase::QueryHitPointSpecial(int x, int y, HWND hwnd, TCHAR **smltxt)
+bool ISmileyBase::QueryHitPointSpecial(int x, int y, HWND hwnd, wchar_t **smltxt)
{
bool result = m_visible && m_hwnd == hwnd;
if (result)
@@ -101,9 +101,9 @@ bool ISmileyBase::QueryHitPointSpecial(int x, int y, HWND hwnd, TCHAR **smltxt)
return result;
}
-void ISmileyBase::SetHint(TCHAR *smltxt)
+void ISmileyBase::SetHint(wchar_t *smltxt)
{
- m_smltxt = _tcsdup(smltxt);
+ m_smltxt = wcsdup(smltxt);
}
@@ -374,7 +374,7 @@ void CloseSmileys(void)
}
}
-int CheckForTip(int x, int y, HWND hwnd, TCHAR **smltxt)
+int CheckForTip(int x, int y, HWND hwnd, wchar_t **smltxt)
{
for (int i = 0; i < regSmileys.getCount(); i++)
if (regSmileys[i]->QueryHitPointSpecial(x, y, hwnd, smltxt))
diff --git a/plugins/SmileyAdd/src/SmileyBase.h b/plugins/SmileyAdd/src/SmileyBase.h
index 10378a52b3..499e960510 100644
--- a/plugins/SmileyAdd/src/SmileyBase.h
+++ b/plugins/SmileyAdd/src/SmileyBase.h
@@ -39,7 +39,7 @@ class ISmileyBase : public IOleObject, public IViewObject2, public ITooltipData
DWORD m_advf;
LONG m_lRefCount;
- TCHAR* m_smltxt;
+ wchar_t* m_smltxt;
protected:
SIZEL m_sizeExtent;
@@ -56,8 +56,8 @@ public:
virtual void OnClose(void);
void SendOnViewChange(void);
- bool QueryHitPointSpecial(int x, int y, HWND hwnd, TCHAR **smltxt);
- void SetHint(TCHAR *smltxt);
+ bool QueryHitPointSpecial(int x, int y, HWND hwnd, wchar_t **smltxt);
+ void SetHint(wchar_t *smltxt);
virtual void Draw() PURE;
virtual void SetPosition(HWND hwnd, LPCRECT lpRect);
diff --git a/plugins/SmileyAdd/src/customsmiley.cpp b/plugins/SmileyAdd/src/customsmiley.cpp
index 97480911f6..a61a014e9c 100644
--- a/plugins/SmileyAdd/src/customsmiley.cpp
+++ b/plugins/SmileyAdd/src/customsmiley.cpp
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
SmileyPackCListType g_SmileyPackCStore;
-bool SmileyPackCListType::AddSmileyPack(MCONTACT hContact, TCHAR *dir)
+bool SmileyPackCListType::AddSmileyPack(MCONTACT hContact, wchar_t *dir)
{
bool res = true;
if (GetSmileyPack(hContact) == NULL) {
@@ -36,7 +36,7 @@ bool SmileyPackCListType::AddSmileyPack(MCONTACT hContact, TCHAR *dir)
return res;
}
-bool SmileyPackCListType::AddSmiley(MCONTACT hContact, TCHAR *path)
+bool SmileyPackCListType::AddSmiley(MCONTACT hContact, wchar_t *path)
{
SmileyPackCType *smpack = GetSmileyPack(hContact);
if (smpack == NULL) {
@@ -59,7 +59,7 @@ SmileyPackCType* SmileyPackCListType::GetSmileyPack(MCONTACT id)
}
-SmileyCType::SmileyCType(const CMString &fullpath, const TCHAR *filepath)
+SmileyCType::SmileyCType(const CMString &fullpath, const wchar_t *filepath)
{
LoadFromResource(fullpath, 0);
CreateTriggerText(_T2A(filepath));
@@ -78,7 +78,7 @@ bool SmileyCType::CreateTriggerText(char *text)
return false;
char save = res[reslen]; res[reslen] = 0; // safe because of mir_alloc
- TCHAR *txt = mir_utf8decodeT(res);
+ wchar_t *txt = mir_utf8decodeT(res);
res[reslen] = save;
if (txt == NULL)
@@ -93,19 +93,19 @@ bool SmileyCType::CreateTriggerText(char *text)
// SmileyPackCType
//
-bool SmileyPackCType::LoadSmileyDir(TCHAR *dir)
+bool SmileyPackCType::LoadSmileyDir(wchar_t *dir)
{
CMString dirs = dir;
dirs += L"\\*.*";
- _tfinddata_t c_file;
- INT_PTR hFile = _tfindfirst((TCHAR*)dirs.c_str(), &c_file);
+ _wfinddata_t c_file;
+ INT_PTR hFile = _wfindfirst((wchar_t*)dirs.c_str(), &c_file);
if (hFile > -1L) {
do {
if (c_file.name[0] != '.') {
CMString fullpath = dir;
fullpath = fullpath + L"\\" + c_file.name;
- TCHAR *div = _tcsrchr(c_file.name, '.');
+ wchar_t *div = wcsrchr(c_file.name, '.');
if (div) {
*div = 0;
SmileyCType *smlc = new SmileyCType(fullpath, c_file.name);
@@ -115,7 +115,7 @@ bool SmileyPackCType::LoadSmileyDir(TCHAR *dir)
m_SmileyList.insert(smlc);
}
}
- } while (_tfindnext(hFile, &c_file) == 0);
+ } while (_wfindnext(hFile, &c_file) == 0);
_findclose(hFile);
AddTriggersToSmileyLookup();
return true;
@@ -123,7 +123,7 @@ bool SmileyPackCType::LoadSmileyDir(TCHAR *dir)
return false;
}
-bool SmileyPackCType::LoadSmiley(TCHAR *path)
+bool SmileyPackCType::LoadSmiley(wchar_t *path)
{
CMString dirs = path;
int slash = dirs.ReverseFind('\\');
@@ -137,7 +137,7 @@ bool SmileyPackCType::LoadSmiley(TCHAR *path)
return true;
}
- m_SmileyList.insert(new SmileyCType(dirs, (TCHAR*)name.c_str()));
+ m_SmileyList.insert(new SmileyCType(dirs, (wchar_t*)name.c_str()));
CMString empty;
m_SmileyLookup.insert(new SmileyLookup(
diff --git a/plugins/SmileyAdd/src/customsmiley.h b/plugins/SmileyAdd/src/customsmiley.h
index 3517d348cd..b1366e83bc 100644
--- a/plugins/SmileyAdd/src/customsmiley.h
+++ b/plugins/SmileyAdd/src/customsmiley.h
@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
class SmileyCType : public SmileyType
{
public:
- SmileyCType(const CMString &fullpath, const TCHAR *filepath);
+ SmileyCType(const CMString &fullpath, const wchar_t *filepath);
bool CreateTriggerText(char *text);
};
@@ -52,8 +52,8 @@ public:
MCONTACT GetId(void) { return m_id; }
void SetId(MCONTACT id) { m_id = id; }
- bool LoadSmiley(TCHAR *path);
- bool LoadSmileyDir(TCHAR *dir);
+ bool LoadSmiley(wchar_t *path);
+ bool LoadSmileyDir(wchar_t *dir);
};
@@ -68,8 +68,8 @@ private:
public:
int NumberOfSmileyPacks(void) { return m_SmileyPacks.getCount(); }
- bool AddSmiley(MCONTACT hContact, TCHAR *path);
- bool AddSmileyPack(MCONTACT hContact, TCHAR *dir);
+ bool AddSmiley(MCONTACT hContact, wchar_t *path);
+ bool AddSmileyPack(MCONTACT hContact, wchar_t *dir);
void ClearAndFreeAll(void) { m_SmileyPacks.destroy(); }
diff --git a/plugins/SmileyAdd/src/download.cpp b/plugins/SmileyAdd/src/download.cpp
index b015c34603..2f45d51950 100644
--- a/plugins/SmileyAdd/src/download.cpp
+++ b/plugins/SmileyAdd/src/download.cpp
@@ -36,7 +36,7 @@ struct QueueElem
static HANDLE g_hDlMutex;
static OBJLIST<QueueElem> dlQueue(10);
-static TCHAR cachepath[MAX_PATH];
+static wchar_t cachepath[MAX_PATH];
static bool threadRunning;
bool InternetDownloadFile(const char *szUrl, char *szDest, HANDLE &hHttpDwnl)
@@ -131,13 +131,13 @@ void __cdecl SmileyDownloadThread(void*)
WaitForSingleObject(g_hDlMutex, 3000);
while (!Miranda_Terminated() && dlQueue.getCount()) {
ReleaseMutex(g_hDlMutex);
- if (_taccess(dlQueue[0].fname.c_str(), 0) != 0) {
+ if (_waccess(dlQueue[0].fname.c_str(), 0) != 0) {
InternetDownloadFile(_T2A(dlQueue[0].url.c_str()), _T2A(dlQueue[0].fname.c_str()), hHttpDwnl);
WaitForSingleObject(g_hDlMutex, 3000);
CMString fname(dlQueue[0].fname);
if (dlQueue[0].needext) { fname += GetImageExt(fname); needext = true; }
- _trename(dlQueue[0].fname.c_str(), fname.c_str());
+ _wrename(dlQueue[0].fname.c_str(), fname.c_str());
}
else WaitForSingleObject(g_hDlMutex, 3000);
@@ -175,8 +175,8 @@ bool GetSmileyFile(CMString &url, const CMString &packstr)
if (needext)
filename += L".*";
- _tfinddata_t c_file;
- INT_PTR hFile = _tfindfirst((TCHAR*)filename.c_str(), &c_file);
+ _wfinddata_t c_file;
+ INT_PTR hFile = _wfindfirst((wchar_t*)filename.c_str(), &c_file);
if (hFile > -1) {
_findclose(hFile);
filename.Truncate(pathpos);
diff --git a/plugins/SmileyAdd/src/general.cpp b/plugins/SmileyAdd/src/general.cpp
index 5a6b94ca63..0a27734c92 100644
--- a/plugins/SmileyAdd/src/general.cpp
+++ b/plugins/SmileyAdd/src/general.cpp
@@ -59,11 +59,11 @@ HICON GetDefaultIcon(bool copy)
return resIco;
}
-const TCHAR* GetImageExt(CMString &fname)
+const wchar_t* GetImageExt(CMString &fname)
{
- const TCHAR *ext = L"";
+ const wchar_t *ext = L"";
- int fileId = _topen(fname.c_str(), O_RDONLY | _O_BINARY);
+ int fileId = _wopen(fname.c_str(), O_RDONLY | _O_BINARY);
if (fileId != -1) {
BYTE buf[6];
@@ -126,18 +126,18 @@ HICON ImageList_GetIconFixed(HIMAGELIST himl, INT i, UINT fStyle)
void pathToRelative(const CMString &pSrc, CMString &pOut)
{
- TCHAR szOutPath[MAX_PATH];
+ wchar_t szOutPath[MAX_PATH];
PathToRelativeT(pSrc.c_str(), szOutPath);
pOut = szOutPath;
}
void pathToAbsolute(const CMString &pSrc, CMString &pOut)
{
- TCHAR szOutPath[MAX_PATH];
+ wchar_t szOutPath[MAX_PATH];
- TCHAR *szVarPath = Utils_ReplaceVarsT(pSrc.c_str());
- if (szVarPath == (TCHAR*)CALLSERVICE_NOTFOUND || szVarPath == NULL) {
- TCHAR szExpPath[MAX_PATH];
+ wchar_t *szVarPath = Utils_ReplaceVarsT(pSrc.c_str());
+ if (szVarPath == (wchar_t*)CALLSERVICE_NOTFOUND || szVarPath == NULL) {
+ wchar_t szExpPath[MAX_PATH];
ExpandEnvironmentStrings(pSrc.c_str(), szExpPath, _countof(szExpPath));
PathToAbsoluteT(szExpPath, szOutPath);
}
@@ -186,7 +186,7 @@ bool InitGdiPlus(void)
{
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
- static const TCHAR errmsg[] = L"GDI+ not installed.\n"
+ static const wchar_t errmsg[] = L"GDI+ not installed.\n"
L"GDI+ can be downloaded here: http://www.microsoft.com/downloads";
__try {
@@ -227,9 +227,9 @@ bool IsSmileyProto(char *proto)
return proto && mir_strcmp(proto, META_PROTO) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & (PF1_IM | PF1_CHAT));
}
-void ReportError(const TCHAR *errmsg)
+void ReportError(const wchar_t *errmsg)
{
- static const TCHAR title[] = L"Miranda SmileyAdd";
+ static const wchar_t title[] = L"Miranda SmileyAdd";
POPUPDATAT pd = { 0 };
mir_tstrcpy(pd.lpwzContactName, title);
diff --git a/plugins/SmileyAdd/src/imagecache.cpp b/plugins/SmileyAdd/src/imagecache.cpp
index 1592a858fc..6960adff96 100644
--- a/plugins/SmileyAdd/src/imagecache.cpp
+++ b/plugins/SmileyAdd/src/imagecache.cpp
@@ -528,7 +528,7 @@ void DestroyImageCache(void)
ImageBase* AddCacheImage(const CMString &file, int index)
{
CMString tmpfile(file); tmpfile.AppendFormat(L"#%d", index);
- unsigned id = mir_hash(tmpfile.c_str(), tmpfile.GetLength() * sizeof(TCHAR));
+ unsigned id = mir_hash(tmpfile.c_str(), tmpfile.GetLength() * sizeof(wchar_t));
WaitForSingleObject(g_hMutexIm, 3000);
diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp
index 86264d591a..8466424240 100644
--- a/plugins/SmileyAdd/src/options.cpp
+++ b/plugins/SmileyAdd/src/options.cpp
@@ -204,7 +204,7 @@ BOOL OptionsDialogType::DialogProcedure(UINT msg, WPARAM wParam, LPARAM lParam)
void OptionsDialogType::AddCategory(void)
{
- TCHAR cat[30];
+ wchar_t cat[30];
GetDlgItemText(m_hwndDialog, IDC_NEWCATEGORY, cat, _countof(cat));
CMString catd = cat;
@@ -327,7 +327,7 @@ void OptionsDialogType::PopulateSmPackList(void)
SmileyCategoryListType::SmileyCategoryVectorType &smc = *tmpsmcat.GetSmileyCategoryList();
for (int i = 0; i < smc.getCount(); i++) {
if (smc[i].IsVisible()) {
- tvi.item.pszText = (TCHAR*)smc[i].GetDisplayName().c_str();
+ tvi.item.pszText = (wchar_t*)smc[i].GetDisplayName().c_str();
if (!smc[i].IsProto()) {
tvi.item.iImage = 0;
tvi.item.iSelectedImage = 0;
@@ -463,7 +463,7 @@ bool OptionsDialogType::BrowseForSmileyPacks(int item)
{
OPENFILENAME ofn = { 0 };
- TCHAR filename[MAX_PATH] = L"";
+ wchar_t filename[MAX_PATH] = L"";
ofn.lpstrFile = filename;
ofn.nMaxFile = _countof(filename);
@@ -480,7 +480,7 @@ bool OptionsDialogType::BrowseForSmileyPacks(int item)
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = m_hwndDialog;
- TCHAR filter[512], *pfilter;
+ wchar_t filter[512], *pfilter;
mir_tstrcpy(filter, TranslateT("Smiley packs"));
mir_tstrcat(filter, L" (*.msl;*.asl;*.xep)");
pfilter = filter + mir_tstrlen(filter) + 1;
@@ -511,7 +511,7 @@ bool OptionsDialogType::BrowseForSmileyPacks(int item)
void OptionsDialogType::FilenameChanged(void)
{
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
GetDlgItemText(m_hwndDialog, IDC_FILENAME, str, _countof(str));
SmileyCategoryType *smc = tmpsmcat.GetSmileyCategory(GetSelProto());
@@ -593,7 +593,7 @@ void OptionsType::ReadPackFileName(CMString &filename, const CMString &name, con
CMString settingKey = name + L"-filename";
ptrT tszValue(db_get_tsa(NULL, "SmileyAdd", _T2A(settingKey.c_str())));
- filename = (tszValue != NULL) ? (TCHAR*)tszValue : defaultFilename;
+ filename = (tszValue != NULL) ? (wchar_t*)tszValue : defaultFilename;
}
void OptionsType::WritePackFileName(const CMString &filename, const CMString &name)
diff --git a/plugins/SmileyAdd/src/richcall.cpp b/plugins/SmileyAdd/src/richcall.cpp
index 9e994418ea..92a556a81c 100644
--- a/plugins/SmileyAdd/src/richcall.cpp
+++ b/plugins/SmileyAdd/src/richcall.cpp
@@ -97,7 +97,7 @@ static void SetPosition(HWND hwnd)
static void SetTooltip(long x, long y, HWND hwnd, RichEditData *rdt)
{
- TCHAR *smltxt;
+ wchar_t *smltxt;
int needtip = CheckForTip(x, y, hwnd, &smltxt);
if (needtip == rdt->tipActive)
return;
diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp
index c0d453624c..1abad18364 100644
--- a/plugins/SmileyAdd/src/services.cpp
+++ b/plugins/SmileyAdd/src/services.cpp
@@ -301,7 +301,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM)
const int ind = i + 3;
mi.position = ind;
- mi.name.t = (TCHAR*)smc[i].GetDisplayName().c_str();
+ mi.name.w = (wchar_t*)smc[i].GetDisplayName().c_str();
if (cat == smc[i].GetName()) {
mi.flags |= CMIF_CHECKED;
@@ -315,7 +315,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM)
}
mi.position = 1;
- mi.name.t = L"<None>";
+ mi.name.w = L"<None>";
if (cat == L"<None>") {
mi.flags |= CMIF_CHECKED;
nonecheck = false;
@@ -326,7 +326,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM)
menuHandleArray.insert(hMenu);
mi.position = 2;
- mi.name.t = LPGENT("Protocol specific");
+ mi.name.w = LPGENW("Protocol specific");
if (nonecheck) mi.flags |= CMIF_CHECKED; else mi.flags &= ~CMIF_CHECKED;
hMenu = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/SmileyAdd/src/smileyroutines.cpp b/plugins/SmileyAdd/src/smileyroutines.cpp
index d71a91fed0..e6d7dfd7ed 100644
--- a/plugins/SmileyAdd/src/smileyroutines.cpp
+++ b/plugins/SmileyAdd/src/smileyroutines.cpp
@@ -19,6 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
+#include <tchar.h>
+
ISmileyBase* CreateSmileyObject(SmileyType *sml);
ISmileyBase* CreateAniSmileyObject(SmileyType *sml, COLORREF clr, bool ishpp);
@@ -29,7 +31,7 @@ bool g_HiddenTextSupported = true;
const GUID IID_ITextDocument =
{ 0x8CC497C0, 0xA1DF, 0x11CE, { 0x80,0x98,0x00,0xAA,0x00,0x47,0xBE,0x5D } };
-void LookupAllSmileys(SmileyPackType *smileyPack, SmileyPackCType *smileyCPack, const TCHAR *lpstrText, SmileysQueueType &smllist, const bool firstOnly)
+void LookupAllSmileys(SmileyPackType *smileyPack, SmileyPackCType *smileyCPack, const wchar_t *lpstrText, SmileysQueueType &smllist, const bool firstOnly)
{
if (lpstrText == NULL || *lpstrText == 0) return;
@@ -98,20 +100,20 @@ void LookupAllSmileys(SmileyPackType *smileyPack, SmileyPackCType *smileyCPack,
ReplaceSmileyType *dat = new ReplaceSmileyType;
- const TCHAR *textToSearch = lpstrText + smloff;
- const TCHAR *textSmlStart = lpstrText + (*smlf)[firstSmlRef].pos;
- const TCHAR *textSmlEnd = textSmlStart + (*smlf)[firstSmlRef].len;
+ const wchar_t *textToSearch = lpstrText + smloff;
+ const wchar_t *textSmlStart = lpstrText + (*smlf)[firstSmlRef].pos;
+ const wchar_t *textSmlEnd = textSmlStart + (*smlf)[firstSmlRef].len;
// check if leading space exist
- const TCHAR *prech = _tcsdec(textToSearch, textSmlStart);
- dat->ldspace = prech != NULL ? _istspace(*prech) != 0 : smloff == 0;
+ const wchar_t *prech = _wcsdec(textToSearch, textSmlStart);
+ dat->ldspace = prech != NULL ? iswspace(*prech) != 0 : smloff == 0;
// check if trailing space exist
- dat->trspace = *textSmlEnd == 0 || _istspace(*textSmlEnd);
+ dat->trspace = *textSmlEnd == 0 || iswspace(*textSmlEnd);
// compute text location in RichEdit
- dat->loc.cpMin = (long)_tcsnccnt(textToSearch, (*smlf)[firstSmlRef].pos - smloff) + numCharsSoFar;
- dat->loc.cpMax = numCharsSoFar = (long)_tcsnccnt(textSmlStart, (*smlf)[firstSmlRef].len) + dat->loc.cpMin;
+ dat->loc.cpMin = (long)_wcsncnt(textToSearch, (*smlf)[firstSmlRef].pos - smloff) + numCharsSoFar;
+ dat->loc.cpMax = numCharsSoFar = (long)_wcsncnt(textSmlStart, (*smlf)[firstSmlRef].len) + dat->loc.cpMin;
if (!opt.EnforceSpaces || (dat->ldspace && dat->trspace)) {
dat->ldspace |= !opt.SurroundSmileyWithSpaces;
@@ -143,7 +145,7 @@ void LookupAllSmileys(SmileyPackType *smileyPack, SmileyPackCType *smileyCPack,
}
-void FindSmileyInText(SmileyPackType *smp, const TCHAR *str, unsigned &first, unsigned &size, SmileyType **sml)
+void FindSmileyInText(SmileyPackType *smp, const wchar_t *str, unsigned &first, unsigned &size, SmileyType **sml)
{
SmileysQueueType smllist;
LookupAllSmileys(smp, NULL, str, smllist, true);
@@ -221,9 +223,9 @@ void ReplaceSmileys(HWND hwnd, SmileyPackType *smp, SmileyPackCType *smcp, const
// disable screen updates
TextDocument->Freeze(&cnt);
- TCHAR classname[20];
+ wchar_t classname[20];
GetClassName(hwnd, classname, _countof(classname));
- bool ishpp = (_tcsncmp(classname, L"THppRichEdit", 12) == 0) || fireView;
+ bool ishpp = (wcsncmp(classname, L"THppRichEdit", 12) == 0) || fireView;
SetRichCallback(hwnd, NULL, false, true);
diff --git a/plugins/SmileyAdd/src/smileyroutines.h b/plugins/SmileyAdd/src/smileyroutines.h
index 93b00cb08e..2507afc11e 100644
--- a/plugins/SmileyAdd/src/smileyroutines.h
+++ b/plugins/SmileyAdd/src/smileyroutines.h
@@ -34,10 +34,10 @@ typedef SMOBJLIST<ReplaceSmileyType> SmileysQueueType;
-void LookupAllSmileys(SmileyPackType *smileyPack, SmileyPackCType *smileyCPack, const TCHAR *lpstrText, SmileysQueueType &smllist, const bool firstOnly);
+void LookupAllSmileys(SmileyPackType *smileyPack, SmileyPackCType *smileyCPack, const wchar_t *lpstrText, SmileysQueueType &smllist, const bool firstOnly);
void ReplaceSmileys(HWND hwnd, SmileyPackType *smp, SmileyPackCType *smcp, const CHARRANGE &sel, bool useHidden, bool ignoreLast, bool unFreeze, bool fireView = 0);
void ReplaceSmileysWithText(HWND hwnd, CHARRANGE &sel, bool keepFrozen);
-void FindSmileyInText(SmileyPackType *smp, const TCHAR *str, unsigned &first, unsigned &size, SmileyType **index);
+void FindSmileyInText(SmileyPackType *smp, const wchar_t *str, unsigned &first, unsigned &size, SmileyType **index);
SmileyType* FindButtonSmiley(SmileyPackType *smp);
#endif
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp
index 97c63f00a5..7024c5ed97 100644
--- a/plugins/SmileyAdd/src/smileys.cpp
+++ b/plugins/SmileyAdd/src/smileys.cpp
@@ -208,14 +208,14 @@ SmileyType* SmileyPackType::GetSmiley(unsigned index)
return (index < (unsigned)m_SmileyList.getCount()) ? &m_SmileyList[index] : NULL;
}
-static DWORD_PTR ConvertServiceParam(MCONTACT hContact, const TCHAR *param)
+static DWORD_PTR ConvertServiceParam(MCONTACT hContact, const wchar_t *param)
{
if (param == NULL)
return 0;
if (mir_tstrcmpi(L"hContact", param) == 0)
return hContact;
- if (_istdigit(*param))
- return _ttoi(param);
+ if (iswdigit(*param))
+ return _wtoi(param);
return (DWORD_PTR)param;
}
@@ -253,10 +253,10 @@ SmileyPackType::~SmileyPackType()
if (m_hSmList != NULL) ImageList_Destroy(m_hSmList);
}
-static const TCHAR urlRegEx[] =
+static const wchar_t urlRegEx[] =
L"(?:ftp|https|http|file|aim|webcal|irc|msnim|xmpp|gopher|mailto|news|nntp|telnet|wais|prospero)://?[\\w.?%:/$+;]*";
-static const TCHAR pathRegEx[] = L"[\\s\"][a-zA-Z]:[\\\\/][\\w.\\-\\\\/]*";
-static const TCHAR timeRegEx[] = L"\\d{1,2}:\\d{2}:\\d{2}|\\d{1,2}:\\d{2}";
+static const wchar_t pathRegEx[] = L"[\\s\"][a-zA-Z]:[\\\\/][\\w.\\-\\\\/]*";
+static const wchar_t timeRegEx[] = L"\\d{1,2}:\\d{2}:\\d{2}|\\d{1,2}:\\d{2}";
void SmileyPackType::AddTriggersToSmileyLookup(void)
{
@@ -354,11 +354,11 @@ bool SmileyPackType::LoadSmileyFile(const CMString &filename, const CMString &pa
pathToAbsolute(filename, modpath);
// Load xep file
- int fh = _topen(modpath.c_str(), _O_BINARY | _O_RDONLY);
+ int fh = _wopen(modpath.c_str(), _O_BINARY | _O_RDONLY);
if (fh == -1) {
if (!noerr) {
- static const TCHAR errmsg[] = LPGENT("Smiley pack %s for category \"%s\" not found.\nSelect correct smiley pack in the Options -> Customize -> Smileys.");
- TCHAR msgtxt[1024];
+ static const wchar_t errmsg[] = LPGENW("Smiley pack %s for category \"%s\" not found.\nSelect correct smiley pack in the Options -> Customize -> Smileys.");
+ wchar_t msgtxt[1024];
mir_sntprintf(msgtxt, TranslateTS(errmsg), modpath.c_str(), packname);
ReportError(msgtxt);
}
@@ -443,8 +443,8 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString &
_TMatcher *m0 = pat->createTMatcher(tbuf);
while (m0->findNextMatch()) {
POINT tpt;
- tpt.x = _ttol(m0->getGroup(2).c_str());
- tpt.y = _ttol(m0->getGroup(3).c_str());
+ tpt.x = _wtol(m0->getGroup(2).c_str());
+ tpt.y = _wtol(m0->getGroup(3).c_str());
if (m0->getGroup(1) == L"Selection")
selec = tpt;
@@ -479,7 +479,7 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString &
SmileyType *dat = new SmileyType;
- const int iconIndex = _ttol(m0->getGroup(3).c_str());
+ const int iconIndex = _wtol(m0->getGroup(3).c_str());
dat->SetHidden(m0->getStartingIndex(1) >= 0);
if (m0->getStartingIndex(4) >= 0) {
@@ -517,8 +517,8 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString &
m_SmileyList.insert(dat);
if (!noerr) {
- static const TCHAR errmsg[] = LPGENT("Smiley #%u in file %s for smiley pack %s not found.");
- TCHAR msgtxt[1024];
+ static const wchar_t errmsg[] = LPGENW("Smiley #%u in file %s for smiley pack %s not found.");
+ wchar_t msgtxt[1024];
mir_sntprintf(msgtxt, TranslateTS(errmsg), smnum, resname.c_str(), modpath.c_str());
CallService(MS_NETLIB_LOG, (WPARAM)hNetlibUser, _T2A(msgtxt));
errorFound = true;
@@ -642,7 +642,7 @@ bool SmileyPackType::LoadSmileyFileXEP(CMString &tbuf, bool onlyInfo, CMString&)
SmileyType *dat = new SmileyType;
dat->SetRegEx(true);
- dat->SetImList(m_hSmList, _ttol(m0->getGroup(1).c_str()));
+ dat->SetImList(m_hSmList, _wtol(m0->getGroup(1).c_str()));
dat->m_ToolText = m0->getGroup(2);
DecodeHTML(dat->m_ToolText);
@@ -897,7 +897,7 @@ void SmileyCategoryListType::AddAccountAsCategory(PROTOACCOUNT *acc, const CMStr
CMString patha;
pathToAbsolute(paths, patha);
- if (_taccess(patha.c_str(), 0) != 0)
+ if (_waccess(patha.c_str(), 0) != 0)
paths = defaultFile;
}
@@ -923,7 +923,7 @@ void SmileyCategoryListType::AddProtoAsCategory(char *acc, const CMString &defau
CMString paths = _A2T(path), patha;
pathToAbsolute(paths, patha);
- if (_taccess(patha.c_str(), 0) != 0)
+ if (_waccess(patha.c_str(), 0) != 0)
paths = defaultFile;
CMString dName(acc), displayName;
displayName.AppendFormat(TranslateT("%s global smiley pack"), dName.GetBuffer());
@@ -995,7 +995,7 @@ void SmileyCategoryListType::AddContactTransportAsCategory(MCONTACT hContact, co
CMString paths = _A2T(path), patha;
pathToAbsolute(paths, patha);
- if (_taccess(patha.c_str(), 0) != 0)
+ if (_waccess(patha.c_str(), 0) != 0)
paths = defaultFile;
AddCategory(displayName, displayName, smcTransportProto, paths);
@@ -1055,7 +1055,7 @@ void SmileyCategoryListType::AddAllProtocolsAsCategory(void)
SmileyLookup::SmileyLookup(const CMString &str, const bool regexs, const int ind, const CMString &smpt)
{
- TCHAR msgtxt[1024];
+ wchar_t msgtxt[1024];
m_ind = ind;
if (regexs) {
@@ -1067,13 +1067,13 @@ SmileyLookup::SmileyLookup(const CMString &str, const bool regexs, const int ind
m_valid &= (!matcher->findFirstMatch() ||
matcher->getStartingIndex() != matcher->getEndingIndex());
if (!m_valid) {
- static const TCHAR errmsg[] = LPGENT("Regular expression \"%s\" in smiley pack \"%s\" could produce \"empty matches\".");
+ static const wchar_t errmsg[] = LPGENW("Regular expression \"%s\" in smiley pack \"%s\" could produce \"empty matches\".");
mir_sntprintf(msgtxt, TranslateTS(errmsg), str.c_str(), smpt.c_str());
}
delete matcher;
}
else {
- static const TCHAR errmsg[] = LPGENT("Regular expression \"%s\" in smiley pack \"%s\" malformed.");
+ static const wchar_t errmsg[] = LPGENW("Regular expression \"%s\" in smiley pack \"%s\" malformed.");
mir_sntprintf(msgtxt, TranslateTS(errmsg), str.c_str(), smpt.c_str());
}
@@ -1112,8 +1112,8 @@ void SmileyLookup::Find(const CMString &str, SmileyLocVecType &smlcur, bool firs
delete matcher;
}
else {
- const TCHAR *pos = str.c_str();
- while ((pos = _tcsstr(pos, m_text.c_str())) != NULL) {
+ const wchar_t *pos = str.c_str();
+ while ((pos = wcsstr(pos, m_text.c_str())) != NULL) {
smlcur.insert(new SmileyLocType(pos - str.c_str(), m_text.GetLength()));
pos += m_text.GetLength();
if (firstOnly && m_ind != -1)
diff --git a/plugins/SmileyAdd/src/smileys.h b/plugins/SmileyAdd/src/smileys.h
index 765480e123..cba4999442 100644
--- a/plugins/SmileyAdd/src/smileys.h
+++ b/plugins/SmileyAdd/src/smileys.h
@@ -69,7 +69,7 @@ public:
bool IsSound(void) const { return (m_flags & SoundSmiley) != 0; }
bool IsText(void) const { return (m_flags & TextSmiley) != 0; }
- bool IsFileFound(void) { return _taccess(m_filepath.c_str(), 0) == 0; }
+ bool IsFileFound(void) { return _waccess(m_filepath.c_str(), 0) == 0; }
bool IsValid(void) { return m_size.cx != 0; }
ImageBase* CreateCachedImage(void);
@@ -203,7 +203,7 @@ public:
SmileyType* GetSmiley(unsigned index);
- const TCHAR* GetButtonSmiley(void) const { return m_ButtonSmiley.c_str(); }
+ const wchar_t* GetButtonSmiley(void) const { return m_ButtonSmiley.c_str(); }
bool LoadSmileyFile(const CMString &filename, const CMString &packname, bool onlyInfo, bool noerr = false);
diff --git a/plugins/SmileyAdd/src/smltool.cpp b/plugins/SmileyAdd/src/smltool.cpp
index d427c47644..8db7726c1f 100644
--- a/plugins/SmileyAdd/src/smltool.cpp
+++ b/plugins/SmileyAdd/src/smltool.cpp
@@ -236,7 +236,7 @@ void SmileyToolWindowType::SmileySel(int but)
ti.uId = (UINT_PTR)m_hwndDialog;
const CMString &toolText = m_pSmileyPack->GetSmiley(m_CurrentHotTrack)->GetToolText();
- ti.lpszText = const_cast<TCHAR*>(toolText.c_str());
+ ti.lpszText = const_cast<wchar_t*>(toolText.c_str());
SendMessage(m_hToolTip, TTM_UPDATETIPTEXT, 0, (LPARAM)&ti);
SendMessage(m_hToolTip, TTM_ACTIVATE, TRUE, 0);
diff --git a/plugins/SmileyAdd/src/stdafx.h b/plugins/SmileyAdd/src/stdafx.h
index 3f9d130e8e..4599a5a6f3 100644
--- a/plugins/SmileyAdd/src/stdafx.h
+++ b/plugins/SmileyAdd/src/stdafx.h
@@ -120,7 +120,7 @@ int UpdateSrmmDlg(WPARAM wParam, LPARAM lParam);
//functions for general use (defined in general.cpp)
int CalculateTextHeight(HDC hdc, CHARFORMAT2 *chf);
-const TCHAR* GetImageExt(CMString &fname);
+const wchar_t* GetImageExt(CMString &fname);
MCONTACT DecodeMetaContact(MCONTACT hContact);
bool IsSmileyProto(char *proto);
@@ -133,7 +133,7 @@ void pathToAbsolute(const CMString &pSrc, CMString &pOut);
bool InitGdiPlus(void);
void DestroyGdiPlus(void);
-void ReportError(const TCHAR *errmsg);
+void ReportError(const wchar_t *errmsg);
HICON GetDefaultIcon(bool copy = true);
void CloseRichCallback(HWND hwnd);
@@ -144,7 +144,7 @@ void ProcessAllInputAreas(bool restoreText);
void RichEditData_Destroy(void);
void CloseSmileys(void);
-int CheckForTip(int x, int y, HWND hwnd, TCHAR **smltxt);
+int CheckForTip(int x, int y, HWND hwnd, wchar_t **smltxt);
void UrlDecode(char *str);
diff --git a/plugins/Spamotron/src/bayes.cpp b/plugins/Spamotron/src/bayes.cpp
index d6d582a59b..aa377760a7 100644
--- a/plugins/Spamotron/src/bayes.cpp
+++ b/plugins/Spamotron/src/bayes.cpp
@@ -177,7 +177,7 @@ int get_token_score(int type, char *token)
return score;
}
-double get_msg_score(TCHAR *msg)
+double get_msg_score(wchar_t *msg)
{
char *message, *token;
double spam_prob, ham_prob, tmp1 = 1, tmp2 = 1;
@@ -220,7 +220,7 @@ double get_msg_score(TCHAR *msg)
return tmp1 / (tmp1 + tmp2);
}
-void queue_message(MCONTACT hContact, DWORD msgtime, TCHAR *message)
+void queue_message(MCONTACT hContact, DWORD msgtime, wchar_t *message)
{
char *tmp;
sqlite3_stmt *stmt;
@@ -247,7 +247,7 @@ void queue_message(MCONTACT hContact, DWORD msgtime, TCHAR *message)
void bayes_approve_contact(MCONTACT hContact)
{
const char *message;
- TCHAR *messageW;
+ wchar_t *messageW;
int d = 0;
sqlite3_stmt *stmt;
@@ -279,7 +279,7 @@ void dequeue_messages()
time_t t = time(NULL);
sqlite3_stmt *stmt;
const char *message;
- TCHAR *messageW;
+ wchar_t *messageW;
int d = 0;
if (bayesdb == NULL)
@@ -306,7 +306,7 @@ void dequeue_messages()
}
/* Learn one message as either SPAM or HAM as specified in type parameter */
-void learn(int type, TCHAR *msg)
+void learn(int type, wchar_t *msg)
{
char *tok, *message;
BYTE digest[16];
@@ -375,12 +375,12 @@ void learn(int type, TCHAR *msg)
mir_free(message);
}
-void learn_ham(TCHAR *msg)
+void learn_ham(wchar_t *msg)
{
learn(0, msg);
}
-void learn_spam(TCHAR *msg)
+void learn_spam(wchar_t *msg)
{
learn(1, msg);
} \ No newline at end of file
diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp
index 5bf7c8a4d6..7f20587abc 100644
--- a/plugins/Spamotron/src/options.cpp
+++ b/plugins/Spamotron/src/options.cpp
@@ -1,31 +1,31 @@
#include "stdafx.h"
-TCHAR currentResponse[256] = {0};
+wchar_t currentResponse[256] = {0};
-TCHAR* _getCOptS(TCHAR *buf, unsigned int buflen, MCONTACT hContact, const char* option, const TCHAR *def)
+wchar_t* _getCOptS(wchar_t *buf, unsigned int buflen, MCONTACT hContact, const char* option, const wchar_t *def)
{
DBVARIANT dbv = {0};
_tcsnset(buf, 0, buflen);
if (db_get_ts(hContact, PLUGIN_NAME, option, &dbv) != 0)
- _tcsncpy(buf, def, min(buflen, mir_tstrlen(def)+1));
+ wcsncpy(buf, def, min(buflen, mir_tstrlen(def)+1));
else if (dbv.type == DBVT_TCHAR) {
- _tcsncpy(buf, dbv.ptszVal, min(buflen, mir_tstrlen(dbv.ptszVal)+1));
+ wcsncpy(buf, dbv.ptszVal, min(buflen, mir_tstrlen(dbv.ptszVal)+1));
}
db_free(&dbv);
return buf;
}
-TCHAR* _getMOptS(TCHAR *buf, unsigned int buflen, const char* module, const char* option, const TCHAR *def)
+wchar_t* _getMOptS(wchar_t *buf, unsigned int buflen, const char* module, const char* option, const wchar_t *def)
{
- TCHAR* tmp;
+ wchar_t* tmp;
DBVARIANT dbv = {0};
_tcsnset(buf, 0, buflen);
if (db_get_s(NULL, module, option, &dbv) != 0)
- _tcsncpy(buf, def, min(buflen, mir_tstrlen(def)+1));
+ wcsncpy(buf, def, min(buflen, mir_tstrlen(def)+1));
else if (dbv.type == DBVT_TCHAR) {
- _tcsncpy(buf, dbv.ptszVal, min(buflen, mir_tstrlen(dbv.ptszVal)+1));
+ wcsncpy(buf, dbv.ptszVal, min(buflen, mir_tstrlen(dbv.ptszVal)+1));
} else {
tmp = mir_a2u(dbv.pszVal);
- _tcsncpy(buf, tmp, min(buflen, mir_tstrlen(tmp)+1));
+ wcsncpy(buf, tmp, min(buflen, mir_tstrlen(tmp)+1));
mir_free(tmp);
}
db_free(&dbv);
@@ -36,9 +36,9 @@ TCHAR* _getMOptS(TCHAR *buf, unsigned int buflen, const char* module, const char
BOOL _saveDlgItemText(HWND hDialog, int controlID, char* option)
{
int len;
- TCHAR *tmp;
+ wchar_t *tmp;
len = GetWindowTextLength(GetDlgItem(hDialog, controlID));
- tmp = (TCHAR *)malloc((len + 1)*sizeof(TCHAR));
+ tmp = (wchar_t *)malloc((len + 1)*sizeof(wchar_t));
GetDlgItemText(hDialog, controlID, tmp, len + 1);
_setOptTS(option, tmp);
free(tmp);
@@ -49,9 +49,9 @@ int _saveDlgItemResponse(HWND hDialog, int controlID, char* option)
int ret = 0;
int isRegex = 0;
int len;
- TCHAR *tmp;
+ wchar_t *tmp;
len = GetWindowTextLength(GetDlgItem(hDialog, controlID));
- tmp = (TCHAR*)malloc((len+1)*sizeof(TCHAR));
+ tmp = (wchar_t*)malloc((len+1)*sizeof(wchar_t));
GetDlgItemText(hDialog, controlID, tmp, len+1);
isRegex = _isregex(tmp);
if (!isRegex)
@@ -68,20 +68,20 @@ int _saveDlgItemResponse(HWND hDialog, int controlID, char* option)
BOOL _saveDlgItemInt(HWND hDialog, int controlID, char* option)
{
int len;
- TCHAR *tmp;
+ wchar_t *tmp;
len = GetWindowTextLength(GetDlgItem(hDialog, controlID));
- tmp = (TCHAR *)malloc((len + 1)*sizeof(TCHAR));
+ tmp = (wchar_t *)malloc((len + 1)*sizeof(wchar_t));
GetDlgItemText(hDialog, controlID, tmp, len + 1);
- _setOptD(option, _ttoi(tmp));
+ _setOptD(option, _wtoi(tmp));
free(tmp);
return TRUE;
}
BOOL _saveDlgItemScore(HWND hDialog, int controlID, char* option)
{
int len;
- TCHAR *tmp;
+ wchar_t *tmp;
len = GetWindowTextLength(GetDlgItem(hDialog, controlID));
- tmp = (TCHAR *)malloc((len + 1)*sizeof(TCHAR));
+ tmp = (wchar_t *)malloc((len + 1)*sizeof(wchar_t));
GetDlgItemText(hDialog, controlID, tmp, len + 1);
_setOptD(option, _tcstod(tmp, NULL)/SCORE_C);
return TRUE;
@@ -93,12 +93,12 @@ INT_PTR CALLBACK DlgProcOptionsMain(HWND optDlg, UINT msg, WPARAM wParam, LPARAM
{
static int bInitializing = 0, i, j, numProtocols;
PROTOACCOUNT **pd;
- TCHAR pName[256] = {0};
+ wchar_t pName[256] = {0};
char protoOption[256] = {0};
HWND hProtocolsList = GetDlgItem(optDlg, IDC_OPT_PROTOCOLS);
LVITEM lvi = {0};
LVCOLUMN lvc = {0};
- TCHAR buf[512];
+ wchar_t buf[512];
switch (msg) {
case WM_INITDIALOG:
@@ -115,8 +115,8 @@ INT_PTR CALLBACK DlgProcOptionsMain(HWND optDlg, UINT msg, WPARAM wParam, LPARAM
CheckDlgButton(optDlg, IDC_OPT_LOG_ACTIONS, _getOptB("LogActions", defaultLogActions) ? BST_CHECKED : BST_UNCHECKED);
SetDlgItemText(optDlg, IDC_OPT_IN_MSG_APPROVE_WORDLIST, _getOptS(buf, _countof(buf), "ApproveOnMsgInWordlist", defaultApproveOnMsgInWordlist));
- SetDlgItemText(optDlg, IDC_OPT_MAX_MSG_CONTACT, _itot((unsigned int)_getOptD("MaxMsgContactCountPerDay", defaultMaxMsgContactCountPerDay), buf, 10));
- SetDlgItemText(optDlg, IDC_OPT_MAX_SAME_MSG, _itot((unsigned int)_getOptD("MaxSameMsgCountPerDay", defaultMaxSameMsgCountPerDay), buf, 10));
+ SetDlgItemText(optDlg, IDC_OPT_MAX_MSG_CONTACT, _itow((unsigned int)_getOptD("MaxMsgContactCountPerDay", defaultMaxMsgContactCountPerDay), buf, 10));
+ SetDlgItemText(optDlg, IDC_OPT_MAX_SAME_MSG, _itow((unsigned int)_getOptD("MaxSameMsgCountPerDay", defaultMaxSameMsgCountPerDay), buf, 10));
SetDlgItemText(optDlg, IDC_OPT_DONT_REPLY_MSG_WORDLIST, _getOptS(buf, _countof(buf), "DontReplyMsgWordlist", defaultDontReplyMsgWordlist));
///Individual protocols list
@@ -129,7 +129,7 @@ INT_PTR CALLBACK DlgProcOptionsMain(HWND optDlg, UINT msg, WPARAM wParam, LPARAM
for (i = 0, j = 0; i < numProtocols; i++)
{
lvi.iItem = i;
- _getMOptS(pName, 200*sizeof(TCHAR), pd[i]->szModuleName, "AM_BaseProto", L"");
+ _getMOptS(pName, 200*sizeof(wchar_t), pd[i]->szModuleName, "AM_BaseProto", L"");
if (mir_tstrcmp(pName, L"ICQ") != 0)
continue;
lvi.pszText = mir_a2u(pd[i]->szModuleName);
@@ -217,7 +217,7 @@ INT_PTR CALLBACK DlgProcOptionsQuestion(HWND optDlg, UINT msg, WPARAM wParam, LP
static int bInitializing = 0;
int i, selectedMode;
HWND ht;
- TCHAR *buf;
+ wchar_t *buf;
unsigned int buflen = 500;
switch (msg) {
@@ -243,7 +243,7 @@ INT_PTR CALLBACK DlgProcOptionsQuestion(HWND optDlg, UINT msg, WPARAM wParam, LP
}
}
SetDlgItemText(optDlg, IDC_OPT_MATH_RESPONSE, TranslateT("Will be automatically evaluated from %mathexpr%"));
- buf = (TCHAR *)malloc(buflen*sizeof(TCHAR));
+ buf = (wchar_t *)malloc(buflen*sizeof(wchar_t));
switch (selectedMode) {
case SPAMOTRON_MODE_PLAIN:
case SPAMOTRON_MODE_ROTATE:
@@ -289,7 +289,7 @@ INT_PTR CALLBACK DlgProcOptionsQuestion(HWND optDlg, UINT msg, WPARAM wParam, LP
return FALSE;
i = SendDlgItemMessage(optDlg, IDC_OPT_MODE, CB_GETCURSEL, 0, 0);
selectedMode = SendDlgItemMessage(optDlg, IDC_OPT_MODE, CB_GETITEMDATA, i, 0);
- buf = (TCHAR*)malloc(buflen*sizeof(TCHAR));
+ buf = (wchar_t*)malloc(buflen*sizeof(wchar_t));
switch (selectedMode) {
case SPAMOTRON_MODE_PLAIN:
case SPAMOTRON_MODE_ROTATE:
@@ -418,8 +418,8 @@ INT_PTR CALLBACK DlgProcOptionsBayes(HWND optDlg, UINT msg, WPARAM wParam, LPARA
{
static int bInitializing = 0, len;
BOOL bEnabled;
- TCHAR *dbuf;
- TCHAR buf[MAX_BUFFER_LENGTH];
+ wchar_t *dbuf;
+ wchar_t buf[MAX_BUFFER_LENGTH];
char cbuf[MAX_BUFFER_LENGTH];
switch (msg) {
case WM_INITDIALOG:
@@ -482,7 +482,7 @@ INT_PTR CALLBACK DlgProcOptionsBayes(HWND optDlg, UINT msg, WPARAM wParam, LPARA
case IDC_OPT_BAYES_HAM:
// Learn ham from learnbox
len = GetWindowTextLength(GetDlgItem(optDlg, IDC_OPT_BAYES_LEARNBOX))+1;
- dbuf = (TCHAR *)malloc(len*sizeof(TCHAR));
+ dbuf = (wchar_t *)malloc(len*sizeof(wchar_t));
if (!dbuf)
return FALSE;
GetDlgItemText(optDlg, IDC_OPT_BAYES_LEARNBOX, dbuf, len);
@@ -499,7 +499,7 @@ INT_PTR CALLBACK DlgProcOptionsBayes(HWND optDlg, UINT msg, WPARAM wParam, LPARA
case IDC_OPT_BAYES_SPAM:
// Learn spam from learnbox
len = GetWindowTextLength(GetDlgItem(optDlg, IDC_OPT_BAYES_LEARNBOX))+1;
- dbuf = (TCHAR *)malloc(len*sizeof(TCHAR));
+ dbuf = (wchar_t *)malloc(len*sizeof(wchar_t));
if (!dbuf)
return FALSE;
GetDlgItemText(optDlg, IDC_OPT_BAYES_LEARNBOX, dbuf, len);
@@ -515,7 +515,7 @@ INT_PTR CALLBACK DlgProcOptionsBayes(HWND optDlg, UINT msg, WPARAM wParam, LPARA
case IDC_CHECK_MSG:
len = GetWindowTextLength(GetDlgItem(optDlg, IDC_OPT_BAYES_LEARNBOX))+1;
- dbuf = (TCHAR *)malloc((len)*sizeof(TCHAR));
+ dbuf = (wchar_t *)malloc((len)*sizeof(wchar_t));
if (!dbuf)
return FALSE;
GetDlgItemText(optDlg, IDC_OPT_BAYES_LEARNBOX, dbuf, len);
@@ -556,21 +556,21 @@ int OnOptInitialize(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
- odp.ptszGroup = LPGENT("Message sessions");
- odp.ptszTitle = _T(PLUGIN_NAME);
+ odp.pwszGroup = LPGENW("Message sessions");
+ odp.pwszTitle = _T(PLUGIN_NAME);
odp.flags = ODPF_TCHAR | ODPF_BOLDGROUPS;
- odp.ptszTab = LPGENT("Settings");
+ odp.pwszTab = LPGENW("Settings");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_SPAMOTRON_MAIN);
odp.pfnDlgProc = DlgProcOptionsMain;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Messages");
+ odp.pwszTab = LPGENW("Messages");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_SPAMOTRON_Q);
odp.pfnDlgProc = DlgProcOptionsQuestion;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Bayes");
+ odp.pwszTab = LPGENW("Bayes");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_SPAMOTRON_BAYES);
odp.pfnDlgProc = DlgProcOptionsBayes;
Options_AddPage(wParam, &odp);
@@ -578,8 +578,8 @@ int OnOptInitialize(WPARAM wParam, LPARAM)
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
odp.pszTemplate = MAKEINTRESOURCEA(IDD_SPAMOTRON_POPUPS);
odp.pfnDlgProc = DlgProcOptionsPopups;
- odp.ptszGroup = LPGENT("Popups");
- odp.ptszTab = NULL;
+ odp.pwszGroup = LPGENW("Popups");
+ odp.pwszTab = NULL;
Options_AddPage(wParam, &odp);
}
return 0;
diff --git a/plugins/Spamotron/src/popups.cpp b/plugins/Spamotron/src/popups.cpp
index 46289ac9af..0d81268d04 100644
--- a/plugins/Spamotron/src/popups.cpp
+++ b/plugins/Spamotron/src/popups.cpp
@@ -143,7 +143,7 @@ INT_PTR CALLBACK DlgProcOptionsPopups(HWND optDlg, UINT msg, WPARAM wParam, LPAR
return FALSE;
}
-int ShowPopupPreview(HWND optDlg, BYTE popupType, TCHAR *line1, TCHAR *line2)
+int ShowPopupPreview(HWND optDlg, BYTE popupType, wchar_t *line1, wchar_t *line2)
{
POPUPDATAT ppdp = {0};
switch (popupType)
@@ -185,14 +185,14 @@ int ShowPopupPreview(HWND optDlg, BYTE popupType, TCHAR *line1, TCHAR *line2)
ppdp.iSeconds = 0;
ppdp.lchContact = NULL;
- _tcsncpy_s(ppdp.lptzContactName, (line1 ? line1 : _T(PLUGIN_NAME)), _TRUNCATE);
+ wcsncpy_s(ppdp.lptzContactName, (line1 ? line1 : _T(PLUGIN_NAME)), _TRUNCATE);
if (line2)
- _tcsncpy_s(ppdp.lptzText, line2, _TRUNCATE);
+ wcsncpy_s(ppdp.lptzText, line2, _TRUNCATE);
return PUAddPopupT(&ppdp);
}
-int ShowPopup(MCONTACT hContact, BYTE popupType, TCHAR *line1, TCHAR *line2)
+int ShowPopup(MCONTACT hContact, BYTE popupType, wchar_t *line1, wchar_t *line2)
{
POPUPDATAT ppdp = {0};
switch (popupType)
@@ -234,8 +234,8 @@ int ShowPopup(MCONTACT hContact, BYTE popupType, TCHAR *line1, TCHAR *line2)
ppdp.iSeconds = 0;
ppdp.lchContact = hContact;
- _tcsncpy_s(ppdp.lptzContactName, (line1 ? line1 : _T(PLUGIN_NAME)), _TRUNCATE);
+ wcsncpy_s(ppdp.lptzContactName, (line1 ? line1 : _T(PLUGIN_NAME)), _TRUNCATE);
if (line2)
- _tcsncpy_s(ppdp.lptzText, line2, _TRUNCATE);
+ wcsncpy_s(ppdp.lptzText, line2, _TRUNCATE);
return PUAddPopupT(&ppdp);
} \ No newline at end of file
diff --git a/plugins/Spamotron/src/spamotron.cpp b/plugins/Spamotron/src/spamotron.cpp
index dceac13a6e..a96cc0551b 100644
--- a/plugins/Spamotron/src/spamotron.cpp
+++ b/plugins/Spamotron/src/spamotron.cpp
@@ -42,10 +42,10 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam)
char *msgblob;
char protoOption[256] = {0};
int buflen = MAX_BUFFER_LENGTH;
- TCHAR buf[MAX_BUFFER_LENGTH];
- TCHAR *message = NULL, *challengeW = NULL, *tmpW = NULL;
- TCHAR *whitelist = NULL, *ptok;
- TCHAR mexpr[64];
+ wchar_t buf[MAX_BUFFER_LENGTH];
+ wchar_t *message = NULL, *challengeW = NULL, *tmpW = NULL;
+ wchar_t *whitelist = NULL, *ptok;
+ wchar_t mexpr[64];
int maxmsglen = 0, a, b, i;
BOOL bayesEnabled = _getOptB("BayesEnabled", defaultBayesEnabled);
BOOL bCorrectResponse = FALSE;
@@ -132,20 +132,20 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam)
/*** Check for words in white-list ***/
if (_getOptB("ApproveOnMsgIn", defaultApproveOnMsgIn)) {
- whitelist = (TCHAR*)malloc(2048 * sizeof(TCHAR));
+ whitelist = (wchar_t*)malloc(2048 * sizeof(wchar_t));
if (whitelist != NULL) {
_getOptS(whitelist, 2048, "ApproveOnMsgInWordlist", defaultApproveOnMsgInWordlist);
if (_isregex(whitelist)) {
if (_regmatch(message, whitelist))
bCorrectResponse = TRUE;
} else {
- ptok = _tcstok(whitelist, L" ");
+ ptok = wcstok(whitelist, L" ");
while (ptok != NULL) {
- if (_tcsstr(message, ptok)) {
+ if (wcsstr(message, ptok)) {
bCorrectResponse = TRUE;
break;
}
- ptok = _tcstok(NULL, L" ");
+ ptok = wcstok(NULL, L" ");
}
}
free(whitelist);
@@ -207,8 +207,8 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam)
case SPAMOTRON_MODE_MATH:
if (message == NULL)
break;
- _itot(_getCOptD(hContact, "ResponseMath", -1), buf, 10);
- if (_tcsstr(message, buf) && (mir_tstrlen(buf) == mir_tstrlen(message))) {
+ _itow(_getCOptD(hContact, "ResponseMath", -1), buf, 10);
+ if (wcsstr(message, buf) && (mir_tstrlen(buf) == mir_tstrlen(message))) {
bCorrectResponse = TRUE;
}
break;
@@ -232,7 +232,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam)
// Resubmit pending authorization request
if (_getCOptB(hContact, "AuthEventPending", FALSE)) {
DBVARIANT _dbv;
- TCHAR AuthEventModule[100];
+ wchar_t AuthEventModule[100];
char* szAuthEventModule;
if (db_get(hContact, PLUGIN_NAME, "AuthEvent", &_dbv) == 0) {
DBEVENTINFO *_dbei = (DBEVENTINFO *)malloc(sizeof(DBEVENTINFO));
@@ -344,8 +344,8 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam)
/*** Send Challenge ***/
- challengeW = (TCHAR *)malloc(maxmsglen*sizeof(TCHAR));
- tmpW = (TCHAR *)malloc(maxmsglen*sizeof(TCHAR));
+ challengeW = (wchar_t *)malloc(maxmsglen*sizeof(wchar_t));
+ tmpW = (wchar_t *)malloc(maxmsglen*sizeof(wchar_t));
switch (_getOptB("Mode", defaultMode)) {
case SPAMOTRON_MODE_PLAIN:
if (dbei->eventType == EVENTTYPE_AUTHREQUEST)
diff --git a/plugins/Spamotron/src/stdafx.h b/plugins/Spamotron/src/stdafx.h
index 2d584589ba..1be69abae9 100644
--- a/plugins/Spamotron/src/stdafx.h
+++ b/plugins/Spamotron/src/stdafx.h
@@ -40,7 +40,7 @@
#define _getOptD(a,b) _getCOptD(NULL, a, b)
#define _setOptD(a,b) _setCOptD(NULL, a, b)
-TCHAR* _getCOptS(TCHAR *buf, unsigned int buflen, MCONTACT hContact, const char* option, const TCHAR *def);
+wchar_t* _getCOptS(wchar_t *buf, unsigned int buflen, MCONTACT hContact, const char* option, const wchar_t *def);
#define _getOptS(a,b,c,d) _getCOptS(a, b, NULL, c, d)
#define _setCOptTS(a,b,c) db_set_ts(a, PLUGIN_NAME, b, c)
#define _setCOptS(a,b,c) db_set_s(a, PLUGIN_NAME, b, c)
@@ -90,24 +90,24 @@ TCHAR* _getCOptS(TCHAR *buf, unsigned int buflen, MCONTACT hContact, const char*
#define _NOTIFYP _getOptB("NotifyPopup", defaultNotifyPopup)
-TCHAR* ReplaceVars(TCHAR *dst, unsigned int len);
-TCHAR* ReplaceVarsNum(TCHAR *dst, unsigned int len, int num);
-TCHAR* ReplaceVar(TCHAR *dst, unsigned int len, const TCHAR *var, const TCHAR *rvar);
-int get_response_id(const TCHAR *strvar);
-int get_response_num(const TCHAR *str);
-TCHAR* get_response(TCHAR* dst, unsigned int dstlen, int num);
-
-TCHAR* _tcsstr_cc(TCHAR* str, TCHAR* strSearch, BOOL cc);
-BOOL _isregex(TCHAR* strSearch);
-BOOL _isvalidregex(TCHAR* strSearch);
-BOOL _regmatch(TCHAR* str, TCHAR* strSearch);
-BOOL Contains(TCHAR* dst, TCHAR* src);
+wchar_t* ReplaceVars(wchar_t *dst, unsigned int len);
+wchar_t* ReplaceVarsNum(wchar_t *dst, unsigned int len, int num);
+wchar_t* ReplaceVar(wchar_t *dst, unsigned int len, const wchar_t *var, const wchar_t *rvar);
+int get_response_id(const wchar_t *strvar);
+int get_response_num(const wchar_t *str);
+wchar_t* get_response(wchar_t* dst, unsigned int dstlen, int num);
+
+wchar_t* _tcsstr_cc(wchar_t* str, wchar_t* strSearch, BOOL cc);
+BOOL _isregex(wchar_t* strSearch);
+BOOL _isvalidregex(wchar_t* strSearch);
+BOOL _regmatch(wchar_t* str, wchar_t* strSearch);
+BOOL Contains(wchar_t* dst, wchar_t* src);
BOOL isOneDay(DWORD timestamp1, DWORD timestamp2);
void MarkUnread(MCONTACT hContact);
-int ShowPopup(MCONTACT hContact, BYTE popupType, TCHAR *line1, TCHAR *line2);
-int ShowPopupPreview(HWND optDlg, BYTE popupType, TCHAR *line1, TCHAR *line2);
-int _notify(MCONTACT hContact, BYTE type, TCHAR *message, TCHAR *origmessage);
+int ShowPopup(MCONTACT hContact, BYTE popupType, wchar_t *line1, wchar_t *line2);
+int ShowPopupPreview(HWND optDlg, BYTE popupType, wchar_t *line1, wchar_t *line2);
+int _notify(MCONTACT hContact, BYTE type, wchar_t *message, wchar_t *origmessage);
int LogToSystemHistory(char *message, char *origmessage);
#define POPUP_DEFAULT 0
#define POPUP_BLOCKED 1
@@ -136,13 +136,13 @@ extern sqlite3 *bayesdb;
int OpenBayes();
int CheckBayes();
-void learn(int type, TCHAR *msg);
-void learn_ham(TCHAR *msg);
-void learn_spam(TCHAR *msg);
+void learn(int type, wchar_t *msg);
+void learn_ham(wchar_t *msg);
+void learn_spam(wchar_t *msg);
int get_token_count(int type);
int get_msg_count(int type);
-double get_msg_score(TCHAR *msg);
-void queue_message(MCONTACT hContact, DWORD msgtime, TCHAR *message);
+double get_msg_score(wchar_t *msg);
+void queue_message(MCONTACT hContact, DWORD msgtime, wchar_t *message);
void bayes_approve_contact(MCONTACT hContact);
void dequeue_messages();
diff --git a/plugins/Spamotron/src/utils.cpp b/plugins/Spamotron/src/utils.cpp
index 7a9bf2fe3e..4d5ca64280 100644
--- a/plugins/Spamotron/src/utils.cpp
+++ b/plugins/Spamotron/src/utils.cpp
@@ -2,36 +2,36 @@
#include <locale.h>
-TCHAR *_tcstolower(TCHAR *dst)
+wchar_t *_tcstolower(wchar_t *dst)
{
if (dst == NULL)
return NULL;
SIZE_T dst_len = mir_tstrlen(dst);
for (SIZE_T i = 0; i < dst_len; i ++)
- dst[i] = _totlower(dst[i]);
+ dst[i] = towlower(dst[i]);
return dst;
}
-TCHAR *_tcstoupper(TCHAR *dst)
+wchar_t *_tcstoupper(wchar_t *dst)
{
if (dst == NULL)
return NULL;
SIZE_T dst_len = mir_tstrlen(dst);
for (SIZE_T i = 0; i < dst_len; i ++)
- dst[i] = _totupper(dst[i]);
+ dst[i] = towupper(dst[i]);
return dst;
}
-BOOL _isregex(TCHAR* strSearch)
+BOOL _isregex(wchar_t* strSearch)
{
BOOL ret = FALSE;
pcre16 *re;
const char *error;
int erroroffs, rc;
- TCHAR *regex;
- TCHAR regex_parse[] = L"/(.*)/([igsm]*)";
+ wchar_t *regex;
+ wchar_t regex_parse[] = L"/(.*)/([igsm]*)";
int ovector[9];
if (strSearch == NULL)
@@ -52,15 +52,15 @@ err_out:
return ret;
}
-BOOL _isvalidregex(TCHAR* strSearch)
+BOOL _isvalidregex(wchar_t* strSearch)
{
BOOL ret = FALSE;
pcre16 *re;
const char *error;
int erroroffs, rc;
- TCHAR *regex, *regexp, *mod;
+ wchar_t *regex, *regexp, *mod;
int opts = 0;
- TCHAR regex_parse[] = L"/(.*)/([igsm]*)";
+ wchar_t regex_parse[] = L"/(.*)/([igsm]*)";
int ovector[9];
if (strSearch == NULL)
@@ -82,11 +82,11 @@ BOOL _isvalidregex(TCHAR* strSearch)
mod = regex + ovector[4];
mod[ovector[5] - ovector[4]] = 0;
- if (_tcsstr(mod, L"i"))
+ if (wcsstr(mod, L"i"))
opts |= PCRE_CASELESS;
- if (_tcsstr(mod, L"m"))
+ if (wcsstr(mod, L"m"))
opts |= PCRE_MULTILINE;
- if (_tcsstr(mod, L"s"))
+ if (wcsstr(mod, L"s"))
opts |= PCRE_DOTALL;
re = pcre16_compile(regexp, opts, &error, &erroroffs, NULL);
@@ -100,15 +100,15 @@ err_out:
return ret;
}
-BOOL _regmatch(TCHAR* str, TCHAR* strSearch)
+BOOL _regmatch(wchar_t* str, wchar_t* strSearch)
{
BOOL ret = FALSE;
pcre16 *re;
const char *error;
int erroroffs, rc;
- TCHAR *regex, *regexp, *data = NULL, *mod;
+ wchar_t *regex, *regexp, *data = NULL, *mod;
int opts = 0;
- TCHAR regex_parse[] = L"^/(.*)/([igsm]*)";
+ wchar_t regex_parse[] = L"^/(.*)/([igsm]*)";
int ovector[9];
if (str == NULL || strSearch == NULL)
@@ -133,11 +133,11 @@ BOOL _regmatch(TCHAR* str, TCHAR* strSearch)
data = mir_tstrdup(str);
if (data == NULL)
goto err_out;
- if (_tcsstr(mod, L"i"))
+ if (wcsstr(mod, L"i"))
opts |= PCRE_CASELESS;
- if (_tcsstr(mod, L"m"))
+ if (wcsstr(mod, L"m"))
opts |= PCRE_MULTILINE;
- if (_tcsstr(mod, L"s"))
+ if (wcsstr(mod, L"s"))
opts |= PCRE_DOTALL;
re = pcre16_compile(regexp, opts, &error, &erroroffs, NULL);
@@ -154,14 +154,14 @@ err_out:
return ret;
}
-int get_response_id(const TCHAR* strvar)
+int get_response_id(const wchar_t* strvar)
{
int ret = 0;
pcre16 *re;
const char *error;
int erroroffs, rc;
- TCHAR *_str, *_strvar;
- TCHAR regex[] = L"^%response([#-_]([0-9]+))?%$";
+ wchar_t *_str, *_strvar;
+ wchar_t regex[] = L"^%response([#-_]([0-9]+))?%$";
int ovector[9];
if (strvar == NULL)
@@ -181,45 +181,45 @@ int get_response_id(const TCHAR* strvar)
} else if (rc == 3) {
_str = _strvar + ovector[4];
_str[ovector[5] - ovector[4]] = 0;
- ret = _ttoi(_str);
+ ret = _wtoi(_str);
}
mir_free(_strvar);
return ret;
}
-int get_response_num(const TCHAR *str)
+int get_response_num(const wchar_t *str)
{
int i = 0;
- TCHAR *tmp, *strc;
+ wchar_t *tmp, *strc;
if (str == NULL)
return 0;
strc = mir_tstrdup(str);
if (strc == NULL)
return 0;
- tmp = _tcstok(strc, L"\r\n");
+ tmp = wcstok(strc, L"\r\n");
while (tmp) {
i ++;
- tmp = _tcstok(NULL, L"\r\n"); /* Move next. */
+ tmp = wcstok(NULL, L"\r\n"); /* Move next. */
}
mir_free(strc);
return i;
}
-TCHAR* get_response(TCHAR* dst, unsigned int dstlen, int num)
+wchar_t* get_response(wchar_t* dst, unsigned int dstlen, int num)
{
int i = 0;
- TCHAR *tmp, *src;
+ wchar_t *tmp, *src;
if (dst == NULL || dstlen == 0 || num < 0)
return dst;
- src = (TCHAR*)mir_alloc(MAX_BUFFER_LENGTH * sizeof(TCHAR));
+ src = (wchar_t*)mir_alloc(MAX_BUFFER_LENGTH * sizeof(wchar_t));
if (src == NULL)
goto err_out;
_getOptS(src, MAX_BUFFER_LENGTH, "Response", defaultResponse);
- tmp = _tcstok(src, L"\r\n");
+ tmp = wcstok(src, L"\r\n");
while (tmp) {
if (i == num) {
mir_tstrcpy(dst, tmp);
@@ -227,7 +227,7 @@ TCHAR* get_response(TCHAR* dst, unsigned int dstlen, int num)
return dst;
}
i ++;
- tmp = _tcstok(NULL, L"\r\n"); /* Move next. */
+ tmp = wcstok(NULL, L"\r\n"); /* Move next. */
}
mir_free(src);
err_out:
@@ -235,12 +235,12 @@ err_out:
return dst;
}
-TCHAR* _tcsstr_cc(TCHAR* str, TCHAR* strSearch, BOOL cc)
+wchar_t* _tcsstr_cc(wchar_t* str, wchar_t* strSearch, BOOL cc)
{
- TCHAR *ret = NULL, *_str = NULL, *_strSearch = NULL;
+ wchar_t *ret = NULL, *_str = NULL, *_strSearch = NULL;
if (cc)
- return _tcsstr(str, strSearch);
+ return wcsstr(str, strSearch);
_str = mir_tstrdup(str);
if (_str == NULL)
@@ -248,7 +248,7 @@ TCHAR* _tcsstr_cc(TCHAR* str, TCHAR* strSearch, BOOL cc)
_strSearch = mir_tstrdup(strSearch);
if (_strSearch == NULL)
goto err_out;
- ret = _tcsstr(_tcstolower(_str), _tcstolower(_strSearch));
+ ret = wcsstr(_tcstolower(_str), _tcstolower(_strSearch));
if (ret != NULL)
ret = ((ret - _str) + str);
err_out:
@@ -258,10 +258,10 @@ err_out:
return ret;
}
-BOOL Contains(TCHAR* dst, TCHAR* src) // Checks for occurence of substring from src in dst
+BOOL Contains(wchar_t* dst, wchar_t* src) // Checks for occurence of substring from src in dst
{
BOOL ret = FALSE;
- TCHAR *tsrc = NULL, *tdst = NULL, *token, *token_end;
+ wchar_t *tsrc = NULL, *tdst = NULL, *token, *token_end;
SIZE_T dst_len;
if (dst == NULL || src == NULL)
@@ -274,24 +274,24 @@ BOOL Contains(TCHAR* dst, TCHAR* src) // Checks for occurence of substring from
goto err_out;
tdst = _tcstoupper(tdst);
dst_len = mir_tstrlen(tdst);
- token = _tcstok(tsrc, L",");
+ token = wcstok(tsrc, L",");
while (token) {
token_end = (token + mir_tstrlen(token));
- while (!_tcsncmp(token, L" ", 1)) { /* Skeep spaces at start. */
+ while (!wcsncmp(token, L" ", 1)) { /* Skeep spaces at start. */
token ++;
}
/* Skeep spaces at end. */
- while (token > token_end && _tcschr((token_end - 1), _T(' '))) {
+ while (token > token_end && wcschr((token_end - 1), ' ')) {
token_end --;
token_end[0] = 0;
}
/* Compare. */
if (dst_len == (token_end - token) &&
- 0 == memcmp(tdst, _tcstoupper(token), (dst_len * sizeof(TCHAR)))) {
+ 0 == memcmp(tdst, _tcstoupper(token), (dst_len * sizeof(wchar_t)))) {
ret = TRUE;
break;
}
- token = _tcstok(NULL, L","); /* Move next. */
+ token = wcstok(NULL, L","); /* Move next. */
}
err_out:
mir_free(tsrc);
@@ -321,9 +321,9 @@ BOOL isOneDay(DWORD timestamp1, DWORD timestamp2)
return FALSE;
}
-TCHAR* ReplaceVar(TCHAR *dst, unsigned int len, const TCHAR *var, const TCHAR *rvar)
+wchar_t* ReplaceVar(wchar_t *dst, unsigned int len, const wchar_t *var, const wchar_t *rvar)
{
- TCHAR *var_start;
+ wchar_t *var_start;
SIZE_T dst_len, var_len, rvar_len;
if (dst == NULL || var == NULL || rvar == NULL)
@@ -331,39 +331,39 @@ TCHAR* ReplaceVar(TCHAR *dst, unsigned int len, const TCHAR *var, const TCHAR *r
dst_len = mir_tstrlen(dst);
var_len = mir_tstrlen(var);
rvar_len = mir_tstrlen(rvar);
- var_start = _tcsstr(dst, var);
+ var_start = wcsstr(dst, var);
while (var_start) {
if (len < (dst_len + rvar_len - var_len + 1))
return NULL; /* Out of buf space. */
memmove((var_start + rvar_len),
(var_start + var_len),
- (((dst + dst_len + 1) - (var_start + var_len)) * sizeof(TCHAR)));
+ (((dst + dst_len + 1) - (var_start + var_len)) * sizeof(wchar_t)));
if (var_len >= rvar_len) { /* Buf data size not changed or decreased. */
dst_len -= (var_len - rvar_len);
} else { /* Buf data size increased. */
dst_len += (rvar_len - var_len);
}
- memcpy(var_start, rvar, (rvar_len * sizeof(TCHAR)));
- var_start = _tcsstr(dst, var); /* Move next. */
+ memcpy(var_start, rvar, (rvar_len * sizeof(wchar_t)));
+ var_start = wcsstr(dst, var); /* Move next. */
}
return dst;
}
-TCHAR* ReplaceVars(TCHAR *dst, unsigned int len)
+wchar_t* ReplaceVars(wchar_t *dst, unsigned int len)
{
return ReplaceVarsNum(dst, len, -1);
}
-TCHAR* ReplaceVarsNum(TCHAR *dst, unsigned int len, int num)
+wchar_t* ReplaceVarsNum(wchar_t *dst, unsigned int len, int num)
{
- TCHAR response[MAX_BUFFER_LENGTH];
+ wchar_t response[MAX_BUFFER_LENGTH];
int ret, i;
pcre16 *re;
const char *error;
int erroroffs, rc;
- TCHAR *_str, *tmp, **r = NULL, **tr, *ttmp, *dstcopy;
- TCHAR regex[] = L"%response([#-_]([0-9]+))?%";
+ wchar_t *_str, *tmp, **r = NULL, **tr, *ttmp, *dstcopy;
+ wchar_t regex[] = L"%response([#-_]([0-9]+))?%";
int ovector[9];
re = pcre16_compile(regex, 0, &error, &erroroffs, NULL);
@@ -371,14 +371,14 @@ TCHAR* ReplaceVarsNum(TCHAR *dst, unsigned int len, int num)
return FALSE; // [TODO] and log some error
_getOptS(response, _countof(response), "Response", defaultResponse);
- ttmp = _tcstok(response, L"\r\n");
+ ttmp = wcstok(response, L"\r\n");
for (i = 0; ttmp != NULL; i ++) {
- tr = (TCHAR**)mir_realloc(r, ((i + 1) * sizeof(TCHAR*)));
+ tr = (wchar_t**)mir_realloc(r, ((i + 1) * sizeof(wchar_t*)));
if (tr == NULL)
goto err_out;
r = tr;
r[i] = ttmp;
- ttmp = _tcstok(NULL, L"\r\n"); /* Move next. */
+ ttmp = wcstok(NULL, L"\r\n"); /* Move next. */
}
do {
@@ -397,7 +397,7 @@ TCHAR* ReplaceVarsNum(TCHAR *dst, unsigned int len, int num)
ttmp[ovector[1] - ovector[0]] = 0;
tmp = _str + ovector[4];
tmp[ovector[5] - ovector[4]] = 0;
- ret = _ttoi(tmp);
+ ret = _wtoi(tmp);
} else {
ttmp = dstcopy + ovector[0];
ttmp[ovector[1] - ovector[0]] = 0;
@@ -423,10 +423,10 @@ err_out:
return dst;
}
-int _notify(MCONTACT hContact, BYTE type, TCHAR *message, TCHAR *origmessage)
+int _notify(MCONTACT hContact, BYTE type, wchar_t *message, wchar_t *origmessage)
{
char *tmp, *tmporig;
- TCHAR msg[MAX_BUFFER_LENGTH];
+ wchar_t msg[MAX_BUFFER_LENGTH];
mir_sntprintf(msg, message, pcli->pfnGetContactDisplayName(hContact, 0));
if (_getOptB("LogActions", defaultLogActions)) {
diff --git a/plugins/SpellChecker/src/RichEdit.cpp b/plugins/SpellChecker/src/RichEdit.cpp
index ea5846a42a..1317f767cd 100644
--- a/plugins/SpellChecker/src/RichEdit.cpp
+++ b/plugins/SpellChecker/src/RichEdit.cpp
@@ -143,7 +143,7 @@ int RichEdit::GetLineCount() const
return SendMessage(EM_GETLINECOUNT, 0, 0);
}
-void RichEdit::GetLine(int line, TCHAR *text, size_t text_len) const
+void RichEdit::GetLine(int line, wchar_t *text, size_t text_len) const
{
*((WORD*)text) = WORD(text_len - 1);
unsigned size = (unsigned)SendMessage(EM_GETLINE, (WPARAM)line, (LPARAM)text);
@@ -152,7 +152,7 @@ void RichEdit::GetLine(int line, TCHAR *text, size_t text_len) const
// to make both implementations return same size
int lineLen = GetLineLength(line);
size = (unsigned)max(0, min((int)text_len - 1, min((int)size, lineLen)));
- text[size] = _T('\0');
+ text[size] = '\0';
}
int RichEdit::GetLineLength(int line) const
@@ -193,7 +193,7 @@ int RichEdit::GetTextLength() const
return GetWindowTextLength(m_hwnd);
}
-TCHAR* RichEdit::GetText(int start, int end) const
+wchar_t* RichEdit::GetText(int start, int end) const
{
if (end <= start)
end = GetTextLength();
@@ -211,26 +211,26 @@ TCHAR* RichEdit::GetText(int start, int end) const
return mir_tstrdup(L"");
}
- TCHAR *res = mir_u2t(text);
+ wchar_t *res = mir_u2t(text);
range->Release();
::SysFreeString(text);
return res;
}
int len = (GetTextLength() + 1);
- TCHAR *tmp = (TCHAR *)mir_alloc(len * sizeof(TCHAR));
+ wchar_t *tmp = (wchar_t *)mir_alloc(len * sizeof(wchar_t));
GetWindowText(m_hwnd, tmp, len);
tmp[len] = 0;
- TCHAR *ret = (TCHAR *)mir_alloc((end - start + 1) * sizeof(TCHAR));
- memmove(ret, &tmp[start], (end - start) * sizeof(TCHAR));
+ wchar_t *ret = (wchar_t *)mir_alloc((end - start + 1) * sizeof(wchar_t));
+ memmove(ret, &tmp[start], (end - start) * sizeof(wchar_t));
ret[end - start] = 0;
mir_free(tmp);
return ret;
}
-void RichEdit::ReplaceSel(const TCHAR *new_text)
+void RichEdit::ReplaceSel(const wchar_t *new_text)
{
if (m_stopped) {
CHARRANGE sel = GetSel();
@@ -249,7 +249,7 @@ void RichEdit::ReplaceSel(const TCHAR *new_text)
else SendMessage(EM_REPLACESEL, m_undoEnabled, (LPARAM)new_text);
}
-int RichEdit::Replace(int start, int end, const TCHAR *new_text)
+int RichEdit::Replace(int start, int end, const wchar_t *new_text)
{
CHARRANGE sel = GetSel();
CHARRANGE replace_sel = { start, end };
@@ -262,7 +262,7 @@ int RichEdit::Replace(int start, int end, const TCHAR *new_text)
return dif;
}
-int RichEdit::Insert(int pos, const TCHAR *text)
+int RichEdit::Insert(int pos, const wchar_t *text)
{
CHARRANGE sel = GetSel();
CHARRANGE replace_sel = { pos, pos };
diff --git a/plugins/SpellChecker/src/RichEdit.h b/plugins/SpellChecker/src/RichEdit.h
index 4556369c31..17ebe1e438 100644
--- a/plugins/SpellChecker/src/RichEdit.h
+++ b/plugins/SpellChecker/src/RichEdit.h
@@ -35,7 +35,7 @@ public:
int GetCharFromPos(const POINT &pt);
int GetLineCount() const;
- void GetLine(int line, TCHAR *text, size_t text_len) const;
+ void GetLine(int line, wchar_t *text, size_t text_len) const;
int GetLineLength(int line) const;
int GetFirstCharOfLine(int line) const;
int GetLineFromChar(int charPos) const;
@@ -44,12 +44,12 @@ public:
void SetSel(int start, int end);
void SetSel(const CHARRANGE &sel);
- TCHAR* GetText(int start, int end) const;
+ wchar_t* GetText(int start, int end) const;
int GetTextLength() const;
- void ReplaceSel(const TCHAR *new_text);
- int Replace(int start, int end, const TCHAR *new_text);
- int Insert(int pos, const TCHAR *text);
+ void ReplaceSel(const wchar_t *new_text);
+ int Replace(int start, int end, const wchar_t *new_text);
+ int Insert(int pos, const wchar_t *text);
int Delete(int start, int end);
private:
diff --git a/plugins/SpellChecker/src/ardialog.cpp b/plugins/SpellChecker/src/ardialog.cpp
index 3b1258508f..0b1a14fa56 100644
--- a/plugins/SpellChecker/src/ardialog.cpp
+++ b/plugins/SpellChecker/src/ardialog.cpp
@@ -25,8 +25,8 @@ static INT_PTR CALLBACK AddReplacementDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
struct Data
{
Dictionary *dict;
- tstring find;
- tstring replace;
+ std::wstring find;
+ std::wstring replace;
BOOL useVariables;
BOOL modal;
@@ -37,7 +37,7 @@ struct Data
};
BOOL ShowAutoReplaceDialog(HWND parent, BOOL modal,
- Dictionary *dict, const TCHAR *find, const TCHAR *replace, BOOL useVariables,
+ Dictionary *dict, const wchar_t *find, const wchar_t *replace, BOOL useVariables,
BOOL findReadOnly, AutoReplaceDialogCallback callback, void *param)
{
Data *data = new Data();
@@ -79,11 +79,11 @@ static LRESULT CALLBACK OnlyCharsEditProc(HWND hwnd, UINT msg, WPARAM wParam, LP
if (GetKeyState(VK_CONTROL) & 0x8000) // CTRL key
break;
{
- TCHAR c = (TCHAR)wParam;
+ wchar_t c = (wchar_t)wParam;
if (!data->dict->autoReplace->isWordChar(c))
return 1;
- TCHAR tmp[2] = { c, 0 };
+ wchar_t tmp[2] = { c, 0 };
CharLower(tmp);
wParam = tmp[0];
@@ -96,10 +96,10 @@ static LRESULT CALLBACK OnlyCharsEditProc(HWND hwnd, UINT msg, WPARAM wParam, LP
switch (msg) {
case EM_PASTESPECIAL:
case WM_PASTE:
- TCHAR text[256];
+ wchar_t text[256];
GetWindowText(hwnd, text, _countof(text));
- scoped_free<TCHAR> dest = data->dict->autoReplace->filterText(text);
+ scoped_free<wchar_t> dest = data->dict->autoReplace->filterText(text);
SetWindowText(hwnd, dest);
break;
}
@@ -171,7 +171,7 @@ static INT_PTR CALLBACK AddReplacementDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
SendDlgItemMessage(hwndDlg, IDC_NEW, EM_LIMITTEXT, 256, 0);
if (!data->find.empty()) {
- scoped_free<TCHAR> tmp = data->dict->autoReplace->filterText(data->find.c_str());
+ scoped_free<wchar_t> tmp = data->dict->autoReplace->filterText(data->find.c_str());
SetDlgItemText(hwndDlg, IDC_OLD, tmp);
}
if (!data->replace.empty())
@@ -213,7 +213,7 @@ static INT_PTR CALLBACK AddReplacementDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
{
Data *data = (Data *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- TCHAR find[256];
+ wchar_t find[256];
if (data->findReadOnly)
mir_tstrncpy(find, data->find.c_str(), _countof(find));
else {
@@ -221,7 +221,7 @@ static INT_PTR CALLBACK AddReplacementDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
lstrtrim(find);
}
- TCHAR replace[256];
+ wchar_t replace[256];
GetDlgItemText(hwndDlg, IDC_NEW, replace, _countof(replace));
lstrtrim(replace);
diff --git a/plugins/SpellChecker/src/ardialog.h b/plugins/SpellChecker/src/ardialog.h
index 83f97c6026..6ece91cc4f 100644
--- a/plugins/SpellChecker/src/ardialog.h
+++ b/plugins/SpellChecker/src/ardialog.h
@@ -22,11 +22,11 @@ Boston, MA 02111-1307, USA.
typedef void (*AutoReplaceDialogCallback)(BOOL canceled, Dictionary *dict,
- const TCHAR *find, const TCHAR *replace, BOOL useVariables,
- const TCHAR *original_find, void *param);
+ const wchar_t *find, const wchar_t *replace, BOOL useVariables,
+ const wchar_t *original_find, void *param);
BOOL ShowAutoReplaceDialog(HWND parent, BOOL modal,
- Dictionary *dict, const TCHAR *find, const TCHAR *replace, BOOL useVariables,
+ Dictionary *dict, const wchar_t *find, const wchar_t *replace, BOOL useVariables,
BOOL findReadOnly, AutoReplaceDialogCallback callback, void *param);
diff --git a/plugins/SpellChecker/src/autoreplace.cpp b/plugins/SpellChecker/src/autoreplace.cpp
index 899146ffdf..a3ad88e928 100644
--- a/plugins/SpellChecker/src/autoreplace.cpp
+++ b/plugins/SpellChecker/src/autoreplace.cpp
@@ -24,13 +24,13 @@ AutoReplacement::AutoReplacement()
{
}
-AutoReplacement::AutoReplacement(const TCHAR *replace, BOOL useVariables)
+AutoReplacement::AutoReplacement(const wchar_t *replace, BOOL useVariables)
: replace(replace), useVariables(useVariables)
{
}
-AutoReplaceMap::AutoReplaceMap(TCHAR *aFilename, Dictionary *dict)
+AutoReplaceMap::AutoReplaceMap(wchar_t *aFilename, Dictionary *dict)
{
m_dict = dict;
mir_tstrncpy(m_filename, aFilename, _countof(m_filename));
@@ -39,7 +39,7 @@ AutoReplaceMap::AutoReplaceMap(TCHAR *aFilename, Dictionary *dict)
void AutoReplaceMap::loadAutoReplaceMap()
{
- FILE *file = _tfopen(m_filename, L"rb");
+ FILE *file = _wfopen(m_filename, L"rb");
if (file == NULL)
return;
@@ -88,17 +88,17 @@ void AutoReplaceMap::loadAutoReplaceMap()
void AutoReplaceMap::writeAutoReplaceMap()
{
// Create path
- TCHAR *p = _tcsrchr(m_filename, _T('\\'));
+ wchar_t *p = wcsrchr(m_filename, '\\');
if (p != NULL) {
*p = 0;
CreateDirectoryTreeT(m_filename);
- *p = _T('\\');
+ *p = '\\';
}
// Write it
- FILE *file = _tfopen(m_filename, L"wb");
+ FILE *file = _wfopen(m_filename, L"wb");
if (file != NULL) {
- map<tstring, AutoReplacement>::iterator it = m_replacements.begin();
+ map<std::wstring, AutoReplacement>::iterator it = m_replacements.begin();
for (; it != m_replacements.end(); it++) {
AutoReplacement &ar = it->second;
@@ -115,32 +115,32 @@ void AutoReplaceMap::writeAutoReplaceMap()
}
-BOOL AutoReplaceMap::isWordChar(TCHAR c)
+BOOL AutoReplaceMap::isWordChar(wchar_t c)
{
if (IsNumber(c))
return TRUE;
- if (_tcschr(L"-_.!@#$%&*()[]{}<>:?/\\=+", c) != NULL)
+ if (wcschr(L"-_.!@#$%&*()[]{}<>:?/\\=+", c) != NULL)
return TRUE;
return m_dict->isWordChar(c);
}
-TCHAR* AutoReplaceMap::autoReplace(const TCHAR * word)
+wchar_t* AutoReplaceMap::autoReplace(const wchar_t * word)
{
- scoped_free<TCHAR> from = _tcslwr(_tcsdup(word));
+ scoped_free<wchar_t> from = wcslwr(wcsdup(word));
if (m_replacements.find(from.get()) == m_replacements.end())
return NULL;
AutoReplacement &ar = m_replacements[from.get()];
- TCHAR *to;
+ wchar_t *to;
if (ar.useVariables)
- to = variables_parsedup((TCHAR *)ar.replace.c_str(), (TCHAR *)word, NULL);
+ to = variables_parsedup((wchar_t *)ar.replace.c_str(), (wchar_t *)word, NULL);
else
- to = _tcsdup(ar.replace.c_str());
+ to = wcsdup(ar.replace.c_str());
// Wich case to use?
size_t len = mir_tstrlen(word);
@@ -156,17 +156,17 @@ TCHAR* AutoReplaceMap::autoReplace(const TCHAR * word)
return CharUpper(to);
// First upper
- TCHAR tmp[2];
+ wchar_t tmp[2];
tmp[0] = to[0];
- tmp[1] = _T('\0');
+ tmp[1] = '\0';
CharUpper(tmp);
to[0] = tmp[0];
return to;
}
-TCHAR* AutoReplaceMap::filterText(const TCHAR *find)
+wchar_t* AutoReplaceMap::filterText(const wchar_t *find)
{
- TCHAR *ret = _tcsdup(find);
+ wchar_t *ret = wcsdup(find);
int len = mir_tstrlen(ret);
int pos = 0;
for (int i = 0; i < len; i++)
@@ -176,27 +176,27 @@ TCHAR* AutoReplaceMap::filterText(const TCHAR *find)
return CharLower(ret);
}
-void AutoReplaceMap::add(const TCHAR * aFrom, const TCHAR * to, BOOL useVariables)
+void AutoReplaceMap::add(const wchar_t * aFrom, const wchar_t * to, BOOL useVariables)
{
- scoped_free<TCHAR> from = filterText(aFrom);
+ scoped_free<wchar_t> from = filterText(aFrom);
m_replacements[from.get()] = AutoReplacement(to, useVariables);
writeAutoReplaceMap();
}
-void AutoReplaceMap::copyMap(map<tstring, AutoReplacement> *replacements)
+void AutoReplaceMap::copyMap(map<std::wstring, AutoReplacement> *replacements)
{
*replacements = m_replacements;
}
-void AutoReplaceMap::setMap(const map<tstring, AutoReplacement> &replacements)
+void AutoReplaceMap::setMap(const map<std::wstring, AutoReplacement> &replacements)
{
m_replacements.clear();
- map<tstring, AutoReplacement>::const_iterator it = replacements.begin();
+ map<std::wstring, AutoReplacement>::const_iterator it = replacements.begin();
for (; it != replacements.end(); it++) {
- scoped_free<TCHAR> from = filterText(it->first.c_str());
+ scoped_free<wchar_t> from = filterText(it->first.c_str());
m_replacements[from.get()] = it->second;
}
diff --git a/plugins/SpellChecker/src/autoreplace.h b/plugins/SpellChecker/src/autoreplace.h
index 8a81fdfcbf..316f015e0d 100644
--- a/plugins/SpellChecker/src/autoreplace.h
+++ b/plugins/SpellChecker/src/autoreplace.h
@@ -24,11 +24,11 @@ Boston, MA 02111-1307, USA.
struct AutoReplacement
{
- tstring replace;
+ std::wstring replace;
BOOL useVariables;
AutoReplacement();
- AutoReplacement(const TCHAR *replace, BOOL useVariables);
+ AutoReplacement(const wchar_t *replace, BOOL useVariables);
};
@@ -38,31 +38,31 @@ class Dictionary;
class AutoReplaceMap
{
private:
- TCHAR m_filename[1024];
+ wchar_t m_filename[1024];
Dictionary *m_dict;
- map<tstring, AutoReplacement> m_replacements;
+ map<std::wstring, AutoReplacement> m_replacements;
void loadAutoReplaceMap();
void writeAutoReplaceMap();
public:
- AutoReplaceMap(TCHAR *filename, Dictionary *dict);
+ AutoReplaceMap(wchar_t *filename, Dictionary *dict);
- TCHAR* filterText(const TCHAR *find);
- BOOL isWordChar(TCHAR c);
+ wchar_t* filterText(const wchar_t *find);
+ BOOL isWordChar(wchar_t c);
/// Return an auto replacement to a word or NULL if none exists.
/// You have to free the item.
- TCHAR* autoReplace(const TCHAR *word);
+ wchar_t* autoReplace(const wchar_t *word);
/// Add a word to the list of auto-replaced words
- void add(const TCHAR *from, const TCHAR *to, BOOL useVariables = FALSE);
+ void add(const wchar_t *from, const wchar_t *to, BOOL useVariables = FALSE);
/// Make a copy of the auto replace map
- void copyMap(map<tstring, AutoReplacement> *replacements);
+ void copyMap(map<std::wstring, AutoReplacement> *replacements);
/// Make a copy of the auto replace map
- void setMap(const map<tstring, AutoReplacement> &replacements);
+ void setMap(const map<std::wstring, AutoReplacement> &replacements);
};
diff --git a/plugins/SpellChecker/src/dictionary.cpp b/plugins/SpellChecker/src/dictionary.cpp
index 58218fc2b1..efad448000 100644
--- a/plugins/SpellChecker/src/dictionary.cpp
+++ b/plugins/SpellChecker/src/dictionary.cpp
@@ -25,16 +25,16 @@ Boston, MA 02111-1307, USA.
// Additional languages that i could not find in Windows
struct {
- TCHAR *language;
- TCHAR *localized_name;
+ wchar_t *language;
+ wchar_t *localized_name;
} aditionalLanguages[] = {
- { L"tl_PH", LPGENT("Tagalog (Philippines)") },
- { L"de_frami_neu", LPGENT("German (Germany)") }
+ { L"tl_PH", LPGENW("Tagalog (Philippines)") },
+ { L"de_frami_neu", LPGENW("German (Germany)") }
};
struct {
- TCHAR *name;
- TCHAR *key;
+ wchar_t *name;
+ wchar_t *key;
} otherHunspellApps[] = {
{ L"Thunderbird", L"thunderbird.exe" },
{ L"Firefox", L"firefox.exe" }
@@ -355,19 +355,19 @@ void LoadThread(LPVOID hd);
class HunspellDictionary : public Dictionary
{
protected:
- TCHAR fileWithoutExtension[1024];
- TCHAR userPath[1024];
+ wchar_t fileWithoutExtension[1024];
+ wchar_t userPath[1024];
volatile int loaded;
Hunspell *hunspell;
- TCHAR *wordChars;
+ wchar_t *wordChars;
UINT codePage;
void loadCustomDict()
{
- TCHAR filename[1024];
+ wchar_t filename[1024];
mir_sntprintf(filename, L"%s\\%s.cdic", userPath, language);
- FILE *file = _tfopen(filename, L"rb");
+ FILE *file = _wfopen(filename, L"rb");
if (file != NULL) {
char tmp[1024];
int c, pos = 0;
@@ -388,14 +388,14 @@ protected:
}
}
- void appendToCustomDict(const TCHAR *word)
+ void appendToCustomDict(const wchar_t *word)
{
CreateDirectoryTreeT(userPath);
- TCHAR filename[1024];
+ wchar_t filename[1024];
mir_sntprintf(filename, L"%s\\%s.cdic", userPath, language);
- FILE *file = _tfopen(filename, L"ab");
+ FILE *file = _wfopen(filename, L"ab");
if (file != NULL) {
char tmp[1024];
toHunspell(tmp, word, _countof(tmp));
@@ -404,7 +404,7 @@ protected:
}
}
- virtual void addWordInternal(const TCHAR * word)
+ virtual void addWordInternal(const wchar_t * word)
{
if (loaded != LANGUAGE_LOADED)
return;
@@ -415,12 +415,12 @@ protected:
hunspell->add(hunspell_word);
}
- void toHunspell(char *hunspellWord, const TCHAR *word, size_t hunspellWordLen)
+ void toHunspell(char *hunspellWord, const wchar_t *word, size_t hunspellWordLen)
{
WideCharToMultiByte(codePage, 0, word, -1, hunspellWord, (int)hunspellWordLen, NULL, NULL);
}
- TCHAR* fromHunspell(const char *hunspellWord)
+ wchar_t* fromHunspell(const char *hunspellWord)
{
int len = MultiByteToWideChar(codePage, 0, hunspellWord, -1, NULL, 0);
WCHAR *ret = (WCHAR *)malloc((len + 1) * sizeof(WCHAR));
@@ -428,31 +428,31 @@ protected:
return ret;
}
- TCHAR* fromHunspellAndFree(char *hunspellWord)
+ wchar_t* fromHunspellAndFree(char *hunspellWord)
{
if (hunspellWord == NULL)
return NULL;
- TCHAR *ret = fromHunspell(hunspellWord);
+ wchar_t *ret = fromHunspell(hunspellWord);
free(hunspellWord);
return ret;
}
public:
- HunspellDictionary(TCHAR *aLanguage, TCHAR *aFileWithoutExtension, TCHAR *anUserPath, TCHAR *aSource)
+ HunspellDictionary(wchar_t *aLanguage, wchar_t *aFileWithoutExtension, wchar_t *anUserPath, wchar_t *aSource)
{
mir_tstrncpy(language, aLanguage, _countof(language));
mir_tstrncpy(fileWithoutExtension, aFileWithoutExtension, _countof(fileWithoutExtension));
mir_tstrncpy(userPath, anUserPath, _countof(userPath));
if (aSource == NULL)
- source[0] = _T('\0');
+ source[0] = '\0';
else
mir_tstrncpy(source, aSource, _countof(source));
loaded = LANGUAGE_NOT_LOADED;
- localized_name[0] = _T('\0');
- english_name[0] = _T('\0');
- full_name[0] = _T('\0');
+ localized_name[0] = '\0';
+ english_name[0] = '\0';
+ full_name[0] = '\0';
hunspell = NULL;
wordChars = NULL;
codePage = CP_ACP;
@@ -467,14 +467,14 @@ public:
free(wordChars);
}
- TCHAR * merge(TCHAR * s1, TCHAR *s2)
+ wchar_t * merge(wchar_t * s1, wchar_t *s2)
{
int len1 = (s1 == NULL ? 0 : mir_tstrlen(s1));
int len2 = (s2 == NULL ? 0 : mir_tstrlen(s2));
- TCHAR *ret;
+ wchar_t *ret;
if (len1 > 0 && len2 > 0) {
- ret = (TCHAR *)malloc(sizeof(TCHAR) * (len1 + len2 + 1));
+ ret = (wchar_t *)malloc(sizeof(wchar_t) * (len1 + len2 + 1));
mir_tstrncpy(ret, s1, len1 + 1);
mir_tstrncpy(&ret[len1], s2, len2 + 1);
@@ -490,7 +490,7 @@ public:
FREE(s1);
}
else {
- ret = (TCHAR *)malloc(sizeof(TCHAR));
+ ret = (wchar_t *)malloc(sizeof(wchar_t));
ret[0] = 0;
FREE(s1);
@@ -500,13 +500,13 @@ public:
// Remove duplicated chars
int last = mir_tstrlen(ret) - 1;
for (int i = 0; i <= last; i++) {
- TCHAR c = ret[i];
+ wchar_t c = ret[i];
for (int j = last; j > i; j--) {
if (c != ret[j])
continue;
if (j != last)
ret[j] = ret[last];
- ret[last] = _T('\0');
+ ret[last] = '\0';
last--;
}
}
@@ -530,7 +530,7 @@ public:
// Get codepage
const char *dic_enc = hunspell->get_dic_encoding();
- TCHAR *hwordchars;
+ wchar_t *hwordchars;
if (mir_strcmp(dic_enc, "UTF-8") == 0) {
codePage = CP_UTF8;
@@ -550,8 +550,8 @@ public:
hwordchars = fromHunspell(hunspell->get_wordchars());
}
- TCHAR *casechars = fromHunspellAndFree(get_casechars(dic_enc));
- TCHAR *try_string = fromHunspellAndFree(hunspell->get_try_string());
+ wchar_t *casechars = fromHunspellAndFree(get_casechars(dic_enc));
+ wchar_t *try_string = fromHunspellAndFree(hunspell->get_try_string());
wordChars = merge(merge(casechars, hwordchars), try_string);
@@ -569,7 +569,7 @@ public:
}
// Return TRUE if the word is correct
- virtual BOOL spell(const TCHAR *word)
+ virtual BOOL spell(const wchar_t *word)
{
load();
if (loaded != LANGUAGE_LOADED)
@@ -584,7 +584,7 @@ public:
}
// Return a list of suggestions to a word
- virtual Suggestions suggest(const TCHAR * word)
+ virtual Suggestions suggest(const wchar_t * word)
{
Suggestions ret = { 0 };
@@ -600,7 +600,7 @@ public:
if (ret.count > 0 && words != NULL) {
// Oki, lets make our array
- ret.words = (TCHAR **)malloc(ret.count * sizeof(TCHAR *));
+ ret.words = (wchar_t **)malloc(ret.count * sizeof(wchar_t *));
for (unsigned i = 0; i < ret.count; i++) {
ret.words[i] = fromHunspell(words[i]);
free(words[i]);
@@ -613,7 +613,7 @@ public:
}
// Return a list of auto suggestions to a word
- virtual Suggestions autoSuggest(const TCHAR * word)
+ virtual Suggestions autoSuggest(const wchar_t * word)
{
Suggestions ret = { 0 };
@@ -632,7 +632,7 @@ public:
// Oki, lets make our array
ret.count = count;
- ret.words = (TCHAR **)malloc(ret.count * sizeof(TCHAR *));
+ ret.words = (wchar_t **)malloc(ret.count * sizeof(wchar_t *));
for (int i = 0; i < count; i++) {
ret.words[i] = fromHunspell(words[i]);
free(words[i]);
@@ -644,7 +644,7 @@ public:
// Return a list of auto suggestions to a word
// You have to free the list AND each item
- virtual TCHAR * autoSuggestOne(const TCHAR * word)
+ virtual wchar_t * autoSuggestOne(const wchar_t * word)
{
load();
if (loaded != LANGUAGE_LOADED)
@@ -659,7 +659,7 @@ public:
if (count <= 0)
return NULL;
- TCHAR *ret = fromHunspell(words[0]);
+ wchar_t *ret = fromHunspell(words[0]);
// Oki, lets make our array
for (int i = 0; i < count; i++)
@@ -670,7 +670,7 @@ public:
}
// Return TRUE if the char is a word char
- virtual BOOL isWordChar(TCHAR c)
+ virtual BOOL isWordChar(wchar_t c)
{
if (c == 0)
return FALSE;
@@ -679,7 +679,7 @@ public:
if (loaded != LANGUAGE_LOADED)
return TRUE;
- return _tcschr(wordChars, (_TINT)c) != NULL;
+ return wcschr(wordChars, (_TINT)c) != NULL;
}
// Assert that all needed data is loaded
@@ -698,14 +698,14 @@ public:
// Add a word to the user custom dict
- virtual void addWord(const TCHAR * word)
+ virtual void addWord(const wchar_t * word)
{
addWordInternal(word);
appendToCustomDict(word);
}
// Add a word to the list of ignored words
- virtual void ignoreWord(const TCHAR * word)
+ virtual void ignoreWord(const wchar_t * word)
{
addWordInternal(word);
}
@@ -725,15 +725,15 @@ LIST<Dictionary> *tmp_dicts;
// To get the names of the languages
BOOL CALLBACK EnumLocalesProc(LPTSTR lpLocaleString)
{
- TCHAR *stopped = NULL;
- USHORT langID = (USHORT)_tcstol(lpLocaleString, &stopped, 16);
+ wchar_t *stopped = NULL;
+ USHORT langID = (USHORT)wcstol(lpLocaleString, &stopped, 16);
- TCHAR ini[32];
- TCHAR end[32];
+ wchar_t ini[32];
+ wchar_t end[32];
GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SISO639LANGNAME, ini, _countof(ini));
GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SISO3166CTRYNAME, end, _countof(end));
- TCHAR name[64];
+ wchar_t name[64];
mir_sntprintf(name, L"%s_%s", ini, end);
for (int i = 0; i < tmp_dicts->getCount(); i++) {
@@ -747,10 +747,10 @@ BOOL CALLBACK EnumLocalesProc(LPTSTR lpLocaleString)
if (dict->localized_name[0] == 0)
GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SNATIVEDISPLAYNAME, dict->localized_name, _countof(dict->localized_name));
if (dict->localized_name[0] == 0 && dict->english_name[0] != 0) {
- TCHAR country[1024];
+ wchar_t country[1024];
GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SENGCOUNTRY, country, _countof(country));
- TCHAR localName[1024];
+ wchar_t localName[1024];
if (country[0] != 0)
mir_sntprintf(localName, L"%s (%s)", dict->english_name, country);
else
@@ -778,7 +778,7 @@ void GetDictsInfo(LIST<Dictionary> &dicts)
for (int i = 0; i < dicts.getCount(); i++) {
Dictionary *dict = dicts[i];
- if (dict->full_name[0] == _T('\0')) {
+ if (dict->full_name[0] == '\0') {
DBVARIANT dbv;
char lang[128];
@@ -788,7 +788,7 @@ void GetDictsInfo(LIST<Dictionary> &dicts)
db_free(&dbv);
}
- if (dict->localized_name[0] == _T('\0')) {
+ if (dict->localized_name[0] == '\0') {
for (size_t j = 0; j < _countof(aditionalLanguages); j++) {
if (!mir_tstrcmp(aditionalLanguages[j].language, dict->language)) {
mir_tstrncpy(dict->localized_name, TranslateTS(aditionalLanguages[j].localized_name), _countof(dict->localized_name));
@@ -797,7 +797,7 @@ void GetDictsInfo(LIST<Dictionary> &dicts)
}
}
- if (dict->localized_name[0] != _T('\0')) {
+ if (dict->localized_name[0] != '\0') {
mir_sntprintf(dict->full_name, L"%s [%s]", dict->localized_name, dict->language);
}
else {
@@ -808,10 +808,10 @@ void GetDictsInfo(LIST<Dictionary> &dicts)
}
-void GetHunspellDictionariesFromFolder(LIST<Dictionary> &dicts, TCHAR *path, TCHAR *user_path, TCHAR *source)
+void GetHunspellDictionariesFromFolder(LIST<Dictionary> &dicts, wchar_t *path, wchar_t *user_path, wchar_t *source)
{
// Load the language files and create an array with then
- TCHAR file[1024] = { 0 };
+ wchar_t file[1024] = { 0 };
mir_sntprintf(file, L"%s\\*.dic", path);
BOOL found = FALSE;
@@ -833,14 +833,14 @@ void GetHunspellDictionariesFromFolder(LIST<Dictionary> &dicts, TCHAR *path, TCH
if (attrib == 0xFFFFFFFF || (attrib & FILE_ATTRIBUTE_DIRECTORY))
continue;
- ffd.cFileName[mir_tstrlen(ffd.cFileName) - 4] = _T('\0');
+ ffd.cFileName[mir_tstrlen(ffd.cFileName) - 4] = '\0';
- TCHAR *lang = ffd.cFileName;
+ wchar_t *lang = ffd.cFileName;
// Replace - for _
for (size_t i = 0; i < mir_tstrlen(lang); i++)
- if (lang[i] == _T('-'))
- lang[i] = _T('_');
+ if (lang[i] == '-')
+ lang[i] = '_';
// Check if dict is new
bool exists = false;
@@ -850,7 +850,7 @@ void GetHunspellDictionariesFromFolder(LIST<Dictionary> &dicts, TCHAR *path, TCH
if (!exists) {
found = TRUE;
- file[mir_tstrlen(file) - 4] = _T('\0');
+ file[mir_tstrlen(file) - 4] = '\0';
dicts.insert(new HunspellDictionary(lang, file, user_path, source));
}
} while (FindNextFile(hFFD, &ffd));
@@ -861,7 +861,7 @@ void GetHunspellDictionariesFromFolder(LIST<Dictionary> &dicts, TCHAR *path, TCH
// Return a list of avaible languages
-void GetAvaibleDictionaries(LIST<Dictionary> &dicts, TCHAR *path, TCHAR *user_path)
+void GetAvaibleDictionaries(LIST<Dictionary> &dicts, wchar_t *path, wchar_t *user_path)
{
// Get miranda folder dicts
GetHunspellDictionariesFromFolder(dicts, path, user_path, NULL);
@@ -869,7 +869,7 @@ void GetAvaibleDictionaries(LIST<Dictionary> &dicts, TCHAR *path, TCHAR *user_pa
if (opts.use_other_apps_dicts) {
// Get other apps dicts
for (int i = 0; i < _countof(otherHunspellApps); i++) {
- TCHAR key[1024];
+ wchar_t key[1024];
mir_sntprintf(key, APPPATH, otherHunspellApps[i].key);
HKEY hKey = 0;
@@ -893,8 +893,8 @@ void GetAvaibleDictionaries(LIST<Dictionary> &dicts, TCHAR *path, TCHAR *user_pa
if (ERROR_SUCCESS != RegEnumValue(hKey, local, key, &cchValue, NULL, NULL, NULL, NULL))
break;
key[cchValue] = 0;
- TCHAR *pos;
- if (pos = _tcsrchr(key, _T('\\'))) {
+ wchar_t *pos;
+ if (pos = wcsrchr(key, '\\')) {
if (!mir_tstrcmpi(&pos[1], otherHunspellApps[i].key)) {
pos[0] = 0;
lResult = ERROR_SUCCESS;
@@ -907,7 +907,7 @@ void GetAvaibleDictionaries(LIST<Dictionary> &dicts, TCHAR *path, TCHAR *user_pa
}
if (ERROR_SUCCESS == lResult) {
- TCHAR folder[1024];
+ wchar_t folder[1024];
mir_sntprintf(folder, L"%s\\Dictionaries", key);
GetHunspellDictionariesFromFolder(languages, folder, user_path, otherHunspellApps[i].name);
diff --git a/plugins/SpellChecker/src/dictionary.h b/plugins/SpellChecker/src/dictionary.h
index 09902435f6..da70a6a4c2 100644
--- a/plugins/SpellChecker/src/dictionary.h
+++ b/plugins/SpellChecker/src/dictionary.h
@@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA.
struct Suggestions {
- TCHAR ** words;
+ wchar_t ** words;
size_t count;
};
@@ -32,37 +32,37 @@ struct Suggestions {
// All dictionaries use a lazy interface
class Dictionary {
public:
- TCHAR language[128];
- TCHAR localized_name[128];
- TCHAR english_name[128];
- TCHAR full_name[256];
- TCHAR source[128];
+ wchar_t language[128];
+ wchar_t localized_name[128];
+ wchar_t english_name[128];
+ wchar_t full_name[256];
+ wchar_t source[128];
AutoReplaceMap *autoReplace;
HANDLE hIcolib;
virtual ~Dictionary();
// Return TRUE if the word is correct
- virtual BOOL spell(const TCHAR *) = 0;
+ virtual BOOL spell(const wchar_t *) = 0;
// Return a list of suggestions to a word
- virtual Suggestions suggest(const TCHAR * word) = 0;
+ virtual Suggestions suggest(const wchar_t * word) = 0;
// Return a list of auto suggestions to a word
- virtual Suggestions autoSuggest(const TCHAR * word) = 0;
+ virtual Suggestions autoSuggest(const wchar_t * word) = 0;
// Return a auto suggestions to a word
// You have to free the item
- virtual TCHAR * autoSuggestOne(const TCHAR * word) = 0;
+ virtual wchar_t * autoSuggestOne(const wchar_t * word) = 0;
// Return TRUE if the char is a word char
- virtual BOOL isWordChar(TCHAR c) = 0;
+ virtual BOOL isWordChar(wchar_t c) = 0;
// Add a word to the user custom dict
- virtual void addWord(const TCHAR * word) = 0;
+ virtual void addWord(const wchar_t * word) = 0;
// Add a word to the list of ignored words
- virtual void ignoreWord(const TCHAR * word) = 0;
+ virtual void ignoreWord(const wchar_t * word) = 0;
// Assert that all needed data is loaded
virtual void load() = 0;
@@ -74,7 +74,7 @@ public:
// Return a list of avaible languages
-void GetAvaibleDictionaries(LIST<Dictionary> &dicts, TCHAR *path, TCHAR *user_path);
+void GetAvaibleDictionaries(LIST<Dictionary> &dicts, wchar_t *path, wchar_t *user_path);
// Free the list returned by GetAvaibleDictionaries
void FreeDictionaries(LIST<Dictionary> &dicts);
diff --git a/plugins/SpellChecker/src/options.cpp b/plugins/SpellChecker/src/options.cpp
index ed625ab6f2..c0bc78ab5a 100644
--- a/plugins/SpellChecker/src/options.cpp
+++ b/plugins/SpellChecker/src/options.cpp
@@ -88,7 +88,7 @@ void LoadOptions()
LoadOpts(autoReplaceControls, _countof(autoReplaceControls), MODULE_NAME);
if (languages.getCount() <= 0) {
- opts.default_language[0] = _T('\0');
+ opts.default_language[0] = '\0';
return;
}
@@ -213,7 +213,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (sel >= languages.getCount())
sel = 0;
db_set_ts(NULL, MODULE_NAME, "DefaultLanguage",
- (TCHAR *)languages[sel]->language);
+ (wchar_t *)languages[sel]->language);
mir_tstrcpy(opts.default_language, languages[sel]->language);
}
}
@@ -247,21 +247,21 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
struct AutoreplaceData
{
Dictionary *dict;
- map<tstring, AutoReplacement> autoReplaceMap;
+ map<std::wstring, AutoReplacement> autoReplaceMap;
BOOL initialized;
BOOL changed;
AutoreplaceData(Dictionary *dict) : dict(dict), initialized(FALSE), changed(FALSE) {}
- void RemoveWord(const TCHAR *aWord)
+ void RemoveWord(const wchar_t *aWord)
{
- map<tstring, AutoReplacement>::iterator it = autoReplaceMap.find(aWord);
+ map<std::wstring, AutoReplacement>::iterator it = autoReplaceMap.find(aWord);
if (it != autoReplaceMap.end())
autoReplaceMap.erase(it);
changed = TRUE;
}
- void AddWord(const TCHAR *find, const TCHAR *replace, BOOL useVars)
+ void AddWord(const wchar_t *find, const wchar_t *replace, BOOL useVars)
{
autoReplaceMap[find] = AutoReplacement(replace, useVars);
changed = TRUE;
@@ -302,26 +302,26 @@ static void LoadReplacements(HWND hwndDlg)
data->initialized = TRUE;
}
- map<tstring, AutoReplacement>::iterator it = data->autoReplaceMap.begin();
+ map<std::wstring, AutoReplacement>::iterator it = data->autoReplaceMap.begin();
for (int i = 0; it != data->autoReplaceMap.end(); it++, i++) {
LVITEM item = { 0 };
item.mask = LVIF_TEXT | LVIF_PARAM;
item.iItem = i;
item.iSubItem = 0;
- item.pszText = (TCHAR *)it->first.c_str();
+ item.pszText = (wchar_t *)it->first.c_str();
item.lParam = i;
ListView_InsertItem(hList, &item);
- ListView_SetItemText(hList, i, 1, (TCHAR *)it->second.replace.c_str());
+ ListView_SetItemText(hList, i, 1, (wchar_t *)it->second.replace.c_str());
}
EnableDisableCtrls(hwndDlg);
}
static void SaveNewReplacements(BOOL canceled, Dictionary*,
- const TCHAR *find, const TCHAR *replace, BOOL useVariables,
- const TCHAR *original_find, void *param)
+ const wchar_t *find, const wchar_t *replace, BOOL useVariables,
+ const wchar_t *original_find, void *param)
{
if (canceled)
return;
@@ -342,8 +342,8 @@ static void ShowAddReplacement(HWND hwndDlg, int item = -1)
AutoreplaceData *data = (AutoreplaceData *)SendDlgItemMessage(hwndDlg, IDC_LANGUAGE, CB_GETITEMDATA, sel, 0);
- TCHAR find[256];
- const TCHAR *replace = NULL;
+ wchar_t find[256];
+ const wchar_t *replace = NULL;
BOOL useVariables = FALSE;
if (item < 0)
@@ -430,7 +430,7 @@ static INT_PTR CALLBACK AutoreplaceDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
sel = SendMessage(hList, LVM_GETNEXTITEM, -1, LVNI_SELECTED);
while (sel >= 0) {
- TCHAR tmp[256];
+ wchar_t tmp[256];
ListView_GetItemText(hList, sel, 0, tmp, _countof(tmp));
data->RemoveWord(tmp);
diff --git a/plugins/SpellChecker/src/options.h b/plugins/SpellChecker/src/options.h
index 65e33c0f4e..8d699d4adf 100644
--- a/plugins/SpellChecker/src/options.h
+++ b/plugins/SpellChecker/src/options.h
@@ -31,7 +31,7 @@ Boston, MA 02111-1307, USA.
struct Options
{
- TCHAR default_language[32];
+ wchar_t default_language[32];
BOOL auto_replace_dict;
BOOL auto_replace_user;
BOOL ignore_uppercase;
diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp
index 7d12a021f5..e6217118c4 100644
--- a/plugins/SpellChecker/src/spellchecker.cpp
+++ b/plugins/SpellChecker/src/spellchecker.cpp
@@ -40,13 +40,13 @@ HINSTANCE hInst;
int hLangpack = 0;
HANDLE hDictionariesFolder = NULL;
-TCHAR *dictionariesFolder;
+wchar_t *dictionariesFolder;
HANDLE hCustomDictionariesFolder = NULL;
-TCHAR *customDictionariesFolder;
+wchar_t *customDictionariesFolder;
HANDLE hFlagsDllFolder = NULL;
-TCHAR *flagsDllFolder;
+wchar_t *flagsDllFolder;
HBITMAP hCheckedBmp;
BITMAP bmpChecked;
@@ -79,7 +79,7 @@ static int IconsChanged(WPARAM, LPARAM)
for (int i = 0; i < languages.getCount(); i++) {
sid.dwId = i;
- TCHAR tmp[128];
+ wchar_t tmp[128];
mir_sntprintf(tmp, L"%s - %s", TranslateT("Spell Checker"), languages[i]->full_name);
sid.tszTooltip = tmp;
@@ -108,19 +108,19 @@ static int ModulesLoaded(WPARAM, LPARAM)
// Folders plugin support
if (hDictionariesFolder = FoldersRegisterCustomPathT(LPGEN("Spell Checker"), LPGEN("Dictionaries"), DICTIONARIES_FOLDER)) {
- dictionariesFolder = (TCHAR *)mir_alloc(sizeof(TCHAR) * MAX_PATH);
+ dictionariesFolder = (wchar_t *)mir_alloc(sizeof(wchar_t) * MAX_PATH);
FoldersGetCustomPathT(hDictionariesFolder, dictionariesFolder, MAX_PATH, L".");
}
else dictionariesFolder = Utils_ReplaceVarsT(DICTIONARIES_FOLDER);
if (hCustomDictionariesFolder = FoldersRegisterCustomPathT(LPGEN("Spell Checker"), LPGEN("Custom Dictionaries"), CUSTOM_DICTIONARIES_FOLDER)) {
- customDictionariesFolder = (TCHAR *)mir_alloc(sizeof(TCHAR) * MAX_PATH);
+ customDictionariesFolder = (wchar_t *)mir_alloc(sizeof(wchar_t) * MAX_PATH);
FoldersGetCustomPathT(hCustomDictionariesFolder, customDictionariesFolder, MAX_PATH, L".");
}
else customDictionariesFolder = Utils_ReplaceVarsT(CUSTOM_DICTIONARIES_FOLDER);
if (hFlagsDllFolder = FoldersRegisterCustomPathT(LPGEN("Spell Checker"), LPGEN("Flags DLL"), FLAGS_DLL_FOLDER)) {
- flagsDllFolder = (TCHAR *)mir_alloc(sizeof(TCHAR) * MAX_PATH);
+ flagsDllFolder = (wchar_t *)mir_alloc(sizeof(wchar_t) * MAX_PATH);
FoldersGetCustomPathT(hFlagsDllFolder, flagsDllFolder, MAX_PATH, L".");
}
else flagsDllFolder = Utils_ReplaceVarsT(FLAGS_DLL_FOLDER);
@@ -133,21 +133,21 @@ static int ModulesLoaded(WPARAM, LPARAM)
if (opts.use_flags) {
// Load flags dll
- TCHAR flag_file[MAX_PATH];
+ wchar_t flag_file[MAX_PATH];
mir_sntprintf(flag_file, L"%s\\flags_icons.dll", flagsDllFolder);
HMODULE hFlagsDll = LoadLibraryEx(flag_file, NULL, LOAD_LIBRARY_AS_DATAFILE);
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
GetModuleFileName(hInst, path, MAX_PATH);
SKINICONDESC sid = { 0 };
sid.flags = SIDF_ALL_TCHAR | SIDF_SORTED;
- sid.section.t = LPGENT("Spell Checker") L"/" LPGENT("Flags");
+ sid.section.w = LPGENW("Spell Checker") L"/" LPGENW("Flags");
// Get language flags
for (int i = 0; i < languages.getCount(); i++) {
Dictionary *p = languages[i];
- sid.description.t = p->full_name;
+ sid.description.w = p->full_name;
char lang[32];
mir_snprintf(lang, "spell_lang_%d", i);
@@ -159,13 +159,13 @@ static int ModulesLoaded(WPARAM, LPARAM)
if (hFlag != NULL) {
sid.hDefaultIcon = hFlag;
- sid.defaultFile.t = NULL;
+ sid.defaultFile.w = NULL;
sid.iDefaultIndex = 0;
}
else {
hFlagIcoLib = IcoLib_GetIcon("spellchecker_unknown");
sid.hDefaultIcon = hFlagIcoLib;
- sid.defaultFile.t = NULL;
+ sid.defaultFile.w = NULL;
sid.iDefaultIndex = 0;
}
@@ -183,7 +183,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
for (int j = 0; j < languages.getCount(); j++) {
Dictionary *dict = languages[j];
- TCHAR filename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
mir_sntprintf(filename, L"%s\\%s.ar", customDictionariesFolder, dict->language);
dict->autoReplace = new AutoReplaceMap(filename, dict);
@@ -204,7 +204,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
for (int i = 0; i < languages.getCount(); i++) {
sid.dwId = i;
- TCHAR tmp[128];
+ wchar_t tmp[128];
mir_sntprintf(tmp, L"%s - %s", TranslateT("Spell Checker"), languages[i]->full_name);
sid.tszTooltip = tmp;
sid.hIcon = (opts.use_flags) ? IcoLib_GetIconByHandle(languages[i]->hIcolib) : IcoLib_GetIcon("spellchecker_enabled");
diff --git a/plugins/SpellChecker/src/stdafx.h b/plugins/SpellChecker/src/stdafx.h
index 66e5e39f3f..ea4ea9b6bc 100644
--- a/plugins/SpellChecker/src/stdafx.h
+++ b/plugins/SpellChecker/src/stdafx.h
@@ -96,7 +96,7 @@ extern HBITMAP hCheckedBmp;
struct WrongWordPopupMenuData
{
Suggestions suggestions;
- TCHAR *word;
+ wchar_t *word;
CHARRANGE pos;
HMENU hMeSubMenu;
HMENU hCorrectSubMenu;
@@ -110,7 +110,7 @@ struct Dialog
MCONTACT hContact;
char name[64];
Dictionary *lang;
- TCHAR lang_name[32];
+ wchar_t lang_name[32];
BOOL enabled;
BOOL srmm;
@@ -129,11 +129,11 @@ struct Dialog
};
static BOOL CenterParent(HWND hwnd);
-TCHAR *lstrtrim(TCHAR *str);
-BOOL lstreq(TCHAR *a, TCHAR *b, size_t len = -1);
-inline BOOL IsNumber(TCHAR c)
+wchar_t *lstrtrim(wchar_t *str);
+BOOL lstreq(wchar_t *a, wchar_t *b, size_t len = -1);
+inline BOOL IsNumber(wchar_t c)
{
- return c >= _T('0') && c <= _T('9');
+ return c >= '0' && c <= '9';
}
int MsgWindowEvent(WPARAM wParam, LPARAM lParam);
@@ -151,9 +151,9 @@ INT_PTR ShowPopupMenuService(WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK MenuWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
void ModifyIcon(Dialog *dlg);
-BOOL GetWordCharRange(Dialog *dlg, CHARRANGE &sel, TCHAR *text, size_t text_len, int &first_char);
-TCHAR *GetWordUnderPoint(Dialog *dlg, POINT pt, CHARRANGE &sel);
+BOOL GetWordCharRange(Dialog *dlg, CHARRANGE &sel, wchar_t *text, size_t text_len, int &first_char);
+wchar_t *GetWordUnderPoint(Dialog *dlg, POINT pt, CHARRANGE &sel);
-int GetClosestLanguage(TCHAR *lang_name);
+int GetClosestLanguage(wchar_t *lang_name);
#endif // __COMMONS_H__
diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp
index 7242f0c98c..7df9b00d14 100644
--- a/plugins/SpellChecker/src/utils.cpp
+++ b/plugins/SpellChecker/src/utils.cpp
@@ -19,7 +19,7 @@ Boston, MA 02111-1307, USA.
#include "stdafx.h"
-typedef void(*FoundWrongWordCallback)(TCHAR *word, CHARRANGE pos, void *param);
+typedef void(*FoundWrongWordCallback)(wchar_t *word, CHARRANGE pos, void *param);
typedef map<HWND, Dialog *> DialogMapType;
DialogMapType dialogs;
@@ -95,20 +95,20 @@ void SetNoUnderline(Dialog *dlg)
dlg->re->Start();
}
-inline BOOL IsURL(TCHAR c)
+inline BOOL IsURL(wchar_t c)
{
- return (c >= _T('a') && c <= _T('z'))
- || (c >= _T('A') && c <= _T('Z'))
+ return (c >= 'a' && c <= 'z')
+ || (c >= 'A' && c <= 'Z')
|| IsNumber(c)
- || c == _T('.') || c == _T('/')
- || c == _T('\\') || c == _T('?')
- || c == _T('=') || c == _T('&')
- || c == _T('%') || c == _T('-')
- || c == _T('_') || c == _T(':')
- || c == _T('@') || c == _T('#');
+ || c == '.' || c == '/'
+ || c == '\\' || c == '?'
+ || c == '=' || c == '&'
+ || c == '%' || c == '-'
+ || c == '_' || c == ':'
+ || c == '@' || c == '#';
}
-int FindURLEnd(Dialog *dlg, TCHAR *text, int start_pos, int *checked_until = NULL)
+int FindURLEnd(Dialog *dlg, wchar_t *text, int start_pos, int *checked_until = NULL)
{
int num_slashes = 0;
int num_ats = 0;
@@ -117,12 +117,12 @@ int FindURLEnd(Dialog *dlg, TCHAR *text, int start_pos, int *checked_until = NUL
int i = start_pos;
for (; IsURL(text[i]) || dlg->lang->isWordChar(text[i]); i++) {
- TCHAR c = text[i];
- if (c == _T('\\') || c == _T('/'))
+ wchar_t c = text[i];
+ if (c == '\\' || c == '/')
num_slashes++;
- else if (c == _T('.'))
+ else if (c == '.')
num_dots++;
- else if (c == _T('@'))
+ else if (c == '@')
num_ats++;
}
@@ -142,7 +142,7 @@ int FindURLEnd(Dialog *dlg, TCHAR *text, int start_pos, int *checked_until = NUL
}
-int ReplaceWord(Dialog *dlg, CHARRANGE &sel, TCHAR *new_word)
+int ReplaceWord(Dialog *dlg, CHARRANGE &sel, wchar_t *new_word)
{
dlg->re->Stop();
dlg->re->ResumeUndo();
@@ -161,10 +161,10 @@ public:
virtual ~TextParser() {}
/// @return true when finished an word
- virtual bool feed(int pos, TCHAR c) = 0;
+ virtual bool feed(int pos, wchar_t c) = 0;
virtual int getFirstCharPos() = 0;
virtual void reset() = 0;
- virtual void deal(const TCHAR *text, bool *mark, bool *replace, TCHAR **replacement) = 0;
+ virtual void deal(const wchar_t *text, bool *mark, bool *replace, wchar_t **replacement) = 0;
};
class SpellParser : public TextParser
@@ -185,14 +185,14 @@ public:
found_real_char = FALSE;
}
- virtual bool feed(int pos, TCHAR c)
+ virtual bool feed(int pos, wchar_t c)
{
// Is inside a word?
if (dict->isWordChar(c) || IsNumber(c)) {
if (last_pos == -1)
last_pos = pos;
- if (c != _T('-') && !IsNumber(c))
+ if (c != '-' && !IsNumber(c))
found_real_char = TRUE;
return false;
@@ -209,7 +209,7 @@ public:
return (!found_real_char) ? -1 : last_pos;
}
- virtual void deal(const TCHAR *text, bool *mark, bool *replace, TCHAR **replacement)
+ virtual void deal(const wchar_t *text, bool *mark, bool *replace, wchar_t **replacement)
{
// Is it correct?
if (dict->spell(text))
@@ -244,7 +244,7 @@ public:
last_pos = -1;
}
- virtual bool feed(int pos, TCHAR c)
+ virtual bool feed(int pos, wchar_t c)
{
// Is inside a word?
if (ar->isWordChar(c)) {
@@ -261,7 +261,7 @@ public:
return last_pos;
}
- virtual void deal(const TCHAR *text, bool*, bool *replace, TCHAR **replacement)
+ virtual void deal(const wchar_t *text, bool*, bool *replace, wchar_t **replacement)
{
*replacement = ar->autoReplace(text);
if (*replacement != NULL)
@@ -274,7 +274,7 @@ int CheckTextLine(Dialog *dlg, int line, TextParser *parser,
const CHARRANGE &ignored, FoundWrongWordCallback callback, void *param)
{
int errors = 0;
- TCHAR text[1024];
+ wchar_t text[1024];
dlg->re->GetLine(line, text, _countof(text));
int len = mir_tstrlen(text);
int first_char = dlg->re->GetFirstCharOfLine(line);
@@ -312,7 +312,7 @@ int CheckTextLine(Dialog *dlg, int line, TextParser *parser,
}
}
else {
- TCHAR c = text[pos];
+ wchar_t c = text[pos];
BOOL feed = parser->feed(pos, c);
if (!feed) {
@@ -356,7 +356,7 @@ int CheckTextLine(Dialog *dlg, int line, TextParser *parser,
bool mark = false;
bool replace = false;
- TCHAR *replacement = NULL;
+ wchar_t *replacement = NULL;
parser->deal(&text[last_pos], &mark, &replace, &replacement);
if (replace) {
@@ -431,12 +431,12 @@ int CheckText(Dialog *dlg, BOOL check_all, FoundWrongWordCallback callback = NUL
return errors;
}
-void ToLocaleID(TCHAR *szKLName, size_t size)
+void ToLocaleID(wchar_t *szKLName, size_t size)
{
- TCHAR *stopped = NULL;
- USHORT langID = (USHORT)_tcstol(szKLName, &stopped, 16);
+ wchar_t *stopped = NULL;
+ USHORT langID = (USHORT)wcstol(szKLName, &stopped, 16);
- TCHAR ini[32], end[32];
+ wchar_t ini[32], end[32];
GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SISO639LANGNAME, ini, _countof(ini));
GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SISO3166CTRYNAME, end, _countof(end));
@@ -445,7 +445,7 @@ void ToLocaleID(TCHAR *szKLName, size_t size)
void LoadDictFromKbdl(Dialog *dlg)
{
- TCHAR szKLName[KL_NAMELENGTH + 1];
+ wchar_t szKLName[KL_NAMELENGTH + 1];
// Use default input language
HKL hkl = GetKeyboardLayout(0);
@@ -500,7 +500,7 @@ LRESULT CALLBACK OwnerProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
if (opts.ask_when_sending_with_error) {
int errors = TimerCheck(dlg, TRUE);
if (errors > 0) {
- TCHAR text[500];
+ wchar_t text[500];
mir_sntprintf(text, TranslateT("There are %d spelling errors. Are you sure you want to send this message?"), errors);
if (MessageBox(hwnd, text, TranslateT("Spell Checker"), MB_ICONQUESTION | MB_YESNO) == IDNO)
return TRUE;
@@ -584,7 +584,7 @@ LRESULT CALLBACK EditProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
break;
{
- TCHAR c = (TCHAR)wParam;
+ wchar_t c = (wchar_t)wParam;
BOOL deleting = (c == VK_BACK || c == VK_DELETE);
// Need to do that to avoid changing the word while typing
@@ -616,7 +616,7 @@ LRESULT CALLBACK EditProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
CHARRANGE sel = dlg->re->GetSel();
- TCHAR text[1024];
+ wchar_t text[1024];
int first_char;
GetWordCharRange(dlg, sel, text, _countof(text), first_char);
@@ -674,7 +674,7 @@ LRESULT CALLBACK EditProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return ret;
}
-int GetClosestLanguage(TCHAR *lang_name)
+int GetClosestLanguage(wchar_t *lang_name)
{
int i;
@@ -684,11 +684,11 @@ int GetClosestLanguage(TCHAR *lang_name)
return i;
// Try searching by the prefix only
- TCHAR lang[128];
+ wchar_t lang[128];
mir_tstrncpy(lang, lang_name, _countof(lang));
{
- TCHAR *p = _tcschr(lang, _T('_'));
- if (p != NULL) *p = _T('\0');
+ wchar_t *p = wcschr(lang, '_');
+ if (p != NULL) *p = '\0';
}
// First check if there is a language that is only the prefix
@@ -699,7 +699,7 @@ int GetClosestLanguage(TCHAR *lang_name)
// Now try any suffix
size_t len = mir_tstrlen(lang);
for (i = 0; i < languages.getCount(); i++) {
- TCHAR *p = _tcschr(languages[i]->language, _T('_'));
+ wchar_t *p = wcschr(languages[i]->language, '_');
if (p == NULL)
continue;
@@ -707,7 +707,7 @@ int GetClosestLanguage(TCHAR *lang_name)
if (prefix_len != len)
continue;
- if (_tcsnicmp(languages[i]->language, lang_name, len) == 0)
+ if (wcsnicmp(languages[i]->language, lang_name, len) == 0)
return i;
}
@@ -734,7 +734,7 @@ void GetUserProtoLanguageSetting(Dialog *dlg, MCONTACT hContact, char *group, ch
}
if (dbv.type == DBVT_TCHAR && dbv.ptszVal != NULL) {
- TCHAR *lang = dbv.ptszVal;
+ wchar_t *lang = dbv.ptszVal;
for (int i = 0; i < languages.getCount(); i++) {
Dictionary *dict = languages[i];
@@ -756,18 +756,18 @@ void GetUserLanguageSetting(Dialog *dlg, char *setting)
return;
GetUserProtoLanguageSetting(dlg, dlg->hContact, proto, setting);
- if (dlg->lang_name[0] != _T('\0'))
+ if (dlg->lang_name[0] != '\0')
return;
GetUserProtoLanguageSetting(dlg, dlg->hContact, "UserInfo", setting, FALSE);
- if (dlg->lang_name[0] != _T('\0'))
+ if (dlg->lang_name[0] != '\0')
return;
// If not found and is inside meta, try to get from the meta
MCONTACT hMetaContact = db_mc_getMeta(dlg->hContact);
if (hMetaContact != NULL) {
GetUserProtoLanguageSetting(dlg, hMetaContact, META_PROTO, setting);
- if (dlg->lang_name[0] != _T('\0'))
+ if (dlg->lang_name[0] != '\0')
return;
GetUserProtoLanguageSetting(dlg, hMetaContact, "UserInfo", setting, FALSE);
@@ -778,7 +778,7 @@ void GetContactLanguage(Dialog *dlg)
{
DBVARIANT dbv = { 0 };
- dlg->lang_name[0] = _T('\0');
+ dlg->lang_name[0] = '\0';
if (dlg->hContact == NULL) {
if (!db_get_ts(NULL, MODULE_NAME, dlg->name, &dbv)) {
@@ -792,13 +792,13 @@ void GetContactLanguage(Dialog *dlg)
db_free(&dbv);
}
- if (dlg->lang_name[0] == _T('\0') && !db_get_ts(dlg->hContact, "eSpeak", "TalkLanguage", &dbv)) {
+ if (dlg->lang_name[0] == '\0' && !db_get_ts(dlg->hContact, "eSpeak", "TalkLanguage", &dbv)) {
mir_tstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
// Try from metacontact
- if (dlg->lang_name[0] == _T('\0')) {
+ if (dlg->lang_name[0] == '\0') {
MCONTACT hMetaContact = db_mc_getMeta(dlg->hContact);
if (hMetaContact != NULL) {
if (!db_get_ts(hMetaContact, MODULE_NAME, "TalkLanguage", &dbv)) {
@@ -806,7 +806,7 @@ void GetContactLanguage(Dialog *dlg)
db_free(&dbv);
}
- if (dlg->lang_name[0] == _T('\0') && !db_get_ts(hMetaContact, "eSpeak", "TalkLanguage", &dbv)) {
+ if (dlg->lang_name[0] == '\0' && !db_get_ts(hMetaContact, "eSpeak", "TalkLanguage", &dbv)) {
mir_tstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
@@ -814,17 +814,17 @@ void GetContactLanguage(Dialog *dlg)
}
// Try to get from Language info
- if (dlg->lang_name[0] == _T('\0'))
+ if (dlg->lang_name[0] == '\0')
GetUserLanguageSetting(dlg, "Language");
- if (dlg->lang_name[0] == _T('\0'))
+ if (dlg->lang_name[0] == '\0')
GetUserLanguageSetting(dlg, "Language1");
- if (dlg->lang_name[0] == _T('\0'))
+ if (dlg->lang_name[0] == '\0')
GetUserLanguageSetting(dlg, "Language2");
- if (dlg->lang_name[0] == _T('\0'))
+ if (dlg->lang_name[0] == '\0')
GetUserLanguageSetting(dlg, "Language3");
// Use default lang
- if (dlg->lang_name[0] == _T('\0'))
+ if (dlg->lang_name[0] == '\0')
mir_tstrncpy(dlg->lang_name, opts.default_language, _countof(dlg->lang_name));
}
@@ -973,7 +973,7 @@ int RemoveContactTextBox(HWND hwnd)
}
// TODO Make this better
-BOOL GetWordCharRange(Dialog *dlg, CHARRANGE &sel, TCHAR *text, size_t text_len, int &first_char)
+BOOL GetWordCharRange(Dialog *dlg, CHARRANGE &sel, wchar_t *text, size_t text_len, int &first_char)
{
// Get line
int line = dlg->re->GetLineFromChar(sel.cpMin);
@@ -989,7 +989,7 @@ BOOL GetWordCharRange(Dialog *dlg, CHARRANGE &sel, TCHAR *text, size_t text_len,
sel.cpMin--;
sel.cpMin++;
- while (text[sel.cpMax - first_char] != _T('\0') && (dlg->lang->isWordChar(text[sel.cpMax - first_char])
+ while (text[sel.cpMax - first_char] != '\0' && (dlg->lang->isWordChar(text[sel.cpMax - first_char])
|| IsNumber(text[sel.cpMax - first_char])))
sel.cpMax++;
@@ -1000,12 +1000,12 @@ BOOL GetWordCharRange(Dialog *dlg, CHARRANGE &sel, TCHAR *text, size_t text_len,
// See if it has only '-'s
BOOL has_valid_char = FALSE;
for (int i = sel.cpMin; i < sel.cpMax && !has_valid_char; i++)
- has_valid_char = (text[i - first_char] != _T('-'));
+ has_valid_char = (text[i - first_char] != '-');
return has_valid_char;
}
-TCHAR *GetWordUnderPoint(Dialog *dlg, POINT pt, CHARRANGE &sel)
+wchar_t *GetWordUnderPoint(Dialog *dlg, POINT pt, CHARRANGE &sel)
{
// Get text
if (dlg->re->GetTextLength() <= 0)
@@ -1015,19 +1015,19 @@ TCHAR *GetWordUnderPoint(Dialog *dlg, POINT pt, CHARRANGE &sel)
sel.cpMin = sel.cpMax = dlg->re->GetCharFromPos(pt);
// Get text
- TCHAR text[1024];
+ wchar_t text[1024];
int first_char;
if (!GetWordCharRange(dlg, sel, text, _countof(text), first_char))
return NULL;
// copy the word
- text[sel.cpMax - first_char] = _T('\0');
- return _tcsdup(&text[sel.cpMin - first_char]);
+ text[sel.cpMax - first_char] = '\0';
+ return wcsdup(&text[sel.cpMin - first_char]);
}
-void AppendSubmenu(HMENU hMenu, HMENU hSubMenu, TCHAR *name)
+void AppendSubmenu(HMENU hMenu, HMENU hSubMenu, wchar_t *name)
{
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -1039,7 +1039,7 @@ void AppendSubmenu(HMENU hMenu, HMENU hSubMenu, TCHAR *name)
InsertMenuItem(hMenu, 0, TRUE, &mii);
}
-void AppendMenuItem(HMENU hMenu, int id, TCHAR *name, HICON hIcon, BOOL checked)
+void AppendMenuItem(HMENU hMenu, int id, wchar_t *name, HICON hIcon, BOOL checked)
{
ICONINFO iconInfo;
GetIconInfo(hIcon, &iconInfo);
@@ -1061,7 +1061,7 @@ void AppendMenuItem(HMENU hMenu, int id, TCHAR *name, HICON hIcon, BOOL checked)
#define WORD_MENU_ID_BASE 100
#define AUTOREPLACE_MENU_ID_BASE 50
-void AddMenuForWord(Dialog *dlg, TCHAR *word, CHARRANGE &pos, HMENU hMenu, BOOL in_submenu, UINT base)
+void AddMenuForWord(Dialog *dlg, wchar_t *word, CHARRANGE &pos, HMENU hMenu, BOOL in_submenu, UINT base)
{
if (dlg->wrong_words == NULL)
dlg->wrong_words = new vector<WrongWordPopupMenuData>(1);
@@ -1116,7 +1116,7 @@ void AddMenuForWord(Dialog *dlg, TCHAR *word, CHARRANGE &pos, HMENU hMenu, BOOL
if (!in_submenu && opts.show_wrong_word) {
InsertMenu(hMenu, 0, MF_BYPOSITION | MF_SEPARATOR, 0, 0);
- TCHAR text[128];
+ wchar_t text[128];
mir_sntprintf(text, TranslateT("Wrong word: %s"), word);
InsertMenu(hMenu, 0, MF_BYPOSITION, 0, text);
}
@@ -1128,13 +1128,13 @@ struct FoundWrongWordParam
int count;
};
-void FoundWrongWord(TCHAR *word, CHARRANGE pos, void *param)
+void FoundWrongWord(wchar_t *word, CHARRANGE pos, void *param)
{
FoundWrongWordParam *p = (FoundWrongWordParam*)param;
p->count++;
- AddMenuForWord(p->dlg, _tcsdup(word), pos, p->dlg->hWrongWordsSubMenu, TRUE, WORD_MENU_ID_BASE * p->count);
+ AddMenuForWord(p->dlg, wcsdup(word), pos, p->dlg->hWrongWordsSubMenu, TRUE, WORD_MENU_ID_BASE * p->count);
}
void AddItemsToMenu(Dialog *dlg, HMENU hMenu, POINT pt, HWND hwndOwner)
@@ -1179,7 +1179,7 @@ void AddItemsToMenu(Dialog *dlg, HMENU hMenu, POINT pt, HWND hwndOwner)
}
else {
CHARRANGE sel;
- TCHAR *word = GetWordUnderPoint(dlg, pt, sel);
+ wchar_t *word = GetWordUnderPoint(dlg, pt, sel);
if (word != NULL && !dlg->lang->spell(word)) {
InsertMenu(hMenu, 0, MF_BYPOSITION | MF_SEPARATOR, 0, 0);
AddMenuForWord(dlg, word, sel, hMenu, FALSE, WORD_MENU_ID_BASE);
@@ -1190,8 +1190,8 @@ void AddItemsToMenu(Dialog *dlg, HMENU hMenu, POINT pt, HWND hwndOwner)
static void AddWordToDictCallback(BOOL canceled, Dictionary *dict,
- const TCHAR *find, const TCHAR *replace, BOOL useVariables,
- const TCHAR *, void *param)
+ const wchar_t *find, const wchar_t *replace, BOOL useVariables,
+ const wchar_t *, void *param)
{
if (canceled)
return;
@@ -1549,7 +1549,7 @@ LRESULT CALLBACK MenuWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return mir_callNextSubclass(hwnd, MenuWndProc, msg, wParam, lParam);
}
-TCHAR* lstrtrim(TCHAR *str)
+wchar_t* lstrtrim(wchar_t *str)
{
int len = mir_tstrlen(str);
@@ -1557,22 +1557,22 @@ TCHAR* lstrtrim(TCHAR *str)
for (i = len - 1; i >= 0 && (str[i] == ' ' || str[i] == '\t'); --i);
if (i < len - 1) {
++i;
- str[i] = _T('\0');
+ str[i] = '\0';
len = i;
}
for (i = 0; i < len && (str[i] == ' ' || str[i] == '\t'); ++i);
if (i > 0)
- memmove(str, &str[i], (len - i + 1) * sizeof(TCHAR));
+ memmove(str, &str[i], (len - i + 1) * sizeof(wchar_t));
return str;
}
-BOOL lstreq(TCHAR *a, TCHAR *b, size_t len)
+BOOL lstreq(wchar_t *a, wchar_t *b, size_t len)
{
- a = CharLower(_tcsdup(a));
- b = CharLower(_tcsdup(b));
- BOOL ret = len ? !_tcsncmp(a, b, len) : !mir_tstrcmp(a, b);
+ a = CharLower(wcsdup(a));
+ b = CharLower(wcsdup(b));
+ BOOL ret = len ? !wcsncmp(a, b, len) : !mir_tstrcmp(a, b);
free(a);
free(b);
return ret;
diff --git a/plugins/SplashScreen/src/bitmap_funcs.cpp b/plugins/SplashScreen/src/bitmap_funcs.cpp
index 33ef919c64..9c89965cbe 100644
--- a/plugins/SplashScreen/src/bitmap_funcs.cpp
+++ b/plugins/SplashScreen/src/bitmap_funcs.cpp
@@ -38,7 +38,7 @@ MyBitmap::MyBitmap(int w, int h)
allocate(w, h);
}
-MyBitmap::MyBitmap(TCHAR *fn)
+MyBitmap::MyBitmap(wchar_t *fn)
{
dcBmp = 0;
hBmp = 0;
@@ -118,7 +118,7 @@ void MyBitmap::restoreAlpha(int x, int y, int w, int h)
bitsSave = 0;
}
-void MyBitmap::DrawText(TCHAR *str, int x, int y)
+void MyBitmap::DrawText(wchar_t *str, int x, int y)
{
SIZE sz; GetTextExtentPoint32(this->getDC(), str, (int)mir_tstrlen(str), &sz);
RECT rc; SetRect(&rc, x, y, x + 10000, y + 10000);
@@ -127,7 +127,7 @@ void MyBitmap::DrawText(TCHAR *str, int x, int y)
this->restoreAlpha(x - 2, y - 2, sz.cx + 2, sz.cy + 2);
}
-bool MyBitmap::loadFromFile(TCHAR *fn)
+bool MyBitmap::loadFromFile(wchar_t *fn)
{
if (bits) free();
diff --git a/plugins/SplashScreen/src/bitmap_funcs.h b/plugins/SplashScreen/src/bitmap_funcs.h
index 35be6683db..851b746e4d 100644
--- a/plugins/SplashScreen/src/bitmap_funcs.h
+++ b/plugins/SplashScreen/src/bitmap_funcs.h
@@ -26,10 +26,10 @@ private:
public:
MyBitmap();
MyBitmap(int w, int h);
- MyBitmap(TCHAR *fn);
+ MyBitmap(wchar_t *fn);
~MyBitmap();
- bool loadFromFile(TCHAR *fn);
+ bool loadFromFile(wchar_t *fn);
int getWidth() { return width; }
int getHeight() { return height; }
@@ -43,7 +43,7 @@ public:
void saveAlpha(int x = 0, int y = 0, int w = 0, int h = 0);
void restoreAlpha(int x = 0, int y = 0, int w = 0, int h = 0);
- void DrawText(TCHAR *str, int x, int y);
+ void DrawText(wchar_t *str, int x, int y);
inline COLOR32 *getBits() { return bits; }
inline COLOR32 *getRow(int row) { return bits + row * width; }
diff --git a/plugins/SplashScreen/src/debug.h b/plugins/SplashScreen/src/debug.h
index 3132433ccb..c283bd30d9 100644
--- a/plugins/SplashScreen/src/debug.h
+++ b/plugins/SplashScreen/src/debug.h
@@ -2,7 +2,7 @@
#define __debug_h__
#define PlugName "SplashScreen"
-extern TCHAR szLogFile[MAX_PATH];
+extern wchar_t szLogFile[MAX_PATH];
/*
* output a notification message.
@@ -11,10 +11,10 @@ extern TCHAR szLogFile[MAX_PATH];
*
*/
-int inline _DebugPopup(MCONTACT hContact, TCHAR *fmt, ...)
+int inline _DebugPopup(MCONTACT hContact, wchar_t *fmt, ...)
{
va_list va;
- TCHAR debug[1024];
+ wchar_t debug[1024];
va_start(va, fmt);
mir_sntprintf(debug, fmt, va);
@@ -24,9 +24,9 @@ int inline _DebugPopup(MCONTACT hContact, TCHAR *fmt, ...)
ppd.lchContact = hContact;
ppd.lchIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
if(hContact != 0)
- mir_tstrncpy(ppd.lptzContactName, (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
+ mir_tstrncpy(ppd.lptzContactName, (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
else
- mir_tstrncpy(ppd.lptzContactName, _T(PlugName), MAX_CONTACTNAME);
+ mir_tstrncpy(ppd.lptzContactName, _A2W(PlugName), MAX_CONTACTNAME);
mir_tstrncpy(ppd.lptzText, debug, MAX_SECONDLINE - 20);
ppd.colorText = RGB(255,255,255);
ppd.colorBack = RGB(255,0,0);
@@ -41,7 +41,7 @@ int inline _DebugPopup(MCONTACT hContact, TCHAR *fmt, ...)
int inline initLog()
{
- fclose(_tfopen(szLogFile, L"w"));
+ fclose(_wfopen(szLogFile, L"w"));
return 0;
}
@@ -49,10 +49,10 @@ int inline initLog()
* logging func
*/
-void inline logMessage(TCHAR *func, TCHAR *msg)
+void inline logMessage(wchar_t *func, wchar_t *msg)
{
- FILE *f = _tfopen(szLogFile, L"a");
- _ftprintf(f, L"%s:\t\t%s\n", func, msg);
+ FILE *f = _wfopen(szLogFile, L"a");
+ fwprintf(f, L"%s:\t\t%s\n", func, msg);
fclose(f);
}
diff --git a/plugins/SplashScreen/src/main.cpp b/plugins/SplashScreen/src/main.cpp
index 74eeb0ff7c..0a88380ac3 100644
--- a/plugins/SplashScreen/src/main.cpp
+++ b/plugins/SplashScreen/src/main.cpp
@@ -31,11 +31,11 @@ BOOL bmodulesloaded = false; // modules are loaded
BOOL png2dibavail = true; // can we use png2dib service?
// path to miranda's dir, config file path, splash path, sound path
-TCHAR szDllName[MAX_PATH], szSplashFile[MAX_PATH], szSoundFile[MAX_PATH], szhAdvaimgPath[MAX_PATH], szPrefix[128], inBuf[80];
-TCHAR *szMirDir;
+wchar_t szDllName[MAX_PATH], szSplashFile[MAX_PATH], szSoundFile[MAX_PATH], szhAdvaimgPath[MAX_PATH], szPrefix[128], inBuf[80];
+wchar_t *szMirDir;
char szVersion[MAX_PATH];
#ifdef _DEBUG
-TCHAR szLogFile[MAX_PATH];
+wchar_t szLogFile[MAX_PATH];
#endif
SPLASHOPTS options;
HWND hwndSplash;
@@ -69,12 +69,12 @@ void SplashMain()
CallService(MS_SYSTEM_GETVERSIONTEXT, MAX_PATH, (LPARAM)szVersion);
#ifdef _DEBUG
- mir_sntprintf(szLogFile, L"%s\\%s.log", szMirDir, _T(__PLUGIN_NAME));
+ mir_sntprintf(szLogFile, L"%s\\%s.log", szMirDir, _A2W(__PLUGIN_NAME));
initLog();
- TCHAR *mirandaVerString = mir_a2t(szVersion);
+ wchar_t *mirandaVerString = mir_a2t(szVersion);
logMessage(L"Miranda version", mirandaVerString);
mir_free(mirandaVerString);
- logMessage(L"Dll Name", _T(__FILENAME));
+ logMessage(L"Dll Name", _A2W(__FILENAME));
logMessage(L"Advaimg path", szhAdvaimgPath);
#endif
@@ -94,15 +94,14 @@ void SplashMain()
mir_tstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
- else
- mir_tstrcpy(inBuf, L"splash\\splash.png");
+ else mir_tstrcpy(inBuf, L"splash\\splash.png");
- TCHAR szExpandedSplashFile[MAX_PATH];
+ wchar_t szExpandedSplashFile[MAX_PATH];
ExpandEnvironmentStrings(inBuf, szExpandedSplashFile, _countof(szExpandedSplashFile));
mir_tstrcpy(inBuf, szExpandedSplashFile);
- TCHAR *pos3 = 0;
- pos3 = _tcsrchr(inBuf, _T(':'));
+ wchar_t *pos3 = 0;
+ pos3 = wcsrchr(inBuf, ':');
if (pos3 == NULL)
mir_sntprintf(szSplashFile, L"%s\\%s", szMirDir, inBuf);
else
@@ -112,15 +111,14 @@ void SplashMain()
mir_tstrcpy(inBuf, dbv.ptszVal);
db_free(&dbv);
}
- else
- mir_tstrcpy(inBuf, L"sounds\\startup.wav");
+ else mir_tstrcpy(inBuf, L"sounds\\startup.wav");
- TCHAR szExpandedSoundFile[MAX_PATH];
+ wchar_t szExpandedSoundFile[MAX_PATH];
ExpandEnvironmentStrings(inBuf, szExpandedSoundFile, _countof(szExpandedSoundFile));
mir_tstrcpy(inBuf, szExpandedSoundFile);
- TCHAR *pos2;
- pos2 = _tcschr(inBuf, _T(':'));
+ wchar_t *pos2;
+ pos2 = wcschr(inBuf, ':');
if (pos2 == NULL)
mir_sntprintf(szSoundFile, L"%s\\%s", szMirDir, inBuf);
else
@@ -130,19 +128,19 @@ void SplashMain()
logMessage(L"SoundFilePath", szSoundFile);
#endif
- TCHAR szOldPath[MAX_PATH] = { 0 };
+ wchar_t szOldPath[MAX_PATH] = { 0 };
if (options.random) // randomly select a splash file
{
int filescount = 0;
- TCHAR szSplashDir[MAX_PATH] = { 0 }, szSearch[MAX_PATH] = { 0 };
- TCHAR *p = 0;
- TCHAR files[255][50]; //TODO: make memory allocation dynamic
+ wchar_t szSplashDir[MAX_PATH] = { 0 }, szSearch[MAX_PATH] = { 0 };
+ wchar_t *p = 0;
+ wchar_t files[255][50]; //TODO: make memory allocation dynamic
mir_tstrcpy(szSplashDir, szSplashFile);
mir_tstrcpy(szOldPath, szSplashFile);
// find the last \ and null it out, this leaves no trailing slash
- p = _tcsrchr(szSplashDir, _T('\\'));
+ p = wcsrchr(szSplashDir, '\\');
if (p) *p = 0;
// create the search filter
mir_sntprintf(szSearch, L"%s\\*.*", szSplashDir);
@@ -158,7 +156,7 @@ void SplashMain()
#endif
//files = new char[mir_strlen(ffd.cFileName)];
//files[filescount] = new char[mir_strlen(ffd.cFileName)];
- TCHAR ext[5];
+ wchar_t ext[5];
wmemcpy(ext, ffd.cFileName + (mir_tstrlen(ffd.cFileName) - 4), 5);
#ifdef _DEBUG
@@ -197,7 +195,7 @@ void SplashMain()
int PlugDisableHook(WPARAM wParam, LPARAM lParam)
{
#ifdef _DEBUG
- TCHAR buf[128];
+ wchar_t buf[128];
#endif
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
if (options.inheritGS) {
@@ -207,7 +205,7 @@ int PlugDisableHook(WPARAM wParam, LPARAM lParam)
cws->value.bVal ? _DebugPopup(NULL, L"Sounds enabled.", L"") : _DebugPopup(NULL, L"Sounds disabled.", L"");
logMessage(L"Module", _A2T(cws->szModule));
logMessage(L"Setting", _A2T(cws->szSetting));
- logMessage(L"Value", _itot(cws->value.bVal, buf, 10));
+ logMessage(L"Value", _itow(cws->value.bVal, buf, 10));
#endif
}
if (!strcmp(cws->szModule, "PluginDisable") && !strcmp(cws->szSetting, _T2A(szDllName))) {
@@ -217,7 +215,7 @@ int PlugDisableHook(WPARAM wParam, LPARAM lParam)
logMessage(L"PlugDisableHook", L"Triggered");
logMessage(L"Module", _A2T(cws->szModule));
logMessage(L"Setting", _A2T(cws->szSetting));
- logMessage(L"Value", _itot(cws->value.bVal, buf, 10));
+ logMessage(L"Value", _itow(cws->value.bVal, buf, 10));
#endif
}
}
@@ -271,7 +269,7 @@ extern "C" int __declspec(dllexport) Load(void)
extern "C" int __declspec(dllexport) Unload(void)
{
- UnregisterClass(_T(SPLASH_CLASS), hInst);
+ UnregisterClass(SPLASH_CLASS, hInst);
// Freeing loaded libraries
if (hAdvaimg)
diff --git a/plugins/SplashScreen/src/options.cpp b/plugins/SplashScreen/src/options.cpp
index 845a016ab4..f68eac44be 100644
--- a/plugins/SplashScreen/src/options.cpp
+++ b/plugins/SplashScreen/src/options.cpp
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "stdafx.h"
-TCHAR szPath2Spash[MAX_PATH], szSoundFilePath[MAX_PATH];
+wchar_t szPath2Spash[MAX_PATH], szSoundFilePath[MAX_PATH];
// Reads values from db
void ReadDbConfig()
@@ -66,7 +66,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
}
else {
ReadDbConfig();
- TCHAR inBuf[80];
+ wchar_t inBuf[80];
DBVARIANT dbv = { 0 };
if (!db_get_ts(NULL, MODNAME, "Path", &dbv)) {
mir_tstrcpy(inBuf, dbv.ptszVal);
@@ -108,9 +108,9 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (options.showversion)
CheckDlgButton(hwndDlg, IDC_SHOWVERSION, BST_CHECKED);
- SetDlgItemText(hwndDlg, IDC_SHOWTIME, _itot(options.showtime, inBuf, 10));
- SetDlgItemText(hwndDlg, IDC_FISTEP, _itot(options.fisteps, inBuf, 10));
- SetDlgItemText(hwndDlg, IDC_FOSTEP, _itot(options.fosteps, inBuf, 10));
+ SetDlgItemText(hwndDlg, IDC_SHOWTIME, _itow(options.showtime, inBuf, 10));
+ SetDlgItemText(hwndDlg, IDC_FISTEP, _itow(options.fisteps, inBuf, 10));
+ SetDlgItemText(hwndDlg, IDC_FOSTEP, _itow(options.fosteps, inBuf, 10));
SendDlgItemMessage(hwndDlg, IDC_SHOWTIME, EM_LIMITTEXT, 5, 0);
}
@@ -166,11 +166,11 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
case IDC_CHOOSESPLASH:
{
- TCHAR szTempPath[MAX_PATH], initDir[MAX_PATH];
+ wchar_t szTempPath[MAX_PATH], initDir[MAX_PATH];
if (Exists(szSplashFile)) {
mir_tstrcpy(initDir, szSplashFile);
- TCHAR *pos = _tcsrchr(initDir, _T('\\'));
+ wchar_t *pos = wcsrchr(initDir, '\\');
if (pos != NULL)
*pos = 0;
}
@@ -180,7 +180,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
mir_free(szMirDir);
}
- TCHAR tmp[MAX_PATH];
+ wchar_t tmp[MAX_PATH];
mir_sntprintf(tmp, L"%s (*.png, *.bmp)%c*.png;*.bmp%c%c", TranslateT("Graphic files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
@@ -204,7 +204,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
int result = PathToRelativeT(szTempPath, szPath2Spash);
if (result && mir_tstrlen(szPath2Spash) > 0) {
if (options.random) {
- TCHAR *pos = _tcsrchr(szPath2Spash, _T('\\'));
+ wchar_t *pos = wcsrchr(szPath2Spash, '\\');
if (pos != NULL) {
*pos = 0;
mir_tstrcat(szPath2Spash, L"\\");
@@ -222,12 +222,12 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
case IDC_CHOOSESND:
{
- TCHAR szTempPath[MAX_PATH], initDir[MAX_PATH];
- TCHAR *pos;
+ wchar_t szTempPath[MAX_PATH], initDir[MAX_PATH];
+ wchar_t *pos;
if (Exists(szSoundFile)) {
mir_tstrcpy(initDir, szSoundFile);
- pos = _tcsrchr(initDir, _T('\\'));
+ pos = wcsrchr(initDir, '\\');
if (pos != NULL) *pos = 0;
}
else {
@@ -238,7 +238,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
- TCHAR tmp[MAX_PATH];
+ wchar_t tmp[MAX_PATH];
mir_sntprintf(tmp, L"%s (*.wav, *.mp3)%c*.wav;*.mp3%c%c", TranslateT("Sound Files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
@@ -285,7 +285,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
{
- TCHAR tmp[MAX_PATH];
+ wchar_t tmp[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_SPLASHPATH, tmp, _countof(tmp));
db_set_ts(NULL, MODNAME, "Path", tmp);
@@ -298,16 +298,16 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
mir_tstrcpy(szPrefix, tmp);
GetDlgItemText(hwndDlg, IDC_SHOWTIME, tmp, _countof(tmp));
- db_set_dw(NULL, MODNAME, "TimeToShow", _ttoi(tmp));
- options.showtime = _ttoi(tmp);
+ db_set_dw(NULL, MODNAME, "TimeToShow", _wtoi(tmp));
+ options.showtime = _wtoi(tmp);
GetDlgItemText(hwndDlg, IDC_FISTEP, tmp, _countof(tmp));
- db_set_dw(NULL, MODNAME, "FadeinSpeed", _ttoi(tmp));
- options.fisteps = _ttoi(tmp);
+ db_set_dw(NULL, MODNAME, "FadeinSpeed", _wtoi(tmp));
+ options.fisteps = _wtoi(tmp);
GetDlgItemText(hwndDlg, IDC_FOSTEP, tmp, _countof(tmp));
- db_set_dw(NULL, MODNAME, "FadeoutSpeed", _ttoi(tmp));
- options.fosteps = _ttoi(tmp);
+ db_set_dw(NULL, MODNAME, "FadeoutSpeed", _wtoi(tmp));
+ options.fosteps = _wtoi(tmp);
if (IsDlgButtonChecked(hwndDlg, IDC_ACTIVE)) {
db_set_b(NULL, MODNAME, "Active", 1);
diff --git a/plugins/SplashScreen/src/services.cpp b/plugins/SplashScreen/src/services.cpp
index e7aa6c7a66..7a9e35cc69 100644
--- a/plugins/SplashScreen/src/services.cpp
+++ b/plugins/SplashScreen/src/services.cpp
@@ -22,14 +22,14 @@
INT_PTR ShowSplashService(WPARAM wparam, LPARAM lparam)
{
bserviceinvoked = true;
- TCHAR szOldfn[256];
- TCHAR *filename = (TCHAR*)wparam;
+ wchar_t szOldfn[256];
+ wchar_t *filename = (wchar_t*)wparam;
int timetoshow = (int)lparam;
mir_tstrcpy(szOldfn, szSplashFile);
options.showtime = timetoshow;
- TCHAR *pos = _tcsrchr(filename, _T(':'));
+ wchar_t *pos = wcsrchr(filename, ':');
if (pos == NULL)
mir_sntprintf(szSplashFile, L"%s\\%s", szMirDir, filename);
else
diff --git a/plugins/SplashScreen/src/splash.cpp b/plugins/SplashScreen/src/splash.cpp
index 9e209b906a..c3cafffbc6 100644
--- a/plugins/SplashScreen/src/splash.cpp
+++ b/plugins/SplashScreen/src/splash.cpp
@@ -41,7 +41,7 @@ LRESULT CALLBACK SplashWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
case WM_TIMER:
#ifdef _DEBUG
- TCHAR b[40];
+ wchar_t b[40];
mir_sntprintf(b, L"%d", wParam);
logMessage(L"Timer ID", b);
mir_sntprintf(b, L"%d", options.showtime);
@@ -152,7 +152,7 @@ void __cdecl SplashThread(void *arg)
wcl.hCursor = LoadCursor(NULL, IDC_ARROW);
wcl.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
wcl.lpszMenuName = NULL;
- wcl.lpszClassName = _T(SPLASH_CLASS);
+ wcl.lpszClassName = SPLASH_CLASS;
wcl.hIconSm = NULL;
RegisterClassEx(&wcl);
@@ -172,7 +172,7 @@ void __cdecl SplashThread(void *arg)
hwndSplash = CreateWindowEx(
WS_EX_TOOLWINDOW | WS_EX_TOPMOST,//dwStyleEx
- _T(SPLASH_CLASS), //Class name
+ SPLASH_CLASS, //Class name
NULL, //Title
DS_SETFONT | DS_FIXEDSYS | WS_POPUP, //dwStyle
WindowRect.left, // x
@@ -227,8 +227,8 @@ void __cdecl SplashThread(void *arg)
}
}
- TCHAR verString[256] = { 0 };
- TCHAR *mirandaVerString = mir_a2t(szVersion);
+ wchar_t verString[256] = { 0 };
+ wchar_t *mirandaVerString = mir_a2t(szVersion);
mir_sntprintf(verString, L"%s%s", szPrefix, mirandaVerString);
mir_free(mirandaVerString);
LOGFONT lf = { 0 };
@@ -326,7 +326,7 @@ BOOL ShowSplash(BOOL bpreview)
else {
timeout = options.showtime;
#ifdef _DEBUG
- TCHAR b[40];
+ wchar_t b[40];
mir_sntprintf(b, L"%d", options.showtime);
logMessage(L"Timeout", b);
#endif
diff --git a/plugins/SplashScreen/src/stdafx.h b/plugins/SplashScreen/src/stdafx.h
index 070026efa2..dd1217124b 100644
--- a/plugins/SplashScreen/src/stdafx.h
+++ b/plugins/SplashScreen/src/stdafx.h
@@ -22,8 +22,8 @@
#define _CRT_SECURE_NO_DEPRECATE
-#include <windows.h>
#include <tchar.h>
+#include <windows.h>
#include <time.h>
#include <dshow.h>
@@ -48,7 +48,7 @@
#endif
// Internal defines
-#define SPLASH_CLASS "MirandaSplash"
+#define SPLASH_CLASS L"MirandaSplash"
#define MODNAME "SplashScreen"
#define WM_LOADED (WM_USER + 10)
@@ -68,8 +68,8 @@ struct SPLASHOPTS
extern HWND hwndSplash;
extern SPLASHOPTS options;
-extern TCHAR szSplashFile[MAX_PATH], szSoundFile[MAX_PATH], szPrefix[128];
-extern TCHAR *szMirDir;
+extern wchar_t szSplashFile[MAX_PATH], szSoundFile[MAX_PATH], szPrefix[128];
+extern wchar_t *szMirDir;
extern char szVersion[MAX_PATH];
extern BOOL bserviceinvoked, bmodulesloaded, png2dibavail;
extern HINSTANCE hInst;
diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp
index abe47b5afb..b6e0a330f9 100644
--- a/plugins/StartupSilence/src/main.cpp
+++ b/plugins/StartupSilence/src/main.cpp
@@ -227,7 +227,7 @@ static INT_PTR AdvSt()
if ((Enabled == 1)) {
POPUPDATAT ppd = {0};
- TCHAR * lptzText =L"";
+ wchar_t * lptzText =L"";
db_set_b(NULL, "Skin", "UseSound", 0);
EnablePopupModule();
@@ -237,7 +237,7 @@ static INT_PTR AdvSt()
ppd.lchContact = NULL;
ppd.iSeconds = PopUpTime;
wcsncpy_s(ppd.lptzText, lptzText, _TRUNCATE);
- lptzText = TranslateT(MENU_NAME);
+ lptzText = TranslateW(MENU_NAMEW);
wcsncpy_s(ppd.lptzContactName, lptzText, _TRUNCATE);
PUAddPopupT(&ppd);
}
@@ -267,13 +267,13 @@ INT_PTR StartupSilenceEnabled(WPARAM, LPARAM)
if (MenuItem == 1)
UpdateMenu();
if (PopUp == 1) {
- TCHAR * lptzText = Enabled == 1 ? S_MODE_CHANGEDON : S_MODE_CHANGEDOFF;
+ wchar_t * lptzText = Enabled == 1 ? S_MODE_CHANGEDON : S_MODE_CHANGEDOFF;
POPUPDATAT ppd = {0};
ppd.lchIcon = IcoLib_GetIconByHandle((Enabled == 1) ? GetIconHandle(ENABLE_SILENCE) : GetIconHandle(DISABLE_SILENCE));
ppd.lchContact = NULL;
ppd.iSeconds = PopUpTime;
wcsncpy_s(ppd.lptzText, lptzText, _TRUNCATE);
- lptzText = TranslateT(MENU_NAME);
+ lptzText = TranslateW(MENU_NAMEW);
wcsncpy_s(ppd.lptzContactName, lptzText, _TRUNCATE);
PUAddPopupT(&ppd);
}
diff --git a/plugins/StartupSilence/src/stdafx.h b/plugins/StartupSilence/src/stdafx.h
index 84ca37766e..e4fcc25b3b 100644
--- a/plugins/StartupSilence/src/stdafx.h
+++ b/plugins/StartupSilence/src/stdafx.h
@@ -45,6 +45,7 @@ INT_PTR SilenceConnection(WPARAM wParam, LPARAM lParam);
#define SS_SILENCE_CONNECTION "StartupSilence/SilenceConnection"
#define MENU_NAME LPGEN("Silence at startup")
+#define MENU_NAMEW LPGENW("Silence at startup")
#define DISABLE_SILENCE LPGEN("Toggle Silence OFF")
#define ENABLE_SILENCE LPGEN("Toggle Silence ON")
#define DISABLE_SILENCETTB LPGEN("Toggle Silence OFF TTB")
@@ -58,15 +59,15 @@ INT_PTR SilenceConnection(WPARAM wParam, LPARAM lParam);
#define SS_IS_ON Translate("Silence At Startup is ON")
#define SS_IS_OFF Translate("Silence At Startup is OFF")
#define TTBNAME Translate("Toggle Silence At Startup")
-#define NOTICE TranslateT(MENU_NAME)
+#define NOTICE TranslateW(MENU_NAMEW)
#define NEEDTTBMOD TranslateT("You have to install TopToolBar plugin to use this option.")
#define NEEDPOPUP TranslateT("You have to install popup plugin to use this option.")
static IconItem iconList[] = {
- {MENU_NAME, MENU_NAME, IDI_SSICON},
- {ALL_ENABLED_FLT, ALL_ENABLED_FLT, IDI_SSFILTEREDON},
- {DISABLE_SILENCE, DISABLE_SILENCE, IDI_SSDISABLE},
- {ENABLE_SILENCE, ENABLE_SILENCE, IDI_SSENABLE}
+ { MENU_NAME, MENU_NAME, IDI_SSICON},
+ { ALL_ENABLED_FLT, ALL_ENABLED_FLT, IDI_SSFILTEREDON},
+ { DISABLE_SILENCE, DISABLE_SILENCE, IDI_SSDISABLE},
+ { ENABLE_SILENCE, ENABLE_SILENCE, IDI_SSENABLE}
};
static IconItem iconttbList[] = {
diff --git a/plugins/StatusChange/src/main.cpp b/plugins/StatusChange/src/main.cpp
index e5e1b035c6..e9d9b17458 100644
--- a/plugins/StatusChange/src/main.cpp
+++ b/plugins/StatusChange/src/main.cpp
@@ -315,8 +315,8 @@ int StatusChangeOptInit(WPARAM wParam, LPARAM)
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.ptszTitle = LPGENT("Status Change");
- odp.ptszGroup = LPGENT("Status");
+ odp.pwszTitle = LPGENW("Status Change");
+ odp.pwszGroup = LPGENW("Status");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pfnDlgProc = DlgProcStatusChangeOpts;
Options_AddPage(wParam, &odp);
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp
index bd6ea8f7dc..1cb68c1f1d 100644
--- a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp
+++ b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp
@@ -242,7 +242,7 @@ static int changeState(TAAAProtoSetting &setting, STATES newState)
if (db_get_b(NULL, MODULENAME, StatusModeToDbSetting(setting.status, SETTING_MSGCUSTOM), FALSE)) {
DBVARIANT dbv;
if (!db_get_ts(NULL, MODULENAME, StatusModeToDbSetting(setting.status, SETTING_STATUSMSG), &dbv)) {
- setting.szMsg = _tcsdup(dbv.ptszVal);
+ setting.szMsg = wcsdup(dbv.ptszVal);
db_free(&dbv);
}
}
@@ -375,7 +375,7 @@ static VOID CALLBACK AutoAwayTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DW
TAAAProtoSettingList ps = autoAwaySettings;
for (int i = 0; i < ps.getCount(); i++) {
if (ps[i].szMsg)
- ps[i].szMsg = _tcsdup(ps[i].szMsg);
+ ps[i].szMsg = wcsdup(ps[i].szMsg);
if (ps[i].status == ID_STATUS_DISABLED)
ps[i].szName = "";
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp
index 0ae73b66d0..818631c5dc 100644
--- a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp
+++ b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp
@@ -127,7 +127,7 @@ INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
if (settings[i]->msg != NULL)
SetDlgItemTextA(hwndDlg, IDC_STATUSMSG, settings[i]->msg);
else {
- ptrT msg((TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGT, settings[i]->status, 0));
+ ptrT msg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, settings[i]->status, 0));
SetDlgItemText(hwndDlg, IDC_STATUSMSG, (msg != NULL) ? msg : L"");
}
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp
index fddb288e73..58e2dba951 100644
--- a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp
+++ b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp
@@ -205,7 +205,7 @@ static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM
SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_RESETCONTENT, 0, 0);
for (int i=0; i < _countof(statusModeList); i++) {
if ((flags & statusModePf2List[i]) || statusModePf2List[i] == PF2_OFFLINE || bSettingSame) {
- TCHAR *statusMode = pcli->pfnGetStatusModeDescription(statusModeList[i], 0);
+ wchar_t *statusMode = pcli->pfnGetStatusModeDescription(statusModeList[i], 0);
int item = SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_ADDSTRING, 0, (LPARAM)statusMode);
SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_SETITEMDATA, item, (LPARAM)statusModeList[i]);
item = SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_ADDSTRING, 0, (LPARAM)statusMode);
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp
index 6f76de23d5..413c8f0f54 100644
--- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp
+++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp
@@ -67,7 +67,7 @@ static int StartTimer(int timer, int timeout, BOOL restart);
static int StopTimer(int timer);
int LoadMainOptions();
static void GetCurrentConnectionSettings();
-static int AssignStatus(TConnectionSettings* connSetting, int status, int lastStatus, TCHAR *szMsg);
+static int AssignStatus(TConnectionSettings* connSetting, int status, int lastStatus, wchar_t *szMsg);
static int ProcessProtoAck(WPARAM wParam, LPARAM lParam);
static VOID CALLBACK CheckConnectingTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime);
static VOID CALLBACK CheckAckStatusTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime);
@@ -83,7 +83,7 @@ static VOID CALLBACK CheckContinueslyTimer(HWND hwnd, UINT message, UINT_PTR idE
INT_PTR IsProtocolEnabledService(WPARAM wParam, LPARAM lParam);
static int ProcessPopup(int reason, LPARAM lParam);
-static INT_PTR ShowPopup(TCHAR *msg, HICON hIcon);
+static INT_PTR ShowPopup(wchar_t *msg, HICON hIcon);
LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
static DWORD CALLBACK MessageWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -205,7 +205,7 @@ static void FreeProtoSettings(PROTOCOLSETTINGEX** ps)
free(ps);
}
-static int AssignStatus(TConnectionSettings* cs, int status, int lastStatus, TCHAR *szMsg)
+static int AssignStatus(TConnectionSettings* cs, int status, int lastStatus, wchar_t *szMsg)
{
if (status < MIN_STATUS || status > MAX_STATUS)
return -1;
@@ -228,7 +228,7 @@ static int AssignStatus(TConnectionSettings* cs, int status, int lastStatus, TCH
if (cs->szMsg != NULL)
free(cs->szMsg);
- cs->szMsg = _tcsdup(szMsg);
+ cs->szMsg = wcsdup(szMsg);
}
else if (szMsg != cs->szMsg) {
if (cs->szMsg != NULL)
@@ -877,7 +877,7 @@ static VOID CALLBACK CheckContinueslyTimer(HWND, UINT, UINT_PTR, DWORD)
}
// =============== popup ======================
-static TCHAR* GetHumanName(LPARAM lParam)
+static wchar_t* GetHumanName(LPARAM lParam)
{
PROTOACCOUNT *ProtoAccount = Proto_GetAccount((char*)lParam);
return (ProtoAccount != NULL) ? ProtoAccount->tszAccountName : TranslateT("Protocol");
@@ -886,7 +886,7 @@ static TCHAR* GetHumanName(LPARAM lParam)
static int ProcessPopup(int reason, LPARAM lParam)
{
HICON hIcon = NULL;
- TCHAR text[MAX_SECONDLINE];
+ wchar_t text[MAX_SECONDLINE];
if (!db_get_b(NULL, MODULENAME, SETTING_SHOWCONNECTIONPOPUPS, FALSE) || !ServiceExists(MS_POPUP_ADDPOPUPT))
return -1;
@@ -929,7 +929,7 @@ static int ProcessPopup(int reason, LPARAM lParam)
return -1;
if (lParam) {
PROTOCOLSETTINGEX **ps = (PROTOCOLSETTINGEX **)lParam;
- TCHAR protoInfoLine[512], protoInfo[MAX_SECONDLINE];
+ wchar_t protoInfoLine[512], protoInfo[MAX_SECONDLINE];
memset(protoInfoLine, '\0', sizeof(protoInfoLine));
memset(protoInfo, '\0', sizeof(protoInfo));
mir_tstrcpy(protoInfo, L"\r\n");
@@ -979,12 +979,12 @@ static int ProcessPopup(int reason, LPARAM lParam)
return ShowPopup(text, hIcon);
}
-static INT_PTR ShowPopup(TCHAR *msg, HICON hIcon)
+static INT_PTR ShowPopup(wchar_t *msg, HICON hIcon)
{
POPUPDATAT ppd = { 0 };
ppd.lchIcon = hIcon;
- _tcsncpy(ppd.lptzContactName, TranslateT("KeepStatus"), MAX_CONTACTNAME);
- _tcsncpy(ppd.lptzText, msg, MAX_SECONDLINE);
+ wcsncpy(ppd.lptzContactName, TranslateT("KeepStatus"), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzText, msg, MAX_SECONDLINE);
if (db_get_b(NULL, MODULENAME, SETTING_POPUP_USEWINCOLORS, 0)) {
ppd.colorBack = GetSysColor(COLOR_BTNFACE);
ppd.colorText = GetSysColor(COLOR_WINDOWTEXT);
diff --git a/plugins/StatusPlugins/KeepStatus/options.cpp b/plugins/StatusPlugins/KeepStatus/options.cpp
index effa88cf8a..147fcf0b5d 100644
--- a/plugins/StatusPlugins/KeepStatus/options.cpp
+++ b/plugins/StatusPlugins/KeepStatus/options.cpp
@@ -481,8 +481,8 @@ INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
ppd.lchContact = NULL;
ppd.lchIcon = Skin_LoadIcon(SKINICON_STATUS_OFFLINE);
- _tcsncpy(ppd.lptzContactName, TranslateT("KeepStatus"), MAX_CONTACTNAME);
- _tcsncpy(ppd.lptzText, TranslateT("You broke the Internet!"), MAX_SECONDLINE);
+ wcsncpy(ppd.lptzContactName, TranslateT("KeepStatus"), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzText, TranslateT("You broke the Internet!"), MAX_SECONDLINE);
if (IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS))
{
ppd.colorBack = GetSysColor(COLOR_BTNFACE);
@@ -568,8 +568,8 @@ int OptionsInit(WPARAM wparam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
- odp.ptszGroup = LPGENT("Status");
- odp.ptszTitle = LPGENT("KeepStatus");
+ odp.pwszGroup = LPGENW("Status");
+ odp.pwszTitle = LPGENW("KeepStatus");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TABS);
odp.pfnDlgProc = DlgProcKsTabs;
@@ -578,11 +578,11 @@ int OptionsInit(WPARAM wparam, LPARAM)
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
memset(&odp, 0, sizeof(odp));
odp.position = 150000000;
- odp.ptszGroup = LPGENT("Popups");
+ odp.pwszGroup = LPGENW("Popups");
odp.groupPosition = 910000000;
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_PUOPT_KEEPSTATUS);
- odp.ptszTitle = LPGENT("KeepStatus");
+ odp.pwszTitle = LPGENW("KeepStatus");
odp.pfnDlgProc = PopupOptDlgProc;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wparam, &odp);
diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp
index f50907a46f..389b7a4d66 100644
--- a/plugins/StatusPlugins/StartupStatus/options.cpp
+++ b/plugins/StatusPlugins/StartupStatus/options.cpp
@@ -128,7 +128,7 @@ static char* GetCMDL(TSettingsList& protoSettings)
/////////////////////////////////////////////////////////////////////////////////////////
// Link processing
-static TCHAR* GetLinkDescription(TSettingsList& protoSettings)
+static wchar_t* GetLinkDescription(TSettingsList& protoSettings)
{
if ( protoSettings.getCount() == 0 )
return NULL;
@@ -137,7 +137,7 @@ static TCHAR* GetLinkDescription(TSettingsList& protoSettings)
for (int i=0; i < protoSettings.getCount(); i++) {
TSSSetting &p = protoSettings[i];
- TCHAR *status;
+ wchar_t *status;
if ( p.status == ID_STATUS_LAST)
status = TranslateT("<last>");
else if (p.status == ID_STATUS_CURRENT)
@@ -161,9 +161,9 @@ static TCHAR* GetLinkDescription(TSettingsList& protoSettings)
HRESULT CreateLink(TSettingsList& protoSettings)
{
- TCHAR savePath[MAX_PATH];
+ wchar_t savePath[MAX_PATH];
if (SHGetSpecialFolderPath(NULL, savePath, 0x10, FALSE))
- _tcsncat_s(savePath, SHORTCUT_FILENAME, _countof(savePath) - mir_tstrlen(savePath));
+ wcsncat_s(savePath, SHORTCUT_FILENAME, _countof(savePath) - mir_tstrlen(savePath));
else
mir_sntprintf(savePath, L".\\%s", SHORTCUT_FILENAME);
@@ -172,11 +172,11 @@ HRESULT CreateLink(TSettingsList& protoSettings)
HRESULT hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, ( void** )&psl);
if (SUCCEEDED(hres)) {
char *args = GetCMDLArguments(protoSettings);
- TCHAR *desc = GetLinkDescription(protoSettings);
+ wchar_t *desc = GetLinkDescription(protoSettings);
// Set the path to the shortcut target, and add the
// description.
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
GetModuleFileName(NULL, path, _countof(path));
psl->SetPath(path);
psl->SetDescription(desc);
@@ -323,7 +323,7 @@ static INT_PTR CALLBACK StartupStatusOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wPa
break;
}
else {
- TCHAR text[128];
+ wchar_t text[128];
mir_sntprintf(text, TranslateT("size: %d x %d"),
db_get_dw(NULL, MODULE_CLIST, SETTING_WIDTH, 0),
db_get_dw(NULL, MODULE_CLIST, SETTING_HEIGHT, 0));
@@ -343,7 +343,7 @@ static INT_PTR CALLBACK StartupStatusOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wPa
int defProfile;
int profileCount = GetProfileCount((WPARAM)&defProfile, 0);
for ( int i=0; i < profileCount; i++ ) {
- TCHAR profileName[128];
+ wchar_t profileName[128];
if ( GetProfileName(i, (LPARAM)profileName))
continue;
@@ -427,7 +427,7 @@ static INT_PTR CALLBACK StartupStatusOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wPa
GetProfile( defProfile, *ps );
for ( int i=0; i < ps->getCount(); i++ )
if ( (*ps)[i].szMsg != NULL )
- (*ps)[i].szMsg = _tcsdup( (*ps)[i].szMsg );
+ (*ps)[i].szMsg = wcsdup( (*ps)[i].szMsg );
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CMDLOPTIONS), hwndDlg, CmdlOptionsDlgProc, (LPARAM)ps);
}
@@ -536,7 +536,7 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP
else {
for (int j=0; j < ar.getCount(); j++)
if ( ar[j].szMsg != NULL)
- ar[j].szMsg = _tcsdup( ar[j].szMsg );
+ ar[j].szMsg = wcsdup( ar[j].szMsg );
ppo->tszName = db_get_tsa(NULL, MODULENAME, OptName(i, SETTING_PROFILENAME));
if (ppo->tszName == NULL) {
@@ -660,7 +660,7 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP
case UM_ADDPROFILE:
{
- TCHAR *tszName = (TCHAR*)lParam;
+ wchar_t *tszName = (wchar_t*)lParam;
if (tszName == NULL)
break;
@@ -738,7 +738,7 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP
ps->szMsg = NULL;
if (IsDlgButtonChecked(hwndDlg, IDC_CUSTOMMSG)) {
len = SendDlgItemMessage(hwndDlg, IDC_STATUSMSG, WM_GETTEXTLENGTH, 0, 0);
- ps->szMsg = (TCHAR*)calloc(sizeof(TCHAR), len+1);
+ ps->szMsg = (wchar_t*)calloc(sizeof(wchar_t), len+1);
GetDlgItemText(hwndDlg, IDC_STATUSMSG, ps->szMsg, (len + 1));
}
SendMessage(hwndDlg, UM_SETSTATUSMSG, 0, 0);
@@ -757,7 +757,7 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP
ps->szMsg = NULL;
}
int len = SendDlgItemMessage(hwndDlg, IDC_STATUSMSG, WM_GETTEXTLENGTH, 0, 0);
- ps->szMsg = (TCHAR*)calloc(sizeof(TCHAR), len+1);
+ ps->szMsg = (wchar_t*)calloc(sizeof(wchar_t), len+1);
GetDlgItemText(hwndDlg, IDC_STATUSMSG, ps->szMsg, (len + 1));
}
break;
@@ -867,7 +867,7 @@ INT_PTR CALLBACK addProfileDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lP
case WM_COMMAND:
if (LOWORD(wParam) == IDC_OK) {
- TCHAR profileName[128];
+ wchar_t profileName[128];
GetDlgItemText(hwndDlg, IDC_PROFILENAME, profileName, _countof(profileName));
SendMessage(hwndParent, UM_ADDPROFILE, 0, (LPARAM)profileName);
// done and exit
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp
index cfc69ce732..d370e53999 100644
--- a/plugins/StatusPlugins/StartupStatus/profiles.cpp
+++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp
@@ -65,12 +65,12 @@ static int CreateMainMenuItems(WPARAM, LPARAM)
mcount = 0;
int count = GetProfileCount(0, 0);
for (int i = 0; i < count && mcount < MAX_MMITEMS; i++) {
- TCHAR profilename[128];
+ wchar_t profilename[128];
if (!db_get_b(NULL, MODULENAME, OptName(i, SETTING_CREATEMMITEM), 0) || GetProfileName(i, (LPARAM)profilename))
continue;
if (db_get_b(NULL, MODULENAME, OptName(i, SETTING_INSUBMENU), 1) && !mi.root) {
- mi.root = Menu_CreateRoot(MO_STATUS, LPGENT("Status profiles"), 2000100000);
+ mi.root = Menu_CreateRoot(MO_STATUS, LPGENW("Status profiles"), 2000100000);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "1AB30D51-BABA-4B27-9288-1A12278BAD8D");
}
@@ -78,7 +78,7 @@ static int CreateMainMenuItems(WPARAM, LPARAM)
mir_snprintf(servicename, "%s%d", MS_SS_MENUSETPROFILEPREFIX, mcount);
hProfileServices[mcount] = CreateServiceFunctionParam(servicename, profileService, mcount);
- mi.name.t = profilename;
+ mi.name.w = profilename;
mi.position = 2000100000 + mcount;
mi.pszService = servicename;
if (Menu_AddStatusMenuItem(&mi))
@@ -100,9 +100,9 @@ INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam)
if (profile >= count && count > 0)
return -1;
- TCHAR* buf = (TCHAR*)lParam;
+ wchar_t* buf = (wchar_t*)lParam;
if (count == 0) {
- _tcsncpy(buf, TranslateT("default"), 128 - 1);
+ wcsncpy(buf, TranslateT("default"), 128 - 1);
return 0;
}
@@ -112,7 +112,7 @@ INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam)
if (db_get_ts(NULL, MODULENAME, setting, &dbv))
return -1;
- _tcsncpy(buf, dbv.ptszVal, 128 - 1); buf[127] = 0;
+ wcsncpy(buf, dbv.ptszVal, 128 - 1); buf[127] = 0;
db_free(&dbv);
return 0;
}
@@ -130,7 +130,7 @@ INT_PTR GetProfileCount(WPARAM wParam, LPARAM)
return count;
}
-TCHAR *GetStatusMessage(int profile, char *szProto)
+wchar_t *GetStatusMessage(int profile, char *szProto)
{
char dbSetting[80];
DBVARIANT dbv;
@@ -139,7 +139,7 @@ TCHAR *GetStatusMessage(int profile, char *szProto)
if ((pce[i].profile == profile) && (!mir_strcmp(pce[i].szProto, szProto))) {
mir_snprintf(dbSetting, "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG);
if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) { // reload from db
- pce[i].msg = (TCHAR*)realloc(pce[i].msg, sizeof(TCHAR)*(mir_tstrlen(dbv.ptszVal) + 1));
+ pce[i].msg = (wchar_t*)realloc(pce[i].msg, sizeof(wchar_t)*(mir_tstrlen(dbv.ptszVal) + 1));
if (pce[i].msg != NULL) {
mir_tstrcpy(pce[i].msg, dbv.ptszVal);
}
@@ -163,7 +163,7 @@ TCHAR *GetStatusMessage(int profile, char *szProto)
pce[pceCount].msg = NULL;
mir_snprintf(dbSetting, "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG);
if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) {
- pce[pceCount].msg = _tcsdup(dbv.ptszVal);
+ pce[pceCount].msg = wcsdup(dbv.ptszVal);
db_free(&dbv);
}
pceCount++;
diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp
index e592da5e71..13d708f0de 100644
--- a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp
+++ b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp
@@ -63,7 +63,7 @@ TSSSetting::TSSSetting(int profile, PROTOACCOUNT *pa)
szMsg = GetStatusMessage(profile, szName);
if (szMsg)
- szMsg = _tcsdup(szMsg);
+ szMsg = wcsdup(szMsg);
}
TSSSetting::~TSSSetting()
@@ -173,7 +173,7 @@ static void SetLastStatusMessages(TSettingsList &ps)
DBVARIANT dbv;
if (ps[i].szMsg == NULL && !db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) {
- ps[i].szMsg = _tcsdup(dbv.ptszVal); // remember this won't be freed
+ ps[i].szMsg = wcsdup(dbv.ptszVal); // remember this won't be freed
db_free(&dbv);
}
}
diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.h b/plugins/StatusPlugins/StartupStatus/startupstatus.h
index 0346567861..5303ab3468 100644
--- a/plugins/StatusPlugins/StartupStatus/startupstatus.h
+++ b/plugins/StatusPlugins/StartupStatus/startupstatus.h
@@ -40,7 +40,7 @@ struct PROFILECE
{
int profile;
char *szProto;
- TCHAR *msg;
+ wchar_t *msg;
};
struct PROFILEOPTIONS : public MZeroedObject
@@ -51,7 +51,7 @@ struct PROFILEOPTIONS : public MZeroedObject
mir_free(tszName);
}
- TCHAR *tszName;
+ wchar_t *tszName;
TSettingsList* ps;
BOOL showDialog;
BOOL createTtb;
@@ -144,7 +144,7 @@ TSettingsList* GetCurrentProtoSettings();
// profile
int GetProfile(int profileID, TSettingsList& arSettings );
-TCHAR *GetStatusMessage(int profile, char *szProto);
+wchar_t *GetStatusMessage(int profile, char *szProto);
INT_PTR LoadAndSetProfile(WPARAM wParam, LPARAM lParam);
INT_PTR GetProfileCount(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/StatusPlugins/commonstatus.cpp b/plugins/StatusPlugins/commonstatus.cpp
index 4f78f829d1..19411d9938 100644
--- a/plugins/StatusPlugins/commonstatus.cpp
+++ b/plugins/StatusPlugins/commonstatus.cpp
@@ -95,7 +95,7 @@ int GetActualStatus(PROTOCOLSETTINGEX *protoSetting)
}
// helper, from core
-static TCHAR* GetDefaultMessage(int status)
+static wchar_t* GetDefaultMessage(int status)
{
switch (status) {
case ID_STATUS_AWAY: return TranslateT("I've been away since %time%.");
@@ -113,14 +113,14 @@ static TCHAR* GetDefaultMessage(int status)
return NULL;
}
-TCHAR* GetDefaultStatusMessage(PROTOCOLSETTINGEX *ps, int newstatus)
+wchar_t* GetDefaultStatusMessage(PROTOCOLSETTINGEX *ps, int newstatus)
{
if (ps->szMsg != NULL) {// custom message set
log_infoA("CommonStatus: Status message set by calling plugin");
return mir_tstrdup(ps->szMsg);
}
- TCHAR *tMsg = (TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGT, newstatus, (LPARAM)ps->szName);
+ wchar_t *tMsg = (wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, newstatus, (LPARAM)ps->szName);
log_debugA("CommonStatus: Status message retrieved from general awaysys: %S", tMsg);
return tMsg;
}
@@ -169,28 +169,28 @@ static int equalsGlobalStatus(PROTOCOLSETTINGEX **ps)
static void SetStatusMsg(PROTOCOLSETTINGEX *ps, int newstatus)
{
- TCHAR* tszMsg = GetDefaultStatusMessage(ps, newstatus);
+ wchar_t* tszMsg = GetDefaultStatusMessage(ps, newstatus);
if (tszMsg) {
/* replace the default vars in msg (I believe this is from core) */
for (int j = 0; tszMsg[j]; j++) {
if (tszMsg[j] != '%')
continue;
- TCHAR substituteStr[128];
- if (!_tcsnicmp(tszMsg + j, L"%time%", 6))
+ wchar_t substituteStr[128];
+ if (!wcsnicmp(tszMsg + j, L"%time%", 6))
GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, 0, 0, substituteStr, _countof(substituteStr));
- else if (!_tcsnicmp(tszMsg + j, L"%date%", 6))
+ else if (!wcsnicmp(tszMsg + j, L"%date%", 6))
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, 0, 0, substituteStr, _countof(substituteStr));
else
continue;
if (mir_tstrlen(substituteStr) > 6)
- tszMsg = (TCHAR*)mir_realloc(tszMsg, sizeof(TCHAR)*(mir_tstrlen(tszMsg) + 1 + mir_tstrlen(substituteStr) - 6));
- memmove(tszMsg + j + mir_tstrlen(substituteStr), tszMsg + j + 6, sizeof(TCHAR)*(mir_tstrlen(tszMsg) - j - 5));
- memcpy(tszMsg + j, substituteStr, sizeof(TCHAR)*mir_tstrlen(substituteStr));
+ tszMsg = (wchar_t*)mir_realloc(tszMsg, sizeof(wchar_t)*(mir_tstrlen(tszMsg) + 1 + mir_tstrlen(substituteStr) - 6));
+ memmove(tszMsg + j + mir_tstrlen(substituteStr), tszMsg + j + 6, sizeof(wchar_t)*(mir_tstrlen(tszMsg) - j - 5));
+ memcpy(tszMsg + j, substituteStr, sizeof(wchar_t)*mir_tstrlen(substituteStr));
}
- TCHAR *szFormattedMsg = variables_parsedup(tszMsg, ps->tszAccName, NULL);
+ wchar_t *szFormattedMsg = variables_parsedup(tszMsg, ps->tszAccName, NULL);
if (szFormattedMsg != NULL) {
mir_free(tszMsg);
tszMsg = szFormattedMsg;
diff --git a/plugins/StatusPlugins/commonstatus.h b/plugins/StatusPlugins/commonstatus.h
index e43c7b5e25..2288cc0e34 100644
--- a/plugins/StatusPlugins/commonstatus.h
+++ b/plugins/StatusPlugins/commonstatus.h
@@ -28,7 +28,6 @@
#include <shlobj.h>
#include <uxtheme.h>
#include <stdio.h>
-#include <tchar.h>
#include <newpluginapi.h>
#include <m_system.h>
@@ -71,7 +70,7 @@
static int statusModeList[] = { ID_STATUS_OFFLINE, ID_STATUS_ONLINE, ID_STATUS_AWAY, ID_STATUS_NA, ID_STATUS_OCCUPIED, ID_STATUS_DND, ID_STATUS_FREECHAT, ID_STATUS_INVISIBLE, ID_STATUS_ONTHEPHONE, ID_STATUS_OUTTOLUNCH };
static int statusModePf2List[] = { PF2_OFFLINE, PF2_ONLINE, PF2_SHORTAWAY, PF2_LONGAWAY, PF2_LIGHTDND, PF2_HEAVYDND, PF2_FREECHAT, PF2_INVISIBLE, PF2_ONTHEPHONE, PF2_OUTTOLUNCH };
-TCHAR *GetDefaultStatusMessage(PROTOCOLSETTINGEX *ps, int status);
+wchar_t *GetDefaultStatusMessage(PROTOCOLSETTINGEX *ps, int status);
int GetActualStatus(PROTOCOLSETTINGEX *protoSetting);
int InitCommonStatus();
bool IsSuitableProto(PROTOACCOUNT *pa);
diff --git a/plugins/StatusPlugins/confirmdialog.cpp b/plugins/StatusPlugins/confirmdialog.cpp
index ac622de347..34b82714a8 100644
--- a/plugins/StatusPlugins/confirmdialog.cpp
+++ b/plugins/StatusPlugins/confirmdialog.cpp
@@ -34,7 +34,7 @@ struct TConfirmSetting : public PROTOCOLSETTINGEX
{
memcpy(this, &x, sizeof(PROTOCOLSETTINGEX));
if (szMsg)
- szMsg = _tcsdup(szMsg);
+ szMsg = wcsdup(szMsg);
}
~TConfirmSetting()
@@ -59,7 +59,7 @@ static INT_PTR CALLBACK StatusMessageDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar
protoSetting = (PROTOCOLSETTINGEX *)lParam;
if (protoSetting->szMsg == NULL) {
- TCHAR* smsg = GetDefaultStatusMessage(protoSetting, GetActualStatus(protoSetting));
+ wchar_t* smsg = GetDefaultStatusMessage(protoSetting, GetActualStatus(protoSetting));
if (smsg != NULL) {
SetDlgItemText(hwndDlg, IDC_STSMSG, smsg);
mir_free(smsg);
@@ -68,7 +68,7 @@ static INT_PTR CALLBACK StatusMessageDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar
else SetDlgItemText(hwndDlg, IDC_STSMSG, protoSetting->szMsg);
{
- TCHAR desc[512];
+ wchar_t desc[512];
mir_sntprintf(desc, TranslateT("Set %s message for %s."),
pcli->pfnGetStatusModeDescription(GetActualStatus(protoSetting), 0), protoSetting->tszAccName);
SetDlgItemText(hwndDlg, IDC_DESCRIPTION, desc);
@@ -81,7 +81,7 @@ static INT_PTR CALLBACK StatusMessageDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar
{
int len = SendDlgItemMessage(hwndDlg, IDC_STSMSG, WM_GETTEXTLENGTH, 0, 0);
if (len > 0) {
- protoSetting->szMsg = (TCHAR*)realloc(protoSetting->szMsg, sizeof(TCHAR)*(len + 1));
+ protoSetting->szMsg = (wchar_t*)realloc(protoSetting->szMsg, sizeof(wchar_t)*(len + 1));
if (protoSetting->szMsg != NULL)
GetDlgItemText(hwndDlg, IDC_STSMSG, protoSetting->szMsg, len + 1);
}
@@ -107,7 +107,7 @@ static int SetStatusList(HWND hwndDlg)
return -1;
HWND hList = GetDlgItem(hwndDlg, IDC_STARTUPLIST);
- TCHAR buf[100];
+ wchar_t buf[100];
// create items
LVITEM lvItem = { 0 };
@@ -124,7 +124,7 @@ static int SetStatusList(HWND hwndDlg)
case ID_STATUS_CURRENT: actualStatus = CallProtoService((*confirmSettings)[i].szName, PS_GETSTATUS, 0, 0); break;
default: actualStatus = (*confirmSettings)[i].status;
}
- TCHAR* status = pcli->pfnGetStatusModeDescription(actualStatus, 0);
+ wchar_t* status = pcli->pfnGetStatusModeDescription(actualStatus, 0);
switch ((*confirmSettings)[i].status) {
case ID_STATUS_LAST:
mir_sntprintf(buf, L"%s (%s)", TranslateT("<last>"), status);
@@ -140,9 +140,9 @@ static int SetStatusList(HWND hwndDlg)
// status message
if (!((!((CallProtoService((*confirmSettings)[i].szName, PS_GETCAPS, (WPARAM)PFLAGNUM_1, 0)&PF1_MODEMSGSEND)&~PF1_INDIVMODEMSG)) || (!(CallProtoService((*confirmSettings)[i].szName, PS_GETCAPS, (WPARAM)PFLAGNUM_3, 0)&Proto_Status2Flag(actualStatus))))) {
- TCHAR *msg = GetDefaultStatusMessage(&(*confirmSettings)[i], actualStatus);
+ wchar_t *msg = GetDefaultStatusMessage(&(*confirmSettings)[i], actualStatus);
if (msg != NULL) {
- TCHAR* fMsg = variables_parsedup(msg, (*confirmSettings)[i].tszAccName, NULL);
+ wchar_t* fMsg = variables_parsedup(msg, (*confirmSettings)[i].tszAccName, NULL);
ListView_SetItemText(hList, lvItem.iItem, 2, fMsg);
mir_free(fMsg);
mir_free(msg);
@@ -197,7 +197,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
int defaultProfile;
int profileCount = (int)CallService(MS_SS_GETPROFILECOUNT, (WPARAM)&defaultProfile, 0);
for (int i = 0; i < profileCount; i++) {
- TCHAR profileName[128];
+ wchar_t profileName[128];
CallService(MS_SS_GETPROFILENAME, i, (LPARAM)profileName);
int item = SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_ADDSTRING, 0, (LPARAM)profileName);
SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_SETITEMDATA, item, i);
@@ -209,7 +209,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
// start timer
if (timeOut > 0) {
- TCHAR text[32];
+ wchar_t text[32];
mir_sntprintf(text, TranslateT("Closing in %d"), timeOut);
SetDlgItemText(hwndDlg, IDC_CLOSE, text);
SetTimer(hwndDlg, TIMER_ID, 1000, NULL);
@@ -218,7 +218,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case WM_TIMER:
{
- TCHAR text[32];
+ wchar_t text[32];
mir_sntprintf(text, TranslateT("Closing in %d"), timeOut - 1);
SetDlgItemText(hwndDlg, IDC_CLOSE, text);
if (timeOut <= 0) {
@@ -247,7 +247,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
CallService(MS_SS_GETPROFILE, (WPARAM)profile, (LPARAM)confirmSettings);
for (int i = 0; i < confirmSettings->getCount(); i++)
if ((*confirmSettings)[i].szMsg != NULL) // we free this later, copy to our memory space
- (*confirmSettings)[i].szMsg = _tcsdup((*confirmSettings)[i].szMsg);
+ (*confirmSettings)[i].szMsg = wcsdup((*confirmSettings)[i].szMsg);
SetStatusList(hwndDlg);
}
@@ -268,7 +268,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
// LAST STATUS
if (proto->status == ID_STATUS_LAST) {
- TCHAR last[80];
+ wchar_t last[80];
mir_sntprintf(last, L"%s (%s)", TranslateT("<last>"), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0));
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_STARTUPLIST), lvItem.iItem, 1, last);
actualStatus = proto->lastStatus;
@@ -277,7 +277,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
// CURRENT STATUS
else if (proto->status == ID_STATUS_CURRENT) {
int currentStatus = CallProtoService(proto->szName, PS_GETSTATUS, 0, 0);
- TCHAR current[80];
+ wchar_t current[80];
mir_sntprintf(current, L"%s (%s)", TranslateT("<current>"), pcli->pfnGetStatusModeDescription(currentStatus, 0));
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_STARTUPLIST), lvItem.iItem, 1, current);
actualStatus = currentStatus;
@@ -343,7 +343,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
int actualStatus = proto->status;
// last
- TCHAR buf[100];
+ wchar_t buf[100];
mir_sntprintf(buf, L"%s (%s)", TranslateT("<last>"), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0));
int item = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)buf);
SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETITEMDATA, item, ID_STATUS_LAST);
@@ -364,7 +364,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
for (int i = 0; i < _countof(statusModeList); i++) {
if (((flags & statusModePf2List[i]) || (statusModePf2List[i] == PF2_OFFLINE)) && (!((!(flags)& Proto_Status2Flag(statusModePf2List[i]))) || ((CallProtoService(proto->szName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0)&Proto_Status2Flag(statusModePf2List[i]))))) {
- TCHAR *statusMode = pcli->pfnGetStatusModeDescription(statusModeList[i], 0);
+ wchar_t *statusMode = pcli->pfnGetStatusModeDescription(statusModeList[i], 0);
item = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)statusMode);
SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETITEMDATA, item, statusModeList[i]);
if (statusModeList[i] == proto->status)
diff --git a/plugins/StopSpamMod/src/init.cpp b/plugins/StopSpamMod/src/init.cpp
index 4b8ef5167e..453dc319ef 100755
--- a/plugins/StopSpamMod/src/init.cpp
+++ b/plugins/StopSpamMod/src/init.cpp
@@ -43,14 +43,14 @@ BOOL gbMathExpression = 0;
HANDLE hStopSpamLogDirH=0;
-tstring gbSpammersGroup = L"Spammers";
-tstring gbAutoAuthGroup = L"NotSpammers";
+wstring gbSpammersGroup = L"Spammers";
+wstring gbAutoAuthGroup = L"NotSpammers";
-tstring gbQuestion;
-tstring gbAnswer;
-tstring gbCongratulation;
+wstring gbQuestion;
+wstring gbAnswer;
+wstring gbCongratulation;
std::wstring gbAuthRepl;
-extern TCHAR const * defQuestion;
+extern wchar_t const * defQuestion;
extern int RemoveTmp(WPARAM,LPARAM);
/////////////////////////////////////////////////////////////////////////////////////////
@@ -75,7 +75,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
return &pluginInfoEx;
}
-extern tstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szModule, char const * szSetting, tstring errorValue);
+extern wstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szModule, char const * szSetting, wstring errorValue);
void InitVars()
{
diff --git a/plugins/StopSpamMod/src/options.cpp b/plugins/StopSpamMod/src/options.cpp
index 7c4e557c06..8cc6139b5c 100755
--- a/plugins/StopSpamMod/src/options.cpp
+++ b/plugins/StopSpamMod/src/options.cpp
@@ -18,7 +18,7 @@
#include "stdafx.h"
char *pluginDescription = LPGEN("No more spam! Robots can't go! Only human beings invited!\r\n\r\nThis plugin works pretty simple:\r\nWhile messages from users on your contact list go as there is no any anti-spam software, messages from unknown users are not delivered to you. But also they are not ignored, this plugin replies with a simple question, and if user gives the right answer, plugin adds him to your contact list so that he can contact you.");
-TCHAR const *defQuestion = TranslateT("Spammers made me to install small anti-spam system you are now speaking with.\r\nPlease reply \"nospam\" without quotes and spaces if you want to contact me.");
+wchar_t const *defQuestion = TranslateT("Spammers made me to install small anti-spam system you are now speaking with.\r\nPlease reply \"nospam\" without quotes and spaces if you want to contact me.");
INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
@@ -143,7 +143,7 @@ INT_PTR CALLBACK ProtoDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
if (LB_ERR != n) {
size_t len = SendDlgItemMessage(hwnd, ID_ALLPROTO, LB_GETTEXTLEN, n, 0);
if (LB_ERR != len) {
- TCHAR * buf = new TCHAR[len + 1];
+ wchar_t * buf = new wchar_t[len + 1];
SendDlgItemMessage(hwnd, ID_ALLPROTO, LB_GETTEXT, n, (LPARAM)buf);
SendDlgItemMessage(hwnd, ID_USEDPROTO, LB_ADDSTRING, 0, (LPARAM)buf);
delete[]buf;
@@ -157,7 +157,7 @@ INT_PTR CALLBACK ProtoDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
if (LB_ERR != n) {
size_t len = SendDlgItemMessage(hwnd, ID_USEDPROTO, LB_GETTEXTLEN, n, 0);
if (LB_ERR != len) {
- TCHAR * buf = new TCHAR[len + 1];
+ wchar_t * buf = new wchar_t[len + 1];
SendDlgItemMessage(hwnd, ID_USEDPROTO, LB_GETTEXT, n, (LPARAM)buf);
SendDlgItemMessage(hwnd, ID_ALLPROTO, LB_ADDSTRING, 0, (LPARAM)buf);
delete[]buf;
@@ -270,7 +270,7 @@ INT_PTR CALLBACK AdvancedDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
db_set_b(NULL, pluginName, "CaseInsensitive", gbCaseInsensitive = BST_CHECKED == IsDlgButtonChecked(hwnd, IDC_CASE_INSENSITIVE));
db_set_b(NULL, pluginName, "DisableInInvis", gbInvisDisable = BST_CHECKED == IsDlgButtonChecked(hwnd, IDC_INVIS_DISABLE));
{
- static tstring NewGroupName, CurrentGroupName;
+ static wstring NewGroupName, CurrentGroupName;
NewGroupName = GetDlgItemString(hwnd, ID_SPECIALGROUPNAME);
CurrentGroupName = gbSpammersGroup = DBGetContactSettingStringPAN(NULL, pluginName, "SpammersGroup", L"0");
if (mir_wstrcmp(CurrentGroupName.c_str(), NewGroupName.c_str()) != 0) {
@@ -294,7 +294,7 @@ INT_PTR CALLBACK AdvancedDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
db_set_b(NULL, pluginName, "HistoryLog", gbHistoryLog = BST_CHECKED == IsDlgButtonChecked(hwnd, IDC_HISTORY_LOG));
db_set_b(NULL, pluginName, "MathExpression", gbMathExpression = BST_CHECKED == IsDlgButtonChecked(hwnd, IDC_MATH_QUESTION));
{
- static tstring NewAGroupName, CurrentAGroupName;
+ static wstring NewAGroupName, CurrentAGroupName;
NewAGroupName = GetDlgItemString(hwnd, IDC_AUTOADDGROUP);
CurrentAGroupName = gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL, pluginName, "AutoAuthGroup", L"0");
if (mir_wstrcmp(CurrentAGroupName.c_str(), NewAGroupName.c_str()) != 0) {
@@ -318,29 +318,29 @@ MIRANDA_HOOK_EVENT(ME_OPT_INITIALISE, w, l)
UNREFERENCED_PARAMETER(l);
OPTIONSDIALOGPAGE odp = { 0 };
- odp.ptszGroup = LPGENT("Message sessions");
- odp.ptszTitle = LPGENT("StopSpam");
+ odp.pwszGroup = LPGENW("Message sessions");
+ odp.pwszTitle = LPGENW("StopSpam");
odp.position = -1;
odp.hInstance = hInst;
odp.flags = ODPF_TCHAR;
- odp.ptszTab = LPGENT("General");
+ odp.pwszTab = LPGENW("General");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_MAIN);
odp.pfnDlgProc = MainDlgProc;
Options_AddPage(w, &odp);
- odp.ptszTab = LPGENT("Messages");
+ odp.pwszTab = LPGENW("Messages");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_MESSAGES);
odp.pfnDlgProc = MessagesDlgProc;
Options_AddPage(w, &odp);
- odp.ptszTab = LPGENT("Accounts");
+ odp.pwszTab = LPGENW("Accounts");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_PROTO);
odp.pfnDlgProc = ProtoDlgProc;
Options_AddPage(w, &odp);
- odp.ptszTab = LPGENT("Advanced");
+ odp.pwszTab = LPGENW("Advanced");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_ADVANCED);
odp.pfnDlgProc = AdvancedDlgProc;
Options_AddPage(w, &odp);
diff --git a/plugins/StopSpamMod/src/stopspam.cpp b/plugins/StopSpamMod/src/stopspam.cpp
index 918ec129aa..c5cc135954 100755
--- a/plugins/StopSpamMod/src/stopspam.cpp
+++ b/plugins/StopSpamMod/src/stopspam.cpp
@@ -49,7 +49,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, hContact, hDbEvent)
db_set_ws(hcntct, "CList", "Group", gbSpammersGroup.c_str());
BYTE msg = 1;
if (gbIgnoreURL) {
- TCHAR* EventText = ReqGetText(&dbei); //else return NULL
+ wchar_t* EventText = ReqGetText(&dbei); //else return NULL
msg = !IsUrlContains(EventText);
mir_free(EventText);
}
@@ -110,7 +110,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
// reject processing of the event
return 1;
- tstring message;
+ wstring message;
if (dbei->flags & DBEF_UTF) {
wchar_t* msg_u;
@@ -136,7 +136,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
bool answered = false;
if (gbMathExpression) {
if (boost::algorithm::all(message, boost::is_digit())) {
- int num = _ttoi(message.c_str());
+ int num = _wtoi(message.c_str());
int math_answer = db_get_dw(hContact, pluginName, "MathAnswer", 0);
if (num && math_answer)
answered = (num == math_answer);
@@ -173,7 +173,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
// send congratulation
if (bSendMsg) {
- tstring prot = DBGetContactSettingStringPAN(NULL, dbei->szModule, "AM_BaseProto", L"");
+ wstring prot = DBGetContactSettingStringPAN(NULL, dbei->szModule, "AM_BaseProto", L"");
// for notICQ protocols or disable auto auth. reqwest
if ((Stricmp(L"ICQ", prot.c_str())) || (!gbAutoReqAuth)) {
char * buf = mir_utf8encodeW(variables_parse(gbCongratulation, hContact).c_str());
@@ -199,23 +199,23 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
return 0;
}
// URL contains check
- bSendMsg = (bSendMsg && gbIgnoreURL) ? (!IsUrlContains((TCHAR *)message.c_str())) : bSendMsg;
+ bSendMsg = (bSendMsg && gbIgnoreURL) ? (!IsUrlContains((wchar_t *)message.c_str())) : bSendMsg;
// if message message does not contain infintite talk protection prefix
// and question count for this contact is less then maximum
if (bSendMsg) {
- if ((!gbInfTalkProtection || tstring::npos == message.find(L"StopSpam automatic message:\r\n"))
+ if ((!gbInfTalkProtection || wstring::npos == message.find(L"StopSpam automatic message:\r\n"))
&& (!gbMaxQuestCount || db_get_dw(hContact, pluginName, "QuestionCount", 0) < gbMaxQuestCount)) {
// send question
- tstring q;
+ wstring q;
if (gbInfTalkProtection)
q += L"StopSpam automatic message:\r\n";
if (gbMathExpression) { //parse math expression in question
- tstring tmp_question = gbQuestion;
+ wstring tmp_question = gbQuestion;
std::list<int> args;
- std::list<TCHAR> actions;
- tstring::size_type p1 = gbQuestion.find(L"X"), p2 = 0;
- const tstring expr_chars = L"X+-/*", expr_acts = L"+-/*";
- while (p1 < gbQuestion.length() && p1 != tstring::npos && expr_chars.find(gbQuestion[p1]) != tstring::npos) {
+ std::list<wchar_t> actions;
+ wstring::size_type p1 = gbQuestion.find(L"X"), p2 = 0;
+ const wstring expr_chars = L"X+-/*", expr_acts = L"+-/*";
+ while (p1 < gbQuestion.length() && p1 != wstring::npos && expr_chars.find(gbQuestion[p1]) != wstring::npos) {
std::string arg;
p2 = p1;
for (p1 = gbQuestion.find(L"X", p1); (p1 < gbQuestion.length()) && (gbQuestion[p1] == L'X'); ++p1)
@@ -224,7 +224,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
tmp_question.replace(p2, arg.size(), toUTF16(arg));
args.push_back(atoi(arg.c_str()));
- if ((p1 < gbQuestion.length()) && (p1 != tstring::npos) && (expr_acts.find(gbQuestion[p1]) != tstring::npos))
+ if ((p1 < gbQuestion.length()) && (p1 != wstring::npos) && (expr_acts.find(gbQuestion[p1]) != wstring::npos))
actions.push_back(gbQuestion[p1]);
++p1;
}
@@ -234,25 +234,25 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
while (!args.empty()) {
if (!actions.empty()) {
switch (actions.front()) {
- case _T('+'):
+ case '+':
{
math_answer += args.front();
args.pop_front();
}
break;
- case _T('-'):
+ case '-':
{
math_answer -= args.front();
args.pop_front();
}
break;
- case _T('/'):
+ case '/':
{
math_answer /= args.front();
args.pop_front();
}
break;
- case _T('*'):
+ case '*':
{
math_answer *= args.front();
args.pop_front();
diff --git a/plugins/StopSpamMod/src/stopspam.h b/plugins/StopSpamMod/src/stopspam.h
index b783dc4d40..6b76869416 100755
--- a/plugins/StopSpamMod/src/stopspam.h
+++ b/plugins/StopSpamMod/src/stopspam.h
@@ -17,14 +17,14 @@ extern BOOL gbHistoryLog;
extern BOOL gbInvisDisable;
extern BOOL gbIgnoreURL;
extern BOOL gbMathExpression;
-extern tstring gbSpammersGroup;
-extern tstring gbQuestion;
-extern tstring gbAnswer;
-extern tstring gbCongratulation;
+extern wstring gbSpammersGroup;
+extern wstring gbQuestion;
+extern wstring gbAnswer;
+extern wstring gbCongratulation;
extern std::wstring gbAuthRepl;
extern BOOL gbAutoAuth;
extern BOOL gbAutoAddToServerList;
extern BOOL gbAutoReqAuth;
-extern tstring gbAutoAuthGroup;
+extern wstring gbAutoAuthGroup;
extern BOOL gbLogToFile;
extern BOOL gbDelAllTempory;
diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp
index bfa076de6a..e2fa1253d1 100755
--- a/plugins/StopSpamMod/src/utilities.cpp
+++ b/plugins/StopSpamMod/src/utilities.cpp
@@ -17,7 +17,7 @@
#include "stdafx.h"
-tstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szModule, char const * szSetting, tstring errorValue)
+wstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szModule, char const * szSetting, wstring errorValue)
{
DBVARIANT dbv;
//if(db_get(hContact, szModule, szSetting, &dbv))
@@ -41,13 +41,13 @@ std::string DBGetContactSettingStringPAN_A(MCONTACT hContact, char const * szMod
return errorValue;
}
-tstring &GetDlgItemString(HWND hwnd, int id)
+wstring &GetDlgItemString(HWND hwnd, int id)
{
HWND h = GetDlgItem(hwnd, id);
int len = GetWindowTextLength(h);
- TCHAR * buf = new TCHAR[len + 1];
+ wchar_t * buf = new wchar_t[len + 1];
GetWindowText(h, buf, len + 1);
- static tstring s;
+ static wstring s;
s = buf;
delete[]buf;
return s;
@@ -64,13 +64,13 @@ bool ProtoInList(std::string proto)
return std::string::npos != GetProtoList().find(proto + "\r\n");
}
-void DeleteCListGroupsByName(TCHAR* szGroupName)
+void DeleteCListGroupsByName(wchar_t* szGroupName)
{
BYTE ConfirmDelete = db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT);
if (ConfirmDelete)
db_set_b(NULL, "CList", "ConfirmDelete", 0);
- TCHAR *szGroup;
+ wchar_t *szGroup;
for (int i = 1; (szGroup = Clist_GroupGetName(i, NULL)) != NULL; i++)
if (!mir_wstrcmp(szGroupName, szGroup))
Clist_GroupDelete(i);
@@ -86,19 +86,19 @@ int RemoveTmp(WPARAM, LPARAM)
return 0;
}
-tstring variables_parse(tstring const &tstrFormat, MCONTACT hContact)
+wstring variables_parse(wstring const &tstrFormat, MCONTACT hContact)
{
if (gbVarsServiceExist) {
FORMATINFO fi;
- TCHAR *tszParsed;
- tstring tstrResult;
+ wchar_t *tszParsed;
+ wstring tstrResult;
memset(&fi, 0, sizeof(fi));
fi.cbSize = sizeof(fi);
- fi.tszFormat = _tcsdup(tstrFormat.c_str());
+ fi.tszFormat = wcsdup(tstrFormat.c_str());
fi.hContact = hContact;
fi.flags |= FIF_TCHAR;
- tszParsed = (TCHAR *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
+ tszParsed = (wchar_t *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
free(fi.tszFormat);
if (tszParsed) {
tstrResult = tszParsed;
@@ -111,13 +111,13 @@ tstring variables_parse(tstring const &tstrFormat, MCONTACT hContact)
// case-insensitive mir_tstrcmp
//by nullbie as i remember...
-#define NEWTSTR_MALLOC(A) (A==NULL) ? NULL : mir_tstrcpy((TCHAR*)mir_alloc(sizeof(TCHAR)*(mir_tstrlen(A)+1)),A)
-const int Stricmp(const TCHAR *str, const TCHAR *substr)
+#define NEWTSTR_MALLOC(A) (A==NULL) ? NULL : mir_tstrcpy((wchar_t*)mir_alloc(sizeof(wchar_t)*(mir_tstrlen(A)+1)),A)
+const int Stricmp(const wchar_t *str, const wchar_t *substr)
{
int i = 0;
- TCHAR *str_up = NEWTSTR_MALLOC(str);
- TCHAR *substr_up = NEWTSTR_MALLOC(substr);
+ wchar_t *str_up = NEWTSTR_MALLOC(str);
+ wchar_t *substr_up = NEWTSTR_MALLOC(substr);
CharUpperBuff(str_up, (int)mir_tstrlen(str_up));
CharUpperBuff(substr_up, (int)mir_tstrlen(substr_up));
@@ -130,7 +130,7 @@ const int Stricmp(const TCHAR *str, const TCHAR *substr)
return i;
}
-TCHAR* ReqGetText(DBEVENTINFO* dbei)
+wchar_t* ReqGetText(DBEVENTINFO* dbei)
{
if (!dbei->pBlob)
return 0;
@@ -152,15 +152,15 @@ TCHAR* ReqGetText(DBEVENTINFO* dbei)
WCHAR* msg = NULL;
msg = (dbei->flags&DBEF_UTF) ? mir_utf8decodeW(tstr) : mir_a2u(tstr);
mir_free(tstr);
- return (TCHAR *)msg;
+ return (wchar_t *)msg;
};
return 0;
}
-BOOL IsUrlContains(TCHAR * Str)
+BOOL IsUrlContains(wchar_t * Str)
{
const int CountUrl = 11;
- const TCHAR URL[CountUrl][5] =
+ const wchar_t URL[CountUrl][5] =
{
L"http",
L"www",
@@ -176,10 +176,10 @@ BOOL IsUrlContains(TCHAR * Str)
};
if (Str && mir_tstrlen(Str) > 0) {
- TCHAR *StrLower = NEWTSTR_MALLOC(Str);
+ wchar_t *StrLower = NEWTSTR_MALLOC(Str);
CharLowerBuff(StrLower, (int)mir_tstrlen(StrLower));
for (int i = 0; i < CountUrl; i++)
- if (_tcsstr(StrLower, URL[i])) {
+ if (wcsstr(StrLower, URL[i])) {
mir_free(StrLower);
return 1;
}
@@ -188,27 +188,27 @@ BOOL IsUrlContains(TCHAR * Str)
return 0;
}
-tstring GetContactUid(MCONTACT hContact, tstring Protocol)
+wstring GetContactUid(MCONTACT hContact, wstring Protocol)
{
char *szProto = mir_utf8encodeW(Protocol.c_str());
ptrT uid(Contact_GetInfo(CNF_DISPLAYUID, hContact, szProto));
return (uid) ? uid : L"";
}
-void LogSpamToFile(MCONTACT hContact, tstring message)
+void LogSpamToFile(MCONTACT hContact, wstring message)
{
if (!gbLogToFile) return;
- tstring LogStrW, LogTime, LogProtocol, LogContactId, LogContactName;
+ wstring LogStrW, LogTime, LogProtocol, LogContactId, LogContactName;
std::fstream file;
- TCHAR pszName[MAX_PATH];
+ wchar_t pszName[MAX_PATH];
if (hStopSpamLogDirH)
FoldersGetCustomPathT(hStopSpamLogDirH, pszName, MAX_PATH, L"");
else
mir_tstrncpy(pszName, VARST(L"%miranda_logpath%"), _countof(pszName));
- tstring filename = pszName;
+ wstring filename = pszName;
filename += L"\\stopspam_mod.log";
file.open(filename.c_str(), std::ios::out | std::ios::app);
@@ -222,7 +222,7 @@ void LogSpamToFile(MCONTACT hContact, tstring message)
// Name, UID and Protocol Log line
LogProtocol = DBGetContactSettingStringPAN(hContact, "Protocol", "p", L"");
- LogContactName = (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0);
+ LogContactName = (wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0);
LogContactId = (LogProtocol == L"") ? L"" : GetContactUid(hContact, LogProtocol);
// Name, UID and Protocol Log line
@@ -331,7 +331,7 @@ void HistoryLogFunc(MCONTACT hContact, std::string message)
std::string msg = message;
msg.append("\n");
msg.append("Protocol: ").append(GetContactProto(hContact)).append(" Contact: ");
- msg.append(toUTF8((TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0))).append(" ID: ");
+ msg.append(toUTF8((wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0))).append(" ID: ");
msg.append(toUTF8(GetContactUid(hContact, toUTF16(GetContactProto(hContact)))));
HistoryLog(NULL, (char*)msg.c_str(), EVENTTYPE_MESSAGE, DBEF_READ);
}
diff --git a/plugins/StopSpamMod/src/utilities.h b/plugins/StopSpamMod/src/utilities.h
index 4120d0dec9..b0ffab994c 100755
--- a/plugins/StopSpamMod/src/utilities.h
+++ b/plugins/StopSpamMod/src/utilities.h
@@ -1,17 +1,17 @@
-tstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szModule, char const * szSetting, tstring errorValue);
+std::wstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szModule, char const * szSetting, std::wstring errorValue);
std::string DBGetContactSettingStringPAN_A(MCONTACT hContact, char const * szModule, char const * szSetting, std::string errorValue);
-tstring &GetDlgItemString(HWND hwnd, int id);
+std::wstring &GetDlgItemString(HWND hwnd, int id);
std::string &GetProtoList();
bool ProtoInList(std::string proto);
void RemoveExcludedUsers();
-tstring variables_parse(tstring const &tstrFormat, MCONTACT hContact);
-const int Stricmp(const TCHAR *str, const TCHAR *substr);
-//const int Stristr(const TCHAR *str, const TCHAR *substr);
-TCHAR* ReqGetText(DBEVENTINFO* dbei);
-BOOL IsUrlContains(TCHAR * Str);
-void DeleteCListGroupsByName(TCHAR* szGroupName);
-tstring GetContactUid(MCONTACT hContact, std::string Protocol);
-void LogSpamToFile(MCONTACT hContact, tstring message);
+std::wstring variables_parse(std::wstring const &tstrFormat, MCONTACT hContact);
+const int Stricmp(const wchar_t *str, const wchar_t *substr);
+//const int Stristr(const wchar_t *str, const wchar_t *substr);
+wchar_t* ReqGetText(DBEVENTINFO* dbei);
+BOOL IsUrlContains(wchar_t * Str);
+void DeleteCListGroupsByName(wchar_t* szGroupName);
+std::wstring GetContactUid(MCONTACT hContact, std::string Protocol);
+void LogSpamToFile(MCONTACT hContact, std::wstring message);
std::string toUTF8(std::wstring str);
std::string toUTF8(std::string str);
std::wstring toUTF16(std::string str);
diff --git a/plugins/StopSpamPlus/src/options.cpp b/plugins/StopSpamPlus/src/options.cpp
index 03105de55d..3feb724e8f 100644
--- a/plugins/StopSpamPlus/src/options.cpp
+++ b/plugins/StopSpamPlus/src/options.cpp
@@ -1,7 +1,7 @@
#include "stdafx.h"
-TCHAR * pluginDescription = TranslateT("No more spam! Robots can't go! Only human beings invited!\r\n\r\nThis plugin works pretty simple:\r\nWhile messages from users on your contact list go as there is no any anti-spam software, messages from unknown users are not delivered to you. But also they are not ignored, this plugin replies with a simple question, and if user gives the right answer, plugin adds him to your contact list so that he can contact you.");
-TCHAR const * infTalkProtPrefix = TranslateT("StopSpam automatic message:\r\n");
+wchar_t * pluginDescription = TranslateT("No more spam! Robots can't go! Only human beings invited!\r\n\r\nThis plugin works pretty simple:\r\nWhile messages from users on your contact list go as there is no any anti-spam software, messages from unknown users are not delivered to you. But also they are not ignored, this plugin replies with a simple question, and if user gives the right answer, plugin adds him to your contact list so that he can contact you.");
+wchar_t const * infTalkProtPrefix = TranslateT("StopSpam automatic message:\r\n");
char const * answeredSetting = "Answered";
char const * questCountSetting = "QuestionCount";
diff --git a/plugins/StopSpamPlus/src/services.cpp b/plugins/StopSpamPlus/src/services.cpp
index 9b821b1aa3..5026af7098 100644
--- a/plugins/StopSpamPlus/src/services.cpp
+++ b/plugins/StopSpamPlus/src/services.cpp
@@ -27,7 +27,7 @@ INT_PTR RemoveTempContacts(WPARAM, LPARAM lParam)
MCONTACT hNext = db_find_next(hContact);
ptrT szGroup(db_get_tsa(hContact, "CList", "Group"));
- if (db_get_b(hContact, "CList", "NotOnList", 0) || (szGroup != NULL && (_tcsstr(szGroup, L"Not In List") || _tcsstr(szGroup, TranslateT("Not In List"))))) {
+ if (db_get_b(hContact, "CList", "NotOnList", 0) || (szGroup != NULL && (wcsstr(szGroup, L"Not In List") || wcsstr(szGroup, TranslateT("Not In List"))))) {
char *szProto = GetContactProto(hContact);
if (szProto != NULL) {
// Check if protocol uses server side lists
@@ -47,10 +47,10 @@ INT_PTR RemoveTempContacts(WPARAM, LPARAM lParam)
}
int hGroup = 1;
- TCHAR *group_name;
+ wchar_t *group_name;
do {
group_name = Clist_GroupGetName(hGroup, 0);
- if (group_name != NULL && _tcsstr(group_name, TranslateT("Not In List"))) {
+ if (group_name != NULL && wcsstr(group_name, TranslateT("Not In List"))) {
BYTE ConfirmDelete = db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT);
if (ConfirmDelete)
db_set_b(NULL, "CList", "ConfirmDelete", 0);
diff --git a/plugins/StopSpamPlus/src/stdafx.h b/plugins/StopSpamPlus/src/stdafx.h
index b22afebe4d..8e521c120d 100644
--- a/plugins/StopSpamPlus/src/stdafx.h
+++ b/plugins/StopSpamPlus/src/stdafx.h
@@ -32,8 +32,8 @@ typedef std::wstring tstring;
#define pluginName LPGEN("StopSpam")
-extern TCHAR * pluginDescription;
-extern TCHAR const * infTalkProtPrefix;
+extern wchar_t * pluginDescription;
+extern wchar_t const * infTalkProtPrefix;
extern char const * answeredSetting;
extern char const * questCountSetting;
extern HANDLE hLoadHook;
diff --git a/plugins/StopSpamPlus/src/stopspam.cpp b/plugins/StopSpamPlus/src/stopspam.cpp
index 13fd6dbd21..ccd407d3d5 100644
--- a/plugins/StopSpamPlus/src/stopspam.cpp
+++ b/plugins/StopSpamPlus/src/stopspam.cpp
@@ -54,7 +54,7 @@ extern "C" int __declspec(dllexport) Load(void)
mi.position = -0x7FFFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- mi.name.t = LPGENT("Remove Temporary Contacts");
+ mi.name.w = LPGENW("Remove Temporary Contacts");
mi.pszService = pluginName"/RemoveTempContacts";
Menu_AddMainMenuItem(&mi);
diff --git a/plugins/StopSpamPlus/src/utils.cpp b/plugins/StopSpamPlus/src/utils.cpp
index 0b617519da..f5ea232f94 100644
--- a/plugins/StopSpamPlus/src/utils.cpp
+++ b/plugins/StopSpamPlus/src/utils.cpp
@@ -4,7 +4,7 @@ tstring &GetDlgItemString(HWND hwnd, int id)
{
HWND h = GetDlgItem(hwnd, id);
int len = GetWindowTextLength(h);
- TCHAR * buf = new TCHAR[len + 1];
+ wchar_t * buf = new wchar_t[len + 1];
GetWindowText(h, buf, len + 1);
static tstring s;
s = buf;
@@ -48,10 +48,10 @@ tstring variables_parse(tstring const &tstrFormat, MCONTACT hContact){
memset(&fi, 0, sizeof(fi));
fi.cbSize = sizeof(fi);
- fi.tszFormat = _tcsdup(tstrFormat.c_str());
+ fi.tszFormat = wcsdup(tstrFormat.c_str());
fi.hContact = hContact;
fi.flags |= FIF_TCHAR;
- TCHAR *tszParsed = (TCHAR *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
+ wchar_t *tszParsed = (wchar_t *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
free(fi.tszFormat);
if (tszParsed) {
tstrResult = tszParsed;
diff --git a/plugins/TabSRMM/src/TSButton.cpp b/plugins/TabSRMM/src/TSButton.cpp
index 603bdceb34..673ad7d5a2 100644
--- a/plugins/TabSRMM/src/TSButton.cpp
+++ b/plugins/TabSRMM/src/TSButton.cpp
@@ -277,7 +277,7 @@ static void PaintWorker(TSButtonCtrl *ctl, HDC hdcPaint)
RECT rcText;
CopyRect(&rcText, &rcClient);
- TCHAR szText[MAX_PATH];
+ wchar_t szText[MAX_PATH];
GetWindowText(ctl->hwnd, szText, _countof(szText));
SetBkMode(hdcMem, TRANSPARENT);
HFONT hOldFont = (HFONT)SelectObject(hdcMem, ctl->hFont);
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp
index adb7c964c5..2e2561c2c2 100644
--- a/plugins/TabSRMM/src/buttonsbar.cpp
+++ b/plugins/TabSRMM/src/buttonsbar.cpp
@@ -24,7 +24,7 @@ struct CustomButtonData : public MZeroedObject
DWORD m_dwButtonCID;
DWORD m_dwArrowCID; // only use with BBBF_ISARROWBUTTON flag
- TCHAR *m_ptszTooltip; // button's tooltip
+ wchar_t *m_ptszTooltip; // button's tooltip
int m_iButtonWidth; // must be 22 for regular button and 33 for button with arrow
HANDLE m_hIcon; // Handle to icolib registred icon
@@ -356,7 +356,7 @@ static int SaveTree(HWND hToolBarTree)
bool RSide = false;
int count = 10;
DWORD loc_sepcout = 0;
- TCHAR strbuf[128];
+ wchar_t strbuf[128];
TVITEM tvi;
tvi.mask = TVIF_TEXT | TVIF_PARAM | TVIF_HANDLE;
@@ -561,7 +561,7 @@ INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
TreeView_GetItem(hToolBarTree, &tvi);
if (hti.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT) || (hti.hItem == TVI_FIRST)) {
TVINSERTSTRUCT tvis;
- TCHAR strbuf[128];
+ wchar_t strbuf[128];
tvis.item.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE;
tvis.item.stateMask = 0xFFFFFFFF;
tvis.item.pszText = strbuf;
@@ -699,7 +699,7 @@ INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
case TVN_SELCHANGING:
hItem = TreeView_GetSelection(hToolBarTree);
if (hItem != NULL) {
- TCHAR strbuf[128];
+ wchar_t strbuf[128];
TVITEM tvi;
tvi.hItem = hItem;
@@ -727,7 +727,7 @@ INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
case TVN_SELCHANGED:
hItem = TreeView_GetSelection(hToolBarTree);
if (hItem != NULL) {
- TCHAR strbuf[128];
+ wchar_t strbuf[128];
TVITEM tvi;
tvi.pszText = strbuf;
@@ -840,14 +840,14 @@ void CB_InitDefaultButtons()
bbd.dwDefPos = 10;
bbd.hIcon = Skin_GetIconHandle(SKINICON_OTHER_CONNECTING);
bbd.pszModuleName = "Tabsrmm";
- bbd.ptszTooltip = LPGENT("Protocol button");
+ bbd.ptszTooltip = LPGENW("Protocol button");
CB_AddButton(0, (LPARAM)&bbd);
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISARROWBUTTON | BBBF_CREATEBYID;
bbd.dwButtonID = IDC_NAME;
bbd.dwDefPos = 20;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[20];
- bbd.ptszTooltip = LPGENT("Info button");
+ bbd.ptszTooltip = LPGENW("Info button");
CB_AddButton(0, (LPARAM)&bbd);
if (PluginConfig.g_SmileyAddAvail) {
@@ -856,7 +856,7 @@ void CB_InitDefaultButtons()
bbd.iButtonWidth = 0;
bbd.dwDefPos = 30;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[9];
- bbd.ptszTooltip = LPGENT("Insert emoticon");
+ bbd.ptszTooltip = LPGENW("Insert emoticon");
CB_AddButton(0, (LPARAM)&bbd);
}
@@ -864,35 +864,35 @@ void CB_InitDefaultButtons()
bbd.dwButtonID = IDC_FONTBOLD;
bbd.dwDefPos = 40;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[10];
- bbd.ptszTooltip = LPGENT("Bold text");
+ bbd.ptszTooltip = LPGENW("Bold text");
CB_AddButton(0, (LPARAM)&bbd);
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISPUSHBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID;
bbd.dwButtonID = IDC_FONTITALIC;
bbd.dwDefPos = 50;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[11];
- bbd.ptszTooltip = LPGENT("Italic text");
+ bbd.ptszTooltip = LPGENW("Italic text");
CB_AddButton(0, (LPARAM)&bbd);
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISPUSHBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID;
bbd.dwButtonID = IDC_FONTUNDERLINE;
bbd.dwDefPos = 60;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[12];
- bbd.ptszTooltip = LPGENT("Underlined text");
+ bbd.ptszTooltip = LPGENW("Underlined text");
CB_AddButton(0, (LPARAM)&bbd);
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISPUSHBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID;
bbd.dwButtonID = IDC_FONTSTRIKEOUT;
bbd.dwDefPos = 70;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[15];
- bbd.ptszTooltip = LPGENT("Strike-through text");
+ bbd.ptszTooltip = LPGENW("Strike-through text");
CB_AddButton(0, (LPARAM)&bbd);
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID;
bbd.dwButtonID = IDC_FONTFACE;
bbd.dwDefPos = 80;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[14];
- bbd.ptszTooltip = LPGENT("Select font color");
+ bbd.ptszTooltip = LPGENW("Select font color");
CB_AddButton(0, (LPARAM)&bbd);
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_ISARROWBUTTON | BBBF_CREATEBYID;
@@ -900,7 +900,7 @@ void CB_InitDefaultButtons()
bbd.dwDefPos = 10;
bbd.iButtonWidth = 51;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[6];
- bbd.ptszTooltip = LPGENT("Send message\nClick dropdown arrow for sending options");
+ bbd.ptszTooltip = LPGENW("Send message\nClick dropdown arrow for sending options");
CB_AddButton(0, (LPARAM)&bbd);
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID;
@@ -908,7 +908,7 @@ void CB_InitDefaultButtons()
bbd.dwDefPos = 20;
bbd.iButtonWidth = 0;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[8];
- bbd.ptszTooltip = LPGENT("Close session");
+ bbd.ptszTooltip = LPGENW("Close session");
CB_AddButton(0, (LPARAM)&bbd);
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID;
@@ -916,7 +916,7 @@ void CB_InitDefaultButtons()
bbd.dwDefPos = 30;
bbd.iButtonWidth = 0;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[4];
- bbd.ptszTooltip = LPGENT("Quote last message OR selected text");
+ bbd.ptszTooltip = LPGENW("Quote last message OR selected text");
CB_AddButton(0, (LPARAM)&bbd);
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID;
@@ -924,7 +924,7 @@ void CB_InitDefaultButtons()
bbd.dwDefPos = 40;
bbd.iButtonWidth = 0;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[2];
- bbd.ptszTooltip = LPGENT("Message log options");
+ bbd.ptszTooltip = LPGENW("Message log options");
CB_AddButton(0, (LPARAM)&bbd);
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID;
@@ -932,7 +932,7 @@ void CB_InitDefaultButtons()
bbd.dwDefPos = 50;
bbd.iButtonWidth = 0;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[0];
- bbd.ptszTooltip = LPGENT("View user's history");
+ bbd.ptszTooltip = LPGENW("View user's history");
CB_AddButton(0, (LPARAM)&bbd);
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID;
@@ -940,7 +940,7 @@ void CB_InitDefaultButtons()
bbd.dwDefPos = 60;
bbd.iButtonWidth = 0;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[7];
- bbd.ptszTooltip = LPGENT("Edit user notes");
+ bbd.ptszTooltip = LPGENW("Edit user notes");
CB_AddButton(0, (LPARAM)&bbd);
//chat buttons
@@ -976,7 +976,7 @@ void CB_InitDefaultButtons()
bbd.dwDefPos = 81;
bbd.iButtonWidth = 22;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[16];
- bbd.ptszTooltip = LPGENT("Change background color");
+ bbd.ptszTooltip = LPGENW("Change background color");
CB_AddButton(0, (LPARAM)&bbd);
bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID;
@@ -984,7 +984,7 @@ void CB_InitDefaultButtons()
bbd.dwDefPos = 22;
bbd.iButtonWidth = 22;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[19];
- bbd.ptszTooltip = LPGENT("Toggle nick list");
+ bbd.ptszTooltip = LPGENW("Toggle nick list");
CB_AddButton(0, (LPARAM)&bbd);
bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID;
@@ -992,7 +992,7 @@ void CB_InitDefaultButtons()
bbd.dwDefPos = 24;
bbd.iButtonWidth = 22;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[18];
- bbd.ptszTooltip = LPGENT("Event filter - right click to setup, left click to activate/deactivate");
+ bbd.ptszTooltip = LPGENW("Event filter - right click to setup, left click to activate/deactivate");
CB_AddButton(0, (LPARAM)&bbd);
bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID;
@@ -1000,7 +1000,7 @@ void CB_InitDefaultButtons()
bbd.dwDefPos = 33;
bbd.iButtonWidth = 22;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[17];
- bbd.ptszTooltip = LPGENT("Channel manager");
+ bbd.ptszTooltip = LPGENW("Channel manager");
CB_AddButton(0, (LPARAM)&bbd);
BB_RegisterSeparators();
diff --git a/plugins/TabSRMM/src/chat/chat.h b/plugins/TabSRMM/src/chat/chat.h
index 536f837528..59f4078655 100644
--- a/plugins/TabSRMM/src/chat/chat.h
+++ b/plugins/TabSRMM/src/chat/chat.h
@@ -52,7 +52,7 @@ struct MODULEINFO : public GCModuleInfoBase
{
DWORD idleTimeStamp;
DWORD lastIdleCheck;
- TCHAR tszIdleMsg[60];
+ wchar_t tszIdleMsg[60];
};
struct SESSION_INFO : public GCSessionInfoBase
@@ -62,7 +62,7 @@ struct SESSION_INFO : public GCSessionInfoBase
int iLogTrayFlags, iLogPopupFlags, iDiskLogFlags;
int iSearchItem;
- TCHAR szSearch[255];
+ wchar_t szSearch[255];
};
struct LOGSTREAMDATA : public GCLogStreamDataBase
@@ -116,7 +116,7 @@ char* Log_CreateRtfHeader(MODULEINFO *mi);
// window.c
INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
-int GetTextPixelSize(TCHAR* pszText, HFONT hFont, bool bWidth);
+int GetTextPixelSize(wchar_t* pszText, HFONT hFont, bool bWidth);
// options.c
enum { FONTSECTION_AUTO, FONTSECTION_IM, FONTSECTION_IP };
@@ -132,28 +132,28 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT
// manager.c
SESSION_INFO* SM_FindSessionByHWND(HWND h);
SESSION_INFO* SM_FindSessionByHCONTACT(MCONTACT h);
-SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const TCHAR* pszOriginal, const TCHAR* pszCurrent);
+SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const wchar_t* pszOriginal, const wchar_t* pszCurrent);
void SM_RemoveContainer(TContainerData *pContainer);
BOOL SM_ReconfigureFilters();
-int UM_CompareItem(USERINFO *u1, const TCHAR* pszNick, WORD wStatus);
+int UM_CompareItem(USERINFO *u1, const wchar_t* pszNick, WORD wStatus);
//clist.c
//tools.c
BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight, int bManyFix);
int Chat_GetColorIndex(const char* pszModule, COLORREF cr);
-TCHAR* my_strstri(const TCHAR* s1, const TCHAR* s2);
+wchar_t* my_strstri(const wchar_t* s1, const wchar_t* s2);
int GetRichTextLength(HWND hwnd);
BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *pszText);
char GetIndicator(SESSION_INFO *si, LPCTSTR ptszNick, int *iNickIndex);
-UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, TCHAR* pszUID, TCHAR* pszWordText);
+UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, wchar_t* pszUID, wchar_t* pszWordText);
void DestroyGCMenu(HMENU *hMenu, int iIndex);
void Chat_SetFilters(SESSION_INFO *si);
void TSAPI DoFlashAndSoundWorker(FLASH_PARAMS* p);
BOOL DoPopup(SESSION_INFO *si, GCEVENT* gce);
-int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR* pszRoomName, COLORREF crBkg, const TCHAR* fmt, ...);
+int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, wchar_t* pszRoomName, COLORREF crBkg, const wchar_t* fmt, ...);
BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce);
#include "chat_resource.h"
diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp
index a7894b3e37..09b240c6aa 100644
--- a/plugins/TabSRMM/src/chat/log.cpp
+++ b/plugins/TabSRMM/src/chat/log.cpp
@@ -54,16 +54,16 @@ static char* u2a(const wchar_t* src, int codepage)
return result;
}
-static char* t2acp(const TCHAR* src, int codepage)
+static char* t2acp(const wchar_t* src, int codepage)
{
return u2a(src, codepage);
}
-static TCHAR *a2tcp(const char *text, int cp)
+static wchar_t *a2tcp(const char *text, int cp)
{
if (text != NULL) {
int cbLen = MultiByteToWideChar(cp, 0, text, -1, NULL, 0);
- TCHAR* result = (TCHAR*)mir_alloc(sizeof(TCHAR)*(cbLen + 1));
+ wchar_t* result = (wchar_t*)mir_alloc(sizeof(wchar_t)*(cbLen + 1));
if (result == NULL)
return NULL;
MultiByteToWideChar(cp, 0, text, -1, result, cbLen);
@@ -72,12 +72,12 @@ static TCHAR *a2tcp(const char *text, int cp)
return NULL;
}
-static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR **buffer, int *cbBufferEnd, int *cbBufferAlloced, const TCHAR *fmt, ...)
+static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, wchar_t **buffer, int *cbBufferEnd, int *cbBufferAlloced, const wchar_t *fmt, ...)
{
va_list va;
int lineLen, textCharsCount = 0;
- TCHAR* line = (TCHAR*)_alloca(8001 * sizeof(TCHAR));
- TCHAR* d;
+ wchar_t* line = (wchar_t*)_alloca(8001 * sizeof(wchar_t));
+ wchar_t* d;
MODULEINFO *mi = pci->MM_FindModule(streamData->si->pszModule);
va_start(va, fmt);
@@ -89,14 +89,14 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR **
lineLen = lineLen * 9 + 8;
if (*cbBufferEnd + lineLen > *cbBufferAlloced) {
cbBufferAlloced[0] += (lineLen + 1024 - lineLen % 1024);
- *buffer = (TCHAR*)mir_realloc(*buffer, *cbBufferAlloced * sizeof(TCHAR));
+ *buffer = (wchar_t*)mir_realloc(*buffer, *cbBufferAlloced * sizeof(wchar_t));
}
d = *buffer + *cbBufferEnd;
for (; *line; line++, textCharsCount++) {
if (*line == '%' && !simpleMode) {
- TCHAR szTemp[200];
+ wchar_t szTemp[200];
szTemp[0] = '\0';
switch (*++line) {
@@ -109,12 +109,12 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR **
case 'f':
if (!g_Settings.bStripFormat && !streamData->bStripFormat) {
if (line[1] != '\0' && line[2] != '\0') {
- TCHAR szTemp3[3], c = *line;
+ wchar_t szTemp3[3], c = *line;
int col;
szTemp3[0] = line[1];
szTemp3[1] = line[2];
szTemp3[2] = '\0';
- col = _ttoi(szTemp3);
+ col = _wtoi(szTemp3);
mir_sntprintf(szTemp, L"%%%c#%02X%02X%02X", c, GetRValue(mi->crColors[col]), GetGValue(mi->crColors[col]), GetBValue(mi->crColors[col]));
}
}
@@ -141,7 +141,7 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR **
if (szTemp[0]) {
size_t iLen = mir_tstrlen(szTemp);
- memcpy(d, szTemp, iLen * sizeof(TCHAR));
+ memcpy(d, szTemp, iLen * sizeof(wchar_t));
d += iLen;
}
}
@@ -150,7 +150,7 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR **
*d++ = (char)*line;
}
else {
- *d++ = (TCHAR)*line;
+ *d++ = (wchar_t)*line;
}
}
*d = '\0';
@@ -158,21 +158,21 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR **
return textCharsCount;
}
-static void AddEventTextToBufferIEView(TCHAR **buffer, int *bufferEnd, int *bufferAlloced, LOGSTREAMDATA *streamData)
+static void AddEventTextToBufferIEView(wchar_t **buffer, int *bufferEnd, int *bufferAlloced, LOGSTREAMDATA *streamData)
{
if (streamData->lin->ptszText)
Log_AppendIEView(streamData, FALSE, str, L": %s", streamData->lin->ptszText);
}
-static void AddEventToBufferIEView(TCHAR **buffer, int *bufferEnd, int *bufferAlloced, LOGSTREAMDATA *streamData, TCHAR *pszNick)
+static void AddEventToBufferIEView(wchar_t **buffer, int *bufferEnd, int *bufferAlloced, LOGSTREAMDATA *streamData, wchar_t *pszNick)
{
if (streamData && streamData->lin) {
switch (streamData->lin->iType) {
case GC_EVENT_MESSAGE:
if (streamData->lin->ptszText) {
- TCHAR *ptszTemp = NULL;
- TCHAR *ptszText = streamData->lin->ptszText;
+ wchar_t *ptszTemp = NULL;
+ wchar_t *ptszText = streamData->lin->ptszText;
if (streamData->dat->codePage != CP_ACP) {
char *aText = t2acp(streamData->lin->ptszText, CP_ACP);
ptszText = ptszTemp = a2tcp(aText, streamData->dat->codePage);
@@ -249,9 +249,9 @@ static void AddEventToBufferIEView(TCHAR **buffer, int *bufferEnd, int *bufferAl
}
}
-static void LogEventIEView(LOGSTREAMDATA *streamData, TCHAR *ptszNick)
+static void LogEventIEView(LOGSTREAMDATA *streamData, wchar_t *ptszNick)
{
- TCHAR *buffer = NULL;
+ wchar_t *buffer = NULL;
int bufferEnd = 0;
int bufferAlloced = 0;
IEVIEWEVENTDATA ied;
@@ -422,10 +422,10 @@ static int EventToIcon(LOGINFO * lin)
return 0;
}
-static void Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, CMStringA &str, const TCHAR *fmt, ...)
+static void Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, CMStringA &str, const wchar_t *fmt, ...)
{
int textCharsCount = 0;
- TCHAR *line = (TCHAR*)_alloca(8001 * sizeof(TCHAR));
+ wchar_t *line = (wchar_t*)_alloca(8001 * sizeof(wchar_t));
va_list va;
va_start(va, fmt);
@@ -458,14 +458,14 @@ static void Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, CMStringA
if (g_Settings.bStripFormat || streamData->bStripFormat)
line += 2;
else if (line[1] != '\0' && line[2] != '\0') {
- TCHAR szTemp3[3], c = *line;
+ wchar_t szTemp3[3], c = *line;
int col;
szTemp3[0] = line[1];
szTemp3[1] = line[2];
szTemp3[2] = '\0';
line += 2;
- col = _ttoi(szTemp3);
+ col = _wtoi(szTemp3);
col += (OPTIONS_FONTCOUNT + 1);
res.AppendFormat((c == 'c') ? "\\cf%u " : "\\highlight%u ", col);
}
@@ -520,8 +520,8 @@ static void Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, CMStringA
static void AddEventToBuffer(CMStringA &str, LOGSTREAMDATA *streamData)
{
- TCHAR szTemp[512], szTemp2[512];
- TCHAR* pszNick = NULL;
+ wchar_t szTemp[512], szTemp2[512];
+ wchar_t* pszNick = NULL;
if (streamData == NULL)
return;
@@ -531,20 +531,20 @@ static void AddEventToBuffer(CMStringA &str, LOGSTREAMDATA *streamData)
if (streamData->lin->ptszNick) {
if (g_Settings.bLogLimitNames && mir_tstrlen(streamData->lin->ptszNick) > 20) {
- _tcsncpy_s(szTemp, 20, streamData->lin->ptszNick, _TRUNCATE);
- _tcsncpy_s(szTemp + 20, 4, L"...", _TRUNCATE);
+ wcsncpy_s(szTemp, 20, streamData->lin->ptszNick, _TRUNCATE);
+ wcsncpy_s(szTemp + 20, 4, L"...", _TRUNCATE);
}
- else _tcsncpy_s(szTemp, streamData->lin->ptszNick, _TRUNCATE);
+ else wcsncpy_s(szTemp, streamData->lin->ptszNick, _TRUNCATE);
if (g_Settings.bClickableNicks)
mir_sntprintf(szTemp2, L"~~++#%s#++~~", szTemp);
else
- _tcsncpy_s(szTemp2, szTemp, _TRUNCATE);
+ wcsncpy_s(szTemp2, szTemp, _TRUNCATE);
if (streamData->lin->ptszUserInfo && streamData->lin->iType != GC_EVENT_TOPIC)
mir_sntprintf(szTemp, L"%s (%s)", szTemp2, streamData->lin->ptszUserInfo);
else
- _tcsncpy_s(szTemp, szTemp2, _TRUNCATE);
+ wcsncpy_s(szTemp, szTemp2, _TRUNCATE);
pszNick = szTemp;
}
@@ -669,7 +669,7 @@ char* Log_CreateRtfHeader(MODULEINFO *mi)
int iIndent = 0;
if (g_Settings.bLogSymbols) {
- TCHAR szString[2];
+ wchar_t szString[2];
LOGFONT lf;
szString[1] = 0;
@@ -770,10 +770,10 @@ static char* Log_CreateRTF(LOGSTREAMDATA *streamData)
//insert timestamp
if (g_Settings.bShowTime) {
- TCHAR szTimeStamp[30], szOldTimeStamp[30];
+ wchar_t szTimeStamp[30], szOldTimeStamp[30];
- _tcsncpy_s(szTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, lin->time), _TRUNCATE);
- _tcsncpy_s(szOldTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, streamData->si->LastTime), _TRUNCATE);
+ wcsncpy_s(szTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, lin->time), _TRUNCATE);
+ wcsncpy_s(szOldTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, streamData->si->LastTime), _TRUNCATE);
if (!g_Settings.bShowTimeIfChanged || streamData->si->LastTime == 0 || mir_tstrcmp(szTimeStamp, szOldTimeStamp)) {
streamData->si->LastTime = lin->time;
Log_AppendRTF(streamData, TRUE, str, L"%s", szTimeStamp);
@@ -984,7 +984,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedra
// trim the message log to the number of most recent events
// this uses hidden marks in the rich text to find the events which should be deleted
if (si->bTrimmed) {
- TCHAR szPattern[50];
+ wchar_t szPattern[50];
mir_sntprintf(szPattern, L"~-+%d+-~", si->pLogEnd);
FINDTEXTEX fi;
diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp
index eee0f6823d..61859eab96 100644
--- a/plugins/TabSRMM/src/chat/main.cpp
+++ b/plugins/TabSRMM/src/chat/main.cpp
@@ -269,7 +269,7 @@ int Chat_Load()
{
CheckUpdate();
- CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENT("Message Sessions") L"/" LPGENT("Group chats"), FONTMODE_ALTER };
+ CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Message Sessions") L"/" LPGENW("Group chats"), FONTMODE_ALTER };
mir_getCI(&data);
saveCI = *pci;
pci->OnCreateModule = OnCreateModule;
diff --git a/plugins/TabSRMM/src/chat/manager.cpp b/plugins/TabSRMM/src/chat/manager.cpp
index b1958c909c..014b238b05 100644
--- a/plugins/TabSRMM/src/chat/manager.cpp
+++ b/plugins/TabSRMM/src/chat/manager.cpp
@@ -26,14 +26,14 @@
#include "../stdafx.h"
-static int sttCompareNicknames(const TCHAR *s1, const TCHAR *s2)
+static int sttCompareNicknames(const wchar_t *s1, const wchar_t *s2)
{
if (s2 == NULL)
return 1;
// skip rubbish
- while (*s1 && !_istalpha(*s1)) ++s1;
- while (*s2 && !_istalpha(*s2)) ++s2;
+ while (*s1 && !iswalpha(*s1)) ++s1;
+ while (*s2 && !iswalpha(*s2)) ++s2;
// are there ~0veRy^kEwL_n1kz?
if (!*s1 && !*s2) return 0;
@@ -44,7 +44,7 @@ static int sttCompareNicknames(const TCHAR *s1, const TCHAR *s2)
return mir_tstrcmpi(s1, s2);
}
-int UM_CompareItem(USERINFO *u1, const TCHAR* pszNick, WORD wStatus)
+int UM_CompareItem(USERINFO *u1, const wchar_t* pszNick, WORD wStatus)
{
WORD dw1 = u1->Status;
WORD dw2 = wStatus;
@@ -108,12 +108,12 @@ SESSION_INFO* SM_FindSessionByHCONTACT(MCONTACT h)
return NULL;
}
-SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const TCHAR* pszOriginal, const TCHAR* pszCurrent)
+SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const wchar_t* pszOriginal, const wchar_t* pszCurrent)
{
if (prevSession == NULL && my_strstri(currSession->ptszName, pszOriginal) == currSession->ptszName)
return currSession;
- TCHAR* pszName = NULL;
+ wchar_t* pszName = NULL;
if (currSession == prevSession)
pszCurrent = pszOriginal;
diff --git a/plugins/TabSRMM/src/chat/muchighlight.cpp b/plugins/TabSRMM/src/chat/muchighlight.cpp
index 4567ba7000..0ec60454ff 100644
--- a/plugins/TabSRMM/src/chat/muchighlight.cpp
+++ b/plugins/TabSRMM/src/chat/muchighlight.cpp
@@ -65,12 +65,12 @@ void CMUCHighlight::init()
tokenize(m_NickPatternString, m_NickPatterns, m_iNickPatterns);
}
-void CMUCHighlight::tokenize(TCHAR *tszString, TCHAR**& patterns, UINT& nr)
+void CMUCHighlight::tokenize(wchar_t *tszString, wchar_t**& patterns, UINT& nr)
{
if (tszString == 0)
return;
- TCHAR *p = tszString;
+ wchar_t *p = tszString;
if (*p == 0)
return;
@@ -83,14 +83,14 @@ void CMUCHighlight::tokenize(TCHAR *tszString, TCHAR**& patterns, UINT& nr)
while (*p) {
if (*p == ' ') {
p++;
- while (*p && _istspace(*p))
+ while (*p && iswspace(*p))
p++;
if (*p)
nr++;
}
p++;
}
- patterns = (TCHAR **)mir_alloc(nr * sizeof(TCHAR*));
+ patterns = (wchar_t **)mir_alloc(nr * sizeof(wchar_t*));
p = tszString;
nr = 0;
@@ -101,7 +101,7 @@ void CMUCHighlight::tokenize(TCHAR *tszString, TCHAR**& patterns, UINT& nr)
while (*p) {
if (*p == ' ') {
*p++ = 0;
- while (*p && _istspace(*p))
+ while (*p && iswspace(*p))
p++;
if (*p)
patterns[nr++] = p;
@@ -118,13 +118,13 @@ int CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dwF
return 0;
if ((m_dwFlags & MATCH_TEXT) && (dwFlags & MATCH_TEXT) && (m_fHighlightMe || m_iTextPatterns > 0) && psi != 0) {
- TCHAR *p = pci->RemoveFormatting(pgce->ptszText);
- p = NEWTSTR_ALLOCA(p);
+ wchar_t *p = pci->RemoveFormatting(pgce->ptszText);
+ p = NEWWSTR_ALLOCA(p);
if (p == NULL)
return 0;
CharLower(p);
- TCHAR *tszMe = ((psi && psi->pMe) ? NEWTSTR_ALLOCA(psi->pMe->pszNick) : 0);
+ wchar_t *tszMe = ((psi && psi->pMe) ? NEWWSTR_ALLOCA(psi->pMe->pszNick) : 0);
if (tszMe)
CharLower(tszMe);
@@ -141,7 +141,7 @@ int CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dwF
if (*p == 0)
break;
- TCHAR *p1 = p;
+ wchar_t *p1 = p;
while (*p1 && *p1 != ' ' && *p1 != ',' && *p1 != '.' && *p1 != ':' && *p1 != ';' && *p1 != '?' && *p1 != '!')
p1++;
@@ -250,7 +250,7 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
iLen = ::GetWindowTextLength(::GetDlgItem(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN));
if (iLen) {
- szBuf = reinterpret_cast<TCHAR *>(mir_realloc(szBuf, sizeof(wchar_t) * (iLen + 2)));
+ szBuf = reinterpret_cast<wchar_t *>(mir_realloc(szBuf, sizeof(wchar_t) * (iLen + 2)));
::GetDlgItemText(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN, szBuf, iLen + 1);
db_set_ts(0, CHAT_MODULE, "HighlightWords", szBuf);
}
diff --git a/plugins/TabSRMM/src/chat/muchighlight.h b/plugins/TabSRMM/src/chat/muchighlight.h
index 570541e075..5f8533868e 100644
--- a/plugins/TabSRMM/src/chat/muchighlight.h
+++ b/plugins/TabSRMM/src/chat/muchighlight.h
@@ -60,16 +60,16 @@ public:
static INT_PTR CALLBACK dlgProcAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); // for the "add to" dialog
private:
- void tokenize(TCHAR *tszString, TCHAR**& patterns, UINT& nr);
+ void tokenize(wchar_t *tszString, wchar_t**& patterns, UINT& nr);
DWORD m_dwFlags;
bool m_fInitialized;
- TCHAR** m_NickPatterns;
- TCHAR** m_TextPatterns;
+ wchar_t** m_NickPatterns;
+ wchar_t** m_TextPatterns;
UINT m_iNickPatterns;
UINT m_iTextPatterns;
- TCHAR *m_NickPatternString;
- TCHAR *m_TextPatternString;
+ wchar_t *m_NickPatternString;
+ wchar_t *m_TextPatternString;
bool m_Valid;
bool m_fHighlightMe;
};
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp
index 36c9ec9d29..79bfc11d83 100644
--- a/plugins/TabSRMM/src/chat/options.cpp
+++ b/plugins/TabSRMM/src/chat/options.cpp
@@ -33,13 +33,13 @@
struct FontOptionsList
{
- TCHAR* szDescr;
+ wchar_t* szDescr;
COLORREF defColour;
- TCHAR* szDefFace;
+ wchar_t* szDefFace;
BYTE defCharset, defStyle;
char defSize;
COLORREF colour;
- TCHAR szFace[LF_FACESIZE];
+ wchar_t szFace[LF_FACESIZE];
BYTE charset, style;
char size;
};
@@ -47,8 +47,8 @@ struct FontOptionsList
struct ColorOptionsList
{
int order;
- TCHAR* tszGroup;
- TCHAR* tszName;
+ wchar_t* tszGroup;
+ wchar_t* tszName;
char* szSetting;
COLORREF def;
};
@@ -58,70 +58,70 @@ struct ColorOptionsList
* (GetSysColor(default_color & 0x00ffffff)), not a rgb value.
*/
static ColorOptionsList _clrs[] = {
- { 0, LPGENT("Message Sessions"), LPGENT("Input area background"), "inputbg", SRMSGDEFSET_BKGCOLOUR },
- { 1, LPGENT("Message Sessions"), LPGENT("Log background"), SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR },
- { 0, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), LPGENT("Outgoing background"), "outbg", SRMSGDEFSET_BKGOUTCOLOUR },
- { 1, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), LPGENT("Incoming background"), "inbg", SRMSGDEFSET_BKGINCOLOUR },
- { 2, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), LPGENT("Status background"), "statbg", SRMSGDEFSET_BKGCOLOUR },
- { 3, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), LPGENT("Incoming background(old)"), "oldinbg", SRMSGDEFSET_BKGINCOLOUR },
- { 4, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), LPGENT("Outgoing background(old)"), "oldoutbg", SRMSGDEFSET_BKGOUTCOLOUR },
- { 5, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), LPGENT("Horizontal Grid Lines"), "hgrid", RGB(224, 224, 224) },
- { 0, LPGENT("Message Sessions") L"/" LPGENT("Info Panel"), LPGENT("Panel background low"), "ipfieldsbg", 0x62caff },
- { 1, LPGENT("Message Sessions") L"/" LPGENT("Info Panel"), LPGENT("Panel background high"), "ipfieldsbgHigh", 0xf0f0f0 },
- { 0, LPGENT("Message Sessions") L"/" LPGENT("Common colors"), LPGENT("Toolbar background high"), "tbBgHigh", 0 },
- { 1, LPGENT("Message Sessions") L"/" LPGENT("Common colors"), LPGENT("Toolbar background low"), "tbBgLow", 0 },
- { 2, LPGENT("Message Sessions") L"/" LPGENT("Common colors"), LPGENT("Window fill color"), "fillColor", 0 },
- { 3, LPGENT("Message Sessions") L"/" LPGENT("Common colors"), LPGENT("Text area borders"), "cRichBorders", 0 },
- { 4, LPGENT("Message Sessions") L"/" LPGENT("Common colors"), LPGENT("Aero glow effect"), "aeroGlow", RGB(40, 40, 255) },
- { 4, LPGENT("Message Sessions") L"/" LPGENT("Common colors"), LPGENT("Generic text color (only when fill color is set)"), "genericTxtClr", 0xff000000 | COLOR_BTNTEXT },
+ { 0, LPGENW("Message Sessions"), LPGENW("Input area background"), "inputbg", SRMSGDEFSET_BKGCOLOUR },
+ { 1, LPGENW("Message Sessions"), LPGENW("Log background"), SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR },
+ { 0, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Outgoing background"), "outbg", SRMSGDEFSET_BKGOUTCOLOUR },
+ { 1, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Incoming background"), "inbg", SRMSGDEFSET_BKGINCOLOUR },
+ { 2, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Status background"), "statbg", SRMSGDEFSET_BKGCOLOUR },
+ { 3, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Incoming background(old)"), "oldinbg", SRMSGDEFSET_BKGINCOLOUR },
+ { 4, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Outgoing background(old)"), "oldoutbg", SRMSGDEFSET_BKGOUTCOLOUR },
+ { 5, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), LPGENW("Horizontal Grid Lines"), "hgrid", RGB(224, 224, 224) },
+ { 0, LPGENW("Message Sessions") L"/" LPGENW("Info Panel"), LPGENW("Panel background low"), "ipfieldsbg", 0x62caff },
+ { 1, LPGENW("Message Sessions") L"/" LPGENW("Info Panel"), LPGENW("Panel background high"), "ipfieldsbgHigh", 0xf0f0f0 },
+ { 0, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Toolbar background high"), "tbBgHigh", 0 },
+ { 1, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Toolbar background low"), "tbBgLow", 0 },
+ { 2, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Window fill color"), "fillColor", 0 },
+ { 3, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Text area borders"), "cRichBorders", 0 },
+ { 4, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Aero glow effect"), "aeroGlow", RGB(40, 40, 255) },
+ { 4, LPGENW("Message Sessions") L"/" LPGENW("Common colors"), LPGENW("Generic text color (only when fill color is set)"), "genericTxtClr", 0xff000000 | COLOR_BTNTEXT },
};
static ColorOptionsList _tabclrs[] = {
- { 0, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Normal text"), "tab_txt_normal", 0xff000000 | COLOR_BTNTEXT },
- { 1, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Active text"), "tab_txt_active", 0xff000000 | COLOR_BTNTEXT },
- { 2, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Hovered text"), "tab_txt_hottrack", 0xff000000 | COLOR_HOTLIGHT },
- { 3, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Unread text"), "tab_txt_unread", 0xff000000 | COLOR_HOTLIGHT },
-
- { 4, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Normal background"), "tab_bg_normal", 0xff000000 | COLOR_3DFACE },
- { 5, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Active background"), "tab_bg_active", 0xff000000 | COLOR_3DFACE },
- { 6, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Hovered background"), "tab_bg_hottrack", 0xff000000 | COLOR_3DFACE },
- { 7, LPGENT("Message Sessions") L"/" LPGENT("Tabs"), LPGENT("Unread background"), "tab_bg_unread", 0xff000000 | COLOR_3DFACE }
+ { 0, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Normal text"), "tab_txt_normal", 0xff000000 | COLOR_BTNTEXT },
+ { 1, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Active text"), "tab_txt_active", 0xff000000 | COLOR_BTNTEXT },
+ { 2, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Hovered text"), "tab_txt_hottrack", 0xff000000 | COLOR_HOTLIGHT },
+ { 3, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Unread text"), "tab_txt_unread", 0xff000000 | COLOR_HOTLIGHT },
+
+ { 4, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Normal background"), "tab_bg_normal", 0xff000000 | COLOR_3DFACE },
+ { 5, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Active background"), "tab_bg_active", 0xff000000 | COLOR_3DFACE },
+ { 6, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Hovered background"), "tab_bg_hottrack", 0xff000000 | COLOR_3DFACE },
+ { 7, LPGENW("Message Sessions") L"/" LPGENW("Tabs"), LPGENW("Unread background"), "tab_bg_unread", 0xff000000 | COLOR_3DFACE }
};
extern LOGFONT lfDefault;
static FontOptionsList IM_fontOptionsList[] = {
- { LPGENT(">> Outgoing messages"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT(">> Outgoing misc events"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("<< Incoming messages"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("<< Incoming misc events"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT(">> Outgoing name"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
- { LPGENT(">> Outgoing timestamp"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
- { LPGENT("<< Incoming name"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
- { LPGENT("<< Incoming timestamp"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
- { LPGENT(">> Outgoing messages (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT(">> Outgoing misc events (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("<< Incoming messages (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("<< Incoming misc events (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT(">> Outgoing name (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
- { LPGENT(">> Outgoing timestamp (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
- { LPGENT("<< Incoming name (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
- { LPGENT("<< Incoming timestamp (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
- { LPGENT("* Message Input Area"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("* Status changes"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("* Dividers"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("* Error and warning messages"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("* Symbols (incoming)"), RGB(50, 50, 50), L"Webdings", SYMBOL_CHARSET, 0, -12 },
- { LPGENT("* Symbols (outgoing)"), RGB(50, 50, 50), L"Webdings", SYMBOL_CHARSET, 0, -12 },
+ { LPGENW(">> Outgoing messages"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW(">> Outgoing misc events"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("<< Incoming messages"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("<< Incoming misc events"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW(">> Outgoing name"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
+ { LPGENW(">> Outgoing timestamp"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
+ { LPGENW("<< Incoming name"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
+ { LPGENW("<< Incoming timestamp"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
+ { LPGENW(">> Outgoing messages (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW(">> Outgoing misc events (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("<< Incoming messages (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("<< Incoming misc events (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW(">> Outgoing name (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
+ { LPGENW(">> Outgoing timestamp (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
+ { LPGENW("<< Incoming name (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
+ { LPGENW("<< Incoming timestamp (old)"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
+ { LPGENW("* Message Input Area"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("* Status changes"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("* Dividers"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("* Error and warning messages"), RGB(50, 50, 50), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("* Symbols (incoming)"), RGB(50, 50, 50), L"Webdings", SYMBOL_CHARSET, 0, -12 },
+ { LPGENW("* Symbols (outgoing)"), RGB(50, 50, 50), L"Webdings", SYMBOL_CHARSET, 0, -12 },
};
static FontOptionsList IP_fontOptionsList[] = {
- { LPGENT("Nickname"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("UIN"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Status"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Protocol"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Contacts local time"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Window caption (skinned mode)"), RGB(255, 255, 255), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Nickname"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("UIN"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Status"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Protocol"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Contacts local time"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Window caption (skinned mode)"), RGB(255, 255, 255), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
};
static FontOptionsList *fontOptionsList = IM_fontOptionsList;
@@ -129,49 +129,49 @@ static int fontCount = MSGDLGFONTCOUNT;
struct branch_t
{
- TCHAR* szDescr;
+ wchar_t* szDescr;
char* szDBName;
int iMode;
BYTE bDefault;
HTREEITEM hItem;
};
static branch_t branch1[] = {
- { LPGENT("Open new chat rooms in the default container"), "DefaultContainer", 0, 1, NULL },
- { LPGENT("Flash window when someone speaks"), "FlashWindow", 0, 0, NULL },
- { LPGENT("Flash window when a word is highlighted"), "FlashWindowHighlight", 0, 1, NULL },
- { LPGENT("Create tabs or windows for highlight events"), "CreateWindowOnHighlight", 0, 0, NULL },
- { LPGENT("Activate chat window on highlight"), "AnnoyingHighlight", 0, 0, NULL },
- { LPGENT("Show list of users in the chat room"), "ShowNicklist", 0, 1, NULL },
- { LPGENT("Colorize nicknames in member list"), "ColorizeNicks", 0, 1, NULL },
- { LPGENT("Show button menus when right clicking the buttons"), "RightClickFilter", 0, 1, NULL },
- { LPGENT("Show topic as status message on the contact list"), "TopicOnClist", 0, 1, NULL },
- { LPGENT("Do not pop up the window when joining a chat room"), "PopupOnJoin", 0, 0, NULL },
- { LPGENT("Hide or show the window by double click in the contact list"), "ToggleVisibility", 0, 0, NULL },
- { LPGENT("Sync splitter position with standard IM sessions"), "SyncSplitter", 0, 0, NULL },
- { LPGENT("Show contact's status modes if supported by the protocol"), "ShowContactStatus", 0, 1, NULL },
- { LPGENT("Display contact's status icon before user role icon"), "ContactStatusFirst", 0, 0, NULL },
- { LPGENT("Use IRC style status indicators in the nick list"), "ClassicIndicators", 0, 0, NULL },
- { LPGENT("Use alternative sorting method in member list"), "AlternativeSorting", 0, 1, NULL }
+ { LPGENW("Open new chat rooms in the default container"), "DefaultContainer", 0, 1, NULL },
+ { LPGENW("Flash window when someone speaks"), "FlashWindow", 0, 0, NULL },
+ { LPGENW("Flash window when a word is highlighted"), "FlashWindowHighlight", 0, 1, NULL },
+ { LPGENW("Create tabs or windows for highlight events"), "CreateWindowOnHighlight", 0, 0, NULL },
+ { LPGENW("Activate chat window on highlight"), "AnnoyingHighlight", 0, 0, NULL },
+ { LPGENW("Show list of users in the chat room"), "ShowNicklist", 0, 1, NULL },
+ { LPGENW("Colorize nicknames in member list"), "ColorizeNicks", 0, 1, NULL },
+ { LPGENW("Show button menus when right clicking the buttons"), "RightClickFilter", 0, 1, NULL },
+ { LPGENW("Show topic as status message on the contact list"), "TopicOnClist", 0, 1, NULL },
+ { LPGENW("Do not pop up the window when joining a chat room"), "PopupOnJoin", 0, 0, NULL },
+ { LPGENW("Hide or show the window by double click in the contact list"), "ToggleVisibility", 0, 0, NULL },
+ { LPGENW("Sync splitter position with standard IM sessions"), "SyncSplitter", 0, 0, NULL },
+ { LPGENW("Show contact's status modes if supported by the protocol"), "ShowContactStatus", 0, 1, NULL },
+ { LPGENW("Display contact's status icon before user role icon"), "ContactStatusFirst", 0, 0, NULL },
+ { LPGENW("Use IRC style status indicators in the nick list"), "ClassicIndicators", 0, 0, NULL },
+ { LPGENW("Use alternative sorting method in member list"), "AlternativeSorting", 0, 1, NULL }
};
static branch_t branch2[] = {
- { LPGENT("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1, NULL },
- { LPGENT("Timestamp only when event time differs"), "ShowTimeStampIfChanged", 0, 0, NULL },
- { LPGENT("Timestamp has same color as the event"), "TimeStampEventColour", 0, 0, NULL },
- { LPGENT("Indent the second line of a message"), "LogIndentEnabled", 0, 1, NULL },
- { LPGENT("Limit user names in the message log to 20 characters"), "LogLimitNames", 0, 1, NULL },
- { LPGENT("Add a colon (:) to auto-completed user names"), "AddColonToAutoComplete", 0, 1, NULL },
- { LPGENT("Add a comma instead of a colon to auto-completed user names"), "UseCommaAsColon", 0, 0, NULL },
- { LPGENT("Start private conversation on double click in nick list (insert nick if unchecked)"), "DoubleClick4Privat", 0, 0, NULL },
- { LPGENT("Strip colors from messages in the log"), "StripFormatting", 0, 0, NULL },
- { LPGENT("Enable the 'event filter' for new rooms"), "FilterEnabled", 0, 0, NULL },
- { LPGENT("Use IRC style status indicators in the log"), "LogClassicIndicators", 0, 0, NULL },
- { LPGENT("Allow clickable user names in the message log"), "ClickableNicks", 0, 1, NULL },
- { LPGENT("Add new line after names"), "NewlineAfterNames", 0, 0, NULL },
- { LPGENT("Colorize user names in message log"), "ColorizeNicksInLog", 0, 1, NULL },
- { LPGENT("Scale down icons to 10x10 pixels in the chat log"), "ScaleIcons", 0, 1, NULL },
- { LPGENT("Place a separator in the log after a window lost its foreground status"), "UseDividers", 0, 1, NULL },
- { LPGENT("Only place a separator when an incoming event is announced with a popup"), "DividersUsePopupConfig", 0, 1, NULL }
+ { LPGENW("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1, NULL },
+ { LPGENW("Timestamp only when event time differs"), "ShowTimeStampIfChanged", 0, 0, NULL },
+ { LPGENW("Timestamp has same color as the event"), "TimeStampEventColour", 0, 0, NULL },
+ { LPGENW("Indent the second line of a message"), "LogIndentEnabled", 0, 1, NULL },
+ { LPGENW("Limit user names in the message log to 20 characters"), "LogLimitNames", 0, 1, NULL },
+ { LPGENW("Add a colon (:) to auto-completed user names"), "AddColonToAutoComplete", 0, 1, NULL },
+ { LPGENW("Add a comma instead of a colon to auto-completed user names"), "UseCommaAsColon", 0, 0, NULL },
+ { LPGENW("Start private conversation on double click in nick list (insert nick if unchecked)"), "DoubleClick4Privat", 0, 0, NULL },
+ { LPGENW("Strip colors from messages in the log"), "StripFormatting", 0, 0, NULL },
+ { LPGENW("Enable the 'event filter' for new rooms"), "FilterEnabled", 0, 0, NULL },
+ { LPGENW("Use IRC style status indicators in the log"), "LogClassicIndicators", 0, 0, NULL },
+ { LPGENW("Allow clickable user names in the message log"), "ClickableNicks", 0, 1, NULL },
+ { LPGENW("Add new line after names"), "NewlineAfterNames", 0, 0, NULL },
+ { LPGENW("Colorize user names in message log"), "ColorizeNicksInLog", 0, 1, NULL },
+ { LPGENW("Scale down icons to 10x10 pixels in the chat log"), "ScaleIcons", 0, 1, NULL },
+ { LPGENW("Place a separator in the log after a window lost its foreground status"), "UseDividers", 0, 1, NULL },
+ { LPGENW("Only place a separator when an incoming event is announced with a popup"), "DividersUsePopupConfig", 0, 1, NULL }
};
static HWND hPathTip = 0;
@@ -222,19 +222,19 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM
mir_snprintf(str, "Font%d", i);
if ((i == 17 && !mir_strcmp(szMod, CHATFONT_MODULE)) || ((i == 20 || i == 21) && !mir_strcmp(szMod, FONTMODULE))) {
lf->lfCharSet = SYMBOL_CHARSET;
- _tcsncpy_s(lf->lfFaceName, L"Webdings", _TRUNCATE);
+ wcsncpy_s(lf->lfFaceName, L"Webdings", _TRUNCATE);
}
else {
ptrT tszDefFace(db_get_tsa(NULL, szMod, str));
if (tszDefFace == NULL)
- _tcsncpy_s(lf->lfFaceName, fol[j].szDefFace, _TRUNCATE);
+ wcsncpy_s(lf->lfFaceName, fol[j].szDefFace, _TRUNCATE);
else
- _tcsncpy_s(lf->lfFaceName, tszDefFace, _TRUNCATE);
+ wcsncpy_s(lf->lfFaceName, tszDefFace, _TRUNCATE);
}
}
}
-static HTREEITEM InsertBranch(HWND hwndTree, TCHAR* pszDescr, BOOL bExpanded)
+static HTREEITEM InsertBranch(HWND hwndTree, wchar_t* pszDescr, BOOL bExpanded)
{
TVINSERTSTRUCT tvis;
tvis.hParent = NULL;
@@ -354,7 +354,7 @@ HICON LoadIconEx(char *pszIcoLibName)
return IcoLib_GetIcon(szTemp);
}
-static void InitSetting(TCHAR* &ppPointer, const char *pszSetting, const TCHAR *pszDefault)
+static void InitSetting(wchar_t* &ppPointer, const char *pszSetting, const wchar_t *pszDefault)
{
ptrT val(db_get_tsa(NULL, CHAT_MODULE, pszSetting));
replaceStrT(ppPointer, (val != NULL) ? val : pszDefault);
@@ -410,7 +410,7 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
FillBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading1, branch1, _countof(branch1), 0x0000);
FillBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading2, branch2, _countof(branch2), 0x0000);
- TCHAR* pszGroup = NULL;
+ wchar_t* pszGroup = NULL;
InitSetting(pszGroup, "AddToGroup", L"Chat rooms");
SetDlgItemText(hwndDlg, IDC_GROUP, pszGroup);
mir_free(pszGroup);
@@ -435,12 +435,12 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
int iLen;
- TCHAR *pszText = NULL;
+ wchar_t *pszText = NULL;
BYTE b;
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_GROUP));
if (iLen > 0) {
- pszText = (TCHAR*)mir_realloc(pszText, (iLen + 2) * sizeof(TCHAR));
+ pszText = (wchar_t*)mir_realloc(pszText, (iLen + 2) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_GROUP, pszText, iLen + 1);
db_set_ts(NULL, CHAT_MODULE, "AddToGroup", pszText);
}
@@ -472,16 +472,16 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
return FALSE;
}
-static TCHAR* chatcolorsnames[] =
+static wchar_t* chatcolorsnames[] =
{
- LPGENT("Voiced"),
- LPGENT("Half operators"),
- LPGENT("Channel operators"),
- LPGENT("Extended mode 1"),
- LPGENT("Extended mode 2"),
- LPGENT("Selection background"),
- LPGENT("Selected text"),
- LPGENT("Incremental search highlight")
+ LPGENW("Voiced"),
+ LPGENW("Half operators"),
+ LPGENW("Channel operators"),
+ LPGENW("Extended mode 1"),
+ LPGENW("Extended mode 2"),
+ LPGENW("Selection background"),
+ LPGENW("Selected text"),
+ LPGENW("Incremental search highlight")
};
void RegisterFontServiceFonts()
@@ -502,54 +502,54 @@ void RegisterFontServiceFonts()
mir_snprintf(szTemp, "Font%d", i);
strncpy(fid.prefix, szTemp, _countof(fid.prefix));
fid.order = i;
- _tcsncpy(fid.name, fontOptionsList[i].szDescr, _countof(fid.name));
+ wcsncpy(fid.name, fontOptionsList[i].szDescr, _countof(fid.name));
fid.deffontsettings.colour = fontOptionsList[i].colour;
fid.deffontsettings.size = (char)lf.lfHeight;
fid.deffontsettings.style = (lf.lfWeight >= FW_BOLD ? FONTF_BOLD : 0) | (lf.lfItalic ? FONTF_ITALIC : 0);
fid.deffontsettings.charset = lf.lfCharSet;
fid.flags = fid.flags & ~FIDF_CLASSMASK | (fid.deffontsettings.style&FONTF_BOLD ? FIDF_CLASSHEADER : FIDF_CLASSGENERAL);
- _tcsncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE);
- _tcsncpy(fid.backgroundGroup, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), _countof(fid.backgroundGroup));
- _tcsncpy(fid.group, LPGENT("Message Sessions") L"/" LPGENT("Single Messaging"), _countof(fid.group));
+ wcsncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE);
+ wcsncpy(fid.backgroundGroup, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), _countof(fid.backgroundGroup));
+ wcsncpy(fid.group, LPGENW("Message Sessions") L"/" LPGENW("Single Messaging"), _countof(fid.group));
switch (i) {
case MSGFONTID_MYMSG:
case 1:
case MSGFONTID_MYNAME:
case MSGFONTID_MYTIME:
case 21:
- _tcsncpy(fid.backgroundName, LPGENT("Outgoing background"), _countof(fid.backgroundName));
+ wcsncpy(fid.backgroundName, LPGENW("Outgoing background"), _countof(fid.backgroundName));
break;
case 8:
case 9:
case 12:
case 13:
- _tcsncpy(fid.backgroundName, LPGENT("Outgoing background(old)"), _countof(fid.backgroundName));
+ wcsncpy(fid.backgroundName, LPGENW("Outgoing background(old)"), _countof(fid.backgroundName));
break;
case 10:
case 11:
case 14:
case 15:
- _tcsncpy(fid.backgroundName, LPGENT("Incoming background(old)"), _countof(fid.backgroundName));
+ wcsncpy(fid.backgroundName, LPGENW("Incoming background(old)"), _countof(fid.backgroundName));
break;
case MSGFONTID_MESSAGEAREA:
- _tcsncpy(fid.group, LPGENT("Message Sessions"), _countof(fid.group));
- _tcsncpy(fid.backgroundGroup, LPGENT("Message Sessions"), _countof(fid.backgroundGroup));
- _tcsncpy(fid.backgroundName, LPGENT("Input area background"), _countof(fid.backgroundName));
+ wcsncpy(fid.group, LPGENW("Message Sessions"), _countof(fid.group));
+ wcsncpy(fid.backgroundGroup, LPGENW("Message Sessions"), _countof(fid.backgroundGroup));
+ wcsncpy(fid.backgroundName, LPGENW("Input area background"), _countof(fid.backgroundName));
fid.flags |= FIDF_DISABLESTYLES;
fid.flags &= ~FIDF_ALLOWEFFECTS;
break;
case 17:
- _tcsncpy(fid.backgroundName, LPGENT("Status background"), _countof(fid.backgroundName));
+ wcsncpy(fid.backgroundName, LPGENW("Status background"), _countof(fid.backgroundName));
break;
case 18:
- _tcsncpy(fid.backgroundGroup, LPGENT("Message Sessions"), _countof(fid.backgroundGroup));
- _tcsncpy(fid.backgroundName, LPGENT("Log background"), _countof(fid.backgroundName));
+ wcsncpy(fid.backgroundGroup, LPGENW("Message Sessions"), _countof(fid.backgroundGroup));
+ wcsncpy(fid.backgroundName, LPGENW("Log background"), _countof(fid.backgroundName));
break;
case 19:
- _tcsncpy(fid.backgroundName, L"", _countof(fid.backgroundName));
+ wcsncpy(fid.backgroundName, L"", _countof(fid.backgroundName));
break;
default:
- _tcsncpy(fid.backgroundName, LPGENT("Incoming background"), _countof(fid.backgroundName));
+ wcsncpy(fid.backgroundName, LPGENW("Incoming background"), _countof(fid.backgroundName));
break;
}
FontRegisterT(&fid);
@@ -557,35 +557,35 @@ void RegisterFontServiceFonts()
fontOptionsList = IP_fontOptionsList;
fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS;
- _tcsncpy(fid.group, LPGENT("Message Sessions") L"/" LPGENT("Info Panel"), _countof(fid.group));
- _tcsncpy(fid.backgroundGroup, LPGENT("Message Sessions") L"/" LPGENT("Info Panel"), _countof(fid.backgroundGroup));
- _tcsncpy(fid.backgroundName, LPGENT("Fields background"), _countof(fid.backgroundName));
+ wcsncpy(fid.group, LPGENW("Message Sessions") L"/" LPGENW("Info Panel"), _countof(fid.group));
+ wcsncpy(fid.backgroundGroup, LPGENW("Message Sessions") L"/" LPGENW("Info Panel"), _countof(fid.backgroundGroup));
+ wcsncpy(fid.backgroundName, LPGENW("Fields background"), _countof(fid.backgroundName));
for (int i = 0; i < IPFONTCOUNT; i++) {
LoadMsgDlgFont(FONTSECTION_IP, i + 100, &lf, &fontOptionsList[i].colour, FONTMODULE);
mir_snprintf(szTemp, "Font%d", i + 100);
strncpy(fid.prefix, szTemp, _countof(fid.prefix));
fid.order = i + 100;
- _tcsncpy(fid.name, fontOptionsList[i].szDescr, _countof(fid.name));
+ wcsncpy(fid.name, fontOptionsList[i].szDescr, _countof(fid.name));
fid.deffontsettings.colour = fontOptionsList[i].colour;
fid.deffontsettings.size = (char)lf.lfHeight;
fid.deffontsettings.style = (lf.lfWeight >= FW_BOLD ? FONTF_BOLD : 0) | (lf.lfItalic ? FONTF_ITALIC : 0);
fid.deffontsettings.charset = lf.lfCharSet;
fid.flags = fid.flags & ~FIDF_CLASSMASK | (fid.deffontsettings.style&FONTF_BOLD ? FIDF_CLASSHEADER : FIDF_CLASSGENERAL);
fid.deffontsettings.charset = lf.lfCharSet;
- _tcsncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE);
+ wcsncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE);
if (i == IPFONTCOUNT - 1) {
- _tcsncpy(fid.backgroundGroup, L"", _countof(fid.backgroundGroup));
- _tcsncpy(fid.backgroundName, L"", _countof(fid.backgroundName));
- _tcsncpy(fid.group, LPGENT("Message Sessions"), _countof(fid.group));
+ wcsncpy(fid.backgroundGroup, L"", _countof(fid.backgroundGroup));
+ wcsncpy(fid.backgroundName, L"", _countof(fid.backgroundName));
+ wcsncpy(fid.group, LPGENW("Message Sessions"), _countof(fid.group));
}
FontRegisterT(&fid);
}
- _tcsncpy(cid.group, LPGENT("Message Sessions") L"/" LPGENT("Group chats"), _countof(cid.group));
+ wcsncpy(cid.group, LPGENW("Message Sessions") L"/" LPGENW("Group chats"), _countof(cid.group));
strncpy(cid.dbSettingsGroup, CHAT_MODULE, _countof(cid.dbSettingsGroup));
for (int i = 0; i <= 7; i++) {
mir_snprintf(szTemp, "NickColor%d", i);
- _tcsncpy(cid.name, chatcolorsnames[i], _countof(cid.name));
+ wcsncpy(cid.name, chatcolorsnames[i], _countof(cid.name));
cid.order = i + 1;
strncpy(cid.setting, szTemp, _countof(cid.setting));
switch (i) {
@@ -602,13 +602,13 @@ void RegisterFontServiceFonts()
ColourRegisterT(&cid);
}
cid.order++;
- _tcsncpy_s(cid.name, LPGENT("Nick list background"), _TRUNCATE);
+ wcsncpy_s(cid.name, LPGENW("Nick list background"), _TRUNCATE);
strncpy_s(cid.setting, "ColorNicklistBG", _TRUNCATE);
cid.defcolour = SRMSGDEFSET_BKGCOLOUR;
ColourRegisterT(&cid);
cid.order++;
- _tcsncpy_s(cid.name, LPGENT("Group chat log background"), _TRUNCATE);
+ wcsncpy_s(cid.name, LPGENW("Group chat log background"), _TRUNCATE);
strncpy_s(cid.setting, "ColorLogBG", _TRUNCATE);
ColourRegisterT(&cid);
@@ -618,8 +618,8 @@ void RegisterFontServiceFonts()
for (int i = 0; i < _countof(_clrs); i++) {
cid.order = _clrs[i].order;
- _tcsncpy(cid.group, _clrs[i].tszGroup, _countof(fid.group));
- _tcsncpy(cid.name, _clrs[i].tszName, _countof(cid.name));
+ wcsncpy(cid.group, _clrs[i].tszGroup, _countof(fid.group));
+ wcsncpy(cid.name, _clrs[i].tszName, _countof(cid.name));
strncpy(cid.setting, _clrs[i].szSetting, _countof(cid.setting));
if (_clrs[i].def & 0xff000000)
cid.defcolour = GetSysColor(_clrs[i].def & 0x000000ff);
@@ -633,8 +633,8 @@ void RegisterFontServiceFonts()
// text and background colors for tabs
for (int i = 0; i < _countof(_tabclrs); i++) {
cid.order = _tabclrs[i].order;
- _tcsncpy(cid.group, _tabclrs[i].tszGroup, _countof(fid.group));
- _tcsncpy(cid.name, _tabclrs[i].tszName, _countof(cid.name));
+ wcsncpy(cid.group, _tabclrs[i].tszGroup, _countof(fid.group));
+ wcsncpy(cid.name, _tabclrs[i].tszName, _countof(cid.name));
strncpy(cid.setting, _tabclrs[i].szSetting, _countof(cid.setting));
if (_tabclrs[i].def & 0xff000000)
cid.defcolour = GetSysColor(_tabclrs[i].def & 0x000000ff);
@@ -689,7 +689,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN4, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, CHAT_MODULE, "LoggingLimit", 100), 0));
Utils::enableDlgControl(hwndDlg, IDC_LIMIT, g_Settings.bLoggingEnabled);
- TCHAR tszTooltipText[2048];
+ wchar_t tszTooltipText[2048];
mir_sntprintf(tszTooltipText,
L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n"
@@ -745,23 +745,23 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
switch (LOWORD(wParam)) {
case IDC_MUC_OPENLOGBASEDIR:
{
- TCHAR tszTemp[MAX_PATH + 20];
- _tcsncpy_s(tszTemp, g_Settings.pszLogDir, _TRUNCATE);
+ wchar_t tszTemp[MAX_PATH + 20];
+ wcsncpy_s(tszTemp, g_Settings.pszLogDir, _TRUNCATE);
- TCHAR *p = tszTemp;
+ wchar_t *p = tszTemp;
while (*p && (*p == '\\' || *p == '.'))
p++;
if (*p)
- if (TCHAR *p1 = _tcschr(p, '\\'))
+ if (wchar_t *p1 = wcschr(p, '\\'))
*p1 = 0;
- TCHAR tszInitialDir[_MAX_DRIVE + _MAX_PATH + 10];
+ wchar_t tszInitialDir[_MAX_DRIVE + _MAX_PATH + 10];
mir_sntprintf(tszInitialDir, L"%s%s", M.getChatLogPath(), p);
if (!PathFileExists(tszInitialDir))
- _tcsncpy_s(tszInitialDir, M.getChatLogPath(), _TRUNCATE);
+ wcsncpy_s(tszInitialDir, M.getChatLogPath(), _TRUNCATE);
- TCHAR tszReturnName[MAX_PATH]; tszReturnName[0] = 0;
+ wchar_t tszReturnName[MAX_PATH]; tszReturnName[0] = 0;
mir_sntprintf(tszTemp, L"%s%c*.*%c%c", TranslateT("All files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
@@ -779,7 +779,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
case IDC_FONTCHOOSE:
{
- TCHAR tszDirectory[MAX_PATH];
+ wchar_t tszDirectory[MAX_PATH];
LPMALLOC psMalloc;
if (SUCCEEDED(CoGetMalloc(1, &psMalloc))) {
@@ -793,11 +793,11 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
LPITEMIDLIST idList = SHBrowseForFolder(&bi);
if (idList) {
- const TCHAR *szUserDir = M.getUserDir();
+ const wchar_t *szUserDir = M.getUserDir();
SHGetPathFromIDList(idList, tszDirectory);
mir_tstrcat(tszDirectory, L"\\");
- TCHAR tszTemp[MAX_PATH];
+ wchar_t tszTemp[MAX_PATH];
PathToRelativeT(tszDirectory, tszTemp, szUserDir);
SetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, mir_tstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME);
}
@@ -824,7 +824,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_LOGDIRECTORY));
if (iLen > 0) {
- TCHAR *pszText1 = (TCHAR*)mir_alloc(iLen*sizeof(TCHAR) + 2);
+ wchar_t *pszText1 = (wchar_t*)mir_alloc(iLen*sizeof(wchar_t) + 2);
GetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, pszText1, iLen + 1);
db_set_ts(NULL, CHAT_MODULE, "LogDirectory", pszText1);
mir_free(pszText1);
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp
index d892fc66aa..4fd40eb4d2 100644
--- a/plugins/TabSRMM/src/chat/services.cpp
+++ b/plugins/TabSRMM/src/chat/services.cpp
@@ -34,9 +34,9 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT
if (M.FindWindow(hContact) != 0)
return 0;
- if (hContact != 0 && M.GetByte("limittabs", 0) && !_tcsncmp(pContainer->szName, L"default", 6)) {
+ if (hContact != 0 && M.GetByte("limittabs", 0) && !wcsncmp(pContainer->szName, L"default", 6)) {
if ((pContainer = FindMatchingContainer(L"default")) == NULL) {
- TCHAR szName[CONTAINER_NAMELEN + 1];
+ wchar_t szName[CONTAINER_NAMELEN + 1];
mir_sntprintf(szName, L"default");
if ((pContainer = CreateContainer(szName, CNT_CREATEFLAG_CLONED, hContact)) == NULL)
return 0;
@@ -49,17 +49,17 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT
newData.szInitialText = NULL;
memset(&newData.item, 0, sizeof(newData.item));
- TCHAR *contactName = pcli->pfnGetContactDisplayName(newData.hContact, 0);
+ wchar_t *contactName = pcli->pfnGetContactDisplayName(newData.hContact, 0);
// cut nickname if larger than x chars...
- TCHAR newcontactname[128];
+ wchar_t newcontactname[128];
if (mir_tstrlen(contactName) > 0) {
if (M.GetByte("cuttitle", 0))
CutContactName(contactName, newcontactname, _countof(newcontactname));
else
- _tcsncpy_s(newcontactname, contactName, _TRUNCATE);
+ wcsncpy_s(newcontactname, contactName, _TRUNCATE);
}
- else _tcsncpy_s(newcontactname, L"_U_", _TRUNCATE);
+ else wcsncpy_s(newcontactname, L"_U_", _TRUNCATE);
newData.item.pszText = newcontactname;
newData.item.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM;
@@ -163,12 +163,12 @@ void ShowRoom(SESSION_INFO *si, WPARAM, BOOL)
return;
}
- TCHAR szName[CONTAINER_NAMELEN + 2]; szName[0] = 0;
+ wchar_t szName[CONTAINER_NAMELEN + 2]; szName[0] = 0;
TContainerData *pContainer = si->pContainer;
if (pContainer == NULL) {
GetContainerNameForContact(si->hContact, szName, CONTAINER_NAMELEN);
if (!g_Settings.bOpenInDefault && !mir_tstrcmp(szName, L"default"))
- _tcsncpy(szName, L"Chat Rooms", CONTAINER_NAMELEN);
+ wcsncpy(szName, L"Chat Rooms", CONTAINER_NAMELEN);
szName[CONTAINER_NAMELEN] = 0;
pContainer = FindContainerByName(szName);
}
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp
index 98a3b8f603..274e4ab8a0 100644
--- a/plugins/TabSRMM/src/chat/tools.cpp
+++ b/plugins/TabSRMM/src/chat/tools.cpp
@@ -92,11 +92,11 @@ BOOL DoTrayIcon(SESSION_INFO *si, GCEVENT *gce)
return TRUE;
}
-int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR*, COLORREF crBkg, const TCHAR* fmt, ...)
+int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, wchar_t*, COLORREF crBkg, const wchar_t* fmt, ...)
{
POPUPDATAT pd = { 0 };
va_list marker;
- static TCHAR szBuf[4 * 1024];
+ static wchar_t szBuf[4 * 1024];
if (!fmt || mir_tstrlen(fmt) == 0 || mir_tstrlen(fmt) > 2000)
return 0;
@@ -114,7 +114,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa
PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName);
mir_sntprintf(pd.lptzContactName, L"%s - %s", (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, pcli->pfnGetContactDisplayName(hContact, 0));
- _tcsncpy_s(pd.lptzText, TranslateTS(szBuf), _TRUNCATE);
+ wcsncpy_s(pd.lptzText, TranslateTS(szBuf), _TRUNCATE);
pd.iSeconds = g_Settings.iPopupTimeout;
if (g_Settings.iPopupStyle == 2) {
@@ -144,7 +144,7 @@ BOOL DoPopup(SESSION_INFO *si, GCEVENT* gce)
TWindowData *dat = si->dat;
TContainerData *pContainer = dat ? dat->pContainer : NULL;
- TCHAR *bbStart, *bbEnd;
+ wchar_t *bbStart, *bbEnd;
if (g_Settings.bBBCodeInPopups) {
bbStart = L"[b]";
bbEnd = L"[/b]";
@@ -474,15 +474,15 @@ int Chat_GetColorIndex(const char* pszModule, COLORREF cr)
return -1;
}
-TCHAR* my_strstri(const TCHAR* s1, const TCHAR* s2)
+wchar_t* my_strstri(const wchar_t* s1, const wchar_t* s2)
{
int i, j, k;
- _tsetlocale(LC_ALL, L"");
+ _wsetlocale(LC_ALL, L"");
for (i = 0; s1[i]; i++)
- for (j = i, k = 0; _totlower(s1[j]) == _totlower(s2[k]); j++, k++)
+ for (j = i, k = 0; towlower(s1[j]) == towlower(s2[k]); j++, k++)
if (!s2[k + 1])
- return (TCHAR*)(s1 + i);
+ return (wchar_t*)(s1 + i);
return NULL;
}
@@ -505,7 +505,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
return saveCI.LogToFile(si, gce); // call kernel method
}
-UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, TCHAR* pszUID, TCHAR* pszWordText)
+UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, wchar_t* pszUID, wchar_t* pszWordText)
{
HMENU hSubMenu = 0;
@@ -531,7 +531,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO
}
if (pszWordText && pszWordText[0]) {
- TCHAR szMenuText[4096];
+ wchar_t szMenuText[4096];
mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText);
ModifyMenu(*hMenu, 4, MF_STRING | MF_BYPOSITION, 4, szMenuText);
}
@@ -539,14 +539,14 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO
gcmi.Type = MENU_ON_LOG;
}
else if (iIndex == 0) {
- TCHAR szTemp[50];
+ wchar_t szTemp[50];
if (pszWordText)
mir_sntprintf(szTemp, TranslateT("&Message %s"), pszWordText);
else
- _tcsncpy_s(szTemp, TranslateT("&Message"), _TRUNCATE);
+ wcsncpy_s(szTemp, TranslateT("&Message"), _TRUNCATE);
if (mir_tstrlen(szTemp) > 40)
- _tcsncpy_s(szTemp + 40, 4, L"...", _TRUNCATE);
+ wcsncpy_s(szTemp + 40, 4, L"...", _TRUNCATE);
ModifyMenu(*hMenu, ID_MESS, MF_STRING | MF_BYCOMMAND, ID_MESS, szTemp);
gcmi.Type = MENU_ON_NICKLIST;
}
@@ -557,7 +557,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO
AppendMenu(*hMenu, MF_SEPARATOR, 0, 0);
for (int i = 0; i < gcmi.nItems; i++) {
- TCHAR *ptszText = TranslateTS(gcmi.Item[i].pszDesc);
+ wchar_t *ptszText = TranslateTS(gcmi.Item[i].pszDesc);
DWORD dwState = gcmi.Item[i].bDisabled ? MF_GRAYED : 0;
if (gcmi.Item[i].uType == MENU_NEWPOPUP) {
@@ -686,7 +686,7 @@ BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *gce)
dwMask |= CMUCHighlight::MATCH_NICKNAME;
if (si && g_Settings.bLogClassicIndicators) {
size_t len = mir_tstrlen(gce->ptszNick) + 1;
- TCHAR *tmp = (TCHAR*)_alloca(sizeof(TCHAR)*(len + 1));
+ wchar_t *tmp = (wchar_t*)_alloca(sizeof(wchar_t)*(len + 1));
*tmp = GetIndicator(si, gce->ptszNick, 0);
mir_tstrcpy(tmp + 1, gce->ptszNick);
evTmp.ptszNick = tmp;
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp
index c633d50ee9..cde016a19e 100644
--- a/plugins/TabSRMM/src/chat/window.cpp
+++ b/plugins/TabSRMM/src/chat/window.cpp
@@ -44,8 +44,8 @@ char szIndicators[] = { 0, '+', '%', '@', '!', '*' };
struct MESSAGESUBDATA
{
time_t lastEnterTime;
- TCHAR *szSearchQuery;
- TCHAR *szSearchResult;
+ wchar_t *szSearchQuery;
+ wchar_t *szSearchResult;
BOOL iSavedSpaces;
SESSION_INFO *lastSession;
};
@@ -130,18 +130,18 @@ static BOOL CheckCustomLink(HWND hwndDlg, POINT *ptClient, UINT uMsg, WPARAM wPa
return bIsCustomLink;
}
-bool IsStringValidLink(TCHAR *pszText)
+bool IsStringValidLink(wchar_t *pszText)
{
if (pszText == NULL)
return false;
- if (mir_tstrlen(pszText) < 5 || _tcschr(pszText, '"'))
+ if (mir_tstrlen(pszText) < 5 || wcschr(pszText, '"'))
return false;
- if (_totlower(pszText[0]) == 'w' && _totlower(pszText[1]) == 'w' && _totlower(pszText[2]) == 'w' && pszText[3] == '.' && _istalnum(pszText[4]))
+ if (towlower(pszText[0]) == 'w' && towlower(pszText[1]) == 'w' && towlower(pszText[2]) == 'w' && pszText[3] == '.' && iswalnum(pszText[4]))
return true;
- return _tcsstr(pszText, L"://") != NULL;
+ return wcsstr(pszText, L"://") != NULL;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -440,11 +440,11 @@ static bool TabAutoComplete(HWND hwnd, MESSAGESUBDATA *dat, SESSION_INFO *si)
return false;
bool isTopic = false, isRoom = false;
- TCHAR *pszName = NULL;
- TCHAR *pszText = (TCHAR*)mir_calloc((iLen + 10) * sizeof(TCHAR));
+ wchar_t *pszName = NULL;
+ wchar_t *pszText = (wchar_t*)mir_calloc((iLen + 10) * sizeof(wchar_t));
gt.flags = GT_DEFAULT;
- gt.cb = (iLen + 9) * sizeof(TCHAR);
+ gt.cb = (iLen + 9) * sizeof(wchar_t);
SendMessage(hwnd, EM_GETTEXTEX, (WPARAM)&gt, (LPARAM)pszText);
if (start > 1 && pszText[start - 1] == ' ' && pszText[start - 2] == ':')
@@ -452,7 +452,7 @@ static bool TabAutoComplete(HWND hwnd, MESSAGESUBDATA *dat, SESSION_INFO *si)
if (dat->szSearchResult != NULL) {
int cbResult = (int)mir_tstrlen(dat->szSearchResult);
- if (start >= cbResult && !_tcsncicmp(dat->szSearchResult, pszText + start - cbResult, cbResult)) {
+ if (start >= cbResult && !wcsnicmp(dat->szSearchResult, pszText + start - cbResult, cbResult)) {
start -= cbResult;
goto LBL_SkipEnd;
}
@@ -471,7 +471,7 @@ LBL_SkipEnd:
int topicStart = start;
while (topicStart > 0 && (pszText[topicStart - 1] == ' ' || pszText[topicStart - 1] == 13 || pszText[topicStart - 1] == VK_TAB))
topicStart--;
- if (topicStart > 5 && _tcsstr(&pszText[topicStart - 6], L"/topic") == &pszText[topicStart - 6])
+ if (topicStart > 5 && wcsstr(&pszText[topicStart - 6], L"/topic") == &pszText[topicStart - 6])
isTopic = TRUE;
}
if (dat->szSearchQuery == NULL) {
@@ -495,7 +495,7 @@ LBL_SkipEnd:
if (end != start) {
ptrT szReplace;
if (!isRoom && !isTopic && g_Settings.bAddColonToAutoComplete && start == 0) {
- szReplace = (TCHAR*)mir_alloc((mir_wstrlen(pszName) + 4) * sizeof(TCHAR));
+ szReplace = (wchar_t*)mir_alloc((mir_wstrlen(pszName) + 4) * sizeof(wchar_t));
mir_wstrcpy(szReplace, pszName);
mir_wstrcat(szReplace, g_Settings.bUseCommaAsColon ? L", " : L": ");
pszName = szReplace;
@@ -1308,14 +1308,14 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO *pa
ti.uId = 1;
ti.rect = clientRect;
- TCHAR tszBuf[1024]; tszBuf[0] = 0;
+ wchar_t tszBuf[1024]; tszBuf[0] = 0;
USERINFO *ui1 = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, currentHovered);
if (ui1) {
if (ProtoServiceExists(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT)) {
- TCHAR *p = (TCHAR*)CallProtoService(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)parentdat->ptszID, (LPARAM)ui1->pszUID);
+ wchar_t *p = (wchar_t*)CallProtoService(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)parentdat->ptszID, (LPARAM)ui1->pszUID);
if (p != NULL) {
- _tcsncpy_s(tszBuf, p, _TRUNCATE);
+ wcsncpy_s(tszBuf, p, _TRUNCATE);
mir_free(p);
}
}
@@ -1460,8 +1460,8 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
MessageBeep(MB_OK);
break;
}
- TCHAR szNew[2];
- szNew[0] = (TCHAR)wParam;
+ wchar_t szNew[2];
+ szNew[0] = (wchar_t)wParam;
szNew[1] = '\0';
mir_tstrcat(si->szSearch, szNew);
}
@@ -1472,7 +1472,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
for (i = 0; i < iItems; i++) {
USERINFO *ui = pci->UM_FindUserFromIndex(si->pUsers, i);
if (ui) {
- if (!_tcsnicmp(ui->pszNick, si->szSearch, mir_tstrlen(si->szSearch))) {
+ if (!wcsnicmp(ui->pszNick, si->szSearch, mir_tstrlen(si->szSearch))) {
SendMessage(hwnd, LB_SETSEL, FALSE, -1);
SendMessage(hwnd, LB_SETSEL, TRUE, i);
si->iSearchItem = i;
@@ -1662,11 +1662,11 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
USERINFO *ui1 = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, currentHovered);
if (ui1) {
- TCHAR tszBuf[1024]; tszBuf[0] = 0;
+ wchar_t tszBuf[1024]; tszBuf[0] = 0;
if (ProtoServiceExists(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT)) {
- TCHAR *p = (TCHAR*)CallProtoService(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)parentdat->ptszID, (LPARAM)ui1->pszUID);
+ wchar_t *p = (wchar_t*)CallProtoService(parentdat->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)parentdat->ptszID, (LPARAM)ui1->pszUID);
if (p) {
- _tcsncpy_s(tszBuf, p, _TRUNCATE);
+ wcsncpy_s(tszBuf, p, _TRUNCATE);
mir_free(p);
}
}
@@ -1691,7 +1691,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
// calculate the required rectangle for a string using the given font. This is more
// precise than using GetTextExtentPoint...()
-int GetTextPixelSize(TCHAR* pszText, HFONT hFont, bool bWidth)
+int GetTextPixelSize(wchar_t* pszText, HFONT hFont, bool bWidth)
{
if (!pszText || !hFont)
return 0;
@@ -1889,15 +1889,15 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
if (!dat->bWasDeleted) {
dat->wStatus = si->wStatus;
- const TCHAR *szNick = dat->cache->getNick();
+ const wchar_t *szNick = dat->cache->getNick();
if (mir_tstrlen(szNick) > 0) {
if (M.GetByte("cuttitle", 0))
CutContactName(szNick, dat->newtitle, _countof(dat->newtitle));
else
- _tcsncpy_s(dat->newtitle, szNick, _TRUNCATE);
+ wcsncpy_s(dat->newtitle, szNick, _TRUNCATE);
}
- TCHAR szTemp[100];
+ wchar_t szTemp[100];
HICON hIcon = 0;
switch (si->iType) {
@@ -1930,7 +1930,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
dat->hTabIcon = dat->hTabStatusIcon;
if (dat->cache->getStatus() != dat->cache->getOldStatus()) {
- _tcsncpy_s(dat->szStatus, pcli->pfnGetStatusModeDescription(dat->wStatus, 0), _TRUNCATE);
+ wcsncpy_s(dat->szStatus, pcli->pfnGetStatusModeDescription(dat->wStatus, 0), _TRUNCATE);
TCITEM item = { 0 };
item.mask = TCIF_TEXT;
@@ -1953,7 +1953,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
break;
if (si->pszModule != NULL) {
- TCHAR szFinalStatusBarText[512];
+ wchar_t szFinalStatusBarText[512];
//Mad: strange rare crash here...
MODULEINFO *mi = pci->MM_FindModule(si->pszModule);
@@ -1990,7 +1990,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
if (si->ptszStatusbarText)
mir_sntprintf(szFinalStatusBarText, L"%s %s", mi->ptszModDispName, si->ptszStatusbarText);
else
- _tcsncpy_s(szFinalStatusBarText, mi->ptszModDispName, _TRUNCATE);
+ wcsncpy_s(szFinalStatusBarText, mi->ptszModDispName, _TRUNCATE);
}
SendMessage(dat->pContainer->hwndStatus, SB_SETTEXT, 0, (LPARAM)szFinalStatusBarText);
UpdateStatusBar(dat);
@@ -2511,7 +2511,7 @@ LABEL_SHOWWINDOW:
ClientToScreen(((LPNMHDR)lParam)->hwndFrom, &pt);
// fixing stuff for searches
- TCHAR *pszWord = (TCHAR*)_alloca(8192);
+ wchar_t *pszWord = (wchar_t*)_alloca(8192);
pszWord[0] = '\0';
POINTL ptl = { pt.x, pt.y };
ScreenToClient(GetDlgItem(hwndDlg, IDC_CHAT_LOG), (LPPOINT)&ptl);
@@ -2531,7 +2531,7 @@ LABEL_SHOWWINDOW:
TEXTRANGE tr = { 0 };
tr.chrg = cr;
- tr.lpstrText = (TCHAR*)pszWord;
+ tr.lpstrText = (wchar_t*)pszWord;
int iRes = SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
if (iRes > 0) {
@@ -2617,7 +2617,7 @@ LABEL_SHOWWINDOW:
TEXTRANGE tr;
tr.lpstrText = NULL;
tr.chrg = ((ENLINK*)lParam)->chrg;
- tr.lpstrText = (TCHAR*)mir_alloc(sizeof(TCHAR) * (tr.chrg.cpMax - tr.chrg.cpMin + 2));
+ tr.lpstrText = (wchar_t*)mir_alloc(sizeof(wchar_t) * (tr.chrg.cpMax - tr.chrg.cpMin + 2));
SendMessage(((LPNMHDR)lParam)->hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
BOOL isLink = IsStringValidLink(tr.lpstrText);
@@ -2684,19 +2684,19 @@ LABEL_SHOWWINDOW:
CHARRANGE chr;
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_EXGETSEL, 0, (LPARAM)&chr);
- TCHAR tszAplTmpl[] = L"%s:";
+ wchar_t tszAplTmpl[] = L"%s:";
size_t bufSize = mir_tstrlen(tr.lpstrText) + mir_tstrlen(tszAplTmpl) + 3;
- TCHAR *tszTmp = (TCHAR*)mir_alloc(bufSize * sizeof(TCHAR)), *tszAppeal = tszTmp;
+ wchar_t *tszTmp = (wchar_t*)mir_alloc(bufSize * sizeof(wchar_t)), *tszAppeal = tszTmp;
TEXTRANGE tr2;
- tr2.lpstrText = (LPTSTR)mir_alloc(sizeof(TCHAR) * 2);
+ tr2.lpstrText = (LPTSTR)mir_alloc(sizeof(wchar_t) * 2);
if (chr.cpMin) {
// prepend nick with space if needed
tr2.chrg.cpMin = chr.cpMin - 1;
tr2.chrg.cpMax = chr.cpMin;
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETTEXTRANGE, 0, (LPARAM)&tr2);
- if (!_istspace(*tr2.lpstrText))
- *tszTmp++ = _T(' ');
+ if (!iswspace(*tr2.lpstrText))
+ *tszTmp++ = ' ';
mir_tstrcpy(tszTmp, tr.lpstrText);
}
else // in the beginning of the message window
@@ -2708,14 +2708,14 @@ LABEL_SHOWWINDOW:
tr2.chrg.cpMax = chr.cpMax + 1;
// if there is no space after selection,
// or there is nothing after selection at all...
- if (!SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETTEXTRANGE, 0, (LPARAM)&tr2) || !_istspace(*tr2.lpstrText)) {
- tszAppeal[st++] = _T(' ');
- tszAppeal[st++] = _T('\0');
+ if (!SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETTEXTRANGE, 0, (LPARAM)&tr2) || !iswspace(*tr2.lpstrText)) {
+ tszAppeal[st++] = ' ';
+ tszAppeal[st++] = '\0';
}
}
else {
- tszAppeal[st++] = _T(' ');
- tszAppeal[st++] = _T('\0');
+ tszAppeal[st++] = ' ';
+ tszAppeal[st++] = '\0';
}
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_REPLACESEL, FALSE, (LPARAM)tszAppeal);
mir_free((void*)tr2.lpstrText);
@@ -3202,11 +3202,11 @@ LABEL_SHOWWINDOW:
case DM_CONTAINERSELECTED:
{
- TCHAR *szNewName = (TCHAR*)lParam;
+ wchar_t *szNewName = (wchar_t*)lParam;
if (!mir_tstrcmp(szNewName, TranslateT("Default container")))
szNewName = CGlobals::m_default_container_name;
int iOldItems = TabCtrl_GetItemCount(hwndTab);
- if (!_tcsncmp(dat->pContainer->szName, szNewName, CONTAINER_NAMELEN))
+ if (!wcsncmp(dat->pContainer->szName, szNewName, CONTAINER_NAMELEN))
break;
TContainerData *pNewContainer = FindContainerByName(szNewName);
if (pNewContainer == NULL)
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp
index 9f7ccd8adc..b955bd2cb8 100644
--- a/plugins/TabSRMM/src/contactcache.cpp
+++ b/plugins/TabSRMM/src/contactcache.cpp
@@ -117,10 +117,10 @@ bool CContactCache::updateNick()
{
bool fChanged = false;
if (m_Valid) {
- TCHAR *tszNick = pcli->pfnGetContactDisplayName(getActiveContact(), 0);
+ wchar_t *tszNick = pcli->pfnGetContactDisplayName(getActiveContact(), 0);
if (tszNick && mir_tstrcmp(m_szNick, tszNick))
fChanged = true;
- _tcsncpy_s(m_szNick, (tszNick ? tszNick : L"<undef>"), _TRUNCATE);
+ wcsncpy_s(m_szNick, (tszNick ? tszNick : L"<undef>"), _TRUNCATE);
}
return fChanged;
}
@@ -180,7 +180,7 @@ bool CContactCache::updateUIN()
if (m_Valid) {
ptrT uid(Contact_GetInfo(CNF_DISPLAYUID, getActiveContact(), getActiveProto()));
if (uid != NULL)
- _tcsncpy_s(m_szUIN, uid, _TRUNCATE);
+ wcsncpy_s(m_szUIN, uid, _TRUNCATE);
}
return false;
@@ -287,12 +287,12 @@ void CContactCache::saveHistory(WPARAM wParam, LPARAM)
if (m_history[m_iHistoryTop].szText == NULL) {
if (iLength < HISTORY_INITIAL_ALLOCSIZE)
iLength = HISTORY_INITIAL_ALLOCSIZE;
- m_history[m_iHistoryTop].szText = (TCHAR*)mir_alloc(iLength);
+ m_history[m_iHistoryTop].szText = (wchar_t*)mir_alloc(iLength);
m_history[m_iHistoryTop].lLen = iLength;
}
else {
if (iLength > m_history[m_iHistoryTop].lLen) {
- m_history[m_iHistoryTop].szText = (TCHAR*)mir_realloc(m_history[m_iHistoryTop].szText, iLength);
+ m_history[m_iHistoryTop].szText = (wchar_t*)mir_realloc(m_history[m_iHistoryTop].szText, iLength);
m_history[m_iHistoryTop].lLen = iLength;
}
}
@@ -329,7 +329,7 @@ void CContactCache::inputHistoryEvent(WPARAM wParam)
if (::GetWindowTextLength(hwndEdit) > 0)
saveHistory(m_iHistorySize, 0);
else
- m_history[m_iHistorySize].szText[0] = (TCHAR)'\0';
+ m_history[m_iHistorySize].szText[0] = (wchar_t)'\0';
}
if (wParam == VK_UP) {
if (m_iHistoryCurrent == 0)
@@ -379,7 +379,7 @@ void CContactCache::allocHistory()
m_iHistoryTop = 0;
if (m_history)
memset(m_history, 0, (sizeof(TInputHistory) * m_iHistorySize));
- m_history[m_iHistorySize].szText = (TCHAR*)mir_alloc((HISTORY_INITIAL_ALLOCSIZE + 1) * sizeof(TCHAR));
+ m_history[m_iHistorySize].szText = (wchar_t*)mir_alloc((HISTORY_INITIAL_ALLOCSIZE + 1) * sizeof(wchar_t));
m_history[m_iHistorySize].lLen = HISTORY_INITIAL_ALLOCSIZE;
}
@@ -517,11 +517,11 @@ int CContactCache::cacheUpdateMetaChanged(WPARAM bMetaEnabled, LPARAM)
/**
* normalize the status message with proper cr/lf sequences.
- * @param src TCHAR*: original status message
+ * @param src wchar_t*: original status message
* @param fStripAll bool: strip all cr/lf sequences and replace them with spaces (use for title bar)
- * @return TCHAR*: converted status message. CALLER is responsible to mir_free it, MUST use mir_free()
+ * @return wchar_t*: converted status message. CALLER is responsible to mir_free it, MUST use mir_free()
*/
-TCHAR* CContactCache::getNormalizedStatusMsg(const TCHAR *src, bool fStripAll)
+wchar_t* CContactCache::getNormalizedStatusMsg(const wchar_t *src, bool fStripAll)
{
if (src == 0 || mir_tstrlen(src) < 2)
return 0;
@@ -531,7 +531,7 @@ TCHAR* CContactCache::getNormalizedStatusMsg(const TCHAR *src, bool fStripAll)
for (int i = 0; src[i] != 0; i++) {
if (src[i] == 0x0d || src[i] == '\t')
continue;
- if (i && src[i] == (TCHAR)0x0a) {
+ if (i && src[i] == (wchar_t)0x0a) {
if (fStripAll) {
dest.AppendChar(' ');
continue;
diff --git a/plugins/TabSRMM/src/contactcache.h b/plugins/TabSRMM/src/contactcache.h
index 4be30f678b..a6e6fa191b 100644
--- a/plugins/TabSRMM/src/contactcache.h
+++ b/plugins/TabSRMM/src/contactcache.h
@@ -33,7 +33,7 @@
#define HISTORY_INITIAL_ALLOCSIZE 300
struct TInputHistory {
- TCHAR* szText;
+ wchar_t* szText;
size_t lLen;
};
@@ -68,7 +68,7 @@ struct CContactCache : public MZeroedObject
const WORD getStatus() const { return m_wStatus; }
const WORD getActiveStatus() const { return m_isMeta ? m_wMetaStatus : m_wStatus; }
const WORD getOldStatus() const { return m_wOldStatus; }
- const TCHAR* getNick() const { return m_szNick; }
+ const wchar_t* getNick() const { return m_szNick; }
const MCONTACT getContact() const { return m_hContact; }
const MCONTACT getActiveContact() const { return (m_isMeta) ? m_hSub : m_hContact; }
const DWORD getIdleTS() const { return m_idleTS; }
@@ -78,11 +78,11 @@ struct CContactCache : public MZeroedObject
bool isSubContact() const { return cc->IsSub(); }
bool isFavorite() const { return m_isFavorite; }
bool isRecent() const { return m_isRecent; }
- const TCHAR* getRealAccount() const { return m_szAccount ? m_szAccount : C_INVALID_ACCOUNT; }
- const TCHAR* getUIN() const { return m_szUIN; }
- const TCHAR* getStatusMsg() const { return m_szStatusMsg; }
- const TCHAR* getXStatusMsg() const { return m_xStatusMsg; }
- const TCHAR* getListeningInfo() const { return m_ListeningInfo; }
+ const wchar_t* getRealAccount() const { return m_szAccount ? m_szAccount : C_INVALID_ACCOUNT; }
+ const wchar_t* getUIN() const { return m_szUIN; }
+ const wchar_t* getStatusMsg() const { return m_szStatusMsg; }
+ const wchar_t* getXStatusMsg() const { return m_xStatusMsg; }
+ const wchar_t* getListeningInfo() const { return m_ListeningInfo; }
BYTE getXStatusId() const { return m_xStatus; }
const HWND getWindowData(TWindowData*& dat) const { dat = m_dat; return m_hwnd; }
const HWND getHwnd() const { return m_hwnd; }
@@ -107,7 +107,7 @@ struct CContactCache : public MZeroedObject
void closeWindow();
void deletedHandler();
void updateFavorite();
- TCHAR* getNormalizedStatusMsg(const TCHAR *src, bool fStripAll = false);
+ wchar_t* getNormalizedStatusMsg(const wchar_t *src, bool fStripAll = false);
HICON getIcon(int& iSize) const;
/*
@@ -128,9 +128,9 @@ private:
MCONTACT m_hContact, m_hSub;
WORD m_wStatus, m_wOldStatus, m_wMetaStatus;
char *m_szMetaProto;
- TCHAR *m_szAccount;
- TCHAR m_szNick[80], m_szUIN[80];
- TCHAR *m_szStatusMsg, *m_xStatusMsg, *m_ListeningInfo;
+ wchar_t *m_szAccount;
+ wchar_t m_szNick[80], m_szUIN[80];
+ wchar_t *m_szStatusMsg, *m_xStatusMsg, *m_ListeningInfo;
BYTE m_xStatus;
DWORD m_idleTS;
bool m_isMeta;
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp
index 57edcf6d1f..02851f893c 100644
--- a/plugins/TabSRMM/src/container.cpp
+++ b/plugins/TabSRMM/src/container.cpp
@@ -151,7 +151,7 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam,
CSkin::DrawItem(dcMem, &rcWindow, &SkinItems[pContainer->ncActive ? ID_EXTBKFRAME : ID_EXTBKFRAMEINACTIVE]);
- TCHAR szWindowText[512];
+ wchar_t szWindowText[512];
GetWindowText(hwndDlg, szWindowText, _countof(szWindowText));
szWindowText[511] = 0;
@@ -1006,7 +1006,7 @@ panel_found:
dat = NULL;
if (lParam) { // lParam != 0 means sent by a chat window
- TCHAR szText[512];
+ wchar_t szText[512];
dat = (TWindowData*)GetWindowLongPtr((HWND)wParam, GWLP_USERDATA);
GetWindowText((HWND)wParam, szText, _countof(szText));
szText[_countof(szText) - 1] = 0;
@@ -1305,9 +1305,9 @@ panel_found:
case DM_OPTIONSAPPLIED:
char szCname[40];
- TCHAR szTitleFormat[200];
+ wchar_t szTitleFormat[200];
{
- TCHAR *szThemeName = NULL;
+ wchar_t *szThemeName = NULL;
DBVARIANT dbv = { 0 };
szTitleFormat[0] = 0;
@@ -1332,7 +1332,7 @@ panel_found:
if (szThemeName != NULL) {
PathToAbsoluteT(szThemeName, pContainer->szAbsThemeFile, M.getDataPath());
- _tcsncpy_s(pContainer->szRelThemeFile, szThemeName, _TRUNCATE);
+ wcsncpy_s(pContainer->szRelThemeFile, szThemeName, _TRUNCATE);
db_free(&dbv);
}
else pContainer->szAbsThemeFile[0] = pContainer->szRelThemeFile[0] = 0;
@@ -1748,7 +1748,7 @@ panel_found:
// The WM_DESTROY handler of the container DlgProc is responsible for mir_free()'ing the
// pointer and for removing the struct from the linked list.
-TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, MCONTACT hContactFrom)
+TContainerData* TSAPI CreateContainer(const wchar_t *name, int iTemp, MCONTACT hContactFrom)
{
if (CMimAPI::m_shutDown)
return NULL;
@@ -1756,7 +1756,7 @@ TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, MCONTACT hCo
TContainerData *pContainer = (TContainerData*)mir_calloc(sizeof(TContainerData));
if (pContainer == NULL)
return NULL;
- _tcsncpy(pContainer->szName, name, CONTAINER_NAMELEN + 1);
+ wcsncpy(pContainer->szName, name, CONTAINER_NAMELEN + 1);
AppendToContainerList(pContainer);
if (M.GetByte("limittabs", 0) && !mir_tstrcmp(name, L"default"))
@@ -1781,11 +1781,11 @@ TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, MCONTACT hCo
break;
}
- if (!_tcsncmp(tszName, name, CONTAINER_NAMELEN)) {
+ if (!wcsncmp(tszName, name, CONTAINER_NAMELEN)) {
pContainer->iContainerIndex = i;
iFound = TRUE;
}
- else if (!_tcsncmp(tszName, L"**mir_free**", CONTAINER_NAMELEN))
+ else if (!wcsncmp(tszName, L"**mir_free**", CONTAINER_NAMELEN))
iFirstFree = i;
} while (++i && iFound == FALSE);
}
@@ -1874,12 +1874,12 @@ void TSAPI CloseOtherTabs(HWND hwndTab, TWindowData &dat)
//
// size = max length of target string
-int TSAPI CutContactName(const TCHAR *oldname, TCHAR *newname, size_t size)
+int TSAPI CutContactName(const wchar_t *oldname, wchar_t *newname, size_t size)
{
if (mir_tstrlen(oldname) <= PluginConfig.m_iTabNameLimit)
- _tcsncpy_s(newname, size, oldname, _TRUNCATE);
+ wcsncpy_s(newname, size, oldname, _TRUNCATE);
else {
- TCHAR fmt[30];
+ wchar_t fmt[30];
mir_sntprintf(fmt, L"%%%d.%ds...", PluginConfig.m_iTabNameLimit, PluginConfig.m_iTabNameLimit);
mir_sntprintf(newname, size, fmt, oldname);
}
@@ -1904,7 +1904,7 @@ static TContainerData* TSAPI AppendToContainerList(TContainerData *pContainer)
return p;
}
-TContainerData* TSAPI FindContainerByName(const TCHAR *name)
+TContainerData* TSAPI FindContainerByName(const wchar_t *name)
{
if (name == NULL || mir_tstrlen(name) == 0)
return 0;
@@ -1913,7 +1913,7 @@ TContainerData* TSAPI FindContainerByName(const TCHAR *name)
return NULL;
for (TContainerData *p = pFirstContainer; p; p = p->pNext)
- if (!_tcsncmp(p->szName, name, CONTAINER_NAMELEN))
+ if (!wcsncmp(p->szName, name, CONTAINER_NAMELEN))
return p;
// error, didn't find it.
@@ -2006,11 +2006,11 @@ void TSAPI AdjustTabClientRect(TContainerData *pContainer, RECT *rc)
// retrieve the container name for the given contact handle.
// if none is assigned, return the name of the default container
-int TSAPI GetContainerNameForContact(MCONTACT hContact, TCHAR *szName, int iNameLen)
+int TSAPI GetContainerNameForContact(MCONTACT hContact, wchar_t *szName, int iNameLen)
{
// single window mode using cloned (temporary) containers
if (M.GetByte("singlewinmode", 0)) {
- _tcsncpy_s(szName, iNameLen, L"Message Session", _TRUNCATE);
+ wcsncpy_s(szName, iNameLen, L"Message Session", _TRUNCATE);
return 0;
}
@@ -2018,21 +2018,21 @@ int TSAPI GetContainerNameForContact(MCONTACT hContact, TCHAR *szName, int iName
if (M.GetByte("useclistgroups", 0)) {
ptrT tszGroup(db_get_tsa(hContact, "CList", "Group"));
if (tszGroup == NULL) {
- _tcsncpy_s(szName, iNameLen, L"default", _TRUNCATE);
+ wcsncpy_s(szName, iNameLen, L"default", _TRUNCATE);
return 0;
}
- _tcsncpy_s(szName, iNameLen, tszGroup, _TRUNCATE);
+ wcsncpy_s(szName, iNameLen, tszGroup, _TRUNCATE);
return 1;
}
ptrT tszContainerName(db_get_tsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
if (tszContainerName == NULL) {
- _tcsncpy_s(szName, iNameLen, L"default", _TRUNCATE);
+ wcsncpy_s(szName, iNameLen, L"default", _TRUNCATE);
return 0;
}
- _tcsncpy_s(szName, iNameLen, tszContainerName, _TRUNCATE);
+ wcsncpy_s(szName, iNameLen, tszContainerName, _TRUNCATE);
return 1;
}
@@ -2067,7 +2067,7 @@ void TSAPI DeleteContainer(int iIndex)
db_unset(NULL, SRMSGMOD_T, szSetting);
}
-void TSAPI RenameContainer(int iIndex, const TCHAR *szNew)
+void TSAPI RenameContainer(int iIndex, const wchar_t *szNew)
{
if (mir_tstrlen(szNew) == 0)
return;
@@ -2109,7 +2109,7 @@ HMENU TSAPI BuildContainerMenu()
if (tszName == NULL)
break;
- if (_tcsncmp(tszName, L"**mir_free**", CONTAINER_NAMELEN))
+ if (wcsncmp(tszName, L"**mir_free**", CONTAINER_NAMELEN))
AppendMenu(hMenu, MF_STRING, IDM_CONTAINERMENU + i, !mir_tstrcmp(tszName, L"default") ? TranslateT("Default container") : tszName);
i++;
}
diff --git a/plugins/TabSRMM/src/containeroptions.cpp b/plugins/TabSRMM/src/containeroptions.cpp
index edc4d321be..33f27f8b7c 100644
--- a/plugins/TabSRMM/src/containeroptions.cpp
+++ b/plugins/TabSRMM/src/containeroptions.cpp
@@ -101,19 +101,19 @@ void TSAPI ApplyContainerSetting(TContainerData *pContainer, DWORD flags, UINT m
static struct _tagPages
{
- const TCHAR *szTitle, *szDesc;
+ const wchar_t *szTitle, *szDesc;
UINT uIds[10];
} o_pages[] = {
- { LPGENT("General options"), NULL, IDC_O_NOTABS, IDC_O_STICKY, IDC_VERTICALMAX, IDC_AUTOSPLITTER, IDC_O_AUTOHIDE, IDC_AUTOCLOSETABTIME, IDC_AUTOCLOSETABSPIN, IDC_O_AUTOHIDESECONDS, 0, 0 },
- { LPGENT("Window layout"), NULL, IDC_CNTNOSTATUSBAR, IDC_HIDEMENUBAR, IDC_UIDSTATUSBAR, IDC_HIDETOOLBAR, IDC_INFOPANEL, IDC_BOTTOMTOOLBAR, 0, 0, 0, 0 },
- { LPGENT("Tabs and switch bar"), LPGENT("Choose your options for the tabbed user interface. Not all options can be applied to open windows. You may need to close and re-open them."), IDC_TABMODE, IDC_O_TABMODE, IDC_O_SBARLAYOUT, IDC_SBARLAYOUT, IDC_FLASHICON, IDC_FLASHLABEL, IDC_SINGLEROWTAB, IDC_BUTTONTABS, IDC_CLOSEBUTTONONTABS, 0 },
- { LPGENT("Notifications"), LPGENT("Select, when you want to see event notifications (popups) for this window. The settings apply to all tabs within this window."), IDC_O_DONTREPORT, IDC_DONTREPORTUNFOCUSED2, IDC_DONTREPORTFOCUSED2, IDC_ALWAYSPOPUPSINACTIVE, IDC_O_EXPLAINGLOBALNOTIFY, 0, 0, 0, 0, 0 },
- { LPGENT("Flashing"), NULL, IDC_O_FLASHDEFAULT, IDC_O_FLASHALWAYS, IDC_O_FLASHNEVER, 0, 0, 0, 0, 0, 0, 0 },
- { LPGENT("Title bar"), NULL, IDC_O_HIDETITLE, IDC_TITLEFORMAT, IDC_O_TITLEBARFORMAT, IDC_O_HELP_TITLEFORMAT, 0, 0, 0, 0, 0, 0 },
- { LPGENT("Window size and theme"), LPGENT("You can select a private theme (.tabsrmm file) for this container which will then override the default message log theme. You will have to close and re-open all message windows after changing this option."), IDC_THEME, IDC_SELECTTHEME, IDC_USEGLOBALSIZE, IDC_SAVESIZEASGLOBAL, IDC_LABEL_PRIVATETHEME, IDC_TSLABEL_EXPLAINTHEME, 0, 0, 0, 0 },
- { LPGENT("Transparency"), LPGENT("This feature may be unavailable when using a container skin."), IDC_TRANSPARENCY, IDC_TRANSPARENCY_ACTIVE, IDC_TRANSPARENCY_INACTIVE, IDC_TSLABEL_ACTIVE, IDC_TSLABEL_INACTIVE, 0, 0, 0, 0, 0 },
- { LPGENT("Contact avatars"), NULL, IDC_O_STATIC_AVATAR, IDC_O_STATIC_OWNAVATAR, IDC_AVATARMODE, IDC_OWNAVATARMODE, IDC_AVATARSONTASKBAR, 0, 0, 0, 0, 0 },
- { LPGENT("Sound notifications"), NULL, IDC_O_ENABLESOUNDS, IDC_O_SOUNDSMINIMIZED, IDC_O_SOUNDSUNFOCUSED, IDC_O_SOUNDSINACTIVE, IDC_O_SOUNDSFOCUSED, 0, 0, 0, 0, 0 },
+ { LPGENW("General options"), NULL, IDC_O_NOTABS, IDC_O_STICKY, IDC_VERTICALMAX, IDC_AUTOSPLITTER, IDC_O_AUTOHIDE, IDC_AUTOCLOSETABTIME, IDC_AUTOCLOSETABSPIN, IDC_O_AUTOHIDESECONDS, 0, 0 },
+ { LPGENW("Window layout"), NULL, IDC_CNTNOSTATUSBAR, IDC_HIDEMENUBAR, IDC_UIDSTATUSBAR, IDC_HIDETOOLBAR, IDC_INFOPANEL, IDC_BOTTOMTOOLBAR, 0, 0, 0, 0 },
+ { LPGENW("Tabs and switch bar"), LPGENW("Choose your options for the tabbed user interface. Not all options can be applied to open windows. You may need to close and re-open them."), IDC_TABMODE, IDC_O_TABMODE, IDC_O_SBARLAYOUT, IDC_SBARLAYOUT, IDC_FLASHICON, IDC_FLASHLABEL, IDC_SINGLEROWTAB, IDC_BUTTONTABS, IDC_CLOSEBUTTONONTABS, 0 },
+ { LPGENW("Notifications"), LPGENW("Select, when you want to see event notifications (popups) for this window. The settings apply to all tabs within this window."), IDC_O_DONTREPORT, IDC_DONTREPORTUNFOCUSED2, IDC_DONTREPORTFOCUSED2, IDC_ALWAYSPOPUPSINACTIVE, IDC_O_EXPLAINGLOBALNOTIFY, 0, 0, 0, 0, 0 },
+ { LPGENW("Flashing"), NULL, IDC_O_FLASHDEFAULT, IDC_O_FLASHALWAYS, IDC_O_FLASHNEVER, 0, 0, 0, 0, 0, 0, 0 },
+ { LPGENW("Title bar"), NULL, IDC_O_HIDETITLE, IDC_TITLEFORMAT, IDC_O_TITLEBARFORMAT, IDC_O_HELP_TITLEFORMAT, 0, 0, 0, 0, 0, 0 },
+ { LPGENW("Window size and theme"), LPGENW("You can select a private theme (.tabsrmm file) for this container which will then override the default message log theme. You will have to close and re-open all message windows after changing this option."), IDC_THEME, IDC_SELECTTHEME, IDC_USEGLOBALSIZE, IDC_SAVESIZEASGLOBAL, IDC_LABEL_PRIVATETHEME, IDC_TSLABEL_EXPLAINTHEME, 0, 0, 0, 0 },
+ { LPGENW("Transparency"), LPGENW("This feature may be unavailable when using a container skin."), IDC_TRANSPARENCY, IDC_TRANSPARENCY_ACTIVE, IDC_TRANSPARENCY_INACTIVE, IDC_TSLABEL_ACTIVE, IDC_TSLABEL_INACTIVE, 0, 0, 0, 0, 0 },
+ { LPGENW("Contact avatars"), NULL, IDC_O_STATIC_AVATAR, IDC_O_STATIC_OWNAVATAR, IDC_AVATARMODE, IDC_OWNAVATARMODE, IDC_AVATARSONTASKBAR, 0, 0, 0, 0, 0 },
+ { LPGENW("Sound notifications"), NULL, IDC_O_ENABLESOUNDS, IDC_O_SOUNDSMINIMIZED, IDC_O_SOUNDSUNFOCUSED, IDC_O_SOUNDSINACTIVE, IDC_O_SOUNDSFOCUSED, 0, 0, 0, 0, 0 },
};
static void ShowPage(HWND hwndDlg, int iPage, BOOL fShow)
@@ -152,7 +152,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
pContainer = (TContainerData*)lParam;
pContainer->hWndOptions = hwndDlg;
SetWindowText(hwndDlg, TranslateT("Container options"));
- TCHAR szNewTitle[128];
+ wchar_t szNewTitle[128];
mir_sntprintf(szNewTitle, L"%s", !mir_tstrcmp(pContainer->szName, L"default") ?
TranslateT("Default container") : pContainer->szName);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, szNewTitle);
@@ -342,7 +342,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
pContainer->fPrivateThemeChanged = TRUE;
if (PathFileExists(szFinalThemeFile))
- _tcsncpy_s(pContainer->szRelThemeFile, szFilename, _TRUNCATE);
+ wcsncpy_s(pContainer->szRelThemeFile, szFilename, _TRUNCATE);
else
pContainer->szRelThemeFile[0] = 0;
}
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp
index 3fdb69954f..a60bf718a8 100644
--- a/plugins/TabSRMM/src/controls.cpp
+++ b/plugins/TabSRMM/src/controls.cpp
@@ -270,12 +270,12 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm)
return CDRF_NOTIFYITEMDRAW | CDRF_NOTIFYPOSTPAINT | CDRF_NOTIFYPOSTERASE;
case CDDS_ITEMPREPAINT:
- TCHAR *szText;
+ wchar_t *szText;
bool fDraw;
{
int iIndex = idToIndex(nmtb->nmcd.dwItemSpec);
if (iIndex >= 0 && iIndex < NR_BUTTONS)
- szText = (TCHAR*)m_TbButtons[iIndex].iString;
+ szText = (wchar_t*)m_TbButtons[iIndex].iString;
else
szText = NULL;
@@ -834,7 +834,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
int height = itemRect.bottom - itemRect.top;
HICON hIcon = (HICON)SendMessage(hWnd, SB_GETICON, i, 0);
- TCHAR szText[1024]; szText[0] = 0;
+ wchar_t szText[1024]; szText[0] = 0;
LRESULT result = SendMessage(hWnd, SB_GETTEXT, i, (LPARAM)szText);
if (i == 2 && pContainer) {
TWindowData *pDat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
@@ -952,7 +952,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
if (dat != NULL) {
RECT rc;
SIZE size;
- TCHAR wBuf[512]; wBuf[0] = 0;
+ wchar_t wBuf[512]; wBuf[0] = 0;
CLCINFOTIP ti = { 0 };
ti.cbSize = sizeof(ti);
ti.ptCursor = pt;
@@ -975,10 +975,10 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
mtnStatus ? TranslateT("enabled") : TranslateT("disabled"));
}
else if (sid->dwId == MSG_ICON_SESSION)
- _tcsncpy_s(wBuf, TranslateT("Session list.\nClick left for a list of open sessions.\nClick right to access favorites and quickly configure message window behavior"), _TRUNCATE);
+ wcsncpy_s(wBuf, TranslateT("Session list.\nClick left for a list of open sessions.\nClick right to access favorites and quickly configure message window behavior"), _TRUNCATE);
}
else if (sid->tszTooltip)
- _tcsncpy(wBuf, sid->tszTooltip, _countof(wBuf));
+ wcsncpy(wBuf, sid->tszTooltip, _countof(wBuf));
if (wBuf[0]) {
CallService("mToolTip/ShowTipW", (WPARAM)wBuf, (LPARAM)&ti);
@@ -995,7 +995,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
iLength = SendDlgItemMessage(dat->hwnd, dat->bType == SESSIONTYPE_IM ? IDC_MESSAGE : IDC_CHAT_MESSAGE, EM_GETTEXTLENGTHEX, (WPARAM)&gtxl, 0);
tooltip_active = TRUE;
- const TCHAR *szFormat = TranslateT("There are %d pending send jobs. Message length: %d bytes, message length limit: %d bytes\n\n%d messages are queued for later delivery");
+ const wchar_t *szFormat = TranslateT("There are %d pending send jobs. Message length: %d bytes, message length limit: %d bytes\n\n%d messages are queued for later delivery");
mir_sntprintf(wBuf, szFormat, dat->iOpenJobs, iLength, dat->nMax ? dat->nMax : 20000, iQueued);
CallService("mToolTip/ShowTipW", (WPARAM)wBuf, (LPARAM)&ti);
diff --git a/plugins/TabSRMM/src/controls.h b/plugins/TabSRMM/src/controls.h
index cefcf8276b..bda3bc61ac 100644
--- a/plugins/TabSRMM/src/controls.h
+++ b/plugins/TabSRMM/src/controls.h
@@ -66,7 +66,7 @@ public:
void setAero(bool fState) { m_isAero = fState; }
const bool getAero(void) const { return(m_isAero); }
- const LRESULT processAccelerator(TCHAR a, UINT& ctlId) const
+ const LRESULT processAccelerator(wchar_t a, UINT& ctlId) const
{
UINT _ctlId;
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp
index 629c9a6d11..0680d86d3a 100644
--- a/plugins/TabSRMM/src/eventpopups.cpp
+++ b/plugins/TabSRMM/src/eventpopups.cpp
@@ -414,14 +414,14 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
* @return
*/
-static TCHAR* ShortenPreview(DBEVENTINFO* dbe)
+static wchar_t* ShortenPreview(DBEVENTINFO* dbe)
{
bool fAddEllipsis = false;
size_t iPreviewLimit = nen_options.iLimitPreview;
if (iPreviewLimit > 500 || iPreviewLimit == 0)
iPreviewLimit = 500;
- TCHAR *buf = DbGetEventTextT(dbe, CP_ACP);
+ wchar_t *buf = DbGetEventTextT(dbe, CP_ACP);
if (mir_tstrlen(buf) > iPreviewLimit) {
fAddEllipsis = true;
size_t iIndex = iPreviewLimit;
@@ -432,13 +432,13 @@ static TCHAR* ShortenPreview(DBEVENTINFO* dbe)
buf[iIndex] = 0;
}
if (fAddEllipsis) {
- buf = (TCHAR*)mir_realloc(buf, (mir_tstrlen(buf) + 5) * sizeof(TCHAR));
+ buf = (wchar_t*)mir_realloc(buf, (mir_tstrlen(buf) + 5) * sizeof(wchar_t));
mir_tstrcat(buf, L"...");
}
return buf;
}
-static TCHAR* GetPreviewT(WORD eventType, DBEVENTINFO* dbe)
+static wchar_t* GetPreviewT(WORD eventType, DBEVENTINFO* dbe)
{
char *pBlob = (char *)dbe->pBlob;
@@ -463,7 +463,7 @@ static TCHAR* GetPreviewT(WORD eventType, DBEVENTINFO* dbe)
szDescr = szFileName + namelength + 1;
ptrT tszFileName(DbGetEventStringT(dbe, szFileName));
- TCHAR buf[1024];
+ wchar_t buf[1024];
if (szDescr && Utils::safe_strlen(szDescr, dbe->cbBlob - sizeof(DWORD) - namelength - 1) > 0) {
ptrT tszDescr(DbGetEventStringT(dbe, szDescr));
@@ -498,7 +498,7 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent)
if (hEvent == NULL)
return 0;
- TCHAR szHeader[256];
+ wchar_t szHeader[256];
if (pdata->pluginOptions->bShowHeaders)
mir_sntprintf(szHeader, L"%s %d\n", TranslateT("New messages: "), pdata->nrMerged + 1);
else
@@ -511,11 +511,11 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent)
}
db_event_get(hEvent, &dbe);
- TCHAR timestamp[MAX_DATASIZE];
- _tcsftime(timestamp, MAX_DATASIZE, L"%Y.%m.%d %H:%M", _localtime32((__time32_t *)&dbe.timestamp));
+ wchar_t timestamp[MAX_DATASIZE];
+ wcsftime(timestamp, MAX_DATASIZE, L"%Y.%m.%d %H:%M", _localtime32((__time32_t *)&dbe.timestamp));
mir_sntprintf(pdata->eventData[pdata->nrMerged].tszText, L"\n\n%s\n", timestamp);
- TCHAR *szPreview = GetPreviewT(dbe.eventType, &dbe);
+ wchar_t *szPreview = GetPreviewT(dbe.eventType, &dbe);
if (szPreview) {
mir_tstrncat(pdata->eventData[pdata->nrMerged].tszText, szPreview, _countof(pdata->eventData[pdata->nrMerged].tszText) - mir_tstrlen(pdata->eventData[pdata->nrMerged].tszText));
mir_free(szPreview);
@@ -529,10 +529,10 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent)
* for which there is enough space in the popup text
*/
- TCHAR lpzText[MAX_SECONDLINE];
+ wchar_t lpzText[MAX_SECONDLINE];
int i, available = MAX_SECONDLINE - 1;
if (pdata->pluginOptions->bShowHeaders) {
- _tcsncpy(lpzText, szHeader, MAX_SECONDLINE);
+ wcsncpy(lpzText, szHeader, MAX_SECONDLINE);
available -= (int)mir_tstrlen(szHeader);
}
else lpzText[0] = 0;
@@ -613,21 +613,21 @@ static int PopupShowT(NEN_OPTIONS *pluginOptions, MCONTACT hContact, MEVENT hEve
pud.PluginData = pdata;
if (hContact)
- _tcsncpy_s(pud.lptzContactName, pcli->pfnGetContactDisplayName(hContact, 0), _TRUNCATE);
+ wcsncpy_s(pud.lptzContactName, pcli->pfnGetContactDisplayName(hContact, 0), _TRUNCATE);
else
- _tcsncpy_s(pud.lptzContactName, _A2T(dbe.szModule), _TRUNCATE);
+ wcsncpy_s(pud.lptzContactName, _A2T(dbe.szModule), _TRUNCATE);
- TCHAR *szPreview = GetPreviewT((WORD)eventType, &dbe);
+ wchar_t *szPreview = GetPreviewT((WORD)eventType, &dbe);
if (szPreview) {
- _tcsncpy_s(pud.lptzText, szPreview, _TRUNCATE);
+ wcsncpy_s(pud.lptzText, szPreview, _TRUNCATE);
mir_free(szPreview);
}
- else _tcsncpy(pud.lptzText, L" ", MAX_SECONDLINE);
+ else wcsncpy(pud.lptzText, L" ", MAX_SECONDLINE);
pdata->eventData = (EVENT_DATAT *)mir_alloc(NR_MERGED * sizeof(EVENT_DATAT));
pdata->eventData[0].hEvent = hEvent;
pdata->eventData[0].timestamp = dbe.timestamp;
- _tcsncpy(pdata->eventData[0].tszText, pud.lptzText, MAX_SECONDLINE);
+ wcsncpy(pdata->eventData[0].tszText, pud.lptzText, MAX_SECONDLINE);
pdata->eventData[0].tszText[MAX_SECONDLINE - 1] = 0;
pdata->nrEventsAlloced = NR_MERGED;
pdata->nrMerged = 1;
@@ -662,14 +662,14 @@ void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced)
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_DATA | MIIM_BITMAP;
- const TCHAR *tszProto = dat->cache->getRealAccount();
+ const wchar_t *tszProto = dat->cache->getRealAccount();
assert(tszProto != 0);
GetMenuItemInfo(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)dat->hContact, FALSE, &mii);
if (!bForced)
PluginConfig.m_UnreadInTray -= (mii.dwItemData & 0x0000ffff);
if (mii.dwItemData > 0 || bForced) {
- TCHAR szMenuEntry[80];
+ wchar_t szMenuEntry[80];
mir_sntprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszProto,
dat->cache->getNick(), dat->szStatus[0] ? dat->szStatus : L"(undef)", mii.dwItemData & 0x0000ffff);
@@ -684,18 +684,18 @@ void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced)
}
// if we want tray support, add the contact to the list of unread sessions in the tray menu
-int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szProto, const TCHAR *szStatus, MCONTACT hContact, DWORD fromEvent)
+int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szProto, const wchar_t *szStatus, MCONTACT hContact, DWORD fromEvent)
{
if (!PluginConfig.g_hMenuTrayUnread || hContact == 0 || szProto == NULL)
return 0;
PROTOACCOUNT *acc = Proto_GetAccount(szProto);
- TCHAR *tszFinalProto = (acc && acc->tszAccountName ? acc->tszAccountName : 0);
+ wchar_t *tszFinalProto = (acc && acc->tszAccountName ? acc->tszAccountName : 0);
if (tszFinalProto == 0)
return 0;
WORD wMyStatus = (wStatus == 0) ? db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE) : wStatus;
- const TCHAR *szMyStatus = (szStatus == NULL) ? pcli->pfnGetStatusModeDescription(wMyStatus, 0) : szStatus;
+ const wchar_t *szMyStatus = (szStatus == NULL) ? pcli->pfnGetStatusModeDescription(wMyStatus, 0) : szStatus;
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -703,8 +703,8 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro
mii.wID = (UINT)hContact;
mii.hbmpItem = HBMMENU_CALLBACK;
- TCHAR szMenuEntry[80];
- const TCHAR *szNick = NULL;
+ wchar_t szMenuEntry[80];
+ const wchar_t *szNick = NULL;
if (dat != 0) {
szNick = dat->cache->getNick();
GetMenuItemInfo(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)hContact, FALSE, &mii);
diff --git a/plugins/TabSRMM/src/functions.h b/plugins/TabSRMM/src/functions.h
index 00ab7a0f2e..de55cf7163 100644
--- a/plugins/TabSRMM/src/functions.h
+++ b/plugins/TabSRMM/src/functions.h
@@ -50,7 +50,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
int TSAPI NEN_ReadOptions(NEN_OPTIONS *options);
int TSAPI NEN_WriteOptions(NEN_OPTIONS *options);
-int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szProto, const TCHAR *szStatus, MCONTACT hContact, DWORD fromEvent);
+int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szProto, const wchar_t *szStatus, MCONTACT hContact, DWORD fromEvent);
void TSAPI DeletePopupsForContact(MCONTACT hContact, DWORD dwMask);
/*
@@ -61,7 +61,7 @@ void TSAPI CreateSystrayIcon(int create);
void TSAPI FlashTrayIcon(HICON hIcon);
void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced);
void TSAPI LoadFavoritesAndRecent();
-void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, const char *szProto, TCHAR *szStatus,
+void TSAPI AddContactToFavorites(MCONTACT hContact, const wchar_t *szNickname, const char *szProto, wchar_t *szStatus,
WORD wStatus, HICON hIcon, BOOL mode, HMENU hMenu);
void TSAPI CreateTrayMenus(int mode);
void TSAPI HandleMenuEntryFromhContact(MCONTACT iSelection);
@@ -76,9 +76,9 @@ int TSAPI ActivateTabFromHWND(HWND hwndTab, HWND hwnd);
void TSAPI FlashContainer(TContainerData *pContainer, int iMode, int iNum);
void TSAPI CreateImageList(BOOL bInitial);
-TContainerData* TSAPI FindMatchingContainer(const TCHAR *szName);
-TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, MCONTACT hContactFrom);
-TContainerData* TSAPI FindContainerByName(const TCHAR *name);
+TContainerData* TSAPI FindMatchingContainer(const wchar_t *szName);
+TContainerData* TSAPI CreateContainer(const wchar_t *name, int iTemp, MCONTACT hContactFrom);
+TContainerData* TSAPI FindContainerByName(const wchar_t *name);
int TSAPI GetTabIndexFromHWND(HWND hwndTab, HWND hwnd);
HWND TSAPI GetHWNDFromTabIndex(HWND hwndTab, int idx);
@@ -90,8 +90,8 @@ void TSAPI ReflashContainer(TContainerData *pContainer);
void TSAPI CloseAllContainers();
void TSAPI DeleteContainer(int iIndex);
-void TSAPI RenameContainer(int iIndex, const TCHAR *newName);
-int TSAPI GetContainerNameForContact(MCONTACT hContact, TCHAR *szName, int iNameLen);
+void TSAPI RenameContainer(int iIndex, const wchar_t *newName);
+int TSAPI GetContainerNameForContact(MCONTACT hContact, wchar_t *szName, int iNameLen);
HMENU TSAPI BuildContainerMenu();
void TSAPI PreTranslateDates();
void TSAPI ApplyContainerSetting(TContainerData *pContainer, DWORD flags, UINT mode, bool fForceResize);
@@ -142,15 +142,15 @@ int TSAPI UnloadTSButtonModule();
#if defined(__LOGDEBUG_)
int _DebugTraceW(const wchar_t *fmt, ...);
#endif
-int _DebugPopup(MCONTACT hContact, const TCHAR *fmt, ...);
+int _DebugPopup(MCONTACT hContact, const wchar_t *fmt, ...);
int _DebugMessage(HWND hwndDlg, TWindowData *dat, const char *fmt, ...);
// themes
-const TCHAR* TSAPI GetThemeFileName(int iMode);
-int TSAPI CheckThemeVersion(const TCHAR *szIniFilename);
-void TSAPI WriteThemeToINI(const TCHAR *szIniFilename, TWindowData *dat);
-void TSAPI ReadThemeFromINI(const TCHAR *szIniFilename, TContainerData *dat, int noAdvanced, DWORD dwFlags);
+const wchar_t* TSAPI GetThemeFileName(int iMode);
+int TSAPI CheckThemeVersion(const wchar_t *szIniFilename);
+void TSAPI WriteThemeToINI(const wchar_t *szIniFilename, TWindowData *dat);
+void TSAPI ReadThemeFromINI(const wchar_t *szIniFilename, TContainerData *dat, int noAdvanced, DWORD dwFlags);
// user prefs
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index 5f63d6c7e5..03317d8d5b 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -43,13 +43,13 @@ void TSAPI DM_SaveLogAsRTF(const TWindowData *dat)
CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&event);
}
else if (dat) {
- TCHAR szFilter[MAX_PATH], szFilename[MAX_PATH];
+ wchar_t szFilter[MAX_PATH], szFilename[MAX_PATH];
mir_sntprintf(szFilter, L"%s%c*.rtf%c%c", TranslateT("Rich Edit file"), 0, 0, 0);
mir_sntprintf(szFilename, L"%s.rtf", dat->cache->getNick());
Utils::sanitizeFilename(szFilename);
- TCHAR szInitialDir[MAX_PATH + 2];
+ wchar_t szInitialDir[MAX_PATH + 2];
mir_sntprintf(szInitialDir, L"%s%s\\", M.getDataPath(), L"\\Saved message logs");
CreateDirectoryTreeT(szInitialDir);
@@ -535,7 +535,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
else {
int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE));
- TCHAR *buf = (TCHAR*)mir_alloc((iLen + 2) * sizeof(TCHAR));
+ wchar_t *buf = (wchar_t*)mir_alloc((iLen + 2) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_MESSAGE, buf, iLen + 1);
db_set_ts(dat->hContact, "UserInfo", "MyNotes", buf);
SetDlgItemText(hwndDlg, IDC_MESSAGE, L"");
@@ -612,7 +612,7 @@ static INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
WORD v[4];
CallService(MS_SYSTEM_GETFILEVERSION, 0, (LPARAM)&v);
- TCHAR tStr[80];
+ wchar_t tStr[80];
mir_sntprintf(tStr, L"%s %d.%d.%d.%d [build %d]",
TranslateT("Version"), __MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM, v[3]);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, tStr);
@@ -1000,9 +1000,9 @@ void TSAPI DM_LoadLocale(TWindowData *dat)
if (!db_get_ts(dat->hContact, SRMSGMOD_T, "locale", &dbv))
db_free(&dbv);
else {
- TCHAR szKLName[KL_NAMELENGTH + 1];
+ wchar_t szKLName[KL_NAMELENGTH + 1];
if (!PluginConfig.m_bDontUseDefaultKbd) {
- TCHAR szBuf[20];
+ wchar_t szBuf[20];
GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, szBuf, 20);
mir_sntprintf(szKLName, L"0000%s", szBuf);
db_set_ts(dat->hContact, SRMSGMOD_T, "locale", szKLName);
@@ -1039,7 +1039,7 @@ void TSAPI DM_UpdateLastMessage(const TWindowData *dat)
if (dat->pContainer->hwndStatus == 0 || dat->pContainer->hwndActive != dat->hwnd)
return;
- TCHAR szBuf[100];
+ wchar_t szBuf[100];
if (dat->bShowTyping) {
SendMessage(dat->pContainer->hwndStatus, SB_SETICON, 0, (LPARAM)PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]);
mir_sntprintf(szBuf, TranslateT("%s is typing a message..."), dat->cache->getNick());
@@ -1055,7 +1055,7 @@ void TSAPI DM_UpdateLastMessage(const TWindowData *dat)
if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR)
mir_sntprintf(szBuf, L"UID: %s", dat->cache->getUIN());
else if (dat->lastMessage) {
- TCHAR date[64], time[64];
+ wchar_t date[64], time[64];
TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"d", date, _countof(date), 0);
if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR && mir_tstrlen(date) > 6)
date[mir_tstrlen(date) - 5] = 0;
@@ -1077,7 +1077,7 @@ void TSAPI DM_SaveLocale(TWindowData *dat, WPARAM, LPARAM lParam)
return;
if (PluginConfig.m_bAutoLocaleSupport && dat->hContact && dat->pContainer->hwndActive == dat->hwnd) {
- TCHAR szKLName[KL_NAMELENGTH + 1];
+ wchar_t szKLName[KL_NAMELENGTH + 1];
if ((HKL)lParam != dat->hkl) {
dat->hkl = (HKL)lParam;
ActivateKeyboardLayout(dat->hkl, 0);
@@ -1591,7 +1591,7 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM hContact, LPARAM lParam)
}
dat->hQueuedEvents[dat->iNextQueuedEvent++] = hDbEvent;
- TCHAR szBuf[100];
+ wchar_t szBuf[100];
mir_sntprintf(szBuf, TranslateT("Auto scrolling is disabled, %d message(s) queued (press F12 to enable it)"),
dat->iNextQueuedEvent);
SetDlgItemText(hwndDlg, IDC_LOGFROZENTEXT, szBuf);
@@ -1704,7 +1704,7 @@ void TSAPI DM_HandleAutoSizeRequest(TWindowData *dat, REQRESIZE* rr)
void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam)
{
- TCHAR newtitle[128], newcontactname[128];
+ wchar_t newtitle[128], newcontactname[128];
DWORD dwOldIdle = dat->idle;
const char *szActProto = 0;
@@ -1722,7 +1722,7 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam)
TCITEM item = { 0 };
if (dat->hContact) {
- const TCHAR *szNick = dat->cache->getNick();
+ const wchar_t *szNick = dat->cache->getNick();
if (dat->szProto) {
szActProto = dat->cache->getProto();
@@ -1732,13 +1732,13 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam)
dat->dwFlagsEx = dat->idle ? dat->dwFlagsEx | MWF_SHOW_ISIDLE : dat->dwFlagsEx & ~MWF_SHOW_ISIDLE;
dat->wStatus = dat->cache->getStatus();
- _tcsncpy_s(dat->szStatus, pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : dat->wStatus, 0), _TRUNCATE);
+ wcsncpy_s(dat->szStatus, pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : dat->wStatus, 0), _TRUNCATE);
if (lParam != 0) {
if (PluginConfig.m_bCutContactNameOnTabs)
CutContactName(szNick, newcontactname, _countof(newcontactname));
else
- _tcsncpy_s(newcontactname, szNick, _TRUNCATE);
+ wcsncpy_s(newcontactname, szNick, _TRUNCATE);
Utils::DoubleAmpersands(newcontactname, _countof(newcontactname));
@@ -1746,15 +1746,15 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam)
if (PluginConfig.m_bStatusOnTabs)
mir_sntprintf(newtitle, L"%s (%s)", newcontactname, dat->szStatus);
else
- _tcsncpy_s(newtitle, newcontactname, _TRUNCATE);
+ wcsncpy_s(newtitle, newcontactname, _TRUNCATE);
}
- else _tcsncpy_s(newtitle, L"Forward", _TRUNCATE);
+ else wcsncpy_s(newtitle, L"Forward", _TRUNCATE);
item.mask |= TCIF_TEXT;
}
SendMessage(hwndDlg, DM_UPDATEWINICON, 0, 0);
- TCHAR fulluin[256];
+ wchar_t fulluin[256];
if (dat->bIsMeta)
mir_sntprintf(fulluin,
TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nRight click for metacontact control\nClick dropdown to add or remove user from your favorites."),
@@ -1767,12 +1767,12 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam)
SendDlgItemMessage(hwndDlg, IDC_NAME, BUTTONADDTOOLTIP, (WPARAM)fulluin, BATF_TCHAR);
}
}
- else _tcsncpy_s(newtitle, L"Message Session", _TRUNCATE);
+ else wcsncpy_s(newtitle, L"Message Session", _TRUNCATE);
if (dat->idle != dwOldIdle || lParam != 0) {
if (item.mask & TCIF_TEXT) {
item.pszText = newtitle;
- _tcsncpy(dat->newtitle, newtitle, _countof(dat->newtitle));
+ wcsncpy(dat->newtitle, newtitle, _countof(dat->newtitle));
dat->newtitle[127] = 0;
if (dat->pWnd)
dat->pWnd->updateTitle(dat->cache->getNick());
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index 688a365f04..9bb015b8bf 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -37,7 +37,7 @@ CGlobals PluginConfig;
static TContainerSettings _cnt_default = { false, CNT_FLAGS_DEFAULT, CNT_FLAGSEX_DEFAULT, 255, CInfoPanel::DEGRADE_THRESHOLD, 60, L"%n (%s)", 1, 0 };
-TCHAR* CGlobals::m_default_container_name = L"default";
+wchar_t* CGlobals::m_default_container_name = L"default";
extern HANDLE hHookButtonPressedEvt;
extern HANDLE hHookToolBarLoadedEvt;
@@ -558,7 +558,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void)
}
}
- TCHAR toolTip[256];
+ wchar_t toolTip[256];
CLISTEVENT cle = {};
cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
@@ -597,8 +597,8 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c)
if (wStatus == wOldStatus)
return;
- TCHAR *szOldStatus = pcli->pfnGetStatusModeDescription(wOldStatus, 0);
- TCHAR *szNewStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
+ wchar_t *szOldStatus = pcli->pfnGetStatusModeDescription(wOldStatus, 0);
+ wchar_t *szNewStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
if (szOldStatus == 0 || szNewStatus == 0)
return;
diff --git a/plugins/TabSRMM/src/globals.h b/plugins/TabSRMM/src/globals.h
index d258f91259..3cc0a9b484 100644
--- a/plugins/TabSRMM/src/globals.h
+++ b/plugins/TabSRMM/src/globals.h
@@ -148,7 +148,7 @@ public:
TSplitterBroadCast lastSPlitterPos;
TContainerSettings globalContainerSettings;
- static TCHAR* m_default_container_name;
+ static wchar_t* m_default_container_name;
static void logStatusChange(WPARAM wParam, const CContactCache *c);
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp
index 8d92bde883..00b3abf2fe 100644
--- a/plugins/TabSRMM/src/infopanel.cpp
+++ b/plugins/TabSRMM/src/infopanel.cpp
@@ -28,7 +28,7 @@
#include "stdafx.h"
-TCHAR *xStatusDescr[] =
+wchar_t *xStatusDescr[] =
{
L"Angry", L"Duck", L"Tired", L"Party", L"Beer", L"Thinking", L"Eating",
L"TV", L"Friends", L"Coffee", L"Music", L"Business", L"Camera", L"Funny",
@@ -383,8 +383,8 @@ void CInfoPanel::renderContent(const HDC hdc)
void CInfoPanel::RenderIPNickname(const HDC hdc, RECT &rcItem)
{
- const TCHAR *szStatusMsg = NULL;
- const TCHAR *szTextToShow = 0;
+ const wchar_t *szStatusMsg = NULL;
+ const wchar_t *szTextToShow = 0;
bool fShowUin = false;
COLORREF clr = 0;
@@ -488,9 +488,9 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem)
else
hOldFont = reinterpret_cast<HFONT>(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN]));
- const TCHAR *tszUin = m_dat->cache->getUIN();
+ const wchar_t *tszUin = m_dat->cache->getUIN();
if (tszUin[0]) {
- TCHAR szBuf[256];
+ wchar_t szBuf[256];
if (m_dat->idle) {
time_t diff = time(NULL) - m_dat->idle;
@@ -498,16 +498,16 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem)
int i_mins = (diff - i_hrs * 3600) / 60;
mir_sntprintf(szBuf, TranslateT("%s Idle: %dh,%02dm"), tszUin, i_hrs, i_mins);
}
- else _tcscpy_s(szBuf, 256, tszUin);
+ else wcscpy_s(szBuf, 256, tszUin);
if (M.GetByte("ShowClientDescription", 1)) {
- TCHAR temp[256];
+ wchar_t temp[256];
ptrT szVersion(db_get_tsa(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer"));
if (szVersion)
mir_sntprintf(temp, TranslateT(" Client: %s"), szVersion);
else
mir_sntprintf(temp, TranslateT(" Client not cached yet"));
- _tcscat_s(szBuf, 256, temp);
+ wcscat_s(szBuf, 256, temp);
}
SIZE sUIN;
@@ -535,13 +535,13 @@ void CInfoPanel::RenderIPStatus(const HDC hdc, RECT& rcItem)
GetTextExtentPoint32(hdc, m_dat->szStatus, (int)mir_tstrlen(m_dat->szStatus), &sStatus);
// figure out final account name
- const TCHAR *szFinalProto = m_dat->cache->getRealAccount();
+ const wchar_t *szFinalProto = m_dat->cache->getRealAccount();
if (szFinalProto) {
SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_PROTO]);
GetTextExtentPoint32(hdc, szFinalProto, (int)mir_tstrlen(szFinalProto), &sProto);
}
- TCHAR szResult[80]; szResult[0] = 0;
+ wchar_t szResult[80]; szResult[0] = 0;
if (m_dat->hTimeZone) {
TimeZone_PrintDateTime(m_dat->hTimeZone, L"t", szResult, _countof(szResult), 0);
GetTextExtentPoint32(hdc, szResult, (int)mir_tstrlen(szResult), &sTime);
@@ -612,7 +612,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem)
HFONT hOldFont;
if (m_height < DEGRADE_THRESHOLD) {
- TCHAR tszText[2048];
+ wchar_t tszText[2048];
mir_sntprintf(tszText, TranslateT("Topic is: %s"),
si->ptszTopic ? si->ptszTopic : TranslateT("no topic set."));
@@ -621,7 +621,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem)
CSkin::m_glowSize, m_ipConfig.clrs[IPFONTID_UIN]);
}
else {
- const TCHAR *tszNick = m_dat->cache->getNick();
+ const wchar_t *tszNick = m_dat->cache->getNick();
hOldFont = reinterpret_cast<HFONT>(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_NICK]));
::GetTextExtentPoint32(hdc, tszNick, (int)mir_tstrlen(tszNick), &m_szNick);
@@ -640,7 +640,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem)
::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_STATUS]);
if (si->ptszStatusbarText) {
- TCHAR *pTmp = _tcschr(si->ptszStatusbarText, ']');
+ wchar_t *pTmp = wcschr(si->ptszStatusbarText, ']');
pTmp += 2;
if (si->ptszStatusbarText[0] == '[' && pTmp > si->ptszStatusbarText) {
@@ -669,7 +669,7 @@ void CInfoPanel::Chat_RenderIPSecondLine(const HDC hdc, RECT& rcItem)
COLORREF clr = m_ipConfig.clrs[IPFONTID_UIN];
SIZE szTitle;
- TCHAR szPrefix[100];
+ wchar_t szPrefix[100];
mir_sntprintf(szPrefix, TranslateT("Topic is: %s"), L"");
::GetTextExtentPoint32(hdc, szPrefix, (int)mir_tstrlen(szPrefix), &szTitle);
mapRealRect(rcItem, m_rcUIN, szTitle);
@@ -865,7 +865,7 @@ void CInfoPanel::trackMouse(POINT &pt)
/////////////////////////////////////////////////////////////////////////////////////////
// activate a tooltip
// @param ctrlId : control id
-// @param lParam : typically a TCHAR * for the tooltip text
+// @param lParam : typically a wchar_t * for the tooltip text
void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam)
{
@@ -879,7 +879,7 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam)
::SendMessage(m_dat->hwndTip, TTM_TRACKPOSITION, 0, (LPARAM)MAKELONG(rc.left, rc.bottom));
}
if (lParam)
- m_dat->ti.lpszText = reinterpret_cast<TCHAR *>(lParam);
+ m_dat->ti.lpszText = reinterpret_cast<wchar_t *>(lParam);
else {
if (m_hwndConfig)
return;
@@ -891,7 +891,7 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam)
DBVARIANT dbv = { 0 };
if (BYTE xStatus = m_dat->cache->getXStatusId()) {
- TCHAR *tszXStatusName = 0;
+ wchar_t *tszXStatusName = 0;
if (0 == db_get_ts(m_dat->cache->getContact(), m_dat->cache->getProto(), "XStatusName", &dbv))
tszXStatusName = dbv.ptszVal;
else if (xStatus > 0 && xStatus <= 31)
@@ -1060,7 +1060,7 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L
switch (msg) {
case WM_INITDIALOG:
{
- TCHAR tszTitle[100];
+ wchar_t tszTitle[100];
mir_sntprintf(tszTitle, TranslateT("Set panel visibility for this %s"),
m_isChat ? TranslateT("chat room") : TranslateT("contact"));
::SetDlgItemText(hwnd, IDC_STATIC_VISIBILTY, tszTitle);
@@ -1306,10 +1306,10 @@ void CInfoPanel::dismissConfig(bool fForced)
//
// @param hwndParent HWND owner (used only for position calculation)
// @param hContact HANDLE contact handle
-// @param pszText TCHAR* the content of the rich edit control
+// @param pszText wchar_t* the content of the rich edit control
// @param panel CInfoPanel* the panel which owns it
-CTip::CTip(const HWND hwndParent, const MCONTACT hContact, const TCHAR *pszText, const CInfoPanel* panel)
+CTip::CTip(const HWND hwndParent, const MCONTACT hContact, const wchar_t *pszText, const CInfoPanel* panel)
{
m_hwnd = ::CreateWindowEx(WS_EX_TOOLWINDOW, L"RichEditTipClass", L"", (M.isAero() ? WS_THICKFRAME : WS_BORDER) | WS_POPUPWINDOW | WS_TABSTOP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
0, 0, 40, 40, 0, 0, g_hInst, this);
@@ -1339,7 +1339,7 @@ CTip::CTip(const HWND hwndParent, const MCONTACT hContact, const TCHAR *pszText,
// @param hIcon optional icon to display in the tip header
// @param szTitle optional title to display in the tip header
-void CTip::show(const RECT& rc, POINT& pt, const HICON hIcon, const TCHAR *szTitle)
+void CTip::show(const RECT& rc, POINT& pt, const HICON hIcon, const wchar_t *szTitle)
{
HDC hdc = ::GetDC(m_hwnd);
@@ -1492,7 +1492,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
break;
case WM_ERASEBKGND:
- TCHAR szTitle[128];
+ wchar_t szTitle[128];
{
HDC hdc = (HDC)wParam;
COLORREF clr = CInfoPanel::m_ipConfig.clrs[IPFONTID_NICK];
diff --git a/plugins/TabSRMM/src/infopanel.h b/plugins/TabSRMM/src/infopanel.h
index 7cf319ac94..aadb0d1f84 100644
--- a/plugins/TabSRMM/src/infopanel.h
+++ b/plugins/TabSRMM/src/infopanel.h
@@ -52,7 +52,7 @@ struct TInfoPanelConfig {
UINT height1, height2;
};
-extern TCHAR *xStatusDescr[];
+extern wchar_t *xStatusDescr[];
/**
* a simple tooltip class using a richedit control to display its content. Allows
@@ -71,12 +71,12 @@ public:
LEFT_BAR_WIDTH = 20
};
- CTip(const HWND hwndParent, const MCONTACT hContact, const TCHAR *pszText = 0, const CInfoPanel *panel = 0);
+ CTip(const HWND hwndParent, const MCONTACT hContact, const wchar_t *pszText = 0, const CInfoPanel *panel = 0);
~CTip()
{
mir_free(m_pszText);
}
- void show(const RECT& rc, POINT& pt, const HICON hIcon = 0, const TCHAR *szTitle = 0);
+ void show(const RECT& rc, POINT& pt, const HICON hIcon = 0, const wchar_t *szTitle = 0);
const HWND getHwnd() const { return(m_hwnd); }
static void registerClass();
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp
index 193be84d7b..d79da9851b 100644
--- a/plugins/TabSRMM/src/mim.cpp
+++ b/plugins/TabSRMM/src/mim.cpp
@@ -47,7 +47,7 @@ DURT CMimAPI::m_pfnDwmUnregisterThumbnail = 0;
DSIT CMimAPI::m_pfnDwmSetIconicThumbnail = 0;
DSILP CMimAPI::m_pfnDwmSetIconicLivePreviewBitmap = 0;
bool CMimAPI::m_shutDown = 0;
-TCHAR CMimAPI::m_userDir[] = L"\0";
+wchar_t CMimAPI::m_userDir[] = L"\0";
bool CMimAPI::m_haveBufferedPaint = false;
@@ -88,10 +88,10 @@ int CMimAPI::FoldersPathChanged(WPARAM, LPARAM)
void CMimAPI::configureCustomFolders()
{
- m_hDataPath = FoldersRegisterCustomPathT(LPGEN("TabSRMM"), LPGEN("Data path"), const_cast<TCHAR *>(getDataPath()));
- m_hSkinsPath = FoldersRegisterCustomPathT(LPGEN("Skins"), LPGEN("TabSRMM"), const_cast<TCHAR *>(getSkinPath()));
- m_hAvatarsPath = FoldersRegisterCustomPathT(LPGEN("Avatars"), LPGEN("Saved TabSRMM avatars"), const_cast<TCHAR *>(getSavedAvatarPath()));
- m_hChatLogsPath = FoldersRegisterCustomPathT(LPGEN("TabSRMM"), LPGEN("Group chat logs root"), const_cast<TCHAR *>(getChatLogPath()));
+ m_hDataPath = FoldersRegisterCustomPathT(LPGEN("TabSRMM"), LPGEN("Data path"), const_cast<wchar_t *>(getDataPath()));
+ m_hSkinsPath = FoldersRegisterCustomPathT(LPGEN("Skins"), LPGEN("TabSRMM"), const_cast<wchar_t *>(getSkinPath()));
+ m_hAvatarsPath = FoldersRegisterCustomPathT(LPGEN("Avatars"), LPGEN("Saved TabSRMM avatars"), const_cast<wchar_t *>(getSavedAvatarPath()));
+ m_hChatLogsPath = FoldersRegisterCustomPathT(LPGEN("TabSRMM"), LPGEN("Group chat logs root"), const_cast<wchar_t *>(getChatLogPath()));
if (m_hDataPath)
HookEvent(ME_FOLDERS_PATH_CHANGED, CMimAPI::FoldersPathChanged);
@@ -101,25 +101,25 @@ void CMimAPI::configureCustomFolders()
INT_PTR CMimAPI::foldersPathChanged()
{
- TCHAR szTemp[MAX_PATH + 2];
+ wchar_t szTemp[MAX_PATH + 2];
if (m_hDataPath) {
szTemp[0] = 0;
- FoldersGetCustomPathT(m_hDataPath, szTemp, MAX_PATH, const_cast<TCHAR *>(getDataPath()));
- _tcsncpy_s(m_szProfilePath, szTemp, _TRUNCATE);
+ FoldersGetCustomPathT(m_hDataPath, szTemp, MAX_PATH, const_cast<wchar_t *>(getDataPath()));
+ wcsncpy_s(m_szProfilePath, szTemp, _TRUNCATE);
szTemp[0] = 0;
- FoldersGetCustomPathT(m_hSkinsPath, szTemp, MAX_PATH, const_cast<TCHAR *>(getSkinPath()));
- _tcsncpy_s(m_szSkinsPath, (MAX_PATH - 1), szTemp, _TRUNCATE);
+ FoldersGetCustomPathT(m_hSkinsPath, szTemp, MAX_PATH, const_cast<wchar_t *>(getSkinPath()));
+ wcsncpy_s(m_szSkinsPath, (MAX_PATH - 1), szTemp, _TRUNCATE);
Utils::ensureTralingBackslash(m_szSkinsPath);
szTemp[0] = 0;
- FoldersGetCustomPathT(m_hAvatarsPath, szTemp, MAX_PATH, const_cast<TCHAR *>(getSavedAvatarPath()));
- _tcsncpy_s(m_szSavedAvatarsPath, szTemp, _TRUNCATE);
+ FoldersGetCustomPathT(m_hAvatarsPath, szTemp, MAX_PATH, const_cast<wchar_t *>(getSavedAvatarPath()));
+ wcsncpy_s(m_szSavedAvatarsPath, szTemp, _TRUNCATE);
szTemp[0] = 0;
- FoldersGetCustomPathT(m_hChatLogsPath, szTemp, MAX_PATH, const_cast<TCHAR *>(getChatLogPath()));
- _tcsncpy_s(m_szChatLogsPath, (MAX_PATH - 1), szTemp, _TRUNCATE);
+ FoldersGetCustomPathT(m_hChatLogsPath, szTemp, MAX_PATH, const_cast<wchar_t *>(getChatLogPath()));
+ wcsncpy_s(m_szChatLogsPath, (MAX_PATH - 1), szTemp, _TRUNCATE);
Utils::ensureTralingBackslash(m_szChatLogsPath);
}
@@ -132,13 +132,13 @@ INT_PTR CMimAPI::foldersPathChanged()
return 0;
}
-const TCHAR* CMimAPI::getUserDir()
+const wchar_t* CMimAPI::getUserDir()
{
if (m_userDir[0] == 0) {
if (ServiceExists(MS_FOLDERS_REGISTER_PATH))
- _tcsncpy_s(m_userDir, L"%miranda_userdata%", _TRUNCATE);
+ wcsncpy_s(m_userDir, L"%miranda_userdata%", _TRUNCATE);
else
- _tcsncpy_s(m_userDir, VARST(L"%miranda_userdata%"), _TRUNCATE);
+ wcsncpy_s(m_userDir, VARST(L"%miranda_userdata%"), _TRUNCATE);
Utils::ensureTralingBackslash(m_userDir);
}
@@ -147,16 +147,16 @@ const TCHAR* CMimAPI::getUserDir()
void CMimAPI::InitPaths()
{
- const TCHAR *szUserdataDir = getUserDir();
+ const wchar_t *szUserdataDir = getUserDir();
mir_sntprintf(m_szProfilePath, L"%stabSRMM", szUserdataDir);
if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) {
- _tcsncpy_s(m_szChatLogsPath, L"%miranda_logpath%", _TRUNCATE);
- _tcsncpy_s(m_szSkinsPath, L"%miranda_path%\\Skins\\TabSRMM", _TRUNCATE);
+ wcsncpy_s(m_szChatLogsPath, L"%miranda_logpath%", _TRUNCATE);
+ wcsncpy_s(m_szSkinsPath, L"%miranda_path%\\Skins\\TabSRMM", _TRUNCATE);
}
else {
- _tcsncpy_s(m_szChatLogsPath, VARST(L"%miranda_logpath%"), _TRUNCATE);
- _tcsncpy_s(m_szSkinsPath, VARST(L"%miranda_path%\\Skins\\TabSRMM"), _TRUNCATE);
+ wcsncpy_s(m_szChatLogsPath, VARST(L"%miranda_logpath%"), _TRUNCATE);
+ wcsncpy_s(m_szSkinsPath, VARST(L"%miranda_path%\\Skins\\TabSRMM"), _TRUNCATE);
}
Utils::ensureTralingBackslash(m_szChatLogsPath);
@@ -298,7 +298,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode)
}
if (mode) {
- TCHAR szTip[256];
+ wchar_t szTip[256];
mir_sntprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0));
if (fShowOnClist && ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && M.GetByte(SRMSGMOD, "ShowTypingBalloon", 0)) {
MIRANDASYSTRAYNOTIFY tn;
@@ -320,7 +320,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode)
cle.hIcon = PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING];
cle.pszService = "SRMsg/TypingMessage";
cle.ptszTooltip = szTip;
- pcli->pfnAddEvent(&cle);
+ pcli->pfnAddEvent(&cle);
}
}
return 0;
@@ -411,7 +411,7 @@ int CMimAPI::DispatchNewEvent(WPARAM hContact, LPARAM hDbEvent)
int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM hDbEvent)
{
- TCHAR szName[CONTAINER_NAMELEN + 1];
+ wchar_t szName[CONTAINER_NAMELEN + 1];
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
@@ -542,7 +542,7 @@ nowindowcreate:
if (!(dbei.flags & DBEF_READ)) {
UpdateTrayMenu(0, 0, dbei.szModule, NULL, hContact, 1);
if (!nen_options.bTraySupport) {
- TCHAR toolTip[256], *contactName;
+ wchar_t toolTip[256], *contactName;
CLISTEVENT cle = {};
cle.hContact = hContact;
@@ -553,7 +553,7 @@ nowindowcreate:
contactName = pcli->pfnGetContactDisplayName(hContact, 0);
mir_sntprintf(toolTip, TranslateT("Message from %s"), contactName);
cle.ptszTooltip = toolTip;
- pcli->pfnAddEvent(&cle);
+ pcli->pfnAddEvent(&cle);
}
tabSRMM_ShowPopup(hContact, hDbEvent, dbei.eventType, 0, 0, 0, dbei.szModule);
}
diff --git a/plugins/TabSRMM/src/mim.h b/plugins/TabSRMM/src/mim.h
index c70aa767f6..8322326611 100644
--- a/plugins/TabSRMM/src/mim.h
+++ b/plugins/TabSRMM/src/mim.h
@@ -216,7 +216,7 @@ public:
static bool m_shutDown, m_haveBufferedPaint;
private:
- TCHAR m_szProfilePath[MAX_PATH + 2], m_szSkinsPath[MAX_PATH + 2], m_szSavedAvatarsPath[MAX_PATH + 2], m_szChatLogsPath[MAX_PATH + 2];
+ wchar_t m_szProfilePath[MAX_PATH + 2], m_szSkinsPath[MAX_PATH + 2], m_szSavedAvatarsPath[MAX_PATH + 2], m_szChatLogsPath[MAX_PATH + 2];
HMODULE m_hUxTheme, m_hDwmApi;
bool m_isAero, m_DwmActive, m_isVsThemed;
HANDLE m_hDataPath, m_hSkinsPath, m_hAvatarsPath, m_hChatLogsPath;
@@ -231,7 +231,7 @@ private:
void InitPaths();
private:
- static TCHAR m_userDir[MAX_PATH + 2];
+ static wchar_t m_userDir[MAX_PATH + 2];
};
extern CMimAPI M;
diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp
index 907f802484..1fc829c606 100644
--- a/plugins/TabSRMM/src/modplus.cpp
+++ b/plugins/TabSRMM/src/modplus.cpp
@@ -40,7 +40,7 @@
#include "stdafx.h"
-static TCHAR* getMenuEntry(int i)
+static wchar_t* getMenuEntry(int i)
{
char MEntry[256];
mir_snprintf(MEntry, "MenuEntry_%u", i);
@@ -59,7 +59,7 @@ static int RegisterCustomButton(WPARAM, LPARAM)
bbd.dwDefPos = 200;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[3];
bbd.pszModuleName = "Tabmodplus";
- bbd.ptszTooltip = LPGENT("Insert [img] tag / surround selected text with [img][/img]");
+ bbd.ptszTooltip = LPGENW("Insert [img] tag / surround selected text with [img][/img]");
return CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
}
@@ -74,14 +74,14 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam)
bbd.pszModuleName = "Tabmodplus";
CallService(MS_BB_GETBUTTONSTATE, wParam, (LPARAM)&bbd);
- TCHAR *pszText = L"";
+ wchar_t *pszText = L"";
CHARRANGE cr;
cr.cpMin = cr.cpMax = 0;
SendDlgItemMessage(cbcd->hwndFrom, IDC_MESSAGE, EM_EXGETSEL, 0, (LPARAM)&cr);
UINT textlenght = cr.cpMax - cr.cpMin;
if (textlenght) {
- pszText = (TCHAR*)mir_alloc((textlenght + 1)*sizeof(TCHAR));
- memset(pszText, 0, ((textlenght + 1) * sizeof(TCHAR)));
+ pszText = (wchar_t*)mir_alloc((textlenght + 1)*sizeof(wchar_t));
+ memset(pszText, 0, ((textlenght + 1) * sizeof(wchar_t)));
SendDlgItemMessage(cbcd->hwndFrom, IDC_MESSAGE, EM_GETSELTEXT, 0, (LPARAM)pszText);
}
@@ -95,7 +95,7 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam)
else
state = 4;
- TCHAR *pszFormatedText = NULL, *pszMenu[256] = { 0 };
+ wchar_t *pszFormatedText = NULL, *pszMenu[256] = { 0 };
size_t bufSize;
@@ -118,7 +118,7 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam)
break;
bufSize = textlenght + mir_tstrlen(pszMenu[res - 1]) + 2;
- pszFormatedText = (TCHAR*)_alloca(bufSize*sizeof(TCHAR));
+ pszFormatedText = (wchar_t*)_alloca(bufSize*sizeof(wchar_t));
mir_sntprintf(pszFormatedText, bufSize, pszMenu[res - 1], pszText);
}
break;
@@ -127,7 +127,7 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam)
SendDlgItemMessage(cbcd->hwndFrom, IDC_MESSAGE, EM_GETSELTEXT, 0, (LPARAM)pszText);
bufSize = textlenght + 12;
- pszFormatedText = (TCHAR*)_alloca(bufSize*sizeof(TCHAR));
+ pszFormatedText = (wchar_t*)_alloca(bufSize*sizeof(wchar_t));
mir_sntprintf(pszFormatedText, bufSize, L"[img]%s[/img]", pszText);
bbd.ptszTooltip = 0;
@@ -139,14 +139,14 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam)
case 3:
pszFormatedText = L"[img]";
- bbd.ptszTooltip = LPGENT("Insert [img] tag / surround selected text with [img][/img]");
+ bbd.ptszTooltip = LPGENW("Insert [img] tag / surround selected text with [img][/img]");
CallService(MS_BB_SETBUTTONSTATE, wParam, (LPARAM)&bbd);
break;
case 4:
pszFormatedText = L"[/img]";
- bbd.ptszTooltip = LPGENT("Insert [img] tag / surround selected text with [img][/img]");
+ bbd.ptszTooltip = LPGENW("Insert [img] tag / surround selected text with [img][/img]");
CallService(MS_BB_SETBUTTONSTATE, wParam, (LPARAM)&bbd);
break;
}
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 83be1cc69e..529dac6ce1 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -30,9 +30,9 @@
#define MS_HTTPSERVER_ADDFILENAME "HTTPServer/AddFileName"
-bool IsStringValidLink(TCHAR* pszText);
+bool IsStringValidLink(wchar_t* pszText);
-const TCHAR *pszIDCSAVE_close = 0, *pszIDCSAVE_save = 0;
+const wchar_t *pszIDCSAVE_close = 0, *pszIDCSAVE_save = 0;
static const UINT sendControls[] = { IDC_MESSAGE, IDC_LOG };
static const UINT formatControls[] = { IDC_SMILEYBTN, IDC_FONTBOLD, IDC_FONTITALIC, IDC_FONTUNDERLINE, IDC_FONTFACE, IDC_FONTSTRIKEOUT };
@@ -45,13 +45,13 @@ static COLORREF rtfDefColors[] = { RGB(255, 0, 0), RGB(0, 0, 255), RGB(0, 255, 0
static struct
{
int id;
- const TCHAR* text;
+ const wchar_t* text;
}
tooltips[] =
{
- { IDC_ADD, LPGENT("Add this contact permanently to your contact list") },
- { IDC_CANCELADD, LPGENT("Do not add this contact permanently") },
- { IDC_TOGGLESIDEBAR, LPGENT("Expand or collapse the side bar") }
+ { IDC_ADD, LPGENW("Add this contact permanently to your contact list") },
+ { IDC_CANCELADD, LPGENW("Do not add this contact permanently") },
+ { IDC_TOGGLESIDEBAR, LPGENW("Expand or collapse the side bar") }
};
static struct
@@ -587,7 +587,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar
HANDLE hClip = GetClipboardData(CF_TEXT);
if (hClip) {
if ((int)mir_strlen((char*)hClip) > mwdat->nMax) {
- TCHAR szBuffer[512];
+ wchar_t szBuffer[512];
if (M.GetByte("autosplit", 0))
mir_sntprintf(szBuffer, TranslateT("WARNING: The message you are trying to paste exceeds the message size limit for the active protocol. It will be sent in chunks of max %d characters"), mwdat->nMax - 10);
else
@@ -1189,7 +1189,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
if (dat->hContact && dat->szProto != NULL) {
dat->wStatus = db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE);
- _tcsncpy_s(dat->szStatus, pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : dat->wStatus, 0), _TRUNCATE);
+ wcsncpy_s(dat->szStatus, pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : dat->wStatus, 0), _TRUNCATE);
}
else dat->wStatus = ID_STATUS_OFFLINE;
@@ -1353,7 +1353,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
}
if (newData->szInitialText) {
if (newData->isWchar)
- SetDlgItemTextW(hwndDlg, IDC_MESSAGE, (TCHAR*)newData->szInitialText);
+ SetDlgItemTextW(hwndDlg, IDC_MESSAGE, (wchar_t*)newData->szInitialText);
else
SetDlgItemTextA(hwndDlg, IDC_MESSAGE, newData->szInitialText);
int len = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE));
@@ -2706,7 +2706,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
MEVENT hDBEvent = 0;
if (dat->hwndIEView || dat->hwndHPP) { // IEView quoting support..
- TCHAR *selected = 0;
+ wchar_t *selected = 0;
IEVIEWEVENT event = { sizeof(event) };
event.hContact = dat->hContact;
@@ -2715,11 +2715,11 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
if (dat->hwndIEView) {
event.hwnd = dat->hwndIEView;
- selected = (TCHAR*)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&event);
+ selected = (wchar_t*)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&event);
}
else {
event.hwnd = dat->hwndHPP;
- selected = (TCHAR*)CallService(MS_HPP_EG_EVENT, 0, (LPARAM)&event);
+ selected = (wchar_t*)CallService(MS_HPP_EG_EVENT, 0, (LPARAM)&event);
}
if (selected != NULL) {
@@ -2742,22 +2742,22 @@ quote_from_last:
if (sel.cpMin == sel.cpMax) {
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.cbBlob = db_event_getBlobSize(hDBEvent);
- TCHAR *szText = (TCHAR*)mir_alloc((dbei.cbBlob + 1) * sizeof(TCHAR)); //URLs are made one char bigger for crlf
+ wchar_t *szText = (wchar_t*)mir_alloc((dbei.cbBlob + 1) * sizeof(wchar_t)); //URLs are made one char bigger for crlf
dbei.pBlob = (BYTE*)szText;
db_event_get(hDBEvent, &dbei);
int iSize = int(mir_strlen((char*)dbei.pBlob)) + 1;
bool bNeedsFree = false;
- TCHAR *szConverted;
+ wchar_t *szConverted;
if (dbei.flags & DBEF_UTF) {
szConverted = mir_utf8decodeW((char*)szText);
bNeedsFree = true;
}
else {
if (iSize != (int)dbei.cbBlob)
- szConverted = (TCHAR*)&dbei.pBlob[iSize];
+ szConverted = (wchar_t*)&dbei.pBlob[iSize];
else {
- szConverted = (TCHAR*)mir_alloc(sizeof(TCHAR) * iSize);
+ szConverted = (wchar_t*)mir_alloc(sizeof(wchar_t) * iSize);
bNeedsFree = true;
MultiByteToWideChar(CP_ACP, 0, (char*)dbei.pBlob, -1, szConverted, iSize);
}
@@ -2768,7 +2768,7 @@ quote_from_last:
memmove(szText + iDescr + 2, szText + sizeof(DWORD) + iDescr, dbei.cbBlob - iDescr - sizeof(DWORD)-1);
szText[iDescr] = '\r';
szText[iDescr + 1] = '\n';
- szConverted = (TCHAR*)mir_alloc(sizeof(TCHAR)* (1 + mir_strlen((char *)szText)));
+ szConverted = (wchar_t*)mir_alloc(sizeof(wchar_t)* (1 + mir_strlen((char *)szText)));
MultiByteToWideChar(CP_ACP, 0, (char *)szText, -1, szConverted, 1 + (int)mir_strlen((char *)szText));
bNeedsFree = true;
}
@@ -2871,15 +2871,15 @@ quote_from_last:
return 0;
// sent by the select container dialog box when a container was selected...
- // lParam = (TCHAR*)selected name...
+ // lParam = (wchar_t*)selected name...
case DM_CONTAINERSELECTED:
{
- TCHAR *szNewName = (TCHAR*)lParam;
+ wchar_t *szNewName = (wchar_t*)lParam;
if (!mir_tstrcmp(szNewName, TranslateT("Default container")))
szNewName = CGlobals::m_default_container_name;
int iOldItems = TabCtrl_GetItemCount(hwndTab);
- if (!_tcsncmp(m_pContainer->szName, szNewName, CONTAINER_NAMELEN))
+ if (!wcsncmp(m_pContainer->szName, szNewName, CONTAINER_NAMELEN))
break;
TContainerData *pNewContainer = FindContainerByName(szNewName);
@@ -3041,10 +3041,10 @@ quote_from_last:
}
if (dat->hContact != NULL) {
- TCHAR szFilename[MAX_PATH];
+ wchar_t szFilename[MAX_PATH];
HDROP hDrop = (HDROP)wParam;
int fileCount = DragQueryFile(hDrop, -1, NULL, 0), totalCount = 0, i;
- TCHAR** ppFiles = NULL;
+ wchar_t** ppFiles = NULL;
for (i = 0; i < fileCount; i++) {
DragQueryFile(hDrop, i, szFilename, _countof(szFilename));
Utils::AddToFileList(&ppFiles, &totalCount, szFilename);
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index d50f9b4374..f68dd7c692 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -77,7 +77,7 @@ void TSAPI RearrangeTab(HWND hwndDlg, const TWindowData *dat, int iMode, BOOL fS
return;
HWND hwndTab = GetParent(hwndDlg);
- TCHAR oldText[512];
+ wchar_t oldText[512];
TCITEM item = { 0 };
item.mask = TCIF_IMAGE | TCIF_TEXT | TCIF_PARAM;
@@ -129,17 +129,17 @@ static UINT_PTR CALLBACK OpenFileSubclass(HWND hwnd, UINT msg, WPARAM, LPARAM lP
static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic)
{
- TCHAR szFinalFilename[MAX_PATH];
+ wchar_t szFinalFilename[MAX_PATH];
time_t t = time(NULL);
struct tm *lt = localtime(&t);
DWORD setView = 1;
- TCHAR szTimestamp[100];
+ wchar_t szTimestamp[100];
mir_sntprintf(szTimestamp, L"%04u %02u %02u_%02u%02u", lt->tm_year + 1900, lt->tm_mon, lt->tm_mday, lt->tm_hour, lt->tm_min);
- TCHAR *szProto = mir_a2t(dat->cache->getActiveProto());
+ wchar_t *szProto = mir_a2t(dat->cache->getActiveProto());
- TCHAR szFinalPath[MAX_PATH];
+ wchar_t szFinalPath[MAX_PATH];
mir_sntprintf(szFinalPath, L"%s\\%s", M.getSavedAvatarPath(), szProto);
mir_free(szProto);
@@ -151,7 +151,7 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic)
}
}
- TCHAR szBaseName[MAX_PATH];
+ wchar_t szBaseName[MAX_PATH];
if (isOwnPic)
mir_sntprintf(szBaseName, L"My Avatar_%s", szTimestamp);
else
@@ -162,7 +162,7 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic)
// do not allow / or \ or % in the filename
Utils::sanitizeFilename(szFinalFilename);
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
mir_sntprintf(filter, L"%s%c*.bmp;*.png;*.jpg;*.gif%c%c", TranslateT("Image files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
@@ -259,7 +259,7 @@ int TSAPI MsgWindowUpdateMenu(TWindowData *dat, HMENU submenu, int menuID)
EnableMenuItem(submenu, ID_TABMENU_CLEARSAVEDTABPOSITION, (M.GetDword(dat->hContact, "tabindex", -1) != -1) ? MF_ENABLED : MF_GRAYED);
}
else if (menuID == MENU_PICMENU) {
- TCHAR *szText = NULL;
+ wchar_t *szText = NULL;
char avOverride = (char)M.GetByte(dat->hContact, "hideavatar", -1);
HMENU visMenu = GetSubMenu(submenu, 0);
BOOL picValid = bInfoPanel ? (dat->hOwnPic != 0) : (dat->ace && dat->ace->hbmPic && dat->ace->hbmPic != PluginConfig.g_hbmUnknown);
@@ -424,7 +424,7 @@ int TSAPI MsgWindowMenuHandler(TWindowData *dat, int selection, int menuId)
void TSAPI UpdateReadChars(const TWindowData *dat)
{
if (dat && (dat->pContainer->hwndStatus && dat->pContainer->hwndActive == dat->hwnd)) {
- TCHAR buf[128];
+ wchar_t buf[128];
int len;
if (dat->bType == SESSIONTYPE_CHAT)
@@ -441,7 +441,7 @@ void TSAPI UpdateReadChars(const TWindowData *dat)
BOOL fCaps = (GetKeyState(VK_CAPITAL) & 1);
BOOL fNum = (GetKeyState(VK_NUMLOCK) & 1);
- TCHAR szBuf[20]; szBuf[0] = 0;
+ wchar_t szBuf[20]; szBuf[0] = 0;
if (dat->fInsertMode)
mir_tstrcat(szBuf, L"O");
if (fCaps)
@@ -646,19 +646,19 @@ int TSAPI CheckValidSmileyPack(const char *szProto, MCONTACT hContact)
/////////////////////////////////////////////////////////////////////////////////////////
// return value MUST be mir_free()'d by caller.
-TCHAR* TSAPI QuoteText(const TCHAR *text)
+wchar_t* TSAPI QuoteText(const wchar_t *text)
{
int outChar, lineChar;
int iCharsPerLine = M.GetDword("quoteLineLength", 64);
size_t bufSize = mir_wstrlen(text) + 23;
- TCHAR *strout = (TCHAR*)mir_alloc(bufSize * sizeof(TCHAR));
+ wchar_t *strout = (wchar_t*)mir_alloc(bufSize * sizeof(wchar_t));
int inChar = 0;
int justDoneLineBreak = 1;
for (outChar = 0, lineChar = 0; text[inChar];) {
if (outChar >= bufSize - 8) {
bufSize += 20;
- strout = (TCHAR*)mir_realloc(strout, bufSize * sizeof(TCHAR));
+ strout = (wchar_t*)mir_realloc(strout, bufSize * sizeof(wchar_t));
}
if (justDoneLineBreak && text[inChar] != '\r' && text[inChar] != '\n') {
strout[outChar++] = '>';
@@ -832,31 +832,31 @@ char* TSAPI Message_GetFromStream(HWND hwndRtf, DWORD dwPassedFlags)
return pszText; // pszText contains the text
}
-static TCHAR tszRtfBreaks[] = L" \\\n\r";
+static wchar_t tszRtfBreaks[] = L" \\\n\r";
static void CreateColorMap(CMString &Text, int iCount, COLORREF *pSrc, int *pDst)
{
- const TCHAR *pszText = Text;
+ const wchar_t *pszText = Text;
int iIndex = 1;
- static const TCHAR *lpszFmt = L"\\red%[^ \x5b\\]\\green%[^ \x5b\\]\\blue%[^ \x5b;];";
- TCHAR szRed[10], szGreen[10], szBlue[10];
+ static const wchar_t *lpszFmt = L"\\red%[^ \x5b\\]\\green%[^ \x5b\\]\\blue%[^ \x5b;];";
+ wchar_t szRed[10], szGreen[10], szBlue[10];
- const TCHAR *p1 = _tcsstr(pszText, L"\\colortbl");
+ const wchar_t *p1 = wcsstr(pszText, L"\\colortbl");
if (!p1)
return;
- const TCHAR *pEnd = _tcschr(p1, '}');
+ const wchar_t *pEnd = wcschr(p1, '}');
- const TCHAR *p2 = _tcsstr(p1, L"\\red");
+ const wchar_t *p2 = wcsstr(p1, L"\\red");
for (int i = 0; i < iCount; i++)
pDst[i] = -1;
while (p2 && p2 < pEnd) {
- if (_stscanf(p2, lpszFmt, &szRed, &szGreen, &szBlue) > 0) {
+ if (swscanf(p2, lpszFmt, &szRed, &szGreen, &szBlue) > 0) {
for (int i = 0; i < iCount; i++) {
- if (pSrc[i] == RGB(_ttoi(szRed), _ttoi(szGreen), _ttoi(szBlue)))
+ if (pSrc[i] == RGB(_wtoi(szRed), _wtoi(szGreen), _wtoi(szBlue)))
pDst[i] = iIndex;
}
}
@@ -864,7 +864,7 @@ static void CreateColorMap(CMString &Text, int iCount, COLORREF *pSrc, int *pDst
p1 = p2;
p1++;
- p2 = _tcsstr(p1, L"\\red");
+ p2 = wcsstr(p1, L"\\red");
}
}
@@ -907,7 +907,7 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors
CMString res;
// iterate through all characters, if rtf control character found then take action
- for (const TCHAR *p = pszText.GetString() + idx; *p;) {
+ for (const wchar_t *p = pszText.GetString() + idx; *p;) {
switch (*p) {
case '\\':
if (p[1] == '\\' || p[1] == '{' || p[1] == '}') { // escaped characters
@@ -919,8 +919,8 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors
p += 2; break;
}
- if (!_tcsncmp(p, L"\\cf", 3)) { // foreground color
- int iCol = _ttoi(p + 3);
+ if (!wcsncmp(p, L"\\cf", 3)) { // foreground color
+ int iCol = _wtoi(p + 3);
int iInd = GetRtfIndex(iCol, iNumColors, pIndex);
if (iCol && dat->bType != SESSIONTYPE_CHAT)
@@ -928,85 +928,85 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors
bInsideColor = iInd > 0;
}
- else if (!_tcsncmp(p, L"\\highlight", 10)) { //background color
- TCHAR szTemp[20];
- int iCol = _ttoi(p + 10);
+ else if (!wcsncmp(p, L"\\highlight", 10)) { //background color
+ wchar_t szTemp[20];
+ int iCol = _wtoi(p + 10);
mir_sntprintf(szTemp, L"%d", iCol);
}
- else if (!_tcsncmp(p, L"\\line", 5)) { // soft line break;
+ else if (!wcsncmp(p, L"\\line", 5)) { // soft line break;
res.AppendChar('\n');
}
- else if (!_tcsncmp(p, L"\\endash", 7)) {
+ else if (!wcsncmp(p, L"\\endash", 7)) {
res.AppendChar(0x2013);
}
- else if (!_tcsncmp(p, L"\\emdash", 7)) {
+ else if (!wcsncmp(p, L"\\emdash", 7)) {
res.AppendChar(0x2014);
}
- else if (!_tcsncmp(p, L"\\bullet", 7)) {
+ else if (!wcsncmp(p, L"\\bullet", 7)) {
res.AppendChar(0x2022);
}
- else if (!_tcsncmp(p, L"\\ldblquote", 10)) {
+ else if (!wcsncmp(p, L"\\ldblquote", 10)) {
res.AppendChar(0x201C);
}
- else if (!_tcsncmp(p, L"\\rdblquote", 10)) {
+ else if (!wcsncmp(p, L"\\rdblquote", 10)) {
res.AppendChar(0x201D);
}
- else if (!_tcsncmp(p, L"\\lquote", 7)) {
+ else if (!wcsncmp(p, L"\\lquote", 7)) {
res.AppendChar(0x2018);
}
- else if (!_tcsncmp(p, L"\\rquote", 7)) {
+ else if (!wcsncmp(p, L"\\rquote", 7)) {
res.AppendChar(0x2019);
}
- else if (!_tcsncmp(p, L"\\b", 2)) { //bold
+ else if (!wcsncmp(p, L"\\b", 2)) { //bold
if (!(lf.lfWeight == FW_BOLD)) // only allow bold if the font itself isn't a bold one, otherwise just strip it..
if (dat->SendFormat)
res.Append((p[2] != '0') ? L"[b]" : L"[/b]");
}
- else if (!_tcsncmp(p, L"\\i", 2)) { // italics
+ else if (!wcsncmp(p, L"\\i", 2)) { // italics
if (!lf.lfItalic && dat->SendFormat)
res.Append((p[2] != '0') ? L"[i]" : L"[/i]");
}
- else if (!_tcsncmp(p, L"\\strike", 7)) { // strike-out
+ else if (!wcsncmp(p, L"\\strike", 7)) { // strike-out
if (!lf.lfStrikeOut && dat->SendFormat)
res.Append((p[7] != '0') ? L"[s]" : L"[/s]");
}
- else if (!_tcsncmp(p, L"\\ul", 3)) { // underlined
+ else if (!wcsncmp(p, L"\\ul", 3)) { // underlined
if (!lf.lfUnderline && dat->SendFormat) {
- if (p[3] == 0 || _tcschr(tszRtfBreaks, p[3])) {
+ if (p[3] == 0 || wcschr(tszRtfBreaks, p[3])) {
res.Append(L"[u]");
bInsideUl = true;
}
- else if (!_tcsnccmp(p + 3, L"none", 4)) {
+ else if (!wcsncmp(p + 3, L"none", 4)) {
if (bInsideUl)
res.Append(L"[/u]");
bInsideUl = false;
}
}
}
- else if (!_tcsncmp(p, L"\\tab", 4)) { // tab
+ else if (!wcsncmp(p, L"\\tab", 4)) { // tab
res.AppendChar('\t');
}
else if (p[1] == '\'') { // special character
if (p[2] != ' ' && p[2] != '\\') {
- TCHAR tmp[10];
+ wchar_t tmp[10];
if (p[3] != ' ' && p[3] != '\\') {
- _tcsncpy(tmp, p + 2, 3);
+ wcsncpy(tmp, p + 2, 3);
tmp[3] = 0;
}
else {
- _tcsncpy(tmp, p + 2, 2);
+ wcsncpy(tmp, p + 2, 2);
tmp[2] = 0;
}
// convert string containing char in hex format to int.
- TCHAR *stoppedHere;
- res.AppendChar(_tcstol(tmp, &stoppedHere, 16));
+ wchar_t *stoppedHere;
+ res.AppendChar(wcstol(tmp, &stoppedHere, 16));
}
}
p++; // skip initial slash
- p += _tcscspn(p, tszRtfBreaks);
+ p += wcscspn(p, tszRtfBreaks);
if (*p == ' ')
p++;
break;
@@ -1039,7 +1039,7 @@ void TSAPI GetMYUIN(TWindowData *dat)
{
ptrT uid(Contact_GetInfo(CNF_DISPLAYUID, NULL, dat->cache->getActiveProto()));
if (uid != NULL)
- _tcsncpy_s(dat->myUin, uid, _TRUNCATE);
+ wcsncpy_s(dat->myUin, uid, _TRUNCATE);
else
dat->myUin[0] = 0;
}
@@ -1249,9 +1249,9 @@ void TSAPI GetSendFormat(TWindowData *dat)
//
// GetLocaleInfo() should no longer be used on Vista and later
-void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName)
+void TSAPI GetLocaleID(TWindowData *dat, const wchar_t *szKLName)
{
- TCHAR szLI[256], *stopped = NULL;
+ wchar_t szLI[256], *stopped = NULL;
USHORT langID;
WORD wCtype2[3];
PARAFORMAT2 pf2;
@@ -1261,34 +1261,34 @@ void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName)
szLI[0] = szLI[1] = 0;
memset(&pf2, 0, sizeof(PARAFORMAT2));
- langID = (USHORT)_tcstol(szKLName, &stopped, 16);
+ langID = (USHORT)wcstol(szKLName, &stopped, 16);
dat->lcid = MAKELCID(langID, 0);
/*
* Vista+: read ISO locale names from the registry
*/
if (PluginConfig.m_bIsVista) {
HKEY hKey = 0;
- TCHAR szKey[20];
- DWORD dwLID = _tcstoul(szKLName, &stopped, 16);
+ wchar_t szKey[20];
+ DWORD dwLID = wcstoul(szKLName, &stopped, 16);
mir_sntprintf(szKey, L"%04.04x", LOWORD(dwLID));
if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, L"MIME\\Database\\Rfc1766", 0, KEY_READ, &hKey)) {
DWORD dwLength = 255;
if (ERROR_SUCCESS == RegQueryValueEx(hKey, szKey, 0, 0, (unsigned char *)szLI, &dwLength)) {
- TCHAR* p;
+ wchar_t* p;
szLI[255] = 0;
- if ((p = _tcschr(szLI, ';')) != 0)
+ if ((p = wcschr(szLI, ';')) != 0)
*p = 0;
}
RegCloseKey(hKey);
}
- szLI[0] = _totupper(szLI[0]);
- szLI[1] = _totupper(szLI[1]);
+ szLI[0] = towupper(szLI[0]);
+ szLI[1] = towupper(szLI[1]);
}
else {
GetLocaleInfo(dat->lcid, LOCALE_SISO639LANGNAME, szLI, 10);
- _tcsupr(szLI);
+ wcsupr(szLI);
}
fLocaleNotSet = (dat->lcID[0] == 0 && dat->lcID[1] == 0);
mir_sntprintf(dat->lcID, szLI);
@@ -1557,7 +1557,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM, LPARAM lParam, TWindowData *dat)
}
if (dis->hwndItem == GetDlgItem(hwndDlg, IDC_STATICTEXT) || dis->hwndItem == GetDlgItem(hwndDlg, IDC_LOGFROZENTEXT)) {
- TCHAR szWindowText[256];
+ wchar_t szWindowText[256];
if (CSkin::m_skinEnabled) {
SetTextColor(dis->hDC, CSkin::m_DefaultFontColor);
CSkin::SkinDrawBG(dis->hwndItem, dat->pContainer->hwnd, dat->pContainer, &dis->rcItem, dis->hDC);
@@ -1737,11 +1737,11 @@ void TSAPI GetMyNick(TWindowData *dat)
ptrT tszNick(Contact_GetInfo(CNF_NICK, NULL, dat->cache->getActiveProto()));
if (tszNick != NULL) {
if (mir_tstrlen(tszNick) == 0 || !mir_tstrcmp(tszNick, TranslateT("'(Unknown contact)'")))
- _tcsncpy_s(dat->szMyNickname, (dat->myUin[0] ? dat->myUin : TranslateT("'(Unknown contact)'")), _TRUNCATE);
+ wcsncpy_s(dat->szMyNickname, (dat->myUin[0] ? dat->myUin : TranslateT("'(Unknown contact)'")), _TRUNCATE);
else
- _tcsncpy_s(dat->szMyNickname, tszNick, _TRUNCATE);
+ wcsncpy_s(dat->szMyNickname, tszNick, _TRUNCATE);
}
- else _tcsncpy_s(dat->szMyNickname, L"<undef>", _TRUNCATE); // same here
+ else wcsncpy_s(dat->szMyNickname, L"<undef>", _TRUNCATE); // same here
}
HICON TSAPI MY_GetContactIcon(const TWindowData *dat, LPCSTR szSetting)
@@ -1849,14 +1849,14 @@ LONG TSAPI GetDefaultMinimumInputHeight(const TWindowData *dat)
return(height);
}
-static LIST<TCHAR> vTempFilenames(5);
+static LIST<wchar_t> vTempFilenames(5);
// send a pasted bitmap by file transfer.
void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp)
{
const wchar_t* mirandatempdir = L"Miranda";
const wchar_t* filenametemplate = L"\\clp-%Y%m%d-%H%M%S0.jpg";
- TCHAR filename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
size_t tempdirlen = GetTempPath(MAX_PATH, filename);
bool fSend = true;
@@ -1899,7 +1899,7 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp)
time(&rawtime);
const tm* timeinfo;
timeinfo = _localtime32((__time32_t *)&rawtime);
- _tcsftime(filename + tempdirlen, MAX_PATH - tempdirlen, filenametemplate, timeinfo);
+ wcsftime(filename + tempdirlen, MAX_PATH - tempdirlen, filenametemplate, timeinfo);
size_t firstnumberpos = tempdirlen + 14;
size_t lastnumberpos = tempdirlen + 20;
while (GetFileAttributes(filename) != INVALID_FILE_ATTRIBUTES) { // while it exists
@@ -1916,7 +1916,7 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp)
}
if (filename[0] == 0) { // prompting to save
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
mir_sntprintf(filter, L"%s%c*.jpg%c%c", TranslateT("JPEG-compressed images"), 0, 0, 0);
OPENFILENAME dlg;
@@ -1940,7 +1940,7 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp)
CallService(MS_IMG_SAVE, (WPARAM)&ii, IMGL_TCHAR);
int totalCount = 0;
- TCHAR **ppFiles = NULL;
+ wchar_t **ppFiles = NULL;
Utils::AddToFileList(&ppFiles, &totalCount, filename);
wchar_t* _t = mir_tstrdup(filename);
diff --git a/plugins/TabSRMM/src/msgdlgutils.h b/plugins/TabSRMM/src/msgdlgutils.h
index 7b6c84ebb5..1d7610caca 100644
--- a/plugins/TabSRMM/src/msgdlgutils.h
+++ b/plugins/TabSRMM/src/msgdlgutils.h
@@ -38,7 +38,7 @@ bool TSAPI GetAvatarVisibility(HWND hwndDlg, TWindowData *dat);
void TSAPI ProcessAvatarChange(HWND hwnd, LPARAM lParam);
void TSAPI UpdateStatusBar(const TWindowData *dat);
int TSAPI CheckValidSmileyPack(const char *szProto, MCONTACT hContact);
-TCHAR* TSAPI QuoteText(const TCHAR *text);
+wchar_t* TSAPI QuoteText(const wchar_t *text);
void TSAPI UpdateReadChars(const TWindowData *dat);
void TSAPI ShowPicture(TWindowData *dat, BOOL showNewPic);
void TSAPI AdjustBottomAvatarDisplay(TWindowData *dat);
@@ -55,7 +55,7 @@ void TSAPI SaveSplitter(TWindowData *dat);
void TSAPI LoadSplitter(TWindowData *dat);
void TSAPI PlayIncomingSound(const TWindowData *dat);
void TSAPI GetSendFormat(TWindowData *dat);
-void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName);
+void TSAPI GetLocaleID(TWindowData *dat, const wchar_t *szKLName);
void TSAPI LoadOwnAvatar(TWindowData *dat);
void TSAPI LoadContactAvatar(TWindowData *dat);
void TSAPI LoadTimeZone(TWindowData *dat);
@@ -64,7 +64,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat
void TSAPI LoadOverrideTheme(TContainerData *pContainer);
void TSAPI LoadThemeDefaults(TContainerData *pContainer);
void TSAPI ConfigureSmileyButton(TWindowData *dat);
-int TSAPI CutContactName(const TCHAR *szold, TCHAR *sznew, size_t size);
+int TSAPI CutContactName(const wchar_t *szold, wchar_t *sznew, size_t size);
void TSAPI SendNudge(const TWindowData *dat);
void TSAPI EnableSendButton(const TWindowData *dat, int iMode);
LRESULT TSAPI GetSendButtonState(HWND hwnd);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp
index 52d7273605..8abd3a071b 100644
--- a/plugins/TabSRMM/src/msglog.cpp
+++ b/plugins/TabSRMM/src/msglog.cpp
@@ -29,41 +29,41 @@
#include "stdafx.h"
struct TCpTable cpTable[] = {
- { 874, LPGENT("Thai") },
- { 932, LPGENT("Japanese") },
- { 936, LPGENT("Simplified Chinese") },
- { 949, LPGENT("Korean") },
- { 950, LPGENT("Traditional Chinese") },
- { 1250, LPGENT("Central European") },
- { 1251, LPGENT("Cyrillic") },
- { 20866, LPGENT("Cyrillic KOI8-R") },
- { 1252, LPGENT("Latin I") },
- { 1253, LPGENT("Greek") },
- { 1254, LPGENT("Turkish") },
- { 1255, LPGENT("Hebrew") },
- { 1256, LPGENT("Arabic") },
- { 1257, LPGENT("Baltic") },
- { 1258, LPGENT("Vietnamese") },
- { 1361, LPGENT("Korean (Johab)") },
+ { 874, LPGENW("Thai") },
+ { 932, LPGENW("Japanese") },
+ { 936, LPGENW("Simplified Chinese") },
+ { 949, LPGENW("Korean") },
+ { 950, LPGENW("Traditional Chinese") },
+ { 1250, LPGENW("Central European") },
+ { 1251, LPGENW("Cyrillic") },
+ { 20866, LPGENW("Cyrillic KOI8-R") },
+ { 1252, LPGENW("Latin I") },
+ { 1253, LPGENW("Greek") },
+ { 1254, LPGENW("Turkish") },
+ { 1255, LPGENW("Hebrew") },
+ { 1256, LPGENW("Arabic") },
+ { 1257, LPGENW("Baltic") },
+ { 1258, LPGENW("Vietnamese") },
+ { 1361, LPGENW("Korean (Johab)") },
{ (UINT)-1, NULL }
};
-wchar_t* weekDays[7] = { LPGENT("Sunday"), LPGENT("Monday"), LPGENT("Tuesday"), LPGENT("Wednesday"), LPGENT("Thursday"), LPGENT("Friday"), LPGENT("Saturday") };
+wchar_t* weekDays[7] = { LPGENW("Sunday"), LPGENW("Monday"), LPGENW("Tuesday"), LPGENW("Wednesday"), LPGENW("Thursday"), LPGENW("Friday"), LPGENW("Saturday") };
wchar_t* months[12] =
{
- LPGENT("January"), LPGENT("February"), LPGENT("March"), LPGENT("April"), LPGENT("May"), LPGENT("June"),
- LPGENT("July"), LPGENT("August"), LPGENT("September"), LPGENT("October"), LPGENT("November"), LPGENT("December")
+ LPGENW("January"), LPGENW("February"), LPGENW("March"), LPGENW("April"), LPGENW("May"), LPGENW("June"),
+ LPGENW("July"), LPGENW("August"), LPGENW("September"), LPGENW("October"), LPGENW("November"), LPGENW("December")
};
static time_t today;
int g_groupBreak = TRUE;
-static TCHAR *szMyName = NULL;
-static TCHAR *szYourName = NULL;
+static wchar_t *szMyName = NULL;
+static wchar_t *szYourName = NULL;
static int logPixelSY;
-static TCHAR szToday[22], szYesterday[22];
+static wchar_t szToday[22], szYesterday[22];
char rtfFontsGlobal[MSGDLGFONTCOUNT + 2][RTFCACHELINESIZE];
char *rtfFonts;
@@ -107,7 +107,7 @@ __forceinline char *GetRTFFont(DWORD dwIndex)
* the highlight code (individual background colors).
* Doesn't touch the message for sure, but empty lines at the end are ugly anyway.
*/
-static void TrimMessage(TCHAR *msg)
+static void TrimMessage(wchar_t *msg)
{
size_t iLen = mir_tstrlen(msg) - 1;
size_t i = iLen;
@@ -132,8 +132,8 @@ void TSAPI CacheLogFonts()
}
mir_snprintf(rtfFontsGlobal[MSGDLGFONTCOUNT], "\\f%u\\cf%u\\b%d\\i%d\\fs%u", MSGDLGFONTCOUNT, MSGDLGFONTCOUNT, 0, 0, 0);
- _tcsncpy(szToday, TranslateT("Today"), 20);
- _tcsncpy(szYesterday, TranslateT("Yesterday"), 20);
+ wcsncpy(szToday, TranslateT("Today"), 20);
+ wcsncpy(szYesterday, TranslateT("Yesterday"), 20);
szToday[19] = szYesterday[19] = 0;
// cache/create the info panel fonts
@@ -198,14 +198,14 @@ static int TSAPI GetColorIndex(char *rtffont)
return 0;
}
-static int AppendUnicodeToBuffer(CMStringA &str, const TCHAR *line, int mode)
+static int AppendUnicodeToBuffer(CMStringA &str, const wchar_t *line, int mode)
{
str.Append("{\\uc1 ");
int textCharsCount = 0;
for (; *line; line++, textCharsCount++) {
if (*line == 127 && line[1] != 0) {
- TCHAR code = line[2];
+ wchar_t code = line[2];
if (((code == '0' || code == '1') && line[3] == ' ') || (line[1] == 'c' && code == 'x')) {
int begin = (code == '1');
switch (line[1]) {
@@ -336,7 +336,7 @@ static char* CreateRTFHeader(TWindowData *dat)
return str.Detach();
}
-static void AppendTimeStamp(TCHAR *szFinalTimestamp, int isSent, CMStringA &str, int skipFont, TWindowData *dat, int iFontIDOffset)
+static void AppendTimeStamp(wchar_t *szFinalTimestamp, int isSent, CMStringA &str, int skipFont, TWindowData *dat, int iFontIDOffset)
{
if (skipFont)
AppendUnicodeToBuffer(str, szFinalTimestamp, MAKELONG(isSent, dat->bIsHistory));
@@ -347,14 +347,14 @@ static void AppendTimeStamp(TCHAR *szFinalTimestamp, int isSent, CMStringA &str,
}
}
-static TCHAR* Template_MakeRelativeDate(HANDLE hTimeZone, time_t check, TCHAR code)
+static wchar_t* Template_MakeRelativeDate(HANDLE hTimeZone, time_t check, wchar_t code)
{
- static TCHAR szResult[100];
- const TCHAR *szFormat;
+ static wchar_t szResult[100];
+ const wchar_t *szFormat;
- if ((code == (TCHAR)'R' || code == (TCHAR)'r') && check >= today)
+ if ((code == (wchar_t)'R' || code == (wchar_t)'r') && check >= today)
mir_tstrcpy(szResult, szToday);
- else if ((code == (TCHAR)'R' || code == (TCHAR)'r') && check > (today - 86400))
+ else if ((code == (wchar_t)'R' || code == (wchar_t)'r') && check > (today - 86400))
mir_tstrcpy(szResult, szYesterday);
else {
if (code == 'D' || code == 'R')
@@ -419,14 +419,14 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact,
if (dbei.eventType == EVENTTYPE_MESSAGE && !dbei.markedRead())
dat->cache->updateStats(TSessionStats::SET_LAST_RCV, mir_strlen((char *)dbei.pBlob));
- TCHAR *formatted = NULL;
- TCHAR *msg = DbGetEventTextT(&dbei, CP_UTF8);
+ wchar_t *formatted = NULL;
+ wchar_t *msg = DbGetEventTextT(&dbei, CP_UTF8);
if (!msg) {
mir_free(dbei.pBlob);
return NULL;
}
TrimMessage(msg);
- formatted = const_cast<TCHAR *>(Utils::FormatRaw(dat, msg, dwFormattingParams, FALSE));
+ formatted = const_cast<wchar_t *>(Utils::FormatRaw(dat, msg, dwFormattingParams, FALSE));
mir_free(msg);
CMStringA str;
@@ -501,7 +501,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact,
TTemplateSet *this_templateset = dbei.flags & DBEF_RTL ? dat->pContainer->rtl_templates : dat->pContainer->ltr_templates;
- TCHAR *szTemplate;
+ wchar_t *szTemplate;
if (bIsStatusChangeEvent)
szTemplate = this_templateset->szTemplates[TMPL_STATUSCHG];
else if (dbei.eventType == EVENTTYPE_ERRMSG)
@@ -529,9 +529,9 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact,
str.Append("\\ul0\\b0\\i0\\v0 ");
for (size_t i = 0; i < iTemplateLen;) {
- TCHAR ci = szTemplate[i];
+ wchar_t ci = szTemplate[i];
if (ci == '%') {
- TCHAR cc = szTemplate[i + 1];
+ wchar_t cc = szTemplate[i + 1];
skipToNext = FALSE;
skipFont = FALSE;
@@ -584,7 +584,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact,
}
}
- TCHAR color, code;
+ wchar_t color, code;
switch (cc) {
case 'V':
//str.Append("\\fs0\\\expnd-40 ~-%d-~", hDbEvent);
@@ -615,14 +615,14 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact,
break;
case 'D': // long date
if (showTime && showDate) {
- TCHAR *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, 'D');
+ wchar_t *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, 'D');
AppendTimeStamp(szFinalTimestamp, isSent, str, skipFont, dat, iFontIDOffset);
}
else skipToNext = TRUE;
break;
case 'E': // short date...
if (showTime && showDate) {
- TCHAR *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, 'E');
+ wchar_t *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, 'E');
AppendTimeStamp(szFinalTimestamp, isSent, str, skipFont, dat, iFontIDOffset);
}
else skipToNext = TRUE;
@@ -721,7 +721,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact,
case 'R':
case 'r': // long date
if (showTime && showDate) {
- TCHAR *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, cc);
+ wchar_t *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, cc);
AppendTimeStamp(szFinalTimestamp, isSent, str, skipFont, dat, iFontIDOffset);
}
else skipToNext = TRUE;
@@ -729,7 +729,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact,
case 't':
case 'T':
if (showTime) {
- TCHAR *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, (TCHAR)((dwEffectiveFlags & MWF_LOG_SHOWSECONDS) ? cc : (TCHAR)'t'));
+ wchar_t *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, (wchar_t)((dwEffectiveFlags & MWF_LOG_SHOWSECONDS) ? cc : (wchar_t)'t'));
AppendTimeStamp(szFinalTimestamp, isSent, str, skipFont, dat, iFontIDOffset);
}
else skipToNext = TRUE;
@@ -830,7 +830,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact,
if (*szDescr != 0) {
ptrT tszDescr(DbGetEventStringT(&dbei, szDescr));
- TCHAR buf[1000];
+ wchar_t buf[1000];
mir_sntprintf(buf, L"%s (%s)", tszFileName, tszDescr);
AppendUnicodeToBuffer(str, buf, 0);
}
@@ -1035,7 +1035,7 @@ static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppe
{
DWORD dwScale = M.GetDword("iconscale", 0);
- TCHAR trbuffer[40];
+ wchar_t trbuffer[40];
TEXTRANGE tr;
tr.lpstrText = trbuffer;
@@ -1062,8 +1062,8 @@ static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppe
cr.cpMax = cr.cpMin + 18;
SendMessage(hwndrtf, EM_EXSETSEL, 0, (LPARAM)&cr);
SendMessage(hwndrtf, EM_REPLACESEL, FALSE, (LPARAM)L"");
- UINT length = (unsigned int)_ttol(&trbuffer[7]);
- int index = _ttol(&trbuffer[14]);
+ UINT length = (unsigned int)_wtol(&trbuffer[7]);
+ int index = _wtol(&trbuffer[14]);
if (length > 0 && length < 20000 && index >= RTF_CTABLE_DEFSIZE && index < Utils::rtf_ctable_size) {
cf2.crTextColor = Utils::rtf_ctable[index].clr;
cr.cpMin = fi.chrgText.cpMin;
@@ -1234,7 +1234,7 @@ void TSAPI StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAp
if (dat->szMicroLf[0] == 0)
SetupLogFormatting(dat);
- szYourName = const_cast<TCHAR *>(dat->cache->getNick());
+ szYourName = const_cast<wchar_t *>(dat->cache->getNick());
szMyName = dat->szMyNickname;
SendMessage(hwndrtf, EM_HIDESELECTION, TRUE, 0);
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp
index 9cb53d4b0c..4928636933 100644
--- a/plugins/TabSRMM/src/msgoptions.cpp
+++ b/plugins/TabSRMM/src/msgoptions.cpp
@@ -93,16 +93,16 @@ static HWND hwndTabConfig = 0;
//
// [Global]/Name property is new in TabSRMM version 3.
-static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox)
+static int TSAPI ScanSkinDir(const wchar_t* tszFolder, HWND hwndCombobox)
{
bool fValid = false;
- TCHAR tszMask[MAX_PATH];
+ wchar_t tszMask[MAX_PATH];
mir_sntprintf(tszMask, L"%s*.*", tszFolder);
WIN32_FIND_DATA fd = { 0 };
HANDLE h = FindFirstFile(tszMask, &fd);
while (h != INVALID_HANDLE_VALUE) {
- if (mir_tstrlen(fd.cFileName) >= 5 && !_tcsnicmp(fd.cFileName + mir_tstrlen(fd.cFileName) - 4, L".tsk", 4)) {
+ if (mir_tstrlen(fd.cFileName) >= 5 && !wcsnicmp(fd.cFileName + mir_tstrlen(fd.cFileName) - 4, L".tsk", 4)) {
fValid = true;
break;
}
@@ -113,21 +113,21 @@ static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox)
FindClose(h);
if (fValid) {
- TCHAR tszFinalName[MAX_PATH], tszRel[MAX_PATH];
+ wchar_t tszFinalName[MAX_PATH], tszRel[MAX_PATH];
LRESULT lr;
- TCHAR szBuf[255];
+ wchar_t szBuf[255];
mir_sntprintf(tszFinalName, L"%s%s", tszFolder, fd.cFileName);
GetPrivateProfileString(L"Global", L"Name", L"None", szBuf, _countof(szBuf), tszFinalName);
if (!mir_tstrcmp(szBuf, L"None")) {
fd.cFileName[mir_tstrlen(fd.cFileName) - 4] = 0;
- _tcsncpy_s(szBuf, fd.cFileName, _TRUNCATE);
+ wcsncpy_s(szBuf, fd.cFileName, _TRUNCATE);
}
PathToRelativeT(tszFinalName, tszRel, M.getSkinPath());
if ((lr = SendMessage(hwndCombobox, CB_INSERTSTRING, -1, (LPARAM)szBuf)) != CB_ERR) {
- TCHAR *idata = (TCHAR*)mir_alloc((mir_tstrlen(tszRel) + 1) * sizeof(TCHAR));
+ wchar_t *idata = (wchar_t*)mir_alloc((mir_tstrlen(tszRel) + 1) * sizeof(wchar_t));
mir_tstrcpy(idata, tszRel);
SendMessage(hwndCombobox, CB_SETITEMDATA, lr, (LPARAM)idata);
@@ -149,8 +149,8 @@ static int TSAPI RescanSkins(HWND hwndCombobox)
{
DBVARIANT dbv = { 0 };
- TCHAR tszSkinRoot[MAX_PATH], tszFindMask[MAX_PATH];
- _tcsncpy_s(tszSkinRoot, M.getSkinPath(), _TRUNCATE);
+ wchar_t tszSkinRoot[MAX_PATH], tszFindMask[MAX_PATH];
+ wcsncpy_s(tszSkinRoot, M.getSkinPath(), _TRUNCATE);
SetDlgItemText(GetParent(hwndCombobox), IDC_SKINROOTFOLDER, tszSkinRoot);
mir_sntprintf(tszFindMask, L"%s*.*", tszSkinRoot);
@@ -162,7 +162,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox)
HANDLE h = FindFirstFile(tszFindMask, &fd);
while (h != INVALID_HANDLE_VALUE) {
if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY && fd.cFileName[0] != '.') {
- TCHAR tszSubDir[MAX_PATH];
+ wchar_t tszSubDir[MAX_PATH];
mir_sntprintf(tszSubDir, L"%s%s\\", tszSkinRoot, fd.cFileName);
ScanSkinDir(tszSubDir, hwndCombobox);
}
@@ -176,8 +176,8 @@ static int TSAPI RescanSkins(HWND hwndCombobox)
if (0 == db_get_ts(0, SRMSGMOD_T, "ContainerSkin", &dbv)) {
LRESULT lr = SendMessage(hwndCombobox, CB_GETCOUNT, 0, 0);
for (int i = 1; i < lr; i++) {
- TCHAR *idata = (TCHAR*)SendMessage(hwndCombobox, CB_GETITEMDATA, i, 0);
- if (idata && idata != (TCHAR*)CB_ERR) {
+ wchar_t *idata = (wchar_t*)SendMessage(hwndCombobox, CB_GETITEMDATA, i, 0);
+ if (idata && idata != (wchar_t*)CB_ERR) {
if (!mir_tstrcmpi(dbv.ptszVal, idata)) {
SendMessage(hwndCombobox, CB_SETCURSEL, i, 0);
break;
@@ -291,7 +291,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
case IDC_THEMEEXPORT:
{
- const TCHAR *szFilename = GetThemeFileName(1);
+ const wchar_t *szFilename = GetThemeFileName(1);
if (szFilename != NULL)
WriteThemeToINI(szFilename, 0);
}
@@ -342,8 +342,8 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
if (HIWORD(wParam) == CBN_SELCHANGE) {
LRESULT lr = SendDlgItemMessage(hwndDlg, IDC_SKINNAME, CB_GETCURSEL, 0, 0);
if (lr != CB_ERR && lr > 0) {
- TCHAR *tszRelPath = (TCHAR*)SendDlgItemMessage(hwndDlg, IDC_SKINNAME, CB_GETITEMDATA, lr, 0);
- if (tszRelPath && tszRelPath != (TCHAR*)CB_ERR)
+ wchar_t *tszRelPath = (wchar_t*)SendDlgItemMessage(hwndDlg, IDC_SKINNAME, CB_GETITEMDATA, lr, 0);
+ if (tszRelPath && tszRelPath != (wchar_t*)CB_ERR)
db_set_ts(0, SRMSGMOD_T, "ContainerSkin", tszRelPath);
SendMessage(hwndDlg, WM_COMMAND, IDC_RELOADSKIN, 0);
}
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index 657c3643ec..1301f3af80 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -281,7 +281,7 @@ static INT_PTR ReadMessageCommand(WPARAM, LPARAM lParam)
if (hwndExisting != 0)
SendMessage(hwndExisting, DM_ACTIVATEME, 0, 0);
else {
- TCHAR szName[CONTAINER_NAMELEN + 1];
+ wchar_t szName[CONTAINER_NAMELEN + 1];
GetContainerNameForContact(hContact, szName, CONTAINER_NAMELEN);
TContainerData *pContainer = FindContainerByName(szName);
if (pContainer == NULL)
@@ -330,7 +330,7 @@ INT_PTR SendMessageCommand_Worker(MCONTACT hContact, LPCSTR pszMsg, bool isWchar
SendMessage(hwnd, DM_ACTIVATEME, 0, 0);
}
else {
- TCHAR szName[CONTAINER_NAMELEN + 1];
+ wchar_t szName[CONTAINER_NAMELEN + 1];
GetContainerNameForContact(hContact, szName, CONTAINER_NAMELEN);
TContainerData *pContainer = FindContainerByName(szName);
@@ -473,7 +473,7 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact,
}
// if we have a max # of tabs/container set and want to open something in the default container...
- if (hContact != 0 && M.GetByte("limittabs", 0) && !_tcsncmp(pContainer->szName, L"default", 6))
+ if (hContact != 0 && M.GetByte("limittabs", 0) && !wcsncmp(pContainer->szName, L"default", 6))
if ((pContainer = FindMatchingContainer(L"default")) == NULL)
if ((pContainer = CreateContainer(L"default", CNT_CREATEFLAG_CLONED, hContact)) == NULL)
return 0;
@@ -487,21 +487,21 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact,
memset(&newData.item, 0, sizeof(newData.item));
// obtain various status information about the contact
- TCHAR *contactName = pcli->pfnGetContactDisplayName(newData.hContact, 0);
+ wchar_t *contactName = pcli->pfnGetContactDisplayName(newData.hContact, 0);
// cut nickname if larger than x chars...
- TCHAR newcontactname[128], tabtitle[128];
+ wchar_t newcontactname[128], tabtitle[128];
if (contactName && mir_tstrlen(contactName) > 0) {
if (M.GetByte("cuttitle", 0))
CutContactName(contactName, newcontactname, _countof(newcontactname));
else
- _tcsncpy_s(newcontactname, contactName, _TRUNCATE);
+ wcsncpy_s(newcontactname, contactName, _TRUNCATE);
Utils::DoubleAmpersands(newcontactname, _countof(newcontactname));
}
- else _tcsncpy_s(newcontactname, L"_U_", _TRUNCATE);
+ else wcsncpy_s(newcontactname, L"_U_", _TRUNCATE);
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
if (M.GetByte("tabstatus", 1))
mir_sntprintf(tabtitle, L"%s (%s) ", newcontactname, szStatus);
@@ -618,13 +618,13 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact,
// it searches a container with "room" for the new tabs or otherwise creates
// a new (cloned) one.
-TContainerData* TSAPI FindMatchingContainer(const TCHAR *szName)
+TContainerData* TSAPI FindMatchingContainer(const wchar_t *szName)
{
int iMaxTabs = M.GetDword("maxtabs", 0);
- if (iMaxTabs > 0 && M.GetByte("limittabs", 0) && !_tcsncmp(szName, L"default", 6)) {
+ if (iMaxTabs > 0 && M.GetByte("limittabs", 0) && !wcsncmp(szName, L"default", 6)) {
// search a "default" with less than iMaxTabs opened...
for (TContainerData *p = pFirstContainer; p; p = p->pNext)
- if (!_tcsncmp(p->szName, L"default", 6) && p->iChilds < iMaxTabs)
+ if (!wcsncmp(p->szName, L"default", 6) && p->iChilds < iMaxTabs)
return p;
return NULL;
@@ -800,8 +800,8 @@ static int TSAPI SetupIconLibConfig()
{
int j = 2, version = 0;
- TCHAR szFilename[MAX_PATH];
- _tcsncpy(szFilename, L"icons\\tabsrmm_icons.dll", MAX_PATH);
+ wchar_t szFilename[MAX_PATH];
+ wcsncpy(szFilename, L"icons\\tabsrmm_icons.dll", MAX_PATH);
g_hIconDLL = LoadLibrary(szFilename);
if (g_hIconDLL == 0) {
CWarning::show(CWarning::WARN_ICONPACKMISSING, CWarning::CWF_NOALLOWHIDE | MB_ICONERROR | MB_OK);
@@ -815,7 +815,7 @@ static int TSAPI SetupIconLibConfig()
g_hIconDLL = 0;
SKINICONDESC sid = { 0 };
- sid.defaultFile.t = szFilename;
+ sid.defaultFile.w = szFilename;
sid.flags = SIDF_PATH_TCHAR;
for (int n = 0; n < _countof(ICONBLOCKS); n++) {
@@ -838,7 +838,7 @@ static int TSAPI SetupIconLibConfig()
sid.iDefaultIndex = -IDI_CLOCK;
IcoLib_AddIcon(&sid);
- _tcsncpy(szFilename, L"plugins\\tabsrmm.dll", MAX_PATH);
+ wcsncpy(szFilename, L"plugins\\tabsrmm.dll", MAX_PATH);
sid.pszName = "tabSRMM_overlay_disabled";
sid.description.a = LPGEN("Feature disabled (used as overlay)");
@@ -1068,7 +1068,7 @@ STDMETHODIMP CREOleCallback::GetInPlaceContext(LPOLEINPLACEFRAME*, LPOLEINPLACEU
STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE *lplpstg)
{
- TCHAR sztName[64];
+ wchar_t sztName[64];
mir_sntprintf(sztName, L"s%u", nextStgId++);
if (pictStg == NULL)
return STG_E_MEDIUMFULL;
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h
index e096eae9ec..b58246c00e 100644
--- a/plugins/TabSRMM/src/msgs.h
+++ b/plugins/TabSRMM/src/msgs.h
@@ -113,7 +113,7 @@
struct TTemplateSet {
BOOL valid; // all templates populated (may still contain crap.. so it's only half-assed safety :)
- TCHAR szTemplates[TMPL_ERRMSG + 1][TEMPLATE_LENGTH]; // the template strings
+ wchar_t szTemplates[TMPL_ERRMSG + 1][TEMPLATE_LENGTH]; // the template strings
char szSetName[20]; // everything in this world needs a name. so does this poor template set.
};
@@ -161,7 +161,7 @@ struct TContainerSettings
DWORD dwTransparency;
DWORD panelheight;
DWORD splitterPos;
- TCHAR szTitleFormat[TITLE_FORMATLEN + 2];
+ wchar_t szTitleFormat[TITLE_FORMATLEN + 2];
WORD avatarMode;
WORD ownAvatarMode;
WORD autoCloseSeconds;
@@ -174,7 +174,7 @@ struct TContainerData
{
TContainerData *pNext;
- TCHAR szName[CONTAINER_NAMELEN + 4]; // container name
+ wchar_t szName[CONTAINER_NAMELEN + 4]; // container name
HWND hwndActive; // active message window
HWND hwnd; // the container handle
int iTabIndex; // next tab id
@@ -198,7 +198,7 @@ struct TContainerData
DWORD dwFlashingStarted;
HWND hWndOptions;
BOOL bSizingLoop;
- TCHAR szRelThemeFile[MAX_PATH], szAbsThemeFile[MAX_PATH];
+ wchar_t szRelThemeFile[MAX_PATH], szAbsThemeFile[MAX_PATH];
TTemplateSet *ltr_templates, *rtl_templates;
HDC cachedDC;
HBITMAP cachedHBM, oldHBM;
@@ -239,11 +239,11 @@ struct TWindowData
DWORD dwFlagsEx;
MCONTACT hContact;
char *szProto;
- TCHAR szMyNickname[130];
- TCHAR szStatusBar[100];
+ wchar_t szMyNickname[130];
+ wchar_t szStatusBar[100];
StatusTextData *sbCustom;
- TCHAR newtitle[130]; // tab title...
- TCHAR szStatus[50];
+ wchar_t newtitle[130]; // tab title...
+ wchar_t szStatus[50];
WORD wStatus;
char *sendBuffer;
size_t iSendBufferSize;
@@ -287,14 +287,14 @@ struct TWindowData
int iOpenJobs;
int iCurrentQueueError;
MEVENT hFlashingEvent;
- TCHAR myUin[80];
+ wchar_t myUin[80];
int SendFormat;
MEVENT *hQueuedEvents;
int iNextQueuedEvent;
#define EVENT_QUEUE_SIZE 10
int iEventQueueSize;
LCID lcid;
- TCHAR lcID[10];
+ wchar_t lcID[10];
int iPanelAvatarX, iPanelAvatarY;
DWORD idle;
HWND hwndTip;
@@ -370,8 +370,8 @@ struct TIconDesc
struct TIconDescW
{
- TCHAR *szName;
- TCHAR *szDesc;
+ wchar_t *szName;
+ wchar_t *szDesc;
HICON *phIcon; // where the handle is saved...
INT_PTR uId; // icon ID
BOOL bForceSmall; // true: force 16x16
@@ -754,7 +754,7 @@ struct TLogIcon {
struct TCpTable {
UINT cpId;
- TCHAR *cpName;
+ wchar_t *cpName;
};
#define LOI_TYPE_FLAG 1
@@ -762,12 +762,12 @@ struct TCpTable {
struct TOptionListGroup {
LRESULT handle;
- TCHAR *szName;
+ wchar_t *szName;
};
struct TOptionListItem {
LRESULT handle;
- TCHAR *szName;
+ wchar_t *szName;
UINT id;
UINT uType;
UINT_PTR lParam;
@@ -797,10 +797,10 @@ struct SIDEBARITEM {
UINT uId;
DWORD dwFlags;
HICON *hIcon, *hIconPressed, *hIconHover;
- TCHAR *szName;
+ wchar_t *szName;
void(*pfnAction)(ButtonItem *item, HWND hwndDlg, TWindowData *dat, HWND hwndItem);
void(*pfnCallback)(ButtonItem *item, HWND hwndDlg, TWindowData *dat, HWND hwndItem);
- TCHAR *tszTip;
+ wchar_t *tszTip;
};
#define FONTF_BOLD 1
@@ -971,7 +971,7 @@ void CheckStatusIconClick(TWindowData *dat, POINT pt, const RECT &rc, int gap, i
struct SKINDESC
{
ULONG ulID; // resource id
- TCHAR tszName[30];
+ wchar_t tszName[30];
};
#define SKIN_NR_ELEMENTS 6
diff --git a/plugins/TabSRMM/src/nen.h b/plugins/TabSRMM/src/nen.h
index 04cd1a7a70..ac0ab76372 100644
--- a/plugins/TabSRMM/src/nen.h
+++ b/plugins/TabSRMM/src/nen.h
@@ -133,7 +133,7 @@ struct NEN_OPTIONS
struct EVENT_DATAT
{
MEVENT hEvent;
- TCHAR tszText[MAX_SECONDLINE + 2];
+ wchar_t tszText[MAX_SECONDLINE + 2];
DWORD timestamp;
};
diff --git a/plugins/TabSRMM/src/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp
index b743ef8868..d52a25f738 100644
--- a/plugins/TabSRMM/src/selectcontainer.cpp
+++ b/plugins/TabSRMM/src/selectcontainer.cpp
@@ -36,7 +36,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
switch (msg) {
case WM_INITDIALOG: {
- TCHAR szNewTitle[128];
+ wchar_t szNewTitle[128];
RECT rc, rcParent;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
@@ -65,7 +65,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK: {
- TCHAR szName[CONTAINER_NAMELEN];
+ wchar_t szName[CONTAINER_NAMELEN];
LRESULT iItem;
if ((iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETCURSEL, 0, 0)) != LB_ERR) {
@@ -81,12 +81,12 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
DestroyWindow(hwndDlg);
break;
case IDC_DELETECONTAINER: {
- TCHAR szName[CONTAINER_NAMELEN + 1];
+ wchar_t szName[CONTAINER_NAMELEN + 1];
LRESULT iItem;
if ((iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETCURSEL, 0, 0)) != LB_ERR) {
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szName);
- if (!_tcsncmp(szName, L"default", CONTAINER_NAMELEN) || !_tcsncmp(szName, TranslateT("Default container"), CONTAINER_NAMELEN))
+ if (!wcsncmp(szName, L"default", CONTAINER_NAMELEN) || !wcsncmp(szName, TranslateT("Default container"), CONTAINER_NAMELEN))
MessageBox(hwndDlg, TranslateT("You cannot delete the default container"), TranslateT("Error"), MB_OK | MB_ICONERROR);
else {
int iIndex = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETITEMDATA, (WPARAM)iItem, 0);
@@ -99,18 +99,18 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
break;
}
case IDC_RENAMECONTAINER: {
- TCHAR szNewName[CONTAINER_NAMELEN], szName[CONTAINER_NAMELEN + 1];
+ wchar_t szNewName[CONTAINER_NAMELEN], szName[CONTAINER_NAMELEN + 1];
int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_NEWCONTAINERNAME));
if (iLen) {
GetDlgItemText(hwndDlg, IDC_NEWCONTAINERNAME, szNewName, _countof(szNewName));
- if (!_tcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN) || !_tcsncmp(szNewName, TranslateT("Default container"), CONTAINER_NAMELEN)) {
+ if (!wcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN) || !wcsncmp(szNewName, TranslateT("Default container"), CONTAINER_NAMELEN)) {
MessageBox(hwndDlg, TranslateT("You cannot rename the default container"), TranslateT("Error"), MB_OK | MB_ICONERROR);
break;
}
int iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_FINDSTRING, (WPARAM)-1, (LPARAM)szNewName);
if (iItem != LB_ERR) {
- TCHAR szOldName[CONTAINER_NAMELEN + 1];
+ wchar_t szOldName[CONTAINER_NAMELEN + 1];
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szOldName);
if (mir_tstrlen(szOldName) == mir_tstrlen(szNewName)) {
MessageBox(0, TranslateT("This name is already in use"), TranslateT("Error"), MB_OK | MB_ICONERROR);
@@ -120,15 +120,15 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
}
if ((iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETCURSEL, 0, 0)) != LB_ERR) {
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szName);
- if (!_tcsncmp(szName, L"default", CONTAINER_NAMELEN) || !_tcsncmp(szName, TranslateT("Default container"), CONTAINER_NAMELEN))
+ if (!wcsncmp(szName, L"default", CONTAINER_NAMELEN) || !wcsncmp(szName, TranslateT("Default container"), CONTAINER_NAMELEN))
MessageBox(hwndDlg, TranslateT("You cannot rename the default container"), TranslateT("Error"), MB_OK | MB_ICONERROR);
else {
int iIndex = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETITEMDATA, (WPARAM)iItem, 0);
RenameContainer(iIndex, szNewName);
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_RESETCONTENT, 0, 0);
for (TContainerData *p = pFirstContainer; p; p = p->pNext) {
- if (!_tcsncmp(p->szName, szName, CONTAINER_NAMELEN) && mir_tstrlen(p->szName) == mir_tstrlen(szName)) {
- _tcsncpy(p->szName, szNewName, CONTAINER_NAMELEN);
+ if (!wcsncmp(p->szName, szName, CONTAINER_NAMELEN) && mir_tstrlen(p->szName) == mir_tstrlen(szName)) {
+ wcsncpy(p->szName, szNewName, CONTAINER_NAMELEN);
SendMessage(p->hwnd, DM_CONFIGURECONTAINER, 0, 0);
}
}
@@ -140,15 +140,15 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
break;
}
case IDC_CREATENEW: {
- TCHAR szNewName[CONTAINER_NAMELEN], szName[CONTAINER_NAMELEN + 1];
+ wchar_t szNewName[CONTAINER_NAMELEN], szName[CONTAINER_NAMELEN + 1];
int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_NEWCONTAINER));
if (iLen) {
GetDlgItemText(hwndDlg, IDC_NEWCONTAINER, szNewName, _countof(szNewName));
int iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_FINDSTRING, (WPARAM)-1, (LPARAM)szNewName);
- if (iItem != LB_ERR || !_tcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
+ if (iItem != LB_ERR || !wcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szName);
- if (mir_tstrlen(szName) == mir_tstrlen(szNewName) || !_tcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
+ if (mir_tstrlen(szName) == mir_tstrlen(szNewName) || !wcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
MessageBox(0, TranslateT("This name is already in use"), TranslateT("Error"), MB_OK | MB_ICONERROR);
SetFocus(GetDlgItem(hwndDlg, IDC_NEWCONTAINER));
break;
@@ -182,7 +182,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
if (db_get_ts(NULL, szKey, szValue, &dbv))
break; // end of list
if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR) {
- if (_tcsncmp(dbv.ptszVal, L"**mir_free**", CONTAINER_NAMELEN)) {
+ if (wcsncmp(dbv.ptszVal, L"**mir_free**", CONTAINER_NAMELEN)) {
iItemNew = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_ADDSTRING, 0, (LPARAM)(!mir_tstrcmp(dbv.ptszVal, L"default") ?
TranslateT("Default container") : dbv.ptszVal));
if (iItemNew != LB_ERR)
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp
index 1c74331fa1..e52fb5adb0 100644
--- a/plugins/TabSRMM/src/sendlater.cpp
+++ b/plugins/TabSRMM/src/sendlater.cpp
@@ -116,12 +116,12 @@ CSendLaterJob::~CSendLaterJob()
* show a popup notification, unless they are disabled
*/
if (PluginConfig.g_bPopupAvail && fShowPopup) {
- TCHAR *tszName = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *tszName = pcli->pfnGetContactDisplayName(hContact, 0);
POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact;
- _tcsncpy_s(ppd.lptzContactName, (tszName ? tszName : TranslateT("'(Unknown contact)'")), _TRUNCATE);
- TCHAR *msgPreview = Utils::GetPreviewWithEllipsis(reinterpret_cast<TCHAR *>(&pBuf[mir_strlen((char *)pBuf) + 1]), 100);
+ wcsncpy_s(ppd.lptzContactName, (tszName ? tszName : TranslateT("'(Unknown contact)'")), _TRUNCATE);
+ wchar_t *msgPreview = Utils::GetPreviewWithEllipsis(reinterpret_cast<wchar_t *>(&pBuf[mir_strlen((char *)pBuf) + 1]), 100);
if (fSuccess) {
mir_sntprintf(ppd.lptzText, TranslateT("A send later job completed successfully.\nThe original message: %s"),
msgPreview);
@@ -479,7 +479,7 @@ void CSendLater::qMgrUpdate(bool fReEnable)
}
}
-LRESULT CSendLater::qMgrAddFilter(const MCONTACT hContact, const TCHAR* tszNick)
+LRESULT CSendLater::qMgrAddFilter(const MCONTACT hContact, const wchar_t* tszNick)
{
LRESULT lr = ::SendMessage(m_hwndFilter, CB_FINDSTRING, 0, LPARAM(tszNick));
if (lr == CB_ERR) {
@@ -495,7 +495,7 @@ LRESULT CSendLater::qMgrAddFilter(const MCONTACT hContact, const TCHAR* tszNick)
// filters by m_hFilter (contact handle)
void CSendLater::qMgrFillList(bool fClear)
{
- TCHAR *formatTime = L"%Y.%m.%d - %H:%M";
+ wchar_t *formatTime = L"%Y.%m.%d - %H:%M";
if (fClear) {
::SendMessage(m_hwndList, LVM_DELETEALLITEMS, 0, 0);
@@ -515,14 +515,14 @@ void CSendLater::qMgrFillList(bool fClear)
CSendLaterJob *p = m_sendLaterJobList[i];
CContactCache *c = CContactCache::getContactCache(p->hContact);
if (c) {
- const TCHAR *tszNick = c->getNick();
+ const wchar_t *tszNick = c->getNick();
if (m_hFilter && m_hFilter != p->hContact) {
qMgrAddFilter(c->getContact(), tszNick);
continue;
}
lvItem.mask = LVIF_TEXT | LVIF_PARAM;
- TCHAR tszBuf[255];
+ wchar_t tszBuf[255];
mir_sntprintf(tszBuf, L"%s [%s]", tszNick, c->getRealAccount());
lvItem.pszText = tszBuf;
lvItem.cchTextMax = _countof(tszBuf);
@@ -533,22 +533,22 @@ void CSendLater::qMgrFillList(bool fClear)
qMgrAddFilter(c->getContact(), tszNick);
lvItem.mask = LVIF_TEXT;
- TCHAR tszTimestamp[30];
- _tcsftime(tszTimestamp, 30, formatTime, _localtime32((__time32_t *)&p->created));
+ wchar_t tszTimestamp[30];
+ wcsftime(tszTimestamp, 30, formatTime, _localtime32((__time32_t *)&p->created));
tszTimestamp[29] = 0;
lvItem.pszText = tszTimestamp;
lvItem.iSubItem = 1;
::SendMessage(m_hwndList, LVM_SETITEM, 0, LPARAM(&lvItem));
- TCHAR *msg = mir_utf8decodeT(p->sendBuffer);
- TCHAR *preview = Utils::GetPreviewWithEllipsis(msg, 255);
+ wchar_t *msg = mir_utf8decodeT(p->sendBuffer);
+ wchar_t *preview = Utils::GetPreviewWithEllipsis(msg, 255);
lvItem.pszText = preview;
lvItem.iSubItem = 2;
::SendMessage(m_hwndList, LVM_SETITEM, 0, LPARAM(&lvItem));
mir_free(preview);
mir_free(msg);
- const TCHAR *tszStatusText = 0;
+ const wchar_t *tszStatusText = 0;
if (p->fFailed) {
tszStatusText = p->bCode == CSendLaterJob::JOB_REMOVABLE ?
TranslateT("Removed") : TranslateT("Failed");
@@ -574,7 +574,7 @@ void CSendLater::qMgrFillList(bool fClear)
if (p->bCode)
bCode = p->bCode;
- TCHAR tszStatus[20];
+ wchar_t tszStatus[20];
mir_sntprintf(tszStatus, L"X/%s[%c] (%d)", tszStatusText, bCode, p->iSendCount);
tszStatus[0] = p->szId[0];
lvItem.pszText = tszStatus;
@@ -582,9 +582,9 @@ void CSendLater::qMgrFillList(bool fClear)
::SendMessage(m_hwndList, LVM_SETITEM, 0, LPARAM(&lvItem));
if (p->lastSent == 0)
- _tcsncpy_s(tszTimestamp, L"Never", _TRUNCATE);
+ wcsncpy_s(tszTimestamp, L"Never", _TRUNCATE);
else {
- _tcsftime(tszTimestamp, 30, formatTime, _localtime32((__time32_t *)&p->lastSent));
+ wcsftime(tszTimestamp, 30, formatTime, _localtime32((__time32_t *)&p->lastSent));
tszTimestamp[29] = 0;
}
lvItem.pszText = tszTimestamp;
@@ -807,7 +807,7 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
job->writeFlags();
break;
case ID_QUEUEMANAGER_COPYMESSAGETOCLIPBOARD:
- Utils::CopyToClipBoard((TCHAR*)ptrT(mir_utf8decodeT(job->sendBuffer)), m_hwndDlg);
+ Utils::CopyToClipBoard((wchar_t*)ptrT(mir_utf8decodeT(job->sendBuffer)), m_hwndDlg);
break;
case ID_QUEUEMANAGER_RESETSELECTED:
if (job->bCode == CSendLaterJob::JOB_DEFERRED) {
diff --git a/plugins/TabSRMM/src/sendlater.h b/plugins/TabSRMM/src/sendlater.h
index f187eb1581..76ab17e89f 100644
--- a/plugins/TabSRMM/src/sendlater.h
+++ b/plugins/TabSRMM/src/sendlater.h
@@ -124,7 +124,7 @@ private:
void qMgrFillList(bool fClear = true);
void qMgrSetupColumns();
void qMgrSaveColumns();
- LRESULT qMgrAddFilter(const MCONTACT hContact, const TCHAR* tszNick);
+ LRESULT qMgrAddFilter(const MCONTACT hContact, const wchar_t* tszNick);
LIST<void> m_sendLaterContactList;
LIST<CSendLaterJob> m_sendLaterJobList;
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp
index d04b2e621b..b7a6f80f5a 100644
--- a/plugins/TabSRMM/src/sendqueue.cpp
+++ b/plugins/TabSRMM/src/sendqueue.cpp
@@ -49,10 +49,10 @@ void SendQueue::handleError(TWindowData *dat, const int iEntry) const
{
if (!dat) return;
- TCHAR szErrorMsg[500];
+ wchar_t szErrorMsg[500];
dat->iCurrentQueueError = iEntry;
- _tcsncpy_s(szErrorMsg, m_jobs[iEntry].szErrorMsg, _TRUNCATE);
+ wcsncpy_s(szErrorMsg, m_jobs[iEntry].szErrorMsg, _TRUNCATE);
logError(dat, iEntry, szErrorMsg);
recallFailed(dat, iEntry);
showErrorControls(dat, TRUE);
@@ -218,7 +218,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry)
}
if (iSendLength >= iMinLength) {
- TCHAR tszError[256];
+ wchar_t tszError[256];
mir_sntprintf(tszError, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), iMinLength);
::SendMessage(dat->hwnd, DM_ACTIVATETOOLTIP, IDC_MESSAGE, LPARAM(tszError));
sendQueue->clearJob(iEntry);
@@ -270,7 +270,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry)
m_jobs[iEntry].iStatus = SQ_INPROGRESS;
m_jobs[iEntry].iAcksNeeded = 1;
if (dat->sendMode & SMODE_SENDLATER) {
- TCHAR tszError[256];
+ wchar_t tszError[256];
size_t iSendLength = getSendLength(iEntry);
if (iSendLength >= dat->nMax) {
@@ -344,7 +344,7 @@ void SendQueue::checkQueue(const TWindowData *dat) const
// logs an error message to the message window.Optionally, appends the original message
// from the given sendJob (queue index)
-void SendQueue::logError(const TWindowData *dat, int iSendJobIndex, const TCHAR *szErrMsg) const
+void SendQueue::logError(const TWindowData *dat, int iSendJobIndex, const wchar_t *szErrMsg) const
{
if (dat == 0)
return;
@@ -473,8 +473,8 @@ void SendQueue::NotifyDeliveryFailure(const TWindowData *dat)
POPUPDATAT ppd = { 0 };
ppd.lchContact = dat->hContact;
- _tcsncpy_s(ppd.lptzContactName, dat->cache->getNick(), _TRUNCATE);
- _tcsncpy_s(ppd.lptzText, TranslateT("A message delivery has failed.\nClick to open the message window."), _TRUNCATE);
+ wcsncpy_s(ppd.lptzContactName, dat->cache->getNick(), _TRUNCATE);
+ wcsncpy_s(ppd.lptzText, TranslateT("A message delivery has failed.\nClick to open the message window."), _TRUNCATE);
if (!(BOOL)M.GetByte(MODULE, OPT_COLDEFAULT_ERR, TRUE)) {
ppd.colorText = (COLORREF)M.GetDword(MODULE, OPT_COLTEXT_ERR, DEFAULT_COLTEXT);
@@ -543,7 +543,7 @@ int SendQueue::ackMessage(TWindowData *dat, WPARAM wParam, LPARAM lParam)
if (!nen_options.iNoSounds && !(m_pContainer->dwFlags & CNT_NOSOUND))
SkinPlaySound("SendError");
- TCHAR *szAckMsg = mir_a2t((char *)ack->lParam);
+ wchar_t *szAckMsg = mir_a2t((char *)ack->lParam);
mir_sntprintf(job.szErrorMsg, TranslateT("Delivery failure: %s"), szAckMsg);
job.iStatus = SQ_ERROR;
mir_free(szAckMsg);
@@ -642,7 +642,7 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, b
{
bool fAvail = sendLater->isAvail();
- const TCHAR *szNote = 0;
+ const wchar_t *szNote = 0;
if (fIsSendLater && dat) {
if (fAvail)
@@ -677,12 +677,12 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, b
if (iJobIndex >= 0 && iJobIndex < NR_SENDJOBS) {
SendJob *job = &m_jobs[iJobIndex];
char szKeyName[20];
- TCHAR tszHeader[150];
+ wchar_t tszHeader[150];
if (fIsSendLater) {
time_t now = time(0);
- TCHAR tszTimestamp[30];
- _tcsftime(tszTimestamp, _countof(tszTimestamp), L"%Y.%m.%d - %H:%M", _localtime32((__time32_t *)&now));
+ wchar_t tszTimestamp[30];
+ wcsftime(tszTimestamp, _countof(tszTimestamp), L"%Y.%m.%d - %H:%M", _localtime32((__time32_t *)&now));
mir_snprintf(szKeyName, "S%d", now);
mir_sntprintf(tszHeader, TranslateT("\n(Sent delayed. Original timestamp %s)"), tszTimestamp);
}
diff --git a/plugins/TabSRMM/src/sendqueue.h b/plugins/TabSRMM/src/sendqueue.h
index c6b736638b..48b92a8e29 100644
--- a/plugins/TabSRMM/src/sendqueue.h
+++ b/plugins/TabSRMM/src/sendqueue.h
@@ -50,7 +50,7 @@ struct SendJob
MCONTACT hContact;
HWND hOwnerWnd;
unsigned iStatus;
- TCHAR szErrorMsg[128];
+ wchar_t szErrorMsg[128];
DWORD dwFlags;
int iAcksNeeded;
HANDLE hEventSplit;
@@ -91,7 +91,7 @@ public:
int sendQueued(TWindowData *dat, const int iEntry);
size_t getSendLength(const int iEntry);
void checkQueue(const TWindowData *dat) const;
- void logError(const TWindowData *dat, int iSendJobIndex, const TCHAR *szErrMsg) const;
+ void logError(const TWindowData *dat, int iSendJobIndex, const wchar_t *szErrMsg) const;
void recallFailed(const TWindowData *dat, int iEntry) const;
void showErrorControls(TWindowData *dat, const int showCmd) const;
int ackMessage(TWindowData *dat, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp
index dfce840e74..908b4b59d0 100644
--- a/plugins/TabSRMM/src/sidebar.cpp
+++ b/plugins/TabSRMM/src/sidebar.cpp
@@ -30,7 +30,7 @@
TSideBarLayout CSideBar::m_layouts[CSideBar::NR_LAYOUTS] = {
{
- LPGENT("Like tabs, vertical text orientation"),
+ LPGENW("Like tabs, vertical text orientation"),
26, 30,
SIDEBARLAYOUT_DYNHEIGHT | SIDEBARLAYOUT_VERTICALORIENTATION,
CSideBar::m_DefaultContentRenderer,
@@ -40,7 +40,7 @@ TSideBarLayout CSideBar::m_layouts[CSideBar::NR_LAYOUTS] = {
SIDEBARLAYOUT_VERTICAL
},
{
- LPGENT("Compact layout, horizontal buttons"),
+ LPGENW("Compact layout, horizontal buttons"),
100, 24,
0,
CSideBar::m_DefaultContentRenderer,
@@ -50,7 +50,7 @@ TSideBarLayout CSideBar::m_layouts[CSideBar::NR_LAYOUTS] = {
SIDEBARLAYOUT_NORMAL
},
{
- LPGENT("Advanced layout with avatars"),
+ LPGENW("Advanced layout with avatars"),
140, 40,
SIDEBARLAYOUT_NOCLOSEBUTTONS,
CSideBar::m_AdvancedContentRenderer,
@@ -60,7 +60,7 @@ TSideBarLayout CSideBar::m_layouts[CSideBar::NR_LAYOUTS] = {
SIDEBARLAYOUT_NORMAL
},
{
- LPGENT("Advanced with avatars, vertical orientation"),
+ LPGENW("Advanced with avatars, vertical orientation"),
40, 40,
SIDEBARLAYOUT_DYNHEIGHT | SIDEBARLAYOUT_VERTICALORIENTATION | SIDEBARLAYOUT_NOCLOSEBUTTONS,
CSideBar::m_AdvancedContentRenderer,
@@ -140,11 +140,11 @@ const SIZE& CSideBarButton::measureItem()
m_sideBarLayout->pfnMeasureItem(this); // use the current layout's function, if available, else use default
else {
HDC dc = ::GetDC(m_hwnd);
- TCHAR tszLabel[255];
+ wchar_t tszLabel[255];
HFONT oldFont = reinterpret_cast<HFONT>(::SelectObject(dc, ::GetStockObject(DEFAULT_GUI_FONT)));
- _tcsncpy_s(tszLabel, m_dat->newtitle, _TRUNCATE);
+ wcsncpy_s(tszLabel, m_dat->newtitle, _TRUNCATE);
::GetTextExtentPoint32(dc, tszLabel, (int)mir_tstrlen(tszLabel), &sz);
sz.cx += 28;
diff --git a/plugins/TabSRMM/src/sidebar.h b/plugins/TabSRMM/src/sidebar.h
index 35d147f96a..4f848f289b 100644
--- a/plugins/TabSRMM/src/sidebar.h
+++ b/plugins/TabSRMM/src/sidebar.h
@@ -38,7 +38,7 @@ struct TSideBarNotify
struct TSideBarLayout
{
- TCHAR szName[50]; // everything wants a name...
+ wchar_t szName[50]; // everything wants a name...
LONG width; // width of the switchbar element (a single button)
LONG height; // height of a single switchbar element
DWORD dwFlags; // flags, obviously :)
diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp
index 9250052093..78ec8e47da 100644
--- a/plugins/TabSRMM/src/srmm.cpp
+++ b/plugins/TabSRMM/src/srmm.cpp
@@ -141,10 +141,10 @@ int _DebugTraceW(const wchar_t *fmt, ...)
* can display the message either as systray notification (baloon popup) or using the
* popup plugin.
*/
-int _DebugPopup(MCONTACT hContact, const TCHAR *fmt, ...)
+int _DebugPopup(MCONTACT hContact, const wchar_t *fmt, ...)
{
va_list va;
- TCHAR debug[1024];
+ wchar_t debug[1024];
int ibsize = 1023;
va_start(va, fmt);
@@ -152,7 +152,7 @@ int _DebugPopup(MCONTACT hContact, const TCHAR *fmt, ...)
if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) {
MIRANDASYSTRAYNOTIFY tn;
- TCHAR szTitle[128];
+ wchar_t szTitle[128];
mir_sntprintf(szTitle, TranslateT("TabSRMM message (%s)"),
(hContact != 0) ? pcli->pfnGetContactDisplayName(hContact, 0) : TranslateT("Global"));
diff --git a/plugins/TabSRMM/src/stdafx.h b/plugins/TabSRMM/src/stdafx.h
index d38bfa6cf6..39383d1ed6 100644
--- a/plugins/TabSRMM/src/stdafx.h
+++ b/plugins/TabSRMM/src/stdafx.h
@@ -233,7 +233,7 @@ extern HINSTANCE hinstance;
extern BOOL g_bIMGtagButton;
extern HANDLE hHookToolBarLoadedEvt;
extern TLogIcon msgLogIcons[NR_LOGICONS * 3];
-extern const TCHAR *pszIDCSAVE_save, *pszIDCSAVE_close;
+extern const wchar_t *pszIDCSAVE_save, *pszIDCSAVE_close;
extern char *TemplateNames[];
extern HANDLE hUserPrefsWindowList;
extern TCpTable cpTable[];
@@ -246,7 +246,7 @@ extern CREOleCallback2 reOleCallback2;
int LoadSendRecvMessageModule(void);
int SplitmsgShutdown(void);
-void LogErrorMessage(HWND hwndDlg, TWindowData *dat, int i, TCHAR *szMsg);
+void LogErrorMessage(HWND hwndDlg, TWindowData *dat, int i, wchar_t *szMsg);
int Chat_Load(), Chat_Unload();
void FreeLogFonts();
void ImageDataInsertBitmap(IRichEditOle *ole, HBITMAP hBm);
diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp
index 0ac8a44021..224053c4c8 100644
--- a/plugins/TabSRMM/src/taskbar.cpp
+++ b/plugins/TabSRMM/src/taskbar.cpp
@@ -515,7 +515,7 @@ void CProxyWindow::Invalidate() const
* update the thumb title string (usually, the nickname)
* @param tszTitle: new title string
*/
-void CProxyWindow::updateTitle(const TCHAR *tszTitle) const
+void CProxyWindow::updateTitle(const wchar_t *tszTitle) const
{
if (m_hwndProxy && tszTitle)
::SetWindowText(m_hwndProxy, tszTitle);
diff --git a/plugins/TabSRMM/src/taskbar.h b/plugins/TabSRMM/src/taskbar.h
index 8a66d5a8ba..1d97f22a39 100644
--- a/plugins/TabSRMM/src/taskbar.h
+++ b/plugins/TabSRMM/src/taskbar.h
@@ -101,7 +101,7 @@ public:
~CProxyWindow();
void updateIcon(const HICON hIcon) const;
- void updateTitle(const TCHAR *tszTitle) const;
+ void updateTitle(const wchar_t *tszTitle) const;
void setBigIcon(const HICON hIcon, bool fInvalidate = true);
void setOverlayIcon(const HICON hIcon, bool fInvalidate = true);
void activateTab() const;
@@ -181,7 +181,7 @@ public:
void unRegisterTab(const HWND hwndTab) const;
void SetTabActive(const HWND hwndTab, const HWND hwndGroup) const;
- //const TCHAR* getFileNameFromWindow (const HWND hWnd);
+ //const wchar_t* getFileNameFromWindow (const HWND hWnd);
private:
ITaskbarList3 *m_pTaskbarInterface;
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp
index 64f4d77917..9ad2b93557 100644
--- a/plugins/TabSRMM/src/templates.cpp
+++ b/plugins/TabSRMM/src/templates.cpp
@@ -84,7 +84,7 @@ static void LoadTemplatesFrom(TTemplateSet *tSet, MCONTACT hContact, int rtl)
if (db_get_ts(hContact, rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, TemplateNames[i], &dbv))
continue;
if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR)
- _tcsncpy_s(tSet->szTemplates[i], dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(tSet->szTemplates[i], dbv.ptszVal, _TRUNCATE);
db_free(&dbv);
}
}
@@ -247,10 +247,10 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
break;
case IDC_SAVETEMPLATE:
{
- TCHAR newTemplate[TEMPLATE_LENGTH + 2];
+ wchar_t newTemplate[TEMPLATE_LENGTH + 2];
GetDlgItemText(hwndDlg, IDC_EDITTEMPLATE, newTemplate, _countof(newTemplate));
- memcpy(tSet->szTemplates[teInfo->inEdit], newTemplate, sizeof(TCHAR) * TEMPLATE_LENGTH);
+ memcpy(tSet->szTemplates[teInfo->inEdit], newTemplate, sizeof(wchar_t) * TEMPLATE_LENGTH);
teInfo->changed = FALSE;
teInfo->updateInfo[teInfo->inEdit] = FALSE;
Utils::enableDlgControl(hwndDlg, IDC_SAVETEMPLATE, FALSE);
@@ -282,7 +282,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
teInfo->changed = FALSE;
teInfo->updateInfo[teInfo->inEdit] = FALSE;
teInfo->selchanging = TRUE;
- memcpy(tSet->szTemplates[teInfo->inEdit], LTR_Default.szTemplates[teInfo->inEdit], sizeof(TCHAR) * TEMPLATE_LENGTH);
+ memcpy(tSet->szTemplates[teInfo->inEdit], LTR_Default.szTemplates[teInfo->inEdit], sizeof(wchar_t) * TEMPLATE_LENGTH);
SetDlgItemText(hwndDlg, IDC_EDITTEMPLATE, tSet->szTemplates[teInfo->inEdit]);
db_unset(teInfo->hContact, teInfo->rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, TemplateNames[teInfo->inEdit]);
SetFocus(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE));
@@ -334,10 +334,10 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case DM_UPDATETEMPLATEPREVIEW: {
DBEVENTINFO dbei = { 0 };
int iIndex = SendDlgItemMessage(hwndDlg, IDC_TEMPLATELIST, LB_GETCURSEL, 0, 0);
- TCHAR szTemp[TEMPLATE_LENGTH + 2];
+ wchar_t szTemp[TEMPLATE_LENGTH + 2];
if (teInfo->changed) {
- memcpy(szTemp, tSet->szTemplates[teInfo->inEdit], (TEMPLATE_LENGTH * sizeof(TCHAR)));
+ memcpy(szTemp, tSet->szTemplates[teInfo->inEdit], (TEMPLATE_LENGTH * sizeof(wchar_t)));
GetDlgItemText(hwndDlg, IDC_EDITTEMPLATE, tSet->szTemplates[teInfo->inEdit], TEMPLATE_LENGTH);
}
dbei.szModule = dat->szProto;
@@ -361,7 +361,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
StreamInEvents(hwndDlg, 0, 1, 0, &dbei);
SendDlgItemMessage(hwndDlg, IDC_PREVIEW, EM_SETSEL, -1, -1);
if (teInfo->changed)
- memcpy(tSet->szTemplates[teInfo->inEdit], szTemp, TEMPLATE_LENGTH * sizeof(TCHAR));
+ memcpy(tSet->szTemplates[teInfo->inEdit], szTemp, TEMPLATE_LENGTH * sizeof(wchar_t));
break;
}
case WM_DESTROY:
diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp
index 204a1fa8f2..96cbe340d7 100644
--- a/plugins/TabSRMM/src/themeio.cpp
+++ b/plugins/TabSRMM/src/themeio.cpp
@@ -166,7 +166,7 @@ static struct _tagFontBlocks {
NULL, 0, 0, NULL
};
-int TSAPI CheckThemeVersion(const TCHAR *szIniFilename)
+int TSAPI CheckThemeVersion(const wchar_t *szIniFilename)
{
int cookie = GetPrivateProfileInt(L"TabSRMM Theme", L"Cookie", 0, szIniFilename);
int version = GetPrivateProfileInt(L"TabSRMM Theme", L"Version", 0, szIniFilename);
@@ -176,7 +176,7 @@ int TSAPI CheckThemeVersion(const TCHAR *szIniFilename)
return 0;
}
-void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, TWindowData *dat)
+void TSAPI WriteThemeToINI(const wchar_t *szIniFilenameT, TWindowData *dat)
{
int i, n = 0;
DBVARIANT dbv;
@@ -244,7 +244,7 @@ void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, TWindowData *dat)
mir_free(szIniFilename);
}
-void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, int noAdvanced, DWORD dwFlags)
+void TSAPI ReadThemeFromINI(const wchar_t *szIniFilenameT, TContainerData *dat, int noAdvanced, DWORD dwFlags)
{
char szBuf[512], szTemp[100], szAppname[100];
int i, n = 0;
@@ -385,9 +385,9 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in
db_set_utf(NULL, TEMPLATES_MODULE, TemplateNames[i], szTemplateBuffer);
decoded = mir_utf8decodeW(szTemplateBuffer);
if (dat == 0)
- _tcsncpy_s(LTR_Active.szTemplates[i], decoded, _TRUNCATE);
+ wcsncpy_s(LTR_Active.szTemplates[i], decoded, _TRUNCATE);
else
- _tcsncpy_s(dat->ltr_templates->szTemplates[i], decoded, _TRUNCATE);
+ wcsncpy_s(dat->ltr_templates->szTemplates[i], decoded, _TRUNCATE);
mir_free(decoded);
}
@@ -398,9 +398,9 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in
db_set_utf(NULL, RTLTEMPLATES_MODULE, TemplateNames[i], szTemplateBuffer);
decoded = mir_utf8decodeW(szTemplateBuffer);
if (dat == 0)
- _tcsncpy_s(RTL_Active.szTemplates[i], decoded, _TRUNCATE);
+ wcsncpy_s(RTL_Active.szTemplates[i], decoded, _TRUNCATE);
else
- _tcsncpy_s(dat->rtl_templates->szTemplates[i], decoded, _TRUNCATE);
+ wcsncpy_s(dat->rtl_templates->szTemplates[i], decoded, _TRUNCATE);
mir_free(decoded);
}
}
@@ -414,17 +414,17 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in
* iMode = 0 - GetOpenFilename, otherwise, GetSaveAs...
*/
-const TCHAR* TSAPI GetThemeFileName(int iMode)
+const wchar_t* TSAPI GetThemeFileName(int iMode)
{
- static TCHAR szFilename[MAX_PATH];
+ static wchar_t szFilename[MAX_PATH];
OPENFILENAME ofn = { 0 };
- TCHAR szInitialDir[MAX_PATH];
+ wchar_t szInitialDir[MAX_PATH];
- _tcsncpy_s(szInitialDir, M.getSkinPath(), _TRUNCATE);
+ wcsncpy_s(szInitialDir, M.getSkinPath(), _TRUNCATE);
szFilename[0] = 0;
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
mir_sntprintf(filter, L"%s%c*.tabsrmm%c%c", TranslateT("TabSRMM themes"), 0, 0, 0);
ofn.lpstrFilter = filter;
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp
index 48c0a11bce..740f69c74b 100644
--- a/plugins/TabSRMM/src/themes.cpp
+++ b/plugins/TabSRMM/src/themes.cpp
@@ -108,10 +108,10 @@ AeroEffect *CSkin::m_pCurrentAeroEffect = 0;
AeroEffect CSkin::m_aeroEffects[AERO_EFFECT_LAST] = {
{
- LPGENT("No effect"), 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0
+ LPGENW("No effect"), 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0
},
{
- LPGENT("Milky Glass"),
+ LPGENW("Milky Glass"),
0xf5f5f5, /* base color */
0xaaaaaa, /* gradient color */
70, /* base alpha */
@@ -126,7 +126,7 @@ AeroEffect CSkin::m_aeroEffects[AERO_EFFECT_LAST] = {
AeroEffectCallback_Milk /* callback function to render the effect */
},
{
- LPGENT("Carbon"),
+ LPGENW("Carbon"),
0xf0f0f0,
0x000000,
75,
@@ -141,7 +141,7 @@ AeroEffect CSkin::m_aeroEffects[AERO_EFFECT_LAST] = {
AeroEffectCallback_Carbon
},
{
- LPGENT("Semi transparent, custom colors"),
+ LPGENW("Semi transparent, custom colors"),
0xffffff,
0x444444,
60,
@@ -156,7 +156,7 @@ AeroEffect CSkin::m_aeroEffects[AERO_EFFECT_LAST] = {
AeroEffectCallback_Solid
},
{
- LPGENT("Silver shadow"),
+ LPGENW("Silver shadow"),
0xffffff,
0xa0a0a0,
80,
@@ -171,7 +171,7 @@ AeroEffect CSkin::m_aeroEffects[AERO_EFFECT_LAST] = {
AeroEffectCallback_Solid
},
{
- LPGENT("Custom (use own gradient colors)"),
+ LPGENW("Custom (use own gradient colors)"),
0xffffff,
0xa0a0a0,
80,
@@ -732,7 +732,7 @@ static CSkinItem StatusItem_Default = {
static struct
{
- TCHAR *szIniKey, *szIniName;
+ wchar_t *szIniKey, *szIniName;
char *szSetting;
unsigned int size;
int defaultval;
@@ -750,7 +750,7 @@ static struct
NULL, NULL, NULL, 0, 0
};
-void CImageItem::Create(const TCHAR *szImageFile)
+void CImageItem::Create(const wchar_t *szImageFile)
{
HBITMAP hbm = LoadPNG(szImageFile);
BITMAP bm;
@@ -795,15 +795,15 @@ void CImageItem::Create(const TCHAR *szImageFile)
// @return char*: full path and filename to the .png image which represents this image item.
// caller MUST delete it.
-TCHAR* CImageItem::Read(const TCHAR *szFilename)
+wchar_t* CImageItem::Read(const wchar_t *szFilename)
{
- TCHAR buffer[501];
- TCHAR szDrive[MAX_PATH], szPath[MAX_PATH];
- TCHAR *szFinalName = 0;
+ wchar_t buffer[501];
+ wchar_t szDrive[MAX_PATH], szPath[MAX_PATH];
+ wchar_t *szFinalName = 0;
GetPrivateProfileString(m_szName, L"Glyph", L"None", buffer, 500, szFilename);
if (mir_tstrcmp(buffer, L"None")) {
- _stscanf(buffer, L"%d,%d,%d,%d", &m_glyphMetrics[0], &m_glyphMetrics[1],
+ swscanf(buffer, L"%d,%d,%d,%d", &m_glyphMetrics[0], &m_glyphMetrics[1],
&m_glyphMetrics[2], &m_glyphMetrics[3]);
if (m_glyphMetrics[2] > m_glyphMetrics[0] && m_glyphMetrics[3] > m_glyphMetrics[1]) {
m_dwFlags |= IMAGE_GLYPH;
@@ -814,10 +814,10 @@ TCHAR* CImageItem::Read(const TCHAR *szFilename)
GetPrivateProfileString(m_szName, L"Image", L"None", buffer, 500, szFilename);
if (mir_tstrcmp(buffer, L"None") || m_dwFlags & IMAGE_GLYPH) {
- szFinalName = new TCHAR[MAX_PATH];
+ szFinalName = new wchar_t[MAX_PATH];
//strncpy(m_szName, &m_szName[1], sizeof(m_szName));
//m_szName[sizeof(m_szName) - 1] = 0;
- _tsplitpath(szFilename, szDrive, szPath, NULL, NULL);
+ _wsplitpath(szFilename, szDrive, szPath, NULL, NULL);
mir_sntprintf(szFinalName, MAX_PATH, L"%s\\%s%s", szDrive, szPath, buffer);
if (!PathFileExists(szFinalName)) {
delete[] szFinalName;
@@ -999,7 +999,7 @@ void CImageItem::Colorize(HBITMAP hBitmap, BYTE dr, BYTE dg, BYTE db, BYTE alpha
/////////////////////////////////////////////////////////////////////////////////////////
// load PNG image using core service(advaimg)
-HBITMAP TSAPI CImageItem::LoadPNG(const TCHAR *szFilename)
+HBITMAP TSAPI CImageItem::LoadPNG(const wchar_t *szFilename)
{
HBITMAP hBitmap = 0;
hBitmap = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)szFilename, IMGL_TCHAR);
@@ -1195,19 +1195,19 @@ void CSkin::Unload()
m_DisableScrollbars = M.GetByte("disableVScroll", 0) ? true : false;
}
-void CSkin::LoadIcon(const TCHAR *szSection, const TCHAR *name, HICON &hIcon)
+void CSkin::LoadIcon(const wchar_t *szSection, const wchar_t *name, HICON &hIcon)
{
if (hIcon != 0)
DestroyIcon(hIcon);
- TCHAR buffer[512];
+ wchar_t buffer[512];
GetPrivateProfileString(szSection, name, L"none", buffer, 250, m_tszFileName);
buffer[500] = 0;
if (mir_tstrcmpi(buffer, L"none")) {
- TCHAR szDrive[MAX_PATH], szDir[MAX_PATH], szImagePath[MAX_PATH];
+ wchar_t szDrive[MAX_PATH], szDir[MAX_PATH], szImagePath[MAX_PATH];
- _tsplitpath(m_tszFileName, szDrive, szDir, NULL, NULL);
+ _wsplitpath(m_tszFileName, szDrive, szDir, NULL, NULL);
mir_sntprintf(szImagePath, L"%s\\%s\\%s", szDrive, szDir, buffer);
hIcon = (HICON)LoadImage(0, szImagePath, IMAGE_ICON, 16, 16, LR_LOADFROMFILE);
}
@@ -1224,10 +1224,10 @@ void CSkin::LoadIcon(const TCHAR *szSection, const TCHAR *name, HICON &hIcon)
// @param szItem char *: the section name in the ini file which holds the definition for this
// item.
-void CSkin::ReadItem(const int id, const TCHAR *szItem)
+void CSkin::ReadItem(const int id, const wchar_t *szItem)
{
- TCHAR buffer[512];
- TCHAR def_color[20];
+ wchar_t buffer[512];
+ wchar_t def_color[20];
COLORREF clr;
CSkinItem *defaults = &StatusItem_Default;
@@ -1250,26 +1250,26 @@ void CSkin::ReadItem(const int id, const TCHAR *szItem)
this_item->CORNER = defaults->CORNER & CORNER_ACTIVE ? defaults->CORNER : 0;
GetPrivateProfileString(szItem, L"Corner", L"None", buffer, 400, m_tszFileName);
- if (_tcsstr(buffer, L"tl"))
+ if (wcsstr(buffer, L"tl"))
this_item->CORNER |= CORNER_TL;
- if (_tcsstr(buffer, L"tr"))
+ if (wcsstr(buffer, L"tr"))
this_item->CORNER |= CORNER_TR;
- if (_tcsstr(buffer, L"bl"))
+ if (wcsstr(buffer, L"bl"))
this_item->CORNER |= CORNER_BL;
- if (_tcsstr(buffer, L"br"))
+ if (wcsstr(buffer, L"br"))
this_item->CORNER |= CORNER_BR;
if (this_item->CORNER)
this_item->CORNER |= CORNER_ACTIVE;
this_item->GRADIENT = defaults->GRADIENT & GRADIENT_ACTIVE ? defaults->GRADIENT : 0;
GetPrivateProfileString(szItem, L"Gradient", L"None", buffer, 400, m_tszFileName);
- if (_tcsstr(buffer, L"left"))
+ if (wcsstr(buffer, L"left"))
this_item->GRADIENT = GRADIENT_RL;
- else if (_tcsstr(buffer, L"right"))
+ else if (wcsstr(buffer, L"right"))
this_item->GRADIENT = GRADIENT_LR;
- else if (_tcsstr(buffer, L"up"))
+ else if (wcsstr(buffer, L"up"))
this_item->GRADIENT = GRADIENT_BT;
- else if (_tcsstr(buffer, L"down"))
+ else if (wcsstr(buffer, L"down"))
this_item->GRADIENT = GRADIENT_TB;
if (this_item->GRADIENT)
this_item->GRADIENT |= GRADIENT_ACTIVE;
@@ -1291,13 +1291,13 @@ void CSkin::ReadItem(const int id, const TCHAR *szItem)
//
// @param itemname char *: image item name, also section name in the .tsk file
-void CSkin::ReadImageItem(const TCHAR *itemname)
+void CSkin::ReadImageItem(const wchar_t *itemname)
{
- TCHAR buffer[512], szItemNr[30];
+ wchar_t buffer[512], szItemNr[30];
CImageItem tmpItem(itemname);
- TCHAR *szImageFileName = tmpItem.Read(m_tszFileName);
+ wchar_t *szImageFileName = tmpItem.Read(m_tszFileName);
if (!mir_tstrcmpi(itemname, L"$glyphs") && szImageFileName != 0) { // the glyph item MUST have a valid image
tmpItem.Create(szImageFileName);
@@ -1370,7 +1370,7 @@ void CSkin::Load(void)
int i = 1, j = 0;
UINT data;
- TCHAR buffer[500];
+ wchar_t buffer[500];
if (!(GetPrivateProfileInt(L"Global", L"Version", 0, m_tszFileName) >= 1 && GetPrivateProfileInt(L"Global", L"Signature", 0, m_tszFileName) == 101))
return;
@@ -1401,11 +1401,11 @@ void CSkin::Load(void)
m_DisableScrollbars = M.GetByte("disableVScroll", 0) ? true : false;
- TCHAR *szSections = (TCHAR*)mir_alloc(6004);
+ wchar_t *szSections = (wchar_t*)mir_alloc(6004);
memset(szSections, 0, 6000);
GetPrivateProfileSectionNames(szSections, 3000, m_tszFileName);
szSections[3001] = szSections[3000] = 0;
- TCHAR *p = szSections;
+ wchar_t *p = szSections;
while (mir_tstrlen(p) > 1) {
if (p[0] != '%') {
p += (mir_tstrlen(p) + 1);
@@ -1464,8 +1464,8 @@ void CSkin::Load(void)
m_bClipBorder = GetPrivateProfileInt(L"WindowFrame", L"ClipFrame", 0, m_tszFileName) ? true : false;
BYTE radius_tl, radius_tr, radius_bl, radius_br;
- TCHAR szFinalName[MAX_PATH];
- TCHAR szDrive[MAX_PATH], szPath[MAX_PATH];
+ wchar_t szFinalName[MAX_PATH];
+ wchar_t szDrive[MAX_PATH], szPath[MAX_PATH];
radius_tl = GetPrivateProfileInt(L"WindowFrame", L"RadiusTL", 0, m_tszFileName);
radius_tr = GetPrivateProfileInt(L"WindowFrame", L"RadiusTR", 0, m_tszFileName);
@@ -1476,7 +1476,7 @@ void CSkin::Load(void)
GetPrivateProfileString(L"Theme", L"File", L"None", buffer, MAX_PATH, m_tszFileName);
- _tsplitpath(m_tszFileName, szDrive, szPath, NULL, NULL);
+ _wsplitpath(m_tszFileName, szDrive, szPath, NULL, NULL);
mir_sntprintf(szFinalName, L"%s\\%s\\%s", szDrive, szPath, buffer);
if (PathFileExists(szFinalName)) {
ReadThemeFromINI(szFinalName, 0, FALSE, m_fLoadOnStartup ? 0 : M.GetByte("skin_loadmode", 0));
@@ -1523,8 +1523,8 @@ void CSkin::Load(void)
void CSkin::LoadItems()
{
- TCHAR *szSections = NULL;
- TCHAR *p, *p1;
+ wchar_t *szSections = NULL;
+ wchar_t *p, *p1;
TIconDesc tmpIconDesc = { 0 };
if (m_skinIcons == NULL)
@@ -1532,15 +1532,15 @@ void CSkin::LoadItems()
m_nrSkinIcons = 0;
- szSections = (TCHAR*)mir_alloc((SECT_BUFFER_SIZE + 2) * sizeof(TCHAR));
- memset(szSections, 0, ((SECT_BUFFER_SIZE + 2) * sizeof(TCHAR)));
+ szSections = (wchar_t*)mir_alloc((SECT_BUFFER_SIZE + 2) * sizeof(wchar_t));
+ memset(szSections, 0, ((SECT_BUFFER_SIZE + 2) * sizeof(wchar_t)));
GetPrivateProfileSection(L"Icons", szSections, SECT_BUFFER_SIZE, m_tszFileName);
szSections[SECT_BUFFER_SIZE] = 0;
p = szSections;
while (mir_tstrlen(p) > 1) {
- p1 = _tcschr(p, (int)'=');
+ p1 = wcschr(p, (int)'=');
if (p1)
*p1 = 0;
if (m_nrSkinIcons < NR_MAXSKINICONS && p1) {
@@ -1549,7 +1549,7 @@ void CSkin::LoadItems()
memset(&m_skinIcons[m_nrSkinIcons], 0, sizeof(TIconDesc));
m_skinIcons[m_nrSkinIcons].uId = tmpIconDesc.uId;
m_skinIcons[m_nrSkinIcons].phIcon = (HICON *)(&m_skinIcons[m_nrSkinIcons].uId);
- m_skinIcons[m_nrSkinIcons].szName = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(p) + 1));
+ m_skinIcons[m_nrSkinIcons].szName = (wchar_t*)mir_alloc(sizeof(wchar_t) * (mir_tstrlen(p) + 1));
mir_tstrcpy(m_skinIcons[m_nrSkinIcons].szName, p);
m_nrSkinIcons++;
}
@@ -1559,7 +1559,7 @@ void CSkin::LoadItems()
p += (mir_tstrlen(p) + 1);
}
- memset(szSections, 0, ((SECT_BUFFER_SIZE + 2) * sizeof(TCHAR)));
+ memset(szSections, 0, ((SECT_BUFFER_SIZE + 2) * sizeof(wchar_t)));
GetPrivateProfileSectionNames(szSections, SECT_BUFFER_SIZE, m_tszFileName);
szSections[SECT_BUFFER_SIZE] = 0;
@@ -1666,8 +1666,8 @@ void CSkin::setupAeroSkins()
if (!m_fAeroSkinsValid)
return;
- TCHAR tszFilename[MAX_PATH], tszBasePath[MAX_PATH];
- _tcsncpy_s(tszBasePath, M.getDataPath(), _TRUNCATE);
+ wchar_t tszFilename[MAX_PATH], tszBasePath[MAX_PATH];
+ wcsncpy_s(tszBasePath, M.getDataPath(), _TRUNCATE);
if (tszBasePath[mir_tstrlen(tszBasePath) - 1] != '\\')
mir_tstrcat(tszBasePath, L"\\");
@@ -2034,16 +2034,16 @@ UINT CSkin::DrawRichEditFrame(HWND hwnd, const TWindowData *mwdat, UINT skinID,
/////////////////////////////////////////////////////////////////////////////////////////
// convert a html-style color string (without the #) to a 32bit COLORREF value
//
-// @param szSource TCHAR*: the color value as string. format:
+// @param szSource wchar_t*: the color value as string. format:
// html-style without the leading #. e.g.
// "f3e355"
//
// @return COLORREF representation of the string value.
-DWORD __fastcall CSkin::HexStringToLong(const TCHAR *szSource)
+DWORD __fastcall CSkin::HexStringToLong(const wchar_t *szSource)
{
- TCHAR *stopped;
- COLORREF clr = _tcstol(szSource, &stopped, 16);
+ wchar_t *stopped;
+ COLORREF clr = wcstol(szSource, &stopped, 16);
if (clr == -1)
return clr;
return(RGB(GetBValue(clr), GetGValue(clr), GetRValue(clr)));
@@ -2053,7 +2053,7 @@ DWORD __fastcall CSkin::HexStringToLong(const TCHAR *szSource)
// Render text to the given HDC. This function is aero aware and will use uxtheme DrawThemeTextEx() when needed.
// Paramaters are pretty much comparable to GDI DrawText() API
-int CSkin::RenderText(HDC hdc, HANDLE hTheme, const TCHAR *szText, RECT *rc, DWORD dtFlags, const int iGlowSize, COLORREF clr, bool fForceAero)
+int CSkin::RenderText(HDC hdc, HANDLE hTheme, const wchar_t *szText, RECT *rc, DWORD dtFlags, const int iGlowSize, COLORREF clr, bool fForceAero)
{
if ((PluginConfig.m_bIsVista && !CSkin::m_skinEnabled && hTheme) || fForceAero) {
DTTOPTS dto = { 0 };
@@ -2437,8 +2437,8 @@ void CSkin::setAeroEffect(LRESULT effect)
void CSkin::extractSkinsAndLogo(bool fForceOverwrite) const
{
- TCHAR tszBasePath[MAX_PATH];
- _tcsncpy_s(tszBasePath, M.getDataPath(), _TRUNCATE);
+ wchar_t tszBasePath[MAX_PATH];
+ wcsncpy_s(tszBasePath, M.getDataPath(), _TRUNCATE);
if (tszBasePath[mir_tstrlen(tszBasePath) - 1] != '\\')
mir_tstrcat(tszBasePath, L"\\");
diff --git a/plugins/TabSRMM/src/themes.h b/plugins/TabSRMM/src/themes.h
index 0c5d1cf32a..32d3ac2d2d 100644
--- a/plugins/TabSRMM/src/themes.h
+++ b/plugins/TabSRMM/src/themes.h
@@ -33,7 +33,7 @@
#ifndef __THEMES_H
#define __THEMES_H
-HBITMAP IMG_LoadLogo(const TCHAR *szName);
+HBITMAP IMG_LoadLogo(const wchar_t *szName);
class CSideBarButton;
@@ -118,7 +118,7 @@ void CustomizeButton(HWND hwndButton);
struct AeroEffect
{
- TCHAR tszName[40];
+ wchar_t tszName[40];
DWORD m_baseColor;
DWORD m_gradientColor;
BYTE m_baseAlpha;
@@ -148,7 +148,7 @@ public:
*this = From;
m_nextItem = 0;
}
- CImageItem(const TCHAR *szName)
+ CImageItem(const wchar_t *szName)
{
memset(this, 0, sizeof(CImageItem));
mir_sntprintf(m_szName, szName);
@@ -220,19 +220,19 @@ public:
const BLENDFUNCTION &bf = m_bf;
return(bf);
}
- const TCHAR* getName() const { return (m_szName); }
- TCHAR* Read(const TCHAR *szFilename);
- void Create(const TCHAR *szImageFile);
+ const wchar_t* getName() const { return (m_szName); }
+ wchar_t* Read(const wchar_t *szFilename);
+ void Create(const wchar_t *szImageFile);
void __fastcall Render(const HDC hdc, const RECT *rc, bool fIgnoreGlyph) const;
static void TSAPI PreMultiply(HBITMAP hBitmap, int mode);
static void TSAPI SetBitmap32Alpha(HBITMAP hBitmap, BYTE bAlpha = 255);
static void TSAPI Colorize(HBITMAP hBitmap, BYTE dr, BYTE dg, BYTE db, BYTE alpha = 0);
- static HBITMAP TSAPI LoadPNG(const TCHAR *szFilename);
+ static HBITMAP TSAPI LoadPNG(const wchar_t *szFilename);
public:
bool m_fValid; // verified item, indicates that all parameters are valid
private:
- TCHAR m_szName[40]; // everything wants a name, an image item doesn't need one though
+ wchar_t m_szName[40]; // everything wants a name, an image item doesn't need one though
HBITMAP m_hbm; // the bitmap handle
BYTE m_bLeft, m_bRight, m_bTop, m_bBottom; // sizing margins for the outer 8 image parts
BYTE m_alpha; // constant alpha for the entire image, applied via m_bf. sums with perpixel alpha
@@ -250,7 +250,7 @@ private:
struct CSkinItem {
- TCHAR szName[40];
+ wchar_t szName[40];
char szDBname[40];
int statusID;
@@ -335,11 +335,11 @@ public:
void Unload();
void UnloadAeroTabs();
void setFileName();
- void ReadItem(const int id, const TCHAR *section);
+ void ReadItem(const int id, const wchar_t *section);
void LoadItems();
- void LoadIcon(const TCHAR *szSection, const TCHAR *name, HICON &hIcon);
- void ReadImageItem(const TCHAR *szItemName);
- void ReadButtonItem(const TCHAR *itemName) const;
+ void LoadIcon(const wchar_t *szSection, const wchar_t *name, HICON &hIcon);
+ void ReadImageItem(const wchar_t *szItemName);
+ void ReadButtonItem(const wchar_t *itemName) const;
bool haveGlyphItem() const { return(m_fHaveGlyph); }
int getNrIcons() const { return(m_nrSkinIcons); }
DWORD getDwmColor() const { return(m_dwmColor); }
@@ -370,11 +370,11 @@ public:
static void TSAPI SkinDrawBGFromDC(HWND hwndClient, HWND hwnd, RECT *rcClient, HDC hdcTarget);
static void TSAPI SkinDrawBG(HWND hwndClient, HWND hwnd, TContainerData *pContainer, RECT *rcClient, HDC hdcTarget);
static void TSAPI DrawDimmedIcon(HDC hdc, LONG left, LONG top, LONG dx, LONG dy, HICON hIcon, BYTE alpha);
- static DWORD __fastcall HexStringToLong(const TCHAR *szSource);
+ static DWORD __fastcall HexStringToLong(const wchar_t *szSource);
static UINT TSAPI DrawRichEditFrame(HWND hwnd, const TWindowData *mwdat, UINT skinID, UINT msg, WPARAM wParam, LPARAM lParam, WNDPROC OldWndProc);
static UINT TSAPI NcCalcRichEditFrame(HWND hwnd, const TWindowData *mwdat, UINT skinID, UINT msg, WPARAM wParam, LPARAM lParam, WNDPROC OldWndProc);
static HBITMAP TSAPI CreateAeroCompatibleBitmap(const RECT &rc, HDC dc);
- static int TSAPI RenderText(HDC hdc, HANDLE hTheme, const TCHAR *szText, RECT *rc, DWORD dtFlags, const int iGlowSize = DEFAULT_GLOW_SIZE, COLORREF clr = 0, bool fForceAero = false);
+ static int TSAPI RenderText(HDC hdc, HANDLE hTheme, const wchar_t *szText, RECT *rc, DWORD dtFlags, const int iGlowSize = DEFAULT_GLOW_SIZE, COLORREF clr = 0, bool fForceAero = false);
static void TSAPI MapClientToParent(HWND hwndClient, HWND hwndParent, RECT &rc);
static void TSAPI RenderToolbarBG(const TWindowData *dat, HDC hdc, const RECT &rcWindow);
static HBITMAP TSAPI ResizeBitmap(HBITMAP hBmpSrc, LONG width, LONG height, bool &mustFree);
@@ -431,7 +431,7 @@ public:
static bool m_fAeroSkinsValid;
private:
- TCHAR m_tszFileName[MAX_PATH]; // full path and filename of the currently loaded skin
+ wchar_t m_tszFileName[MAX_PATH]; // full path and filename of the currently loaded skin
CSkinItem* m_SkinItems;
CImageItem* m_ImageItems; // the list of image item objects
CImageItem m_glyphItem;
@@ -484,7 +484,7 @@ extern CSkin *Skin;
*/
struct ButtonItem {
- TCHAR szName[40];
+ wchar_t szName[40];
HWND hWnd;
LONG xOff, yOff;
LONG width, height;
@@ -494,14 +494,14 @@ struct ButtonItem {
LONG_PTR pressedGlyphMetrics[4];
DWORD dwFlags, dwStockFlags;
DWORD uId;
- TCHAR szTip[256];
+ wchar_t szTip[256];
char szService[256];
char szModule[256], szSetting[256];
BYTE bValuePush[256], bValueRelease[256];
DWORD type;
void(*pfnAction)(ButtonItem *item, HWND hwndDlg, TWindowData *dat, HWND hwndItem);
void(*pfnCallback)(ButtonItem *item, HWND hwndDlg, TWindowData *dat, HWND hwndItem);
- TCHAR tszLabel[40];
+ wchar_t tszLabel[40];
ButtonItem* nextItem;
HANDLE hContact;
TWindowData *dat;
diff --git a/plugins/TabSRMM/src/translator.cpp b/plugins/TabSRMM/src/translator.cpp
index d0893ea53c..a3ab89b044 100644
--- a/plugins/TabSRMM/src/translator.cpp
+++ b/plugins/TabSRMM/src/translator.cpp
@@ -30,149 +30,149 @@
TOptionListGroup m_lvGroupsModPlus[] =
{
- { 0, LPGENT("Message window tweaks") },
- { 0, LPGENT("Display metacontact icons") },
- { 0, LPGENT("Error feedback") },
+ { 0, LPGENW("Message window tweaks") },
+ { 0, LPGENW("Display metacontact icons") },
+ { 0, LPGENW("Error feedback") },
{ 0, NULL }
};
TOptionListItem m_lvItemsModPlus[] =
{
- { 0, LPGENT("Show skinnable tooltip in chat (Tipper plugin required)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"adv_TipperTooltip", 0 },
- { 0, LPGENT("Enable typing sounds"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_soundontyping", 0 },
- { 0, LPGENT("Close current tab on send"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_AutoClose_2", 0 },
- { 0, LPGENT("Automatic keyboard layout: Do not load the system default for new contacts"), 1, LOI_TYPE_SETTING, (UINT_PTR)"adv_leaveKeyboardAlone", 0 },
- { 0, LPGENT("Enable unattended send (experimental feature, required for multisend and send later) (*)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendLaterAvail", 0 },
- { 0, LPGENT("Show client description in info panel"), 1, LOI_TYPE_SETTING, (UINT_PTR)"ShowClientDescription", 0 },
- { 0, LPGENT("On tab control"), 1, LOI_TYPE_SETTING, (UINT_PTR)"MetaiconTab", 1 },
- { 0, LPGENT("On the button bar"), 0, LOI_TYPE_SETTING, (UINT_PTR)"MetaiconBar", 1 },
- { 0, LPGENT("Disable error popups on sending failures"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_noErrorPopups", 2 },
+ { 0, LPGENW("Show skinnable tooltip in chat (Tipper plugin required)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"adv_TipperTooltip", 0 },
+ { 0, LPGENW("Enable typing sounds"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_soundontyping", 0 },
+ { 0, LPGENW("Close current tab on send"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_AutoClose_2", 0 },
+ { 0, LPGENW("Automatic keyboard layout: Do not load the system default for new contacts"), 1, LOI_TYPE_SETTING, (UINT_PTR)"adv_leaveKeyboardAlone", 0 },
+ { 0, LPGENW("Enable unattended send (experimental feature, required for multisend and send later) (*)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendLaterAvail", 0 },
+ { 0, LPGENW("Show client description in info panel"), 1, LOI_TYPE_SETTING, (UINT_PTR)"ShowClientDescription", 0 },
+ { 0, LPGENW("On tab control"), 1, LOI_TYPE_SETTING, (UINT_PTR)"MetaiconTab", 1 },
+ { 0, LPGENW("On the button bar"), 0, LOI_TYPE_SETTING, (UINT_PTR)"MetaiconBar", 1 },
+ { 0, LPGENW("Disable error popups on sending failures"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_noErrorPopups", 2 },
{ 0, NULL, 0, 0, 0, 0 }
};
TOptionListItem m_lvItemsNEN[] =
{
- { 0, LPGENT("Show a preview of the event"), IDC_CHKPREVIEW, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bPreview, 1 },
- { 0, LPGENT("Don't announce event when message dialog is open"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bWindowCheck, 1 },
- { 0, LPGENT("Don't announce events from RSS protocols"), IDC_NORSS, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bNoRSS, 1 },
- { 0, LPGENT("Enable the system tray icon"), IDC_ENABLETRAYSUPPORT, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bTraySupport, 2 },
- { 0, LPGENT("Merge new events for the same contact into existing popup"), 1, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bMergePopup, 6 },
- { 0, LPGENT("Show headers"), IDC_CHKSHOWHEADERS, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bShowHeaders, 6 },
- { 0, LPGENT("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 },
- { 0, LPGENT("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 },
- { 0, LPGENT("Dismiss event"), MASK_REMOVE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 },
-
- { 0, LPGENT("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 },
- { 0, LPGENT("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 },
- { 0, LPGENT("Dismiss event"), MASK_REMOVE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 },
-
- { 0, LPGENT("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActTE, 5 },
- { 0, LPGENT("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActTE, 5 },
-
- { 0, LPGENT("Disable event notifications for instant messages"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.iDisable, 0 },
- { 0, LPGENT("Disable event notifications for group chats"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.iMUCDisable, 0 },
- { 0, LPGENT("Disable notifications for non-message events"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bDisableNonMessage, 0 },
-
- { 0, LPGENT("Remove popups for a contact when the message window is focused"), PU_REMOVE_ON_FOCUS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 },
- { 0, LPGENT("Remove popups for a contact when I start typing a reply"), PU_REMOVE_ON_TYPE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 },
- { 0, LPGENT("Remove popups for a contact when I send a reply"), PU_REMOVE_ON_SEND, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 },
+ { 0, LPGENW("Show a preview of the event"), IDC_CHKPREVIEW, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bPreview, 1 },
+ { 0, LPGENW("Don't announce event when message dialog is open"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bWindowCheck, 1 },
+ { 0, LPGENW("Don't announce events from RSS protocols"), IDC_NORSS, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bNoRSS, 1 },
+ { 0, LPGENW("Enable the system tray icon"), IDC_ENABLETRAYSUPPORT, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bTraySupport, 2 },
+ { 0, LPGENW("Merge new events for the same contact into existing popup"), 1, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bMergePopup, 6 },
+ { 0, LPGENW("Show headers"), IDC_CHKSHOWHEADERS, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bShowHeaders, 6 },
+ { 0, LPGENW("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 },
+ { 0, LPGENW("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 },
+ { 0, LPGENW("Dismiss event"), MASK_REMOVE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 },
+
+ { 0, LPGENW("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 },
+ { 0, LPGENW("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 },
+ { 0, LPGENW("Dismiss event"), MASK_REMOVE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 },
+
+ { 0, LPGENW("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActTE, 5 },
+ { 0, LPGENW("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActTE, 5 },
+
+ { 0, LPGENW("Disable event notifications for instant messages"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.iDisable, 0 },
+ { 0, LPGENW("Disable event notifications for group chats"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.iMUCDisable, 0 },
+ { 0, LPGENW("Disable notifications for non-message events"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bDisableNonMessage, 0 },
+
+ { 0, LPGENW("Remove popups for a contact when the message window is focused"), PU_REMOVE_ON_FOCUS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 },
+ { 0, LPGENW("Remove popups for a contact when I start typing a reply"), PU_REMOVE_ON_TYPE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 },
+ { 0, LPGENW("Remove popups for a contact when I send a reply"), PU_REMOVE_ON_SEND, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 },
{ 0, NULL, 0, 0, 0, 0 }
};
TOptionListGroup m_lvGroupsNEN[] =
{
- { 0, LPGENT("Disable notifications") },
- { 0, LPGENT("General options") },
- { 0, LPGENT("System tray icon") },
- { 0, LPGENT("Left click actions (popups only)") },
- { 0, LPGENT("Right click actions (popups only)") },
- { 0, LPGENT("Timeout actions (popups only)") },
- { 0, LPGENT("Combine notifications for the same contact") },
- { 0, LPGENT("Remove popups under following conditions") },
+ { 0, LPGENW("Disable notifications") },
+ { 0, LPGENW("General options") },
+ { 0, LPGENW("System tray icon") },
+ { 0, LPGENW("Left click actions (popups only)") },
+ { 0, LPGENW("Right click actions (popups only)") },
+ { 0, LPGENW("Timeout actions (popups only)") },
+ { 0, LPGENW("Combine notifications for the same contact") },
+ { 0, LPGENW("Remove popups under following conditions") },
{ 0, NULL }
};
TOptionListGroup m_lvGroupsMsg[] =
{
- { 0, LPGENT("Message window behavior") },
- { 0, LPGENT("Sending messages") },
- { 0, LPGENT("Other options") },
+ { 0, LPGENW("Message window behavior") },
+ { 0, LPGENW("Sending messages") },
+ { 0, LPGENW("Other options") },
{ 0, NULL }
};
TOptionListItem m_lvItemsMsg[] =
{
- { 0, LPGENT("Send on Shift+Enter"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendonshiftenter", 1 },
- { 0, LPGENT("Send message on 'Enter'"), SRMSGDEFSET_SENDONENTER, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_SENDONENTER, 1 },
- { 0, LPGENT("Send message on double 'Enter'"), 0, LOI_TYPE_SETTING, (UINT_PTR)"SendOnDblEnter", 1 },
- { 0, LPGENT("Minimize the message window on send"), SRMSGDEFSET_AUTOMIN, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_AUTOMIN, 1 },
- { 0, LPGENT("Close the message window on send"), 0, LOI_TYPE_SETTING, (UINT_PTR)"AutoClose", 1 },
- { 0, LPGENT("Always flash contact list and tray icon for new messages"), 0, LOI_TYPE_SETTING, (UINT_PTR)"flashcl", 0 },
- { 0, LPGENT("Delete temporary contacts on close"), 0, LOI_TYPE_SETTING, (UINT_PTR)"deletetemp", 0 },
- { 0, LPGENT("Enable \"Paste and send\" feature"), 0, LOI_TYPE_SETTING, (UINT_PTR)"pasteandsend", 1 },
- { 0, LPGENT("Allow BBCode formatting in outgoing messages"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendformat", 1 },
- { 0, LPGENT("Automatically split long messages (experimental, use with care)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"autosplit", 2 },
- { 0, LPGENT("Log status changes"), 0, LOI_TYPE_SETTING, (UINT_PTR)"logstatuschanges", 2 },
- { 0, LPGENT("Automatically copy selected text"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autocopy", 2 },
+ { 0, LPGENW("Send on Shift+Enter"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendonshiftenter", 1 },
+ { 0, LPGENW("Send message on 'Enter'"), SRMSGDEFSET_SENDONENTER, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_SENDONENTER, 1 },
+ { 0, LPGENW("Send message on double 'Enter'"), 0, LOI_TYPE_SETTING, (UINT_PTR)"SendOnDblEnter", 1 },
+ { 0, LPGENW("Minimize the message window on send"), SRMSGDEFSET_AUTOMIN, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_AUTOMIN, 1 },
+ { 0, LPGENW("Close the message window on send"), 0, LOI_TYPE_SETTING, (UINT_PTR)"AutoClose", 1 },
+ { 0, LPGENW("Always flash contact list and tray icon for new messages"), 0, LOI_TYPE_SETTING, (UINT_PTR)"flashcl", 0 },
+ { 0, LPGENW("Delete temporary contacts on close"), 0, LOI_TYPE_SETTING, (UINT_PTR)"deletetemp", 0 },
+ { 0, LPGENW("Enable \"Paste and send\" feature"), 0, LOI_TYPE_SETTING, (UINT_PTR)"pasteandsend", 1 },
+ { 0, LPGENW("Allow BBCode formatting in outgoing messages"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendformat", 1 },
+ { 0, LPGENW("Automatically split long messages (experimental, use with care)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"autosplit", 2 },
+ { 0, LPGENW("Log status changes"), 0, LOI_TYPE_SETTING, (UINT_PTR)"logstatuschanges", 2 },
+ { 0, LPGENW("Automatically copy selected text"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autocopy", 2 },
{ 0, NULL, 0, 0, 0, 0 }
};
TOptionListGroup m_lvGroupsLog[] =
{
- { 0, LPGENT("Message log appearance") },
- { 0, LPGENT("Support for external plugins") },
- { 0, LPGENT("Timestamp settings (note: timestamps also depend on your templates)") },
- { 0, LPGENT("Message log icons") },
+ { 0, LPGENW("Message log appearance") },
+ { 0, LPGENW("Support for external plugins") },
+ { 0, LPGENW("Timestamp settings (note: timestamps also depend on your templates)") },
+ { 0, LPGENW("Message log icons") },
{ 0, NULL }
};
TOptionListItem m_lvItemsLog[] =
{
- { 0, LPGENT("Show timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWTIME, 2 },
- { 0, LPGENT("Show dates in timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWDATES, 2 },
- { 0, LPGENT("Show seconds in timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWSECONDS, 2 },
- { 0, LPGENT("Use contacts local time (if timezone info available)"), 0, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_LOCALTIME, 2 },
- { 0, LPGENT("Draw grid lines"), 1, LOI_TYPE_FLAG, MWF_LOG_GRID, 0 },
- { 0, LPGENT("Event type icons in the message log"), 1, LOI_TYPE_FLAG, MWF_LOG_SHOWICONS, 3 },
- { 0, LPGENT("Text symbols as event markers"), 0, LOI_TYPE_FLAG, MWF_LOG_SYMBOLS, 3 },
- { 0, LPGENT("Use incoming/outgoing icons"), 1, LOI_TYPE_FLAG, MWF_LOG_INOUTICONS, 3 },
- { 0, LPGENT("Use message grouping"), 1, LOI_TYPE_FLAG, MWF_LOG_GROUPMODE, 0 },
- { 0, LPGENT("Indent message body"), 1, LOI_TYPE_FLAG, MWF_LOG_INDENT, 0 },
- { 0, LPGENT("Simple text formatting (*bold*, etc.)"), 0, LOI_TYPE_FLAG, MWF_LOG_TEXTFORMAT, 0 },
- { 0, LPGENT("Support BBCode formatting"), 1, LOI_TYPE_FLAG, MWF_LOG_BBCODE, 0 },
- { 0, LPGENT("Place a separator in the log after a window lost its foreground status"), 0, LOI_TYPE_SETTING, (UINT_PTR)"usedividers", 0 },
- { 0, LPGENT("Only place a separator when an incoming event is announced with a popup"), 0, LOI_TYPE_SETTING, (UINT_PTR)"div_popupconfig", 0 },
- { 0, LPGENT("RTL is default text direction"), 0, LOI_TYPE_FLAG, MWF_LOG_RTL, 0 },
- { 0, LPGENT("Show events at the new line (IEView Compatibility Mode)"), 1, LOI_TYPE_FLAG, MWF_LOG_NEWLINE, 1 },
- { 0, LPGENT("Underline timestamp/nickname (IEView Compatibility Mode)"), 0, LOI_TYPE_FLAG, MWF_LOG_UNDERLINE, 1 },
- { 0, LPGENT("Show timestamp after nickname (IEView Compatibility Mode)"), 0, LOI_TYPE_FLAG, MWF_LOG_SWAPNICK, 1 },
- { 0, LPGENT("Use normal templates (uncheck to use simple templates if your template set supports them)"), 1, LOI_TYPE_FLAG, MWF_LOG_NORMALTEMPLATES, 0 },
+ { 0, LPGENW("Show timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWTIME, 2 },
+ { 0, LPGENW("Show dates in timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWDATES, 2 },
+ { 0, LPGENW("Show seconds in timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWSECONDS, 2 },
+ { 0, LPGENW("Use contacts local time (if timezone info available)"), 0, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_LOCALTIME, 2 },
+ { 0, LPGENW("Draw grid lines"), 1, LOI_TYPE_FLAG, MWF_LOG_GRID, 0 },
+ { 0, LPGENW("Event type icons in the message log"), 1, LOI_TYPE_FLAG, MWF_LOG_SHOWICONS, 3 },
+ { 0, LPGENW("Text symbols as event markers"), 0, LOI_TYPE_FLAG, MWF_LOG_SYMBOLS, 3 },
+ { 0, LPGENW("Use incoming/outgoing icons"), 1, LOI_TYPE_FLAG, MWF_LOG_INOUTICONS, 3 },
+ { 0, LPGENW("Use message grouping"), 1, LOI_TYPE_FLAG, MWF_LOG_GROUPMODE, 0 },
+ { 0, LPGENW("Indent message body"), 1, LOI_TYPE_FLAG, MWF_LOG_INDENT, 0 },
+ { 0, LPGENW("Simple text formatting (*bold*, etc.)"), 0, LOI_TYPE_FLAG, MWF_LOG_TEXTFORMAT, 0 },
+ { 0, LPGENW("Support BBCode formatting"), 1, LOI_TYPE_FLAG, MWF_LOG_BBCODE, 0 },
+ { 0, LPGENW("Place a separator in the log after a window lost its foreground status"), 0, LOI_TYPE_SETTING, (UINT_PTR)"usedividers", 0 },
+ { 0, LPGENW("Only place a separator when an incoming event is announced with a popup"), 0, LOI_TYPE_SETTING, (UINT_PTR)"div_popupconfig", 0 },
+ { 0, LPGENW("RTL is default text direction"), 0, LOI_TYPE_FLAG, MWF_LOG_RTL, 0 },
+ { 0, LPGENW("Show events at the new line (IEView Compatibility Mode)"), 1, LOI_TYPE_FLAG, MWF_LOG_NEWLINE, 1 },
+ { 0, LPGENW("Underline timestamp/nickname (IEView Compatibility Mode)"), 0, LOI_TYPE_FLAG, MWF_LOG_UNDERLINE, 1 },
+ { 0, LPGENW("Show timestamp after nickname (IEView Compatibility Mode)"), 0, LOI_TYPE_FLAG, MWF_LOG_SWAPNICK, 1 },
+ { 0, LPGENW("Use normal templates (uncheck to use simple templates if your template set supports them)"), 1, LOI_TYPE_FLAG, MWF_LOG_NORMALTEMPLATES, 0 },
{ 0, NULL, 0, 0, 0, 0 }
};
TOptionListGroup m_lvGroupsTab[] =
{
- { 0, LPGENT("Tab options") },
- { 0, LPGENT("How to create tabs and windows for incoming messages") },
- { 0, LPGENT("Miscellaneous options") },
+ { 0, LPGENW("Tab options") },
+ { 0, LPGENW("How to create tabs and windows for incoming messages") },
+ { 0, LPGENW("Miscellaneous options") },
{ 0, NULL }
};
TOptionListItem m_lvItemsTab[] =
{
- { 0, LPGENT("Show status text on tabs"), 1, LOI_TYPE_SETTING, (UINT_PTR)"tabstatus", 0 },
- { 0, LPGENT("Prefer xStatus icons when available"), 1, LOI_TYPE_SETTING, (UINT_PTR)"use_xicons", 0 },
- { 0, LPGENT("Detailed tooltip on tabs (requires Tipper plugin)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"d_tooltips", 0 },
- { 0, LPGENT("ALWAYS activate new message sessions (has PRIORITY over the options below)"), SRMSGDEFSET_AUTOPOPUP, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_AUTOPOPUP, 1 },
- { 0, LPGENT("Automatically create new message sessions without activating them"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autotabs", 1 },
- { 0, LPGENT("New windows are minimized (the option above MUST be active)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autocontainer", 1 },
- { 0, LPGENT("Activate a minimized window when a new tab is created inside it"), 0, LOI_TYPE_SETTING, (UINT_PTR)"cpopup", 1 },
- { 0, LPGENT("Automatically switch existing tabs in minimized windows on incoming messages (ignored when using Aero Peek task bar features)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autoswitchtabs", 1 },
- { 0, LPGENT("Remember and set keyboard layout per contact"), 1, LOI_TYPE_SETTING, (UINT_PTR)"al", 2 },
- { 0, LPGENT("Close button only hides message windows"), 0, LOI_TYPE_SETTING, (UINT_PTR)"hideonclose", 2 },
- { 0, LPGENT("Allow TAB key in typing area (this will disable focus selection by TAB key)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"tabmode", 2 },
- { 0, LPGENT("Add offline contacts to multisend list"), 0, LOI_TYPE_SETTING, (UINT_PTR) "AllowOfflineMultisend", 2 },
+ { 0, LPGENW("Show status text on tabs"), 1, LOI_TYPE_SETTING, (UINT_PTR)"tabstatus", 0 },
+ { 0, LPGENW("Prefer xStatus icons when available"), 1, LOI_TYPE_SETTING, (UINT_PTR)"use_xicons", 0 },
+ { 0, LPGENW("Detailed tooltip on tabs (requires Tipper plugin)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"d_tooltips", 0 },
+ { 0, LPGENW("ALWAYS activate new message sessions (has PRIORITY over the options below)"), SRMSGDEFSET_AUTOPOPUP, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_AUTOPOPUP, 1 },
+ { 0, LPGENW("Automatically create new message sessions without activating them"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autotabs", 1 },
+ { 0, LPGENW("New windows are minimized (the option above MUST be active)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autocontainer", 1 },
+ { 0, LPGENW("Activate a minimized window when a new tab is created inside it"), 0, LOI_TYPE_SETTING, (UINT_PTR)"cpopup", 1 },
+ { 0, LPGENW("Automatically switch existing tabs in minimized windows on incoming messages (ignored when using Aero Peek task bar features)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autoswitchtabs", 1 },
+ { 0, LPGENW("Remember and set keyboard layout per contact"), 1, LOI_TYPE_SETTING, (UINT_PTR)"al", 2 },
+ { 0, LPGENW("Close button only hides message windows"), 0, LOI_TYPE_SETTING, (UINT_PTR)"hideonclose", 2 },
+ { 0, LPGENW("Allow TAB key in typing area (this will disable focus selection by TAB key)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"tabmode", 2 },
+ { 0, LPGENW("Add offline contacts to multisend list"), 0, LOI_TYPE_SETTING, (UINT_PTR) "AllowOfflineMultisend", 2 },
{ 0, NULL, 0, 0, 0, 0 }
};
diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp
index d27a5446ca..f13c5195c5 100644
--- a/plugins/TabSRMM/src/trayicon.cpp
+++ b/plugins/TabSRMM/src/trayicon.cpp
@@ -33,7 +33,7 @@ static HANDLE hTrayAnimThread = 0;
static HICON hIconTrayCurrent = 0;
HANDLE g_hEvent = 0;
-static TCHAR g_eventName[100];
+static wchar_t g_eventName[100];
static void TrayAnimThread(LPVOID)
{
@@ -142,7 +142,7 @@ void TSAPI CreateSystrayIcon(int create)
nim.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
nim.hIcon = PluginConfig.g_iconContainer;
nim.uCallbackMessage = DM_TRAYICONNOTIFY;
- _tcsncpy_s(nim.szTip, L"tabSRMM", _TRUNCATE);
+ wcsncpy_s(nim.szTip, L"tabSRMM", _TRUNCATE);
if (create && !nen_options.bTrayExist) {
Shell_NotifyIcon(NIM_ADD, &nim);
nen_options.bTrayExist = TRUE;
@@ -189,15 +189,15 @@ void TSAPI FlashTrayIcon(HICON hIcon)
* maximum number of allowed entries (20 at the moment). The oldest (topmost) entry
* is deleted, if necessary.
*/
-void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, const char *szProto, TCHAR *szStatus, WORD wStatus, HICON hIcon, BOOL mode, HMENU hMenu)
+void TSAPI AddContactToFavorites(MCONTACT hContact, const wchar_t *szNickname, const char *szProto, wchar_t *szStatus, WORD wStatus, HICON hIcon, BOOL mode, HMENU hMenu)
{
- TCHAR szMenuEntry[80];
- TCHAR szFinalNick[100];
+ wchar_t szMenuEntry[80];
+ wchar_t szFinalNick[100];
if (szNickname == NULL)
- _tcsncpy_s(szFinalNick, pcli->pfnGetContactDisplayName(hContact, 0), _TRUNCATE);
+ wcsncpy_s(szFinalNick, pcli->pfnGetContactDisplayName(hContact, 0), _TRUNCATE);
else
- _tcsncpy_s(szFinalNick, szNickname, _TRUNCATE);
+ wcsncpy_s(szFinalNick, szNickname, _TRUNCATE);
if (szProto == NULL)
szProto = GetContactProto(hContact);
@@ -236,7 +236,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, con
AppendMenu(hMenu, MF_BYCOMMAND, (UINT_PTR)hContact, szMenuEntry);
}
else if (hMenu == PluginConfig.g_hMenuFavorites) { // insert the item sorted...
- TCHAR szBuffer[142];
+ wchar_t szBuffer[142];
int i, c = GetMenuItemCount(PluginConfig.g_hMenuFavorites);
MENUITEMINFO mii2 = { 0 };
@@ -252,7 +252,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, con
mii2.cch++;
mii2.dwTypeData = szBuffer;
GetMenuItemInfo(PluginConfig.g_hMenuFavorites, i, TRUE, &mii2);
- if (_tcsncmp((TCHAR*)mii2.dwTypeData, szMenuEntry, 140) > 0 || i == c) {
+ if (wcsncmp((wchar_t*)mii2.dwTypeData, szMenuEntry, 140) > 0 || i == c) {
InsertMenu(PluginConfig.g_hMenuFavorites, i, MF_BYPOSITION, (UINT_PTR)hContact, szMenuEntry);
break;
}
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp
index a3a78f74cc..a9a06b6611 100644
--- a/plugins/TabSRMM/src/typingnotify.cpp
+++ b/plugins/TabSRMM/src/typingnotify.cpp
@@ -21,8 +21,8 @@ static int newTimeout2;
static BYTE newTimeoutMode;
static BYTE newTimeoutMode2;
static BYTE newColorMode;
-static TCHAR szStart[128];
-static TCHAR szStop[128];
+static wchar_t szStart[128];
+static wchar_t szStop[128];
static HANDLE hntfStarted = 0;
static HANDLE hntfStopped = 0;
@@ -47,9 +47,9 @@ static INT_PTR EnableDisableMenuCommand(WPARAM, LPARAM)
if (PluginConfig.g_bPopupAvail) {
if (!Disabled)
- Menu_ModifyItem(hDisableMenu, LPGENT("Disable &typing notification"), LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_ENABLED)));
+ Menu_ModifyItem(hDisableMenu, LPGENW("Disable &typing notification"), LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_ENABLED)));
else
- Menu_ModifyItem(hDisableMenu, LPGENT("Enable &typing notification"), LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_DISABLED)));
+ Menu_ModifyItem(hDisableMenu, LPGENW("Enable &typing notification"), LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_DISABLED)));
}
return 0;
@@ -90,7 +90,7 @@ void TN_TypingMessage(MCONTACT hContact, int iMode)
if (!PluginConfig.g_bPopupAvail || Disabled)
return;
- TCHAR *szContactName = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *szContactName = pcli->pfnGetContactDisplayName(hContact, 0);
if (OnePopup) {
HWND hPopupWnd = WindowList_Find(hPopupsList, hContact);
@@ -107,16 +107,16 @@ void TN_TypingMessage(MCONTACT hContact, int iMode)
if (iMode == PROTOTYPE_CONTACTTYPING_OFF) {
if (StopDisabled)
return;
- _tcsncpy_s(ppd.lptzContactName, szContactName, _TRUNCATE);
- _tcsncpy_s(ppd.lptzText, szStop, _TRUNCATE);
+ wcsncpy_s(ppd.lptzContactName, szContactName, _TRUNCATE);
+ wcsncpy_s(ppd.lptzText, szStop, _TRUNCATE);
ppd.hNotification = hntfStopped;
notyping = 1;
}
else {
if (StartDisabled)
return;
- _tcsncpy_s(ppd.lptzContactName, szContactName, _TRUNCATE);
- _tcsncpy_s(ppd.lptzText, szStart, _TRUNCATE);
+ wcsncpy_s(ppd.lptzContactName, szContactName, _TRUNCATE);
+ wcsncpy_s(ppd.lptzText, szStart, _TRUNCATE);
ppd.hNotification = hntfStarted;
notyping = 0;
}
@@ -297,13 +297,13 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
for (int i = 0; i < 2; i++) {
int notyping;
if (i == PROTOTYPE_CONTACTTYPING_OFF) {
- _tcsncpy_s(ppd.lptzContactName, TranslateT("Contact"), _TRUNCATE);
- _tcsncpy_s(ppd.lptzText, szStop, _TRUNCATE);
+ wcsncpy_s(ppd.lptzContactName, TranslateT("Contact"), _TRUNCATE);
+ wcsncpy_s(ppd.lptzText, szStop, _TRUNCATE);
notyping = 1;
}
else {
- _tcsncpy_s(ppd.lptzContactName, TranslateT("Contact"), _TRUNCATE);
- _tcsncpy_s(ppd.lptzText, szStart, _TRUNCATE);
+ wcsncpy_s(ppd.lptzContactName, TranslateT("Contact"), _TRUNCATE);
+ wcsncpy_s(ppd.lptzText, szStart, _TRUNCATE);
notyping = 0;
}
@@ -545,7 +545,7 @@ int TN_ModuleInit()
mi.hIcolibItem = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_DISABLED));
}
mi.pszService = "TypingNotify/EnableDisableMenuCommand";
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Popups"), 0);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Popups"), 0);
hDisableMenu = Menu_AddMainMenuItem(&mi);
}
diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp
index 442335bde0..39f367e2c1 100644
--- a/plugins/TabSRMM/src/userprefs.cpp
+++ b/plugins/TabSRMM/src/userprefs.cpp
@@ -415,7 +415,7 @@ INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LP
RECT rcClient;
GetClientRect(hwndDlg, &rcClient);
- TCHAR szBuffer[180];
+ wchar_t szBuffer[180];
mir_sntprintf(szBuffer, TranslateT("Set messaging options for %s"), pcli->pfnGetContactDisplayName(hContact, 0));
SetWindowText(hwndDlg, szBuffer);
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp
index 674872b380..82918649a4 100644
--- a/plugins/TabSRMM/src/utils.cpp
+++ b/plugins/TabSRMM/src/utils.cpp
@@ -30,7 +30,7 @@
#include <string>
-typedef std::basic_string<TCHAR> tstring;
+typedef std::basic_string<wchar_t> tstring;
#define MWF_LOG_BBCODE 1
#define MWF_LOG_TEXTFORMAT 0x2000000
@@ -54,11 +54,11 @@ TRTFColorTable* Utils::rtf_ctable = 0;
MWindowList CWarning::hWindowList = 0;
-static TCHAR *w_bbcodes_begin[] = { L"[b]", L"[i]", L"[u]", L"[s]", L"[color=" };
-static TCHAR *w_bbcodes_end[] = { L"[/b]", L"[/i]", L"[/u]", L"[/s]", L"[/color]" };
+static wchar_t *w_bbcodes_begin[] = { L"[b]", L"[i]", L"[u]", L"[s]", L"[color=" };
+static wchar_t *w_bbcodes_end[] = { L"[/b]", L"[/i]", L"[/u]", L"[/s]", L"[/color]" };
-static TCHAR *formatting_strings_begin[] = { L"b1 ", L"i1 ", L"u1 ", L"s1 ", L"c1 " };
-static TCHAR *formatting_strings_end[] = { L"b0 ", L"i0 ", L"u0 ", L"s0 ", L"c0 " };
+static wchar_t *formatting_strings_begin[] = { L"b1 ", L"i1 ", L"u1 ", L"s1 ", L"c1 " };
+static wchar_t *formatting_strings_end[] = { L"b0 ", L"i0 ", L"u0 ", L"s0 ", L"c0 " };
#define NR_CODES 5
@@ -67,13 +67,13 @@ static TCHAR *formatting_strings_end[] = { L"b0 ", L"i0 ", L"u0 ", L"s0 ", L
// flags: loword = words only for simple * /_ formatting
// hiword = bbcode support (strip bbcodes if 0)
-const TCHAR* Utils::FormatRaw(TWindowData *dat, const TCHAR *msg, int flags, BOOL isSent)
+const wchar_t* Utils::FormatRaw(TWindowData *dat, const wchar_t *msg, int flags, BOOL isSent)
{
bool clr_was_added = false, was_added;
static tstring message(msg);
size_t beginmark = 0, endmark = 0, tempmark = 0, index;
int i, endindex;
- TCHAR endmarker;
+ wchar_t endmarker;
DWORD dwFlags = dat->dwFlags;
message.assign(msg);
@@ -103,7 +103,7 @@ const TCHAR* Utils::FormatRaw(TWindowData *dat, const TCHAR *msg, int flags, BOO
search_again:
bool clr_found = false;
for (int ii = 0; ii < rtf_ctable_size; ii++) {
- if (!_tcsnicmp((TCHAR*)colorname.c_str(), rtf_ctable[ii].szName, mir_tstrlen(rtf_ctable[ii].szName))) {
+ if (!wcsnicmp((wchar_t*)colorname.c_str(), rtf_ctable[ii].szName, mir_tstrlen(rtf_ctable[ii].szName))) {
closing = beginmark + 7 + mir_tstrlen(rtf_ctable[ii].szName);
if (endmark != message.npos) {
message.erase(endmark, 4);
@@ -111,14 +111,14 @@ search_again:
}
message.erase(beginmark, (closing - beginmark));
- TCHAR szTemp[5];
+ wchar_t szTemp[5];
message.insert(beginmark, L"cxxx ");
mir_sntprintf(szTemp, L"%02d", MSGDLGFONTCOUNT + 13 + ii);
message[beginmark + 3] = szTemp[0];
message[beginmark + 4] = szTemp[1];
clr_found = true;
if (was_added) {
- TCHAR wszTemp[100];
+ wchar_t wszTemp[100];
mir_sntprintf(wszTemp, L"##col##%06u:%04u", endmark - closing, ii);
wszTemp[99] = 0;
message.insert(beginmark, wszTemp);
@@ -130,7 +130,7 @@ search_again:
size_t c_closing = colorname.find_first_of(L"]", 0);
if (c_closing == colorname.npos)
c_closing = colorname.length();
- const TCHAR *wszColname = colorname.c_str();
+ const wchar_t *wszColname = colorname.c_str();
if (endmark != message.npos && c_closing > 2 && c_closing <= 6 && iswalnum(colorname[0]) && iswalnum(colorname[c_closing - 1])) {
RTF_ColorAdd(wszColname, c_closing);
if (!was_added) {
@@ -166,7 +166,7 @@ invalid_code:
while ((beginmark = message.find_first_of(L"*/_", beginmark)) != message.npos) {
endmarker = message[beginmark];
if (LOWORD(flags)) {
- if (beginmark > 0 && !_istspace(message[beginmark - 1]) && !_istpunct(message[beginmark - 1])) {
+ if (beginmark > 0 && !iswspace(message[beginmark - 1]) && !iswpunct(message[beginmark - 1])) {
beginmark++;
continue;
}
@@ -174,7 +174,7 @@ invalid_code:
// search a corresponding endmarker which fulfills the criteria
INT_PTR mark = beginmark + 1;
while ((endmark = message.find(endmarker, mark)) != message.npos) {
- if (_istpunct(message[endmark + 1]) || _istspace(message[endmark + 1]) || message[endmark + 1] == 0 || _tcschr(L"*/_", message[endmark + 1]) != NULL)
+ if (iswpunct(message[endmark + 1]) || iswspace(message[endmark + 1]) || message[endmark + 1] == 0 || wcschr(L"*/_", message[endmark + 1]) != NULL)
goto ok;
mark = endmark + 1;
}
@@ -212,7 +212,7 @@ ok:
smbp.cbSize = sizeof(smbp);
smbp.Protocolname = dat->cache->getActiveProto();
smbp.flag = SAFL_TCHAR | SAFL_PATH | (isSent ? SAFL_OUTGOING : 0);
- smbp.str = (TCHAR*)smcode.c_str();
+ smbp.str = (wchar_t*)smcode.c_str();
smbp.hContact = dat->hContact;
SMADD_BATCHPARSERES *smbpr = (SMADD_BATCHPARSERES *)CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&smbp);
if (smbpr) {
@@ -234,19 +234,19 @@ ok:
// format the title bar string for IM chat sessions using placeholders.
// the caller must mir_free() the returned string
-static TCHAR* Trunc500(TCHAR *str)
+static wchar_t* Trunc500(wchar_t *str)
{
if (mir_tstrlen(str) > 500)
str[500] = 0;
return str;
}
-bool Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat, CMString &dest)
+bool Utils::FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMString &dest)
{
if (dat == 0)
return false;
- for (const TCHAR *src = szFormat; *src; src++) {
+ for (const wchar_t *src = szFormat; *src; src++) {
if (*src != '%') {
dest.AppendChar(*src);
continue;
@@ -361,7 +361,7 @@ WCHAR* Utils::FilterEventMarkers(WCHAR *wszText)
/////////////////////////////////////////////////////////////////////////////////////////
-void Utils::DoubleAmpersands(TCHAR *pszText, size_t len)
+void Utils::DoubleAmpersands(wchar_t *pszText, size_t len)
{
CMString text(pszText);
text.Replace(L"&", L"&&");
@@ -373,12 +373,12 @@ void Utils::DoubleAmpersands(TCHAR *pszText, size_t len)
//
// @param szText source text
// @param iMaxLen max length of the preview
-// @return TCHAR* result (caller must mir_free() it)
+// @return wchar_t* result (caller must mir_free() it)
-TCHAR* Utils::GetPreviewWithEllipsis(TCHAR *szText, size_t iMaxLen)
+wchar_t* Utils::GetPreviewWithEllipsis(wchar_t *szText, size_t iMaxLen)
{
size_t uRequired;
- TCHAR *p = 0, cSaved;
+ wchar_t *p = 0, cSaved;
bool fEllipsis = false;
if (mir_tstrlen(szText) <= iMaxLen) {
@@ -398,7 +398,7 @@ TCHAR* Utils::GetPreviewWithEllipsis(TCHAR *szText, size_t iMaxLen)
*p = 0;
uRequired = (p - szText) + 6;
}
- TCHAR *szResult = reinterpret_cast<TCHAR *>(mir_alloc((uRequired + 1) * sizeof(TCHAR)));
+ wchar_t *szResult = reinterpret_cast<wchar_t *>(mir_alloc((uRequired + 1) * sizeof(wchar_t)));
mir_sntprintf(szResult, (uRequired + 1), fEllipsis ? L"%s..." : L"%s", szText);
if (p)
@@ -450,17 +450,17 @@ void Utils::RTF_CTableInit()
/////////////////////////////////////////////////////////////////////////////////////////
// add a color to the global rtf color table
-void Utils::RTF_ColorAdd(const TCHAR *tszColname, size_t length)
+void Utils::RTF_ColorAdd(const wchar_t *tszColname, size_t length)
{
- TCHAR *stopped;
+ wchar_t *stopped;
rtf_ctable_size++;
rtf_ctable = (TRTFColorTable *)mir_realloc(rtf_ctable, sizeof(TRTFColorTable) * rtf_ctable_size);
- COLORREF clr = _tcstol(tszColname, &stopped, 16);
+ COLORREF clr = wcstol(tszColname, &stopped, 16);
mir_sntprintf(rtf_ctable[rtf_ctable_size - 1].szName, length + 1, L"%06x", clr);
rtf_ctable[rtf_ctable_size - 1].menuid = 0;
- clr = _tcstol(tszColname, &stopped, 16);
+ clr = wcstol(tszColname, &stopped, 16);
rtf_ctable[rtf_ctable_size - 1].clr = (RGB(GetBValue(clr), GetGValue(clr), GetRValue(clr)));
}
@@ -710,11 +710,11 @@ void Utils::getIconSize(HICON hIcon, int& sizeX, int& sizeY)
// @param uID the item command id
// @param pos zero-based position index
-void Utils::addMenuItem(const HMENU& m, MENUITEMINFO &mii, HICON hIcon, const TCHAR *szText, UINT uID, UINT pos)
+void Utils::addMenuItem(const HMENU& m, MENUITEMINFO &mii, HICON hIcon, const wchar_t *szText, UINT uID, UINT pos)
{
mii.wID = uID;
mii.dwItemData = (ULONG_PTR)hIcon;
- mii.dwTypeData = const_cast<TCHAR *>(szText);
+ mii.dwTypeData = const_cast<wchar_t *>(szText);
mii.cch = (int)mir_tstrlen(mii.dwTypeData) + 1;
::InsertMenuItem(m, pos, TRUE, &mii);
@@ -772,7 +772,7 @@ void Utils::showDlgControl(const HWND hwnd, UINT id, int showCmd)
// stream function to write the contents of the message log to an rtf file
DWORD CALLBACK Utils::StreamOut(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG * pcb)
{
- TCHAR *szFilename = (TCHAR*)dwCookie;
+ wchar_t *szFilename = (wchar_t*)dwCookie;
HANDLE hFile = CreateFile(szFilename, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
SetFilePointer(hFile, 0, NULL, FILE_END);
@@ -789,8 +789,8 @@ DWORD CALLBACK Utils::StreamOut(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG
// extract a resource from the given module
// tszPath must end with \
-bool Utils::extractResource(const HMODULE h, const UINT uID, const TCHAR *tszName, const TCHAR *tszPath,
- const TCHAR *tszFilename, bool fForceOverwrite)
+bool Utils::extractResource(const HMODULE h, const UINT uID, const wchar_t *tszName, const wchar_t *tszPath,
+ const wchar_t *tszFilename, bool fForceOverwrite)
{
HRSRC hRes = FindResource(h, MAKEINTRESOURCE(uID), tszName);
if (hRes) {
@@ -799,7 +799,7 @@ bool Utils::extractResource(const HMODULE h, const UINT uID, const TCHAR *tszNam
char *pData = (char *)LockResource(hResource);
DWORD dwSize = SizeofResource(g_hInst, hRes), written = 0;
- TCHAR szFilename[MAX_PATH];
+ wchar_t szFilename[MAX_PATH];
mir_sntprintf(szFilename, L"%s%s", tszPath, tszFilename);
if (!fForceOverwrite)
if (PathFileExists(szFilename))
@@ -817,12 +817,12 @@ bool Utils::extractResource(const HMODULE h, const UINT uID, const TCHAR *tszNam
}
/////////////////////////////////////////////////////////////////////////////////////////
-// extract the clicked URL from a rich edit control. Return the URL as TCHAR*
+// extract the clicked URL from a rich edit control. Return the URL as wchar_t*
// caller MUST mir_free() the returned string
// @param hwndRich - rich edit window handle
// @return wchar_t* extracted URL
-TCHAR* Utils::extractURLFromRichEdit(const ENLINK* _e, const HWND hwndRich)
+wchar_t* Utils::extractURLFromRichEdit(const ENLINK* _e, const HWND hwndRich)
{
CHARRANGE sel = { 0 };
::SendMessage(hwndRich, EM_EXGETSEL, 0, (LPARAM)&sel);
@@ -831,9 +831,9 @@ TCHAR* Utils::extractURLFromRichEdit(const ENLINK* _e, const HWND hwndRich)
TEXTRANGE tr;
tr.chrg = _e->chrg;
- tr.lpstrText = (TCHAR*)mir_alloc(sizeof(TCHAR) * (tr.chrg.cpMax - tr.chrg.cpMin + 8));
+ tr.lpstrText = (wchar_t*)mir_alloc(sizeof(wchar_t) * (tr.chrg.cpMax - tr.chrg.cpMin + 8));
::SendMessage(hwndRich, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
- if (_tcschr(tr.lpstrText, '@') != NULL && _tcschr(tr.lpstrText, ':') == NULL && _tcschr(tr.lpstrText, '/') == NULL) {
+ if (wcschr(tr.lpstrText, '@') != NULL && wcschr(tr.lpstrText, ':') == NULL && wcschr(tr.lpstrText, '/') == NULL) {
mir_tstrncpy(tr.lpstrText, L"mailto:", 7);
mir_tstrncpy(tr.lpstrText + 7, tr.lpstrText, tr.chrg.cpMax - tr.chrg.cpMin + 1);
}
@@ -935,7 +935,7 @@ size_t Utils::CopyToClipBoard(const wchar_t *str, const HWND hwndOwner)
if (!OpenClipboard(hwndOwner) || str == 0)
return 0;
- size_t i = sizeof(TCHAR) * (mir_tstrlen(str) + 1);
+ size_t i = sizeof(wchar_t) * (mir_tstrlen(str) + 1);
EmptyClipboard();
HGLOBAL hData = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, i);
@@ -950,15 +950,15 @@ size_t Utils::CopyToClipBoard(const wchar_t *str, const HWND hwndOwner)
/////////////////////////////////////////////////////////////////////////////////////////
// file list handler
-void Utils::AddToFileList(TCHAR ***pppFiles, int *totalCount, LPCTSTR szFilename)
+void Utils::AddToFileList(wchar_t ***pppFiles, int *totalCount, LPCTSTR szFilename)
{
- *pppFiles = (TCHAR**)mir_realloc(*pppFiles, (++*totalCount + 1) * sizeof(TCHAR*));
+ *pppFiles = (wchar_t**)mir_realloc(*pppFiles, (++*totalCount + 1) * sizeof(wchar_t*));
(*pppFiles)[*totalCount] = NULL;
(*pppFiles)[*totalCount - 1] = mir_tstrdup(szFilename);
if (GetFileAttributes(szFilename) & FILE_ATTRIBUTE_DIRECTORY) {
WIN32_FIND_DATA fd;
- TCHAR szPath[MAX_PATH];
+ wchar_t szPath[MAX_PATH];
mir_tstrcpy(szPath, szFilename);
mir_tstrcat(szPath, L"\\*");
HANDLE hFind = FindFirstFile(szPath, &fd);
@@ -993,20 +993,20 @@ void Utils::AddToFileList(TCHAR ***pppFiles, int *totalCount, LPCTSTR szFilename
// some strings are empty, this is intentional and used for error messages that share
// the message with other possible error notifications (popups, tool tips etc.)
//
-// Entries that do not use the LPGENT() macro are NOT TRANSLATABLE, so don't bother translating them.
+// Entries that do not use the LPGENW() macro are NOT TRANSLATABLE, so don't bother translating them.
static wchar_t* warnings[] = {
- LPGENT("Important release notes|A test warning message"), /* WARN_TEST */ /* reserved for important notes after upgrade - NOT translatable */
- LPGENT("Icon pack version check|The installed icon pack is outdated and might be incompatible with TabSRMM version 3.\n\n\\b1Missing or misplaced icons are possible issues with the currently installed icon pack.\\b0"), /* WARN_ICONPACKVERSION */
- LPGENT("Edit user notes|You are editing the user notes. Click the button again or use the hotkey (default: Alt-N) to save the notes and return to normal messaging mode"), /* WARN_EDITUSERNOTES */
- LPGENT("Missing component|The icon pack is missing. Please install it to the default icons folder.\n\nNo icons will be available"), /* WARN_ICONPACKMISSING */
- LPGENT("Aero peek warning|You have enabled Aero Peek features and loaded a custom container window skin\n\nThis can result in minor visual anomalies in the live preview feature."), /* WARN_AEROPEEKSKIN */
- LPGENT("File transfer problem|Sending the image by file transfer failed.\n\nPossible reasons: File transfers not supported, either you or the target contact is offline, or you are invisible and the target contact is not on your visibility list."), /* WARN_IMGSVC_MISSING */
- LPGENT("Settings problem|The option \\b1 History -> Imitate IEView API\\b0 is enabled and the History++ plugin is active. This can cause problems when using IEView as message log viewer.\n\nShould I correct the option (a restart is required)?"), /* WARN_HPP_APICHECK */
+ LPGENW("Important release notes|A test warning message"), /* WARN_TEST */ /* reserved for important notes after upgrade - NOT translatable */
+ LPGENW("Icon pack version check|The installed icon pack is outdated and might be incompatible with TabSRMM version 3.\n\n\\b1Missing or misplaced icons are possible issues with the currently installed icon pack.\\b0"), /* WARN_ICONPACKVERSION */
+ LPGENW("Edit user notes|You are editing the user notes. Click the button again or use the hotkey (default: Alt-N) to save the notes and return to normal messaging mode"), /* WARN_EDITUSERNOTES */
+ LPGENW("Missing component|The icon pack is missing. Please install it to the default icons folder.\n\nNo icons will be available"), /* WARN_ICONPACKMISSING */
+ LPGENW("Aero peek warning|You have enabled Aero Peek features and loaded a custom container window skin\n\nThis can result in minor visual anomalies in the live preview feature."), /* WARN_AEROPEEKSKIN */
+ LPGENW("File transfer problem|Sending the image by file transfer failed.\n\nPossible reasons: File transfers not supported, either you or the target contact is offline, or you are invisible and the target contact is not on your visibility list."), /* WARN_IMGSVC_MISSING */
+ LPGENW("Settings problem|The option \\b1 History -> Imitate IEView API\\b0 is enabled and the History++ plugin is active. This can cause problems when using IEView as message log viewer.\n\nShould I correct the option (a restart is required)?"), /* WARN_HPP_APICHECK */
L" ", /* WARN_NO_SENDLATER */ /*uses "Configuration issue|The unattended send feature is disabled. The \\b1 send later\\b0 and \\b1 send to multiple contacts\\b0 features depend on it.\n\nYou must enable it under \\b1Options -> Message sessions -> Advanced tweaks\\b0. Changing this option requires a restart." */
- LPGENT("Closing Window|You are about to close a window with multiple tabs open.\n\nProceed?"), /* WARN_CLOSEWINDOW */
- LPGENT("Closing options dialog|To reflect the changes done by importing a theme in the options dialog, the dialog must be closed after loading a theme \\b1 and unsaved changes might be lost\\b0 .\n\nDo you want to continue?"), /* WARN_OPTION_CLOSE */
- LPGENT("Loading a theme|Loading a color and font theme can overwrite the settings defined by your skin.\n\nDo you want to continue?"), /* WARN_THEME_OVERWRITE */
+ LPGENW("Closing Window|You are about to close a window with multiple tabs open.\n\nProceed?"), /* WARN_CLOSEWINDOW */
+ LPGENW("Closing options dialog|To reflect the changes done by importing a theme in the options dialog, the dialog must be closed after loading a theme \\b1 and unsaved changes might be lost\\b0 .\n\nDo you want to continue?"), /* WARN_OPTION_CLOSE */
+ LPGENW("Loading a theme|Loading a color and font theme can overwrite the settings defined by your skin.\n\nDo you want to continue?"), /* WARN_THEME_OVERWRITE */
};
CWarning::CWarning(const wchar_t *tszTitle, const wchar_t *tszText, const UINT uId, const DWORD dwFlags) :
@@ -1168,7 +1168,7 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
{
HICON hIcon = 0;
UINT uResId = 0;
- TCHAR temp[1024];
+ wchar_t temp[1024];
SETTEXTEX stx = { ST_SELECTION, CP_UTF8 };
size_t pos = 0;
@@ -1303,7 +1303,7 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
const wchar_t *wszUrl = Utils::extractURLFromRichEdit(e, ::GetDlgItem(hwnd, IDC_WARNTEXT));
if (wszUrl) {
Utils_OpenUrlW(wszUrl);
- mir_free(const_cast<TCHAR *>(wszUrl));
+ mir_free(const_cast<wchar_t *>(wszUrl));
}
}
}
diff --git a/plugins/TabSRMM/src/utils.h b/plugins/TabSRMM/src/utils.h
index a5bed3cef5..245db9db97 100644
--- a/plugins/TabSRMM/src/utils.h
+++ b/plugins/TabSRMM/src/utils.h
@@ -38,7 +38,7 @@
struct TRTFColorTable
{
- TCHAR szName[10];
+ wchar_t szName[10];
COLORREF clr;
int menuid;
};
@@ -53,14 +53,14 @@ public:
};
static int FindRTLLocale(TWindowData *dat);
- static TCHAR* GetPreviewWithEllipsis(TCHAR *szText, size_t iMaxLen);
- static TCHAR* FilterEventMarkers(TCHAR *wszText);
- static LPCTSTR FormatRaw(TWindowData *dat, const TCHAR *msg, int flags, BOOL isSent);
- static bool FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat, CMString &dest);
+ static wchar_t* GetPreviewWithEllipsis(wchar_t *szText, size_t iMaxLen);
+ static wchar_t* FilterEventMarkers(wchar_t *wszText);
+ static LPCTSTR FormatRaw(TWindowData *dat, const wchar_t *msg, int flags, BOOL isSent);
+ static bool FormatTitleBar(const TWindowData *dat, const wchar_t *szFormat, CMString &dest);
static char* FilterEventMarkers(char *szText);
- static void DoubleAmpersands(TCHAR *pszText, size_t len);
+ static void DoubleAmpersands(wchar_t *pszText, size_t len);
static void RTF_CTableInit();
- static void RTF_ColorAdd(const TCHAR *tszColname, size_t length);
+ static void RTF_ColorAdd(const wchar_t *tszColname, size_t length);
static int ReadContainerSettingsFromDB(const MCONTACT hContact, TContainerSettings *cs, const char *szKey = 0);
static int WriteContainerSettingsToDB(const MCONTACT hContact, TContainerSettings *cs, const char *szKey = 0);
static void SettingsToContainer(TContainerData *pContainer);
@@ -71,7 +71,7 @@ public:
static DWORD CALLBACK StreamOut(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG * pcb);
static LRESULT CmdDispatcher(UINT uType, HWND hwndDlg, UINT cmd, WPARAM wParam, LPARAM lParam, TWindowData *dat = 0, TContainerData *pContainer = 0);
- static void addMenuItem(const HMENU& m, MENUITEMINFO& mii, HICON hIcon, const TCHAR *szText, UINT uID, UINT pos);
+ static void addMenuItem(const HMENU& m, MENUITEMINFO& mii, HICON hIcon, const wchar_t *szText, UINT uID, UINT pos);
static void enableDlgControl(const HWND hwnd, UINT id, bool fEnable = true);
static void showDlgControl(const HWND hwnd, UINT id, int showCmd);
static int mustPlaySound(const TWindowData *dat);
@@ -79,7 +79,7 @@ public:
static void setAvatarContact(HWND hWnd, MCONTACT hContact);
static void getIconSize(HICON hIcon, int& sizeX, int& sizeY);
- static bool extractResource(const HMODULE h, const UINT uID, const TCHAR *tszName, const TCHAR *tszPath, const TCHAR *tszFilename, bool fForceOverwrite);
+ static bool extractResource(const HMODULE h, const UINT uID, const wchar_t *tszName, const wchar_t *tszPath, const wchar_t *tszFilename, bool fForceOverwrite);
static void scaleAvatarHeightLimited(const HBITMAP hBm, double& dNewWidth, double& dNewHeight, const LONG maxHeight);
static AVATARCACHEENTRY* loadAvatarFromAVS(const MCONTACT hContact);
@@ -96,7 +96,7 @@ public:
static size_t CopyToClipBoard(const wchar_t *str, const HWND hwndOwner);
- static void AddToFileList(TCHAR ***pppFiles, int *totalCount, LPCTSTR szFilename);
+ static void AddToFileList(wchar_t ***pppFiles, int *totalCount, LPCTSTR szFilename);
//////////////////////////////////////////////////////////////////////////////////////
// safe mir_strlen function - do not overflow the given buffer length
diff --git a/plugins/TipperYM/src/bitmap_func.cpp b/plugins/TipperYM/src/bitmap_func.cpp
index cdd1a71bb0..fe9ecfce84 100644
--- a/plugins/TipperYM/src/bitmap_func.cpp
+++ b/plugins/TipperYM/src/bitmap_func.cpp
@@ -150,7 +150,7 @@ void CreateFromBitmaps(bool bServiceTip)
if (i == SKIN_ITEM_SIDEBAR && (!opt.iSidebarWidth || bServiceTip))
continue;
- TCHAR* tszFileName = opt.szImgFile[i];
+ wchar_t* tszFileName = opt.szImgFile[i];
if (tszFileName && *tszFileName != 0) {
FIBITMAP *fib = NULL;
if (!skin.bCached) {
diff --git a/plugins/TipperYM/src/message_pump.cpp b/plugins/TipperYM/src/message_pump.cpp
index 4f07b1395d..d19096e067 100644
--- a/plugins/TipperYM/src/message_pump.cpp
+++ b/plugins/TipperYM/src/message_pump.cpp
@@ -20,6 +20,8 @@ Boston, MA 02111-1307, USA.
#include "stdafx.h"
+#include <tchar.h>
+
HMODULE hDwmapiDll = 0;
HRESULT (WINAPI *MyDwmEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurBehind) = 0;
@@ -150,7 +152,7 @@ unsigned int CALLBACK MessagePumpThread(void*)
case MUM_GOTSTATUS:
{
MCONTACT hContact = (MCONTACT)hwndMsg.wParam;
- TCHAR *swzMsg = (TCHAR *)hwndMsg.lParam;
+ wchar_t *swzMsg = (wchar_t *)hwndMsg.lParam;
if (opt.bWaitForContent && !bStatusMsgReady && clcitex && clcitex->hItem == (HANDLE)hContact) {
if (WaitForContentTimerID) {
@@ -282,7 +284,7 @@ INT_PTR ShowTipW(WPARAM wParam, LPARAM lParam)
if (wParam) // wParam is char pointer containing text - e.g. status bar tooltip
{
- clcit2->swzText = mir_tstrdup((TCHAR *)wParam);
+ clcit2->swzText = mir_tstrdup((wchar_t *)wParam);
GetCursorPos(&clcit2->ptCursor);
}
@@ -313,7 +315,7 @@ int ProtoAck(WPARAM, LPARAM lParam)
return 0;
if (ack->type == ACKTYPE_AWAYMSG) {
- TCHAR *tszMsg = (TCHAR*)ack->lParam;
+ wchar_t *tszMsg = (wchar_t*)ack->lParam;
if (mir_tstrlen(tszMsg))
PostMPMessage(MUM_GOTSTATUS, (WPARAM)ack->hContact, (LPARAM)mir_tstrdup(tszMsg));
}
diff --git a/plugins/TipperYM/src/mir_smileys.cpp b/plugins/TipperYM/src/mir_smileys.cpp
index 3e2df38660..5e8c62b8c9 100644
--- a/plugins/TipperYM/src/mir_smileys.cpp
+++ b/plugins/TipperYM/src/mir_smileys.cpp
@@ -20,6 +20,8 @@ Boston, MA 02111-1307, USA.
#include "stdafx.h"
+#include <tchar.h>
+
int InitTipperSmileys()
{
// Register smiley category
@@ -104,13 +106,13 @@ int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT
return text_size.cy;
}
-SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTextFormat, int max_width)
+SIZE GetTextSize(HDC hdcMem, const wchar_t *szText, SMILEYPARSEINFO info, UINT uTextFormat, int max_width)
{
SIZE text_size = { 0 };
int text_height;
int row_count = 0, pos_x = 0;
- if (szText == NULL || _tcsclen(szText) == 0) {
+ if (szText == NULL || wcslen(szText) == 0) {
text_size.cy = 0;
text_size.cx = 0;
}
@@ -177,7 +179,7 @@ SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTe
return text_size;
}
-void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat)
+void DrawTextSmiley(HDC hdcMem, RECT free_rc, const wchar_t *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat)
{
if (szText == NULL)
return;
@@ -304,7 +306,7 @@ void DestroySmileyList(SortedList* p_list)
}
// Generate the list of smileys / text to be drawn
-SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protocol, int *max_smiley_height)
+SortedList *ReplaceSmileys(const wchar_t *text, int text_size, const char *protocol, int *max_smiley_height)
{
*max_smiley_height = 0;
@@ -322,7 +324,7 @@ SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protoco
// Parse it!
SMADD_BATCHPARSE2 sp = { 0 };
sp.cbSize = sizeof(sp);
- sp.str = (TCHAR *)text;
+ sp.str = (wchar_t *)text;
sp.flag = SAFL_TCHAR;
sp.Protocolname = (opt.iSmileyAddFlags & SMILEYADD_USEPROTO) ? smileyProto : "tipper";
SMADD_BATCHPARSERES *spres = (SMADD_BATCHPARSERES *)CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&sp);
@@ -333,11 +335,11 @@ SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protoco
// Lets add smileys
SortedList *plText = List_Create(0, 10);
- TCHAR *word_start, *word_end;
- TCHAR *smiley_start, *smiley_end;
- TCHAR *last_text_pos = _tcsninc(text, text_size);
+ wchar_t *word_start, *word_end;
+ wchar_t *smiley_start, *smiley_end;
+ wchar_t *last_text_pos = _tcsninc(text, text_size);
- word_start = word_end = (TCHAR *)text;
+ word_start = word_end = (wchar_t *)text;
for (unsigned i = 0; i < sp.numSmileys; i++) {
// Get smile position
diff --git a/plugins/TipperYM/src/mir_smileys.h b/plugins/TipperYM/src/mir_smileys.h
index 0e95710240..eead1110b3 100644
--- a/plugins/TipperYM/src/mir_smileys.h
+++ b/plugins/TipperYM/src/mir_smileys.h
@@ -59,9 +59,9 @@ int InitTipperSmileys();
SMILEYPARSEINFO Smileys_PreParse(LPCTSTR lpString, int nCount, const char *protocol);
void Smileys_FreeParse(SMILEYPARSEINFO parseInfo);
-SortedList* ReplaceSmileys(const TCHAR *text, int text_size, const char *protocol, int *max_smiley_height);
-SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTextFormat, int max_width);
-void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat);
+SortedList* ReplaceSmileys(const wchar_t *text, int text_size, const char *protocol, int *max_smiley_height);
+SIZE GetTextSize(HDC hdcMem, const wchar_t *szText, SMILEYPARSEINFO info, UINT uTextFormat, int max_width);
+void DrawTextSmiley(HDC hdcMem, RECT free_rc, const wchar_t *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat);
void DestroySmileyList(SortedList* p_list);
int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, SMILEYPARSEINFO parseInfo);
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp
index 63ca767e1e..d083f1bc98 100644
--- a/plugins/TipperYM/src/options.cpp
+++ b/plugins/TipperYM/src/options.cpp
@@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA.
OPTIONS opt;
ICONSTATE exIcons[EXICONS_COUNT];
-extern int IsTrayProto(const TCHAR *swzProto, BOOL bExtendedTip)
+extern int IsTrayProto(const wchar_t *swzProto, BOOL bExtendedTip)
{
if (swzProto == NULL)
return 0;
@@ -37,7 +37,7 @@ extern int IsTrayProto(const TCHAR *swzProto, BOOL bExtendedTip)
DBVARIANT dbv;
int result = 1;
if (!db_get_ts(NULL, MODULE, szSetting, &dbv)) {
- result = _tcsstr(dbv.ptszVal, swzProto) ? 1 : 0;
+ result = wcsstr(dbv.ptszVal, swzProto) ? 1 : 0;
db_free(&dbv);
}
@@ -49,8 +49,8 @@ void CreateDefaultItems()
for (int i = 0; defaultItemList[i].szName; i++) {
if (defaultItemList[i].szName[0] == '-') {
DIListNode *di_node = (DIListNode *)mir_alloc(sizeof(DIListNode));
- _tcsncpy(di_node->di.swzLabel, L"", LABEL_LEN);
- _tcsncpy(di_node->di.swzValue, L"", VALUE_LEN);
+ wcsncpy(di_node->di.swzLabel, L"", LABEL_LEN);
+ wcsncpy(di_node->di.swzValue, L"", VALUE_LEN);
di_node->di.bLineAbove = true;
di_node->di.bIsVisible = true;
di_node->di.bParseTipperVarsFirst = false;
@@ -67,7 +67,7 @@ void CreateDefaultItems()
if (subst == NULL) continue;
DSListNode *ds_node = (DSListNode *)mir_alloc(sizeof(DSListNode));
- _tcsncpy(ds_node->ds.swzName, subst->swzName, LABEL_LEN);
+ wcsncpy(ds_node->ds.swzName, subst->swzName, LABEL_LEN);
ds_node->ds.type = subst->type;
strncpy(ds_node->ds.szSettingName, subst->szSettingName, SETTING_NAME_LEN);
ds_node->ds.iTranslateFuncId = subst->iTranslateFuncId;
@@ -77,8 +77,8 @@ void CreateDefaultItems()
}
DIListNode *di_node = (DIListNode *)mir_alloc(sizeof(DIListNode));
- _tcsncpy(di_node->di.swzLabel, TranslateTS(item->swzLabel), LABEL_LEN);
- _tcsncpy(di_node->di.swzValue, item->swzValue, VALUE_LEN);
+ wcsncpy(di_node->di.swzLabel, TranslateTS(item->swzLabel), LABEL_LEN);
+ wcsncpy(di_node->di.swzValue, item->swzValue, VALUE_LEN);
di_node->di.bLineAbove = false;
di_node->di.bValueNewline = defaultItemList[i].bValueNewline;
di_node->di.bIsVisible = true;
@@ -100,7 +100,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index)
if (db_get_ts(0, MODULE_ITEMS, setting, &dbv))
return false;
- _tcsncpy(ds->swzName, dbv.ptszVal, _countof(ds->swzName));
+ wcsncpy(ds->swzName, dbv.ptszVal, _countof(ds->swzName));
ds->swzName[_countof(ds->swzName) - 1] = 0;
db_free(&dbv);
@@ -161,14 +161,14 @@ bool LoadDI(DISPLAYITEM *di, int index)
if (db_get_ts(0, MODULE_ITEMS, setting, &dbv))
return false;
- _tcsncpy(di->swzLabel, dbv.ptszVal, _countof(di->swzLabel));
+ wcsncpy(di->swzLabel, dbv.ptszVal, _countof(di->swzLabel));
di->swzLabel[_countof(di->swzLabel) - 1] = 0;
db_free(&dbv);
mir_snprintf(setting, "DIValue%d", index);
di->swzValue[0] = 0;
if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv)) {
- _tcsncpy(di->swzValue, dbv.ptszVal, _countof(di->swzValue));
+ wcsncpy(di->swzValue, dbv.ptszVal, _countof(di->swzValue));
di->swzValue[_countof(di->swzValue) - 1] = 0;
db_free(&dbv);
}
@@ -275,7 +275,7 @@ void SaveItems()
opt.bWaitForStatusMsg = false;
while (di_node) {
SaveDI(&di_node->di, index);
- if (di_node->di.bIsVisible && _tcsstr(di_node->di.swzValue, L"sys:status_msg"))
+ if (di_node->di.bIsVisible && wcsstr(di_node->di.swzValue, L"sys:status_msg"))
opt.bWaitForStatusMsg = true;
di_node = di_node->next;
index++;
@@ -372,7 +372,7 @@ void LoadOptions()
di_node->next = opt.diList;
opt.diList = di_node;
real_count++;
- if (di_node->di.bIsVisible && _tcsstr(di_node->di.swzValue, L"sys:status_msg"))
+ if (di_node->di.bIsVisible && wcsstr(di_node->di.swzValue, L"sys:status_msg"))
opt.bWaitForStatusMsg = true;
}
else
@@ -411,8 +411,8 @@ void LoadOptions()
di_node = opt.diList;
}
- _tcsncpy(di_node->di.swzLabel, L"Last message: (%sys:last_msg_reltime% ago)", LABEL_LEN);
- _tcsncpy(di_node->di.swzValue, L"%sys:last_msg%", VALUE_LEN);
+ wcsncpy(di_node->di.swzLabel, L"Last message: (%sys:last_msg_reltime% ago)", LABEL_LEN);
+ wcsncpy(di_node->di.swzValue, L"%sys:last_msg%", VALUE_LEN);
di_node->di.bLineAbove = di_node->di.bValueNewline = true;
di_node->next = 0;
opt.iDiCount++;
@@ -436,8 +436,8 @@ void LoadOptions()
di_node = opt.diList;
}
- _tcsncpy(di_node->di.swzLabel, L"Status message:", LABEL_LEN);
- _tcsncpy(di_node->di.swzValue, L"%sys:status_msg%", VALUE_LEN);
+ wcsncpy(di_node->di.swzLabel, L"Status message:", LABEL_LEN);
+ wcsncpy(di_node->di.swzValue, L"%sys:status_msg%", VALUE_LEN);
di_node->di.bLineAbove = di_node->di.bValueNewline = true;
di_node->next = 0;
opt.iDiCount++;
@@ -516,7 +516,7 @@ void LoadOptions()
}
else if (opt.skinMode == SM_IMAGE) {
if (!db_get_ts(NULL, MODULE, "SkinName", &dbv)) {
- _tcsncpy(opt.szSkinName, dbv.ptszVal, _countof(opt.szSkinName) - 1);
+ wcsncpy(opt.szSkinName, dbv.ptszVal, _countof(opt.szSkinName) - 1);
db_free(&dbv);
}
}
@@ -584,7 +584,7 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
sel = SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETCURSEL, 0, 0);
if (sel != CB_ERR) {
- TCHAR buff[256];
+ wchar_t buff[256];
SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETLBTEXT, sel, (LPARAM)buff);
for (int i = 0; presetItems[i].szID; i++) {
if (mir_tstrcmp(buff, TranslateTS(presetItems[i].swzName)) == 0) {
@@ -620,7 +620,7 @@ INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (LOWORD(wParam) == IDC_CMB_PRESETITEMS) {
int sel = SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETCURSEL, 0, 0);
if (sel != CB_ERR) {
- TCHAR buff[256];
+ wchar_t buff[256];
SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETLBTEXT, sel, (LPARAM)buff);
for (int i = 0; presetItems[i].szID; i++) {
if (mir_tstrcmp(buff, TranslateTS(presetItems[i].swzName)) == 0) {
@@ -737,7 +737,7 @@ INT_PTR CALLBACK DlgProcAddSubst(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
return 0;
}
-static void SetTreeItemText(DIListNode *node, TCHAR **pszText)
+static void SetTreeItemText(DIListNode *node, wchar_t **pszText)
{
if (node->di.swzLabel[0] == 0) {
if (node->di.swzValue[0] == 0 && node->di.bLineAbove)
@@ -750,15 +750,15 @@ static void SetTreeItemText(DIListNode *node, TCHAR **pszText)
}
static OPTBUTTON btns[9] = {
- IDC_BTN_ADD, SKINICON_OTHER_ADDCONTACT, 0, LPGENT("Add item"),
- IDC_BTN_SEPARATOR, 0, IDI_SEPARATOR, LPGENT("Add separator"),
- IDC_BTN_EDIT, SKINICON_OTHER_RENAME, 0, LPGENT("Edit"),
- IDC_BTN_REMOVE, SKINICON_OTHER_DELETE, 0, LPGENT("Remove"),
- IDC_BTN_UP, 0, IDI_UP, LPGENT("Move up"),
- IDC_BTN_DOWN, 0, IDI_DOWN, LPGENT("Move down"),
- IDC_BTN_ADD2, SKINICON_OTHER_ADDCONTACT, 0, LPGENT("Add"),
- IDC_BTN_REMOVE2, SKINICON_OTHER_DELETE, 0, LPGENT("Remove"),
- IDC_BTN_EDIT2, SKINICON_OTHER_RENAME, 0, LPGENT("Edit")
+ IDC_BTN_ADD, SKINICON_OTHER_ADDCONTACT, 0, LPGENW("Add item"),
+ IDC_BTN_SEPARATOR, 0, IDI_SEPARATOR, LPGENW("Add separator"),
+ IDC_BTN_EDIT, SKINICON_OTHER_RENAME, 0, LPGENW("Edit"),
+ IDC_BTN_REMOVE, SKINICON_OTHER_DELETE, 0, LPGENW("Remove"),
+ IDC_BTN_UP, 0, IDI_UP, LPGENW("Move up"),
+ IDC_BTN_DOWN, 0, IDI_DOWN, LPGENW("Move down"),
+ IDC_BTN_ADD2, SKINICON_OTHER_ADDCONTACT, 0, LPGENW("Add"),
+ IDC_BTN_REMOVE2, SKINICON_OTHER_DELETE, 0, LPGENW("Remove"),
+ IDC_BTN_EDIT2, SKINICON_OTHER_RENAME, 0, LPGENW("Edit")
};
INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -907,7 +907,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
memset(ds_value, 0, sizeof(DSListNode));
ds_value->next = NULL;
ds_value->ds.type = subst->type;
- _tcsncpy(ds_value->ds.swzName, subst->swzName, LABEL_LEN - 1);
+ wcsncpy(ds_value->ds.swzName, subst->swzName, LABEL_LEN - 1);
if (ds_value->ds.type == DVT_DB && subst->szModuleName)
strncpy(ds_value->ds.szModuleName, subst->szModuleName, MODULE_NAME_LEN - 1);
@@ -985,7 +985,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
hNewItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem);
if (hNewItem) {
- TCHAR buff[512], buff2[512];
+ wchar_t buff[512], buff2[512];
LPARAM tmpParam;
UINT tmpState;
@@ -1643,7 +1643,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &item);
if (hti.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT) || (hti.hItem == TVI_FIRST)) {
TVINSERTSTRUCT tvis;
- TCHAR swzName[256];
+ wchar_t swzName[256];
tvis.item.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.pszText = swzName;
@@ -1794,7 +1794,7 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
EnableControls(hwndDlg, false);
}
else if (iSel != LB_ERR) {
- TCHAR swzSkinName[256];
+ wchar_t swzSkinName[256];
if (ListBox_GetText(hwndList, iSel, swzSkinName) > 0)
ParseSkinFile(swzSkinName, false, true);
EnableControls(hwndDlg, true);
@@ -2026,8 +2026,8 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
switch (((LPNMHDR)lParam)->idFrom) {
case 0:
if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY) {
- TCHAR buff[256];
- TCHAR swzProtos[1024] = { 0 };
+ wchar_t buff[256];
+ wchar_t swzProtos[1024] = { 0 };
TVITEM item;
item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS));
diff --git a/plugins/TipperYM/src/options.h b/plugins/TipperYM/src/options.h
index f75e828d89..3161b5e2d4 100644
--- a/plugins/TipperYM/src/options.h
+++ b/plugins/TipperYM/src/options.h
@@ -35,13 +35,13 @@ Boston, MA 02111-1307, USA.
typedef struct {
UINT id, uintCoreIconId, uintResIconId;
- TCHAR *swzTooltip;
+ wchar_t *swzTooltip;
} OPTBUTTON;
typedef enum { DIT_ALL = 0, DIT_CONTACTS = 1, DIT_CHATS = 2 } DisplayItemType;
typedef struct {
- TCHAR swzLabel[LABEL_LEN];
- TCHAR swzValue[VALUE_LEN];
+ wchar_t swzLabel[LABEL_LEN];
+ wchar_t swzValue[VALUE_LEN];
DisplayItemType type;
bool bLineAbove, bValueNewline;
bool bIsVisible;
@@ -51,16 +51,16 @@ typedef struct {
// display item types
static struct {
DisplayItemType type;
- TCHAR *title;
+ wchar_t *title;
} displayItemTypes[] = {
- { DIT_ALL, LPGENT("Show for all contact types") },
- { DIT_CONTACTS, LPGENT("Show only for contacts") },
- { DIT_CHATS, LPGENT("Show only for chatrooms") }
+ { DIT_ALL, LPGENW("Show for all contact types") },
+ { DIT_CONTACTS, LPGENW("Show only for contacts") },
+ { DIT_CHATS, LPGENW("Show only for chatrooms") }
};
typedef enum { DVT_DB = 0, DVT_PROTODB = 1 } DisplaySubstType;
typedef struct {
- TCHAR swzName[LABEL_LEN];
+ wchar_t swzName[LABEL_LEN];
DisplaySubstType type;
char szModuleName[MODULE_NAME_LEN];
char szSettingName[SETTING_NAME_LEN];
@@ -85,28 +85,28 @@ typedef struct {
} MARGINS;
// tray tooltip items
-static TCHAR *trayTipItems[TRAYTIP_ITEMS_COUNT] = {
- LPGENT("Number of contacts"),
- LPGENT("Protocol lock status"),
- LPGENT("Logon time"),
- LPGENT("Unread emails"),
- LPGENT("Status"),
- LPGENT("Status message"),
- LPGENT("Extra status"),
- LPGENT("Listening to"),
- LPGENT("Favorite contacts"),
- LPGENT("Miranda uptime"),
- LPGENT("Contact list event")
+static wchar_t *trayTipItems[TRAYTIP_ITEMS_COUNT] = {
+ LPGENW("Number of contacts"),
+ LPGENW("Protocol lock status"),
+ LPGENW("Logon time"),
+ LPGENW("Unread emails"),
+ LPGENW("Status"),
+ LPGENW("Status message"),
+ LPGENW("Extra status"),
+ LPGENW("Listening to"),
+ LPGENW("Favorite contacts"),
+ LPGENW("Miranda uptime"),
+ LPGENW("Contact list event")
};
// extra icons
-static TCHAR *extraIconName[6] = {
- LPGENT("Status"),
- LPGENT("Extra status"),
- LPGENT("Jabber activity"),
- LPGENT("Gender"),
- LPGENT("Country flag"),
- LPGENT("Client")
+static wchar_t *extraIconName[6] = {
+ LPGENW("Status"),
+ LPGENW("Extra status"),
+ LPGENW("Jabber activity"),
+ LPGENW("Gender"),
+ LPGENW("Country flag"),
+ LPGENW("Client")
};
typedef struct {
@@ -148,9 +148,9 @@ typedef struct {
// tooltip skin
SkinMode skinMode;
- TCHAR szSkinName[256];
- TCHAR szPreviewFile[1024];
- TCHAR *szImgFile[SKIN_ITEMS_COUNT];
+ wchar_t szSkinName[256];
+ wchar_t szPreviewFile[1024];
+ wchar_t *szImgFile[SKIN_ITEMS_COUNT];
MARGINS margins[SKIN_ITEMS_COUNT];
TransformationMode transfMode[SKIN_ITEMS_COUNT];
PopupShowEffect showEffect;
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp
index 1a238d7ba9..2b0cbebb6b 100644
--- a/plugins/TipperYM/src/popwin.cpp
+++ b/plugins/TipperYM/src/popwin.cpp
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA.
#include "stdafx.h"
-__inline void AddRow(PopupWindowData *pwd, TCHAR *swzLabel, TCHAR *swzValue, char *szProto, bool bParseSmileys, bool bNewline, bool bLineAbove, bool bIsTitle = false, HICON hIcon = NULL)
+__inline void AddRow(PopupWindowData *pwd, wchar_t *swzLabel, wchar_t *swzValue, char *szProto, bool bParseSmileys, bool bNewline, bool bLineAbove, bool bIsTitle = false, HICON hIcon = NULL)
{
RowData *pRows = (RowData *)mir_realloc(pwd->rows, sizeof(RowData) * (pwd->iRowCount + 1));
if (pRows == NULL)
@@ -97,31 +97,31 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
// uid info
- TCHAR swzUid[256], swzUidName[256];
+ wchar_t swzUid[256], swzUidName[256];
if (Uid(0, pwd->clcit.szProto, swzUid, 256) && UidName(pwd->clcit.szProto, swzUidName, 253)) {
mir_tstrcat(swzUidName, L": ");
AddRow(pwd, swzUidName, swzUid, NULL, false, false, false);
}
// logon info
- TCHAR swzLogon[64];
+ wchar_t swzLogon[64];
if (TimestampToTimeDifference(NULL, pwd->clcit.szProto, "LogonTS", swzLogon, 59)) {
- TCHAR ago[96];
+ wchar_t ago[96];
mir_sntprintf(ago, TranslateT("%s ago"), swzLogon);
AddRow(pwd, TranslateT("Log on:"), ago, NULL, false, false, false);
}
// number of unread emails
- TCHAR swzEmailCount[64];
+ wchar_t swzEmailCount[64];
if (ProtoServiceExists(pwd->clcit.szProto, PS_GETUNREADEMAILCOUNT)) {
int iCount = (int)CallProtoService(pwd->clcit.szProto, PS_GETUNREADEMAILCOUNT, 0, 0);
if (iCount > 0) {
- _itot(iCount, swzEmailCount, 10);
+ _itow(iCount, swzEmailCount, 10);
AddRow(pwd, TranslateT("Unread emails:"), swzEmailCount, NULL, false, false, false);
}
}
- TCHAR *swzText = pcli->pfnGetStatusModeDescription(wStatus, 0);
+ wchar_t *swzText = pcli->pfnGetStatusModeDescription(wStatus, 0);
if (swzText)
AddRow(pwd, TranslateT("Status:"), swzText, NULL, false, false, false);
@@ -134,7 +134,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
// jabber mood or icq xstatus
- TCHAR *swzAdvTitle = GetJabberAdvStatusText(pwd->clcit.szProto, "mood", "title");
+ wchar_t *swzAdvTitle = GetJabberAdvStatusText(pwd->clcit.szProto, "mood", "title");
if (swzAdvTitle) {
StripBBCodesInPlace(swzAdvTitle);
AddRow(pwd, TranslateT("Mood:"), swzAdvTitle, pwd->clcit.szProto, true, false, true);
@@ -217,14 +217,14 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
SetTimer(hwnd, ID_TIMER_TRAYTIP, opt.iExpandTime, 0);
}
else {
- TCHAR buff[2048], *swzText = pwd->clcit.swzText;
+ wchar_t buff[2048], *swzText = pwd->clcit.swzText;
size_t iBuffPos, i = 0, iSize = mir_tstrlen(pwd->clcit.swzText);
bool bTopMessage = false;
- while (i < iSize && swzText[i] != _T('<')) {
+ while (i < iSize && swzText[i] != '<') {
iBuffPos = 0;
- while (swzText[i] != _T('\n') && swzText[i] != _T('\r') && i < iSize && iBuffPos < 2048) {
- if (swzText[i] != _T('\t'))
+ while (swzText[i] != '\n' && swzText[i] != '\r' && i < iSize && iBuffPos < 2048) {
+ if (swzText[i] != '\t')
buff[iBuffPos++] = swzText[i];
i++;
}
@@ -236,21 +236,21 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
bTopMessage = true;
}
- while (i < iSize && (swzText[i] == _T('\n') || swzText[i] == _T('\r')))
+ while (i < iSize && (swzText[i] == '\n' || swzText[i] == '\r'))
i++;
}
// parse bold bits into labels and the rest into items
while (i < iSize) {
- while (i + 2 < iSize && (swzText[i] != _T('<') || swzText[i + 1] != _T('b') || swzText[i + 2] != _T('>')))
+ while (i + 2 < iSize && (swzText[i] != '<' || swzText[i + 1] != 'b' || swzText[i + 2] != '>'))
i++;
i += 3;
iBuffPos = 0;
- while (i + 3 < iSize && iBuffPos < 2048 && (swzText[i] != _T('<')
- || swzText[i + 1] != _T('/') || swzText[i + 2] != _T('b') || swzText[i + 3] != _T('>'))) {
- if (swzText[i] != _T('\t'))
+ while (i + 3 < iSize && iBuffPos < 2048 && (swzText[i] != '<'
+ || swzText[i + 1] != '/' || swzText[i + 2] != 'b' || swzText[i + 3] != '>')) {
+ if (swzText[i] != '\t')
buff[iBuffPos++] = swzText[i];
i++;
}
@@ -269,8 +269,8 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
pwd->rows[pwd->iRowCount].bLineAbove = false;
iBuffPos = 0;
- while (i < iSize && iBuffPos < 2048 && swzText[i] != _T('\n')) {
- if (swzText[i] != _T('\t') && swzText[i] != _T('\r'))
+ while (i < iSize && iBuffPos < 2048 && swzText[i] != '\n') {
+ if (swzText[i] != '\t' && swzText[i] != '\r')
buff[iBuffPos++] = swzText[i];
i++;
}
@@ -306,7 +306,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (!opt.bWaitForContent)
db_unset(pwd->hContact, MODULE, "TempStatusMsg");
- _tcsncpy_s(pwd->swzTitle, pcli->pfnGetContactDisplayName(pwd->hContact, 0), _TRUNCATE);
+ wcsncpy_s(pwd->swzTitle, pcli->pfnGetContactDisplayName(pwd->hContact, 0), _TRUNCATE);
char *szProto = GetContactProto(pwd->hContact);
pwd->spiTitle = Smileys_PreParse(pwd->swzTitle, -1, szProto);
@@ -741,10 +741,10 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
HBITMAP hbmpAllItems = iconInfo.hbmColor;
DestroyIcon(hIcon);
- AppendMenu(hMenu, MF_STRING, COPYMENU_ALLITEMS_LABELS, LPGENT("Copy all items with labels"));
- AppendMenu(hMenu, MF_STRING, COPYMENU_ALLITEMS, LPGENT("Copy all items"));
+ AppendMenu(hMenu, MF_STRING, COPYMENU_ALLITEMS_LABELS, LPGENW("Copy all items with labels"));
+ AppendMenu(hMenu, MF_STRING, COPYMENU_ALLITEMS, LPGENW("Copy all items"));
if (pwd->clcit.szProto || pwd->hContact)
- AppendMenu(hMenu, MF_STRING, COPYMENU_AVATAR, LPGENT("Copy avatar"));
+ AppendMenu(hMenu, MF_STRING, COPYMENU_AVATAR, LPGENW("Copy avatar"));
AppendMenu(hMenu, MF_SEPARATOR, 2000, 0);
TranslateMenu(hMenu);
@@ -765,11 +765,11 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
for (int i = 0; i < pwd->iRowCount; i++) {
if (pwd->rows[i].swzValue) {
- TCHAR buff[128];
+ wchar_t buff[128];
int iLen = (int)mir_tstrlen(pwd->rows[i].swzValue);
if (iLen) {
if (iLen > MAX_VALUE_LEN) {
- _tcsncpy(buff, pwd->rows[i].swzValue, MAX_VALUE_LEN);
+ wcsncpy(buff, pwd->rows[i].swzValue, MAX_VALUE_LEN);
buff[MAX_VALUE_LEN] = 0;
mir_tstrcat(buff, L"...");
}
@@ -816,7 +816,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
else { // copy text
HGLOBAL hClipboardData = GlobalAlloc(GMEM_DDESHARE, 4096);
- TCHAR *pchData = (TCHAR *)GlobalLock(hClipboardData);
+ wchar_t *pchData = (wchar_t *)GlobalLock(hClipboardData);
pchData[0] = 0;
if (iSelItem == COPYMENU_ALLITEMS_LABELS) { // copy all items with labels
for (int i = 0; i < pwd->iRowCount; i++) {
@@ -965,7 +965,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
case PUM_SETSTATUSTEXT:
if (pwd && wParam == pwd->hContact) {
- db_set_ts(pwd->hContact, MODULE, "TempStatusMsg", (TCHAR *)lParam);
+ db_set_ts(pwd->hContact, MODULE, "TempStatusMsg", (wchar_t *)lParam);
pwd->bIsPainted = false;
pwd->bNeedRefresh = true;
SendMessage(hwnd, PUM_REFRESH_VALUES, TRUE, 0);
@@ -1035,7 +1035,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
pwd->iRowCount = 0;
DIListNode *node = opt.diList;
- TCHAR buff_label[LABEL_LEN], buff[VALUE_LEN];
+ wchar_t buff_label[LABEL_LEN], buff[VALUE_LEN];
while (node) {
if (node->di.bIsVisible && CheckContactType(pwd->hContact, node->di)) {
if (GetLabelText(pwd->hContact, node->di, buff_label, LABEL_LEN) && GetValueText(pwd->hContact, node->di, buff, VALUE_LEN)) {
@@ -1453,7 +1453,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
DWORD dwItems = (wParam == 0) ? opt.iFirstItems : opt.iSecondItems;
bool bFirstItem = true;
- TCHAR buff[64];
+ wchar_t buff[64];
int oldOrder = -1, iProtoCount = 0;
PROTOACCOUNT **accs;
@@ -1488,7 +1488,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
else buff[0] = 0;
- TCHAR swzProto[256];
+ wchar_t swzProto[256];
mir_tstrcpy(swzProto, pa->tszAccountName);
if (dwItems & TRAYTIP_LOCKSTATUS)
if (Proto_IsAccountLocked(pa))
@@ -1499,7 +1499,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (dwItems & TRAYTIP_LOGON) {
if (TimestampToTimeDifference(NULL, pa->szModuleName, "LogonTS", buff, 59)) {
- TCHAR ago[96];
+ wchar_t ago[96];
mir_sntprintf(ago, TranslateT("%s ago"), buff);
AddRow(pwd, TranslateT("Log on:"), ago, NULL, false, false, false);
}
@@ -1508,20 +1508,20 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (dwItems & TRAYTIP_UNREAD_EMAILS && ProtoServiceExists(pa->szModuleName, PS_GETUNREADEMAILCOUNT)) {
int iCount = (int)CallProtoService(pa->szModuleName, PS_GETUNREADEMAILCOUNT, 0, 0);
if (iCount > 0) {
- _itot(iCount, buff, 10);
+ _itow(iCount, buff, 10);
AddRow(pwd, TranslateT("Unread emails:"), buff, NULL, false, false, false);
}
}
if (dwItems & TRAYTIP_STATUS) {
- TCHAR *swzText = pcli->pfnGetStatusModeDescription(wStatus, 0);
+ wchar_t *swzText = pcli->pfnGetStatusModeDescription(wStatus, 0);
if (swzText)
AddRow(pwd, TranslateT("Status:"), swzText, NULL, false, false, false);
}
if (wStatus >= ID_STATUS_ONLINE && wStatus <= ID_STATUS_OUTTOLUNCH) {
if (dwItems & TRAYTIP_STATUS_MSG) {
- TCHAR *swzText = GetProtoStatusMessage(pa->szModuleName, wStatus);
+ wchar_t *swzText = GetProtoStatusMessage(pa->szModuleName, wStatus);
if (swzText) {
StripBBCodesInPlace(swzText);
AddRow(pwd, TranslateT("Status message:"), swzText, pa->szModuleName, true, true, false);
@@ -1531,13 +1531,13 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (dwItems & TRAYTIP_EXTRA_STATUS) {
// jabber mood or icq xstatus
- TCHAR *swzAdvTitle = GetJabberAdvStatusText(pa->szModuleName, "mood", "title");
+ wchar_t *swzAdvTitle = GetJabberAdvStatusText(pa->szModuleName, "mood", "title");
if (swzAdvTitle) {
StripBBCodesInPlace(swzAdvTitle);
AddRow(pwd, TranslateT("Mood:"), swzAdvTitle, pa->szModuleName, true, false, false);
mir_free(swzAdvTitle);
- TCHAR *swzAdvText = GetJabberAdvStatusText(pa->szModuleName, "mood", "text");
+ wchar_t *swzAdvText = GetJabberAdvStatusText(pa->szModuleName, "mood", "text");
if (swzAdvText) {
StripBBCodesInPlace(swzAdvText);
AddRow(pwd, L"", swzAdvText, pa->szModuleName, true, true, false);
@@ -1555,7 +1555,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
// xstatus message
- TCHAR *swzAdvText = GetProtoExtraStatusMessage(pa->szModuleName);
+ wchar_t *swzAdvText = GetProtoExtraStatusMessage(pa->szModuleName);
if (swzAdvText) {
StripBBCodesInPlace(swzAdvText);
AddRow(pwd, L"", swzAdvText, pa->szModuleName, true, true, false);
@@ -1564,14 +1564,14 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
}
- TCHAR *swzActTitle = GetJabberAdvStatusText(pa->szModuleName, "activity", "title");
+ wchar_t *swzActTitle = GetJabberAdvStatusText(pa->szModuleName, "activity", "title");
if (swzActTitle) {
StripBBCodesInPlace(swzActTitle);
AddRow(pwd, TranslateT("Activity:"), swzActTitle, pa->szModuleName, true, false, false);
mir_free(swzActTitle);
}
- TCHAR *swzActText = GetJabberAdvStatusText(pa->szModuleName, "activity", "text");
+ wchar_t *swzActText = GetJabberAdvStatusText(pa->szModuleName, "activity", "text");
if (swzActText) {
StripBBCodesInPlace(swzActText);
AddRow(pwd, L"", swzActText, pa->szModuleName, true, true, false);
@@ -1580,7 +1580,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
if (dwItems & TRAYTIP_LISTENINGTO) {
- TCHAR *swzListening = GetListeningTo(pa->szModuleName);
+ wchar_t *swzListening = GetListeningTo(pa->szModuleName);
if (swzListening) {
StripBBCodesInPlace(swzListening);
AddRow(pwd, TranslateT("Listening to:"), swzListening, NULL, false, true, false);
@@ -1592,8 +1592,8 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (dwItems & TRAYTIP_FAVCONTACTS) {
if (db_get_dw(0, MODULE, "FavouriteContactsCount", 0)) {
- TCHAR swzName[256];
- TCHAR swzStatus[256];
+ wchar_t swzName[256];
+ wchar_t swzStatus[256];
bool bTitlePainted = false;
int iCount = 0, iCountOnline = 0;
@@ -1618,9 +1618,9 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
bTitlePainted = true;
}
- TCHAR *swzNick = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *swzNick = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0);
if (opt.iFavoriteContFlags & FAVCONT_APPEND_PROTO) {
- TCHAR *swzProto = a2t(proto);
+ wchar_t *swzProto = a2t(proto);
mir_sntprintf(swzName, L"%s (%s)", swzNick, swzProto);
mir_free(swzProto);
}
@@ -1652,11 +1652,11 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
if (dwItems & TRAYTIP_CLIST_EVENT && pwd->clcit.swzText) {
- TCHAR *pchBr = _tcschr(pwd->clcit.swzText, '\n');
- TCHAR *pchBold = _tcsstr(pwd->clcit.swzText, L"<b>");
+ wchar_t *pchBr = wcschr(pwd->clcit.swzText, '\n');
+ wchar_t *pchBold = wcsstr(pwd->clcit.swzText, L"<b>");
if (!pchBold || pchBold != pwd->clcit.swzText) {
- TCHAR swzText[256];
+ wchar_t swzText[256];
mir_tstrcpy(swzText, pwd->clcit.swzText);
if (pchBr) swzText[pchBr - pwd->clcit.swzText] = 0;
AddRow(pwd, swzText, L"", NULL, false, true, false, true, Skin_LoadIcon(SKINICON_OTHER_FILLEDBLOB));
diff --git a/plugins/TipperYM/src/popwin.h b/plugins/TipperYM/src/popwin.h
index 92ac1e2855..d63ca07b33 100644
--- a/plugins/TipperYM/src/popwin.h
+++ b/plugins/TipperYM/src/popwin.h
@@ -89,12 +89,12 @@ typedef struct {
HANDLE hItem; //handle to group or contact
POINT ptCursor;
RECT rcItem;
- TCHAR *swzText; // for tips with specific text
+ wchar_t *swzText; // for tips with specific text
char *szProto; // for proto tips
} CLCINFOTIPEX;
typedef struct {
- TCHAR *swzLabel, *swzValue;
+ wchar_t *swzLabel, *swzValue;
HICON hIcon;
bool bValueNewline;
bool bLineAbove;
@@ -110,7 +110,7 @@ typedef struct {
MCONTACT hContact;
int iIconIndex;
CLCINFOTIPEX clcit;
- TCHAR swzTitle[TITLE_TEXT_LEN];
+ wchar_t swzTitle[TITLE_TEXT_LEN];
SMILEYPARSEINFO spiTitle;
RowData *rows;
int iRowCount;
@@ -132,7 +132,7 @@ typedef struct {
LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
-extern int IsTrayProto(const TCHAR *swzProto, BOOL bExtendedTip);
+extern int IsTrayProto(const wchar_t *swzProto, BOOL bExtendedTip);
#endif
diff --git a/plugins/TipperYM/src/preset_items.cpp b/plugins/TipperYM/src/preset_items.cpp
index 764264c42d..e29ca11708 100644
--- a/plugins/TipperYM/src/preset_items.cpp
+++ b/plugins/TipperYM/src/preset_items.cpp
@@ -22,42 +22,42 @@ Boston, MA 02111-1307, USA.
PRESETITEM presetItems[] =
{
- "account", LPGENT("Account"), LPGENT("Account:"), L"%sys:account%", 0, 0, 0,
- "birth", LPGENT("Birthday"), LPGENT("Birthday:"), L"%birthday_date% (%birthday_age%) @ Next: %birthday_next%", "birthdate", "birthage", "birthnext",
- "client", LPGENT("Client"), LPGENT("Client:"), L"%raw:/MirVer%", 0, 0, 0,
- "email", LPGENT("Email"), LPGENT("Email:"), L"%raw:/e-mail%", 0, 0, 0,
- "gender", LPGENT("Gender"), LPGENT("Gender:"), L"%gender%", 0, 0, 0,
- "homepage", LPGENT("Homepage"), LPGENT("Homepage:"), L"%raw:/Homepage%", 0, 0, 0,
- "id", LPGENT("Identifier"), L"%sys:uidname|UID^!MetaContacts%:", L"%sys:uid%", 0, 0, 0,
- "idle", LPGENT("Idle"), LPGENT("Idle:"), L"%idle% (%idle_diff% ago)", "idle", "idlediff", 0,
+ "account", LPGENW("Account"), LPGENW("Account:"), L"%sys:account%", 0, 0, 0,
+ "birth", LPGENW("Birthday"), LPGENW("Birthday:"), L"%birthday_date% (%birthday_age%) @ Next: %birthday_next%", "birthdate", "birthage", "birthnext",
+ "client", LPGENW("Client"), LPGENW("Client:"), L"%raw:/MirVer%", 0, 0, 0,
+ "email", LPGENW("Email"), LPGENW("Email:"), L"%raw:/e-mail%", 0, 0, 0,
+ "gender", LPGENW("Gender"), LPGENW("Gender:"), L"%gender%", 0, 0, 0,
+ "homepage", LPGENW("Homepage"), LPGENW("Homepage:"), L"%raw:/Homepage%", 0, 0, 0,
+ "id", LPGENW("Identifier"), L"%sys:uidname|UID^!MetaContacts%:", L"%sys:uid%", 0, 0, 0,
+ "idle", LPGENW("Idle"), LPGENW("Idle:"), L"%idle% (%idle_diff% ago)", "idle", "idlediff", 0,
"ip", L"IP", L"IP:", L"%ip%", "ip", 0, 0,
- "ipint", LPGENT("IP internal"), LPGENT("IP internal:"), L"%ip_internal%", "ipint", 0, 0,
- "lastmsg", LPGENT("Last message"), LPGENT("Last message: (%sys:last_msg_reltime% ago)"), L"%sys:last_msg%", 0, 0, 0,
- "listening", LPGENT("Listening to"), LPGENT("Listening to:"), L"%raw:/ListeningTo%", 0, 0, 0,
- "name", LPGENT("Name"), LPGENT("Name:"), L"%raw:/FirstName|% %raw:/LastName%", 0, 0, 0,
- "received", LPGENT("Number of received messages"), LPGENT("Number of msg [IN]:"), L"%sys:msg_count_in%", 0, 0, 0,
- "sended", LPGENT("Number of sent messages"), LPGENT("Number of msg [OUT]:"), L"%sys:msg_count_out%", 0, 0, 0,
- "status", LPGENT("Status"), LPGENT("Status:"), L"%Status%", "status", 0, 0,
- "statusmsg", LPGENT("Status message"), LPGENT("Status message:"), L"%sys:status_msg%", 0, 0, 0,
- "time", LPGENT("Contact time"), LPGENT("Time:"), L"%sys:time%", 0, 0, 0,
- "xtitle", LPGENT("xStatus title"), LPGENT("xStatus title:"), L"%xsname%", "xname", 0, 0,
- "xtext", LPGENT("xStatus text"), LPGENT("xStatus text:"), L"%raw:/XStatusMsg%", 0, 0, 0,
- "acttitle", LPGENT("[jabber.dll] Activity title"), LPGENT("Activity title:"), L"%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/title%", 0, 0, 0,
- "acttext", LPGENT("[jabber.dll] Activity text"), LPGENT("Activity text:"), L"%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/text%", 0, 0, 0,
- "lastseentime", LPGENT("[seenplugin.dll] Last seen time"), LPGENT("Last seen time:"), L"%lastseen_date% @ %lastseen_time%", "lsdate", "lstime", 0,
- "lastseenstatus", LPGENT("[seenplugin.dll] Last seen status"), LPGENT("Last seen status:"), L"%lastseen_status% (%lastseen_ago% ago)", "lsstatus", "lsago", 0,
- "cond", LPGENT("[weather.dll] Condition"), LPGENT("Condition:"), L"%raw:Current/Condition%", 0, 0, 0,
- "humidity", LPGENT("[weather.dll] Humidity"), LPGENT("Humidity:"), L"%raw:Current/Humidity%", 0, 0, 0,
- "minmaxtemp", LPGENT("[weather.dll] Max/Min temperature"), LPGENT("Max/Min:"), L"%raw:Current/High%/%raw:Current/Low%", 0, 0, 0,
- "moon", LPGENT("[weather.dll] Moon"), LPGENT("Moon:"), L"%raw:Current/Moon%", 0, 0, 0,
- "pressure", LPGENT("[weather.dll] Pressure"), LPGENT("Pressure:"), L"%raw:Current/Pressure% (%raw:Current/Pressure Tendency%)", 0, 0, 0,
- "sunrise", LPGENT("[weather.dll] Sunrise"), LPGENT("Sunrise:"), L"%raw:Current/Sunrise%", 0, 0, 0,
- "sunset", LPGENT("[weather.dll] Sunset"), LPGENT("Sunset:"), L"%raw:Current/Sunset%", 0, 0, 0,
- "temp", LPGENT("[weather.dll] Temperature"), LPGENT("Temperature:"), L"%raw:Current/Temperature%", 0, 0, 0,
- "uptime", LPGENT("[weather.dll] Update time"), LPGENT("Update time:"), L"%raw:Current/Update%", 0, 0, 0,
- "uvindex", LPGENT("[weather.dll] UV Index"), LPGENT("UV Index:"), L"%raw:Current/UV% - %raw:Current/UVI%", 0, 0, 0,
- "vis", LPGENT("[weather.dll] Visibility"), LPGENT("Visibility:"), L"%raw:Current/Visibility%", 0, 0, 0,
- "wind", LPGENT("[weather.dll] Wind"), LPGENT("Wind:"), L"%raw:Current/Wind Direction% (%raw:Current/Wind Direction DEG%)/%raw:Current/Wind Speed%", 0, 0, 0,
+ "ipint", LPGENW("IP internal"), LPGENW("IP internal:"), L"%ip_internal%", "ipint", 0, 0,
+ "lastmsg", LPGENW("Last message"), LPGENW("Last message: (%sys:last_msg_reltime% ago)"), L"%sys:last_msg%", 0, 0, 0,
+ "listening", LPGENW("Listening to"), LPGENW("Listening to:"), L"%raw:/ListeningTo%", 0, 0, 0,
+ "name", LPGENW("Name"), LPGENW("Name:"), L"%raw:/FirstName|% %raw:/LastName%", 0, 0, 0,
+ "received", LPGENW("Number of received messages"), LPGENW("Number of msg [IN]:"), L"%sys:msg_count_in%", 0, 0, 0,
+ "sended", LPGENW("Number of sent messages"), LPGENW("Number of msg [OUT]:"), L"%sys:msg_count_out%", 0, 0, 0,
+ "status", LPGENW("Status"), LPGENW("Status:"), L"%Status%", "status", 0, 0,
+ "statusmsg", LPGENW("Status message"), LPGENW("Status message:"), L"%sys:status_msg%", 0, 0, 0,
+ "time", LPGENW("Contact time"), LPGENW("Time:"), L"%sys:time%", 0, 0, 0,
+ "xtitle", LPGENW("xStatus title"), LPGENW("xStatus title:"), L"%xsname%", "xname", 0, 0,
+ "xtext", LPGENW("xStatus text"), LPGENW("xStatus text:"), L"%raw:/XStatusMsg%", 0, 0, 0,
+ "acttitle", LPGENW("[jabber.dll] Activity title"), LPGENW("Activity title:"), L"%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/title%", 0, 0, 0,
+ "acttext", LPGENW("[jabber.dll] Activity text"), LPGENW("Activity text:"), L"%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/text%", 0, 0, 0,
+ "lastseentime", LPGENW("[seenplugin.dll] Last seen time"), LPGENW("Last seen time:"), L"%lastseen_date% @ %lastseen_time%", "lsdate", "lstime", 0,
+ "lastseenstatus", LPGENW("[seenplugin.dll] Last seen status"), LPGENW("Last seen status:"), L"%lastseen_status% (%lastseen_ago% ago)", "lsstatus", "lsago", 0,
+ "cond", LPGENW("[weather.dll] Condition"), LPGENW("Condition:"), L"%raw:Current/Condition%", 0, 0, 0,
+ "humidity", LPGENW("[weather.dll] Humidity"), LPGENW("Humidity:"), L"%raw:Current/Humidity%", 0, 0, 0,
+ "minmaxtemp", LPGENW("[weather.dll] Max/Min temperature"), LPGENW("Max/Min:"), L"%raw:Current/High%/%raw:Current/Low%", 0, 0, 0,
+ "moon", LPGENW("[weather.dll] Moon"), LPGENW("Moon:"), L"%raw:Current/Moon%", 0, 0, 0,
+ "pressure", LPGENW("[weather.dll] Pressure"), LPGENW("Pressure:"), L"%raw:Current/Pressure% (%raw:Current/Pressure Tendency%)", 0, 0, 0,
+ "sunrise", LPGENW("[weather.dll] Sunrise"), LPGENW("Sunrise:"), L"%raw:Current/Sunrise%", 0, 0, 0,
+ "sunset", LPGENW("[weather.dll] Sunset"), LPGENW("Sunset:"), L"%raw:Current/Sunset%", 0, 0, 0,
+ "temp", LPGENW("[weather.dll] Temperature"), LPGENW("Temperature:"), L"%raw:Current/Temperature%", 0, 0, 0,
+ "uptime", LPGENW("[weather.dll] Update time"), LPGENW("Update time:"), L"%raw:Current/Update%", 0, 0, 0,
+ "uvindex", LPGENW("[weather.dll] UV Index"), LPGENW("UV Index:"), L"%raw:Current/UV% - %raw:Current/UVI%", 0, 0, 0,
+ "vis", LPGENW("[weather.dll] Visibility"), LPGENW("Visibility:"), L"%raw:Current/Visibility%", 0, 0, 0,
+ "wind", LPGENW("[weather.dll] Wind"), LPGENW("Wind:"), L"%raw:Current/Wind Direction% (%raw:Current/Wind Direction DEG%)/%raw:Current/Wind Speed%", 0, 0, 0,
0, 0, 0, 0, 0, 0, 0
};
diff --git a/plugins/TipperYM/src/preset_items.h b/plugins/TipperYM/src/preset_items.h
index 8b07f0069c..a402cca5d6 100644
--- a/plugins/TipperYM/src/preset_items.h
+++ b/plugins/TipperYM/src/preset_items.h
@@ -25,15 +25,15 @@ Boston, MA 02111-1307, USA.
typedef struct {
char *szID;
- TCHAR *swzName;
- TCHAR *swzLabel;
- TCHAR *swzValue;
+ wchar_t *swzName;
+ wchar_t *swzLabel;
+ wchar_t *swzValue;
char *szNeededSubst[MAX_PRESET_SUBST_COUNT];
} PRESETITEM;
typedef struct {
char *szID;
- TCHAR *swzName;
+ wchar_t *swzName;
DisplaySubstType type;
char *szModuleName;
char *szSettingName;
diff --git a/plugins/TipperYM/src/skin_parser.cpp b/plugins/TipperYM/src/skin_parser.cpp
index 9f4416e51b..8bcb23daca 100644
--- a/plugins/TipperYM/src/skin_parser.cpp
+++ b/plugins/TipperYM/src/skin_parser.cpp
@@ -26,7 +26,7 @@ int RefreshSkinList(HWND hwndDlg)
ListBox_ResetContent(hwndSkins);
ListBox_AddString(hwndSkins, TranslateT("# Solid color fill"));
- TCHAR szDirSave[1024];
+ wchar_t szDirSave[1024];
GetCurrentDirectory(1024, szDirSave);
SetCurrentDirectory(SKIN_FOLDER);
@@ -56,7 +56,7 @@ int RefreshSkinList(HWND hwndDlg)
return ListBox_SelectString(GetDlgItem(hwndDlg, IDC_LB_SKINS), -1, opt.szSkinName);
}
-bool FileExists(TCHAR *filename)
+bool FileExists(wchar_t *filename)
{
HANDLE hFile = CreateFile(filename, 0, 0, 0, OPEN_EXISTING, 0, 0);
if (hFile != INVALID_HANDLE_VALUE)
@@ -68,14 +68,14 @@ bool FileExists(TCHAR *filename)
return false;
}
-void ParseAboutPart(FILE *fp, TCHAR *buff, TCHAR *szSkinName)
+void ParseAboutPart(FILE *fp, wchar_t *buff, wchar_t *szSkinName)
{
myfgets(buff, 1024, fp);
while (buff[0] != '[')
{
if (buff[0] != ';')
{
- TCHAR *pch = _tcschr(buff, '=');
+ wchar_t *pch = wcschr(buff, '=');
if (pch++)
{
while (pch && (*pch == ' ' || *pch == '\t'))
@@ -83,11 +83,11 @@ void ParseAboutPart(FILE *fp, TCHAR *buff, TCHAR *szSkinName)
if (pch)
{
- if (_tcsstr(buff, L"author"))
+ if (wcsstr(buff, L"author"))
{}
- else if (_tcsstr(buff, L"preview"))
+ else if (wcsstr(buff, L"preview"))
{
- TCHAR szImgPath[1024];
+ wchar_t szImgPath[1024];
mir_sntprintf(szImgPath, L"%s\\%s\\%s", SKIN_FOLDER, szSkinName, pch);
if (FileExists(szImgPath))
mir_tstrcpy(opt.szPreviewFile, szImgPath);
@@ -101,7 +101,7 @@ void ParseAboutPart(FILE *fp, TCHAR *buff, TCHAR *szSkinName)
}
}
-void ParseImagePart(FILE *fp, TCHAR *buff, int iPart)
+void ParseImagePart(FILE *fp, wchar_t *buff, int iPart)
{
opt.szImgFile[iPart] = NULL;
opt.transfMode[iPart] = TM_NONE;
@@ -115,7 +115,7 @@ void ParseImagePart(FILE *fp, TCHAR *buff, int iPart)
{
if (buff[0] != ';')
{
- TCHAR *pch = _tcschr(buff, '=');
+ wchar_t *pch = wcschr(buff, '=');
if (pch++)
{
while (pch && (*pch == ' ' || *pch == '\t'))
@@ -123,13 +123,13 @@ void ParseImagePart(FILE *fp, TCHAR *buff, int iPart)
if (pch)
{
- if (_tcsstr(buff, L"image"))
+ if (wcsstr(buff, L"image"))
{
- TCHAR szImgPath[1024];
+ wchar_t szImgPath[1024];
mir_sntprintf(szImgPath, L"%s\\%s\\%s", SKIN_FOLDER, opt.szSkinName, pch);
opt.szImgFile[iPart] = mir_tstrdup(szImgPath);
}
- else if (_tcsstr(buff, L"tm"))
+ else if (wcsstr(buff, L"tm"))
{
if (!mir_tstrcmpi(pch, L"TM_NONE"))
opt.transfMode[iPart] = TM_NONE;
@@ -150,14 +150,14 @@ void ParseImagePart(FILE *fp, TCHAR *buff, int iPart)
else
opt.transfMode[iPart] = TM_NONE;
}
- else if (_tcsstr(buff, L"left"))
- opt.margins[iPart].left = _ttoi(pch);
- else if (_tcsstr(buff, L"top"))
- opt.margins[iPart].top = _ttoi(pch);
- else if (_tcsstr(buff, L"right"))
- opt.margins[iPart].right = _ttoi(pch);
- else if (_tcsstr(buff, L"bottom"))
- opt.margins[iPart].bottom = _ttoi(pch);
+ else if (wcsstr(buff, L"left"))
+ opt.margins[iPart].left = _wtoi(pch);
+ else if (wcsstr(buff, L"top"))
+ opt.margins[iPart].top = _wtoi(pch);
+ else if (wcsstr(buff, L"right"))
+ opt.margins[iPart].right = _wtoi(pch);
+ else if (wcsstr(buff, L"bottom"))
+ opt.margins[iPart].bottom = _wtoi(pch);
}
}
}
@@ -167,25 +167,25 @@ void ParseImagePart(FILE *fp, TCHAR *buff, int iPart)
}
}
-char *GetSettingName(TCHAR *szValue, char *szPostfix, char *buff, size_t buffsize)
+char *GetSettingName(wchar_t *szValue, char *szPostfix, char *buff, size_t buffsize)
{
buff[0] = 0;
- if (_tcsstr(szValue, L"traytitle"))
+ if (wcsstr(szValue, L"traytitle"))
mir_snprintf(buff, buffsize, "FontTrayTitle%s", szPostfix);
- else if (_tcsstr(szValue, L"title"))
+ else if (wcsstr(szValue, L"title"))
mir_snprintf(buff, buffsize, "FontFirst%s", szPostfix);
- else if (_tcsstr(szValue, L"label"))
+ else if (wcsstr(szValue, L"label"))
mir_snprintf(buff, buffsize, "FontLabels%s", szPostfix);
- else if (_tcsstr(szValue, L"value"))
+ else if (wcsstr(szValue, L"value"))
mir_snprintf(buff, buffsize, "FontValues%s", szPostfix);
- else if (_tcsstr(szValue, L"divider"))
+ else if (wcsstr(szValue, L"divider"))
mir_snprintf(buff, buffsize, "Divider%s", szPostfix);
return buff[0] ? buff : NULL;
}
-void ParseFontPart(FILE *fp, TCHAR *buff)
+void ParseFontPart(FILE *fp, wchar_t *buff)
{
char szSetting[64];
@@ -194,7 +194,7 @@ void ParseFontPart(FILE *fp, TCHAR *buff)
{
if (buff[0] != ';')
{
- TCHAR *pch = _tcschr(buff, '=');
+ wchar_t *pch = wcschr(buff, '=');
if (pch++)
{
while (pch && (*pch == ' ' || *pch == '\t'))
@@ -202,7 +202,7 @@ void ParseFontPart(FILE *fp, TCHAR *buff)
if (pch)
{
- if (_tcsstr(buff, L"face"))
+ if (wcsstr(buff, L"face"))
{
if (GetSettingName(buff, "", szSetting, sizeof(szSetting) - 1))
{
@@ -212,45 +212,45 @@ void ParseFontPart(FILE *fp, TCHAR *buff)
db_set_ts(0, MODULE, szSetting, pch);
}
}
- else if (_tcsstr(buff, L"color"))
+ else if (wcsstr(buff, L"color"))
{
if (GetSettingName(buff, "Col", szSetting, sizeof(szSetting) - 1))
{
- BYTE r = _ttoi(pch);
- pch = _tcschr(pch, ' ');
+ BYTE r = _wtoi(pch);
+ pch = wcschr(pch, ' ');
if (++pch)
{
- BYTE g = _ttoi(pch);
- pch = _tcschr(pch, ' ');
+ BYTE g = _wtoi(pch);
+ pch = wcschr(pch, ' ');
if (++pch)
{
- BYTE b = _ttoi(pch);
+ BYTE b = _wtoi(pch);
COLORREF color = RGB(r, g ,b);
db_set_dw(0, MODULE, szSetting, color);
}
}
}
}
- else if (_tcsstr(buff, L"size"))
+ else if (wcsstr(buff, L"size"))
{
if (GetSettingName(buff, "Size", szSetting, sizeof(szSetting) - 1))
{
HDC hdc = GetDC(0);
- int size = -MulDiv(_ttoi(pch), GetDeviceCaps(hdc, LOGPIXELSY), 72);
+ int size = -MulDiv(_wtoi(pch), GetDeviceCaps(hdc, LOGPIXELSY), 72);
db_set_b(0, MODULE, szSetting, (BYTE)size);
ReleaseDC(0, hdc);
}
}
- else if (_tcsstr(buff, L"effect"))
+ else if (wcsstr(buff, L"effect"))
{
if (GetSettingName(buff, "Sty", szSetting, sizeof(szSetting) - 1))
{
BYTE effect = 0;
- if (_tcsstr(pch, L"font_bold"))
+ if (wcsstr(pch, L"font_bold"))
effect |= DBFONTF_BOLD;
- if (_tcsstr(pch, L"font_italic"))
+ if (wcsstr(pch, L"font_italic"))
effect |= DBFONTF_ITALIC;
- if (_tcsstr(pch, L"font_underline"))
+ if (wcsstr(pch, L"font_underline"))
effect |= DBFONTF_UNDERLINE;
db_set_b(0, MODULE, szSetting, effect);
@@ -265,14 +265,14 @@ void ParseFontPart(FILE *fp, TCHAR *buff)
}
}
-void ParseAppearancePart(FILE *fp, TCHAR *buff)
+void ParseAppearancePart(FILE *fp, wchar_t *buff)
{
myfgets(buff, 1024, fp);
while (buff[0] != '[')
{
if (buff[0] != ';')
{
- TCHAR *pch = _tcschr(buff, '=');
+ wchar_t *pch = wcschr(buff, '=');
if (pch++)
{
while (pch && (*pch == ' ' || *pch == '\t'))
@@ -280,24 +280,24 @@ void ParseAppearancePart(FILE *fp, TCHAR *buff)
if (pch)
{
- if (_tcsstr(buff, L"general-padding"))
- opt.iPadding = _ttoi(pch);
- else if (_tcsstr(buff, L"title-indent"))
- opt.iTitleIndent = _ttoi(pch);
- else if (_tcsstr(buff, L"text-indent"))
- opt.iTextIndent = _ttoi(pch);
- else if (_tcsstr(buff, L"value-indent"))
- opt.iValueIndent = _ttoi(pch);
- else if (_tcsstr(buff, L"text-padding"))
- opt.iTextPadding = _ttoi(pch);
- else if (_tcsstr(buff, L"outer-avatar-padding"))
- opt.iOuterAvatarPadding = _ttoi(pch);
- else if (_tcsstr(buff, L"inner-avatar-padding"))
- opt.iInnerAvatarPadding = _ttoi(pch);
- else if (_tcsstr(buff, L"sidebar-width"))
- opt.iSidebarWidth = _ttoi(pch);
- else if (_tcsstr(buff, L"opacity"))
- opt.iOpacity = _ttoi(pch);
+ if (wcsstr(buff, L"general-padding"))
+ opt.iPadding = _wtoi(pch);
+ else if (wcsstr(buff, L"title-indent"))
+ opt.iTitleIndent = _wtoi(pch);
+ else if (wcsstr(buff, L"text-indent"))
+ opt.iTextIndent = _wtoi(pch);
+ else if (wcsstr(buff, L"value-indent"))
+ opt.iValueIndent = _wtoi(pch);
+ else if (wcsstr(buff, L"text-padding"))
+ opt.iTextPadding = _wtoi(pch);
+ else if (wcsstr(buff, L"outer-avatar-padding"))
+ opt.iOuterAvatarPadding = _wtoi(pch);
+ else if (wcsstr(buff, L"inner-avatar-padding"))
+ opt.iInnerAvatarPadding = _wtoi(pch);
+ else if (wcsstr(buff, L"sidebar-width"))
+ opt.iSidebarWidth = _wtoi(pch);
+ else if (wcsstr(buff, L"opacity"))
+ opt.iOpacity = _wtoi(pch);
}
}
}
@@ -307,14 +307,14 @@ void ParseAppearancePart(FILE *fp, TCHAR *buff)
}
}
-void ParseOtherPart(FILE *fp, TCHAR *buff)
+void ParseOtherPart(FILE *fp, wchar_t *buff)
{
myfgets(buff, 1024, fp);
while (buff[0] != '[')
{
if (buff[0] != ';')
{
- TCHAR *pch = _tcschr(buff, '=');
+ wchar_t *pch = wcschr(buff, '=');
if (pch++)
{
while (pch && (*pch == ' ' || *pch == '\t'))
@@ -322,9 +322,9 @@ void ParseOtherPart(FILE *fp, TCHAR *buff)
if (pch)
{
- if (_tcsstr(buff, L"enable-coloring"))
+ if (wcsstr(buff, L"enable-coloring"))
{
- if (_tcsstr(pch, L"false"))
+ if (wcsstr(pch, L"false"))
opt.iEnableColoring = -1;
}
}
@@ -336,9 +336,9 @@ void ParseOtherPart(FILE *fp, TCHAR *buff)
}
}
-void ParseSkinFile(TCHAR *szSkinName, bool bStartup, bool bOnlyPreview)
+void ParseSkinFile(wchar_t *szSkinName, bool bStartup, bool bOnlyPreview)
{
- TCHAR szDirSave[1024], buff[1024];
+ wchar_t szDirSave[1024], buff[1024];
if (opt.skinMode == SM_OBSOLOTE && bStartup)
return;
@@ -354,7 +354,7 @@ void ParseSkinFile(TCHAR *szSkinName, bool bStartup, bool bOnlyPreview)
HANDLE hFind = FindFirstFile(L"*.tsf", &ffd);
if (hFind != INVALID_HANDLE_VALUE)
{
- FILE *fp = _tfopen(ffd.cFileName, L"r");
+ FILE *fp = _wfopen(ffd.cFileName, L"r");
if (fp)
{
myfgets(buff, 1024, fp);
diff --git a/plugins/TipperYM/src/skin_parser.h b/plugins/TipperYM/src/skin_parser.h
index ca83f47915..c7981709b2 100644
--- a/plugins/TipperYM/src/skin_parser.h
+++ b/plugins/TipperYM/src/skin_parser.h
@@ -26,5 +26,5 @@ typedef enum {
} SkinMode;
int RefreshSkinList(HWND hwndDlg);
-void ParseSkinFile(TCHAR *szSkinName, bool bStartup, bool bOnlyPreview);
+void ParseSkinFile(wchar_t *szSkinName, bool bStartup, bool bOnlyPreview);
#endif \ No newline at end of file
diff --git a/plugins/TipperYM/src/stdafx.h b/plugins/TipperYM/src/stdafx.h
index b0bd0ad7df..b6facc2c8d 100644
--- a/plugins/TipperYM/src/stdafx.h
+++ b/plugins/TipperYM/src/stdafx.h
@@ -66,9 +66,9 @@ Boston, MA 02111-1307, USA.
#include "preset_items.h"
#include "translations.h"
-#define MODULE "Tipper"
-#define MODULE_ITEMS "Tipper_Items"
-#define DEFAULT_SKIN_FOLDER "Skins\\Tipper"
+#define MODULE "Tipper"
+#define MODULE_ITEMS "Tipper_Items"
+#define DEFAULT_SKIN_FOLDER L"Skins\\Tipper"
extern HMODULE hInst;
@@ -80,6 +80,6 @@ extern int iCodePage;
extern FI_INTERFACE *fii;
extern TOOLTIPSKIN skin;
-extern TCHAR SKIN_FOLDER[256];
+extern wchar_t SKIN_FOLDER[256];
extern int ReloadFont(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/TipperYM/src/str_utils.cpp b/plugins/TipperYM/src/str_utils.cpp
index 63ccd39165..ccc537581a 100644
--- a/plugins/TipperYM/src/str_utils.cpp
+++ b/plugins/TipperYM/src/str_utils.cpp
@@ -67,34 +67,34 @@ bool utf2a(const char *us, char *buff, int bufflen)
}
-bool t2w(const TCHAR *ts, wchar_t *buff, int bufflen)
+bool t2w(const wchar_t *ts, wchar_t *buff, int bufflen)
{
wcsncpy(buff, ts, bufflen);
return true;
}
-bool w2t(const wchar_t *ws, TCHAR *buff, int bufflen)
+bool w2t(const wchar_t *ws, wchar_t *buff, int bufflen)
{
wcsncpy(buff, ws, bufflen);
return true;
}
-bool t2a(const TCHAR *ts, char *buff, int bufflen)
+bool t2a(const wchar_t *ts, char *buff, int bufflen)
{
return w2a(ts, buff, bufflen);
}
-bool a2t(const char *as, TCHAR *buff, int bufflen)
+bool a2t(const char *as, wchar_t *buff, int bufflen)
{
return a2w(as, buff, bufflen);
}
-bool t2utf(const TCHAR *ts, char *buff, int bufflen)
+bool t2utf(const wchar_t *ts, char *buff, int bufflen)
{
return w2utf(ts, buff, bufflen);
}
-bool utf2t(const char *us, TCHAR *buff, int bufflen)
+bool utf2t(const char *us, wchar_t *buff, int bufflen)
{
return utf2w(us, buff, bufflen);
}
@@ -161,40 +161,40 @@ char *a2utf(const char *as)
return ret;
}
-TCHAR *w2t(const wchar_t *ws)
+wchar_t *w2t(const wchar_t *ws)
{
return mir_wstrdup(ws);
}
-wchar_t *t2w(const TCHAR *ts)
+wchar_t *t2w(const wchar_t *ts)
{
return mir_tstrdup(ts);
}
-char *t2a(const TCHAR *ts)
+char *t2a(const wchar_t *ts)
{
return w2a(ts);
}
-TCHAR *a2t(const char *as)
+wchar_t *a2t(const char *as)
{
return a2w(as);
}
-TCHAR *utf2t(const char *utfs)
+wchar_t *utf2t(const char *utfs)
{
return utf2w(utfs);
}
-char *t2utf(const TCHAR *ts)
+char *t2utf(const wchar_t *ts)
{
return w2utf(ts);
}
-TCHAR *myfgets(TCHAR *Buf, int MaxCount, FILE *File)
+wchar_t *myfgets(wchar_t *Buf, int MaxCount, FILE *File)
{
- _fgetts(Buf, MaxCount, File);
+ fgetws(Buf, MaxCount, File);
for (size_t i = mir_tstrlen(Buf) - 1; ; i--)
{
if (Buf[i] == '\n' || Buf[i] == ' ')
diff --git a/plugins/TipperYM/src/str_utils.h b/plugins/TipperYM/src/str_utils.h
index 26fbb613fa..4beca4e51b 100644
--- a/plugins/TipperYM/src/str_utils.h
+++ b/plugins/TipperYM/src/str_utils.h
@@ -32,14 +32,14 @@ bool w2utf(const wchar_t *ws, char *buff, int bufflen);
bool a2utf(const char *as, char *buff, int bufflen);
bool utf2a(const char *ws, char *buff, int bufflen);
-bool t2w(const TCHAR *ts, wchar_t *buff, int bufflen);
-bool w2t(const wchar_t *ws, TCHAR *buff, int bufflen);
+bool t2w(const wchar_t *ts, wchar_t *buff, int bufflen);
+bool w2t(const wchar_t *ws, wchar_t *buff, int bufflen);
-bool t2a(const TCHAR *ts, char *buff, int bufflen);
-bool a2t(const char *as, TCHAR *buff, int bufflen);
+bool t2a(const wchar_t *ts, char *buff, int bufflen);
+bool a2t(const char *as, wchar_t *buff, int bufflen);
-bool t2utf(const TCHAR *ts, char *buff, int bufflen);
-bool utf2t(const char *us, TCHAR *buff, int bufflen);
+bool t2utf(const wchar_t *ts, char *buff, int bufflen);
+bool utf2t(const char *us, wchar_t *buff, int bufflen);
// remember to free return value
wchar_t *a2w(const char *as);
@@ -51,16 +51,16 @@ char *w2utf(const wchar_t *ws);
char *utf2a(const char *us);
char *a2utf(const char *as);
-wchar_t *t2w(const TCHAR *ts);
-TCHAR *w2t(const wchar_t *ws);
+wchar_t *t2w(const wchar_t *ts);
+wchar_t *w2t(const wchar_t *ws);
-TCHAR *utf2t(const char *us);
-char *t2utf(const TCHAR *ts);
+wchar_t *utf2t(const char *us);
+char *t2utf(const wchar_t *ts);
-char *t2a(const TCHAR *ts);
-TCHAR *a2t(const char *as);
+char *t2a(const wchar_t *ts);
+wchar_t *a2t(const char *as);
-TCHAR *myfgets(TCHAR *Buf, int MaxCount, FILE *File);
+wchar_t *myfgets(wchar_t *Buf, int MaxCount, FILE *File);
#endif
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp
index fb0674de07..071e73c212 100644
--- a/plugins/TipperYM/src/subst.cpp
+++ b/plugins/TipperYM/src/subst.cpp
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA.
#include "stdafx.h"
-bool DBGetContactSettingAsString(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+bool DBGetContactSettingAsString(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
buff[0] = 0;
@@ -31,13 +31,13 @@ bool DBGetContactSettingAsString(MCONTACT hContact, const char *szModuleName, co
if (!db_get(hContact, szModuleName, szSettingName, &dbv)) {
switch (dbv.type) {
case DBVT_BYTE:
- _itot(dbv.bVal, buff, 10);
+ _itow(dbv.bVal, buff, 10);
break;
case DBVT_WORD:
- _ltot(dbv.wVal, buff, 10);
+ _ltow(dbv.wVal, buff, 10);
break;
case DBVT_DWORD:
- _ltot(dbv.dVal, buff, 10);
+ _ltow(dbv.dVal, buff, 10);
break;
case DBVT_ASCIIZ:
if (dbv.pszVal) a2t(dbv.pszVal, buff, bufflen);
@@ -76,7 +76,7 @@ bool CheckContactType(MCONTACT hContact, const DISPLAYITEM &di)
return false;
}
-void StripBBCodesInPlace(TCHAR *ptszText)
+void StripBBCodesInPlace(wchar_t *ptszText)
{
if (!db_get_b(0, MODULE, "StripBBCodes", 1))
return;
@@ -96,21 +96,21 @@ void StripBBCodesInPlace(TCHAR *ptszText)
if (iRead > iLen)
break;
- if (iLen - iRead >= 3 && (_tcsnicmp(ptszText + iRead, L"[b]", 3) == 0 || _tcsnicmp(ptszText + iRead, L"[i]", 3) == 0))
+ if (iLen - iRead >= 3 && (wcsnicmp(ptszText + iRead, L"[b]", 3) == 0 || wcsnicmp(ptszText + iRead, L"[i]", 3) == 0))
iRead += 3;
- else if (iLen - iRead >= 4 && (_tcsnicmp(ptszText + iRead, L"[/b]", 4) == 0 || _tcsnicmp(ptszText + iRead, L"[/i]", 4) == 0))
+ else if (iLen - iRead >= 4 && (wcsnicmp(ptszText + iRead, L"[/b]", 4) == 0 || wcsnicmp(ptszText + iRead, L"[/i]", 4) == 0))
iRead += 4;
- else if (iLen - iRead >= 6 && (_tcsnicmp(ptszText + iRead, L"[color", 6) == 0)) {
+ else if (iLen - iRead >= 6 && (wcsnicmp(ptszText + iRead, L"[color", 6) == 0)) {
while (iRead < iLen && ptszText[iRead] != ']') iRead++;
iRead++;// skip the ']'
}
- else if (iLen - iRead >= 8 && (_tcsnicmp(ptszText + iRead, L"[/color]", 8) == 0))
+ else if (iLen - iRead >= 8 && (wcsnicmp(ptszText + iRead, L"[/color]", 8) == 0))
iRead += 8;
- else if (iLen - iRead >= 5 && (_tcsnicmp(ptszText + iRead, L"[size", 5) == 0)) {
+ else if (iLen - iRead >= 5 && (wcsnicmp(ptszText + iRead, L"[size", 5) == 0)) {
while (iRead < iLen && ptszText[iRead] != ']') iRead++;
iRead++;// skip the ']'
}
- else if (iLen - iRead >= 7 && (_tcsnicmp(ptszText + iRead, L"[/size]", 7) == 0))
+ else if (iLen - iRead >= 7 && (wcsnicmp(ptszText + iRead, L"[/size]", 7) == 0))
iRead += 7;
else {
if (ptszText[iRead] != ptszText[iWrite]) ptszText[iWrite] = ptszText[iRead];
@@ -131,14 +131,14 @@ DWORD LastMessageTimestamp(MCONTACT hContact, bool received)
return 0;
}
-void FormatTimestamp(DWORD ts, char *szFormat, TCHAR *buff, int bufflen)
+void FormatTimestamp(DWORD ts, char *szFormat, wchar_t *buff, int bufflen)
{
- TCHAR swzForm[16];
+ wchar_t swzForm[16];
a2t(szFormat, swzForm, 16);
TimeZone_ToStringT(ts, swzForm, buff, bufflen);
}
-bool Uid(MCONTACT hContact, char *szProto, TCHAR *buff, int bufflen)
+bool Uid(MCONTACT hContact, char *szProto, wchar_t *buff, int bufflen)
{
char *tmpProto = (hContact ? GetContactProto(hContact) : szProto);
if (tmpProto) {
@@ -150,7 +150,7 @@ bool Uid(MCONTACT hContact, char *szProto, TCHAR *buff, int bufflen)
return false;
}
-bool UidName(char *szProto, TCHAR *buff, int bufflen)
+bool UidName(char *szProto, wchar_t *buff, int bufflen)
{
if (szProto) {
char *szUidName = (char*)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDTEXT, 0);
@@ -162,7 +162,7 @@ bool UidName(char *szProto, TCHAR *buff, int bufflen)
return false;
}
-TCHAR* GetLastMessageText(MCONTACT hContact, bool received)
+wchar_t* GetLastMessageText(MCONTACT hContact, bool received)
{
for (MEVENT hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) {
DBEVENTINFO dbei = { sizeof(dbei) };
@@ -173,8 +173,8 @@ TCHAR* GetLastMessageText(MCONTACT hContact, bool received)
if (dbei.cbBlob == 0 || dbei.pBlob == 0)
return 0;
- TCHAR *buff = DbGetEventTextT( &dbei, CP_ACP );
- TCHAR *swzMsg = mir_tstrdup(buff);
+ wchar_t *buff = DbGetEventTextT( &dbei, CP_ACP );
+ wchar_t *swzMsg = mir_tstrdup(buff);
mir_free(buff);
StripBBCodesInPlace(swzMsg);
@@ -206,9 +206,9 @@ bool CanRetrieveStatusMsg(MCONTACT hContact, char *szProto)
return false;
}
-TCHAR* GetStatusMessageText(MCONTACT hContact)
+wchar_t* GetStatusMessageText(MCONTACT hContact)
{
- TCHAR *swzMsg = NULL;
+ wchar_t *swzMsg = NULL;
DBVARIANT dbv;
char *szProto = GetContactProto(hContact);
@@ -246,7 +246,7 @@ TCHAR* GetStatusMessageText(MCONTACT hContact)
return swzMsg;
}
-bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int bufflen)
+bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int bufflen)
{
bool recv = false;
@@ -268,7 +268,7 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff
else if (szProto) {
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (pa && pa->tszAccountName) {
- _tcsncpy(buff, pa->tszAccountName, bufflen);
+ wcsncpy(buff, pa->tszAccountName, bufflen);
return true;
}
else
@@ -284,17 +284,17 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff
return UidName(szProto, buff, bufflen);
}
else if (!mir_tstrcmp(swzRawSpec, L"status_msg")) {
- TCHAR *swzMsg = GetStatusMessageText(hContact);
+ wchar_t *swzMsg = GetStatusMessageText(hContact);
if (swzMsg) {
- _tcsncpy(buff, swzMsg, bufflen);
+ wcsncpy(buff, swzMsg, bufflen);
mir_free(swzMsg);
return true;
}
}
else if ((recv = !mir_tstrcmp(swzRawSpec, L"last_msg")) || !mir_tstrcmp(swzRawSpec, L"last_msg_out")) {
- TCHAR *swzMsg = GetLastMessageText(hContact, recv);
+ wchar_t *swzMsg = GetLastMessageText(hContact, recv);
if (swzMsg) {
- _tcsncpy(buff, swzMsg, bufflen);
+ wcsncpy(buff, swzMsg, bufflen);
mir_free(swzMsg);
return true;
}
@@ -305,9 +305,9 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff
if (!hSubContact)
return false;
- TCHAR *swzNick = pcli->pfnGetContactDisplayName(hSubContact, 0);
+ wchar_t *swzNick = pcli->pfnGetContactDisplayName(hSubContact, 0);
if (swzNick)
- _tcsncpy(buff, swzNick, bufflen);
+ wcsncpy(buff, swzNick, bufflen);
return true;
}
else if (!mir_tstrcmp(swzRawSpec, L"meta_subuid")) {
@@ -418,7 +418,7 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff
return false;
}
-bool GetSubstText(MCONTACT hContact, const DISPLAYSUBST &ds, TCHAR *buff, int bufflen)
+bool GetSubstText(MCONTACT hContact, const DISPLAYSUBST &ds, wchar_t *buff, int bufflen)
{
TranslateFunc *transFunc = 0;
for (int i = 0; i < iTransFuncsCount; i++)
@@ -445,7 +445,7 @@ bool GetSubstText(MCONTACT hContact, const DISPLAYSUBST &ds, TCHAR *buff, int bu
return false;
}
-bool GetRawSubstText(MCONTACT hContact, char *szRawSpec, TCHAR *buff, int bufflen)
+bool GetRawSubstText(MCONTACT hContact, char *szRawSpec, wchar_t *buff, int bufflen)
{
size_t lenght = mir_strlen(szRawSpec);
for (size_t i = 0; i < lenght; i++) {
@@ -466,7 +466,7 @@ bool GetRawSubstText(MCONTACT hContact, char *szRawSpec, TCHAR *buff, int buffle
return false;
}
-bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsFirst, TCHAR *swzDest, size_t iDestLen)
+bool ApplySubst(MCONTACT hContact, const wchar_t *swzSource, bool parseTipperVarsFirst, wchar_t *swzDest, size_t iDestLen)
{
// hack - allow empty strings before passing to variables (note - zero length strings return false after this)
if (swzDest && swzSource && (*swzSource == 0)) {
@@ -475,18 +475,18 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
}
// pass to variables plugin if available
- TCHAR *swzVarSrc = (parseTipperVarsFirst ? mir_tstrdup(swzSource) : variables_parsedup((TCHAR *)swzSource, 0, hContact));
+ wchar_t *swzVarSrc = (parseTipperVarsFirst ? mir_tstrdup(swzSource) : variables_parsedup((wchar_t *)swzSource, 0, hContact));
size_t iSourceLen = mir_tstrlen(swzVarSrc);
size_t si = 0, di = 0, v = 0;
- TCHAR swzVName[LABEL_LEN], swzRep[VALUE_LEN], swzAlt[VALUE_LEN];
+ wchar_t swzVName[LABEL_LEN], swzRep[VALUE_LEN], swzAlt[VALUE_LEN];
while (si < iSourceLen && di < iDestLen - 1) {
- if (swzVarSrc[si] == _T('%')) {
+ if (swzVarSrc[si] == '%') {
si++;
v = 0;
while (si < iSourceLen && v < LABEL_LEN - 1) {
- if (swzVarSrc[si] == _T('%'))
+ if (swzVarSrc[si] == '%')
break;
swzVName[v] = swzVarSrc[si];
@@ -494,7 +494,7 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
}
if (v == 0) // bSubst len is 0 - just a % symbol
- swzDest[di] = _T('%');
+ swzDest[di] = '%';
else if (si < iSourceLen) // we found end %
{
swzVName[v] = 0;
@@ -502,7 +502,7 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
bool bAltSubst = false, bSubst = false;
// apply only to specific protocols
- TCHAR *p = _tcsrchr(swzVName, _T('^')); // use last '^', so if you want a ^ in swzAlt text, you can just put a '^' on the end
+ wchar_t *p = wcsrchr(swzVName, '^'); // use last '^', so if you want a ^ in swzAlt text, you can just put a '^' on the end
if (p) {
*p = 0;
p++;
@@ -519,7 +519,7 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
goto empty;
bool negate = false;
- if (*p == _T('!')) {
+ if (*p == '!') {
p++;
if (*p == 0) goto error;
negate = true;
@@ -529,11 +529,11 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
bool spec = false;
int len;
- TCHAR *last = _tcsrchr(p, _T(','));
+ wchar_t *last = wcsrchr(p, ',');
if (!last) last = p;
while (p <= last + 1) {
- len = (int)_tcscspn(p, L",");
+ len = (int)wcscspn(p, L",");
t2a(p, sproto, len);
sproto[len] = 0;
p += len + 1;
@@ -551,17 +551,17 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
// get alternate text, if bSubst fails
swzAlt[0] = 0;
- p = _tcschr(swzVName, _T('|')); // use first '|' - so you can use the '|' symbol in swzAlt text
+ p = wcschr(swzVName, '|'); // use first '|' - so you can use the '|' symbol in swzAlt text
if (p) {
*p = 0; // clip swzAlt from swzVName
p++;
- if (mir_tstrlen(p) > 4 && _tcsncmp(p, L"raw:", 4) == 0) { // raw db substitution
+ if (mir_tstrlen(p) > 4 && wcsncmp(p, L"raw:", 4) == 0) { // raw db substitution
char raw_spec[LABEL_LEN];
p += 4;
t2a(p, raw_spec, LABEL_LEN);
GetRawSubstText(hContact, raw_spec, swzAlt, VALUE_LEN);
}
- else if (mir_tstrlen(p) > 4 && _tcsncmp(p, L"sys:", 4) == 0) { // 'system' substitution
+ else if (mir_tstrlen(p) > 4 && wcsncmp(p, L"sys:", 4) == 0) { // 'system' substitution
p += 4;
GetSysSubstText(hContact, p, swzAlt, VALUE_LEN);
}
@@ -578,7 +578,7 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
if (ds_node)
GetSubstText(hContact, ds_node->ds, swzAlt, VALUE_LEN);
else {
- _tcsncpy(swzAlt, p, VALUE_LEN);
+ wcsncpy(swzAlt, p, VALUE_LEN);
bAltSubst = true;
}
}
@@ -588,13 +588,13 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
}
// get bSubst text
- if (v > 4 && _tcsncmp(swzVName, L"raw:", 4) == 0) // raw db substitution
+ if (v > 4 && wcsncmp(swzVName, L"raw:", 4) == 0) // raw db substitution
{
char raw_spec[LABEL_LEN];
t2a(&swzVName[4], raw_spec, LABEL_LEN);
bSubst = GetRawSubstText(hContact, raw_spec, swzRep, VALUE_LEN);
}
- else if (v > 4 && _tcsncmp(swzVName, L"sys:", 4) == 0) // 'system' substitution
+ else if (v > 4 && wcsncmp(swzVName, L"sys:", 4) == 0) // 'system' substitution
{
bSubst = GetSysSubstText(hContact, &swzVName[4], swzRep, VALUE_LEN);
}
@@ -616,12 +616,12 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
if (bSubst) {
size_t rep_len = mir_tstrlen(swzRep);
- _tcsncpy(&swzDest[di], swzRep, min(rep_len, iDestLen - di));
+ wcsncpy(&swzDest[di], swzRep, min(rep_len, iDestLen - di));
di += rep_len - 1; // -1 because we inc at bottom of loop
}
else if (bAltSubst) {
size_t alt_len = mir_tstrlen(swzAlt);
- _tcsncpy(&swzDest[di], swzAlt, min(alt_len, iDestLen - di));
+ wcsncpy(&swzDest[di], swzAlt, min(alt_len, iDestLen - di));
di += alt_len - 1; // -1 because we inc at bottom of loop
}
else goto empty; // empty value
@@ -640,14 +640,14 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
if (parseTipperVarsFirst) {
swzVarSrc = variables_parsedup(swzDest, 0, hContact);
- _tcsncpy(swzDest, swzVarSrc, iDestLen);
+ wcsncpy(swzDest, swzVarSrc, iDestLen);
mir_free(swzVarSrc);
}
// check for a 'blank' string - just spaces etc
for (si = 0; si <= di; si++) {
- if (swzDest[si] != 0 && swzDest[si] != _T(' ') && swzDest[si] != _T('\t') && swzDest[si] != _T('\r') && swzDest[si] != _T('\n'))
+ if (swzDest[si] != 0 && swzDest[si] != ' ' && swzDest[si] != '\t' && swzDest[si] != '\r' && swzDest[si] != '\n')
return true;
}
@@ -658,23 +658,23 @@ empty:
return false;
error:
- swzDest[0] = _T('*');
+ swzDest[0] = '*';
swzDest[1] = 0;
mir_free(swzVarSrc);
return true;
}
-bool GetLabelText(MCONTACT hContact, const DISPLAYITEM &di, TCHAR *buff, size_t bufflen)
+bool GetLabelText(MCONTACT hContact, const DISPLAYITEM &di, wchar_t *buff, size_t bufflen)
{
return ApplySubst(hContact, di.swzLabel, false, buff, bufflen);
}
-bool GetValueText(MCONTACT hContact, const DISPLAYITEM &di, TCHAR *buff, size_t bufflen)
+bool GetValueText(MCONTACT hContact, const DISPLAYITEM &di, wchar_t *buff, size_t bufflen)
{
return ApplySubst(hContact, di.swzValue, di.bParseTipperVarsFirst, buff, bufflen);
}
-void TruncateString(TCHAR *ptszText)
+void TruncateString(wchar_t *ptszText)
{
if (ptszText && opt.iLimitCharCount > 3) {
if ((int)mir_tstrlen(ptszText) > opt.iLimitCharCount) {
@@ -684,7 +684,7 @@ void TruncateString(TCHAR *ptszText)
}
}
-TCHAR* GetProtoStatusMessage(char *szProto, WORD wStatus)
+wchar_t* GetProtoStatusMessage(char *szProto, WORD wStatus)
{
if (!szProto || wStatus == ID_STATUS_OFFLINE)
return NULL;
@@ -694,9 +694,9 @@ TCHAR* GetProtoStatusMessage(char *szProto, WORD wStatus)
if (!(flags & Proto_Status2Flag(wStatus)))
return NULL;
- TCHAR *ptszText = (TCHAR *)CallProtoService(szProto, PS_GETMYAWAYMSG, 0, SGMA_TCHAR);
+ wchar_t *ptszText = (wchar_t *)CallProtoService(szProto, PS_GETMYAWAYMSG, 0, SGMA_TCHAR);
if ((INT_PTR)ptszText == CALLSERVICE_NOTFOUND)
- ptszText = (TCHAR *)CallService(MS_AWAYMSG_GETSTATUSMSGT, wStatus, (LPARAM)szProto);
+ ptszText = (wchar_t *)CallService(MS_AWAYMSG_GETSTATUSMSGT, wStatus, (LPARAM)szProto);
else if (ptszText == NULL) {
// try to use service without SGMA_TCHAR
@@ -719,14 +719,14 @@ TCHAR* GetProtoStatusMessage(char *szProto, WORD wStatus)
return ptszText;
}
-TCHAR* GetProtoExtraStatusTitle(char *szProto)
+wchar_t* GetProtoExtraStatusTitle(char *szProto)
{
if (!szProto)
return NULL;
- TCHAR *ptszText = db_get_tsa(0, szProto, "XStatusName");
+ wchar_t *ptszText = db_get_tsa(0, szProto, "XStatusName");
if (!ptszText) {
- TCHAR buff[256];
+ wchar_t buff[256];
if (EmptyXStatusToDefaultName(0, szProto, 0, buff, 256))
ptszText = mir_tstrdup(buff);
}
@@ -737,12 +737,12 @@ TCHAR* GetProtoExtraStatusTitle(char *szProto)
return ptszText;
}
-TCHAR* GetProtoExtraStatusMessage(char *szProto)
+wchar_t* GetProtoExtraStatusMessage(char *szProto)
{
if (!szProto)
return NULL;
- TCHAR *ptszText = db_get_tsa(0, szProto, "XStatusMsg");
+ wchar_t *ptszText = db_get_tsa(0, szProto, "XStatusMsg");
if (ptszText == NULL)
return NULL;
@@ -759,7 +759,7 @@ TCHAR* GetProtoExtraStatusMessage(char *szProto)
}
}
- TCHAR *tszParsed = variables_parse(ptszText, NULL, hContact);
+ wchar_t *tszParsed = variables_parse(ptszText, NULL, hContact);
if (tszParsed)
{
mir_free(ptszText);
@@ -773,26 +773,26 @@ TCHAR* GetProtoExtraStatusMessage(char *szProto)
return ptszText;
}
-TCHAR* GetListeningTo(char *szProto)
+wchar_t* GetListeningTo(char *szProto)
{
if (!szProto)
return NULL;
- TCHAR *ptszText = db_get_tsa(0, szProto, "ListeningTo");
+ wchar_t *ptszText = db_get_tsa(0, szProto, "ListeningTo");
if (opt.bLimitMsg)
TruncateString(ptszText);
return ptszText;
}
-TCHAR* GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szValue)
+wchar_t* GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szValue)
{
if (!szProto)
return NULL;
char szSetting[128];
mir_snprintf(szSetting, "%s/%s/%s", szProto, szSlot, szValue);
- TCHAR *ptszText = db_get_tsa(0, "AdvStatus", szSetting);
+ wchar_t *ptszText = db_get_tsa(0, "AdvStatus", szSetting);
if (opt.bLimitMsg)
TruncateString(ptszText);
diff --git a/plugins/TipperYM/src/subst.h b/plugins/TipperYM/src/subst.h
index 66b5712462..888ca5b9cb 100644
--- a/plugins/TipperYM/src/subst.h
+++ b/plugins/TipperYM/src/subst.h
@@ -21,25 +21,25 @@ Boston, MA 02111-1307, USA.
#ifndef _SUBST_INC
#define _SUBST_INC
-bool GetLabelText(MCONTACT hContact, const DISPLAYITEM &di, TCHAR *buff, size_t iBufflen);
-bool GetValueText(MCONTACT hContact, const DISPLAYITEM &di, TCHAR *buff, size_t iBufflen);
+bool GetLabelText(MCONTACT hContact, const DISPLAYITEM &di, wchar_t *buff, size_t iBufflen);
+bool GetValueText(MCONTACT hContact, const DISPLAYITEM &di, wchar_t *buff, size_t iBufflen);
bool CheckContactType(MCONTACT hContact, const DISPLAYITEM &di);
-void StripBBCodesInPlace(TCHAR *text);
+void StripBBCodesInPlace(wchar_t *text);
// can be used with hContact == 0 to get uid for a given proto
-bool UidName(char *szProto, TCHAR *buff, int bufflen);
-bool Uid(MCONTACT hContact, char *szProto, TCHAR *buff, int bufflen);
+bool UidName(char *szProto, wchar_t *buff, int bufflen);
+bool Uid(MCONTACT hContact, char *szProto, wchar_t *buff, int bufflen);
// get info for status and tray tooltip
-bool DBGetContactSettingAsString(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
+bool DBGetContactSettingAsString(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen);
bool CanRetrieveStatusMsg(MCONTACT hContact, char *szProto);
-TCHAR *GetProtoStatusMessage(char *szProto, WORD status);
-TCHAR *GetProtoExtraStatusTitle(char *szProto);
-TCHAR *GetProtoExtraStatusMessage(char *szProto);
-TCHAR *GetListeningTo(char *szProto);
-TCHAR *GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szValue);
+wchar_t *GetProtoStatusMessage(char *szProto, WORD status);
+wchar_t *GetProtoExtraStatusTitle(char *szProto);
+wchar_t *GetProtoExtraStatusMessage(char *szProto);
+wchar_t *GetListeningTo(char *szProto);
+wchar_t *GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szValue);
HICON GetJabberActivityIcon(MCONTACT hContact, char *szProto);
#endif
diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp
index 125867150e..770d1348ce 100644
--- a/plugins/TipperYM/src/tipper.cpp
+++ b/plugins/TipperYM/src/tipper.cpp
@@ -33,7 +33,7 @@ HANDLE hShowTipService, hShowTipWService, hHideTipService;
HANDLE hReloadFonts = NULL;
HANDLE hFolderChanged, hSkinFolder;
-TCHAR SKIN_FOLDER[256];
+wchar_t SKIN_FOLDER[256];
CLIST_INTERFACE *pcli = NULL;
FI_INTERFACE *fii = NULL;
@@ -117,15 +117,15 @@ int EventDeleted(WPARAM wParam, LPARAM lParam)
int ReloadSkinFolder(WPARAM, LPARAM)
{
- FoldersGetCustomPathT(hSkinFolder, SKIN_FOLDER, _countof(SKIN_FOLDER), _T(DEFAULT_SKIN_FOLDER));
+ FoldersGetCustomPathT(hSkinFolder, SKIN_FOLDER, _countof(SKIN_FOLDER), DEFAULT_SKIN_FOLDER);
return 0;
}
void InitFonts()
{
colourBg.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colourBg.group, LPGENT("Tooltips"));
- mir_tstrcpy(colourBg.name, LPGENT("Background"));
+ mir_tstrcpy(colourBg.group, LPGENW("Tooltips"));
+ mir_tstrcpy(colourBg.name, LPGENW("Background"));
mir_strcpy(colourBg.dbSettingsGroup, MODULE);
mir_strcpy(colourBg.setting, "ColourBg");
colourBg.defcolour = RGB(219, 219, 219);
@@ -133,8 +133,8 @@ void InitFonts()
ColourRegisterT(&colourBg);
colourBorder.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colourBorder.group, LPGENT("Tooltips"));
- mir_tstrcpy(colourBorder.name, LPGENT("Border"));
+ mir_tstrcpy(colourBorder.group, LPGENW("Tooltips"));
+ mir_tstrcpy(colourBorder.name, LPGENW("Border"));
mir_strcpy(colourBorder.dbSettingsGroup, MODULE);
mir_strcpy(colourBorder.setting, "BorderCol");
colourBorder.defcolour = 0;
@@ -142,8 +142,8 @@ void InitFonts()
ColourRegisterT(&colourBorder);
colourAvatarBorder.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colourAvatarBorder.group, LPGENT("Tooltips"));
- mir_tstrcpy(colourAvatarBorder.name, LPGENT("Avatar border"));
+ mir_tstrcpy(colourAvatarBorder.group, LPGENW("Tooltips"));
+ mir_tstrcpy(colourAvatarBorder.name, LPGENW("Avatar border"));
mir_strcpy(colourAvatarBorder.dbSettingsGroup, MODULE);
mir_strcpy(colourAvatarBorder.setting, "AvBorderCol");
colourAvatarBorder.defcolour = 0;
@@ -151,8 +151,8 @@ void InitFonts()
ColourRegisterT(&colourAvatarBorder);
colourDivider.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colourDivider.group, LPGENT("Tooltips"));
- mir_tstrcpy(colourDivider.name, LPGENT("Dividers"));
+ mir_tstrcpy(colourDivider.group, LPGENW("Tooltips"));
+ mir_tstrcpy(colourDivider.name, LPGENW("Dividers"));
mir_strcpy(colourDivider.dbSettingsGroup, MODULE);
mir_strcpy(colourDivider.setting, "DividerCol");
colourDivider.defcolour = 0;
@@ -160,8 +160,8 @@ void InitFonts()
ColourRegisterT(&colourDivider);
colourSidebar.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colourSidebar.group, LPGENT("Tooltips"));
- mir_tstrcpy(colourSidebar.name, LPGENT("Sidebar"));
+ mir_tstrcpy(colourSidebar.group, LPGENW("Tooltips"));
+ mir_tstrcpy(colourSidebar.name, LPGENW("Sidebar"));
mir_strcpy(colourSidebar.dbSettingsGroup, MODULE);
mir_strcpy(colourSidebar.setting, "SidebarCol");
colourSidebar.defcolour = RGB(192, 192, 192);
@@ -170,12 +170,12 @@ void InitFonts()
fontTitle.cbSize = sizeof(FontIDT);
fontTitle.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(fontTitle.group, LPGENT("Tooltips"));
- mir_tstrcpy(fontTitle.name, LPGENT("Title"));
+ mir_tstrcpy(fontTitle.group, LPGENW("Tooltips"));
+ mir_tstrcpy(fontTitle.name, LPGENW("Title"));
mir_strcpy(fontTitle.dbSettingsGroup, MODULE);
mir_strcpy(fontTitle.prefix, "FontFirst");
- mir_tstrcpy(fontTitle.backgroundGroup, LPGENT("Tooltips"));
- mir_tstrcpy(fontTitle.backgroundName, LPGENT("Background"));
+ mir_tstrcpy(fontTitle.backgroundGroup, LPGENW("Tooltips"));
+ mir_tstrcpy(fontTitle.backgroundName, LPGENW("Background"));
fontTitle.order = 0;
fontTitle.deffontsettings.charset = DEFAULT_CHARSET;
@@ -186,12 +186,12 @@ void InitFonts()
fontLabels.cbSize = sizeof(FontIDT);
fontLabels.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(fontLabels.group, LPGENT("Tooltips"));
- mir_tstrcpy(fontLabels.name, LPGENT("Labels"));
+ mir_tstrcpy(fontLabels.group, LPGENW("Tooltips"));
+ mir_tstrcpy(fontLabels.name, LPGENW("Labels"));
mir_strcpy(fontLabels.dbSettingsGroup, MODULE);
mir_strcpy(fontLabels.prefix, "FontLabels");
- mir_tstrcpy(fontLabels.backgroundGroup, LPGENT("Tooltips"));
- mir_tstrcpy(fontLabels.backgroundName, LPGENT("Background"));
+ mir_tstrcpy(fontLabels.backgroundGroup, LPGENW("Tooltips"));
+ mir_tstrcpy(fontLabels.backgroundName, LPGENW("Background"));
fontLabels.order = 1;
fontLabels.deffontsettings.charset = DEFAULT_CHARSET;
@@ -202,12 +202,12 @@ void InitFonts()
fontValues.cbSize = sizeof(FontIDT);
fontValues.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(fontValues.group, LPGENT("Tooltips"));
- mir_tstrcpy(fontValues.name, LPGENT("Values"));
+ mir_tstrcpy(fontValues.group, LPGENW("Tooltips"));
+ mir_tstrcpy(fontValues.name, LPGENW("Values"));
mir_strcpy(fontValues.dbSettingsGroup, MODULE);
mir_strcpy(fontValues.prefix, "FontValues");
- mir_tstrcpy(fontValues.backgroundGroup, LPGENT("Tooltips"));
- mir_tstrcpy(fontValues.backgroundName, LPGENT("Background"));
+ mir_tstrcpy(fontValues.backgroundGroup, LPGENW("Tooltips"));
+ mir_tstrcpy(fontValues.backgroundName, LPGENW("Background"));
fontValues.order = 2;
fontValues.deffontsettings.charset = DEFAULT_CHARSET;
@@ -218,12 +218,12 @@ void InitFonts()
fontTrayTitle.cbSize = sizeof(FontIDT);
fontTrayTitle.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(fontTrayTitle.group, LPGENT("Tooltips"));
- mir_tstrcpy(fontTrayTitle.name, LPGENT("Tray title"));
+ mir_tstrcpy(fontTrayTitle.group, LPGENW("Tooltips"));
+ mir_tstrcpy(fontTrayTitle.name, LPGENW("Tray title"));
mir_strcpy(fontTrayTitle.dbSettingsGroup, MODULE);
mir_strcpy(fontTrayTitle.prefix, "FontTrayTitle");
- mir_tstrcpy(fontTrayTitle.backgroundGroup, LPGENT("Tooltips"));
- mir_tstrcpy(fontTrayTitle.backgroundName, LPGENT("Background"));
+ mir_tstrcpy(fontTrayTitle.backgroundGroup, LPGENW("Tooltips"));
+ mir_tstrcpy(fontTrayTitle.backgroundName, LPGENW("Background"));
fontTrayTitle.order = 0;
fontTrayTitle.deffontsettings.charset = DEFAULT_CHARSET;
@@ -254,8 +254,8 @@ int ModulesLoaded(WPARAM, LPARAM)
hFolderChanged = HookEvent(ME_FOLDERS_PATH_CHANGED, ReloadSkinFolder);
- hSkinFolder = FoldersRegisterCustomPathT(LPGEN("Skins"), LPGEN("Tipper"), MIRANDA_PATHT L"\\" _T(DEFAULT_SKIN_FOLDER));
- FoldersGetCustomPathT(hSkinFolder, SKIN_FOLDER, _countof(SKIN_FOLDER), _T(DEFAULT_SKIN_FOLDER));
+ hSkinFolder = FoldersRegisterCustomPathT(LPGEN("Skins"), LPGEN("Tipper"), MIRANDA_PATHT L"\\" DEFAULT_SKIN_FOLDER);
+ FoldersGetCustomPathT(hSkinFolder, SKIN_FOLDER, _countof(SKIN_FOLDER), DEFAULT_SKIN_FOLDER);
InitTipperSmileys();
LoadOptions();
@@ -298,7 +298,7 @@ static INT_PTR ReloadSkin(WPARAM wParam, LPARAM lParam)
LoadOptions();
opt.skinMode = (SkinMode)wParam;
if (lParam != 0)
- _tcscpy_s(opt.szSkinName, _A2T((char*)(lParam)));
+ wcscpy_s(opt.szSkinName, _A2T((char*)(lParam)));
ParseSkinFile(opt.szSkinName, false, false);
ReloadFont(0, 0);
SaveOptions();
diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp
index b89c3c2b07..87679f08a7 100644
--- a/plugins/TipperYM/src/translations.cpp
+++ b/plugins/TipperYM/src/translations.cpp
@@ -63,14 +63,14 @@ void AddTranslation(DBVTranslation *newTrans)
mir_free(szName);
}
-TCHAR *NullTranslation(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *NullTranslation(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
if (DBGetContactSettingAsString(hContact, szModuleName, szSettingName, buff, bufflen))
return buff;
return NULL;
}
-TCHAR* TimestampToShortDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t* TimestampToShortDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0)
@@ -79,7 +79,7 @@ TCHAR* TimestampToShortDate(MCONTACT hContact, const char *szModuleName, const c
return TimeZone_ToStringT(ts, L"d", buff, bufflen);
}
-TCHAR* TimestampToLongDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t* TimestampToLongDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0)
@@ -88,7 +88,7 @@ TCHAR* TimestampToLongDate(MCONTACT hContact, const char *szModuleName, const ch
return TimeZone_ToStringT(ts, L"D", buff, bufflen);
}
-TCHAR* TimestampToTime(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t* TimestampToTime(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0)
@@ -97,7 +97,7 @@ TCHAR* TimestampToTime(MCONTACT hContact, const char *szModuleName, const char *
return TimeZone_ToStringT(ts, L"s", buff, bufflen);
}
-TCHAR* TimestampToTimeNoSecs(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t* TimestampToTimeNoSecs(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0)
@@ -106,7 +106,7 @@ TCHAR* TimestampToTimeNoSecs(MCONTACT hContact, const char *szModuleName, const
return TimeZone_ToStringT(ts, L"t", buff, bufflen);
}
-TCHAR* TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t* TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
DWORD t = (DWORD)time(0);
@@ -126,7 +126,7 @@ TCHAR* TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, co
return buff;
}
-TCHAR *SecondsToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *SecondsToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD diff = db_get_dw(hContact, szModuleName, szSettingName, 0);
int d = (diff / 60 / 60 / 24);
@@ -142,15 +142,15 @@ TCHAR *SecondsToTimeDifference(MCONTACT hContact, const char *szModuleName, cons
return buff;
}
-TCHAR *WordToStatusDesc(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *WordToStatusDesc(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
WORD wStatus = db_get_w(hContact, szModuleName, szSettingName, ID_STATUS_OFFLINE);
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
- _tcsncpy_s(buff, bufflen, szStatus, _TRUNCATE);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
+ wcsncpy_s(buff, bufflen, szStatus, _TRUNCATE);
return buff;
}
-TCHAR *ByteToYesNo(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *ByteToYesNo(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
@@ -158,9 +158,9 @@ TCHAR *ByteToYesNo(MCONTACT hContact, const char *szModuleName, const char *szSe
if (dbv.type == DBVT_BYTE)
{
if (dbv.bVal != 0)
- _tcsncpy(buff, L"Yes", bufflen);
+ wcsncpy(buff, L"Yes", bufflen);
else
- _tcsncpy(buff, L"No", bufflen);
+ wcsncpy(buff, L"No", bufflen);
buff[bufflen - 1] = 0;
db_free(&dbv);
return buff;
@@ -170,13 +170,13 @@ TCHAR *ByteToYesNo(MCONTACT hContact, const char *szModuleName, const char *szSe
return 0;
}
-TCHAR *ByteToGender(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *ByteToGender(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
BYTE val = (BYTE)db_get_b(hContact, szModuleName, szSettingName, 0);
if (val == 'F')
- _tcsncpy(buff, TranslateT("Female"), bufflen);
+ wcsncpy(buff, TranslateT("Female"), bufflen);
else if (val == 'M')
- _tcsncpy(buff, TranslateT("Male"), bufflen);
+ wcsncpy(buff, TranslateT("Male"), bufflen);
else
return 0;
@@ -184,7 +184,7 @@ TCHAR *ByteToGender(MCONTACT hContact, const char *szModuleName, const char *szS
return buff;
}
-TCHAR *WordToCountry(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *WordToCountry(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
char *szCountryName = 0;
WORD cid = (WORD)db_get_w(hContact, szModuleName, szSettingName, (WORD)-1);
@@ -199,7 +199,7 @@ TCHAR *WordToCountry(MCONTACT hContact, const char *szModuleName, const char *sz
return 0;
}
-TCHAR *DwordToIp(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *DwordToIp(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
DWORD ip = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ip) {
@@ -229,7 +229,7 @@ bool GetInt(const DBVARIANT &dbv, int *iVal)
return false;
}
-TCHAR *DayMonthYearToDate(MCONTACT hContact, const char *szModuleName, const char *prefix, TCHAR *buff, int bufflen)
+wchar_t *DayMonthYearToDate(MCONTACT hContact, const char *szModuleName, const char *prefix, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -259,7 +259,7 @@ TCHAR *DayMonthYearToDate(MCONTACT hContact, const char *szModuleName, const cha
time.tm_mon = month - 1;
time.tm_year = year - 1900;
- _tcsftime(buff, bufflen, L"%x", &time);
+ wcsftime(buff, bufflen, L"%x", &time);
return buff;
@@ -274,7 +274,7 @@ TCHAR *DayMonthYearToDate(MCONTACT hContact, const char *szModuleName, const cha
return 0;
}
-TCHAR *DayMonthYearToAge(MCONTACT hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+wchar_t *DayMonthYearToAge(MCONTACT hContact, const char *szModuleName, const char *szPrefix, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -323,7 +323,7 @@ TCHAR *DayMonthYearToAge(MCONTACT hContact, const char *szModuleName, const char
return 0;
}
-TCHAR *HoursMinutesSecondsToTime(MCONTACT hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+wchar_t *HoursMinutesSecondsToTime(MCONTACT hContact, const char *szModuleName, const char *szPrefix, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -367,7 +367,7 @@ TCHAR *HoursMinutesSecondsToTime(MCONTACT hContact, const char *szModuleName, co
return 0;
}
-TCHAR *HoursMinutesToTime(MCONTACT hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+wchar_t *HoursMinutesToTime(MCONTACT hContact, const char *szModuleName, const char *szPrefix, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -403,7 +403,7 @@ TCHAR *HoursMinutesToTime(MCONTACT hContact, const char *szModuleName, const cha
return 0;
}
-TCHAR *DmyToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+wchar_t *DmyToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szPrefix, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -505,7 +505,7 @@ TCHAR *DmyToTimeDifference(MCONTACT hContact, const char *szModuleName, const ch
return 0;
}
-TCHAR *DayMonthToDaysToNextBirthday(MCONTACT hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+wchar_t *DayMonthToDaysToNextBirthday(MCONTACT hContact, const char *szModuleName, const char *szPrefix, wchar_t *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -558,9 +558,9 @@ TCHAR *DayMonthToDaysToNextBirthday(MCONTACT hContact, const char *szModuleName,
}
-TCHAR *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
- TCHAR szDefaultName[1024];
+ wchar_t szDefaultName[1024];
CUSTOM_STATUS xstatus = {0};
DBVARIANT dbv;
@@ -569,7 +569,7 @@ TCHAR *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, co
{
if (!db_get_ts(hContact, szModuleName, szSettingName, &dbv))
{
- _tcsncpy(buff, TranslateTS(dbv.ptszVal), bufflen);
+ wcsncpy(buff, TranslateTS(dbv.ptszVal), bufflen);
buff[bufflen - 1] = 0;
return buff;
}
@@ -590,7 +590,7 @@ TCHAR *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, co
if (CallProtoService(szModuleName, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus))
return 0;
- _tcsncpy(buff, TranslateTS(szDefaultName), bufflen);
+ wcsncpy(buff, TranslateTS(szDefaultName), bufflen);
buff[bufflen - 1] = 0;
return buff;
}
@@ -598,7 +598,7 @@ TCHAR *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, co
return 0;
}
-TCHAR *TimezoneToTime(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *TimezoneToTime(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
int timezone = db_get_b(hContact,szModuleName,szSettingName,256);
if (timezone==256 || (char)timezone==-100)
@@ -623,7 +623,7 @@ TCHAR *TimezoneToTime(MCONTACT hContact, const char *szModuleName, const char *s
return buff;
}
-TCHAR *ByteToDay(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *ByteToDay(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
int iDay = db_get_w(hContact, szModuleName, szSettingName, -1);
if (iDay > -1 && iDay < 7)
@@ -636,7 +636,7 @@ TCHAR *ByteToDay(MCONTACT hContact, const char *szModuleName, const char *szSett
return 0;
}
-TCHAR *ByteToMonth(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *ByteToMonth(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
int iMonth = db_get_w(hContact, szModuleName, szSettingName, 0);
if (iMonth > 0 && iMonth < 13)
@@ -649,7 +649,7 @@ TCHAR *ByteToMonth(MCONTACT hContact, const char *szModuleName, const char *szSe
return 0;
}
-TCHAR *ByteToLanguage(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+wchar_t *ByteToLanguage(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
int iLang = db_get_b(hContact, szModuleName, szSettingName, 0);
if (iLang)
@@ -680,29 +680,29 @@ INT_PTR ServiceAddTranslation(WPARAM, LPARAM lParam)
static DBVTranslation internalTranslations[] =
{
- { NullTranslation, LPGENT("[No translation]") },
- { WordToStatusDesc, LPGENT("WORD to status description") },
- { TimestampToTime, LPGENT("DWORD timestamp to time") },
- { TimestampToTimeDifference, LPGENT("DWORD timestamp to time difference") },
- { ByteToYesNo, LPGENT("BYTE to Yes/No") },
- { ByteToGender, LPGENT("BYTE to Male/Female (ICQ)") },
- { WordToCountry, LPGENT("WORD to country name") },
- { DwordToIp, LPGENT("DWORD to IP address") },
- { DayMonthYearToDate, LPGENT("<prefix>Day|Month|Year to date") },
- { DayMonthYearToAge, LPGENT("<prefix>Day|Month|Year to age") },
- { HoursMinutesSecondsToTime, LPGENT("<prefix>Hours|Minutes|Seconds to time") },
- { DmyToTimeDifference, LPGENT("<prefix>Day|Month|Year|Hours|Minutes|Seconds to time difference") },
- { DayMonthToDaysToNextBirthday, LPGENT("<prefix>Day|Month to days to next birthday") },
- { TimestampToTimeNoSecs, LPGENT("DWORD timestamp to time (no seconds)") },
- { HoursMinutesToTime, LPGENT("<prefix>Hours|Minutes to time") },
- { TimestampToShortDate, LPGENT("DWORD timestamp to date (short)") },
- { TimestampToLongDate, LPGENT("DWORD timestamp to date (long)") },
- { EmptyXStatusToDefaultName, LPGENT("xStatus: empty xStatus name to default name") },
- { SecondsToTimeDifference, LPGENT("DWORD seconds to time difference") },
- { TimezoneToTime, LPGENT("BYTE timezone to time") },
- { ByteToDay, LPGENT("WORD to name of a day (0..6, 0 is Sunday)") },
- { ByteToMonth, LPGENT("WORD to name of a month (1..12, 1 is January)") },
- { ByteToLanguage, LPGENT("BYTE to language (ICQ)") },
+ { NullTranslation, LPGENW("[No translation]") },
+ { WordToStatusDesc, LPGENW("WORD to status description") },
+ { TimestampToTime, LPGENW("DWORD timestamp to time") },
+ { TimestampToTimeDifference, LPGENW("DWORD timestamp to time difference") },
+ { ByteToYesNo, LPGENW("BYTE to Yes/No") },
+ { ByteToGender, LPGENW("BYTE to Male/Female (ICQ)") },
+ { WordToCountry, LPGENW("WORD to country name") },
+ { DwordToIp, LPGENW("DWORD to IP address") },
+ { DayMonthYearToDate, LPGENW("<prefix>Day|Month|Year to date") },
+ { DayMonthYearToAge, LPGENW("<prefix>Day|Month|Year to age") },
+ { HoursMinutesSecondsToTime, LPGENW("<prefix>Hours|Minutes|Seconds to time") },
+ { DmyToTimeDifference, LPGENW("<prefix>Day|Month|Year|Hours|Minutes|Seconds to time difference") },
+ { DayMonthToDaysToNextBirthday, LPGENW("<prefix>Day|Month to days to next birthday") },
+ { TimestampToTimeNoSecs, LPGENW("DWORD timestamp to time (no seconds)") },
+ { HoursMinutesToTime, LPGENW("<prefix>Hours|Minutes to time") },
+ { TimestampToShortDate, LPGENW("DWORD timestamp to date (short)") },
+ { TimestampToLongDate, LPGENW("DWORD timestamp to date (long)") },
+ { EmptyXStatusToDefaultName, LPGENW("xStatus: empty xStatus name to default name") },
+ { SecondsToTimeDifference, LPGENW("DWORD seconds to time difference") },
+ { TimezoneToTime, LPGENW("BYTE timezone to time") },
+ { ByteToDay, LPGENW("WORD to name of a day (0..6, 0 is Sunday)") },
+ { ByteToMonth, LPGENW("WORD to name of a month (1..12, 1 is January)") },
+ { ByteToLanguage, LPGENW("BYTE to language (ICQ)") },
};
void InitTranslations()
diff --git a/plugins/TipperYM/src/translations.h b/plugins/TipperYM/src/translations.h
index 1ed2e8f53e..d981a2601c 100644
--- a/plugins/TipperYM/src/translations.h
+++ b/plugins/TipperYM/src/translations.h
@@ -117,9 +117,9 @@ static char *months[12] = {
void InitTranslations();
void DeinitTranslations();
-TCHAR *TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
-TCHAR *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
-TCHAR *WordToStatusDesc(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
+wchar_t *TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen);
+wchar_t *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen);
+wchar_t *WordToStatusDesc(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen);
#endif
diff --git a/plugins/Toaster/src/options.cpp b/plugins/Toaster/src/options.cpp
index d023d19d67..0dcfe12f64 100644
--- a/plugins/Toaster/src/options.cpp
+++ b/plugins/Toaster/src/options.cpp
@@ -46,10 +46,10 @@ void COptions::Enabled_OnChange(CCtrlCheck* chk)
int OnOptionsInitialized(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.ptszTitle = L"Popups"; //_T(MODULE);
+ odp.pwszTitle = L"Popups"; //_T(MODULE);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.position = -790000000;
- odp.ptszTab = _T(MODULE);
+ odp.pwszTab = _T(MODULE);
odp.pDialog = new COptions();
Options_AddPage(wParam, &odp);
diff --git a/plugins/Toaster/src/structs.h b/plugins/Toaster/src/structs.h
index d304141f2f..fe8a658850 100644
--- a/plugins/Toaster/src/structs.h
+++ b/plugins/Toaster/src/structs.h
@@ -3,8 +3,8 @@
struct ToastData : public MZeroedObject
{
MCONTACT hContact;
- TCHAR *tszTitle;
- TCHAR *tszText;
+ wchar_t *tszTitle;
+ wchar_t *tszText;
union
{
HICON hIcon;
@@ -15,7 +15,7 @@ struct ToastData : public MZeroedObject
WNDPROC pPopupProc;
void *vPopupData;
- ToastData(MCONTACT _hContact, const TCHAR *_tszTitle, const TCHAR *_tszText, HICON _hIcon = NULL) :
+ ToastData(MCONTACT _hContact, const wchar_t *_tszTitle, const wchar_t *_tszText, HICON _hIcon = NULL) :
hContact(_hContact),
tszTitle(mir_tstrdup(_tszTitle)),
tszText(mir_tstrdup(_tszText)),
@@ -24,7 +24,7 @@ struct ToastData : public MZeroedObject
pPopupProc(NULL),
vPopupData(NULL)
{}
- ToastData(MCONTACT _hContact, const TCHAR *_tszTitle, const TCHAR *_tszText, HBITMAP bmp = NULL) :
+ ToastData(MCONTACT _hContact, const wchar_t *_tszTitle, const wchar_t *_tszText, HBITMAP bmp = NULL) :
hContact(_hContact),
tszTitle(mir_tstrdup(_tszTitle)),
tszText(mir_tstrdup(_tszText)),
diff --git a/plugins/TooltipNotify/src/Tooltip.cpp b/plugins/TooltipNotify/src/Tooltip.cpp
index 2b5cc39063..9f9edc03e4 100644
--- a/plugins/TooltipNotify/src/Tooltip.cpp
+++ b/plugins/TooltipNotify/src/Tooltip.cpp
@@ -4,7 +4,7 @@
#include "stdafx.h"
-/*static*/ const TCHAR *CTooltip::s_szTooltipClass = L"MimTooltipNotify";
+/*static*/ const wchar_t *CTooltip::s_szTooltipClass = L"MimTooltipNotify";
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
@@ -192,9 +192,9 @@ void CTooltip::set_Position(INT x, INT y)
SetWindowPos(m_hWnd, 0, x, y, 0, 0, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE);
}
-void CTooltip::set_Text(const TCHAR* szText)
+void CTooltip::set_Text(const wchar_t* szText)
{
if (m_szText) free(m_szText);
- m_szText = _tcsdup(szText);
+ m_szText = wcsdup(szText);
}
diff --git a/plugins/TooltipNotify/src/Tooltip.h b/plugins/TooltipNotify/src/Tooltip.h
index 2ad5bea397..9e47040bf6 100644
--- a/plugins/TooltipNotify/src/Tooltip.h
+++ b/plugins/TooltipNotify/src/Tooltip.h
@@ -19,7 +19,7 @@ public:
void get_Rect(RECT *Rect) const;
void set_TransparentInput(BOOL bOnOff);
void set_Translucency(BYTE bAlpha);
- void set_Text(const TCHAR* szText);
+ void set_Text(const wchar_t* szText);
void set_Font(const LOGFONT& Font) { m_lfFont = Font; }
void set_TextColor(DWORD TextColor) { m_dwTextColor = TextColor; }
void set_BgColor(DWORD BgColor) { m_dwBgColor = BgColor; }
@@ -43,11 +43,11 @@ private:
DWORD m_dwTextColor;
DWORD m_dwBgColor;
LOGFONT m_lfFont;
- TCHAR *m_szText;
+ wchar_t *m_szText;
BYTE m_bAlpha;
BOOL m_bTranspInput;
BYTE m_bLDblClick;
CTooltipNotify *m_pTooltipNotify;
- static const TCHAR *s_szTooltipClass;
+ static const wchar_t *s_szTooltipClass;
};
diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp
index 439ca55f58..3bb08f45ad 100644
--- a/plugins/TooltipNotify/src/TooltipNotify.cpp
+++ b/plugins/TooltipNotify/src/TooltipNotify.cpp
@@ -20,17 +20,17 @@ static const int ID_TTNTF_STATUS_TYPING = ID_STATUS_INVISIBLE + 10;
static const int ID_TTNTF_STATUS_IDLE = ID_STATUS_INVISIBLE + 11;
static const int ID_TTNTF_STATUS_NOT_IDLE = ID_STATUS_INVISIBLE + 12;
-#define FONTSERV_GROUP LPGENT("Tooltip Notify")
-#define FONTSERV_ONLINE LPGENT("Online")
-#define FONTSERV_OFFLINE LPGENT("Offline")
-#define FONTSERV_OTHER LPGENT("Other status")
-#define FONTSERV_TYPING LPGENT("Typing")
-#define FONTSERV_IDLE LPGENT("Idle")
+#define FONTSERV_GROUP LPGENW("Tooltip Notify")
+#define FONTSERV_ONLINE LPGENW("Online")
+#define FONTSERV_OFFLINE LPGENW("Offline")
+#define FONTSERV_OTHER LPGENW("Other status")
+#define FONTSERV_TYPING LPGENW("Typing")
+#define FONTSERV_IDLE LPGENW("Idle")
struct FontEntry
{
int status;
- TCHAR* name;
+ wchar_t* name;
char* fontPrefix;
char* clrPrefix;
};
@@ -73,31 +73,31 @@ CTooltipNotify::~CTooltipNotify()
void CTooltipNotify::RegisterFonts()
{
FontIDT fontId = { sizeof(fontId) };
- _tcsncpy(fontId.group, FONTSERV_GROUP, _countof(fontId.group) - 1);
+ wcsncpy(fontId.group, FONTSERV_GROUP, _countof(fontId.group) - 1);
strncpy(fontId.dbSettingsGroup, MODULENAME, _countof(fontId.dbSettingsGroup) - 1);
fontId.flags = FIDF_DEFAULTVALID;
fontId.deffontsettings.colour = DEF_SETTING_TXTCOLOR;
fontId.deffontsettings.size = -MulDiv(DEF_SETTING_FONT_SIZE, DEF_LOGPIXELSY, 72);
fontId.deffontsettings.style = DEF_SETTING_FONT_STYLE;
fontId.deffontsettings.charset = DEF_SETTING_FONT_CHARSET;
- _tcsncpy(fontId.deffontsettings.szFace, DEF_SETTING_FONT_FACE, _countof(fontId.deffontsettings.szFace) - 1);
+ wcsncpy(fontId.deffontsettings.szFace, DEF_SETTING_FONT_FACE, _countof(fontId.deffontsettings.szFace) - 1);
fontId.order = 0;
- _tcsncpy(fontId.backgroundGroup, FONTSERV_GROUP, _countof(fontId.backgroundGroup) - 1);
+ wcsncpy(fontId.backgroundGroup, FONTSERV_GROUP, _countof(fontId.backgroundGroup) - 1);
ColourIDT colorId = { sizeof(colorId) };
- _tcsncpy(colorId.group, FONTSERV_GROUP, _countof(colorId.group) - 1);
+ wcsncpy(colorId.group, FONTSERV_GROUP, _countof(colorId.group) - 1);
strncpy(colorId.dbSettingsGroup, MODULENAME, _countof(colorId.dbSettingsGroup) - 1);
colorId.flags = 0;
colorId.defcolour = DEF_SETTING_BGCOLOR;
colorId.order = 0;
for (int i = 0; i < _countof(s_fontTable); i++) {
- _tcsncpy(fontId.name, s_fontTable[i].name, _countof(fontId.name) - 1);
+ wcsncpy(fontId.name, s_fontTable[i].name, _countof(fontId.name) - 1);
strncpy(fontId.prefix, s_fontTable[i].fontPrefix, _countof(fontId.prefix) - 1);
- _tcsncpy(fontId.backgroundName, s_fontTable[i].name, _countof(fontId.backgroundName) - 1);
+ wcsncpy(fontId.backgroundName, s_fontTable[i].name, _countof(fontId.backgroundName) - 1);
::FontRegisterT(&fontId);
- _tcsncpy(colorId.name, s_fontTable[i].name, _countof(colorId.name) - 1);
+ wcsncpy(colorId.name, s_fontTable[i].name, _countof(colorId.name) - 1);
strncpy(colorId.setting, s_fontTable[i].clrPrefix, _countof(colorId.setting) - 1);
::ColourRegisterT(&colorId);
}
@@ -105,7 +105,7 @@ void CTooltipNotify::RegisterFonts()
void CTooltipNotify::GetFont(int iStatus, LOGFONT* lf, COLORREF* text, COLORREF* bg)
{
- TCHAR* fontName = 0;
+ wchar_t* fontName = 0;
for (int i = 0; i < _countof(s_fontTable); i++) {
if (s_fontTable[i].status == iStatus) {
fontName = s_fontTable[i].name;
@@ -117,10 +117,10 @@ void CTooltipNotify::GetFont(int iStatus, LOGFONT* lf, COLORREF* text, COLORREF*
// name and group only
FontIDT fontId = { sizeof(fontId), FONTSERV_GROUP, 0 };
- _tcsncpy(fontId.name, fontName, _countof(fontId.name) - 1);
+ wcsncpy(fontId.name, fontName, _countof(fontId.name) - 1);
*text = (COLORREF)::CallService(MS_FONT_GETT, (WPARAM)&fontId, (LPARAM)lf);
ColourIDT colorId = { sizeof(colorId), FONTSERV_GROUP, 0 };
- _tcsncpy(colorId.name, fontName, _countof(colorId.name) - 1);
+ wcsncpy(colorId.name, fontName, _countof(colorId.name) - 1);
*bg = (COLORREF)::CallService(MS_COLOUR_GETT, (WPARAM)&colorId, 0);
}
@@ -276,7 +276,7 @@ int CTooltipNotify::InitializeOptions(WPARAM wParam, LPARAM)
CTooltip *CTooltipNotify::BeginNotify(STooltipData *pTooltipData)
{
- TCHAR szTooltipText[64] = { 0 };
+ wchar_t szTooltipText[64] = { 0 };
MakeTooltipString(pTooltipData->hContact, pTooltipData->iStatus, szTooltipText, 64);
LOGFONT lf = { 0 };
@@ -536,7 +536,7 @@ BOOL CTooltipNotify::OptionsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l
case WM_VSCROLL:
case WM_HSCROLL:
- TCHAR str[10];
+ wchar_t str[10];
mir_sntprintf(str, L"%d%%", 100 * SendDlgItemMessage(hDlg, IDC_TRANSPARENCY_SLIDER, TBM_GETPOS, 0, 0) / 255);
SetDlgItemText(hDlg, IDC_TRANSPERC, str);
if (wParam != 0x12345678)
@@ -674,7 +674,7 @@ BOOL CTooltipNotify::ProtosDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM)
int proto_count = ListView_GetItemCount(GetDlgItem(hDlg, IDC_PROTOS));
for (int i = 0; i < proto_count; i++) {
- TCHAR szProto[64];
+ wchar_t szProto[64];
ListView_GetItemText(GetDlgItem(hDlg, IDC_PROTOS), i, 0, szProto, _countof(szProto));
@@ -796,7 +796,7 @@ BOOL CTooltipNotify::ContactsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM)
}
-TCHAR* CTooltipNotify::StatusToString(int iStatus, TCHAR *szStatus, int iBufSize)
+wchar_t* CTooltipNotify::StatusToString(int iStatus, wchar_t *szStatus, int iBufSize)
{
if (iStatus >= ID_STATUS_OFFLINE && iStatus <= ID_STATUS_OUTTOLUNCH)
mir_tstrncpy(szStatus, pcli->pfnGetStatusModeDescription(iStatus, 0), iBufSize);
@@ -822,24 +822,24 @@ TCHAR* CTooltipNotify::StatusToString(int iStatus, TCHAR *szStatus, int iBufSize
return szStatus;
}
-TCHAR* CTooltipNotify::MakeTooltipString(MCONTACT hContact, int iStatus, TCHAR *szString, int iBufSize)
+wchar_t* CTooltipNotify::MakeTooltipString(MCONTACT hContact, int iStatus, wchar_t *szString, int iBufSize)
{
- TCHAR szStatus[32];
+ wchar_t szStatus[32];
StatusToString(iStatus, szStatus, _countof(szStatus));
// "proro: user is online"
- const TCHAR *szFormatString = m_sOptions.bPrefixProto ? L"%s%s%s" : L"%.0s%.0s%s";
- const TCHAR* szIs = TranslateT("is");
+ const wchar_t *szFormatString = m_sOptions.bPrefixProto ? L"%s%s%s" : L"%.0s%.0s%s";
+ const wchar_t* szIs = TranslateT("is");
const char* szProto = hContact == 0 ? "Proto" : ::GetContactProto(hContact);
- const TCHAR* szContactName = ::pcli->pfnGetContactDisplayName(hContact, 0);
+ const wchar_t* szContactName = ::pcli->pfnGetContactDisplayName(hContact, 0);
- memset(szString, 0, iBufSize*sizeof(TCHAR));
+ memset(szString, 0, iBufSize*sizeof(wchar_t));
WCHAR wszProto[32];
long lLen = MultiByteToWideChar(CP_ACP, 0, szProto, (int)mir_strlen(szProto), wszProto, _countof(wszProto));
- wszProto[lLen] = _T('\0');
+ wszProto[lLen] = '\0';
mir_sntprintf(szString, iBufSize - 1, szFormatString, wszProto, L": ", szContactName);
diff --git a/plugins/TooltipNotify/src/TooltipNotify.h b/plugins/TooltipNotify/src/TooltipNotify.h
index 50f507da31..793d1d6500 100644
--- a/plugins/TooltipNotify/src/TooltipNotify.h
+++ b/plugins/TooltipNotify/src/TooltipNotify.h
@@ -87,8 +87,8 @@ private:
MapTimerIdProtoIter FindProtoByTimer(UINT idTimer);
template<typename T> TooltipsListIter FindBy(T STooltipData::* m, const T& value);
- TCHAR *StatusToString(int iStatus, TCHAR *szStatus, int iBufSize);
- TCHAR *MakeTooltipString(MCONTACT hContact, int iStatus, TCHAR *szString, int iBufSize);
+ wchar_t *StatusToString(int iStatus, wchar_t *szStatus, int iBufSize);
+ wchar_t *MakeTooltipString(MCONTACT hContact, int iStatus, wchar_t *szString, int iBufSize);
void MigrateSettings();
void RegisterFonts();
void GetFont(int iStatus, LOGFONT* lf, COLORREF* text, COLORREF* bg);
diff --git a/plugins/TooltipNotify/src/Utils.cpp b/plugins/TooltipNotify/src/Utils.cpp
index c0d4a25fc8..4d102f9822 100644
--- a/plugins/TooltipNotify/src/Utils.cpp
+++ b/plugins/TooltipNotify/src/Utils.cpp
@@ -11,14 +11,14 @@ BOOL IsNt50()
return (bMajorVer>=5);
}
-void TruncateWithDots(TCHAR* szString, size_t iNewLen)
+void TruncateWithDots(wchar_t* szString, size_t iNewLen)
{
size_t iOrigLen = mir_tstrlen(szString);
if (iNewLen < iOrigLen) {
- TCHAR* p = szString+iNewLen;
- *p = _T('\0');
+ wchar_t* p = szString+iNewLen;
+ *p = '\0';
for(int i=0; --p>=szString && i<3; i++)
- *p = _T('.');
+ *p = '.';
}
}
diff --git a/plugins/TooltipNotify/src/Utils.h b/plugins/TooltipNotify/src/Utils.h
index b0baf7c0da..36270e8311 100644
--- a/plugins/TooltipNotify/src/Utils.h
+++ b/plugins/TooltipNotify/src/Utils.h
@@ -3,4 +3,4 @@
//
BOOL IsNt50();
-void TruncateWithDots(TCHAR* szString, size_t iNewLen); \ No newline at end of file
+void TruncateWithDots(wchar_t* szString, size_t iNewLen);
diff --git a/plugins/TopToolBar/src/stdafx.h b/plugins/TopToolBar/src/stdafx.h
index babf433470..57e4e39329 100644
--- a/plugins/TopToolBar/src/stdafx.h
+++ b/plugins/TopToolBar/src/stdafx.h
@@ -68,9 +68,9 @@ struct TopButtonInt : public MZeroedObject
HANDLE hIconHandleUp, hIconHandleDn;
char *pszService;
- TCHAR *ptszProgram;
+ wchar_t *ptszProgram;
char *pszName;
- TCHAR *ptszTooltip;
+ wchar_t *ptszTooltip;
LPARAM lParamUp;
WPARAM wParamUp;
@@ -78,7 +78,7 @@ struct TopButtonInt : public MZeroedObject
WPARAM wParamDown;
int hLangpack;
- TCHAR *ptszTooltipUp, *ptszTooltipDn;
+ wchar_t *ptszTooltipUp, *ptszTooltipDn;
};
///////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/TopToolBar/src/toolbarwnd.cpp b/plugins/TopToolBar/src/toolbarwnd.cpp
index 56577b4703..73661085dd 100644
--- a/plugins/TopToolBar/src/toolbarwnd.cpp
+++ b/plugins/TopToolBar/src/toolbarwnd.cpp
@@ -5,7 +5,7 @@ COLORREF bkColour;
HBITMAP hBmpBackground, hBmpSeparator;
int backgroundBmpUse;
-static TCHAR pluginname[] = L"TopToolBar";
+static wchar_t pluginname[] = L"TopToolBar";
/////////////////////////////////////////////////////////////////////////////////////////
// Toolbar window procedure
diff --git a/plugins/TopToolBar/src/topbutton.cpp b/plugins/TopToolBar/src/topbutton.cpp
index 1fe3eb2488..4be939ba8b 100644
--- a/plugins/TopToolBar/src/topbutton.cpp
+++ b/plugins/TopToolBar/src/topbutton.cpp
@@ -159,7 +159,7 @@ void TopButtonInt::SetBitmap()
if (GetWindowLongPtr(hwnd, GWL_STYLE) & SS_ICON)
SetWindowLongPtr(hwnd, GWL_STYLE, curstyle | SS_ICON);
- TCHAR *pTooltip;
+ wchar_t *pTooltip;
if (bPushed) {
SendMessage(hwnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)(hIconDn ? hIconDn : hIconUp));
SendMessage(hwnd, BM_SETCHECK, BST_CHECKED, 0);
diff --git a/plugins/TopToolBar/src/ttbopt.cpp b/plugins/TopToolBar/src/ttbopt.cpp
index f048adfda3..b78101a566 100644
--- a/plugins/TopToolBar/src/ttbopt.cpp
+++ b/plugins/TopToolBar/src/ttbopt.cpp
@@ -18,7 +18,7 @@ static HTREEITEM AddLine(HWND hTree,TopButtonInt *b, HTREEITEM hItem, HIMAGELIST
tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
int index;
- TCHAR* tmp;
+ wchar_t* tmp;
if (b->dwFlags & TTBBF_ISSEPARATOR) {
tvis.item.pszText = L"------------------";
@@ -239,7 +239,7 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
//----- Launch buttons -----
if (ctrlid == IDC_BROWSE) {
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
OPENFILENAME ofn = {0};
GetDlgItemText(hwndDlg, IDC_EPATH, str, _countof(str));
@@ -272,7 +272,7 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
TreeView_GetItem(hTree, &tvi);
TopButtonInt* btn = (TopButtonInt*)tvi.lParam;
- TCHAR buf [256];
+ wchar_t buf [256];
// probably, condition not needs
if (btn->dwFlags & TTBBF_ISLBUTTON) {
if (!(btn->dwFlags & TTBBF_OPTIONAL)) {
@@ -509,7 +509,7 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
TreeView_GetItem(hTree, &tvi);
if ( (hti.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT)) || (hti.hItem==TVI_FIRST)) {
TVINSERTSTRUCT tvis;
- TCHAR name[128];
+ wchar_t name[128];
tvis.item.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE;
tvis.item.stateMask = 0xFFFFFFFF;
tvis.item.pszText = name;
diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp
index 3dea6dd19d..9619347bc3 100644
--- a/plugins/TrafficCounter/src/TrafficCounter.cpp
+++ b/plugins/TrafficCounter/src/TrafficCounter.cpp
@@ -34,7 +34,7 @@ CLIST_INTERFACE *pcli;
int hLangpack = 0; // Ïîääåðæêà ïëàãèíîçàâèñèìîãî ïåðåâîäà.
BOOL bPopupExists = FALSE, bVariablesExists = FALSE, bTooltipExists = FALSE;
-static TCHAR tszFormat[] =
+static wchar_t tszFormat[] =
_T("{I4}\x0D\x0A\x0A\
{R65}?tc_GetTraffic(%extratext%,now,sent,d)\x0D\x0A\x0A\
{R115}?tc_GetTraffic(%extratext%,now,received,d)\x0D\x0A\x0A\
@@ -42,7 +42,7 @@ _T("{I4}\x0D\x0A\x0A\
{L180}?if3(?tc_GetTime(%extratext%,now,hh:mm:ss),)\x0D\x0A\x0A\
{L230}?if3(?tc_GetTime(%extratext%,total,d hh:mm),)");
-TCHAR* TRAFFIC_COUNTER_WINDOW_CLASS = L"TrafficCounterWnd";
+wchar_t* TRAFFIC_COUNTER_WINDOW_CLASS = L"TrafficCounterWnd";
/*-------------------------------------------------------------------------------------------------------------------*/
//TRAFFIC COUNTER
@@ -64,8 +64,8 @@ char Traffic_PopupTimeoutValue;
unsigned short int Traffic_LineHeight;
//
-TCHAR Traffic_CounterFormat[512];
-TCHAR Traffic_TooltipFormat[512];
+wchar_t Traffic_CounterFormat[512];
+wchar_t Traffic_TooltipFormat[512];
//
HANDLE Traffic_FrameID = NULL;
@@ -245,8 +245,8 @@ int TrafficCounterModulesLoaded(WPARAM, LPARAM)
//register traffic font
TrafficFontID.cbSize = sizeof(FontIDT);
- mir_tstrcpy(TrafficFontID.group, LPGENT("Traffic counter"));
- mir_tstrcpy(TrafficFontID.name, LPGENT("Font"));
+ mir_tstrcpy(TrafficFontID.group, LPGENW("Traffic counter"));
+ mir_tstrcpy(TrafficFontID.name, LPGENW("Font"));
mir_strcpy(TrafficFontID.dbSettingsGroup, TRAFFIC_SETTINGS_GROUP);
mir_strcpy(TrafficFontID.prefix, "Font");
TrafficFontID.flags = FIDF_DEFAULTVALID | FIDF_SAVEPOINTSIZE;
@@ -260,8 +260,8 @@ int TrafficCounterModulesLoaded(WPARAM, LPARAM)
// Ðåãèñòðèðóåì öâåò ôîíà
TrafficBackgroundColorID.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(TrafficBackgroundColorID.group, LPGENT("Traffic counter"));
- mir_tstrcpy(TrafficBackgroundColorID.name, LPGENT("Font"));
+ mir_tstrcpy(TrafficBackgroundColorID.group, LPGENW("Traffic counter"));
+ mir_tstrcpy(TrafficBackgroundColorID.name, LPGENW("Font"));
mir_strcpy(TrafficBackgroundColorID.dbSettingsGroup, TRAFFIC_SETTINGS_GROUP);
mir_strcpy(TrafficBackgroundColorID.setting, "FontBkColor");
TrafficBackgroundColorID.defcolour = GetSysColor(COLOR_BTNFACE);
@@ -485,14 +485,14 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC)
// Ñëåäóþùèå ïîçèöèè ñòðîÿòñÿ îò ïðàâîãî êðàÿ.
// Îáùåå âðåìÿ.
if (unOptions.DrawTotalTimeCounter) {
- TCHAR bu[32];
+ wchar_t bu[32];
GetDurationFormatM(ProtoList[i].Total.Timer, L"h:mm:ss", bu, 32);
TC_AlphaText(hdc, bu, &rect, DT_SINGLELINE | DT_RIGHT | DT_TOP, ClistModernPresent);
}
// Òåêóùåå âðåìÿ.
if (unOptions.DrawCurrentTimeCounter) {
- TCHAR bu[32];
+ wchar_t bu[32];
GetDurationFormatM(ProtoList[i].Session.Timer, L"h:mm:ss", bu, 32);
rect.right -= 50;
@@ -501,7 +501,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC)
}
// Èçîáðàæàåì îáùèé òðàôèê.
if (unOptions.DrawTotalTraffic) {
- TCHAR bu[32];
+ wchar_t bu[32];
GetFormattedTraffic(ProtoList[i].TotalSentTraffic + ProtoList[i].TotalRecvTraffic, 3, bu, 32);
rect.right -= 100;
@@ -513,7 +513,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC)
}
// Èçîáðàæàåì òåêóùèé òðàôèê.
if (unOptions.DrawCurrentTraffic) {
- TCHAR bu[32];
+ wchar_t bu[32];
GetFormattedTraffic(ProtoList[i].CurrentRecvTraffic + ProtoList[i].CurrentSentTraffic, 3, bu, 32);
rect.right -= 150;
@@ -539,7 +539,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC)
// Âûâîäèì òåêñò
// Èçîáðàæàåì èìÿ
if (unOptions.DrawProtoName) {
- TCHAR *bu = mir_a2t("Summary");
+ wchar_t *bu = mir_a2t("Summary");
rect.left += dx;
TC_AlphaText(hdc, bu, &rect, DT_SINGLELINE | DT_LEFT | DT_TOP, ClistModernPresent);
@@ -548,14 +548,14 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC)
}
// Îáùåå âðåìÿ.
if (unOptions.DrawTotalTimeCounter) {
- TCHAR bu[32];
+ wchar_t bu[32];
GetDurationFormatM(OverallInfo.Total.Timer, L"h:mm:ss", bu, 32);
TC_AlphaText(hdc, bu, &rect, DT_SINGLELINE | DT_RIGHT | DT_TOP, ClistModernPresent);
}
// Òåêóùåå âðåìÿ.
if (unOptions.DrawCurrentTimeCounter) {
- TCHAR bu[32];
+ wchar_t bu[32];
GetDurationFormatM(OverallInfo.Session.Timer, L"h:mm:ss", bu, 32);
rect.right -= 50;
@@ -564,7 +564,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC)
}
// Èçîáðàæàåì îáùèé òðàôèê.
if (unOptions.DrawTotalTraffic) {
- TCHAR bu[32];
+ wchar_t bu[32];
GetFormattedTraffic(SummaryTotal, 3, bu, 32);
rect.right -= 100;
@@ -573,7 +573,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC)
}
// Èçîáðàæàåì òåêóùèé òðàôèê.
if (unOptions.DrawCurrentTraffic) {
- TCHAR bu[32];
+ wchar_t bu[32];
GetFormattedTraffic(SummarySession, 3, bu, 32);
rect.right -= 150;
@@ -594,7 +594,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC)
// Âûâîäèì òåêñò
// Èçîáðàæàåì èìÿ
if (unOptions.DrawProtoName) {
- TCHAR *bu = mir_a2t("Overall");
+ wchar_t *bu = mir_a2t("Overall");
rect.left += dx;
TC_AlphaText(hdc, bu, &rect, DT_SINGLELINE | DT_LEFT | DT_TOP, ClistModernPresent);
@@ -604,7 +604,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC)
// Ñëåäóþùèå ïîçèöèè ñòðîÿòñÿ îò ïðàâîãî êðàÿ.
// Èçîáðàæàåì îáùèé òðàôèê.
if (unOptions.DrawTotalTraffic) {
- TCHAR bu[32];
+ wchar_t bu[32];
GetFormattedTraffic(OverallInfo.TotalSentTraffic + OverallInfo.TotalRecvTraffic, 3, bu, 32);
rect.right -= 100;
@@ -613,7 +613,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC)
}
// Èçîáðàæàåì òåêóùèé òðàôèê.
if (unOptions.DrawCurrentTraffic) {
- TCHAR bu[32];
+ wchar_t bu[32];
GetFormattedTraffic(OverallInfo.CurrentRecvTraffic + OverallInfo.CurrentSentTraffic, 3, bu, 32);
rect.right -= 150;
@@ -630,13 +630,13 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC)
WORD ItemsNumber, RowsNumber;
// Ãîòîâèì ñïèñîê ñòðîê äëÿ Variables è èêîíîê.
- TCHAR **ExtraText = (TCHAR**)mir_alloc(sizeof(TCHAR*));
+ wchar_t **ExtraText = (wchar_t**)mir_alloc(sizeof(wchar_t*));
HICON *ahIcon = (HICON*)mir_alloc(sizeof(HICON));
RowsNumber = 0;
// Öèêë ïî àêêàóíòàì.
for (int i = 0; i < NumberOfAccounts; i++) {
if (ProtoList[i].Visible && ProtoList[i].Enabled) {
- ExtraText = (TCHAR**)mir_realloc(ExtraText, sizeof(TCHAR*) * (RowsNumber + 1));
+ ExtraText = (wchar_t**)mir_realloc(ExtraText, sizeof(wchar_t*) * (RowsNumber + 1));
ahIcon = (HICON*)mir_realloc(ahIcon, sizeof(HICON) * (RowsNumber + 1));
ExtraText[RowsNumber] = mir_a2t(ProtoList[i].name);
@@ -645,14 +645,14 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC)
}
// Åù¸ 2 îñîáûõ ýëåìåíòà.
if (unOptions.ShowSummary) {
- ExtraText = (TCHAR**)mir_realloc(ExtraText, sizeof(TCHAR*) * (RowsNumber + 1));
+ ExtraText = (wchar_t**)mir_realloc(ExtraText, sizeof(wchar_t*) * (RowsNumber + 1));
ahIcon = (HICON*)mir_realloc(ahIcon, sizeof(HICON) * (RowsNumber + 1));
ExtraText[RowsNumber] = mir_a2t("summary");
ahIcon[RowsNumber++] = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
}
if (unOptions.ShowOverall) {
- ExtraText = (TCHAR**)mir_realloc(ExtraText, sizeof(TCHAR*) * (RowsNumber + 1));
+ ExtraText = (wchar_t**)mir_realloc(ExtraText, sizeof(wchar_t*) * (RowsNumber + 1));
ahIcon = (HICON*)mir_realloc(ahIcon, sizeof(HICON) * (RowsNumber + 1));
ExtraText[RowsNumber] = mir_a2t("overall");
@@ -661,7 +661,7 @@ int PaintTrafficCounterWindow(HWND hwnd, HDC hDC)
// Ðèñóåì ñâîé ñ÷¸ò÷èê äëÿ êàæäîãî èç âûáðàííûõ ïðîòîêîëîâ
for (int i = 0; i < RowsNumber; i++) {
- TCHAR *buf = variables_parse(Traffic_CounterFormat, ExtraText[i], NULL);
+ wchar_t *buf = variables_parse(Traffic_CounterFormat, ExtraText[i], NULL);
if (ItemsNumber = GetRowItems(buf, &ItemsList)) {
// Ðèñóåì òåêñò.
for (int dx = 0; dx < ItemsNumber; dx++) {
@@ -943,7 +943,7 @@ LRESULT CALLBACK TrafficCounterWndProc_MW(HWND hwnd, UINT msg, WPARAM wParam, LP
case TIMER_TOOLTIP:
{
- TCHAR *TooltipText;
+ wchar_t *TooltipText;
CLCINFOTIP ti = { 0 };
RECT rt;
@@ -1064,7 +1064,7 @@ void NotifyOnSend(void)
memset(&ppd, 0, sizeof(ppd));
ppd.lchContact = NULL;
ppd.lchIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
- _tcsncpy(ppd.lptzContactName, TranslateT("Traffic counter notification"), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzContactName, TranslateT("Traffic counter notification"), MAX_CONTACTNAME);
mir_sntprintf(ppd.lptzText, TranslateT("%d kilobytes sent"), notify_send_size = OverallInfo.CurrentSentTraffic >> 10);
ppd.colorBack = Traffic_PopupBkColor;
ppd.colorText = Traffic_PopupFontColor;
@@ -1080,7 +1080,7 @@ void NotifyOnRecv(void)
memset(&ppd, 0, sizeof(ppd));
ppd.lchContact = NULL;
ppd.lchIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
- _tcsncpy(ppd.lptzContactName, TranslateT("Traffic counter notification"), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzContactName, TranslateT("Traffic counter notification"), MAX_CONTACTNAME);
mir_sntprintf(ppd.lptzText, TranslateT("%d kilobytes received"), notify_recv_size = OverallInfo.CurrentRecvTraffic >> 10);
ppd.colorBack = Traffic_PopupBkColor;
ppd.colorText = Traffic_PopupFontColor;
diff --git a/plugins/TrafficCounter/src/misc.cpp b/plugins/TrafficCounter/src/misc.cpp
index 5c23fd4541..398feaab96 100644
--- a/plugins/TrafficCounter/src/misc.cpp
+++ b/plugins/TrafficCounter/src/misc.cpp
@@ -25,13 +25,13 @@ InputString - ñòðîêà äëÿ ðàçáîðà;
RowItemsList - ñïèñîê íàéäåííûõ ýëåìåíòîâ.
Âîçâðàùàåìîå çíà÷åíèå - êîëè÷åñòâî ýëåìåíòîâ â ñïèñêàõ. */
-WORD GetRowItems(TCHAR *InputString, RowItemInfo **RowItemsList)
+WORD GetRowItems(wchar_t *InputString, RowItemInfo **RowItemsList)
{
- TCHAR *begin, *end;
+ wchar_t *begin, *end;
WORD c = 0;
// Èùåì ñëåâà îòêðûâàþùóþ ñêîáêó.
- begin = _tcschr(InputString, '{');
+ begin = wcschr(InputString, '{');
// Åñëè ñêîáêà íàéäåíà...
if (begin) {
// Âûäåëÿåì ïàìÿòü ïîä óêàçàòåëè
@@ -41,31 +41,31 @@ WORD GetRowItems(TCHAR *InputString, RowItemInfo **RowItemsList)
do {
// Ñðàçó âñëåä çà íåé èùåì çàêðûâàþùóþ.
- end = _tcschr(begin, '}');
+ end = wcschr(begin, '}');
// Âûäåëÿåì ïàìÿòü ïîä óêàçàòåëè
*RowItemsList = (RowItemInfo*)mir_realloc(*RowItemsList, sizeof(RowItemInfo) * (c + 1));
// Ðàçáèðàåì òåã.
- _stscanf(begin + 1, L"%c%hd",
+ swscanf(begin + 1, L"%c%hd",
&((*RowItemsList)[c].Alignment),
&((*RowItemsList)[c].Interval));
// Èùåì äàëåå îòêðûâàþùóþ ñêîáêó - ýòî êîíåö ñòðîêè, ñîîòâåòñòâóþùåé òåãó.
- begin = _tcschr(end, '{');
+ begin = wcschr(end, '{');
if (begin) {
// Âûäåëÿåì ïàìÿòü ïîä ñòðîêó.
- (*RowItemsList)[c].String = (TCHAR*)mir_alloc(sizeof(TCHAR) * (begin - end));
+ (*RowItemsList)[c].String = (wchar_t*)mir_alloc(sizeof(wchar_t) * (begin - end));
// Êîïèðóåì ñòðîêó.
- _tcsncpy((*RowItemsList)[c].String, end + 1, begin - end - 1);
+ wcsncpy((*RowItemsList)[c].String, end + 1, begin - end - 1);
(*RowItemsList)[c].String[begin - end - 1] = 0;
}
else {
// Âûäåëÿåì ïàìÿòü ïîä ñòðîêó.
- (*RowItemsList)[c].String = (TCHAR*)mir_alloc(sizeof(TCHAR) * mir_tstrlen(end));
+ (*RowItemsList)[c].String = (wchar_t*)mir_alloc(sizeof(wchar_t) * mir_tstrlen(end));
// Êîïèðóåì ñòðîêó.
- _tcsncpy((*RowItemsList)[c].String, end + 1, mir_tstrlen(end));
+ wcsncpy((*RowItemsList)[c].String, end + 1, mir_tstrlen(end));
}
c++;
@@ -118,12 +118,12 @@ Buffer - àäðåñ ñòðîêè äëÿ çàïèñè ðåçóëüòàòà;
Size - ðàçìåð áóôåðà.
Âîçâðàùàåìîå çíà÷åíèå: òðåáóåìûé ðàçìåð áóôåðà.
*/
-size_t GetFormattedTraffic(DWORD Value, BYTE Unit, TCHAR *Buffer, size_t Size)
+size_t GetFormattedTraffic(DWORD Value, BYTE Unit, wchar_t *Buffer, size_t Size)
{
- TCHAR Str1[32], szUnit[4] = { ' ', 0 };
+ wchar_t Str1[32], szUnit[4] = { ' ', 0 };
DWORD Divider;
NUMBERFMT nf = { 0, 1, 3, L",", L" ", 0 };
- TCHAR *Res; // Ïðîìåæóòî÷íûé ðåçóëüòàò.
+ wchar_t *Res; // Ïðîìåæóòî÷íûé ðåçóëüòàò.
switch (Unit) {
case 0: //bytes
@@ -152,7 +152,7 @@ size_t GetFormattedTraffic(DWORD Value, BYTE Unit, TCHAR *Buffer, size_t Size)
size_t l = GetNumberFormat(LOCALE_USER_DEFAULT, 0, Str1, &nf, NULL, 0);
if (!l) return 0;
l += mir_tstrlen(szUnit) + 1;
- Res = (TCHAR*)malloc(l * sizeof(TCHAR));
+ Res = (wchar_t*)malloc(l * sizeof(wchar_t));
if (!Res) return 0;
GetNumberFormat(LOCALE_USER_DEFAULT, 0, Str1, &nf, Res, (int)l);
mir_tstrcat(Res, szUnit);
@@ -174,26 +174,26 @@ Format: ñòðîêà ôîðìàòà;
Buffer: àäðåñ áóôåðà, êóäà ôóíêöèÿ ïîìåùàåò ðåçóëüòàò.
Size - ðàçìåð áóôåðà. */
-size_t GetDurationFormatM(DWORD Duration, TCHAR *Format, TCHAR *Buffer, size_t Size)
+size_t GetDurationFormatM(DWORD Duration, wchar_t *Format, wchar_t *Buffer, size_t Size)
{
size_t Length;
DWORD q;
WORD TokenIndex, FormatIndex;
- TCHAR Token[256], // Àêêóìóëÿòîð.
+ wchar_t Token[256], // Àêêóìóëÿòîð.
*Res; // Ïðîìåæóòî÷íûé ðåçóëüòàò.
- Res = (TCHAR*)malloc(sizeof(TCHAR)); // Âûäåëÿåì ÷óòü-÷óòü ïàìÿòè ïîä ðåçóëüòàò, íî ýòî òîëüêî íà÷àëî.
- //SecureZeroMemory(Res, sizeof(TCHAR));
+ Res = (wchar_t*)malloc(sizeof(wchar_t)); // Âûäåëÿåì ÷óòü-÷óòü ïàìÿòè ïîä ðåçóëüòàò, íî ýòî òîëüêî íà÷àëî.
+ //SecureZeroMemory(Res, sizeof(wchar_t));
Res[0] = 0;
for (FormatIndex = 0; Format[FormatIndex];) {
// Èùåì òîêåíû. Ñ÷èòàåòñÿ, ÷òî òîêåí - òîëüêî áóêâû.
TokenIndex = 0;
- q = _istalpha(Format[FormatIndex]);
+ q = iswalpha(Format[FormatIndex]);
// Êîïèðóåì ñèìâîëû â àêêóìóëÿòîð äî ñìåíû ôëàãà.
do {
Token[TokenIndex++] = Format[FormatIndex++];
- } while (q == _istalpha(Format[FormatIndex]));
+ } while (q == iswalpha(Format[FormatIndex]));
Token[TokenIndex] = 0;
// ×òî ïîëó÷èëè â àêêóìóëÿòîðå?
@@ -235,12 +235,12 @@ size_t GetDurationFormatM(DWORD Duration, TCHAR *Format, TCHAR *Buffer, size_t S
// Äîáàâèì ïàìÿòè, åñëè íóæíî.
Length = mir_tstrlen(Res) + mir_tstrlen(Token) + 1;
- Res = (TCHAR*)realloc(Res, Length * sizeof(TCHAR));
+ Res = (wchar_t*)realloc(Res, Length * sizeof(wchar_t));
mir_tstrcat(Res, Token);
}
if (Size && Buffer) {
- _tcsncpy(Buffer, Res, Size);
+ wcsncpy(Buffer, Res, Size);
Length = mir_tstrlen(Buffer);
}
else Length = mir_tstrlen(Res) + 1;
diff --git a/plugins/TrafficCounter/src/misc.h b/plugins/TrafficCounter/src/misc.h
index 0f4b418bdc..d0d784e6cf 100644
--- a/plugins/TrafficCounter/src/misc.h
+++ b/plugins/TrafficCounter/src/misc.h
@@ -1,8 +1,8 @@
typedef struct
{
- TCHAR Alignment; // Âûðàâíèâàíèå. L - ê ëåâîé ãðàíèöå, R - ê ïðàâîé.
+ wchar_t Alignment; // Âûðàâíèâàíèå. L - ê ëåâîé ãðàíèöå, R - ê ïðàâîé.
WORD Interval; // Ðàññòîÿíèå, íà êîòîðîå ãðàíèöà ñòðîêè îòñòîèò îò ëåâîãî êðàÿ ôðåéìà.
- TCHAR *String; // Ñîáñòâåííî ñòðîêà.
+ wchar_t *String; // Ñîáñòâåííî ñòðîêà.
} RowItemInfo;
/* Ôóíêöèÿ ðàçáèðàåò ñòðîêó è âîçâðàùàåò ñïèñîê òåãîâ è ñîîòâåòñòâóþùèõ èì ñòðîê.
@@ -10,7 +10,7 @@ typedef struct
InputString - ñòðîêà äëÿ ðàçáîðà;
RowItemsList - ñïèñîê íàéäåííûõ ýëåìåíòîâ.
Âîçâðàùàåìîå çíà÷åíèå - êîëè÷åñòâî ýëåìåíòîâ â ñïèñêàõ. */
-WORD GetRowItems(TCHAR *InputString, RowItemInfo **RowItemsList);
+WORD GetRowItems(wchar_t *InputString, RowItemInfo **RowItemsList);
/* Ôóíêöèÿ âîçâðàùàåò êîëè÷åñòâî äíåé â óêàçàííîì ìåñÿöå óêàçàííîãî ãîäà. */
BYTE DaysInMonth(BYTE Month, WORD Year);
@@ -25,8 +25,8 @@ BYTE DayOfWeek(BYTE Day, BYTE Month, WORD Year);
Buffer - àäðåñ ñòðîêè äëÿ çàïèñè ðåçóëüòàòà;
Size - ðàçìåð áóôåðà.
Âîçâðàùàåìîå çíà÷åíèå: òðåáóåìûé ðàçìåð áóôåðà. */
-size_t GetFormattedTraffic(DWORD Value, BYTE Unit, TCHAR *Buffer, size_t Size);
+size_t GetFormattedTraffic(DWORD Value, BYTE Unit, wchar_t *Buffer, size_t Size);
-size_t GetDurationFormatM(DWORD Duration, TCHAR *Format, TCHAR *Buffer, size_t Size);
+size_t GetDurationFormatM(DWORD Duration, wchar_t *Format, wchar_t *Buffer, size_t Size);
signed short int TimeCompare(SYSTEMTIME st1, SYSTEMTIME st2); \ No newline at end of file
diff --git a/plugins/TrafficCounter/src/options.cpp b/plugins/TrafficCounter/src/options.cpp
index 81fc55b629..02bfd9d5d5 100644
--- a/plugins/TrafficCounter/src/options.cpp
+++ b/plugins/TrafficCounter/src/options.cpp
@@ -126,15 +126,15 @@ static INT_PTR CALLBACK DlgProcPopupsTraffic(HWND hwndDlg, UINT msg, WPARAM wPar
static OPTTREE_OPTION options[] =
{
- {0, LPGENT("Display") L"/" LPGENT("Icon"), OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawProtoIcon"},
- {0, LPGENT("Display") L"/" LPGENT("Account name"), OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawProtoName"},
- {0, LPGENT("Display") L"/" LPGENT("Current traffic"), OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawCurrentTraffic"},
- {0, LPGENT("Display") L"/" LPGENT("Total traffic"), OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawTotalTraffic"},
- {0, LPGENT("Display") L"/" LPGENT("Current online"), OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawCurrentTime"},
- {0, LPGENT("Display") L"/" LPGENT("Total online"),OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawTotalTime"},
- {0, LPGENT("General") L"/" LPGENT("Draw frame as skin element"), OPTTREE_CHECK, 1, NULL, "DrawFrmAsSkin"},
- {0, LPGENT("General") L"/" LPGENT("Show tooltip in traffic window"), OPTTREE_CHECK, 1, NULL, "ShowTooltip"},
- {0, LPGENT("General") L"/" LPGENT("\"Toggle traffic counter\" in main menu"), OPTTREE_CHECK, 1, NULL, "ShowMainMenuItem"},
+ {0, LPGENW("Display") L"/" LPGENW("Icon"), OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawProtoIcon"},
+ {0, LPGENW("Display") L"/" LPGENW("Account name"), OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawProtoName"},
+ {0, LPGENW("Display") L"/" LPGENW("Current traffic"), OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawCurrentTraffic"},
+ {0, LPGENW("Display") L"/" LPGENW("Total traffic"), OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawTotalTraffic"},
+ {0, LPGENW("Display") L"/" LPGENW("Current online"), OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawCurrentTime"},
+ {0, LPGENW("Display") L"/" LPGENW("Total online"),OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, "DrawTotalTime"},
+ {0, LPGENW("General") L"/" LPGENW("Draw frame as skin element"), OPTTREE_CHECK, 1, NULL, "DrawFrmAsSkin"},
+ {0, LPGENW("General") L"/" LPGENW("Show tooltip in traffic window"), OPTTREE_CHECK, 1, NULL, "ShowTooltip"},
+ {0, LPGENW("General") L"/" LPGENW("\"Toggle traffic counter\" in main menu"), OPTTREE_CHECK, 1, NULL, "ShowMainMenuItem"},
// Ðåçåðâèðóåì ìåñòî ïîä àêòèâíûå è âèäèìûå ïðîòîêîëû
// Ìàêñèìóì 16 ïîçèöèé âèäèìûõ è 16 àêòèâíûõ
{0, NULL, OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, NULL},
@@ -169,8 +169,8 @@ static OPTTREE_OPTION options[] =
{0, NULL, OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, NULL},
{0, NULL, OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, NULL},
{0, NULL, OPTTREE_CHECK, OPTTREE_INVISIBLE, NULL, NULL},
- {0, LPGENT("Visible accounts")L"/" LPGENT("Summary traffic for visible accounts"), OPTTREE_CHECK, 1, NULL, "ShowSummary"},
- {0, LPGENT("Visible accounts")L"/" LPGENT("Overall traffic"), OPTTREE_CHECK, 1, NULL, "ShowOverall"},
+ {0, LPGENW("Visible accounts")L"/" LPGENW("Summary traffic for visible accounts"), OPTTREE_CHECK, 1, NULL, "ShowSummary"},
+ {0, LPGENW("Visible accounts")L"/" LPGENW("Overall traffic"), OPTTREE_CHECK, 1, NULL, "ShowOverall"},
};
static INT_PTR CALLBACK DlgProcTCOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -195,7 +195,7 @@ static INT_PTR CALLBACK DlgProcTCOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
options[i].szSettingName = (char*)mir_alloc(1 + mir_strlen(ProtoList[j].name));
mir_strcpy(options[i].szSettingName, ProtoList[j].name);
size_t l = 20 + mir_tstrlen(ProtoList[j].tszAccountName);
- options[i].szOptionName = (TCHAR*)mir_alloc(sizeof(TCHAR) * l);
+ options[i].szOptionName = (wchar_t*)mir_alloc(sizeof(wchar_t) * l);
mir_sntprintf(options[i].szOptionName, l, L"Visible accounts/%s", ProtoList[j].tszAccountName);
options[i].dwFlag = (ProtoList[j++].Enabled ? 1 : OPTTREE_INVISIBLE) | OPTTREE_NOTRANSLATE;
}
diff --git a/plugins/TrafficCounter/src/opttree.cpp b/plugins/TrafficCounter/src/opttree.cpp
index 09447b2c85..337fca2806 100644
--- a/plugins/TrafficCounter/src/opttree.cpp
+++ b/plugins/TrafficCounter/src/opttree.cpp
@@ -23,12 +23,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TCHAR *name);
-HTREEITEM OptTree_AddItem(HWND hwndTree, TCHAR *name, LPARAM lParam, int iconIndex);
+HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const wchar_t *name);
+HTREEITEM OptTree_AddItem(HWND hwndTree, wchar_t *name, LPARAM lParam, int iconIndex);
static void OptTree_TranslateItem(HWND hwndTree, HTREEITEM hItem)
{
- TCHAR buf[128];
+ wchar_t buf[128];
TVITEM tvi = {0};
tvi.mask = TVIF_HANDLE|TVIF_TEXT;
@@ -72,10 +72,10 @@ void OptTree_Translate(HWND hwndTree)
}
}
-HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TCHAR *name)
+HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const wchar_t *name)
{
TVITEM tvi = {0};
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
if (hItem)
tvi.hItem = TreeView_GetChild(hwndTree, hItem);
@@ -101,11 +101,11 @@ HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TCHA
return NULL;
}
-HTREEITEM OptTree_AddItem(HWND hwndTree, TCHAR *name, LPARAM lParam, int iconIndex)
+HTREEITEM OptTree_AddItem(HWND hwndTree, wchar_t *name, LPARAM lParam, int iconIndex)
{
- TCHAR itemName[1024];
+ wchar_t itemName[1024];
- TCHAR* sectionName;
+ wchar_t* sectionName;
int sectionLevel = 0;
HTREEITEM hSection = NULL, result = NULL;
@@ -115,10 +115,10 @@ HTREEITEM OptTree_AddItem(HWND hwndTree, TCHAR *name, LPARAM lParam, int iconInd
while (sectionName)
{
// allow multi-level tree
- TCHAR* pItemName = sectionName;
+ wchar_t* pItemName = sectionName;
HTREEITEM hItem;
- if (sectionName = _tcschr(sectionName, '/'))
+ if (sectionName = wcschr(sectionName, '/'))
{
// one level deeper
*sectionName = 0;
@@ -169,7 +169,7 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, BOOL*,
case WM_INITDIALOG:
{
int indx;
- TCHAR itemName[1024];
+ wchar_t itemName[1024];
HIMAGELIST hImgLst;
TreeView_SelectItem(hwndTree, NULL);
@@ -188,7 +188,7 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, BOOL*,
/* build options tree. based on code from IcoLib */
for (indx = 0; indx < optionCount; indx++)
{
- TCHAR* sectionName;
+ wchar_t* sectionName;
int sectionLevel = 0;
HTREEITEM hSection = NULL;
@@ -202,10 +202,10 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, BOOL*,
while (sectionName)
{
// allow multi-level tree
- TCHAR* pItemName = sectionName;
+ wchar_t* pItemName = sectionName;
HTREEITEM hItem;
- if (sectionName = _tcschr(sectionName, '/'))
+ if (sectionName = wcschr(sectionName, '/'))
{
// one level deeper
*sectionName = 0;
diff --git a/plugins/TrafficCounter/src/opttree.h b/plugins/TrafficCounter/src/opttree.h
index de3a8ddbbb..8c80b599eb 100644
--- a/plugins/TrafficCounter/src/opttree.h
+++ b/plugins/TrafficCounter/src/opttree.h
@@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
typedef struct {
int iconIndex;
- TCHAR *szOptionName;
+ wchar_t *szOptionName;
int groupId;
DWORD dwFlag;
HTREEITEM hItem;
diff --git a/plugins/TrafficCounter/src/statistics.cpp b/plugins/TrafficCounter/src/statistics.cpp
index 709d7e3724..cb0f7e3f6d 100644
--- a/plugins/TrafficCounter/src/statistics.cpp
+++ b/plugins/TrafficCounter/src/statistics.cpp
@@ -174,7 +174,7 @@ INT_PTR CALLBACK DlgProcOptStatistics(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
SYSTEMTIME st = { 0 };
DWORD Index, Value;
double vartime;
- TCHAR szBufW[64];
+ wchar_t szBufW[64];
BYTE EldestAcc;
if (!(pdi->item.mask & LVIF_TEXT)) return 0;
@@ -229,7 +229,7 @@ INT_PTR CALLBACK DlgProcOptStatistics(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
break;
case 4: // Âðåìÿ
{
- TCHAR *Fmt[5] = { L"m:ss", L"h:mm:ss", L"h:mm:ss", L"d hh:mm:ss", L"d hh:mm:ss" };
+ wchar_t *Fmt[5] = { L"m:ss", L"h:mm:ss", L"h:mm:ss", L"d hh:mm:ss", L"d hh:mm:ss" };
GetDurationFormatM(Value, Fmt[unOptions.Stat_Tab], pdi->item.pszText, 32);
}
break;
@@ -297,7 +297,7 @@ void Stat_ReadFile(BYTE n)
{
LARGE_INTEGER Size;
DWORD BytesRead;
- TCHAR FileName[MAX_PATH], *pszPath;
+ wchar_t FileName[MAX_PATH], *pszPath;
SYSTEMTIME stNow;
pszPath = Utils_ReplaceVarsT(L"%miranda_userdata%\\statistics");
@@ -350,7 +350,7 @@ void Stat_Show(HWND hwndDialog)
void Stat_UpdateTotalTraffic(HWND hwndDialog, DWORD Incoming, DWORD Outgoing)
{
- TCHAR tmp[32];
+ wchar_t tmp[32];
GetFormattedTraffic(Incoming, unOptions.Stat_Units, tmp, 32);
SetDlgItemText(hwndDialog, IDC_STATIC_DNL, tmp);
diff --git a/plugins/TrafficCounter/src/stdafx.h b/plugins/TrafficCounter/src/stdafx.h
index abeb7badd6..2868dc3b87 100644
--- a/plugins/TrafficCounter/src/stdafx.h
+++ b/plugins/TrafficCounter/src/stdafx.h
@@ -107,7 +107,7 @@ typedef struct
// äàòà êîòîðîé ñîîòâåòñòâóåò íà÷àëó ñòàòèñòèêè äàííîãî àêêàóíòà.
// 0.1.1.6
- TCHAR *tszAccountName; // ×åëîâå÷åñêîå èìÿ àêêàóíòà äëÿ èñïîëüçîâàíèÿ â ãðàôè÷åñêîì èíòåðôåéñå.
+ wchar_t *tszAccountName; // ×åëîâå÷åñêîå èìÿ àêêàóíòà äëÿ èñïîëüçîâàíèÿ â ãðàôè÷åñêîì èíòåðôåéñå.
} PROTOLIST;
//---------------------------------------------------------------------------------------------
@@ -155,8 +155,8 @@ extern char Traffic_PopupTimeoutDefault;
extern char Traffic_PopupTimeoutValue;
extern char Traffic_AdditionSpace;
-extern TCHAR Traffic_CounterFormat[512];
-extern TCHAR Traffic_TooltipFormat[512];
+extern wchar_t Traffic_CounterFormat[512];
+extern wchar_t Traffic_TooltipFormat[512];
extern BOOL bPopupExists, bVariablesExists, bTooltipExists;
diff --git a/plugins/TrafficCounter/src/vars.cpp b/plugins/TrafficCounter/src/vars.cpp
index 62da3f32f7..64a71c71b5 100644
--- a/plugins/TrafficCounter/src/vars.cpp
+++ b/plugins/TrafficCounter/src/vars.cpp
@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-static TCHAR* GetTraffic(ARGUMENTSINFO *ai)
+static wchar_t* GetTraffic(ARGUMENTSINFO *ai)
{
DWORD tmp, tmpsn = 0, tmprn = 0, tmpst = 0, tmprt = 0;
BYTE ed;
@@ -54,7 +54,7 @@ static TCHAR* GetTraffic(ARGUMENTSINFO *ai)
for (tmp = ed = 0; ed < NumberOfAccounts; ed++)
{
if (!ProtoList[ed].name) continue;
- TCHAR *buf = mir_a2t(ProtoList[ed].name);
+ wchar_t *buf = mir_a2t(ProtoList[ed].name);
if (!mir_tstrcmp(buf, ai->targv[1]))
{
tmpsn = ProtoList[ed].CurrentSentTraffic;
@@ -101,7 +101,7 @@ static TCHAR* GetTraffic(ARGUMENTSINFO *ai)
// Ïîëó÷àåì ôîðìàòèðîâàííóþ ñòðîêó è âîçâðàùàåì óêàçàòåëü íà íå¸.
// Ñíà÷àëà óçíàåì ðàçìåð áóôåðà.
size_t l = GetFormattedTraffic(tmp, ed, NULL, 0);
- TCHAR *res = (TCHAR*)mir_alloc(l * sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc(l * sizeof(wchar_t));
if (!res) return NULL;
if (GetFormattedTraffic(tmp, ed, res, l))
return res;
@@ -110,7 +110,7 @@ static TCHAR* GetTraffic(ARGUMENTSINFO *ai)
return NULL;
}
-static TCHAR* GetTime(ARGUMENTSINFO *ai)
+static wchar_t* GetTime(ARGUMENTSINFO *ai)
{
BYTE ed, flag;
DWORD Duration;
@@ -120,7 +120,7 @@ static TCHAR* GetTime(ARGUMENTSINFO *ai)
// Èùåì èíäåêñ ïðîòîêîëà, ïåðåäàííîãî ïåðâûì àðãóìåíòîì
for (flag = ed = 0; ed < NumberOfAccounts; ed++)
{
- TCHAR *buf;
+ wchar_t *buf;
if (!ProtoList[ed].name) continue;
buf = mir_a2t(ProtoList[ed].name);
if (!mir_tstrcmp(buf, ai->targv[1]))
@@ -150,7 +150,7 @@ static TCHAR* GetTime(ARGUMENTSINFO *ai)
// Ïîëó÷àåì ôîðìàòèðîâàííóþ ñòðîêó è âîçâðàùàåì óêàçàòåëü íà íå¸.
// Ñíà÷àëà óçíàåì ðàçìåð áóôåðà.
size_t l = GetDurationFormatM(Duration, ai->targv[3], NULL, 0);
- TCHAR *res = (TCHAR*)mir_alloc(l * sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc(l * sizeof(wchar_t));
if (!res) return NULL;
GetDurationFormatM(Duration, ai->targv[3], res, l);
diff --git a/plugins/TranslitSwitcher/src/Layoutproc.cpp b/plugins/TranslitSwitcher/src/Layoutproc.cpp
index 74132b55d3..e0c08bb045 100644
--- a/plugins/TranslitSwitcher/src/Layoutproc.cpp
+++ b/plugins/TranslitSwitcher/src/Layoutproc.cpp
@@ -39,18 +39,18 @@ bool isItSmiley(unsigned int position)
static DWORD CALLBACK StreamOutCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
- TCHAR **ppText = (TCHAR**)dwCookie;
- *ppText = mir_tstrndup((TCHAR*)pbBuff, cb / sizeof(TCHAR));
+ wchar_t **ppText = (wchar_t**)dwCookie;
+ *ppText = mir_tstrndup((wchar_t*)pbBuff, cb / sizeof(wchar_t));
*pcb = cb;
return 0;
}
-TCHAR* Message_GetFromStream(HWND hwndRtf, DWORD dwPassedFlags)
+wchar_t* Message_GetFromStream(HWND hwndRtf, DWORD dwPassedFlags)
{
if (hwndRtf == 0)
return NULL;
- TCHAR *pszText = NULL;
+ wchar_t *pszText = NULL;
EDITSTREAM stream = { 0 };
stream.pfnCallback = StreamOutCallback;
stream.dwCookie = (DWORD_PTR)&pszText;
@@ -58,88 +58,88 @@ TCHAR* Message_GetFromStream(HWND hwndRtf, DWORD dwPassedFlags)
return pszText;
}
-void Transliterate(TCHAR *&str)
+void Transliterate(wchar_t *&str)
{
- TCHAR *newStr = (TCHAR*)mir_alloc(sizeof(TCHAR) * mir_tstrlen(str) * 3 + 1);
+ wchar_t *newStr = (wchar_t*)mir_alloc(sizeof(wchar_t) * mir_tstrlen(str) * 3 + 1);
newStr[0] = 0;
for (; *str != 0; str++) {
switch (str[0]) {
- case _T('à'): mir_tstrcat(newStr, L"a"); break;
- case _T('á'): mir_tstrcat(newStr, L"b"); break;
- case _T('â'): mir_tstrcat(newStr, L"v"); break;
- case _T('ã'): mir_tstrcat(newStr, L"g"); break;
- case _T('ä'): mir_tstrcat(newStr, L"d"); break;
- case _T('å'): mir_tstrcat(newStr, L"e"); break;
- case _T('¸'): mir_tstrcat(newStr, L"ye"); break;
- case _T('æ'): mir_tstrcat(newStr, L"zh"); break;
- case _T('ç'): mir_tstrcat(newStr, L"z"); break;
- case _T('è'): mir_tstrcat(newStr, L"i"); break;
- case _T('é'): mir_tstrcat(newStr, L"y"); break;
- case _T('ê'): mir_tstrcat(newStr, L"k"); break;
- case _T('ë'): mir_tstrcat(newStr, L"l"); break;
- case _T('ì'): mir_tstrcat(newStr, L"m"); break;
- case _T('í'): mir_tstrcat(newStr, L"n"); break;
- case _T('î'): mir_tstrcat(newStr, L"o"); break;
- case _T('ï'): mir_tstrcat(newStr, L"p"); break;
- case _T('ð'): mir_tstrcat(newStr, L"r"); break;
- case _T('ñ'): mir_tstrcat(newStr, L"s"); break;
- case _T('ò'): mir_tstrcat(newStr, L"t"); break;
- case _T('ó'): mir_tstrcat(newStr, L"u"); break;
- case _T('ô'): mir_tstrcat(newStr, L"f"); break;
- case _T('õ'): mir_tstrcat(newStr, L"kh"); break;
- case _T('ö'): mir_tstrcat(newStr, L"ts"); break;
- case _T('÷'): mir_tstrcat(newStr, L"ch"); break;
- case _T('ø'): mir_tstrcat(newStr, L"sh"); break;
- case _T('ù'): mir_tstrcat(newStr, L"sch"); break;
- case _T('ú'): mir_tstrcat(newStr, L"'"); break;
- case _T('û'): mir_tstrcat(newStr, L"yi"); break;
- case _T('ü'): mir_tstrcat(newStr, L""); break;
- case _T('ý'): mir_tstrcat(newStr, L"e"); break;
- case _T('þ'): mir_tstrcat(newStr, L"yu"); break;
- case _T('ÿ'): mir_tstrcat(newStr, L"ya"); break;
- case _T('À'): mir_tstrcat(newStr, L"A"); break;
- case _T('Á'): mir_tstrcat(newStr, L"B"); break;
- case _T('Â'): mir_tstrcat(newStr, L"V"); break;
- case _T('Ã'): mir_tstrcat(newStr, L"G"); break;
- case _T('Ä'): mir_tstrcat(newStr, L"D"); break;
- case _T('Å'): mir_tstrcat(newStr, L"E"); break;
- case _T('¨'): mir_tstrcat(newStr, L"Ye"); break;
- case _T('Æ'): mir_tstrcat(newStr, L"Zh"); break;
- case _T('Ç'): mir_tstrcat(newStr, L"Z"); break;
- case _T('È'): mir_tstrcat(newStr, L"I"); break;
- case _T('É'): mir_tstrcat(newStr, L"Y"); break;
- case _T('Ê'): mir_tstrcat(newStr, L"K"); break;
- case _T('Ë'): mir_tstrcat(newStr, L"L"); break;
- case _T('Ì'): mir_tstrcat(newStr, L"M"); break;
- case _T('Í'): mir_tstrcat(newStr, L"N"); break;
- case _T('Î'): mir_tstrcat(newStr, L"O"); break;
- case _T('Ï'): mir_tstrcat(newStr, L"P"); break;
- case _T('Ð'): mir_tstrcat(newStr, L"R"); break;
- case _T('Ñ'): mir_tstrcat(newStr, L"S"); break;
- case _T('Ò'): mir_tstrcat(newStr, L"T"); break;
- case _T('Ó'): mir_tstrcat(newStr, L"U"); break;
- case _T('Ô'): mir_tstrcat(newStr, L"F"); break;
- case _T('Õ'): mir_tstrcat(newStr, L"Kh"); break;
- case _T('Ö'): mir_tstrcat(newStr, L"Ts"); break;
- case _T('×'): mir_tstrcat(newStr, L"Ch"); break;
- case _T('Ø'): mir_tstrcat(newStr, L"Sh"); break;
- case _T('Ù'): mir_tstrcat(newStr, L"Sch"); break;
- case _T('Ú'): mir_tstrcat(newStr, L"'"); break;
- case _T('Û'): mir_tstrcat(newStr, L"Yi"); break;
- case _T('Ü'): mir_tstrcat(newStr, L""); break;
- case _T('Ý'): mir_tstrcat(newStr, L"E"); break;
- case _T('Þ'): mir_tstrcat(newStr, L"Yu"); break;
- case _T('ß'): mir_tstrcat(newStr, L"Ya"); break;
-
- case _T('a'): mir_tstrcat(newStr, L"à"); break;
- case _T('b'): mir_tstrcat(newStr, L"á"); break;
- case _T('v'): mir_tstrcat(newStr, L"â"); break;
- case _T('g'): mir_tstrcat(newStr, L"ã"); break;
- case _T('d'): mir_tstrcat(newStr, L"ä"); break;
- case _T('e'): mir_tstrcat(newStr, L"å"); break;
- case _T('z'):
+ case 'à': mir_tstrcat(newStr, L"a"); break;
+ case 'á': mir_tstrcat(newStr, L"b"); break;
+ case 'â': mir_tstrcat(newStr, L"v"); break;
+ case 'ã': mir_tstrcat(newStr, L"g"); break;
+ case 'ä': mir_tstrcat(newStr, L"d"); break;
+ case 'å': mir_tstrcat(newStr, L"e"); break;
+ case '¸': mir_tstrcat(newStr, L"ye"); break;
+ case 'æ': mir_tstrcat(newStr, L"zh"); break;
+ case 'ç': mir_tstrcat(newStr, L"z"); break;
+ case 'è': mir_tstrcat(newStr, L"i"); break;
+ case 'é': mir_tstrcat(newStr, L"y"); break;
+ case 'ê': mir_tstrcat(newStr, L"k"); break;
+ case 'ë': mir_tstrcat(newStr, L"l"); break;
+ case 'ì': mir_tstrcat(newStr, L"m"); break;
+ case 'í': mir_tstrcat(newStr, L"n"); break;
+ case 'î': mir_tstrcat(newStr, L"o"); break;
+ case 'ï': mir_tstrcat(newStr, L"p"); break;
+ case 'ð': mir_tstrcat(newStr, L"r"); break;
+ case 'ñ': mir_tstrcat(newStr, L"s"); break;
+ case 'ò': mir_tstrcat(newStr, L"t"); break;
+ case 'ó': mir_tstrcat(newStr, L"u"); break;
+ case 'ô': mir_tstrcat(newStr, L"f"); break;
+ case 'õ': mir_tstrcat(newStr, L"kh"); break;
+ case 'ö': mir_tstrcat(newStr, L"ts"); break;
+ case '÷': mir_tstrcat(newStr, L"ch"); break;
+ case 'ø': mir_tstrcat(newStr, L"sh"); break;
+ case 'ù': mir_tstrcat(newStr, L"sch"); break;
+ case 'ú': mir_tstrcat(newStr, L"'"); break;
+ case 'û': mir_tstrcat(newStr, L"yi"); break;
+ case 'ü': mir_tstrcat(newStr, L""); break;
+ case 'ý': mir_tstrcat(newStr, L"e"); break;
+ case 'þ': mir_tstrcat(newStr, L"yu"); break;
+ case 'ÿ': mir_tstrcat(newStr, L"ya"); break;
+ case 'À': mir_tstrcat(newStr, L"A"); break;
+ case 'Á': mir_tstrcat(newStr, L"B"); break;
+ case 'Â': mir_tstrcat(newStr, L"V"); break;
+ case 'Ã': mir_tstrcat(newStr, L"G"); break;
+ case 'Ä': mir_tstrcat(newStr, L"D"); break;
+ case 'Å': mir_tstrcat(newStr, L"E"); break;
+ case '¨': mir_tstrcat(newStr, L"Ye"); break;
+ case 'Æ': mir_tstrcat(newStr, L"Zh"); break;
+ case 'Ç': mir_tstrcat(newStr, L"Z"); break;
+ case 'È': mir_tstrcat(newStr, L"I"); break;
+ case 'É': mir_tstrcat(newStr, L"Y"); break;
+ case 'Ê': mir_tstrcat(newStr, L"K"); break;
+ case 'Ë': mir_tstrcat(newStr, L"L"); break;
+ case 'Ì': mir_tstrcat(newStr, L"M"); break;
+ case 'Í': mir_tstrcat(newStr, L"N"); break;
+ case 'Î': mir_tstrcat(newStr, L"O"); break;
+ case 'Ï': mir_tstrcat(newStr, L"P"); break;
+ case 'Ð': mir_tstrcat(newStr, L"R"); break;
+ case 'Ñ': mir_tstrcat(newStr, L"S"); break;
+ case 'Ò': mir_tstrcat(newStr, L"T"); break;
+ case 'Ó': mir_tstrcat(newStr, L"U"); break;
+ case 'Ô': mir_tstrcat(newStr, L"F"); break;
+ case 'Õ': mir_tstrcat(newStr, L"Kh"); break;
+ case 'Ö': mir_tstrcat(newStr, L"Ts"); break;
+ case '×': mir_tstrcat(newStr, L"Ch"); break;
+ case 'Ø': mir_tstrcat(newStr, L"Sh"); break;
+ case 'Ù': mir_tstrcat(newStr, L"Sch"); break;
+ case 'Ú': mir_tstrcat(newStr, L"'"); break;
+ case 'Û': mir_tstrcat(newStr, L"Yi"); break;
+ case 'Ü': mir_tstrcat(newStr, L""); break;
+ case 'Ý': mir_tstrcat(newStr, L"E"); break;
+ case 'Þ': mir_tstrcat(newStr, L"Yu"); break;
+ case 'ß': mir_tstrcat(newStr, L"Ya"); break;
+
+ case 'a': mir_tstrcat(newStr, L"à"); break;
+ case 'b': mir_tstrcat(newStr, L"á"); break;
+ case 'v': mir_tstrcat(newStr, L"â"); break;
+ case 'g': mir_tstrcat(newStr, L"ã"); break;
+ case 'd': mir_tstrcat(newStr, L"ä"); break;
+ case 'e': mir_tstrcat(newStr, L"å"); break;
+ case 'z':
{
- if (str[1] == _T('h')) {
+ if (str[1] == 'h') {
mir_tstrcat(newStr, L"æ");
str++;
break;
@@ -149,25 +149,25 @@ void Transliterate(TCHAR *&str)
break;
}
}
- case _T('i'): mir_tstrcat(newStr, L"è"); break;
- case _T('y'):
+ case 'i': mir_tstrcat(newStr, L"è"); break;
+ case 'y':
{
- if (str[1] == _T('a')) {
+ if (str[1] == 'a') {
mir_tstrcat(newStr, L"ÿ");
str++;
break;
}
- else if (str[1] == _T('e')) {
+ else if (str[1] == 'e') {
mir_tstrcat(newStr, L"¸");
str++;
break;
}
- else if (str[1] == _T('u')) {
+ else if (str[1] == 'u') {
mir_tstrcat(newStr, L"þ");
str++;
break;
}
- else if (str[1] == _T('i')) {
+ else if (str[1] == 'i') {
mir_tstrcat(newStr, L"û");
str++;
break;
@@ -177,9 +177,9 @@ void Transliterate(TCHAR *&str)
break;
}
}
- case _T('k'):
+ case 'k':
{
- if (str[1] == _T('h')) {
+ if (str[1] == 'h') {
mir_tstrcat(newStr, L"õ");
str++;
break;
@@ -189,20 +189,20 @@ void Transliterate(TCHAR *&str)
break;
}
}
- case _T('l'): mir_tstrcat(newStr, L"ë"); break;
- case _T('m'): mir_tstrcat(newStr, L"ì"); break;
- case _T('n'): mir_tstrcat(newStr, L"í"); break;
- case _T('o'): mir_tstrcat(newStr, L"î"); break;
- case _T('p'): mir_tstrcat(newStr, L"ï"); break;
- case _T('r'): mir_tstrcat(newStr, L"ð"); break;
- case _T('s'):
+ case 'l': mir_tstrcat(newStr, L"ë"); break;
+ case 'm': mir_tstrcat(newStr, L"ì"); break;
+ case 'n': mir_tstrcat(newStr, L"í"); break;
+ case 'o': mir_tstrcat(newStr, L"î"); break;
+ case 'p': mir_tstrcat(newStr, L"ï"); break;
+ case 'r': mir_tstrcat(newStr, L"ð"); break;
+ case 's':
{
- if (str[1] == _T('h')) {
+ if (str[1] == 'h') {
mir_tstrcat(newStr, L"ø");
str++;
break;
}
- else if (str[1] == _T('c') && str[2] == _T('h')) {
+ else if (str[1] == 'c' && str[2] == 'h') {
mir_tstrcat(newStr, L"ù");
str += 2;
break;
@@ -212,9 +212,9 @@ void Transliterate(TCHAR *&str)
break;
}
}
- case _T('t'):
+ case 't':
{
- if (str[1] == _T('s')) {
+ if (str[1] == 's') {
mir_tstrcat(newStr, L"ö");
str++;
break;
@@ -224,40 +224,40 @@ void Transliterate(TCHAR *&str)
break;
}
}
- case _T('u'): mir_tstrcat(newStr, L"ó"); break;
- case _T('f'): mir_tstrcat(newStr, L"ô"); break;
- case _T('c'):
+ case 'u': mir_tstrcat(newStr, L"ó"); break;
+ case 'f': mir_tstrcat(newStr, L"ô"); break;
+ case 'c':
{
- if (str[1] == _T('h')) {
+ if (str[1] == 'h') {
mir_tstrcat(newStr, L"÷");
str++;
break;
}
}
- case _T('A'): mir_tstrcat(newStr, L"À"); break;
- case _T('B'): mir_tstrcat(newStr, L"Á"); break;
- case _T('V'): mir_tstrcat(newStr, L"Â"); break;
- case _T('G'): mir_tstrcat(newStr, L"Ã"); break;
- case _T('D'): mir_tstrcat(newStr, L"Ä"); break;
- case _T('E'): mir_tstrcat(newStr, L"Å"); break;
- case _T('Y'):
+ case 'A': mir_tstrcat(newStr, L"À"); break;
+ case 'B': mir_tstrcat(newStr, L"Á"); break;
+ case 'V': mir_tstrcat(newStr, L"Â"); break;
+ case 'G': mir_tstrcat(newStr, L"Ã"); break;
+ case 'D': mir_tstrcat(newStr, L"Ä"); break;
+ case 'E': mir_tstrcat(newStr, L"Å"); break;
+ case 'Y':
{
- if (str[1] == _T('a')) {
+ if (str[1] == 'a') {
mir_tstrcat(newStr, L"ß");
str++;
break;
}
- else if (str[1] == _T('e')) {
+ else if (str[1] == 'e') {
mir_tstrcat(newStr, L"¨");
str++;
break;
}
- else if (str[1] == _T('u')) {
+ else if (str[1] == 'u') {
mir_tstrcat(newStr, L"Þ");
str++;
break;
}
- else if (str[1] == _T('i')) {
+ else if (str[1] == 'i') {
mir_tstrcat(newStr, L"Û");
str++;
break;
@@ -267,9 +267,9 @@ void Transliterate(TCHAR *&str)
break;
}
}
- case _T('Z'):
+ case 'Z':
{
- if (str[1] == _T('h')) {
+ if (str[1] == 'h') {
mir_tstrcat(newStr, L"Æ");
str++;
break;
@@ -279,10 +279,10 @@ void Transliterate(TCHAR *&str)
break;
}
}
- case _T('I'): mir_tstrcat(newStr, L"È"); break;
- case _T('K'):
+ case 'I': mir_tstrcat(newStr, L"È"); break;
+ case 'K':
{
- if (str[1] == _T('h')) {
+ if (str[1] == 'h') {
mir_tstrcat(newStr, L"Õ");
str++;
break;
@@ -292,20 +292,20 @@ void Transliterate(TCHAR *&str)
break;
}
}
- case _T('L'): mir_tstrcat(newStr, L"Ë"); break;
- case _T('M'): mir_tstrcat(newStr, L"Ì"); break;
- case _T('N'): mir_tstrcat(newStr, L"Í"); break;
- case _T('O'): mir_tstrcat(newStr, L"Î"); break;
- case _T('P'): mir_tstrcat(newStr, L"Ï"); break;
- case _T('R'): mir_tstrcat(newStr, L"Ð"); break;
- case _T('S'):
+ case 'L': mir_tstrcat(newStr, L"Ë"); break;
+ case 'M': mir_tstrcat(newStr, L"Ì"); break;
+ case 'N': mir_tstrcat(newStr, L"Í"); break;
+ case 'O': mir_tstrcat(newStr, L"Î"); break;
+ case 'P': mir_tstrcat(newStr, L"Ï"); break;
+ case 'R': mir_tstrcat(newStr, L"Ð"); break;
+ case 'S':
{
- if (str[1] == _T('h')) {
+ if (str[1] == 'h') {
mir_tstrcat(newStr, L"Ø");
str++;
break;
}
- else if (str[1] == _T('c') && str[2] == _T('h')) {
+ else if (str[1] == 'c' && str[2] == 'h') {
mir_tstrcat(newStr, L"Ù");
str += 2;
break;
@@ -315,9 +315,9 @@ void Transliterate(TCHAR *&str)
break;
}
}
- case _T('T'):
+ case 'T':
{
- if (str[1] == _T('s')) {
+ if (str[1] == 's') {
mir_tstrcat(newStr, L"Ö");
str++;
break;
@@ -327,35 +327,35 @@ void Transliterate(TCHAR *&str)
break;
}
}
- case _T('U'): mir_tstrcat(newStr, L"Ó"); break;
- case _T('F'): mir_tstrcat(newStr, L"Ô"); break;
- case _T('C'):
+ case 'U': mir_tstrcat(newStr, L"Ó"); break;
+ case 'F': mir_tstrcat(newStr, L"Ô"); break;
+ case 'C':
{
- if (str[1] == _T('h')) {
+ if (str[1] == 'h') {
mir_tstrcat(newStr, L"×");
str++;
break;
}
}
- case _T('\''): mir_tstrcat(newStr, L"ú"); break;
+ case '\'': mir_tstrcat(newStr, L"ú"); break;
- default: { TCHAR Temp[2] = { str[0], 0 }; mir_tstrcat(newStr, &Temp[0]); }
+ default: { wchar_t Temp[2] = { str[0], 0 }; mir_tstrcat(newStr, &Temp[0]); }
}
}
size_t len = mir_tstrlen(newStr);
- str = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
+ str = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
str[0] = 0;
mir_tstrcpy(str, newStr);
mir_free(newStr);
}
-void Invert(TCHAR *str)
+void Invert(wchar_t *str)
{
while (*str) {
if (IsCharUpper(*str))
- *str = (TCHAR)CharLower((LPTSTR)*str);
+ *str = (wchar_t)CharLower((LPTSTR)*str);
else if (IsCharLower(*str))
- *str = (TCHAR)CharUpper((LPTSTR)*str);
+ *str = (wchar_t)CharUpper((LPTSTR)*str);
str++;
}
keybd_event(VK_CAPITAL, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
@@ -374,10 +374,10 @@ void SwitchLayout(bool lastword)
if (hwnd2 == NULL)
return;
- TCHAR szClassName[MAX_PATH];
+ wchar_t szClassName[MAX_PATH];
GetClassName(hwnd2, szClassName, _countof(szClassName));
if ((mir_tstrcmp(szClassName, L"THppRichEdit.UnicodeClass") == 0 || mir_tstrcmp(szClassName, L"THistoryGrid.UnicodeClass") == 0 || mir_tstrcmp(szClassName, L"TExtHistoryGrid.UnicodeClass") == 0 || mir_tstrcmp(szClassName, L"Internet Explorer_Server") == 0) && ServiceExists(MS_POPUP_SHOWMESSAGE)) { // make popup here
- TCHAR buf[2048];
+ wchar_t buf[2048];
if (mir_tstrcmp(szClassName, L"Internet Explorer_Server") == 0) {
IEVIEWEVENT event;
HWND hwnd3 = GetParent(GetParent(hwnd2));
@@ -387,7 +387,7 @@ void SwitchLayout(bool lastword)
event.dwFlags = 0;
event.iType = IEE_GET_SELECTION;
event.hwnd = hwnd3;
- TCHAR *selected = (TCHAR *)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&event);
+ wchar_t *selected = (wchar_t *)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&event);
mir_tstrncpy(buf, selected, _countof(buf));
}
else GetWindowText(hwnd2, buf, _countof(buf)); // gimme, gimme, gimme...
@@ -418,7 +418,7 @@ void SwitchLayout(bool lastword)
keys[VK_MENU] = (HIBYTE(vks) & 4) ? 0xFF : 0x00; // alt
if (!isItSmiley(DWORD(i))) {
- TCHAR tchr;
+ wchar_t tchr;
if (ToUnicodeEx(LOBYTE(vks), 0, keys, &tchr, 1, 0, GetKeyboardLayout(dwThreadID)) == 1)
buf[i] = tchr;
}
@@ -446,7 +446,7 @@ void SwitchLayout(bool lastword)
if (somethingIsSelected)
dwFlags += SFF_SELECTION;
- TCHAR *sel = Message_GetFromStream(hwnd2, dwFlags);
+ wchar_t *sel = Message_GetFromStream(hwnd2, dwFlags);
size_t slen = mir_tstrlen(sel);
if (slen != 0) {
if (ServiceExists(MS_SMILEYADD_BATCHPARSE)) {
@@ -461,13 +461,13 @@ void SwitchLayout(bool lastword)
if (lastword && !somethingIsSelected) {
end = (size_t)dwStart;
while (end < slen) {
- if (_istspace(sel[end]) || isItSmiley((int)end))
+ if (iswspace(sel[end]) || isItSmiley((int)end))
break;
end++;
}
start = dwStart - 1;
while (start > 0 && start < dwStart) {
- if ((_istspace(sel[start]) && !_istspace(sel[start + 1])) || isItSmiley((int)start))
+ if ((iswspace(sel[start]) && !iswspace(sel[start + 1])) || isItSmiley((int)start))
break;
start--;
}
@@ -483,7 +483,7 @@ void SwitchLayout(bool lastword)
keys[VK_MENU] = (HIBYTE(vks) & 4) ? 0xFF : 0x00; // alt
if (!isItSmiley((int)i)) {
- TCHAR tchr;
+ wchar_t tchr;
if (ToUnicodeEx(LOBYTE(vks), 0, keys, &tchr, 1, 0, GetKeyboardLayout(dwThreadID)) == 1)
sel[i] = tchr;
}
@@ -513,7 +513,7 @@ void TranslitLayout(bool lastword)
if (hwnd2 == NULL)
return;
- TCHAR szClassName[16];
+ wchar_t szClassName[16];
GetClassName(hwnd2, szClassName, _countof(szClassName));
if (mir_tstrcmpi(szClassName, L"RichEdit50W") != 0)
return;
@@ -524,29 +524,29 @@ void TranslitLayout(bool lastword)
if (somethingIsSelected)
dwFlags += SFF_SELECTION;
- TCHAR *boo, *sel = Message_GetFromStream(hwnd2, dwFlags);
+ wchar_t *boo, *sel = Message_GetFromStream(hwnd2, dwFlags);
size_t slen = mir_tstrlen(sel), start = 0, end = 0;
if (slen != 0) {
end = slen;
if (lastword && !somethingIsSelected) {
end = (size_t)dwStart;
while (end < slen) {
- if (_istspace(sel[end]) || isItSmiley((int)end))
+ if (iswspace(sel[end]) || isItSmiley((int)end))
break;
end++;
}
start = (size_t)dwStart - 1;
while (start > 0 && start < (size_t)dwStart) {
- if ((_istspace(sel[start]) && (end - start > 2)) || isItSmiley((int)start))
+ if ((iswspace(sel[start]) && (end - start > 2)) || isItSmiley((int)start))
break;
start--;
}
- boo = (TCHAR*)mir_alloc((end - start + 1) * sizeof(TCHAR));
+ boo = (wchar_t*)mir_alloc((end - start + 1) * sizeof(wchar_t));
mir_tstrncpy(boo, sel + start, end - start);
boo[end - start] = 0;
}
else {
- boo = (TCHAR*)mir_alloc((slen + 1) * sizeof(TCHAR));
+ boo = (wchar_t*)mir_alloc((slen + 1) * sizeof(wchar_t));
mir_tstrcpy(boo, sel);
}
@@ -555,7 +555,7 @@ void TranslitLayout(bool lastword)
if (somethingIsSelected)
SendMessage(hwnd2, EM_REPLACESEL, false, (LPARAM)boo);
else {
- TCHAR *NewText = (TCHAR*)mir_alloc((start + mir_tstrlen(boo) + (slen - start) + 1) * sizeof(TCHAR));
+ wchar_t *NewText = (wchar_t*)mir_alloc((start + mir_tstrlen(boo) + (slen - start) + 1) * sizeof(wchar_t));
NewText[0] = 0;
mir_tstrncat(NewText, sel, start);
mir_tstrcat(NewText, boo);
@@ -580,7 +580,7 @@ void InvertCase(bool lastword)
if (hwnd2 == NULL)
return;
- TCHAR szClassName[16];
+ wchar_t szClassName[16];
GetClassName(hwnd2, szClassName, _countof(szClassName));
if (mir_tstrcmpi(szClassName, L"RichEdit50W") != 0)
@@ -592,29 +592,29 @@ void InvertCase(bool lastword)
if (somethingIsSelected)
dwFlags += SFF_SELECTION;
- TCHAR *boo, *sel = Message_GetFromStream(hwnd2, dwFlags);
+ wchar_t *boo, *sel = Message_GetFromStream(hwnd2, dwFlags);
size_t slen = mir_tstrlen(sel), start = 0, end = 0;
if (slen != 0) {
end = slen;
if (lastword && !somethingIsSelected) {
end = (size_t)dwStart;
while (end < slen) {
- if (_istspace(sel[end]) || isItSmiley((int)end))
+ if (iswspace(sel[end]) || isItSmiley((int)end))
break;
end++;
}
start = (size_t)dwStart - 1;
while (start > 0 && start < (size_t)dwStart) {
- if ((_istspace(sel[start]) && (end - start > 2)) || isItSmiley((int)start))
+ if ((iswspace(sel[start]) && (end - start > 2)) || isItSmiley((int)start))
break;
start--;
}
- boo = (TCHAR*)mir_alloc((end - start + 1) * sizeof(TCHAR));
+ boo = (wchar_t*)mir_alloc((end - start + 1) * sizeof(wchar_t));
mir_tstrncpy(boo, sel + start, end - start);
boo[end - start] = 0;
}
else {
- boo = (TCHAR*)mir_alloc((slen + 1) * sizeof(TCHAR));
+ boo = (wchar_t*)mir_alloc((slen + 1) * sizeof(wchar_t));
mir_tstrcpy(boo, sel);
}
@@ -623,7 +623,7 @@ void InvertCase(bool lastword)
if (somethingIsSelected)
SendMessage(hwnd2, EM_REPLACESEL, false, (LPARAM)boo);
else {
- TCHAR *NewText = (TCHAR*)mir_alloc((start + mir_tstrlen(boo) + (slen - start) + 1) * sizeof(TCHAR));
+ wchar_t *NewText = (wchar_t*)mir_alloc((start + mir_tstrlen(boo) + (slen - start) + 1) * sizeof(wchar_t));
NewText[0] = 0;
mir_tstrncat(NewText, sel, start);
mir_tstrcat(NewText, boo);
@@ -664,7 +664,7 @@ int OnButtonPressed(WPARAM, LPARAM lParam)
byKeybState[VK_CONTROL] = 0;
SetKeyboardState(byKeybState);
- TCHAR *sel = Message_GetFromStream(hEdit, SF_TEXT | SF_UNICODE);
+ wchar_t *sel = Message_GetFromStream(hEdit, SF_TEXT | SF_UNICODE);
size_t slen = mir_tstrlen(sel);
if (slen != 0) {
switch (iType) {
@@ -686,7 +686,7 @@ int OnButtonPressed(WPARAM, LPARAM lParam)
ActivateKeyboardLayout((HKL)HKL_PREV, KLF_ACTIVATE);
for (int i = 0; i < (int)slen; i++) {
- TCHAR tchr;
+ wchar_t tchr;
BYTE keys[256] = { 0 };
SHORT vks = VkKeyScanEx(sel[i], hkl);
diff --git a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp
index daf47f1298..046d982675 100644
--- a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp
+++ b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp
@@ -156,40 +156,40 @@ extern "C" __declspec(dllexport) int Load(void)
HOTKEYDESC hkd = { sizeof(hkd) };
hkd.dwFlags = HKD_TCHAR;
hkd.pszName = "TranslitSwitcher/ConvertAllOrSelected";
- hkd.ptszDescription = LPGENT("Convert All / Selected");
+ hkd.ptszDescription = LPGENW("Convert All / Selected");
hkd.ptszSection = L"TranslitSwitcher";
hkd.pszService = MS_TS_SWITCHLAYOUT;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL + HKCOMB_A, 'R') | HKF_MIRANDA_LOCAL;
Hotkey_Register(&hkd);
hkd.pszName = "TranslitSwitcher/ConvertLastOrSelected";
- hkd.ptszDescription = LPGENT("Convert Last / Selected");
+ hkd.ptszDescription = LPGENW("Convert Last / Selected");
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT + HKCOMB_A, 'R') | HKF_MIRANDA_LOCAL;
hkd.lParam = true;
Hotkey_Register(&hkd);
hkd.pszName = "TranslitSwitcher/TranslitAllOrSelected";
- hkd.ptszDescription = LPGENT("Translit All / Selected");
+ hkd.ptszDescription = LPGENW("Translit All / Selected");
hkd.pszService = MS_TS_TRANSLITLAYOUT;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL + HKCOMB_A, 'T') | HKF_MIRANDA_LOCAL;
hkd.lParam = false;
Hotkey_Register(&hkd);
hkd.pszName = "TranslitSwitcher/TranslitLastOrSelected";
- hkd.ptszDescription = LPGENT("Translit Last / Selected");
+ hkd.ptszDescription = LPGENW("Translit Last / Selected");
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT + HKCOMB_A, 'T') | HKF_MIRANDA_LOCAL;
hkd.lParam = true;
Hotkey_Register(&hkd);
hkd.pszName = "TranslitSwitcher/InvertCaseAllOrSelected";
- hkd.ptszDescription = LPGENT("Invert Case All / Selected");
+ hkd.ptszDescription = LPGENW("Invert Case All / Selected");
hkd.pszService = MS_TS_INVERTCASE;
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL + HKCOMB_A, 'Y') | HKF_MIRANDA_LOCAL;
hkd.lParam = false;
Hotkey_Register(&hkd);
hkd.pszName = "TranslitSwitcher/InvertCaseLastOrSelected";
- hkd.ptszDescription = LPGENT("Invert Case Last / Selected");
+ hkd.ptszDescription = LPGENW("Invert Case Last / Selected");
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT + HKCOMB_A, 'Y') | HKF_MIRANDA_LOCAL;
hkd.lParam = true;
Hotkey_Register(&hkd);
diff --git a/plugins/UserGuide/src/main.cpp b/plugins/UserGuide/src/main.cpp
index 9492c6896b..2d591663ba 100644
--- a/plugins/UserGuide/src/main.cpp
+++ b/plugins/UserGuide/src/main.cpp
@@ -21,10 +21,10 @@ PLUGININFOEX pluginInfo = {
static INT_PTR ShowGuideFile(WPARAM, LPARAM)
{
- LPTSTR pszDirName = (LPTSTR)mir_alloc(250*sizeof(TCHAR));
- LPTSTR pszFileName = (LPTSTR)mir_alloc(250*sizeof(TCHAR));
+ LPTSTR pszDirName = (LPTSTR)mir_alloc(250*sizeof(wchar_t));
+ LPTSTR pszFileName = (LPTSTR)mir_alloc(250*sizeof(wchar_t));
- TCHAR *ptszHelpFile = db_get_tsa(NULL, "UserGuide", "PathToHelpFile");
+ wchar_t *ptszHelpFile = db_get_tsa(NULL, "UserGuide", "PathToHelpFile");
if (ptszHelpFile==0)
{
@@ -40,17 +40,17 @@ static INT_PTR ShowGuideFile(WPARAM, LPARAM)
}
else
{
- LPTSTR pszDivider = _tcsrchr(ptszHelpFile, '\\');
+ LPTSTR pszDivider = wcsrchr(ptszHelpFile, '\\');
if (pszDivider == NULL)
{
mir_tstrcpy(pszDirName, L"");
- _tcsncpy(pszFileName, ptszHelpFile, mir_tstrlen(ptszHelpFile));
+ wcsncpy(pszFileName, ptszHelpFile, mir_tstrlen(ptszHelpFile));
}
else
{
- _tcsncpy(pszFileName, pszDivider + 1, mir_tstrlen(ptszHelpFile) - mir_tstrlen(pszDivider) - 1);
+ wcsncpy(pszFileName, pszDivider + 1, mir_tstrlen(ptszHelpFile) - mir_tstrlen(pszDivider) - 1);
pszFileName[mir_tstrlen(ptszHelpFile) - mir_tstrlen(pszDivider) - 1] = 0;
- _tcsncpy(pszDirName, ptszHelpFile, pszDivider - ptszHelpFile);
+ wcsncpy(pszDirName, ptszHelpFile, pszDivider - ptszHelpFile);
pszDirName[pszDivider - ptszHelpFile] = 0;
}
}
@@ -87,7 +87,7 @@ extern "C" __declspec(dllexport) int Load(void)
mi.position = 500000;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_HELP);
- mi.name.t = LPGENT("User Guide");
+ mi.name.w = LPGENW("User Guide");
mi.pszService = "UserGuide/ShowGuide";
Menu_AddMainMenuItem(&mi);
diff --git a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp
index d28f9fcd36..445928a641 100644
--- a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp
+++ b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp
@@ -342,12 +342,12 @@ void InitIcons()
if (phIconHandles != NULL) {
char szId[20];
SKINICONDESC sid = { 0 };
- sid.section.t = LPGENT("Country flags");
+ sid.section.w = LPGENW("Country flags");
sid.pszName = szId; // name to refer to icon when playing and in db
sid.flags = SIDF_SORTED | SIDF_TCHAR;
for (int i=0; i < nCountriesCount; i++) {
- sid.description.t = mir_a2t(LPGEN(countries[i].szName));
+ sid.description.w = mir_a2t(LPGEN(countries[i].szName));
/* create identifier */
mir_snprintf(szId, (countries[i].id == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countries[i].id); /* buffer safe */
int index = CountryNumberToBitmapIndex(countries[i].id);
@@ -358,7 +358,7 @@ void InitIcons()
phIconHandles[index] = IcoLib_AddIcon(&sid);
if (sid.hDefaultIcon != NULL)
DestroyIcon(sid.hDefaultIcon);
- mir_free(sid.description.t); sid.description.t = NULL;
+ mir_free(sid.description.w); sid.description.w = NULL;
}
}
ImageList_Destroy(himl);
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp
index 9567506ab3..2bf0c62670 100644
--- a/plugins/UserInfoEx/src/classMAnnivDate.cpp
+++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp
@@ -218,19 +218,19 @@ struct
LPCSTR szZodiacIcon;
}
static zodiac[] = {
- { 80, 110, LPGENT("Aries"), ICO_ZOD_ARIES }, // Widder
- { 111, 140, LPGENT("Taurus"), ICO_ZOD_TAURUS }, // Stier
- { 141, 172, LPGENT("Gemini"), ICO_ZOD_GEMINI }, // Zwillinge
- { 173, 203, LPGENT("Cancer"), ICO_ZOD_CANCER }, // Krebs
- { 204, 235, LPGENT("Leo"), ICO_ZOD_LEO }, // Löwe
- { 236, 266, LPGENT("Virgo"), ICO_ZOD_VIRGO }, // Jungfrau
- { 267, 296, LPGENT("Libra"), ICO_ZOD_LIBRA }, // Waage
- { 297, 326, LPGENT("Scorpio"), ICO_ZOD_SCORPIO }, // Scorpion
- { 327, 355, LPGENT("Sagittarius"), ICO_ZOD_SAGITTARIUS }, // Schütze
- { 356, 364, LPGENT("Capricorn"), ICO_ZOD_CAPRICORN }, // Steinbock
- { 1, 19, LPGENT("Capricorn"), ICO_ZOD_CAPRICORN }, // Steinbock
- { 20, 49, LPGENT("Aquarius"), ICO_ZOD_AQUARIUS }, // Wassermann
- { 50, 79, LPGENT("Pisces"), ICO_ZOD_PISCES }, // Fische
+ { 80, 110, LPGENW("Aries"), ICO_ZOD_ARIES }, // Widder
+ { 111, 140, LPGENW("Taurus"), ICO_ZOD_TAURUS }, // Stier
+ { 141, 172, LPGENW("Gemini"), ICO_ZOD_GEMINI }, // Zwillinge
+ { 173, 203, LPGENW("Cancer"), ICO_ZOD_CANCER }, // Krebs
+ { 204, 235, LPGENW("Leo"), ICO_ZOD_LEO }, // Löwe
+ { 236, 266, LPGENW("Virgo"), ICO_ZOD_VIRGO }, // Jungfrau
+ { 267, 296, LPGENW("Libra"), ICO_ZOD_LIBRA }, // Waage
+ { 297, 326, LPGENW("Scorpio"), ICO_ZOD_SCORPIO }, // Scorpion
+ { 327, 355, LPGENW("Sagittarius"), ICO_ZOD_SAGITTARIUS }, // Schütze
+ { 356, 364, LPGENW("Capricorn"), ICO_ZOD_CAPRICORN }, // Steinbock
+ { 1, 19, LPGENW("Capricorn"), ICO_ZOD_CAPRICORN }, // Steinbock
+ { 20, 49, LPGENW("Aquarius"), ICO_ZOD_AQUARIUS }, // Wassermann
+ { 50, 79, LPGENW("Pisces"), ICO_ZOD_PISCES }, // Fische
{ 0, 0, NULL, "" } // end of array
};
@@ -680,9 +680,9 @@ int MAnnivDate::DBWriteAnniversaryDate(MCONTACT hContact, WORD wIndex)
static WORD AskUser(MCONTACT hContact, MAnnivDate *pOldCustomDate, MAnnivDate *pNewProtoDate)
{
MSGBOX MB;
- TCHAR szMsg[MAXDATASIZE];
- TCHAR szDate[MAX_PATH];
- TCHAR szoldDate[MAX_PATH];
+ wchar_t szMsg[MAXDATASIZE];
+ wchar_t szDate[MAX_PATH];
+ wchar_t szoldDate[MAX_PATH];
pOldCustomDate->DateFormat(szoldDate, _countof(szoldDate));
pNewProtoDate->DateFormat(szDate, _countof(szDate));
@@ -696,8 +696,8 @@ static WORD AskUser(MCONTACT hContact, MAnnivDate *pOldCustomDate, MAnnivDate *p
MB.hiLogo = IcoLib_GetIcon(ICO_DLG_ANNIVERSARY);
MB.hiMsg = NULL;
MB.uType = MB_YESALLNO|MB_ICON_QUESTION|MB_INFOBAR|MB_NOPOPUP;
- MB.ptszTitle = LPGENT("Update custom birthday");
- MB.ptszInfoText = LPGENT("Keeps your custom birthday up to date.");
+ MB.ptszTitle = LPGENW("Update custom birthday");
+ MB.ptszInfoText = LPGENW("Keeps your custom birthday up to date.");
MB.ptszMsg = szMsg;
return MsgBoxService(NULL, (LPARAM)&MB);
}
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.h b/plugins/UserInfoEx/src/classMAnnivDate.h
index 14246f79f6..9d600eb814 100644
--- a/plugins/UserInfoEx/src/classMAnnivDate.h
+++ b/plugins/UserInfoEx/src/classMAnnivDate.h
@@ -44,7 +44,7 @@ public:
private:
WORD _wID; // index to anniversary in database or ANID_BIRTHDAY
- tstring _strDesc; // descripes the anniversary (e.g. birthday)
+ wstring _strDesc; // descripes the anniversary (e.g. birthday)
string _strModule; // the module the anniversary has been read from
WORD _wFlags; // the flags
BYTE _bRemind; // per user setting for reminder (0 - disabled, 1 - use local offset, 2 - use global offset)
diff --git a/plugins/UserInfoEx/src/classMTime.cpp b/plugins/UserInfoEx/src/classMTime.cpp
index 8c2049b3d7..03cc310118 100644
--- a/plugins/UserInfoEx/src/classMTime.cpp
+++ b/plugins/UserInfoEx/src/classMTime.cpp
@@ -363,9 +363,9 @@ WORD MTime::DateFormatAlt(LPTSTR ptszTimeFormat, WORD cchTimeFormat)
return 0;
}
- TCHAR tszText[10];
- _itot(mtNow.Year(), tszText, 10);
- TCHAR * tszYear = _tcsstr(ptszTimeFormat, tszText);
+ wchar_t tszText[10];
+ _itow(mtNow.Year(), tszText, 10);
+ wchar_t * tszYear = wcsstr(ptszTimeFormat, tszText);
if (tszYear && mir_tstrlen(tszYear) == 4)
mir_tstrcpy(tszYear, L"????");
diff --git a/plugins/UserInfoEx/src/classMTime.h b/plugins/UserInfoEx/src/classMTime.h
index 78ff1b23dd..623b1a156b 100644
--- a/plugins/UserInfoEx/src/classMTime.h
+++ b/plugins/UserInfoEx/src/classMTime.h
@@ -59,7 +59,6 @@ public:
WORD AdjustYear(const int nDiffDays);
WORD TimeFormat(LPTSTR ptszTimeFormat, WORD cchTimeFormat);
- WORD TimeFormat(tstring& str);
WORD DateFormat(LPTSTR ptszTimeFormat, WORD cchTimeFormat);
WORD DateFormatAlt(LPTSTR ptszTimeFormat, WORD cchTimeFormat);
WORD DateFormatLong(LPTSTR ptszTimeFormat, WORD cchTimeFormat);
diff --git a/plugins/UserInfoEx/src/classPsTree.cpp b/plugins/UserInfoEx/src/classPsTree.cpp
index 6cbd32fe43..ba83d12e61 100644
--- a/plugins/UserInfoEx/src/classPsTree.cpp
+++ b/plugins/UserInfoEx/src/classPsTree.cpp
@@ -130,10 +130,10 @@ int CPsTree::AddDummyItem(LPCSTR pszGroup)
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = ghInst;
odp.flags = ODPF_TCHAR;
- odp.ptszTitle = mir_utf8decodeT(pszGroup);
+ odp.pwszTitle = mir_utf8decodeT(pszGroup);
INT_PTR rc = UserInfo_AddPage((WPARAM)&psh, &odp);
- mir_free(odp.ptszTitle);
+ mir_free(odp.pwszTitle);
if (!rc) {
_pItems = psh._pPages;
_numItems = psh._numPages;
@@ -368,7 +368,7 @@ HTREEITEM CPsTree::ShowItem(const int iPageIndex, LPWORD needWidth)
!pti->Name() ||
!pti->Label())
{
- MsgErr(GetParent(_hWndTree), LPGENT("Due to a parameter error, one of the treeitems can't be added!"));
+ MsgErr(GetParent(_hWndTree), LPGENW("Due to a parameter error, one of the treeitems can't be added!"));
return NULL;
}
// item is visible at the moment
@@ -393,7 +393,7 @@ HTREEITEM CPsTree::ShowItem(const int iPageIndex, LPWORD needWidth)
// insert item into tree if set visible
if ((tvii.itemex.hItem = TreeView_InsertItem(_hWndTree, &tvii)) == NULL)
{
- MsgErr(GetParent(_hWndTree), LPGENT("A fatal error occurred on adding a property sheet page!\nDialog creation aborted!"));
+ MsgErr(GetParent(_hWndTree), LPGENW("A fatal error occurred on adding a property sheet page!\nDialog creation aborted!"));
return NULL;
}
pti->Hti(tvii.itemex.hItem);
@@ -685,7 +685,7 @@ int CPsTree::BeginLabelEdit(HTREEITEM hItem)
**/
int CPsTree::EndLabelEdit(const BYTE bSave)
{
- TCHAR szEdit[MAX_TINAME];
+ wchar_t szEdit[MAX_TINAME];
TVITEM tvi;
WORD cchEdit;
diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp
index ca46d61dfa..2035874a55 100644
--- a/plugins/UserInfoEx/src/classPsTreeItem.cpp
+++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp
@@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**/
BOOL CALLBACK BoldGroupTitlesEnumChildren(HWND hWnd, LPARAM lParam)
{
- TCHAR szClass[64];
+ wchar_t szClass[64];
GetClassName(hWnd, szClass, 64);
if (!mir_tstrcmp(szClass, L"Button") && (GetWindowLongPtr(hWnd, GWL_STYLE) & 0x0F) == BS_GROUPBOX)
SendMessage(hWnd, WM_SETFONT, lParam, NULL);
@@ -318,8 +318,8 @@ int CPsTreeItem::Icon(HIMAGELIST hIml, OPTIONSDIALOGPAGE *odp, BYTE bInitIconsOn
SKINICONDESC sid = { 0 };
sid.flags = SIDF_ALL_TCHAR;
sid.pszName = (LPSTR)pszIconName;
- sid.description.t = _ptszLabel;
- sid.section.t = LPGENT(SECT_TREE);
+ sid.description.w = _ptszLabel;
+ sid.section.w = _A2W(SECT_TREE);
// the item to insert brings along an icon?
if (odp->flags & ODPF_ICON) {
@@ -327,10 +327,10 @@ int CPsTreeItem::Icon(HIMAGELIST hIml, OPTIONSDIALOGPAGE *odp, BYTE bInitIconsOn
if (odp->hInstance == ghInst) {
// the pszGroup holds the iconfile for items added by uinfoex
- sid.defaultFile.t = odp->ptszGroup;
+ sid.defaultFile.w = odp->pwszGroup;
// icon library exists?
- if (sid.defaultFile.t)
+ if (sid.defaultFile.w)
sid.iDefaultIndex = (INT_PTR)odp->hIcon;
// no valid icon library
else {
@@ -385,7 +385,7 @@ int CPsTreeItem::Icon(HIMAGELIST hIml, OPTIONSDIALOGPAGE *odp, BYTE bInitIconsOn
int CPsTreeItem::Create(CPsHdr* pPsh, OPTIONSDIALOGPAGE *odp)
{
int err;
- TCHAR szTitle[ MAXSETTING ];
+ wchar_t szTitle[ MAXSETTING ];
// check parameter
if (pPsh && pPsh->_dwSize == sizeof(CPsHdr) && odp && PtrIsValid(odp->hInstance)) {
@@ -403,23 +403,23 @@ int CPsTreeItem::Create(CPsHdr* pPsh, OPTIONSDIALOGPAGE *odp)
if (pPsh->_dwFlags & PSF_PROTOPAGESONLY) {
if (_dwFlags & ODPF_USERINFOTAB)
- mir_sntprintf(szTitle, L"%s %d\\%s", odp->ptszTitle, pPsh->_nSubContact+1, odp->ptszTab);
+ mir_sntprintf(szTitle, L"%s %d\\%s", odp->pwszTitle, pPsh->_nSubContact+1, odp->pwszTab);
else
- mir_sntprintf(szTitle, L"%s %d", odp->ptszTitle, pPsh->_nSubContact+1);
+ mir_sntprintf(szTitle, L"%s %d", odp->pwszTitle, pPsh->_nSubContact+1);
}
else {
if (_dwFlags & ODPF_USERINFOTAB)
- mir_sntprintf(szTitle, L"%s\\%s", odp->ptszTitle, odp->ptszTab);
+ mir_sntprintf(szTitle, L"%s\\%s", odp->pwszTitle, odp->pwszTab);
else
- mir_tstrcpy(szTitle, odp->ptszTitle);
+ mir_tstrcpy(szTitle, odp->pwszTitle);
}
// set the unique utf8 encoded name for the item
if (err = Name(szTitle, (_dwFlags & ODPF_UNICODE) == ODPF_UNICODE))
- MsgErr(NULL, LPGENT("Creating unique name for a page failed with %d and error code %d"), err, GetLastError());
+ MsgErr(NULL, LPGENW("Creating unique name for a page failed with %d and error code %d"), err, GetLastError());
// read label from database or create it
else if (err = ItemLabel(TRUE))
- MsgErr(NULL, LPGENT("Creating the label for a page failed with %d and error code %d"), err, GetLastError());
+ MsgErr(NULL, LPGENW("Creating the label for a page failed with %d and error code %d"), err, GetLastError());
else {
// load icon for the item
Icon(pPsh->_hImages, odp, (pPsh->_dwFlags & PSTVF_INITICONS) == PSTVF_INITICONS);
@@ -439,7 +439,7 @@ int CPsTreeItem::Create(CPsHdr* pPsh, OPTIONSDIALOGPAGE *odp)
// error for no longer supported dialog template type
if (((UINT_PTR)odp->pszTemplate & 0xFFFF0000))
- MsgErr(NULL, LPGENT("The dialog template type is no longer supported"));
+ MsgErr(NULL, LPGENW("The dialog template type is no longer supported"));
else {
// fetch dialog resource id
_idDlg = (INT_PTR)odp->pszTemplate;
diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.cpp b/plugins/UserInfoEx/src/ctrl_annivedit.cpp
index 591df8f8b3..a8fcf14a4d 100644
--- a/plugins/UserInfoEx/src/ctrl_annivedit.cpp
+++ b/plugins/UserInfoEx/src/ctrl_annivedit.cpp
@@ -403,7 +403,7 @@ INT_PTR CAnnivEditCtrl::SetCurSel(WORD wIndex)
DateTime_SetFormat(_hwndDate, NULL);
}
else {
- TCHAR szText[MAX_DESC];
+ wchar_t szText[MAX_DESC];
mir_sntprintf(szText, L"'%s'", TranslateT("Unspecified"));
DateTime_SetSystemtime(_hwndDate, GDT_NONE, NULL);
DateTime_SetFormat(_hwndDate, szText);
@@ -528,7 +528,7 @@ void CAnnivEditCtrl::OnReminderChecked()
MCONTACT hContact;
LPCSTR pszProto;
int state;
- TCHAR buf[6];
+ wchar_t buf[6];
MAnnivDate *pCurrent = Current();
PSGetContact(_hwndDlg, hContact);
@@ -540,7 +540,7 @@ void CAnnivEditCtrl::OnReminderChecked()
{
if (IsDlgButtonChecked(_hwndDlg, RADIO_REMIND1))
{
- _itot(db_get_b(NULL, MODNAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET), buf, 10);
+ _itow(db_get_b(NULL, MODNAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET), buf, 10);
EnableWindow(GetDlgItem(_hwndDlg, EDIT_REMIND), FALSE);
EnableWindow(GetDlgItem(_hwndDlg, SPIN_REMIND), FALSE);
state = BST_INDETERMINATE;
@@ -549,11 +549,11 @@ void CAnnivEditCtrl::OnReminderChecked()
{
if (pCurrent->RemindOffset() == (WORD)-1)
{
- _itot(db_get_b(NULL, MODNAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET), buf, 10);
+ _itow(db_get_b(NULL, MODNAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET), buf, 10);
}
else
{
- _itot(pCurrent->RemindOffset(), buf, 10);
+ _itow(pCurrent->RemindOffset(), buf, 10);
}
EnableWindow(GetDlgItem(_hwndDlg, EDIT_REMIND), _ReminderEnabled);
EnableWindow(GetDlgItem(_hwndDlg, SPIN_REMIND), _ReminderEnabled);
diff --git a/plugins/UserInfoEx/src/ctrl_button.cpp b/plugins/UserInfoEx/src/ctrl_button.cpp
index e2ec2b7292..59ccb0a1ee 100644
--- a/plugins/UserInfoEx/src/ctrl_button.cpp
+++ b/plugins/UserInfoEx/src/ctrl_button.cpp
@@ -41,7 +41,7 @@ typedef struct TMBCtrl{
int stateId; // button state
int defbutton; // default button
int pbState;
- TCHAR cHot;
+ wchar_t cHot;
} BTNCTRL, *LPBTNCTRL;
// External theme methods and properties
@@ -254,7 +254,7 @@ static void __fastcall PaintThemeButton(BTNCTRL *ctl, HDC hdcMem, LPRECT rcClien
static void __fastcall PaintButton(BTNCTRL *ctl, HDC hdcMem, LPRECT rcClient)
{
RECT rcText = { 0, 0, 0, 0 };
- TCHAR szText[MAX_PATH] = { 0 };
+ wchar_t szText[MAX_PATH] = { 0 };
WORD ccText;
// Draw the flat button
@@ -408,7 +408,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L
while (*tmp) {
if (*tmp == '&' && *(tmp + 1)) {
- bct->cHot = _totlower(*(tmp + 1));
+ bct->cHot = towlower(*(tmp + 1));
break;
}
tmp++;
@@ -417,7 +417,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L
}
break;
case WM_SYSKEYUP:
- if (bct->stateId != PBS_DISABLED && bct->cHot && bct->cHot == _totlower((TCHAR)wParam)) {
+ if (bct->stateId != PBS_DISABLED && bct->cHot && bct->cHot == towlower((wchar_t)wParam)) {
if (bct->dwStyle & MBS_PUSHBUTTON) {
if (bct->pbState) bct->pbState = 0;
else bct->pbState = 1;
@@ -542,7 +542,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L
break;
case BUTTONTRANSLATE:
{
- TCHAR szButton[MAX_PATH];
+ wchar_t szButton[MAX_PATH];
GetWindowText(bct->hwnd, szButton, _countof(szButton));
SetWindowText(bct->hwnd, TranslateTS(szButton));
}
diff --git a/plugins/UserInfoEx/src/ctrl_contact.cpp b/plugins/UserInfoEx/src/ctrl_contact.cpp
index b37897793b..ae37e6eaac 100644
--- a/plugins/UserInfoEx/src/ctrl_contact.cpp
+++ b/plugins/UserInfoEx/src/ctrl_contact.cpp
@@ -35,7 +35,7 @@ typedef struct TCbExItem
WORD wMask;
WORD wFlags;
DWORD dwID;
- TCHAR szCat[MAX_CAT];
+ wchar_t szCat[MAX_CAT];
LPTSTR pszVal;
LPCSTR pszIcon;
HICON hIcon;
@@ -158,7 +158,7 @@ static INT_PTR CALLBACK DlgProc_EMail(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
}
if (*cbi->pszVal)
- SetWindowText(hDlg, LPGENT("Edit e-mail"));
+ SetWindowText(hDlg, LPGENW("Edit e-mail"));
TranslateDialogDefault(hDlg);
SendDlgItemMessage(hDlg, EDIT_CATEGORY, EM_LIMITTEXT, cbi->ccCat - 1, 0);
SendDlgItemMessage(hDlg, EDIT_EMAIL, EM_LIMITTEXT, cbi->ccVal - 1, 0);
@@ -169,7 +169,7 @@ static INT_PTR CALLBACK DlgProc_EMail(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
// translate Userinfo buttons
{
- TCHAR szButton[MAX_PATH];
+ wchar_t szButton[MAX_PATH];
HWND hBtn = GetDlgItem(hDlg, IDOK);
GetWindowText(hBtn, szButton, _countof(szButton));
SetWindowText(hBtn, TranslateTS(szButton));
@@ -202,14 +202,14 @@ static INT_PTR CALLBACK DlgProc_EMail(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
}
case EDIT_EMAIL:
if (HIWORD(wParam) == EN_UPDATE) {
- TCHAR szText[MAXDATASIZE];
+ wchar_t szText[MAXDATASIZE];
LPTSTR pszAdd, pszDot;
if (PtrIsValid(cbi)) {
GetWindowText((HWND)lParam, szText, _countof(szText));
EnableWindow(GetDlgItem(hDlg, IDOK),
- ((pszAdd = _tcschr(szText, '@')) &&
+ ((pszAdd = wcschr(szText, '@')) &&
*(pszAdd + 1) != '.' &&
- (pszDot = _tcschr(pszAdd, '.')) &&
+ (pszDot = wcschr(pszAdd, '.')) &&
*(pszDot + 1) &&
mir_tstrcmp(szText, cbi->pszVal)));
}
@@ -251,7 +251,7 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam
// translate Userinfo buttons
{
- TCHAR szButton[MAX_PATH];
+ wchar_t szButton[MAX_PATH];
HWND hBtn;
hBtn = GetDlgItem(hDlg, IDOK);
@@ -261,7 +261,7 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam
GetWindowText(hBtn, szButton, _countof(szButton));
SetWindowText(hBtn, TranslateTS(szButton));
}
- if (*cbi->pszVal) SetWindowText(hDlg, LPGENT("Edit phone number"));
+ if (*cbi->pszVal) SetWindowText(hDlg, LPGENW("Edit phone number"));
if (cbi->wFlags & CBEXIF_SMS) CheckDlgButton(hDlg, CHECK_SMS, BST_CHECKED);
TranslateDialogDefault(hDlg);
@@ -292,7 +292,7 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam
switch (LOWORD(wParam)) {
case IDOK:
if (HIWORD(wParam) == BN_CLICKED) {
- TCHAR szText[MAXDATASIZE];
+ wchar_t szText[MAXDATASIZE];
int errorPos;
if (!GetDlgItemText(hDlg, EDIT_PHONE, szText, _countof(szText)) || !CheckPhoneSyntax(szText, cbi->pszVal, cbi->ccVal, errorPos) || errorPos > -1) {
@@ -322,7 +322,7 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam
if (noRecursion) break;
EnableWindow(GetDlgItem(hDlg, IDOK), TRUE);
{
- TCHAR szPhone[MAXDATASIZE], szArea[32], szData[64];
+ wchar_t szPhone[MAXDATASIZE], szArea[32], szData[64];
int nCurSel = SendDlgItemMessage(hDlg, EDIT_COUNTRY, CB_GETCURSEL, 0, 0);
UINT nCountry = (nCurSel != CB_ERR) ? SendDlgItemMessage(hDlg, EDIT_COUNTRY, CB_GETITEMDATA, nCurSel, 0) : 0;
@@ -340,13 +340,13 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam
if (noRecursion) break;
noRecursion = 1;
{
- TCHAR szText[MAXDATASIZE], *pText = 0, *pArea, *pNumber;
+ wchar_t szText[MAXDATASIZE], *pText = 0, *pArea, *pNumber;
bool isValid = true;
GetDlgItemText(hDlg, EDIT_PHONE, szText, _countof(szText));
if (szText[0] != '+')
isValid = false;
if (isValid) {
- int country = _tcstol(szText + 1, &pText, 10);
+ int country = wcstol(szText + 1, &pText, 10);
if (pText - szText > 4)
isValid = false;
else {
@@ -362,11 +362,11 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam
}
}
if (isValid) {
- pArea = pText + _tcscspn(pText, L"0123456789");
+ pArea = pText + wcscspn(pText, L"0123456789");
pText = pArea + _tcsspn(pArea, L"0123456789");
if (*pText) {
*pText = '\0';
- pNumber = pText + 1 + _tcscspn(pText + 1, L"0123456789");
+ pNumber = pText + 1 + wcscspn(pText + 1, L"0123456789");
SetDlgItemText(hDlg, EDIT_NUMBER, pNumber);
}
SetDlgItemText(hDlg, EDIT_AREA, pArea);
@@ -659,8 +659,8 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
if (HIWORD(wParam) == BN_CLICKED) {
DLGPROC dlgProc;
WORD dlgID;
- TCHAR szCat[MAX_CAT] = { 0 };
- TCHAR szVal[MAXDATASIZE] = { 0 };
+ wchar_t szCat[MAX_CAT] = { 0 };
+ wchar_t szVal[MAXDATASIZE] = { 0 };
CBEXITEM cbi;
HWND hDlgDetails;
@@ -716,8 +716,8 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
if (HIWORD(wParam) == BN_CLICKED) {
DLGPROC dlgProc;
WORD dlgID;
- TCHAR szCat[MAX_CAT] = { 0 };
- TCHAR szVal[MAXDATASIZE] = { 0 };
+ wchar_t szCat[MAX_CAT] = { 0 };
+ wchar_t szVal[MAXDATASIZE] = { 0 };
CBEXITEM cbi;
HWND hDlgDetails;
@@ -746,7 +746,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
cbi.ccCat = MAX_CAT;
cbi.ccVal = MAXDATASIZE;
if (!CtrlContactWndProc(hwnd, CBEXM_GETITEM, NULL, (LPARAM)&cbi)) {
- MsgErr(hwnd, LPGENT("CRITICAL: Unable to edit current entry!\nThis should not happen!"));
+ MsgErr(hwnd, LPGENW("CRITICAL: Unable to edit current entry!\nThis should not happen!"));
return 1;
}
@@ -772,7 +772,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
if (HIWORD(wParam) == BN_CLICKED) {
HWND hDlgDetails;
MSGBOX mBox;
- TCHAR szMsg[MAXDATASIZE];
+ wchar_t szMsg[MAXDATASIZE];
SetFocus((HWND)lParam);
if (!(hDlgDetails = GetParent(GetParent(hwnd))) ||
@@ -827,7 +827,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
switch (HIWORD(wParam)) {
case EN_UPDATE:
{
- TCHAR szVal[MAXDATASIZE] = { 0 };
+ wchar_t szVal[MAXDATASIZE] = { 0 };
int ccVal;
MCONTACT hContact;
HWND hDlgDetails = GetParent(GetParent(hwnd));
@@ -845,7 +845,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
case EDIT_PHONE:
{
int errorPos;
- TCHAR szEdit[MAXDATASIZE];
+ wchar_t szEdit[MAXDATASIZE];
if (ccVal = GetWindowText(cbex->hEdit, szEdit, _countof(szEdit))) {
if (!(ccVal = CheckPhoneSyntax(szEdit, szVal, MAXDATASIZE, errorPos)) || errorPos > -1) {
@@ -894,7 +894,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
cbex->bIsChanged = TRUE;
}
else
- if (cbex->pItems[cbex->iSelectedItem].pszVal = (LPTSTR)mir_realloc(cbex->pItems[cbex->iSelectedItem].pszVal, (ccText + 2) * sizeof(TCHAR))) {
+ if (cbex->pItems[cbex->iSelectedItem].pszVal = (LPTSTR)mir_realloc(cbex->pItems[cbex->iSelectedItem].pszVal, (ccText + 2) * sizeof(wchar_t))) {
cbex->pItems[cbex->iSelectedItem].pszVal[ccText + 1] = 0;
GetWindowText(cbex->hEdit, cbex->pItems[cbex->iSelectedItem].pszVal, ccText + 1);
}
@@ -1297,7 +1297,7 @@ int CtrlContactAddItemFromDB(
cbi.pszVal = NULL;
else { // check the database value
cbi.pszVal = dbv.ptszVal;
- if (LPTSTR sms = _tcsstr(cbi.pszVal, L" SMS")) {
+ if (LPTSTR sms = wcsstr(cbi.pszVal, L" SMS")) {
cbi.wFlags |= CBEXIF_SMS;
*sms = 0;
}
@@ -1377,7 +1377,7 @@ int CtrlContactAddMyItemsFromDB(
dbv.ptszVal = NULL;
}
}
- if (sms = _tcsstr(cbi.pszVal, L" SMS")) {
+ if (sms = wcsstr(cbi.pszVal, L" SMS")) {
cbi.wFlags |= CBEXIF_SMS;
*sms = 0;
}
@@ -1411,7 +1411,7 @@ int CtrlContactWriteItemToDB(
LPCSTR pszProto,
LPCSTR pszSetting)
{
- TCHAR szVal[MAXDATASIZE];
+ wchar_t szVal[MAXDATASIZE];
CBEXITEM cbi;
if (!CtrlContactWndProc(hCtrl, CBEXM_ISCHANGED, NULL, NULL)) return 1;
@@ -1455,8 +1455,8 @@ int CtrlContactWriteMyItemsToDB(
LPCSTR szFormatVal)
{
CHAR pszSetting[MAXSETTING];
- TCHAR szCat[MAX_CAT];
- TCHAR szVal[MAXDATASIZE];
+ wchar_t szCat[MAX_CAT];
+ wchar_t szVal[MAXDATASIZE];
LPTSTR pszOther;
CBEXITEM cbi;
INT_PTR ccOther;
@@ -1481,7 +1481,7 @@ int CtrlContactWriteMyItemsToDB(
mir_tstrncat(szVal, L" SMS", _countof(szVal) - mir_tstrlen(szVal));
}
mir_snprintf(pszSetting, szFormatCat, i);
- if (*szCat && _tcsncmp(szCat, pszOther, ccOther)) {
+ if (*szCat && wcsncmp(szCat, pszOther, ccOther)) {
if (db_set_ts(hContact, pszModule, pszSetting, szCat)) return 1;
}
else
diff --git a/plugins/UserInfoEx/src/ctrl_edit.cpp b/plugins/UserInfoEx/src/ctrl_edit.cpp
index 77a3904eb6..04bfdbe2b8 100644
--- a/plugins/UserInfoEx/src/ctrl_edit.cpp
+++ b/plugins/UserInfoEx/src/ctrl_edit.cpp
@@ -108,7 +108,7 @@ BOOL CEditCtrl::OnInfoChanged(MCONTACT hContact, LPCSTR pszProto)
{
if (!_Flags.B.hasChanged) {
DBVARIANT dbv;
- TCHAR szText[64];
+ wchar_t szText[64];
_Flags.B.hasCustom = _Flags.B.hasProto = _Flags.B.hasMeta = false;
_Flags.W |= DB::Setting::GetTStringCtrl(hContact, _pszModule, _pszModule, pszProto, _pszSetting, &dbv);
@@ -171,7 +171,7 @@ void CEditCtrl::OnApply(MCONTACT hContact, LPCSTR pszProto)
DWORD cch = GetWindowTextLength(_hwnd);
if (cch > 0) {
- LPTSTR val = (LPTSTR)mir_alloc((cch + 1) * sizeof(TCHAR));
+ LPTSTR val = (LPTSTR)mir_alloc((cch + 1) * sizeof(wchar_t));
if (GetWindowText(_hwnd, val, cch + 1) > 0) {
DBVARIANT dbv;
@@ -179,15 +179,15 @@ void CEditCtrl::OnApply(MCONTACT hContact, LPCSTR pszProto)
dbv.type = _dbType;
switch (_dbType) {
case DBVT_BYTE:
- dbv.bVal = (BYTE)_tcstol(val, NULL, 10);
+ dbv.bVal = (BYTE)wcstol(val, NULL, 10);
break;
case DBVT_WORD:
- dbv.wVal = (WORD)_tcstol(val, NULL, 10);
+ dbv.wVal = (WORD)wcstol(val, NULL, 10);
break;
case DBVT_DWORD:
- dbv.dVal = (DWORD)_tcstol(val, NULL, 10);
+ dbv.dVal = (DWORD)wcstol(val, NULL, 10);
break;
case DBVT_TCHAR:
@@ -245,11 +245,11 @@ void CEditCtrl::OnChangedByUser(WORD wChangedMsg)
LPTSTR szText;
__try {
- szText = (LPTSTR)alloca((cch + 1) * sizeof(TCHAR));
+ szText = (LPTSTR)alloca((cch + 1) * sizeof(wchar_t));
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
- szText = (LPTSTR)mir_alloc((cch + 1) * sizeof(TCHAR));
+ szText = (LPTSTR)mir_alloc((cch + 1) * sizeof(wchar_t));
need_free = 1;
}
@@ -278,11 +278,11 @@ void CEditCtrl::OpenUrl()
BYTE need_free = 0;
__try {
- szUrl = (LPTSTR)alloca((8 + lenUrl) * sizeof(TCHAR));
+ szUrl = (LPTSTR)alloca((8 + lenUrl) * sizeof(wchar_t));
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
- szUrl = (LPTSTR)mir_alloc((8 + lenUrl) * sizeof(TCHAR));
+ szUrl = (LPTSTR)mir_alloc((8 + lenUrl) * sizeof(wchar_t));
need_free = 1;
}
@@ -315,17 +315,17 @@ LRESULT CEditCtrl::LinkNotificationHandler(ENLINK* lnk)
tr.chrg = lnk->chrg;
__try {
- tr.lpstrText = (LPTSTR)alloca((tr.chrg.cpMax - tr.chrg.cpMin + 8) * sizeof(TCHAR));
+ tr.lpstrText = (LPTSTR)alloca((tr.chrg.cpMax - tr.chrg.cpMin + 8) * sizeof(wchar_t));
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
- tr.lpstrText = (LPTSTR)mir_alloc((tr.chrg.cpMax - tr.chrg.cpMin + 8) * sizeof(TCHAR));
+ tr.lpstrText = (LPTSTR)mir_alloc((tr.chrg.cpMax - tr.chrg.cpMin + 8) * sizeof(wchar_t));
need_free = 1;
}
if (tr.lpstrText && (SendMessage(_hwnd, EM_GETTEXTRANGE, NULL, (LPARAM)&tr) > 0)) {
- if (_tcschr(tr.lpstrText, '@') != NULL && _tcschr(tr.lpstrText, ':') == NULL && _tcschr(tr.lpstrText, '/') == NULL) {
- memmove(tr.lpstrText + 7, tr.lpstrText, (tr.chrg.cpMax - tr.chrg.cpMin + 1)*sizeof(TCHAR));
- memcpy(tr.lpstrText, L"mailto:", (7 * sizeof(TCHAR)));
+ if (wcschr(tr.lpstrText, '@') != NULL && wcschr(tr.lpstrText, ':') == NULL && wcschr(tr.lpstrText, '/') == NULL) {
+ memmove(tr.lpstrText + 7, tr.lpstrText, (tr.chrg.cpMax - tr.chrg.cpMin + 1)*sizeof(wchar_t));
+ memcpy(tr.lpstrText, L"mailto:", (7 * sizeof(wchar_t)));
}
Utils_OpenUrlT(tr.lpstrText);
diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp
index a1c3fb3be8..ede54b4d37 100644
--- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp
+++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp
@@ -234,8 +234,8 @@ class CAnnivList
int result;
if (pDlg) {
- TCHAR szText1[MAX_PATH];
- TCHAR szText2[MAX_PATH];
+ wchar_t szText1[MAX_PATH];
+ wchar_t szText2[MAX_PATH];
szText1[0] = szText2[0] = 0;
switch (pDlg->_sortHeader) {
@@ -251,7 +251,7 @@ class CAnnivList
case COLUMN_ETA:
ListView_GetItemText(pDlg->_hList, iItem1, pDlg->_sortHeader, szText1, _countof(szText1));
ListView_GetItemText(pDlg->_hList, iItem2, pDlg->_sortHeader, szText2, _countof(szText2));
- result = pDlg->_sortOrder * (_ttoi(szText1) - _ttoi(szText2));
+ result = pDlg->_sortOrder * (_wtoi(szText1) - _wtoi(szText2));
break;
case COLUMN_DATE:
@@ -314,12 +314,12 @@ class CAnnivList
ListView_SetExtendedListViewStyle(pDlg->_hList, LVS_EX_FULLROWSELECT);
// add columns
- if (pDlg->AddColumn(CAnnivList::COLUMN_ETA, LPGENT("ETA"), 40)
- || pDlg->AddColumn(CAnnivList::COLUMN_CONTACT, LPGENT("Contact"), 160)
- || pDlg->AddColumn(CAnnivList::COLUMN_PROTO, LPGENT("Proto"), 50)
- || pDlg->AddColumn(CAnnivList::COLUMN_AGE, LPGENT("Age/Nr."), 40)
- || pDlg->AddColumn(CAnnivList::COLUMN_DESC, LPGENT("Anniversary"), 100)
- || pDlg->AddColumn(CAnnivList::COLUMN_DATE, LPGENT("Date"), 80))
+ if (pDlg->AddColumn(CAnnivList::COLUMN_ETA, LPGENW("ETA"), 40)
+ || pDlg->AddColumn(CAnnivList::COLUMN_CONTACT, LPGENW("Contact"), 160)
+ || pDlg->AddColumn(CAnnivList::COLUMN_PROTO, LPGENW("Proto"), 50)
+ || pDlg->AddColumn(CAnnivList::COLUMN_AGE, LPGENW("Age/Nr."), 40)
+ || pDlg->AddColumn(CAnnivList::COLUMN_DESC, LPGENW("Anniversary"), 100)
+ || pDlg->AddColumn(CAnnivList::COLUMN_DATE, LPGENW("Date"), 80))
break;
TranslateDialogDefault(hDlg);
@@ -666,7 +666,7 @@ class CAnnivList
**/
BYTE AddRow(MCONTACT hContact, LPCSTR pszProto, MAnnivDate &ad, MTime &mtNow, WORD wDaysBefore)
{
- TCHAR szText[MAX_PATH];
+ wchar_t szText[MAX_PATH];
int diff, iItem = -1;
CItemData *pdata;
@@ -688,7 +688,7 @@ class CAnnivList
if (!pdata)
return FALSE;
// add item
- iItem = AddItem(_itot(diff, szText, 10), (LPARAM)pdata);
+ iItem = AddItem(_itow(diff, szText, 10), (LPARAM)pdata);
if (iItem == -1) {
delete pdata;
return FALSE;
@@ -698,13 +698,13 @@ class CAnnivList
AddSubItem(iItem, COLUMN_CONTACT, DB::Contact::DisplayName(hContact));
// third column: protocol
- TCHAR *ptszProto = mir_a2t(pszProto);
+ wchar_t *ptszProto = mir_a2t(pszProto);
AddSubItem(iItem, COLUMN_PROTO, ptszProto);
mir_free(ptszProto);
// forth line: age
if (ad.Age(&mtNow))
- AddSubItem(iItem, COLUMN_AGE, _itot(ad.Age(&mtNow), szText, 10));
+ AddSubItem(iItem, COLUMN_AGE, _itow(ad.Age(&mtNow), szText, 10));
else
AddSubItem(iItem, COLUMN_AGE, L"???");
diff --git a/plugins/UserInfoEx/src/dlg_msgbox.cpp b/plugins/UserInfoEx/src/dlg_msgbox.cpp
index 8cb11462e3..a3b3444e43 100644
--- a/plugins/UserInfoEx/src/dlg_msgbox.cpp
+++ b/plugins/UserInfoEx/src/dlg_msgbox.cpp
@@ -322,9 +322,9 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l
case MB_OKCANCEL:
retOk = IDRETRY;
- SetDlgItemText(hDlg, IDOK, LPGENT("OK"));
+ SetDlgItemText(hDlg, IDOK, LPGENW("OK"));
retCancel = IDCANCEL;
- SetDlgItemText(hDlg, IDCANCEL, LPGENT("Cancel"));
+ SetDlgItemText(hDlg, IDCANCEL, LPGENW("Cancel"));
rcOk.left = dlgMid - okWidth - 10;
rcOk.right = rcOk.left + okWidth;
rcCancel.left = dlgMid + 10;
@@ -335,9 +335,9 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l
case MB_RETRYCANCEL:
retOk = IDRETRY;
- SetDlgItemText(hDlg, IDOK, LPGENT("Retry"));
+ SetDlgItemText(hDlg, IDOK, LPGENW("Retry"));
retCancel = IDCANCEL;
- SetDlgItemText(hDlg, IDCANCEL, LPGENT("Cancel"));
+ SetDlgItemText(hDlg, IDCANCEL, LPGENW("Cancel"));
rcOk.left = dlgMid - okWidth - 10;
rcOk.right = rcOk.left + okWidth;
rcCancel.left = dlgMid + 10;
@@ -348,9 +348,9 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l
case MB_YESNO:
retOk = IDYES;
- SetDlgItemText(hDlg, IDOK, LPGENT("Yes"));
+ SetDlgItemText(hDlg, IDOK, LPGENW("Yes"));
retCancel = IDNO;
- SetDlgItemText(hDlg, IDCANCEL, LPGENT("No"));
+ SetDlgItemText(hDlg, IDCANCEL, LPGENW("No"));
rcOk.left = dlgMid - okWidth - 10;
rcOk.right = rcOk.left + okWidth;
rcCancel.left = dlgMid + 10;
@@ -361,11 +361,11 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l
case MB_ABORTRETRYIGNORE:
retOk = IDABORT;
- SetDlgItemText(hDlg, IDOK, LPGENT("Abort"));
+ SetDlgItemText(hDlg, IDOK, LPGENW("Abort"));
retAll = IDABORT;
- SetDlgItemText(hDlg, IDALL, LPGENT("Retry"));
+ SetDlgItemText(hDlg, IDALL, LPGENW("Retry"));
retCancel = IDCANCEL;
- SetDlgItemText(hDlg, IDCANCEL, LPGENT("Ignore"));
+ SetDlgItemText(hDlg, IDCANCEL, LPGENW("Ignore"));
rcAll.left = dlgMid - (allWidth / 2);
rcAll.right = rcAll.left + allWidth;
rcOk.left = rcAll.left - okWidth - 5;
@@ -379,11 +379,11 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l
case MB_YESNOCANCEL:
retOk = IDYES;
- SetDlgItemText(hDlg, IDOK, LPGENT("Yes"));
+ SetDlgItemText(hDlg, IDOK, LPGENW("Yes"));
retAll = IDNO;
- SetDlgItemText(hDlg, IDALL, LPGENT("No"));
+ SetDlgItemText(hDlg, IDALL, LPGENW("No"));
retCancel = IDCANCEL;
- SetDlgItemText(hDlg, IDCANCEL, LPGENT("Cancel"));
+ SetDlgItemText(hDlg, IDCANCEL, LPGENW("Cancel"));
rcAll.left = dlgMid - (allWidth / 2);
rcAll.right = rcAll.left + allWidth;
rcOk.left = rcAll.left - okWidth - 5;
@@ -397,13 +397,13 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l
case MB_YESALLNO:
retOk = IDYES;
- SetDlgItemText(hDlg, IDOK, LPGENT("Yes"));
+ SetDlgItemText(hDlg, IDOK, LPGENW("Yes"));
retAll = IDALL;
- SetDlgItemText(hDlg, IDALL, LPGENT("All"));
+ SetDlgItemText(hDlg, IDALL, LPGENW("All"));
//retNon = IDNONE;
- SetDlgItemText(hDlg, IDNONE, LPGENT("None"));
+ SetDlgItemText(hDlg, IDNONE, LPGENW("None"));
retCancel = IDNO;
- SetDlgItemText(hDlg, IDCANCEL, LPGENT("No"));
+ SetDlgItemText(hDlg, IDCANCEL, LPGENW("No"));
rcCancel.right = rcDlg.right - rcDlg.left - 10;
rcCancel.left = rcCancel.right - caWidth;
rcNone.right = rcCancel.left - 5;
@@ -660,7 +660,7 @@ INT_PTR MsgBoxService(WPARAM, LPARAM lParam)
**/
INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszInfo, LPCTSTR pszFormat, ...)
{
- TCHAR tszMsg[MAX_SECONDLINE];
+ wchar_t tszMsg[MAX_SECONDLINE];
va_list vl;
va_start(vl, pszFormat);
@@ -686,7 +686,7 @@ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszI
**/
INT_PTR CALLBACK MsgErr(HWND hParent, LPCTSTR pszFormat, ...)
{
- TCHAR tszTitle[MAX_SECONDLINE], tszMsg[MAX_SECONDLINE];
+ wchar_t tszTitle[MAX_SECONDLINE], tszMsg[MAX_SECONDLINE];
mir_sntprintf(tszTitle, L"%s - %s", _T(MODNAME), TranslateT("Error"));
va_list vl;
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp
index c03a5a75db..b70724c993 100644
--- a/plugins/UserInfoEx/src/dlg_propsheet.cpp
+++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp
@@ -268,7 +268,7 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM)
metrics.x = GetSystemMetrics(SM_CXSMICON);
metrics.y = GetSystemMetrics(SM_CYSMICON);
if ((psh._hImages = ImageList_Create(metrics.x, metrics.y, ILC_COLOR32 | ILC_MASK, 0, 1)) == NULL) {
- MsgErr(NULL, LPGENT("Creating the image list failed!"));
+ MsgErr(NULL, LPGENW("Creating the image list failed!"));
return 1;
}
@@ -291,7 +291,7 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM)
// get contact's protocol
psh._pszPrefix = psh._pszProto = Proto_GetBaseAccountName(wParam);
if (psh._pszProto == NULL) {
- MsgErr(NULL, LPGENT("Could not find contact's protocol. Maybe it is not active!"));
+ MsgErr(NULL, LPGENW("Could not find contact's protocol. Maybe it is not active!"));
return 1;
}
// prepare scanning for metacontact's subcontact's pages
@@ -302,7 +302,7 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM)
// add the pages
NotifyEventHooks(g_hDetailsInitEvent, (WPARAM)&psh, wParam);
if (!psh._pPages || !psh._numPages) {
- MsgErr(NULL, LPGENT("No pages have been added. Canceling dialog creation!"));
+ MsgErr(NULL, LPGENW("No pages have been added. Canceling dialog creation!"));
return 1;
}
@@ -330,7 +330,7 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM)
// create the dialog itself
if (!CreateDialogParam(ghInst, MAKEINTRESOURCE(IDD_DETAILS), NULL, DlgProc, (LPARAM)&psh))
- MsgErr(NULL, LPGENT("Details dialog failed to be created. Returning error is %d."), GetLastError());
+ MsgErr(NULL, LPGENW("Details dialog failed to be created. Returning error is %d."), GetLastError());
return 0;
}
@@ -356,7 +356,7 @@ static INT_PTR AddPage(WPARAM wParam, LPARAM lParam)
if (pPsh->_dwFlags & (PSF_PROTOPAGESONLY | PSF_PROTOPAGESONLY_INIT)) {
BYTE bIsUnicode = (odp->flags & ODPF_UNICODE) == ODPF_UNICODE;
- TCHAR *ptszTitle = bIsUnicode ? mir_tstrdup(odp->ptszTitle) : mir_a2t(odp->pszTitle);
+ wchar_t *ptszTitle = bIsUnicode ? mir_tstrdup(odp->pwszTitle) : mir_a2t(odp->pszTitle);
// avoid adding pages for a meta subcontact, which have been added for a metacontact.
if (pPsh->_dwFlags & PSF_PROTOPAGESONLY) {
@@ -428,65 +428,65 @@ static int OnShutdown(WPARAM, LPARAM)
**/
static int AddProtocolPages(OPTIONSDIALOGPAGE& odp, WPARAM wParam, LPSTR pszProto = NULL)
{
- TCHAR szTitle[MAX_PATH];
+ wchar_t szTitle[MAX_PATH];
const BYTE ofs = (pszProto) ? mir_sntprintf(szTitle, L"%S\\", pszProto) : 0;
- odp.ptszTitle = szTitle;
+ odp.pwszTitle = szTitle;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_GENERAL);
odp.position = 0x8000000;
odp.pfnDlgProc = PSPProcGeneral;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_GENERAL);
- mir_tstrncpy(szTitle + ofs, LPGENT("General"), _countof(szTitle) - ofs);
+ mir_tstrncpy(szTitle + ofs, LPGENW("General"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_ADDRESS);
odp.position = 0x8000001;
odp.pfnDlgProc = PSPProcContactHome;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_ADDRESS);
- mir_tstrncpy(szTitle + ofs, LPGENT("General") L"\\" LPGENT("Contact (private)"), _countof(szTitle) - ofs);
+ mir_tstrncpy(szTitle + ofs, LPGENW("General") L"\\" LPGENW("Contact (private)"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_ORIGIN);
odp.position = 0x8000002;
odp.pfnDlgProc = PSPProcOrigin;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_ADVANCED);
- mir_tstrncpy(szTitle + ofs, LPGENT("General") L"\\" LPGENT("Origin"), _countof(szTitle) - ofs);
+ mir_tstrncpy(szTitle + ofs, LPGENW("General") L"\\" LPGENW("Origin"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_ANNIVERSARY);
odp.position = 0x8000003;
odp.pfnDlgProc = PSPProcAnniversary;
odp.hIcon = (HICON)ICONINDEX(IDI_BIRTHDAY);
- mir_tstrncpy(szTitle + ofs, LPGENT("General") L"\\" LPGENT("Anniversaries"), _countof(szTitle) - ofs);
+ mir_tstrncpy(szTitle + ofs, LPGENW("General") L"\\" LPGENW("Anniversaries"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_COMPANY);
odp.position = 0x8000004;
odp.pfnDlgProc = PSPProcCompany;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_COMPANY);
- mir_tstrncpy(szTitle + ofs, LPGENT("Work"), _countof(szTitle) - ofs);
+ mir_tstrncpy(szTitle + ofs, LPGENW("Work"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_ADDRESS);
odp.position = 0x8000005;
odp.pfnDlgProc = PSPProcContactWork;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_ADDRESS);
- mir_tstrncpy(szTitle + ofs, LPGENT("Work") L"\\" LPGENT("Contact (work)"), _countof(szTitle) - ofs);
+ mir_tstrncpy(szTitle + ofs, LPGENW("Work") L"\\" LPGENW("Contact (work)"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_ABOUT);
odp.position = 0x8000006;
odp.pfnDlgProc = PSPProcAbout;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_ABOUT);
- mir_tstrncpy(szTitle + ofs, LPGENT("About"), _countof(szTitle) - ofs);
+ mir_tstrncpy(szTitle + ofs, LPGENW("About"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_PROFILE);
odp.position = 0x8000007;
odp.pfnDlgProc = PSPProcContactProfile;
odp.hIcon = (HICON)ICONINDEX(IDI_TREE_PROFILE);
- mir_tstrncpy(szTitle + ofs, LPGENT("About") L"\\" LPGENT("Profile"), _countof(szTitle) - ofs);
+ mir_tstrncpy(szTitle + ofs, LPGENW("About") L"\\" LPGENW("Profile"), _countof(szTitle) - ofs);
AddPage(wParam, (LPARAM)&odp);
return 0;
}
@@ -508,16 +508,16 @@ static int InitDetails(WPARAM wParam, LPARAM lParam)
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = ghInst;
odp.flags = ODPF_ICON | ODPF_TCHAR;
- odp.ptszGroup = IcoLib_GetDefaultIconFileName();
+ odp.pwszGroup = IcoLib_GetDefaultIconFileName();
if (lParam) {
// ignore common pages for weather contacts
if (!pPsh->_pszProto || _stricmp(pPsh->_pszProto, "weather")) {
AddProtocolPages(odp, wParam);
- odp.ptszTitle = LPGENT("About") L"\\" LPGENT("Notes");
+ odp.pwszTitle = LPGENW("About") L"\\" LPGENW("Notes");
}
else
- odp.ptszTitle = LPGENT("Notes");
+ odp.pwszTitle = LPGENW("Notes");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONTACT_ABOUT);
odp.position = 0x8000008;
@@ -1218,9 +1218,9 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
}
else if (ack->result == ACKRESULT_FAILED) {
MsgBox(hDlg, MB_ICON_WARNING,
- LPGENT("Upload ICQ details"),
- LPGENT("Upload failed"),
- LPGENT("Your details were not uploaded successfully.\nThey were written to database only."));
+ LPGENW("Upload ICQ details"),
+ LPGENW("Upload failed"),
+ LPGENW("Your details were not uploaded successfully.\nThey were written to database only."));
KillTimer(hDlg, TIMERID_UPDATING);
ShowWindow(GetDlgItem(hDlg, TXT_UPDATING), SW_HIDE);
DlgProc(hDlg, M_CHECKONLINE, NULL, NULL);
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.h b/plugins/UserInfoEx/src/dlg_propsheet.h
index 8e28a102cc..f2e1d88871 100644
--- a/plugins/UserInfoEx/src/dlg_propsheet.h
+++ b/plugins/UserInfoEx/src/dlg_propsheet.h
@@ -226,7 +226,7 @@ public:
WORD _numPages; // number of pages
DWORD _dwFlags; // some option flags
HIMAGELIST _hImages; // the imagelist with all tree item icons
- LIST<TCHAR> _ignore; // list of to skipp items when adding metasubcontacts pages
+ LIST<wchar_t> _ignore; // list of to skipp items when adding metasubcontacts pages
int _nSubContact; // index of a current subcontact
CPsHdr();
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
index 27c15f4d03..96cd972f8c 100644
--- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
+++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
@@ -477,8 +477,8 @@ BYTE CExImContactBase::isHandle(MCONTACT hContact)
if (dbv.type == DBVT_UTF8 && dbv.pszVal && !mir_strcmpi(dbv.pszVal,_pszNick)) {
LPTSTR ptszNick = mir_utf8decodeT(_pszNick);
LPTSTR ptszProto = mir_a2t(_pszProto);
- int ans = MsgBox(NULL, MB_ICONQUESTION|MB_YESNO, LPGENT("Question"), LPGENT("contact identification"),
- LPGENT("The contact %s(%s) has no unique ID in the vCard,\nbut there is a contact in your contact list with the same nick and protocol.\nDo you wish to use this contact?"),
+ int ans = MsgBox(NULL, MB_ICONQUESTION|MB_YESNO, LPGENW("Question"), LPGENW("contact identification"),
+ LPGENW("The contact %s(%s) has no unique ID in the vCard,\nbut there is a contact in your contact list with the same nick and protocol.\nDo you wish to use this contact?"),
ptszNick, ptszProto);
MIR_FREE(ptszNick);
MIR_FREE(ptszProto);
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp
index 39e31af3ab..e75750654f 100644
--- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp
+++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp
@@ -603,9 +603,9 @@ int CExImContactXML::ImportContact()
// ask to delete new incomplete contact
if (_isNewContact && _hContact != NULL) {
int result = MsgBox(NULL, MB_YESNO|MB_ICONWARNING,
- LPGENT("Question"),
- LPGENT("Importing a new contact was aborted!"),
- LPGENT("You aborted import of a new contact.\nSome information may be missing for this contact.\n\nDo you want to delete the incomplete contact?"));
+ LPGENW("Question"),
+ LPGENW("Importing a new contact was aborted!"),
+ LPGENW("You aborted import of a new contact.\nSome information may be missing for this contact.\n\nDo you want to delete the incomplete contact?"));
if (result == IDYES) {
DB::Contact::Delete(_hContact);
_hContact = INVALID_CONTACT_ID;
@@ -742,9 +742,9 @@ int CExImContactXML::ImportMetaSubContact(CExImContactXML * pMetaContact)
LPTSTR ptszNick = mir_utf8decodeT(_pszNick);
LPTSTR ptszMetaNick = mir_utf8decodeT(pMetaContact->_pszNick);
int result = MsgBox(NULL, MB_YESNO|MB_ICONWARNING,
- LPGENT("Question"),
- LPGENT("Importing a new meta subcontact failed!"),
- LPGENT("The newly created meta subcontact '%s'\ncould not be added to metacontact '%s'!\n\nDo you want to delete this contact?"),
+ LPGENW("Question"),
+ LPGENW("Importing a new meta subcontact failed!"),
+ LPGENW("The newly created meta subcontact '%s'\ncould not be added to metacontact '%s'!\n\nDo you want to delete this contact?"),
ptszNick, ptszMetaNick);
MIR_FREE(ptszNick);
MIR_FREE(ptszMetaNick);
@@ -821,7 +821,7 @@ int CExImContactXML::ImportModule(TiXmlNode* xmlModule)
else if (ImportSetting(pszModule, xKey->ToElement()) == ERROR_OK) {
_pXmlFile->_numSettingsDone++;
}
- if (!_pXmlFile->_progress.UpdateSetting(LPGENT("Settings: %S"), pszModule))
+ if (!_pXmlFile->_progress.UpdateSetting(LPGENW("Settings: %S"), pszModule))
return ERROR_ABORTED;
}
// import event
@@ -835,7 +835,7 @@ int CExImContactXML::ImportModule(TiXmlNode* xmlModule)
_pXmlFile->_numEventsDuplicated++;
break;
}
- if (!_pXmlFile->_progress.UpdateSetting(LPGENT("Events: %S"), pszModule))
+ if (!_pXmlFile->_progress.UpdateSetting(LPGENW("Events: %S"), pszModule))
return ERROR_ABORTED;
}
} //*end for
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp
index 5c43c0a7f1..10c51971b4 100644
--- a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp
+++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp
@@ -196,7 +196,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar
// Set the Window Title and description
{
LPCTSTR name = NULL;
- TCHAR oldTitle[MAXDATASIZE],
+ wchar_t oldTitle[MAXDATASIZE],
newTitle[MAXDATASIZE];
switch (pDat->ExImContact->Typ) {
case EXIM_ALL:
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp
index e54f06003b..380e238788 100644
--- a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp
+++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp
@@ -106,7 +106,7 @@ static LRESULT CALLBACK PlacesBarSubclassProc(HWND hWnd, UINT uMsg, WPARAM wPara
{
if (uMsg == TB_ADDBUTTONS) {
TBBUTTON *tbb = (TBBUTTON *)lParam;
- TCHAR szBtnText[MAX_PATH];
+ wchar_t szBtnText[MAX_PATH];
int iString;
HWND hWndToolTip;
@@ -280,7 +280,7 @@ int DlgExIm_OpenFileName(HWND hWndParent, LPCSTR pszTitle, LPCSTR pszFilter, LPS
ofn.Flags |= OFN_PATHMUSTEXIST;
if (!GetOpenFileNameA(&ofn)) {
DWORD dwError = CommDlgExtendedError();
- if (dwError) MsgErr(ofn.hwndOwner, LPGENT("The OpenFileDialog returned an error: %d!"), dwError);
+ if (dwError) MsgErr(ofn.hwndOwner, LPGENW("The OpenFileDialog returned an error: %d!"), dwError);
return -1;
}
SaveInitialDir(pszFile);
@@ -307,7 +307,7 @@ int DlgExIm_SaveFileName(HWND hWndParent, LPCSTR pszTitle, LPCSTR pszFilter, LPS
if (!GetSaveFileNameA(&ofn)) {
DWORD dwError = CommDlgExtendedError();
- if (dwError) MsgErr(ofn.hwndOwner, LPGENT("The SaveFileDialog returned an error: %d!"), dwError);
+ if (dwError) MsgErr(ofn.hwndOwner, LPGENW("The SaveFileDialog returned an error: %d!"), dwError);
return -1;
}
SaveInitialDir(pszFile);
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp
index 524b3d2169..92981e12d7 100644
--- a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp
+++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp
@@ -187,7 +187,7 @@ BYTE CProgress::UpdateContact(LPCTSTR pszFormat, ...)
if (_hDlg != NULL) {
HWND hProg = GetDlgItem(_hDlg, IDC_PROGRESS2);
if (pszFormat) {
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
va_list vl;
va_start(vl, pszFormat);
@@ -213,8 +213,8 @@ BYTE CProgress::UpdateSetting(LPCTSTR pszFormat, ...)
if (_hDlg != NULL) {
HWND hProg = GetDlgItem(_hDlg, IDC_PROGRESS);
if (pszFormat) {
- TCHAR buf[MAX_PATH];
- TCHAR tmp[MAX_PATH];
+ wchar_t buf[MAX_PATH];
+ wchar_t tmp[MAX_PATH];
va_list vl;
va_start(vl, pszFormat);
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp
index a45dc00c67..dfc1499a08 100644
--- a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp
+++ b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp
@@ -172,7 +172,7 @@ int SvcExImINI_Export(lpExImParam ExImContact, LPCSTR pszFileName)
if (err != NULL)
{
MsgErr(NULL,
- LPGENT("The ini-file \"%s\"\nfor saving contact information could not be opened."),
+ LPGENW("The ini-file \"%s\"\nfor saving contact information could not be opened."),
pszFileName);
return 1;
}
@@ -500,19 +500,19 @@ int SvcExImINI_Import(MCONTACT hContact, LPCSTR pszFileName)
// the contact was not found in the file
if (numContactsInFile > 0 && !numContactsAdded) {
MsgErr(NULL,
- LPGENT("None of the %d contacts, stored in the ini-file, match the selected contact!\nNothing will be imported"),
+ LPGENW("None of the %d contacts, stored in the ini-file, match the selected contact!\nNothing will be imported"),
numContactsInFile);
}
// Import complete
else{
- MsgBox(NULL, MB_ICON_INFO, LPGENT("Import complete"), LPGENT("Some basic statistics"),
- LPGENT("Added %d of %d contacts stored in the ini-file."),
+ MsgBox(NULL, MB_ICON_INFO, LPGENW("Import complete"), LPGENW("Some basic statistics"),
+ LPGENW("Added %d of %d contacts stored in the ini-file."),
numContactsAdded, numContactsInFile);
}
return 0;
}
MsgErr(NULL,
- LPGENT("The ini-file \"%s\"\nfor reading contact information could not be opened."),
+ LPGENW("The ini-file \"%s\"\nfor reading contact information could not be opened."),
pszFileName);
return 1;
}
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp
index 35975b1abd..30f7151067 100644
--- a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp
+++ b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp
@@ -107,7 +107,7 @@ int CFileXml::Export(lpExImParam ExImContact, LPCSTR pszFileName)
FILE *xmlfile = fopen(pszFileName, "wt");
if (!xmlfile)
{
- MsgErr(NULL, LPGENT("Can't create xml file!\n%S"), pszFileName);
+ MsgErr(NULL, LPGENW("Can't create xml file!\n%S"), pszFileName);
return 1;
}
@@ -183,7 +183,7 @@ int CFileXml::Export(lpExImParam ExImContact, LPCSTR pszFileName)
} // *end for
#ifdef _DEBUG
QueryPerformanceCounter(&t2);
- MsgErr(NULL, LPGENT("Export took %f ms"),
+ MsgErr(NULL, LPGENW("Export took %f ms"),
(long double)(t2.QuadPart - t1.QuadPart) / freq.QuadPart * 1000.);
#endif
}// *end other export mode
@@ -255,7 +255,7 @@ int CFileXml::ImportContacts(TiXmlElement* xmlParent)
// update progressbar and abort if user clicked cancel
LPTSTR pszNick = mir_utf8decodeT(xContact->Attribute("nick"));
// user clicked abort button
- if (_progress.UpdateContact(LPGENT("Contact: %s (%S)"), pszNick, xContact->Attribute("proto"))) {
+ if (_progress.UpdateContact(LPGENW("Contact: %s (%S)"), pszNick, xContact->Attribute("proto"))) {
int result = vContact.LoadXmlElemnt(xContact);
switch (result) {
case ERROR_OK:
@@ -271,7 +271,7 @@ int CFileXml::ImportContacts(TiXmlElement* xmlParent)
return ERROR_ABORTED;
#ifdef _DEBUG
default:
- MsgErr(NULL, LPGENT("Importing %s caused error %d"), pszNick, result);
+ MsgErr(NULL, LPGENW("Importing %s caused error %d"), pszNick, result);
break;
#endif
}
@@ -282,7 +282,7 @@ int CFileXml::ImportContacts(TiXmlElement* xmlParent)
return ERROR_ABORTED;
#ifdef _DEBUG
default:
- MsgErr(NULL, LPGENT("Loading contact %s from xml failed with error %d"), pszNick, result);
+ MsgErr(NULL, LPGENW("Loading contact %s from xml failed with error %d"), pszNick, result);
break;
#endif
}
@@ -300,7 +300,7 @@ int CFileXml::ImportContacts(TiXmlElement* xmlParent)
return ERROR_ABORTED;
#ifdef _DEBUG
default:
- MsgErr(NULL, LPGENT("Importing Owner caused error %d"), result);
+ MsgErr(NULL, LPGENW("Importing Owner caused error %d"), result);
#endif
}
}
@@ -345,19 +345,19 @@ int CFileXml::Import(MCONTACT hContact, LPCSTR pszFileName)
// load xml file
TiXmlDocument doc;
if (!doc.LoadFile(pszFileName)) {
- MsgErr(NULL, LPGENT("Parser is unable to load XMLCard \"%s\"\nError: %d\nDescription: %s"),
+ MsgErr(NULL, LPGENW("Parser is unable to load XMLCard \"%s\"\nError: %d\nDescription: %s"),
pszFileName, doc.ErrorId(), doc.ErrorDesc());
return 1;
}
// is xmlfile a XMLCard ?
TiXmlElement *xmlCard = doc.FirstChildElement("XMLCard");
if (xmlCard == NULL) {
- MsgErr(NULL, LPGENT("The selected file is no valid XMLCard"));
+ MsgErr(NULL, LPGENW("The selected file is no valid XMLCard"));
return 1;
}
// check version
if (mir_strcmp(xmlCard->Attribute("ver"), XMLCARD_VERSION)) {
- MsgErr(NULL, LPGENT("The version of the XMLCard is not supported by UserInfoEx"));
+ MsgErr(NULL, LPGENW("The version of the XMLCard is not supported by UserInfoEx"));
return 1;
}
@@ -374,12 +374,12 @@ int CFileXml::Import(MCONTACT hContact, LPCSTR pszFileName)
if (!ret) {
MsgBox(NULL, MB_ICONINFORMATION,
- LPGENT("Complete"),
- LPGENT("Import complete"),
- LPGENT("Owner contact successfully imported."));
+ LPGENW("Complete"),
+ LPGENW("Import complete"),
+ LPGENW("Owner contact successfully imported."));
return 0;
} else {
- MsgErr(NULL, LPGENT("Selected XMLCard does not contain an owner contact!"));
+ MsgErr(NULL, LPGENW("Selected XMLCard does not contain an owner contact!"));
return 1;
}
}
@@ -406,12 +406,12 @@ int CFileXml::Import(MCONTACT hContact, LPCSTR pszFileName)
#ifdef _DEBUG
QueryPerformanceCounter(&t2);
- MsgErr(NULL, LPGENT("Import took %f ms"),
+ MsgErr(NULL, LPGENW("Import took %f ms"),
(long double)(t2.QuadPart - t1.QuadPart) / freq.QuadPart * 1000.);
#endif
// show results
- MsgBox(NULL, MB_ICONINFORMATION, LPGENT("Import complete"), LPGENT("Some basic statistics"),
- LPGENT("added contacts: %u / %u\nadded settings: %u / %u\nadded events %u / %u\nduplicated events: %u"),
+ MsgBox(NULL, MB_ICONINFORMATION, LPGENW("Import complete"), LPGENW("Some basic statistics"),
+ LPGENW("added contacts: %u / %u\nadded settings: %u / %u\nadded events %u / %u\nduplicated events: %u"),
_numContactsDone, _numContactsTodo,
_numSettingsDone, _numSettingsTodo,
_numEventsDone, _numEventsTodo,
@@ -421,7 +421,7 @@ int CFileXml::Import(MCONTACT hContact, LPCSTR pszFileName)
return 0;
}
catch(...) {
- MsgErr(NULL, LPGENT("FATAL: An exception was thrown while importing contacts from xmlCard!"));
+ MsgErr(NULL, LPGENW("FATAL: An exception was thrown while importing contacts from xmlCard!"));
return 1;
}
}
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp
index 157094e89e..864129010c 100644
--- a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp
+++ b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp
@@ -266,7 +266,7 @@ INT_PTR svcExIm_Group_Service(WPARAM wParam, LPARAM)
{
ExImParam ExIm;
INT_PTR hItem = 0, hRoot = 0, hParent = 0;
- TCHAR tszGroup[120], tszItem[120];
+ wchar_t tszGroup[120], tszItem[120];
memset(&tszGroup, 0, sizeof(tszGroup));
memset(&tszItem, 0, sizeof(tszItem));
memset(&ExIm, 0, sizeof(ExIm));
diff --git a/plugins/UserInfoEx/src/mir_icolib.cpp b/plugins/UserInfoEx/src/mir_icolib.cpp
index 9f39826acd..6cb53675a8 100644
--- a/plugins/UserInfoEx/src/mir_icolib.cpp
+++ b/plugins/UserInfoEx/src/mir_icolib.cpp
@@ -132,7 +132,7 @@ LPTSTR IcoLib_GetDefaultIconFileName()
L"Plugins\\uinfoex_icons.dll",
L"Customize\\Icons\\uinfoex_icons.dll"
};
- TCHAR absolute[MAX_PATH];
+ wchar_t absolute[MAX_PATH];
for (int i = 0; i < _countof(path); i++) {
PathToAbsoluteT(path[i], absolute);
@@ -156,7 +156,7 @@ static void IcoLib_CheckIconPackVersion(LPTSTR szIconPack)
{
if (db_get_b(NULL, MODNAME, SET_ICONS_CHECKFILEVERSION, TRUE)) {
if (szIconPack) {
- TCHAR szAbsolutePath[MAX_PATH];
+ wchar_t szAbsolutePath[MAX_PATH];
PathToAbsoluteT(szIconPack, szAbsolutePath);
HMODULE hIconDll = LoadLibrary(szAbsolutePath);
@@ -165,12 +165,12 @@ static void IcoLib_CheckIconPackVersion(LPTSTR szIconPack)
if (!LoadStringA(hIconDll, IDS_ICOPACKVERSION, szFileVersion, sizeof(szFileVersion))
|| mir_strcmp(szFileVersion, "__UserInfoEx_IconPack_1.2__"))
- MsgErr(NULL, LPGENT("Warning: Your current IconPack's version differs from the one UserInfoEx is designed for.\nSome icons may not be displayed correctly"));
+ MsgErr(NULL, LPGENW("Warning: Your current IconPack's version differs from the one UserInfoEx is designed for.\nSome icons may not be displayed correctly"));
FreeLibrary(hIconDll);
}
}
else
- MsgErr(NULL, LPGENT("Warning: No IconPack found in one of the following directories: 'customize\\icons', 'icons' or 'plugins'!"));
+ MsgErr(NULL, LPGENW("Warning: No IconPack found in one of the following directories: 'customize\\icons', 'icons' or 'plugins'!"));
}
}
@@ -229,10 +229,10 @@ static HANDLE IcoLib_RegisterIconHandleEx(LPSTR szIconID, LPSTR szDescription, L
SKINICONDESC sid = { 0 };
sid.flags = SIDF_ALL_TCHAR;
sid.pszName = szIconID;
- sid.description.t = mir_a2t(szDescription);
- sid.section.t = mir_a2t(szSection);
+ sid.description.w = mir_a2t(szDescription);
+ sid.section.w = mir_a2t(szSection);
- if (sid.description.t && sid.section.t) {
+ if (sid.description.w && sid.section.w) {
switch (Size) {
// small icons (16x16)
case 0:
@@ -252,8 +252,8 @@ static HANDLE IcoLib_RegisterIconHandleEx(LPSTR szIconID, LPSTR szDescription, L
break;
}
- sid.defaultFile.t = szDefaultFile;
- if (sid.defaultFile.t && sid.defaultFile.t[0])
+ sid.defaultFile.w = szDefaultFile;
+ if (sid.defaultFile.w && sid.defaultFile.w[0])
sid.iDefaultIndex = -idIcon;
else {
sid.hDefaultIcon = hDefIcon;
@@ -261,8 +261,8 @@ static HANDLE IcoLib_RegisterIconHandleEx(LPSTR szIconID, LPSTR szDescription, L
}
hIconHandle = IcoLib_AddIcon(&sid);
}
- MIR_FREE(sid.description.t);
- MIR_FREE(sid.section.t);
+ MIR_FREE(sid.description.w);
+ MIR_FREE(sid.section.w);
}
return hIconHandle;
}
diff --git a/plugins/UserInfoEx/src/mir_icolib.h b/plugins/UserInfoEx/src/mir_icolib.h
index 7ac5bd5e36..f6220fda85 100644
--- a/plugins/UserInfoEx/src/mir_icolib.h
+++ b/plugins/UserInfoEx/src/mir_icolib.h
@@ -24,11 +24,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// sections
#define SECT_COMMON LPGEN("Extended user info")
-#define SECT_ZODIAC "Extended user info/Zodiacs"
-#define SECT_DLG "Extended user info/Dialogs"
-#define SECT_BUTTONS "Extended user info/Buttons"
-#define SECT_TREE "Extended user info/Treeview"
-#define SECT_REMIND "Extended user info/Reminder"
+#define SECT_ZODIAC LPGEN("Extended user info/Zodiacs")
+#define SECT_DLG LPGEN("Extended user info/Dialogs")
+#define SECT_BUTTONS LPGEN("Extended user info/Buttons")
+#define SECT_TREE LPGEN("Extended user info/Treeview")
+#define SECT_REMIND LPGEN("Extended user info/Reminder")
// icons
#define ICO_COMMON_MAIN MODNAME"_common_main"
diff --git a/plugins/UserInfoEx/src/psp_about.cpp b/plugins/UserInfoEx/src/psp_about.cpp
index d097a200b6..d19175763e 100644
--- a/plugins/UserInfoEx/src/psp_about.cpp
+++ b/plugins/UserInfoEx/src/psp_about.cpp
@@ -43,9 +43,9 @@ INT_PTR CALLBACK PSPProcEdit(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam,
SendDlgItemMessage(hDlg, IDC_PAGETITLE, WM_SETFONT, (WPARAM)hBoldFont, 0);
if (!mir_strcmp(pszSetting, SET_CONTACT_MYNOTES))
- SetDlgItemText(hDlg, IDC_PAGETITLE, LPGENT("My notes:"));
+ SetDlgItemText(hDlg, IDC_PAGETITLE, LPGENW("My notes:"));
else
- SetDlgItemText(hDlg, IDC_PAGETITLE, LPGENT("About:"));
+ SetDlgItemText(hDlg, IDC_PAGETITLE, LPGENW("About:"));
TranslateDialogDefault(hDlg);
diff --git a/plugins/UserInfoEx/src/psp_anniversary.cpp b/plugins/UserInfoEx/src/psp_anniversary.cpp
index 8683a347c7..b1c7514edc 100644
--- a/plugins/UserInfoEx/src/psp_anniversary.cpp
+++ b/plugins/UserInfoEx/src/psp_anniversary.cpp
@@ -78,10 +78,10 @@ static INT_PTR CALLBACK DlgProc_AnniversaryEditor(HWND hDlg, UINT uMsg, WPARAM w
LPTSTR pszText;
if (len == 0
- || (pszText = (LPTSTR)_alloca((len + 1) * sizeof(TCHAR))) == NULL
+ || (pszText = (LPTSTR)_alloca((len + 1) * sizeof(wchar_t))) == NULL
|| !Edit_GetText(hEdit, pszText, len + 1))
{
- MsgErr(hDlg, LPGENT("Please enter a valid description first!"));
+ MsgErr(hDlg, LPGENW("Please enter a valid description first!"));
break;
}
@@ -213,7 +213,7 @@ INT_PTR CALLBACK PSPProcAnniversary(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
if (HIWORD(wParam) == BN_CLICKED && PtrIsValid(pDateCtrl)) {
MAnnivDate *pDate = pDateCtrl->Current();
if (!pDate)
- MsgErr(hDlg, LPGENT("No valid date selected for editing!"));
+ MsgErr(hDlg, LPGENW("No valid date selected for editing!"));
else if (
IDOK == DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_ANNIVERSARY_EDITOR), hDlg, DlgProc_AnniversaryEditor, (LPARAM)pDate) &&
(pDate->Flags() & (MAnnivDate::MADF_CHANGED | MAnnivDate::MADF_REMINDER_CHANGED)))
@@ -232,8 +232,8 @@ INT_PTR CALLBACK PSPProcAnniversary(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
if (HIWORD(wParam) == BN_CLICKED && PtrIsValid(pDateCtrl)) {
MAnnivDate *pCurrent = pDateCtrl->Current();
if (pCurrent) {
- int rc = MsgBox(hDlg, MB_YESNO | MB_ICON_QUESTION | MB_NOPOPUP, LPGENT("Delete"), NULL,
- LPGENT("Do you really want to delete the %s?"), pCurrent->Description());
+ int rc = MsgBox(hDlg, MB_YESNO | MB_ICON_QUESTION | MB_NOPOPUP, LPGENW("Delete"), NULL,
+ LPGENW("Do you really want to delete the %s?"), pCurrent->Description());
if (rc == IDYES)
pDateCtrl->DeleteDate(pDateCtrl->CurrentIndex());
diff --git a/plugins/UserInfoEx/src/psp_contact.cpp b/plugins/UserInfoEx/src/psp_contact.cpp
index 997df02d38..2f0f6a9fa0 100644
--- a/plugins/UserInfoEx/src/psp_contact.cpp
+++ b/plugins/UserInfoEx/src/psp_contact.cpp
@@ -38,7 +38,7 @@ INT_PTR CALLBACK PSPProcContactHome(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
{
CCtrlList *pCtrlList = CCtrlList::CreateObj(hDlg);
if (pCtrlList) {
- TCHAR szAddr[MAX_PATH];
+ wchar_t szAddr[MAX_PATH];
LPIDSTRLIST pList;
UINT nList;
@@ -184,7 +184,7 @@ INT_PTR CALLBACK PSPProcContactWork(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
CCtrlList *pCtrlList = CCtrlList::CreateObj(hDlg);
if (pCtrlList)
{
- TCHAR szAddr[MAX_PATH];
+ wchar_t szAddr[MAX_PATH];
LPIDSTRLIST pList;
UINT nList;
diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp
index 50819e7922..fa6a41a010 100644
--- a/plugins/UserInfoEx/src/psp_options.cpp
+++ b/plugins/UserInfoEx/src/psp_options.cpp
@@ -447,9 +447,9 @@ static INT_PTR CALLBACK DlgProc_AdvancedOpts(HWND hDlg, UINT uMsg, WPARAM wParam
case BTN_OPT_RESET:
BYTE WantReset = MsgBox(hDlg,
MB_ICON_WARNING | MB_YESNO,
- LPGENT("Question"),
- LPGENT("Reset factory defaults"),
- LPGENT("This will delete all settings, you've made!\nAll TreeView settings, window positions and any other settings!\n\nAre you sure to proceed?"));
+ LPGENW("Question"),
+ LPGENW("Reset factory defaults"),
+ LPGENW("This will delete all settings, you've made!\nAll TreeView settings, window positions and any other settings!\n\nAre you sure to proceed?"));
if (WantReset) {
MCONTACT hContact;
@@ -485,9 +485,9 @@ static INT_PTR CALLBACK DlgProc_AdvancedOpts(HWND hDlg, UINT uMsg, WPARAM wParam
SendMessage(GetParent(hDlg), PSM_FORCECHANGED, NULL, NULL);
MsgBox(hDlg, MB_ICON_INFO,
- LPGENT("Ready"),
- LPGENT("Everything is done!"),
- LPGENT("All settings are reset to default values now!"));
+ LPGENW("Ready"),
+ LPGENW("Everything is done!"),
+ LPGENW("All settings are reset to default values now!"));
}
}
}
@@ -635,7 +635,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam
SendDlgItemMessage(hDlg, EDIT_BIRTHMODULE, CB_SETCURSEL, db_get_b(NULL, MODNAME, SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE), NULL);
MTime mtLast;
- TCHAR szTime[MAX_PATH];
+ wchar_t szTime[MAX_PATH];
mtLast.DBGetStamp(NULL, MODNAME, SET_REMIND_LASTCHECK);
mtLast.UTCToLocal();
@@ -868,9 +868,9 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR
if (IsDlgButtonChecked(hDlg, RADIO_OPT_POPUP_PERMANENT))
db_set_b(NULL, MODNAME, SET_POPUP_DELAY, 255);
else if (IsDlgButtonChecked(hDlg, RADIO_OPT_POPUP_CUSTOM)) {
- TCHAR szDelay[4];
+ wchar_t szDelay[4];
GetDlgItemText(hDlg, EDIT_DELAY, szDelay, _countof(szDelay));
- db_set_b(NULL, MODNAME, SET_POPUP_DELAY, (BYTE)_tcstol(szDelay, NULL, 10));
+ db_set_b(NULL, MODNAME, SET_POPUP_DELAY, (BYTE)wcstol(szDelay, NULL, 10));
}
else
db_unset(NULL, MODNAME, SET_POPUP_DELAY);
diff --git a/plugins/UserInfoEx/src/psp_origin.cpp b/plugins/UserInfoEx/src/psp_origin.cpp
index a2c35c73b2..7dd0f8cc53 100644
--- a/plugins/UserInfoEx/src/psp_origin.cpp
+++ b/plugins/UserInfoEx/src/psp_origin.cpp
@@ -86,7 +86,7 @@ INT_PTR CALLBACK PSPProcOrigin(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
mt.FromStampAsUTC(dwStamp);
}
if (mt.IsValid()) {
- TCHAR szTime[MAX_PATH];
+ wchar_t szTime[MAX_PATH];
LPTSTR ptr;
mt.UTCToLocal();
@@ -133,7 +133,7 @@ INT_PTR CALLBACK PSPProcOrigin(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
case WM_TIMER:
{
- TCHAR szTime[32];
+ wchar_t szTime[32];
CTzCombo::GetObj(hDlg, EDIT_TIMEZONE)->GetTime(szTime, _countof(szTime));
SetDlgItemText(hDlg, TXT_TIME, szTime);
break;
diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp
index a2a6917b3c..ead5c48503 100644
--- a/plugins/UserInfoEx/src/psp_profile.cpp
+++ b/plugins/UserInfoEx/src/psp_profile.cpp
@@ -67,9 +67,9 @@ typedef struct TProfileEntries {
} PROFILEENTRY, *LPPROFILEENTRY;
static const PROFILEENTRY pFmt[3] = {
- { LPGENT("Past"), "Past%d", "Past%dText", (MIRANDASERVICE)GetPastList },
- { LPGENT("Affiliation"), "Affiliation%d", "Affiliation%dText", (MIRANDASERVICE)GetAffiliationsList },
- { LPGENT("Interest"), "Interest%dCat", "Interest%dText", (MIRANDASERVICE)GetInterestsList }
+ { LPGENW("Past"), "Past%d", "Past%dText", (MIRANDASERVICE)GetPastList },
+ { LPGENW("Affiliation"), "Affiliation%d", "Affiliation%dText", (MIRANDASERVICE)GetAffiliationsList },
+ { LPGENW("Interest"), "Interest%dCat", "Interest%dText", (MIRANDASERVICE)GetInterestsList }
};
static LRESULT CALLBACK ProfileList_LabelEditProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -112,7 +112,7 @@ static int ProfileList_AddGroup(HWND hList, LPTSTR pszText, int iItem)
static int ProfileList_GetItemText(HWND hList, int iItem, int iSubItem, LPTSTR pszText, int ccText)
{
LVITEM lvi;
- TCHAR szNull[2];
+ wchar_t szNull[2];
lvi.mask = LVIF_TEXT;
lvi.iItem = iItem;
@@ -223,7 +223,7 @@ static int ProfileList_EndLabelEdit(LPLISTCTRL pList, BYTE bSave)
}
// value was edited
else {
- if ((ccText = GetWindowTextLength(hEdit)) > 0 && (szEdit = (LPTSTR)mir_alloc((ccText + 2) * sizeof(TCHAR)))) {
+ if ((ccText = GetWindowTextLength(hEdit)) > 0 && (szEdit = (LPTSTR)mir_alloc((ccText + 2) * sizeof(wchar_t)))) {
GetWindowText(hEdit, szEdit, ccText + 1);
szEdit[ccText + 1] = 0;
@@ -446,7 +446,7 @@ static BYTE ProfileList_AddNewItem(HWND hDlg, LPLISTCTRL pList, const PROFILEENT
return TRUE;
}
mir_free(pItem);
- MsgErr(hDlg, LPGENT("Sorry, but there is a problem with adding a new item of type \"%s\""), pEntry->szGroup);
+ MsgErr(hDlg, LPGENW("Sorry, but there is a problem with adding a new item of type \"%s\""), pEntry->szGroup);
}
return FALSE;
}
@@ -907,7 +907,7 @@ static LRESULT CALLBACK ProfileList_SubclassProc(HWND hwnd, UINT msg, WPARAM wPa
case BTN_EDIT:
{
int i;
- TCHAR szEdit[MAX_PATH];
+ wchar_t szEdit[MAX_PATH];
if (!PtrIsValid(pList = (LPLISTCTRL)GetUserData(hwnd)))
break;
@@ -1181,7 +1181,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR
BYTE iFmt = -1;
int iItem;
LVITEM lvi;
- TCHAR szGroup[MAX_PATH];
+ wchar_t szGroup[MAX_PATH];
CHAR pszSetting[MAXSETTING];
LPLCITEM pItem;
LPSTR pszModule = USERINFO;
@@ -1332,7 +1332,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR
ListView_GetItemRect(cd->nmcd.hdr.hwndFrom, cd->nmcd.dwItemSpec, &rc, LVIR_BOUNDS);
if (!PtrIsValid(pItem)) {
HFONT hBold, hFont;
- TCHAR szText[MAX_PATH];
+ wchar_t szText[MAX_PATH];
PSGetBoldFont(hDlg, hBold);
hFont = (HFONT)SelectObject(cd->nmcd.hdc, hBold);
@@ -1412,7 +1412,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR
ProfileList_BeginLabelEdit(hList, ListView_GetSelectionMark(hList), 1);
break;
case BTN_DEL:
- if (IDYES == MsgBox(hDlg, MB_YESNO | MB_ICON_QUESTION, LPGENT("Question"), LPGENT("Delete an entry"), LPGENT("Do you really want to delete this entry?"))) {
+ if (IDYES == MsgBox(hDlg, MB_YESNO | MB_ICON_QUESTION, LPGENW("Question"), LPGENW("Delete an entry"), LPGENW("Do you really want to delete this entry?"))) {
int iItem = ListView_GetSelectionMark(hList);
pList = (LPLISTCTRL)GetUserData(hList);
diff --git a/plugins/UserInfoEx/src/svc_email.cpp b/plugins/UserInfoEx/src/svc_email.cpp
index 73a1dd982a..c47c9c5ac8 100644
--- a/plugins/UserInfoEx/src/svc_email.cpp
+++ b/plugins/UserInfoEx/src/svc_email.cpp
@@ -100,7 +100,7 @@ static INT_PTR MenuCommand(WPARAM wParam,LPARAM lParam)
}
else {
result = 1;
- MsgBox((HWND)lParam, MB_OK, LPGENT("Send e-mail"), NULL, LPGENT("Memory allocation error!"));
+ MsgBox((HWND)lParam, MB_OK, LPGENW("Send e-mail"), NULL, LPGENW("Memory allocation error!"));
}
}
__except(GetExceptionCode()==EXCEPTION_ACCESS_VIOLATION ?
@@ -108,7 +108,7 @@ static INT_PTR MenuCommand(WPARAM wParam,LPARAM lParam)
{
mir_free(val);
result = 1;
- MsgErr((HWND)lParam, LPGENT("Memory allocation error!"));
+ MsgErr((HWND)lParam, LPGENW("Memory allocation error!"));
}
return result;
}
diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp
index 4833e52f12..b844322721 100644
--- a/plugins/UserInfoEx/src/svc_refreshci.cpp
+++ b/plugins/UserInfoEx/src/svc_refreshci.cpp
@@ -115,7 +115,7 @@ public:
{
if (szText)
{
- TCHAR buf[MAXDATASIZE];
+ wchar_t buf[MAXDATASIZE];
va_list vl;
va_start(vl, szText);
@@ -144,11 +144,11 @@ public:
if (szText)
{
INT_PTR cch = mir_tstrlen(szText);
- LPTSTR fmt = (LPTSTR) mir_alloc((cch + 1) * sizeof(TCHAR));
+ LPTSTR fmt = (LPTSTR) mir_alloc((cch + 1) * sizeof(wchar_t));
if (fmt)
{
- TCHAR buf[MAXDATASIZE];
+ wchar_t buf[MAXDATASIZE];
va_list vl;
mir_tstrcpy(fmt, szText);
@@ -165,13 +165,13 @@ public:
// leading bbcode tag (e.g.: [b], [u], [i])
if ((s[1] == 'b' || s[1] == 'u' || s[1] == 'i') && s[2] == ']')
{
- memmove(s, s + 3, (e - s - 2) * sizeof(TCHAR));
+ memmove(s, s + 3, (e - s - 2) * sizeof(wchar_t));
e -= 3;
}
// ending bbcode tag (e.g.: [/b], [/u], [/i])
else if (s[1] == '/' && (s[2] == 'b' || s[2] == 'u' || s[2] == 'i') && s[3] == ']')
{
- memmove(s, s + 4, (e - s - 3) * sizeof(TCHAR));
+ memmove(s, s + 4, (e - s - 3) * sizeof(wchar_t));
e -= 4;
}
}
@@ -346,7 +346,7 @@ class CPopupUpdProgress : public CUpdProgress
if (_szText)
{
INT_PTR cb = mir_tstrlen(_szText) + 8;
- LPTSTR pb = (LPTSTR) mir_alloc(cb * sizeof(TCHAR));
+ LPTSTR pb = (LPTSTR) mir_alloc(cb * sizeof(wchar_t));
if (pb)
{
@@ -602,7 +602,7 @@ class CContactUpdater : public CContactQueue
// reset menu
if (hMenuItemRefresh)
- Menu_ModifyItem(hMenuItemRefresh, LPGENT("Refresh contact details"), IcoLib_GetIcon(ICO_BTN_UPDATE));
+ Menu_ModifyItem(hMenuItemRefresh, LPGENW("Refresh contact details"), IcoLib_GetIcon(ICO_BTN_UPDATE));
}
/**
@@ -713,7 +713,7 @@ public:
// if there are contacts in the queue, change the main menu item to indicate it is meant for canceling.
if (hMenuItemRefresh && Size() > 0)
- Menu_ModifyItem(hMenuItemRefresh, LPGENT("Abort Refreshing Contact Details"), IcoLib_GetIcon(ICO_BTN_CANCEL));
+ Menu_ModifyItem(hMenuItemRefresh, LPGENW("Abort Refreshing Contact Details"), IcoLib_GetIcon(ICO_BTN_CANCEL));
}
/**
@@ -785,20 +785,20 @@ static INT_PTR RefreshService(WPARAM, LPARAM)
{
ContactUpdater->RefreshAll();
}
- else if (IDYES == MsgBox(NULL, MB_YESNO|MB_ICON_QUESTION, LPGENT("Refresh contact details"), NULL,
- LPGENT("Do you want to cancel the current refresh procedure?")))
+ else if (IDYES == MsgBox(NULL, MB_YESNO|MB_ICON_QUESTION, LPGENW("Refresh contact details"), NULL,
+ LPGENW("Do you want to cancel the current refresh procedure?")))
{
ContactUpdater->Cancel();
}
}
else
{
- MsgErr(NULL, LPGENT("Miranda must be online for refreshing contact information!"));
+ MsgErr(NULL, LPGENW("Miranda must be online for refreshing contact information!"));
}
}
catch(...)
{
- MsgErr(NULL, LPGENT("The function caused an exception!"));
+ MsgErr(NULL, LPGENW("The function caused an exception!"));
}
return 0;
}
@@ -838,7 +838,7 @@ static int OnContactAdded(WPARAM hContact, LPARAM)
}
catch(...)
{
- MsgErr(NULL, LPGENT("The function caused an exception!"));
+ MsgErr(NULL, LPGENW("The function caused an exception!"));
}
return 0;
}
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp
index de7ee4ee19..700575c708 100644
--- a/plugins/UserInfoEx/src/svc_reminder.cpp
+++ b/plugins/UserInfoEx/src/svc_reminder.cpp
@@ -308,7 +308,7 @@ static void NotifyFlashCListIcon(MCONTACT hContact, const CEvent &evt)
if (!gRemindOpts.bFlashCList || evt._wDaysLeft != 0)
return;
- TCHAR szMsg[MAX_PATH];
+ wchar_t szMsg[MAX_PATH];
CLISTEVENT cle = {};
cle.hContact = hContact;
@@ -431,7 +431,7 @@ static BYTE CheckAnniversaries(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE
tszMsg.Append(L"\n...");
}
- NotifyWithPopup(hContact, CEvent::ANNIVERSARY, Diff, LPGENT("Anniversaries"), tszMsg);
+ NotifyWithPopup(hContact, CEvent::ANNIVERSARY, Diff, LPGENW("Anniversaries"), tszMsg);
}
return numAnniversaries != 0;
@@ -476,7 +476,7 @@ static bool CheckBirthday(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNoti
}
if (bNotify) {
- TCHAR szMsg[MAXDATASIZE];
+ wchar_t szMsg[MAXDATASIZE];
WORD cchMsg = 0;
switch (Diff) {
diff --git a/plugins/UserInfoEx/src/svc_timezone_old.cpp b/plugins/UserInfoEx/src/svc_timezone_old.cpp
index bd08054600..dfc50be0ed 100644
--- a/plugins/UserInfoEx/src/svc_timezone_old.cpp
+++ b/plugins/UserInfoEx/src/svc_timezone_old.cpp
@@ -176,7 +176,7 @@ public:
hKeyTz;
DWORD i,
cbData;
- TCHAR szName[MAX_PATH],
+ wchar_t szName[MAX_PATH],
szDisplay[MAX_PATH];
CTimeZone *pTimeZone;
diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp
index 0ab768ffd4..416cc360c8 100644
--- a/plugins/Variables/src/contact.cpp
+++ b/plugins/Variables/src/contact.cpp
@@ -22,7 +22,7 @@
struct _tagType
{
int cnfCode;
- TCHAR* str;
+ wchar_t* str;
}
static builtinCnfs[] =
{
@@ -77,7 +77,7 @@ static builtinCnfs[] =
struct CONTACTCE
{
int flags;
- TCHAR* tszContact;
+ wchar_t* tszContact;
MCONTACT hContact;
};
@@ -94,7 +94,7 @@ static OBJLIST<CONTACTCE> arContactCache(20, SortContactCache);
static mir_cs csContactCache;
// converts a string into a CNF_ type
-BYTE getContactInfoType(TCHAR* type)
+BYTE getContactInfoType(wchar_t* type)
{
if (type == NULL || mir_tstrlen(type) == 0)
return 0;
@@ -107,7 +107,7 @@ BYTE getContactInfoType(TCHAR* type)
}
// returns info about a contact as a string
-TCHAR* getContactInfoT(BYTE type, MCONTACT hContact)
+wchar_t* getContactInfoT(BYTE type, MCONTACT hContact)
{
/* returns dynamic allocated buffer with info, or NULL if failed */
if (hContact == NULL)
@@ -117,7 +117,7 @@ TCHAR* getContactInfoT(BYTE type, MCONTACT hContact)
if (szProto == NULL)
return NULL;
- TCHAR *res = NULL;
+ wchar_t *res = NULL;
switch (type) {
case CCNF_PROTOID:
return mir_a2t(szProto);
@@ -168,7 +168,7 @@ TCHAR* getContactInfoT(BYTE type, MCONTACT hContact)
}
// MS_VARS_GETCONTACTFROMSTRING
-MCONTACT getContactFromString(const TCHAR *tszContact, DWORD dwFlags, int nMatch)
+MCONTACT getContactFromString(const wchar_t *tszContact, DWORD dwFlags, int nMatch)
{
/* service to retrieve a contact's HANDLE from a given string */
if (tszContact == NULL || *tszContact == 0)
@@ -183,7 +183,7 @@ MCONTACT getContactFromString(const TCHAR *tszContact, DWORD dwFlags, int nMatch
// search the cache
{
- CONTACTCE tmp = { dwFlags, (TCHAR*)tszContact, 0 };
+ CONTACTCE tmp = { dwFlags, (wchar_t*)tszContact, 0 };
mir_cslock lck(csContactCache);
CONTACTCE *p = arContactCache.find(&tmp);
@@ -355,18 +355,18 @@ int deinitContactModule()
// returns a string in the form <PROTOID:UNIQUEID>, cannot be _HANDLE_!
// result must be freed
-TCHAR* encodeContactToString(MCONTACT hContact)
+wchar_t* encodeContactToString(MCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
if (szProto == NULL)
return NULL;
- TCHAR *tszUniqueId = getContactInfoT(CNF_UNIQUEID, hContact);
+ wchar_t *tszUniqueId = getContactInfoT(CNF_UNIQUEID, hContact);
if (tszUniqueId == NULL)
return NULL;
size_t size = mir_tstrlen(tszUniqueId) + mir_strlen(szProto) + 4;
- TCHAR *tszResult = (TCHAR *)mir_calloc(size * sizeof(TCHAR));
+ wchar_t *tszResult = (wchar_t *)mir_calloc(size * sizeof(wchar_t));
if (tszResult)
mir_sntprintf(tszResult, size, L"<%S:%s>", szProto, tszUniqueId);
return tszResult;
diff --git a/plugins/Variables/src/contact.h b/plugins/Variables/src/contact.h
index 55e292677c..b145a48f4f 100644
--- a/plugins/Variables/src/contact.h
+++ b/plugins/Variables/src/contact.h
@@ -96,4 +96,4 @@
// CNF_ type possible
#define CI_NEEDCOUNT 0x80000000 // returns contacts count
-TCHAR *encodeContactToString(MCONTACT hContact);
+wchar_t *encodeContactToString(MCONTACT hContact);
diff --git a/plugins/Variables/src/help.cpp b/plugins/Variables/src/help.cpp
index 842695deb3..57d5ad1e0c 100644
--- a/plugins/Variables/src/help.cpp
+++ b/plugins/Variables/src/help.cpp
@@ -129,7 +129,7 @@ static INT_PTR CALLBACK clistDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM
MCONTACT hItem, hContact = wParam;
log_debugA("VARM_SETSUBJECT: %u", hContact);
if (hContact == INVALID_CONTACT_ID) {
- TCHAR *tszContact = db_get_tsa(NULL, MODULENAME, SETTING_SUBJECT);
+ wchar_t *tszContact = db_get_tsa(NULL, MODULENAME, SETTING_SUBJECT);
log_debugA("VARM_SETSUBJECT: %s", tszContact);
if (tszContact != NULL) {
hContact = getContactFromString(tszContact, CI_PROTOID);
@@ -202,7 +202,7 @@ static INT_PTR CALLBACK clistDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM
MCONTACT hContact = (MCONTACT)SendMessage(hwndDlg, VARM_GETSUBJECT, 0, 0);
if (hContact != NULL) {
- TCHAR *tszContact = encodeContactToString(hContact);
+ wchar_t *tszContact = encodeContactToString(hContact);
if (tszContact != NULL) {
db_set_ts(NULL, MODULENAME, SETTING_SUBJECT, tszContact);
mir_free(tszContact);
@@ -214,7 +214,7 @@ static INT_PTR CALLBACK clistDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM
}
// dialog box for the tokens
-static TCHAR *getTokenCategory(TOKENREGISTEREX *tr) {
+static wchar_t *getTokenCategory(TOKENREGISTEREX *tr) {
if (tr == NULL) {
return NULL;
}
@@ -228,20 +228,20 @@ static TCHAR *getTokenCategory(TOKENREGISTEREX *tr) {
*cur = 0;
helpText = ( char* )mir_realloc(helpText, mir_strlen(helpText)+1);
- TCHAR *res = mir_a2t(helpText);
+ wchar_t *res = mir_a2t(helpText);
mir_free(helpText);
return res;
}
cur++;
}
- TCHAR *res = mir_a2t(helpText);
+ wchar_t *res = mir_a2t(helpText);
mir_free(helpText);
return res;
}
-static TCHAR *getHelpDescription(TOKENREGISTEREX *tr)
+static wchar_t *getHelpDescription(TOKENREGISTEREX *tr)
{
if (tr == NULL)
return NULL;
@@ -251,7 +251,7 @@ static TCHAR *getHelpDescription(TOKENREGISTEREX *tr)
if (*cur == '\t') {
cur = mir_strdup(cur+1);
- TCHAR *res = mir_a2t(cur);
+ wchar_t *res = mir_a2t(cur);
mir_free(cur);
return res;
@@ -263,7 +263,7 @@ static TCHAR *getHelpDescription(TOKENREGISTEREX *tr)
}
-static TCHAR *getTokenDescription(TOKENREGISTEREX *tr)
+static wchar_t *getTokenDescription(TOKENREGISTEREX *tr)
{
if (tr == NULL)
return NULL;
@@ -276,7 +276,7 @@ static TCHAR *getTokenDescription(TOKENREGISTEREX *tr)
return NULL;
char *cur = helpText;
- TCHAR *tArgs = NULL;
+ wchar_t *tArgs = NULL;
char *args = NULL, *first = NULL, *second = NULL;
while (*cur != 0) {
if (*cur == '\t') {
@@ -295,7 +295,7 @@ static TCHAR *getTokenDescription(TOKENREGISTEREX *tr)
else args = NULL;
size_t len = mir_tstrlen(tr->tszTokenString) + (args!=NULL?mir_strlen(args):0) + 3;
- TCHAR *desc = (TCHAR*)mir_calloc(len * sizeof(TCHAR));
+ wchar_t *desc = (wchar_t*)mir_calloc(len * sizeof(wchar_t));
if (desc == NULL) {
mir_free(helpText);
return NULL;
@@ -344,7 +344,7 @@ static BOOL CALLBACK processTokenListMessage(HWND hwndDlg, UINT msg, WPARAM, LPA
case WM_INITDIALOG:
{
TOKENREGISTEREX *tr;
- TCHAR *tszTokenDesc, *tszHelpDesc, *last, *cat, *text;
+ wchar_t *tszTokenDesc, *tszHelpDesc, *last, *cat, *text;
// token list things
HWND hList = GetDlgItem(hwndDlg, IDC_TOKENLIST);
@@ -465,11 +465,11 @@ static BOOL CALLBACK processTokenListMessage(HWND hwndDlg, UINT msg, WPARAM, LPA
break;
size_t len = mir_tstrlen(tr->tszTokenString) + 2;
- TCHAR *tokenString = (TCHAR*)mir_alloc((len+1)*sizeof(TCHAR));
+ wchar_t *tokenString = (wchar_t*)mir_alloc((len+1)*sizeof(wchar_t));
if (tokenString == NULL)
break;
- memset(tokenString, 0, ((len + 1) * sizeof(TCHAR)));
+ memset(tokenString, 0, ((len + 1) * sizeof(wchar_t)));
mir_sntprintf(tokenString, len + 1, L"%c%s%c", (tr->flags & TRF_FIELD) ? FIELD_CHAR : FUNC_CHAR, tr->tszTokenString, (tr->flags & TRF_FIELD) ? FIELD_CHAR : '(');
SendDlgItemMessage(hwndInputDlg, IDC_TESTSTRING, EM_REPLACESEL, TRUE, (LPARAM)tokenString);
mir_free(tokenString);
@@ -673,18 +673,18 @@ static INT_PTR CALLBACK inputDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM
case VARM_PARSE:
{
- TCHAR *string = Hlp_GetDlgItemText(hwndDlg, IDC_TESTSTRING), *extraText;
+ wchar_t *string = Hlp_GetDlgItemText(hwndDlg, IDC_TESTSTRING), *extraText;
int len = SendMessage(GetParent(hwndDlg), VARM_GETEXTRATEXTLENGTH, 0, 0);
if (len > 0) {
- extraText = (TCHAR*)mir_calloc((len + 1)* sizeof(TCHAR));
+ extraText = (wchar_t*)mir_calloc((len + 1)* sizeof(wchar_t));
SendMessage(GetParent(hwndDlg), VARM_GETEXTRATEXT, (WPARAM)len + 1, (LPARAM)extraText);
}
else extraText = NULL;
if (string != NULL) {
- TCHAR *newString = variables_parsedup(string, extraText, (MCONTACT)SendMessage(GetParent(hwndDlg), VARM_GETSUBJECT, 0, 0));
+ wchar_t *newString = variables_parsedup(string, extraText, (MCONTACT)SendMessage(GetParent(hwndDlg), VARM_GETSUBJECT, 0, 0));
if (newString != NULL) {
- TCHAR *oldString = Hlp_GetDlgItemText(hwndDlg, IDC_RESULT);
+ wchar_t *oldString = Hlp_GetDlgItemText(hwndDlg, IDC_RESULT);
if (oldString == NULL || mir_tstrcmp(oldString, newString))
SetDlgItemText(hwndDlg, IDC_RESULT, newString);
@@ -819,7 +819,7 @@ static INT_PTR CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM l
}
}
else if (dat->vhs->hwndCtrl != NULL) {
- TCHAR *tszText = Hlp_GetWindowText(dat->vhs->hwndCtrl);
+ wchar_t *tszText = Hlp_GetWindowText(dat->vhs->hwndCtrl);
if (tszText != NULL) {
SendMessage(hwndDlg, VARM_SETINPUTTEXT, 0, (LPARAM)tszText);
mir_free(tszText);
@@ -908,7 +908,7 @@ static INT_PTR CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM l
if (len > 0) {
if ((dat->vhs->fi != NULL) && (!(dat->vhs->flags&VHF_DONTFILLSTRUCT))) {
if (dat->vhs->fi->flags&FIF_UNICODE) {
- dat->vhs->fi->tszFormat = (TCHAR*)mir_calloc((len + 1)*sizeof(WCHAR));
+ dat->vhs->fi->tszFormat = (wchar_t*)mir_calloc((len + 1)*sizeof(WCHAR));
SendMessage(hwndDlg, VARM_GETINPUTTEXT, (WPARAM)len + 1, (LPARAM)dat->vhs->fi->tszFormat);
}
else {
@@ -922,9 +922,9 @@ static INT_PTR CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM l
if (dat->vhs->hwndCtrl != NULL) {
int len = SendMessage(hwndDlg, VARM_GETINPUTTEXTLENGTH, 0, 0);
if (len > 0) {
- TCHAR *tszText;
+ wchar_t *tszText;
- tszText = (TCHAR*)mir_calloc((len + 1)*sizeof(TCHAR));
+ tszText = (wchar_t*)mir_calloc((len + 1)*sizeof(wchar_t));
if (tszText != NULL) {
SendMessage(hwndDlg, VARM_GETINPUTTEXT, (WPARAM)len + 1, (LPARAM)tszText);
SetWindowText(dat->vhs->hwndCtrl, tszText);
@@ -942,7 +942,7 @@ static INT_PTR CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM l
int len = SendMessage(hwndDlg, VARM_GETEXTRATEXTLENGTH, 0, 0);
if (len > 0) {
if (dat->vhs->fi->flags&FIF_UNICODE) {
- dat->vhs->fi->tszExtraText = (TCHAR*)mir_calloc((len + 1)*sizeof(WCHAR));
+ dat->vhs->fi->tszExtraText = (wchar_t*)mir_calloc((len + 1)*sizeof(WCHAR));
SendMessage(hwndDlg, VARM_GETEXTRATEXT, (WPARAM)len + 1, (LPARAM)dat->vhs->fi->tszExtraText);
}
else {
diff --git a/plugins/Variables/src/options.cpp b/plugins/Variables/src/options.cpp
index bb381ef238..d07ad89999 100644
--- a/plugins/Variables/src/options.cpp
+++ b/plugins/Variables/src/options.cpp
@@ -85,7 +85,7 @@ static INT_PTR CALLBACK SetOptsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA
if (((LPNMHDR)lParam)->code == PSN_APPLY) {
int len = SendDlgItemMessage(hwndDlg, IDC_FORMATTEXT, WM_GETTEXTLENGTH, 0, 0);
if (len >= 0) {
- TCHAR *szFormatText = (TCHAR*)mir_calloc((len+1)* sizeof(TCHAR));
+ wchar_t *szFormatText = (wchar_t*)mir_calloc((len+1)* sizeof(wchar_t));
if (szFormatText == NULL)
break;
@@ -103,9 +103,9 @@ static INT_PTR CALLBACK SetOptsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA
case VARM_PARSE:
{
- TCHAR *string = Hlp_GetDlgItemText(hwndDlg, IDC_FORMATTEXT);
+ wchar_t *string = Hlp_GetDlgItemText(hwndDlg, IDC_FORMATTEXT);
if (string != NULL) {
- TCHAR *newString = variables_parsedup(string, NULL, NULL);
+ wchar_t *newString = variables_parsedup(string, NULL, NULL);
if (newString != NULL) {
SetDlgItemText(hwndDlg, IDC_RESULT, newString);
mir_free(newString);
diff --git a/plugins/Variables/src/parse_alias.cpp b/plugins/Variables/src/parse_alias.cpp
index 9a29840a18..8f7ccd9f2e 100644
--- a/plugins/Variables/src/parse_alias.cpp
+++ b/plugins/Variables/src/parse_alias.cpp
@@ -21,16 +21,16 @@
struct ALIASREGISTER
{
- TCHAR *szAlias;
+ wchar_t *szAlias;
unsigned int argc;
- TCHAR **argv;
- TCHAR *szTranslation;
+ wchar_t **argv;
+ wchar_t *szTranslation;
};
static LIST<ALIASREGISTER> arAliases(5);
static mir_cs csAliasRegister;
-static ALIASREGISTER* searchAliasRegister(TCHAR *szAlias)
+static ALIASREGISTER* searchAliasRegister(wchar_t *szAlias)
{
if (szAlias == NULL || *szAlias == 0)
return NULL;
@@ -43,7 +43,7 @@ static ALIASREGISTER* searchAliasRegister(TCHAR *szAlias)
return NULL;
}
-static TCHAR *replaceArguments(TCHAR *res, TCHAR *tArg, TCHAR *rArg)
+static wchar_t *replaceArguments(wchar_t *res, wchar_t *tArg, wchar_t *rArg)
{
if (mir_tstrlen(tArg) == 0)
return res;
@@ -55,14 +55,14 @@ static TCHAR *replaceArguments(TCHAR *res, TCHAR *tArg, TCHAR *rArg)
while ((*(res + ecur) != ')') && (*(res + ecur) != ','))
ecur++;
- if (((signed int)mir_tstrlen(tArg) == (ecur - cur)) && (!_tcsncmp(tArg, res + cur, mir_tstrlen(tArg)))) {
+ if (((signed int)mir_tstrlen(tArg) == (ecur - cur)) && (!wcsncmp(tArg, res + cur, mir_tstrlen(tArg)))) {
if (mir_tstrlen(rArg) > mir_tstrlen(tArg)) {
- res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + (mir_tstrlen(rArg) - mir_tstrlen(tArg)) + 1)*sizeof(TCHAR));
+ res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + (mir_tstrlen(rArg) - mir_tstrlen(tArg)) + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
}
- memmove(res + ecur + (mir_tstrlen(rArg) - mir_tstrlen(tArg)), res + ecur, (mir_tstrlen(res + ecur) + 1)*sizeof(TCHAR));
- _tcsncpy(res + cur, rArg, mir_tstrlen(rArg));
+ memmove(res + ecur + (mir_tstrlen(rArg) - mir_tstrlen(tArg)), res + ecur, (mir_tstrlen(res + ecur) + 1)*sizeof(wchar_t));
+ wcsncpy(res + cur, rArg, mir_tstrlen(rArg));
}
}
cur++;
@@ -71,13 +71,13 @@ static TCHAR *replaceArguments(TCHAR *res, TCHAR *tArg, TCHAR *rArg)
return res;
}
-static TCHAR *parseTranslateAlias(ARGUMENTSINFO *ai)
+static wchar_t *parseTranslateAlias(ARGUMENTSINFO *ai)
{
ALIASREGISTER *areg = searchAliasRegister(ai->targv[0]);
if (areg == NULL || areg->argc != ai->argc - 1)
return NULL;
- TCHAR *res = mir_tstrdup(areg->szTranslation);
+ wchar_t *res = mir_tstrdup(areg->szTranslation);
for (unsigned i = 0; i < areg->argc; i++) {
res = replaceArguments(res, areg->argv[i], ai->targv[i + 1]);
if (res == NULL)
@@ -87,7 +87,7 @@ static TCHAR *parseTranslateAlias(ARGUMENTSINFO *ai)
return res;
}
-static int addToAliasRegister(TCHAR *szAlias, unsigned int argc, TCHAR** argv, TCHAR *szTranslation)
+static int addToAliasRegister(wchar_t *szAlias, unsigned int argc, wchar_t** argv, wchar_t *szTranslation)
{
if (szAlias == NULL || szTranslation == NULL || mir_tstrlen(szAlias) == 0)
return -1;
@@ -104,7 +104,7 @@ static int addToAliasRegister(TCHAR *szAlias, unsigned int argc, TCHAR** argv, T
mir_free(p->argv[j]);
p->argc = argc;
- p->argv = (TCHAR**)mir_realloc(p->argv, argc * sizeof(TCHAR*));
+ p->argv = (wchar_t**)mir_realloc(p->argv, argc * sizeof(wchar_t*));
if (p->argv == NULL)
return -1;
@@ -116,7 +116,7 @@ static int addToAliasRegister(TCHAR *szAlias, unsigned int argc, TCHAR** argv, T
}
return 0;
}
- TCHAR **pargv = (TCHAR**)mir_alloc(argc * sizeof(TCHAR*));
+ wchar_t **pargv = (wchar_t**)mir_alloc(argc * sizeof(wchar_t*));
if (pargv == NULL)
return -1;
@@ -136,13 +136,13 @@ static int addToAliasRegister(TCHAR *szAlias, unsigned int argc, TCHAR** argv, T
return 0;
}
-static TCHAR *parseAddAlias(ARGUMENTSINFO *ai)
+static wchar_t *parseAddAlias(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
char *szHelp, *szArgsA;
- TCHAR *cur = ai->targv[1];
+ wchar_t *cur = ai->targv[1];
while (isValidTokenChar(*cur))
cur++;
@@ -153,12 +153,12 @@ static TCHAR *parseAddAlias(ARGUMENTSINFO *ai)
deRegisterToken(alias);
addToAliasRegister(alias, argv.getCount(), argv.getArray(), ai->targv[2]);
- TCHAR *szArgs = NULL;
+ wchar_t *szArgs = NULL;
for (int i = 0; i < argv.getCount(); i++) {
if (i == 0)
- szArgs = (TCHAR*)mir_calloc((mir_tstrlen(argv[i]) + 2)*sizeof(TCHAR));
+ szArgs = (wchar_t*)mir_calloc((mir_tstrlen(argv[i]) + 2)*sizeof(wchar_t));
else
- szArgs = (TCHAR*)mir_realloc(szArgs, (mir_tstrlen(szArgs) + mir_tstrlen(argv[i]) + 2)*sizeof(TCHAR));
+ szArgs = (wchar_t*)mir_realloc(szArgs, (mir_tstrlen(szArgs) + mir_tstrlen(argv[i]) + 2)*sizeof(wchar_t));
mir_tstrcat(szArgs, argv[i]);
if (i != argv.getCount() - 1)
diff --git a/plugins/Variables/src/parse_alias.h b/plugins/Variables/src/parse_alias.h
index 5876367aad..8cec5ded4f 100644
--- a/plugins/Variables/src/parse_alias.h
+++ b/plugins/Variables/src/parse_alias.h
@@ -19,12 +19,12 @@
#define ADDALIAS L"alias"
-int isValidTokenChar(TCHAR tc);
+int isValidTokenChar(wchar_t tc);
-struct TArgList : public LIST<TCHAR>
+struct TArgList : public LIST<wchar_t>
{
TArgList() :
- LIST<TCHAR>(1)
+ LIST<wchar_t>(1)
{}
void destroy()
@@ -35,4 +35,4 @@ struct TArgList : public LIST<TCHAR>
}
};
-TCHAR* getArguments(TCHAR *string, TArgList &aargv);
+wchar_t* getArguments(wchar_t *string, TArgList &aargv);
diff --git a/plugins/Variables/src/parse_external.cpp b/plugins/Variables/src/parse_external.cpp
index 4dca2905f2..873be4f90b 100644
--- a/plugins/Variables/src/parse_external.cpp
+++ b/plugins/Variables/src/parse_external.cpp
@@ -19,7 +19,7 @@
#include "stdafx.h"
-static TCHAR *getFullWinampTitleText()
+static wchar_t *getFullWinampTitleText()
{
HWND hwndWinamp = FindWindow(L"STUDIO", NULL);
if (hwndWinamp == NULL)
@@ -29,7 +29,7 @@ static TCHAR *getFullWinampTitleText()
return NULL;
SIZE_T dwWinTextLength = (GetWindowTextLength(hwndWinamp) + 1);
- TCHAR *szWinText = (TCHAR*)mir_alloc(dwWinTextLength * sizeof(TCHAR));
+ wchar_t *szWinText = (wchar_t*)mir_alloc(dwWinTextLength * sizeof(wchar_t));
if (szWinText == NULL)
return NULL;
@@ -37,7 +37,7 @@ static TCHAR *getFullWinampTitleText()
mir_free(szWinText);
return NULL;
}
- TCHAR *szTitle = (TCHAR*)mir_alloc((2 * mir_tstrlen(szWinText) + 1)*sizeof(TCHAR));
+ wchar_t *szTitle = (wchar_t*)mir_alloc((2 * mir_tstrlen(szWinText) + 1)*sizeof(wchar_t));
if (szTitle == NULL) {
mir_free(szWinText);
return NULL;
@@ -49,19 +49,19 @@ static TCHAR *getFullWinampTitleText()
return szTitle;
}
-static TCHAR *parseWinampSong(ARGUMENTSINFO *ai)
+static wchar_t *parseWinampSong(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
- TCHAR *res = NULL;
- TCHAR *szTitle = getFullWinampTitleText();
+ wchar_t *res = NULL;
+ wchar_t *szTitle = getFullWinampTitleText();
if (szTitle == NULL)
return NULL;
- TCHAR *scur = _tcschr(szTitle, '.');
- TCHAR *cur;
- if ((scur == NULL) || ((cur = _tcsstr(scur, L" - Winamp")) == NULL) || (scur >= cur) || (scur > (szTitle + mir_tstrlen(szTitle) - 2)) || (cur > (szTitle + mir_tstrlen(szTitle)))) {
+ wchar_t *scur = wcschr(szTitle, '.');
+ wchar_t *cur;
+ if ((scur == NULL) || ((cur = wcsstr(scur, L" - Winamp")) == NULL) || (scur >= cur) || (scur > (szTitle + mir_tstrlen(szTitle) - 2)) || (cur > (szTitle + mir_tstrlen(szTitle)))) {
mir_free(szTitle);
return NULL;
}
@@ -75,23 +75,23 @@ static TCHAR *parseWinampSong(ARGUMENTSINFO *ai)
return res;
}
-static TCHAR *parseWinampState(ARGUMENTSINFO *ai)
+static wchar_t *parseWinampState(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
- TCHAR *res = NULL;
- TCHAR *szTitle = getFullWinampTitleText();
+ wchar_t *res = NULL;
+ wchar_t *szTitle = getFullWinampTitleText();
if (szTitle == NULL)
return NULL;
- TCHAR *scur = _tcschr(szTitle, '.');
- TCHAR *cur;
- if (scur == NULL || (cur = _tcsstr(scur, L" - Winamp")) == NULL)
+ wchar_t *scur = wcschr(szTitle, '.');
+ wchar_t *cur;
+ if (scur == NULL || (cur = wcsstr(scur, L" - Winamp")) == NULL)
res = mir_tstrdup(TranslateT("Stopped"));
- else if ((!_tcsncmp(cur + 10, L"[Stopped]", 9)))
+ else if ((!wcsncmp(cur + 10, L"[Stopped]", 9)))
res = mir_tstrdup(TranslateT("Stopped"));
- else if ((!_tcsncmp(cur + 10, L"[Paused]", 8)))
+ else if ((!wcsncmp(cur + 10, L"[Paused]", 8)))
res = mir_tstrdup(TranslateT("Paused"));
else
res = mir_tstrdup(L"Playing");
diff --git a/plugins/Variables/src/parse_inet.cpp b/plugins/Variables/src/parse_inet.cpp
index 59d3cc4ce8..58c96df015 100644
--- a/plugins/Variables/src/parse_inet.cpp
+++ b/plugins/Variables/src/parse_inet.cpp
@@ -19,7 +19,7 @@
#include "stdafx.h"
-static TCHAR *parseUrlEnc(ARGUMENTSINFO *ai)
+static wchar_t *parseUrlEnc(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -45,12 +45,12 @@ static TCHAR *parseUrlEnc(ARGUMENTSINFO *ai)
cur += mir_strlen(hex);
}
- TCHAR *tres = mir_a2t(res);
+ wchar_t *tres = mir_a2t(res);
mir_free(res);
return tres;
}
-static TCHAR *parseUrlDec(ARGUMENTSINFO *ai)
+static wchar_t *parseUrlDec(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -72,12 +72,12 @@ static TCHAR *parseUrlDec(ARGUMENTSINFO *ai)
}
res = (char*)mir_realloc(res, mir_strlen(res) + 1);
- TCHAR *tres = mir_a2t(res);
+ wchar_t *tres = mir_a2t(res);
mir_free(res);
return tres;
}
-static TCHAR *parseNToA(ARGUMENTSINFO *ai)
+static wchar_t *parseNToA(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -87,7 +87,7 @@ static TCHAR *parseNToA(ARGUMENTSINFO *ai)
return mir_a2t(inet_ntoa(in));
}
-static TCHAR *parseHToA(ARGUMENTSINFO *ai)
+static wchar_t *parseHToA(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
diff --git a/plugins/Variables/src/parse_logic.cpp b/plugins/Variables/src/parse_logic.cpp
index c06d8445a9..763136f821 100644
--- a/plugins/Variables/src/parse_logic.cpp
+++ b/plugins/Variables/src/parse_logic.cpp
@@ -19,7 +19,7 @@
#include "stdafx.h"
-static TCHAR *parseAnd(ARGUMENTSINFO *ai)
+static wchar_t *parseAnd(ARGUMENTSINFO *ai)
{
if (ai->argc < 3)
return NULL;
@@ -39,7 +39,7 @@ static TCHAR *parseAnd(ARGUMENTSINFO *ai)
return mir_tstrdup(L"");
}
-static TCHAR *parseFalse(ARGUMENTSINFO *ai)
+static wchar_t *parseFalse(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
@@ -48,7 +48,7 @@ static TCHAR *parseFalse(ARGUMENTSINFO *ai)
return mir_tstrdup(L"");
}
-static TCHAR *parseIf(ARGUMENTSINFO *ai)
+static wchar_t *parseIf(ARGUMENTSINFO *ai)
{
if (ai->argc != 4)
return NULL;
@@ -62,7 +62,7 @@ static TCHAR *parseIf(ARGUMENTSINFO *ai)
return mir_tstrdup((fi.eCount == 0) ? ai->targv[2] : ai->targv[3]);
}
-static TCHAR *parseIf2(ARGUMENTSINFO *ai)
+static wchar_t *parseIf2(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -71,7 +71,7 @@ static TCHAR *parseIf2(ARGUMENTSINFO *ai)
memcpy(&fi, ai->fi, sizeof(fi));
fi.eCount = fi.pCount = 0;
fi.tszFormat = ai->targv[1];
- TCHAR *szCondition = formatString(&fi);
+ wchar_t *szCondition = formatString(&fi);
if (fi.eCount == 0)
return szCondition;
@@ -79,14 +79,14 @@ static TCHAR *parseIf2(ARGUMENTSINFO *ai)
return mir_tstrdup(ai->targv[2]);
}
-static TCHAR *parseIf3(ARGUMENTSINFO *ai)
+static wchar_t *parseIf3(ARGUMENTSINFO *ai)
{
FORMATINFO fi;
memcpy(&fi, ai->fi, sizeof(fi));
for (unsigned i = 1; i < ai->argc; i++) {
fi.eCount = fi.pCount = 0;
fi.tszFormat = ai->targv[i];
- TCHAR *szCondition = formatString(&fi);
+ wchar_t *szCondition = formatString(&fi);
if (fi.eCount == 0)
return szCondition;
@@ -96,7 +96,7 @@ static TCHAR *parseIf3(ARGUMENTSINFO *ai)
return NULL;
}
-static TCHAR *parseIfequal(ARGUMENTSINFO *ai)
+static wchar_t *parseIfequal(ARGUMENTSINFO *ai)
{
if (ai->argc != 5)
return NULL;
@@ -116,7 +116,7 @@ static TCHAR *parseIfequal(ARGUMENTSINFO *ai)
return mir_tstrdup(ai->targv[4]);
}
-static TCHAR *parseIfgreater(ARGUMENTSINFO *ai)
+static wchar_t *parseIfgreater(ARGUMENTSINFO *ai)
{
if (ai->argc != 5)
return NULL;
@@ -136,7 +136,7 @@ static TCHAR *parseIfgreater(ARGUMENTSINFO *ai)
return mir_tstrdup(ai->targv[4]);
}
-static TCHAR *parseIflonger(ARGUMENTSINFO *ai)
+static wchar_t *parseIflonger(ARGUMENTSINFO *ai)
{
if (ai->argc != 5)
return NULL;
@@ -161,12 +161,12 @@ static TCHAR *parseIflonger(ARGUMENTSINFO *ai)
?for(init, cond, incr, show)
*/
-static TCHAR *parseFor(ARGUMENTSINFO *ai)
+static wchar_t *parseFor(ARGUMENTSINFO *ai)
{
if (ai->argc != 5)
return NULL;
- TCHAR *res = mir_tstrdup(L"");
+ wchar_t *res = mir_tstrdup(L"");
FORMATINFO fi;
memcpy(&fi, ai->fi, sizeof(fi));
@@ -177,16 +177,16 @@ static TCHAR *parseFor(ARGUMENTSINFO *ai)
mir_free(formatString(&fi));
while (fi.eCount == 0) {
fi.tszFormat = ai->targv[4];
- TCHAR *parsed = formatString(&fi);
+ wchar_t *parsed = formatString(&fi);
if (parsed != NULL) {
if (res == NULL) {
- res = (TCHAR*)mir_alloc(mir_tstrlen(parsed) + 1 * sizeof(TCHAR));
+ res = (wchar_t*)mir_alloc(mir_tstrlen(parsed) + 1 * sizeof(wchar_t));
if (res == NULL) {
mir_free(parsed);
return NULL;
}
}
- else res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(parsed) + 1)*sizeof(TCHAR));
+ else res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(parsed) + 1)*sizeof(wchar_t));
mir_tstrcat(res, parsed);
mir_free(parsed);
@@ -201,7 +201,7 @@ static TCHAR *parseFor(ARGUMENTSINFO *ai)
return res;
}
-static TCHAR *parseEqual(ARGUMENTSINFO *ai)
+static wchar_t *parseEqual(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -212,7 +212,7 @@ static TCHAR *parseEqual(ARGUMENTSINFO *ai)
return mir_tstrdup(L"");
}
-static TCHAR *parseGreater(ARGUMENTSINFO *ai)
+static wchar_t *parseGreater(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -223,7 +223,7 @@ static TCHAR *parseGreater(ARGUMENTSINFO *ai)
return mir_tstrdup(L"");
}
-static TCHAR *parseLonger(ARGUMENTSINFO *ai)
+static wchar_t *parseLonger(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -234,7 +234,7 @@ static TCHAR *parseLonger(ARGUMENTSINFO *ai)
return mir_tstrdup(L"");
}
-static TCHAR *parseNot(ARGUMENTSINFO *ai)
+static wchar_t *parseNot(ARGUMENTSINFO *ai)
{
if (ai->argc != 2) {
return NULL;
@@ -251,7 +251,7 @@ static TCHAR *parseNot(ARGUMENTSINFO *ai)
return mir_tstrdup(L"");
}
-static TCHAR *parseOr(ARGUMENTSINFO *ai)
+static wchar_t *parseOr(ARGUMENTSINFO *ai)
{
if (ai->argc < 2)
return NULL;
@@ -271,12 +271,12 @@ static TCHAR *parseOr(ARGUMENTSINFO *ai)
return mir_tstrdup(L"");
}
-static TCHAR *parseTrue(ARGUMENTSINFO *ai)
+static wchar_t *parseTrue(ARGUMENTSINFO *ai)
{
return (ai->argc != 1) ? NULL : mir_tstrdup(L"");
}
-static TCHAR *parseXor(ARGUMENTSINFO *ai)
+static wchar_t *parseXor(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
diff --git a/plugins/Variables/src/parse_math.cpp b/plugins/Variables/src/parse_math.cpp
index 0e65e29da2..a9946d8a7a 100644
--- a/plugins/Variables/src/parse_math.cpp
+++ b/plugins/Variables/src/parse_math.cpp
@@ -19,7 +19,7 @@
#include "stdafx.h"
-static TCHAR *parseAdd(ARGUMENTSINFO *ai)
+static wchar_t *parseAdd(ARGUMENTSINFO *ai)
{
if (ai->argc < 3)
return NULL;
@@ -31,7 +31,7 @@ static TCHAR *parseAdd(ARGUMENTSINFO *ai)
return itot(result);
}
-static TCHAR *parseDiv(ARGUMENTSINFO *ai)
+static wchar_t *parseDiv(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -44,10 +44,10 @@ static TCHAR *parseDiv(ARGUMENTSINFO *ai)
return itot(val1 / val2);
}
-static TCHAR *parseHex(ARGUMENTSINFO *ai)
+static wchar_t *parseHex(ARGUMENTSINFO *ai)
{
unsigned int i;
- TCHAR szVal[34];
+ wchar_t szVal[34];
if (ai->argc != 3)
return NULL;
@@ -56,11 +56,11 @@ static TCHAR *parseHex(ARGUMENTSINFO *ai)
int padding = ttoi(ai->targv[2]);
mir_sntprintf(szVal, L"%x", val);
unsigned int zeros = max(padding - (signed int)mir_tstrlen(szVal), 0);
- TCHAR *res = (TCHAR*)mir_alloc((zeros + mir_tstrlen(szVal) + 3)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((zeros + mir_tstrlen(szVal) + 3)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((zeros + mir_tstrlen(szVal) + 3) * sizeof(TCHAR)));
+ memset(res, 0, ((zeros + mir_tstrlen(szVal) + 3) * sizeof(wchar_t)));
mir_tstrcpy(res, L"0x");
for (i = 0; i < zeros; i++)
*(res + 2 + i) = '0';
@@ -69,7 +69,7 @@ static TCHAR *parseHex(ARGUMENTSINFO *ai)
return res;
}
-static TCHAR *parseMod(ARGUMENTSINFO *ai)
+static wchar_t *parseMod(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -82,7 +82,7 @@ static TCHAR *parseMod(ARGUMENTSINFO *ai)
return itot(val1 % val2);
}
-static TCHAR *parseMul(ARGUMENTSINFO *ai)
+static wchar_t *parseMul(ARGUMENTSINFO *ai)
{
if (ai->argc < 3)
return NULL;
@@ -94,7 +94,7 @@ static TCHAR *parseMul(ARGUMENTSINFO *ai)
return itot(result);
}
-static TCHAR *parseMuldiv(ARGUMENTSINFO *ai)
+static wchar_t *parseMuldiv(ARGUMENTSINFO *ai)
{
if (ai->argc != 4)
return NULL;
@@ -105,7 +105,7 @@ static TCHAR *parseMuldiv(ARGUMENTSINFO *ai)
return itot((ttoi(ai->targv[1])*ttoi(ai->targv[2])) / ttoi(ai->targv[3]));
}
-static TCHAR *parseMin(ARGUMENTSINFO *ai)
+static wchar_t *parseMin(ARGUMENTSINFO *ai)
{
if (ai->argc < 2)
return NULL;
@@ -117,7 +117,7 @@ static TCHAR *parseMin(ARGUMENTSINFO *ai)
return itot(minVal);
}
-static TCHAR *parseMax(ARGUMENTSINFO *ai)
+static wchar_t *parseMax(ARGUMENTSINFO *ai)
{
if (ai->argc < 2)
return NULL;
@@ -129,26 +129,26 @@ static TCHAR *parseMax(ARGUMENTSINFO *ai)
return itot(maxVal);
}
-static TCHAR *parseNum(ARGUMENTSINFO *ai)
+static wchar_t *parseNum(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
int val = ttoi(ai->targv[1]);
int padding = ttoi(ai->targv[2]);
- TCHAR *szVal = itot(val);
+ wchar_t *szVal = itot(val);
if (szVal == NULL)
return NULL;
unsigned zeros = max(padding - (signed int)mir_tstrlen(szVal), 0);
- TCHAR *res = (TCHAR*)mir_alloc((zeros + mir_tstrlen(szVal) + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((zeros + mir_tstrlen(szVal) + 1)*sizeof(wchar_t));
if (res == NULL) {
mir_free(szVal);
return NULL;
}
- memset(res, 0, ((zeros + mir_tstrlen(szVal) + 1) * sizeof(TCHAR)));
- TCHAR *cur = res;
+ memset(res, 0, ((zeros + mir_tstrlen(szVal) + 1) * sizeof(wchar_t)));
+ wchar_t *cur = res;
for (unsigned i = 0; i < zeros; i++)
*cur++ = '0';
@@ -158,12 +158,12 @@ static TCHAR *parseNum(ARGUMENTSINFO *ai)
return res;
}
-static TCHAR *parseRand(ARGUMENTSINFO *)
+static wchar_t *parseRand(ARGUMENTSINFO *)
{
return itot(rand());
}
-static TCHAR *parseSub(ARGUMENTSINFO *ai)
+static wchar_t *parseSub(ARGUMENTSINFO *ai)
{
if (ai->argc < 3)
return NULL;
diff --git a/plugins/Variables/src/parse_metacontacts.cpp b/plugins/Variables/src/parse_metacontacts.cpp
index 71ab1c08a6..ac1185edb3 100644
--- a/plugins/Variables/src/parse_metacontacts.cpp
+++ b/plugins/Variables/src/parse_metacontacts.cpp
@@ -19,7 +19,7 @@
#include "stdafx.h"
-static TCHAR *parseGetParent(ARGUMENTSINFO *ai)
+static wchar_t *parseGetParent(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -39,7 +39,7 @@ static TCHAR *parseGetParent(ARGUMENTSINFO *ai)
if (szUniqueID == NULL) {
szProto = PROTOID_HANDLE;
- TCHAR tszID[40];
+ wchar_t tszID[40];
mir_sntprintf(tszID, L"%p", hContact);
szUniqueID = mir_tstrdup(tszID);
}
@@ -47,7 +47,7 @@ static TCHAR *parseGetParent(ARGUMENTSINFO *ai)
return CMString(FORMAT, L"<%S:%s>", szProto, szUniqueID).Detach();
}
-static TCHAR *parseGetDefault(ARGUMENTSINFO *ai)
+static wchar_t *parseGetDefault(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -67,7 +67,7 @@ static TCHAR *parseGetDefault(ARGUMENTSINFO *ai)
if (szUniqueID == NULL) {
szProto = PROTOID_HANDLE;
- TCHAR tszID[40];
+ wchar_t tszID[40];
mir_sntprintf(tszID, L"%p", hContact);
szUniqueID = mir_tstrdup(tszID);
}
@@ -75,7 +75,7 @@ static TCHAR *parseGetDefault(ARGUMENTSINFO *ai)
return CMString(FORMAT, L"<%S:%s>", szProto, szUniqueID).Detach();
}
-static TCHAR *parseGetMostOnline(ARGUMENTSINFO *ai)
+static wchar_t *parseGetMostOnline(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -95,7 +95,7 @@ static TCHAR *parseGetMostOnline(ARGUMENTSINFO *ai)
if (szUniqueID == NULL) {
szProto = PROTOID_HANDLE;
- TCHAR tszID[40];
+ wchar_t tszID[40];
mir_sntprintf(tszID, L"%p", hContact);
szUniqueID = mir_tstrdup(tszID);
}
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp
index 088fb00497..a25e303247 100644
--- a/plugins/Variables/src/parse_miranda.cpp
+++ b/plugins/Variables/src/parse_miranda.cpp
@@ -19,48 +19,48 @@
#include "stdafx.h"
-static TCHAR* parseCodeToStatus(ARGUMENTSINFO *ai)
+static wchar_t* parseCodeToStatus(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
unsigned int status = ttoi(ai->targv[1]);
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
if (szStatus != NULL)
return mir_tstrdup(szStatus);
return NULL;
}
-static int getContactInfoFlags(TCHAR *tszDesc)
+static int getContactInfoFlags(wchar_t *tszDesc)
{
int flags = 0;
- for (TCHAR *cur = tszDesc; (cur < (tszDesc + mir_tstrlen(tszDesc))); cur++) {
- if (!_tcsnicmp(cur, STR_PROTOID, mir_tstrlen(STR_PROTOID))) {
+ for (wchar_t *cur = tszDesc; (cur < (tszDesc + mir_tstrlen(tszDesc))); cur++) {
+ if (!wcsnicmp(cur, STR_PROTOID, mir_tstrlen(STR_PROTOID))) {
flags |= CI_PROTOID;
cur += mir_tstrlen(STR_PROTOID) - 1;
}
- else if (!_tcsnicmp(cur, STR_NICK, mir_tstrlen(STR_NICK))) {
+ else if (!wcsnicmp(cur, STR_NICK, mir_tstrlen(STR_NICK))) {
flags |= CI_NICK;
cur += mir_tstrlen(STR_NICK) - 1;
}
- else if (!_tcsnicmp(cur, STR_FIRSTNAME, mir_tstrlen(STR_FIRSTNAME))) {
+ else if (!wcsnicmp(cur, STR_FIRSTNAME, mir_tstrlen(STR_FIRSTNAME))) {
flags |= CI_FIRSTNAME;
cur += mir_tstrlen(STR_FIRSTNAME) - 1;
}
- else if (!_tcsnicmp(cur, STR_LASTNAME, mir_tstrlen(STR_LASTNAME))) {
+ else if (!wcsnicmp(cur, STR_LASTNAME, mir_tstrlen(STR_LASTNAME))) {
flags |= CI_LASTNAME;
cur += mir_tstrlen(STR_LASTNAME) - 1;
}
- else if (!_tcsnicmp(cur, STR_DISPLAY, mir_tstrlen(STR_DISPLAY))) {
+ else if (!wcsnicmp(cur, STR_DISPLAY, mir_tstrlen(STR_DISPLAY))) {
flags |= CI_LISTNAME;
cur += mir_tstrlen(STR_DISPLAY) - 1;
}
- else if (!_tcsnicmp(cur, STR_EMAIL, mir_tstrlen(STR_EMAIL))) {
+ else if (!wcsnicmp(cur, STR_EMAIL, mir_tstrlen(STR_EMAIL))) {
flags |= CI_EMAIL;
cur += mir_tstrlen(STR_EMAIL) - 1;
}
- else if (!_tcsnicmp(cur, STR_UNIQUEID, mir_tstrlen(STR_UNIQUEID))) {
+ else if (!wcsnicmp(cur, STR_UNIQUEID, mir_tstrlen(STR_UNIQUEID))) {
flags |= CI_UNIQUEID;
cur += mir_tstrlen(STR_UNIQUEID) - 1;
}
@@ -74,7 +74,7 @@ static int getContactInfoFlags(TCHAR *tszDesc)
return flags;
}
-static TCHAR* parseContact(ARGUMENTSINFO *ai)
+static wchar_t* parseContact(ARGUMENTSINFO *ai)
{
if (ai->argc < 3 || ai->argc > 4)
return NULL;
@@ -95,7 +95,7 @@ static TCHAR* parseContact(ARGUMENTSINFO *ai)
return encodeContactToString(hContact);
}
-static TCHAR* parseContactCount(ARGUMENTSINFO *ai)
+static wchar_t* parseContactCount(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -104,7 +104,7 @@ static TCHAR* parseContactCount(ARGUMENTSINFO *ai)
return itot(count);
}
-static TCHAR* parseContactInfo(ARGUMENTSINFO *ai)
+static wchar_t* parseContactInfo(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -120,37 +120,37 @@ static TCHAR* parseContactInfo(ARGUMENTSINFO *ai)
return getContactInfoT(type, hContact);
}
-static TCHAR* parseDBProfileName(ARGUMENTSINFO *ai)
+static wchar_t* parseDBProfileName(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
- TCHAR name[MAX_PATH];
+ wchar_t name[MAX_PATH];
if (CallService(MS_DB_GETPROFILENAMET, _countof(name), (LPARAM)name))
return NULL;
return mir_tstrdup(name);
}
-static TCHAR* parseDBProfilePath(ARGUMENTSINFO *ai)
+static wchar_t* parseDBProfilePath(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
if (CallService(MS_DB_GETPROFILEPATHT, _countof(path), (LPARAM)path))
return NULL;
return mir_tstrdup(path);
}
-static TCHAR* getDBSetting(MCONTACT hContact, char* module, char* setting, TCHAR* defaultValue)
+static wchar_t* getDBSetting(MCONTACT hContact, char* module, char* setting, wchar_t* defaultValue)
{
DBVARIANT dbv;
if (db_get_s(hContact, module, setting, &dbv, 0))
return defaultValue;
- TCHAR *var = NULL;
+ wchar_t *var = NULL;
switch (dbv.type) {
case DBVT_BYTE:
var = itot(dbv.bVal);
@@ -176,7 +176,7 @@ static TCHAR* getDBSetting(MCONTACT hContact, char* module, char* setting, TCHAR
return var;
}
-static TCHAR* parseDBSetting(ARGUMENTSINFO *ai)
+static wchar_t* parseDBSetting(ARGUMENTSINFO *ai)
{
if (ai->argc < 4)
return NULL;
@@ -198,15 +198,15 @@ static TCHAR* parseDBSetting(ARGUMENTSINFO *ai)
return NULL;
}
- TCHAR *szDefaultValue = ((ai->argc > 4 && mir_tstrlen(ai->targv[4]) > 0) ? mir_tstrdup(ai->targv[4]) : NULL);
- TCHAR *res = getDBSetting(hContact, szModule, szSetting, szDefaultValue);
+ wchar_t *szDefaultValue = ((ai->argc > 4 && mir_tstrlen(ai->targv[4]) > 0) ? mir_tstrdup(ai->targv[4]) : NULL);
+ wchar_t *res = getDBSetting(hContact, szModule, szSetting, szDefaultValue);
mir_free(szDefaultValue);
mir_free(szSetting);
mir_free(szModule);
return res;
}
-static TCHAR* parseLastSeenDate(ARGUMENTSINFO *ai)
+static wchar_t* parseLastSeenDate(ARGUMENTSINFO *ai)
{
if (ai->argc <= 1)
return NULL;
@@ -215,7 +215,7 @@ static TCHAR* parseLastSeenDate(ARGUMENTSINFO *ai)
if (hContact == INVALID_CONTACT_ID)
return NULL;
- TCHAR *szFormat;
+ wchar_t *szFormat;
if (ai->argc == 2 || (ai->argc > 2 && mir_tstrlen(ai->targv[2]) == 0))
szFormat = NULL;
else
@@ -236,7 +236,7 @@ static TCHAR* parseLastSeenDate(ARGUMENTSINFO *ai)
lsTime.wMonth = db_get_w(hContact, szModule, "Month", 0);
int len = GetDateFormat(LOCALE_USER_DEFAULT, 0, &lsTime, szFormat, NULL, 0);
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
@@ -248,7 +248,7 @@ static TCHAR* parseLastSeenDate(ARGUMENTSINFO *ai)
return res;
}
-static TCHAR* parseLastSeenTime(ARGUMENTSINFO *ai)
+static wchar_t* parseLastSeenTime(ARGUMENTSINFO *ai)
{
if (ai->argc <= 1)
return NULL;
@@ -257,7 +257,7 @@ static TCHAR* parseLastSeenTime(ARGUMENTSINFO *ai)
if (hContact == INVALID_CONTACT_ID)
return NULL;
- TCHAR *szFormat;
+ wchar_t *szFormat;
if (ai->argc == 2 || (ai->argc > 2 && mir_tstrlen(ai->targv[2]) == 0))
szFormat = NULL;
else
@@ -279,7 +279,7 @@ static TCHAR* parseLastSeenTime(ARGUMENTSINFO *ai)
lsTime.wYear = db_get_w(hContact, szModule, "Year", 0);
int len = GetTimeFormat(LOCALE_USER_DEFAULT, 0, &lsTime, szFormat, NULL, 0);
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
@@ -291,7 +291,7 @@ static TCHAR* parseLastSeenTime(ARGUMENTSINFO *ai)
return res;
}
-static TCHAR* parseLastSeenStatus(ARGUMENTSINFO *ai)
+static wchar_t* parseLastSeenStatus(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -305,27 +305,27 @@ static TCHAR* parseLastSeenStatus(ARGUMENTSINFO *ai)
if (status == 0)
return NULL;
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
if (szStatus != NULL)
return mir_tstrdup(szStatus);
return NULL;
}
-static TCHAR* parseMirandaPath(ARGUMENTSINFO *ai)
+static wchar_t* parseMirandaPath(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
ai->flags |= AIF_DONTPARSE;
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
if (GetModuleFileName(NULL, path, _countof(path)) == 0)
return NULL;
return mir_tstrdup(path);
}
-static TCHAR* parseMyStatus(ARGUMENTSINFO *ai)
+static wchar_t* parseMyStatus(ARGUMENTSINFO *ai)
{
if (ai->argc > 2)
return NULL;
@@ -336,17 +336,17 @@ static TCHAR* parseMyStatus(ARGUMENTSINFO *ai)
else
status = CallProtoService(_T2A(ai->targv[1]), PS_GETSTATUS, 0, 0);
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
return (szStatus != NULL) ? mir_tstrdup(szStatus) : NULL;
}
-static TCHAR* parseProtoInfo(ARGUMENTSINFO *ai)
+static wchar_t* parseProtoInfo(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
char *szRes = NULL;
- TCHAR *tszRes = NULL;
+ wchar_t *tszRes = NULL;
ptrA szProto(mir_t2a(ai->targv[1]));
if (!mir_tstrcmp(ai->targv[2], _T(STR_PINAME)))
@@ -373,7 +373,7 @@ static TCHAR* parseProtoInfo(ARGUMENTSINFO *ai)
return tszRes;
}
-static TCHAR* parseSpecialContact(ARGUMENTSINFO *ai)
+static wchar_t* parseSpecialContact(ARGUMENTSINFO *ai)
{
if (ai->argc != 1 || ai->fi->hContact == NULL)
return NULL;
@@ -386,7 +386,7 @@ static TCHAR* parseSpecialContact(ARGUMENTSINFO *ai)
if (szUniqueID == NULL) {
szProto = PROTOID_HANDLE;
- szUniqueID = (TCHAR*)mir_alloc(40);
+ szUniqueID = (wchar_t*)mir_alloc(40);
if (szUniqueID == NULL)
return NULL;
mir_sntprintf(szUniqueID, 20, L"%p", ai->fi->hContact);
@@ -526,7 +526,7 @@ static MEVENT findDbEvent(MCONTACT hContact, MEVENT hDbEvent, int flags)
}
// ?message(%subject%,last|first,sent|recv,read|unread)
-static TCHAR* parseDbEvent(ARGUMENTSINFO *ai)
+static wchar_t* parseDbEvent(ARGUMENTSINFO *ai)
{
if (ai->argc != 5)
return NULL;
@@ -579,21 +579,21 @@ static TCHAR* parseDbEvent(ARGUMENTSINFO *ai)
return NULL;
}
- TCHAR *res = DbGetEventTextT(&dbe, CP_ACP);
+ wchar_t *res = DbGetEventTextT(&dbe, CP_ACP);
mir_free(dbe.pBlob);
return res;
}
-static TCHAR* parseTranslate(ARGUMENTSINFO *ai)
+static wchar_t* parseTranslate(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
- TCHAR *res = TranslateTS(ai->targv[1]);
+ wchar_t *res = TranslateTS(ai->targv[1]);
return (res == NULL) ? NULL : mir_tstrdup(res);
}
-static TCHAR* parseVersionString(ARGUMENTSINFO *ai)
+static wchar_t* parseVersionString(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
@@ -606,40 +606,40 @@ static TCHAR* parseVersionString(ARGUMENTSINFO *ai)
return mir_a2t(versionString);
}
-static TCHAR *parseContactNameString(ARGUMENTSINFO *ai)
+static wchar_t *parseContactNameString(ARGUMENTSINFO *ai)
{
if (ai->argc != 1 || ai->fi->hContact == NULL)
return NULL;
ai->flags |= AIF_DONTPARSE;
- TCHAR *ret = (TCHAR*)pcli->pfnGetContactDisplayName(ai->fi->hContact, 0);
+ wchar_t *ret = (wchar_t*)pcli->pfnGetContactDisplayName(ai->fi->hContact, 0);
return (ret == NULL) ? NULL : mir_tstrdup(ret);
}
-static TCHAR *parseMirDateString(ARGUMENTSINFO *ai)
+static wchar_t *parseMirDateString(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
ai->flags |= AIF_DONTPARSE;
- TCHAR ret[128];
+ wchar_t ret[128];
return mir_tstrdup(TimeZone_ToStringT(time(NULL), L"d s", ret, _countof(ret)));
}
-static TCHAR *parseMirandaCoreVar(ARGUMENTSINFO *ai)
+static wchar_t *parseMirandaCoreVar(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
ai->flags |= AIF_DONTPARSE;
- TCHAR corevar[MAX_PATH];
+ wchar_t corevar[MAX_PATH];
mir_sntprintf(corevar, L"%%%s%%", ai->targv[0]);
return Utils_ReplaceVarsT(corevar);
}
-static TCHAR *parseMirSrvExists(ARGUMENTSINFO *ai)
+static wchar_t *parseMirSrvExists(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
diff --git a/plugins/Variables/src/parse_regexp.cpp b/plugins/Variables/src/parse_regexp.cpp
index f3e968ddb2..f5cb3c6ba8 100644
--- a/plugins/Variables/src/parse_regexp.cpp
+++ b/plugins/Variables/src/parse_regexp.cpp
@@ -22,7 +22,7 @@
/*
pattern, subject
*/
-static TCHAR *parseRegExpCheck(ARGUMENTSINFO *ai)
+static wchar_t *parseRegExpCheck(ARGUMENTSINFO *ai)
{
const char *err;
int erroffset;
@@ -52,17 +52,17 @@ static TCHAR *parseRegExpCheck(ARGUMENTSINFO *ai)
/*
pattern, subject, substring no (== PCRE string no (starting at 0))
*/
-static TCHAR *parseRegExpSubstr(ARGUMENTSINFO *ai)
+static wchar_t *parseRegExpSubstr(ARGUMENTSINFO *ai)
{
const char *err;
- const TCHAR *substring;
+ const wchar_t *substring;
int erroffset, number;
int offsets[99];
if (ai->argc != 4)
return NULL;
- number = _ttoi(ai->targv[3]);
+ number = _wtoi(ai->targv[3]);
if (number < 0)
return NULL;
@@ -79,7 +79,7 @@ static TCHAR *parseRegExpSubstr(ARGUMENTSINFO *ai)
if (pcre16_get_substring(ai->targv[2], offsets, nmat, number, &substring) < 0)
ai->flags |= AIF_FALSE;
else {
- TCHAR *tres = mir_tstrdup(substring);
+ wchar_t *tres = mir_tstrdup(substring);
pcre16_free_substring(substring);
return tres;
}
diff --git a/plugins/Variables/src/parse_str.cpp b/plugins/Variables/src/parse_str.cpp
index 23a18acc7e..5ee00fb0f7 100644
--- a/plugins/Variables/src/parse_str.cpp
+++ b/plugins/Variables/src/parse_str.cpp
@@ -19,75 +19,75 @@
#include "stdafx.h"
-static TCHAR *parseCaps(ARGUMENTSINFO *ai)
+static wchar_t *parseCaps(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
- TCHAR *res = mir_tstrdup(ai->targv[1]);
- TCHAR *cur = res;
+ wchar_t *res = mir_tstrdup(ai->targv[1]);
+ wchar_t *cur = res;
CharLower(res);
- *cur = (TCHAR)CharUpper((LPTSTR)*cur);
+ *cur = (wchar_t)CharUpper((LPTSTR)*cur);
cur++;
while (*cur != 0) {
if ((*cur == ' ') && (*(cur + 1) != 0)) {
cur++;
if (IsCharLower(*cur))
- *cur = (TCHAR)CharUpper((LPTSTR)*cur);
+ *cur = (wchar_t)CharUpper((LPTSTR)*cur);
}
else {
cur++;
if (IsCharUpper(*cur))
- *cur = (TCHAR)CharLower((LPTSTR)*cur);
+ *cur = (wchar_t)CharLower((LPTSTR)*cur);
}
}
return res;
}
-static TCHAR *parseCaps2(ARGUMENTSINFO *ai)
+static wchar_t *parseCaps2(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
- TCHAR *res = mir_tstrdup(ai->targv[1]);
- TCHAR *cur = res;
- *cur = (TCHAR)CharUpper((LPTSTR)*cur);
+ wchar_t *res = mir_tstrdup(ai->targv[1]);
+ wchar_t *cur = res;
+ *cur = (wchar_t)CharUpper((LPTSTR)*cur);
cur++;
while (*cur != 0) {
if ((*cur == ' ') && (*(cur + 1) != 0)) {
cur++;
if (IsCharLower(*cur))
- *cur = (TCHAR)CharUpper((LPTSTR)*cur);
+ *cur = (wchar_t)CharUpper((LPTSTR)*cur);
}
else cur++;
}
return res;
}
-static TCHAR *parseCrlf(ARGUMENTSINFO *ai)
+static wchar_t *parseCrlf(ARGUMENTSINFO *ai)
{
ai->flags |= AIF_DONTPARSE;
return mir_tstrdup(L"\r\n");
}
-static TCHAR *parseEolToCrlf(ARGUMENTSINFO *ai)
+static wchar_t *parseEolToCrlf(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
- TCHAR *res = mir_tstrdup(ai->targv[1]);
- TCHAR *cur = res;
+ wchar_t *res = mir_tstrdup(ai->targv[1]);
+ wchar_t *cur = res;
do {
- cur = _tcschr(cur, '\n');
+ cur = wcschr(cur, '\n');
if ((cur == NULL) || ((cur > res) && (*(cur - 1) == '\r')))
continue;
log_debug(cur);
int loc = cur - res;
- res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + 2)*sizeof(TCHAR));
+ res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + 2)*sizeof(wchar_t));
cur = res + loc;
- memmove(cur + 2, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(TCHAR));
- memcpy(cur, L"\r\n", 2 * sizeof(TCHAR));
+ memmove(cur + 2, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(wchar_t));
+ memcpy(cur, L"\r\n", 2 * sizeof(wchar_t));
cur += 2;
}
while (cur != NULL);
@@ -95,9 +95,9 @@ static TCHAR *parseEolToCrlf(ARGUMENTSINFO *ai)
return res;
}
-static TCHAR *parseFixeol(ARGUMENTSINFO *ai)
+static wchar_t *parseFixeol(ARGUMENTSINFO *ai)
{
- TCHAR *szReplacement;
+ wchar_t *szReplacement;
if (ai->argc == 2)
szReplacement = L"(...)";
else if (ai->argc == 3)
@@ -105,7 +105,7 @@ static TCHAR *parseFixeol(ARGUMENTSINFO *ai)
else
return NULL;
- TCHAR *cur = ai->targv[1];
+ wchar_t *cur = ai->targv[1];
while (mir_tstrcmp(cur, L"\r\n") && *cur != '\n' && *cur != 0)
cur++;
@@ -113,30 +113,30 @@ static TCHAR *parseFixeol(ARGUMENTSINFO *ai)
return mir_tstrdup(ai->targv[1]);
cur--;
- TCHAR *res = (TCHAR*)mir_alloc((cur - ai->targv[1] + mir_tstrlen(szReplacement) + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((cur - ai->targv[1] + mir_tstrlen(szReplacement) + 1)*sizeof(wchar_t));
if (res == NULL)
return res;
- memset(res, 0, (((cur - ai->targv[1]) + 1) * sizeof(TCHAR)));
- _tcsncpy(res, ai->targv[1], cur - ai->targv[1]);
+ memset(res, 0, (((cur - ai->targv[1]) + 1) * sizeof(wchar_t)));
+ wcsncpy(res, ai->targv[1], cur - ai->targv[1]);
mir_tstrcat(res, szReplacement);
return res;
}
-static TCHAR *parseFixeol2(ARGUMENTSINFO *ai)
+static wchar_t *parseFixeol2(ARGUMENTSINFO *ai)
{
- TCHAR *szReplacement;
+ wchar_t *szReplacement;
switch (ai->argc) {
case 2: szReplacement = L" "; break;
case 3: szReplacement = ai->targv[2]; break;
default: return NULL;
}
- TCHAR *res = mir_tstrdup(ai->targv[1]);
+ wchar_t *res = mir_tstrdup(ai->targv[1]);
for (size_t pos = 0; pos < mir_tstrlen(res); pos++) {
- TCHAR *cur = res + pos;
- TCHAR *szEol = NULL;
- if (!_tcsncmp(cur, L"\r\n", mir_tstrlen(L"\r\n")))
+ wchar_t *cur = res + pos;
+ wchar_t *szEol = NULL;
+ if (!wcsncmp(cur, L"\r\n", mir_tstrlen(L"\r\n")))
szEol = L"\r\n";
if (*cur == '\n')
@@ -144,18 +144,18 @@ static TCHAR *parseFixeol2(ARGUMENTSINFO *ai)
if (szEol != NULL) {
if (mir_tstrlen(szReplacement) > mir_tstrlen(szEol)) {
- res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(szReplacement) - mir_tstrlen(szEol) + 1)*sizeof(TCHAR));
+ res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(szReplacement) - mir_tstrlen(szEol) + 1)*sizeof(wchar_t));
cur = res + pos;
}
- memmove(cur + mir_tstrlen(szReplacement), cur + mir_tstrlen(szEol), (mir_tstrlen(cur + mir_tstrlen(szEol)) + 1)*sizeof(TCHAR));
- memcpy(cur, szReplacement, mir_tstrlen(szReplacement)*sizeof(TCHAR));
+ memmove(cur + mir_tstrlen(szReplacement), cur + mir_tstrlen(szEol), (mir_tstrlen(cur + mir_tstrlen(szEol)) + 1)*sizeof(wchar_t));
+ memcpy(cur, szReplacement, mir_tstrlen(szReplacement)*sizeof(wchar_t));
pos += mir_tstrlen(szReplacement) - 1;
}
}
- return (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + 1)*sizeof(TCHAR));
+ return (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + 1)*sizeof(wchar_t));
}
-static TCHAR *parseInsert(ARGUMENTSINFO *ai)
+static wchar_t *parseInsert(ARGUMENTSINFO *ai)
{
if (ai->argc != 4)
return NULL;
@@ -164,18 +164,18 @@ static TCHAR *parseInsert(ARGUMENTSINFO *ai)
if (pos > mir_tstrlen(ai->targv[1]))
return NULL;
- TCHAR *res = (TCHAR*)mir_alloc((mir_tstrlen(ai->targv[1]) + mir_tstrlen(ai->targv[2]) + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((mir_tstrlen(ai->targv[1]) + mir_tstrlen(ai->targv[2]) + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((mir_tstrlen(ai->targv[1]) + mir_tstrlen(ai->targv[2]) + 1) * sizeof(TCHAR)));
- _tcsncpy(res, ai->targv[1], pos);
+ memset(res, 0, ((mir_tstrlen(ai->targv[1]) + mir_tstrlen(ai->targv[2]) + 1) * sizeof(wchar_t)));
+ wcsncpy(res, ai->targv[1], pos);
mir_tstrcpy(res + pos, ai->targv[2]);
mir_tstrcpy(res + pos + mir_tstrlen(ai->targv[2]), ai->targv[1] + pos);
return res;
}
-static TCHAR *parseLeft(ARGUMENTSINFO *ai)
+static wchar_t *parseLeft(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -185,16 +185,16 @@ static TCHAR *parseLeft(ARGUMENTSINFO *ai)
return NULL;
len = min(len, (signed int)mir_tstrlen(ai->targv[1]));
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((len + 1) * sizeof(TCHAR)));
- _tcsncpy(res, ai->targv[1], len);
+ memset(res, 0, ((len + 1) * sizeof(wchar_t)));
+ wcsncpy(res, ai->targv[1], len);
return res;
}
-static TCHAR *parseLen(ARGUMENTSINFO *ai)
+static wchar_t *parseLen(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -202,15 +202,15 @@ static TCHAR *parseLen(ARGUMENTSINFO *ai)
return itot((int)mir_tstrlen(ai->targv[1]));
}
-static TCHAR *parseLineCount(ARGUMENTSINFO *ai)
+static wchar_t *parseLineCount(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
int count = 1;
- TCHAR *cur = ai->targv[1];
+ wchar_t *cur = ai->targv[1];
while (cur < (ai->targv[1] + mir_tstrlen(ai->targv[1]))) {
- if (!_tcsncmp(cur, L"\r\n", 2)) {
+ if (!wcsncmp(cur, L"\r\n", 2)) {
count++;
cur++;
}
@@ -223,19 +223,19 @@ static TCHAR *parseLineCount(ARGUMENTSINFO *ai)
return itot(count);
}
-static TCHAR *parseLower(ARGUMENTSINFO *ai)
+static wchar_t *parseLower(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
- TCHAR *res = mir_tstrdup(ai->targv[1]);
+ wchar_t *res = mir_tstrdup(ai->targv[1]);
if (res == NULL)
return NULL;
return CharLower(res);
}
-static TCHAR *parseLongest(ARGUMENTSINFO *ai)
+static wchar_t *parseLongest(ARGUMENTSINFO *ai)
{
if (ai->argc < 2)
return NULL;
@@ -248,7 +248,7 @@ static TCHAR *parseLongest(ARGUMENTSINFO *ai)
return mir_tstrdup(ai->targv[iLong]);
}
-static TCHAR *parseNoOp(ARGUMENTSINFO *ai)
+static wchar_t *parseNoOp(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -256,9 +256,9 @@ static TCHAR *parseNoOp(ARGUMENTSINFO *ai)
return mir_tstrdup(ai->targv[1]);
}
-static TCHAR *parsePad(ARGUMENTSINFO *ai)
+static wchar_t *parsePad(ARGUMENTSINFO *ai)
{
- TCHAR padchar;
+ wchar_t padchar;
switch (ai->argc) {
case 3: padchar = ' '; break;
case 4: padchar = *ai->targv[3]; break;
@@ -270,12 +270,12 @@ static TCHAR *parsePad(ARGUMENTSINFO *ai)
return NULL;
unsigned int addcount = max(padding - (signed int)mir_tstrlen(ai->targv[1]), 0);
- TCHAR *res = (TCHAR*)mir_alloc((addcount + mir_tstrlen(ai->targv[1]) + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((addcount + mir_tstrlen(ai->targv[1]) + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((addcount + mir_tstrlen(ai->targv[1]) + 1) * sizeof(TCHAR)));
- TCHAR *cur = res;
+ memset(res, 0, ((addcount + mir_tstrlen(ai->targv[1]) + 1) * sizeof(wchar_t)));
+ wchar_t *cur = res;
for (unsigned int i = 0; i < addcount; i++)
*cur++ = padchar;
@@ -283,9 +283,9 @@ static TCHAR *parsePad(ARGUMENTSINFO *ai)
return res;
}
-static TCHAR *parsePadright(ARGUMENTSINFO *ai)
+static wchar_t *parsePadright(ARGUMENTSINFO *ai)
{
- TCHAR padchar;
+ wchar_t padchar;
switch (ai->argc) {
case 3: padchar = ' '; break;
case 4: padchar = *ai->targv[3]; break;
@@ -297,22 +297,22 @@ static TCHAR *parsePadright(ARGUMENTSINFO *ai)
return NULL;
unsigned int addcount = max(padding - (signed int)mir_tstrlen(ai->targv[1]), 0);
- TCHAR *res = (TCHAR*)mir_alloc((addcount + mir_tstrlen(ai->targv[1]) + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((addcount + mir_tstrlen(ai->targv[1]) + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((addcount + mir_tstrlen(ai->targv[1]) + 1) * sizeof(TCHAR)));
+ memset(res, 0, ((addcount + mir_tstrlen(ai->targv[1]) + 1) * sizeof(wchar_t)));
mir_tstrcpy(res, ai->targv[1]);
- TCHAR *cur = res + mir_tstrlen(ai->targv[1]);
+ wchar_t *cur = res + mir_tstrlen(ai->targv[1]);
for (unsigned int i = 0; i < addcount; i++)
*cur++ = padchar;
return res;
}
-static TCHAR *parsePadcut(ARGUMENTSINFO *ai)
+static wchar_t *parsePadcut(ARGUMENTSINFO *ai)
{
- TCHAR padchar;
+ wchar_t padchar;
switch (ai->argc) {
case 3: padchar = ' '; break;
case 4: padchar = *ai->targv[3]; break;
@@ -324,24 +324,24 @@ static TCHAR *parsePadcut(ARGUMENTSINFO *ai)
return NULL;
int addcount = max(padding - (signed int)mir_tstrlen(ai->targv[1]), 0);
- TCHAR *res = (TCHAR*)mir_alloc((padding + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((padding + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((padding + 1) * sizeof(TCHAR)));
- TCHAR *cur = res;
+ memset(res, 0, ((padding + 1) * sizeof(wchar_t)));
+ wchar_t *cur = res;
for (int i = 0; i < addcount; i++)
*cur++ = padchar;
if (padding > addcount)
- _tcsncpy(res + addcount, ai->targv[1], padding - addcount);
+ wcsncpy(res + addcount, ai->targv[1], padding - addcount);
return res;
}
-static TCHAR *parsePadcutright(ARGUMENTSINFO *ai)
+static wchar_t *parsePadcutright(ARGUMENTSINFO *ai)
{
- TCHAR padchar;
+ wchar_t padchar;
switch (ai->argc) {
case 3: padchar = ' '; break;
case 4: padchar = *ai->targv[3]; break;
@@ -353,22 +353,22 @@ static TCHAR *parsePadcutright(ARGUMENTSINFO *ai)
return NULL;
int addcount = max(padding - (signed int)mir_tstrlen(ai->targv[1]), 0);
- TCHAR *res = (TCHAR*)mir_alloc((padding + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((padding + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((padding + 1) * sizeof(TCHAR)));
- TCHAR *cur = res + padding - addcount;
+ memset(res, 0, ((padding + 1) * sizeof(wchar_t)));
+ wchar_t *cur = res + padding - addcount;
for (int i = 0; i < addcount; i++)
*cur++ = padchar;
if (padding > addcount)
- _tcsncpy(res, ai->targv[1], padding - addcount);
+ wcsncpy(res, ai->targv[1], padding - addcount);
return res;
}
-static TCHAR *parseRepeat(ARGUMENTSINFO *ai)
+static wchar_t *parseRepeat(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -377,49 +377,49 @@ static TCHAR *parseRepeat(ARGUMENTSINFO *ai)
if (count < 0)
return NULL;
- TCHAR *res = (TCHAR*)mir_alloc((count * mir_tstrlen(ai->targv[1]) + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((count * mir_tstrlen(ai->targv[1]) + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((count * mir_tstrlen(ai->targv[1]) + 1) * sizeof(TCHAR)));
+ memset(res, 0, ((count * mir_tstrlen(ai->targv[1]) + 1) * sizeof(wchar_t)));
for (int i = 0; i < count; i++)
mir_tstrcat(res, ai->targv[1]);
return res;
}
-static TCHAR *parseReplace(ARGUMENTSINFO *ai)
+static wchar_t *parseReplace(ARGUMENTSINFO *ai)
{
if ((ai->argc < 4) || (ai->argc % 2 != 0))
return NULL;
- TCHAR *cur;
+ wchar_t *cur;
size_t pos = 0;
- TCHAR *res = mir_tstrdup(ai->targv[1]);
+ wchar_t *res = mir_tstrdup(ai->targv[1]);
for (size_t i = 2; i < ai->argc; i += 2) {
if (mir_tstrlen(ai->targv[i]) == 0)
continue;
for (pos = 0; pos<mir_tstrlen(res); pos++) {
cur = res + pos;
- if (!_tcsncmp(cur, ai->targv[i], mir_tstrlen(ai->targv[i]))) {
+ if (!wcsncmp(cur, ai->targv[i], mir_tstrlen(ai->targv[i]))) {
if (mir_tstrlen(ai->targv[i + 1]) > mir_tstrlen(ai->targv[i])) {
- res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(ai->targv[i + 1]) - mir_tstrlen(ai->targv[i]) + 1)*sizeof(TCHAR));
+ res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(ai->targv[i + 1]) - mir_tstrlen(ai->targv[i]) + 1)*sizeof(wchar_t));
cur = res + pos;
}
- memmove(cur + mir_tstrlen(ai->targv[i + 1]), cur + mir_tstrlen(ai->targv[i]), (mir_tstrlen(cur + mir_tstrlen(ai->targv[i])) + 1)*sizeof(TCHAR));
- memcpy(cur, ai->targv[i + 1], mir_tstrlen(ai->targv[i + 1])*sizeof(TCHAR));
+ memmove(cur + mir_tstrlen(ai->targv[i + 1]), cur + mir_tstrlen(ai->targv[i]), (mir_tstrlen(cur + mir_tstrlen(ai->targv[i])) + 1)*sizeof(wchar_t));
+ memcpy(cur, ai->targv[i + 1], mir_tstrlen(ai->targv[i + 1])*sizeof(wchar_t));
pos += mir_tstrlen(ai->targv[i + 1]) - 1;
}
}
- res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + 1)*sizeof(TCHAR));
+ res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + 1)*sizeof(wchar_t));
}
return res;
}
-static TCHAR *parseRight(ARGUMENTSINFO *ai)
+static wchar_t *parseRight(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -429,19 +429,19 @@ static TCHAR *parseRight(ARGUMENTSINFO *ai)
return NULL;
len = min(len, (signed int)mir_tstrlen(ai->targv[1]));
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((len + 1)*sizeof(TCHAR)));
- _tcsncpy(res, ai->targv[1] + mir_tstrlen(ai->targv[1]) - len, len);
+ memset(res, 0, ((len + 1)*sizeof(wchar_t)));
+ wcsncpy(res, ai->targv[1] + mir_tstrlen(ai->targv[1]) - len, len);
return res;
}
/*
string, display size, scroll amount
*/
-static TCHAR *parseScroll(ARGUMENTSINFO *ai)
+static wchar_t *parseScroll(ARGUMENTSINFO *ai)
{
if (ai->argc != 4)
return NULL;
@@ -454,21 +454,21 @@ static TCHAR *parseScroll(ARGUMENTSINFO *ai)
if (display > mir_tstrlen(ai->targv[1]))
display = (unsigned)mir_tstrlen(ai->targv[1]);
- TCHAR *res = (TCHAR*)mir_alloc((2 * mir_tstrlen(ai->targv[1]) + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((2 * mir_tstrlen(ai->targv[1]) + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((2 * mir_tstrlen(ai->targv[1]) + 1) * sizeof(TCHAR)));
+ memset(res, 0, ((2 * mir_tstrlen(ai->targv[1]) + 1) * sizeof(wchar_t)));
mir_tstrcpy(res, ai->targv[1]);
mir_tstrcat(res, ai->targv[1]);
- memmove(res, res + move, (mir_tstrlen(res + move) + 1)*sizeof(TCHAR));
+ memmove(res, res + move, (mir_tstrlen(res + move) + 1)*sizeof(wchar_t));
*(res + display) = 0;
- res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + 1)*sizeof(TCHAR));
+ res = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + 1)*sizeof(wchar_t));
return res;
}
-static TCHAR *parseShortest(ARGUMENTSINFO *ai)
+static wchar_t *parseShortest(ARGUMENTSINFO *ai)
{
if (ai->argc <= 1)
return NULL;
@@ -481,21 +481,21 @@ static TCHAR *parseShortest(ARGUMENTSINFO *ai)
return mir_tstrdup(ai->targv[iShort]);
}
-static TCHAR *parseStrchr(ARGUMENTSINFO *ai)
+static wchar_t *parseStrchr(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
char *szVal[34];
memset(szVal, 0, sizeof(szVal));
- TCHAR *c = _tcschr(ai->targv[1], *ai->targv[2]);
+ wchar_t *c = wcschr(ai->targv[1], *ai->targv[2]);
if (c == NULL || *c == 0)
return mir_tstrdup(L"0");
return itot(c - ai->targv[1] + 1);
}
-static TCHAR *parseStrcmp(ARGUMENTSINFO *ai)
+static wchar_t *parseStrcmp(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -506,7 +506,7 @@ static TCHAR *parseStrcmp(ARGUMENTSINFO *ai)
return mir_tstrdup(L"");
}
-static TCHAR *parseStrmcmp(ARGUMENTSINFO *ai)
+static wchar_t *parseStrmcmp(ARGUMENTSINFO *ai)
{
if (ai->argc < 3)
return NULL;
@@ -522,7 +522,7 @@ static TCHAR *parseStrmcmp(ARGUMENTSINFO *ai)
return mir_tstrdup(L"");
}
-static TCHAR *parseStrncmp(ARGUMENTSINFO *ai)
+static wchar_t *parseStrncmp(ARGUMENTSINFO *ai)
{
if (ai->argc != 4)
return NULL;
@@ -531,13 +531,13 @@ static TCHAR *parseStrncmp(ARGUMENTSINFO *ai)
if (n <= 0)
return NULL;
- if (_tcsncmp(ai->targv[1], ai->targv[2], n))
+ if (wcsncmp(ai->targv[1], ai->targv[2], n))
ai->flags |= AIF_FALSE;
return mir_tstrdup(L"");
}
-static TCHAR *parseStricmp(ARGUMENTSINFO *ai)
+static wchar_t *parseStricmp(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -548,7 +548,7 @@ static TCHAR *parseStricmp(ARGUMENTSINFO *ai)
return mir_tstrdup(L"");
}
-static TCHAR *parseStrnicmp(ARGUMENTSINFO *ai)
+static wchar_t *parseStrnicmp(ARGUMENTSINFO *ai)
{
if (ai->argc != 4)
return NULL;
@@ -557,37 +557,37 @@ static TCHAR *parseStrnicmp(ARGUMENTSINFO *ai)
if (n <= 0)
return NULL;
- if (_tcsnicmp(ai->targv[1], ai->targv[2], n))
+ if (wcsnicmp(ai->targv[1], ai->targv[2], n))
ai->flags |= AIF_FALSE;
return mir_tstrdup(L"");
}
-static TCHAR *parseStrrchr(ARGUMENTSINFO *ai)
+static wchar_t *parseStrrchr(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
- TCHAR *c = _tcsrchr(ai->targv[1], *ai->targv[2]);
+ wchar_t *c = wcsrchr(ai->targv[1], *ai->targv[2]);
if ((c == NULL) || (*c == 0))
return mir_tstrdup(L"0");
return itot(c - ai->targv[1] + 1);
}
-static TCHAR *parseStrstr(ARGUMENTSINFO *ai)
+static wchar_t *parseStrstr(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
- TCHAR *c = _tcsstr(ai->targv[1], ai->targv[2]);
+ wchar_t *c = wcsstr(ai->targv[1], ai->targv[2]);
if ((c == NULL) || (*c == 0))
return mir_tstrdup(L"0");
return itot(c - ai->targv[1] + 1);
}
-static TCHAR *parseSubstr(ARGUMENTSINFO *ai)
+static wchar_t *parseSubstr(ARGUMENTSINFO *ai)
{
if (ai->argc < 3)
return NULL;
@@ -601,13 +601,13 @@ static TCHAR *parseSubstr(ARGUMENTSINFO *ai)
if (to < from)
return NULL;
- TCHAR *res = (TCHAR*)mir_alloc((to - from + 1)*sizeof(TCHAR));
- memset(res, 0, ((to - from + 1) * sizeof(TCHAR)));
- _tcsncpy(res, ai->targv[1] + from, to - from);
+ wchar_t *res = (wchar_t*)mir_alloc((to - from + 1)*sizeof(wchar_t));
+ memset(res, 0, ((to - from + 1) * sizeof(wchar_t)));
+ wcsncpy(res, ai->targv[1] + from, to - from);
return res;
}
-static TCHAR *parseSelect(ARGUMENTSINFO *ai)
+static wchar_t *parseSelect(ARGUMENTSINFO *ai)
{
if (ai->argc <= 1)
return NULL;
@@ -619,7 +619,7 @@ static TCHAR *parseSelect(ARGUMENTSINFO *ai)
return mir_tstrdup(ai->targv[n + 1]);
}
-static TCHAR *parseSwitch(ARGUMENTSINFO *ai)
+static wchar_t *parseSwitch(ARGUMENTSINFO *ai)
{
if (ai->argc % 2 != 0)
return NULL;
@@ -631,33 +631,33 @@ static TCHAR *parseSwitch(ARGUMENTSINFO *ai)
return NULL;
}
-static TCHAR *parseTrim(ARGUMENTSINFO *ai)
+static wchar_t *parseTrim(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
- TCHAR *scur = ai->targv[1];
+ wchar_t *scur = ai->targv[1];
while (*scur == ' ')
scur++;
- TCHAR *ecur = ai->targv[1] + mir_tstrlen(ai->targv[1]) - 1;
+ wchar_t *ecur = ai->targv[1] + mir_tstrlen(ai->targv[1]) - 1;
while ((*ecur == ' ') && (ecur > ai->targv[1]))
ecur--;
if (scur >= ecur)
return mir_tstrdup(L"");
- TCHAR *res = (TCHAR*)mir_alloc((ecur - scur + 2)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((ecur - scur + 2)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((ecur - scur + 2) * sizeof(TCHAR)));
- _tcsncpy(res, scur, ecur - scur + 1);
+ memset(res, 0, ((ecur - scur + 2) * sizeof(wchar_t)));
+ wcsncpy(res, scur, ecur - scur + 1);
return res;
}
-static TCHAR *parseTab(ARGUMENTSINFO *ai)
+static wchar_t *parseTab(ARGUMENTSINFO *ai)
{
int count = 1;
if ((ai->argc == 2) && (mir_tstrlen(ai->targv[1]) > 0))
@@ -666,37 +666,37 @@ static TCHAR *parseTab(ARGUMENTSINFO *ai)
if (count < 0)
return NULL;
- TCHAR *res = (TCHAR*)mir_alloc((count + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((count + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, (count + 1)*sizeof(TCHAR));
- TCHAR *cur = res;
+ memset(res, 0, (count + 1)*sizeof(wchar_t));
+ wchar_t *cur = res;
for (int i = 0; i < count; i++)
*cur++ = '\t';
return res;
}
-static TCHAR *parseUpper(ARGUMENTSINFO *ai)
+static wchar_t *parseUpper(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
- TCHAR *res = mir_tstrdup(ai->targv[1]);
+ wchar_t *res = mir_tstrdup(ai->targv[1]);
if (res == NULL)
return NULL;
return CharUpper(res);
}
-static TCHAR *getNthWord(TCHAR *szString, int w)
+static wchar_t *getNthWord(wchar_t *szString, int w)
{
if (szString == NULL)
return NULL;
int count = 0;
- TCHAR *scur = szString;
+ wchar_t *scur = szString;
while (*scur == ' ')
scur++;
@@ -714,25 +714,25 @@ static TCHAR *getNthWord(TCHAR *szString, int w)
if (count != w)
return NULL;
- TCHAR *ecur = scur;
+ wchar_t *ecur = scur;
while ((*ecur != ' ') && (*ecur != 0))
ecur++;
- TCHAR *res = (TCHAR*)mir_alloc((ecur - scur + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((ecur - scur + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((ecur - scur + 1) * sizeof(TCHAR)));
- _tcsncpy(res, scur, ecur - scur);
+ memset(res, 0, ((ecur - scur + 1) * sizeof(wchar_t)));
+ wcsncpy(res, scur, ecur - scur);
return res;
}
-static TCHAR *parseWord(ARGUMENTSINFO *ai)
+static wchar_t *parseWord(ARGUMENTSINFO *ai)
{
if (ai->argc < 3 || ai->argc > 4)
return NULL;
- TCHAR *res = NULL;
+ wchar_t *res = NULL;
int to, from = ttoi(ai->targv[2]);
if (ai->argc == 4) {
if (mir_tstrlen(ai->targv[3]) > 0)
@@ -746,12 +746,12 @@ static TCHAR *parseWord(ARGUMENTSINFO *ai)
return NULL;
for (int i = from; i <= to; i++) {
- TCHAR *szWord = getNthWord(ai->targv[1], i);
+ wchar_t *szWord = getNthWord(ai->targv[1], i);
if (szWord == NULL)
return res;
if (res != NULL) {
- TCHAR *pres = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(szWord) + 2)*sizeof(TCHAR));
+ wchar_t *pres = (wchar_t*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(szWord) + 2)*sizeof(wchar_t));
if (pres != NULL) {
res = pres;
mir_tstrcat(res, L" ");
@@ -765,7 +765,7 @@ static TCHAR *parseWord(ARGUMENTSINFO *ai)
return res;
}
-static TCHAR *parseExtratext(ARGUMENTSINFO *ai)
+static wchar_t *parseExtratext(ARGUMENTSINFO *ai)
{
if (ai->argc > 1)
return NULL;
diff --git a/plugins/Variables/src/parse_system.cpp b/plugins/Variables/src/parse_system.cpp
index 43695c7db0..370c84881e 100644
--- a/plugins/Variables/src/parse_system.cpp
+++ b/plugins/Variables/src/parse_system.cpp
@@ -19,14 +19,14 @@
#include "stdafx.h"
-static TCHAR *parseComputerName(ARGUMENTSINFO *ai)
+static wchar_t *parseComputerName(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
ai->flags |= AIF_DONTPARSE;
DWORD len = MAX_COMPUTERNAME_LENGTH;
- TCHAR *res = (TCHAR*)mir_calloc((len + 1) * sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_calloc((len + 1) * sizeof(wchar_t));
if (res == NULL)
return NULL;
@@ -40,13 +40,13 @@ static TCHAR *parseComputerName(ARGUMENTSINFO *ai)
#include <pdh.h>
#include <pdhmsg.h>
-static TCHAR *parseCpuLoad(ARGUMENTSINFO *ai)
+static wchar_t *parseCpuLoad(ARGUMENTSINFO *ai)
{
HQUERY hQuery;
PDH_FMT_COUNTERVALUE cValue;
HCOUNTER hCounter;
- TCHAR *szCounter, szVal[32];
+ wchar_t *szCounter, szVal[32];
if (ai->argc != 2)
return NULL;
@@ -55,7 +55,7 @@ static TCHAR *parseCpuLoad(ARGUMENTSINFO *ai)
szCounter = mir_tstrdup(L"\\Processor(_Total)\\% Processor Time");
else {
int size = (int)mir_tstrlen(ai->targv[1]) + 32;
- szCounter = (TCHAR *)mir_alloc(size * sizeof(TCHAR));
+ szCounter = (wchar_t *)mir_alloc(size * sizeof(wchar_t));
if (szCounter == NULL)
return NULL;
@@ -113,16 +113,16 @@ static TCHAR *parseCpuLoad(ARGUMENTSINFO *ai)
return mir_tstrdup(szVal);
}
-static TCHAR *parseCurrentDate(ARGUMENTSINFO *ai)
+static wchar_t *parseCurrentDate(ARGUMENTSINFO *ai)
{
- TCHAR *szFormat;
+ wchar_t *szFormat;
if (ai->argc == 1 || (ai->argc > 1 && mir_tstrlen(ai->targv[1]) == 0))
szFormat = NULL;
else
szFormat = ai->targv[1];
int len = GetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, szFormat, NULL, 0);
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
@@ -134,16 +134,16 @@ static TCHAR *parseCurrentDate(ARGUMENTSINFO *ai)
return res;
}
-static TCHAR *parseCurrentTime(ARGUMENTSINFO *ai)
+static wchar_t *parseCurrentTime(ARGUMENTSINFO *ai)
{
- TCHAR *szFormat;
+ wchar_t *szFormat;
if (ai->argc == 1 || (ai->argc > 1) && (mir_tstrlen(ai->targv[1]) == 0))
szFormat = NULL;
else
szFormat = ai->targv[1];
int len = GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL, szFormat, NULL, 0);
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
@@ -155,7 +155,7 @@ static TCHAR *parseCurrentTime(ARGUMENTSINFO *ai)
return res;
}
-static TCHAR *parseDirectory(ARGUMENTSINFO *ai)
+static wchar_t *parseDirectory(ARGUMENTSINFO *ai)
{
if (ai->argc < 2 || ai->argc > 3)
return NULL;
@@ -181,8 +181,8 @@ static TCHAR *parseDirectory(ARGUMENTSINFO *ai)
if (ai->targv[1][bi - 1] == '\\')
break;
- TCHAR *res = (TCHAR*)mir_alloc((ei - bi + 1) * sizeof(TCHAR));
- _tcsncpy(res, ai->targv[1] + bi, ei - bi);
+ wchar_t *res = (wchar_t*)mir_alloc((ei - bi + 1) * sizeof(wchar_t));
+ wcsncpy(res, ai->targv[1] + bi, ei - bi);
res[ei - bi] = 0;
return res;
}
@@ -191,7 +191,7 @@ static TCHAR *parseDirectory(ARGUMENTSINFO *ai)
path, depth
returns complete path up to "path depth - depth"
*/
-static TCHAR *parseDirectory2(ARGUMENTSINFO *ai)
+static wchar_t *parseDirectory2(ARGUMENTSINFO *ai)
{
if (ai->argc < 2 || ai->argc > 3)
return NULL;
@@ -203,7 +203,7 @@ static TCHAR *parseDirectory2(ARGUMENTSINFO *ai)
if (depth <= 0)
return NULL;
- TCHAR *ecur = ai->targv[1] + mir_tstrlen(ai->targv[1]);
+ wchar_t *ecur = ai->targv[1] + mir_tstrlen(ai->targv[1]);
while (depth > 0) {
while ((*ecur != '\\') && (ecur > ai->targv[1]))
ecur--;
@@ -214,32 +214,32 @@ static TCHAR *parseDirectory2(ARGUMENTSINFO *ai)
depth -= 1;
ecur--;
}
- TCHAR *res = (TCHAR*)mir_calloc((ecur - ai->targv[1] + 2) * sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_calloc((ecur - ai->targv[1] + 2) * sizeof(wchar_t));
if (res == NULL)
return NULL;
- _tcsncpy(res, ai->targv[1], (ecur - ai->targv[1]) + 1);
+ wcsncpy(res, ai->targv[1], (ecur - ai->targv[1]) + 1);
return res;
}
-static int getTime(TCHAR *szTime, struct tm *date)
+static int getTime(wchar_t *szTime, struct tm *date)
{
// do some extra checks here
- TCHAR *cur = szTime;
+ wchar_t *cur = szTime;
if (cur >= szTime + mir_tstrlen(szTime))
return -1;
- date->tm_mon = _tcstoul(cur, &cur, 10) - 1;
+ date->tm_mon = wcstoul(cur, &cur, 10) - 1;
cur++;
if (cur >= szTime + mir_tstrlen(szTime))
return -1;
- date->tm_mday = _tcstoul(cur, &cur, 10);
+ date->tm_mday = wcstoul(cur, &cur, 10);
cur++;
if (cur >= szTime + mir_tstrlen(szTime))
return -1;
- date->tm_year = _tcstoul(cur, &cur, 10);
+ date->tm_year = wcstoul(cur, &cur, 10);
if (date->tm_year > 2000)
date->tm_year -= 2000;
else if (date->tm_year > 1900)
@@ -250,24 +250,24 @@ static int getTime(TCHAR *szTime, struct tm *date)
if (cur >= szTime + mir_tstrlen(szTime))
return -1;
- date->tm_hour = _tcstoul(cur, &cur, 10);
+ date->tm_hour = wcstoul(cur, &cur, 10);
cur++;
if (cur >= szTime + mir_tstrlen(szTime))
return -1;
- date->tm_min = _tcstoul(cur, &cur, 10);
+ date->tm_min = wcstoul(cur, &cur, 10);
cur++;
if (cur >= szTime + mir_tstrlen(szTime))
return -1;
- date->tm_sec = _tcstoul(cur, &cur, 10);
+ date->tm_sec = wcstoul(cur, &cur, 10);
return 0;
}
-static TCHAR *parseDiffTime(ARGUMENTSINFO *ai)
+static wchar_t *parseDiffTime(ARGUMENTSINFO *ai)
{
struct tm t0, t1;
- TCHAR szTime[32];
+ wchar_t szTime[32];
double diff;
if (ai->argc != 3)
@@ -287,7 +287,7 @@ static TCHAR *parseDiffTime(ARGUMENTSINFO *ai)
return mir_tstrdup(szTime);
}
-static TCHAR *parseDirExists(ARGUMENTSINFO *ai)
+static wchar_t *parseDirExists(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -301,7 +301,7 @@ static TCHAR *parseDirExists(ARGUMENTSINFO *ai)
return mir_tstrdup(L"");
}
-static TCHAR *parseEnvironmentVariable(ARGUMENTSINFO *ai)
+static wchar_t *parseEnvironmentVariable(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -310,11 +310,11 @@ static TCHAR *parseEnvironmentVariable(ARGUMENTSINFO *ai)
if (len <= 0)
return NULL;
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, ((len + 1) * sizeof(TCHAR)));
+ memset(res, 0, ((len + 1) * sizeof(wchar_t)));
if (ExpandEnvironmentStrings(ai->targv[1], res, len) == 0) {
mir_free(res);
return NULL;
@@ -322,7 +322,7 @@ static TCHAR *parseEnvironmentVariable(ARGUMENTSINFO *ai)
return res;
}
-static TCHAR *parseFileExists(ARGUMENTSINFO *ai)
+static wchar_t *parseFileExists(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -336,7 +336,7 @@ static TCHAR *parseFileExists(ARGUMENTSINFO *ai)
return mir_tstrdup(L"");
}
-static TCHAR *parseFindWindow(ARGUMENTSINFO *ai)
+static wchar_t *parseFindWindow(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -349,8 +349,8 @@ static TCHAR *parseFindWindow(ARGUMENTSINFO *ai)
if (len == 0)
return NULL;
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
- memset(res, 0, ((len + 1) * sizeof(TCHAR)));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
+ memset(res, 0, ((len + 1) * sizeof(wchar_t)));
GetWindowText(hWin, res, len + 1);
return res;
}
@@ -359,19 +359,19 @@ static TCHAR *parseFindWindow(ARGUMENTSINFO *ai)
// 2 = filter
// 3 = sperator
// 4 = [f]iles, [d]irs
-static TCHAR *parseListDir(ARGUMENTSINFO *ai)
+static wchar_t *parseListDir(ARGUMENTSINFO *ai)
{
if (ai->argc < 2)
return NULL;
- TCHAR tszFirst[MAX_PATH], *tszRes, *tszSeperator, *tszFilter;
+ wchar_t tszFirst[MAX_PATH], *tszRes, *tszSeperator, *tszFilter;
tszFirst[0] = 0;
tszSeperator = L"\r\n";
tszFilter = L"*";
tszRes = NULL;
if (ai->argc > 1)
- _tcsncpy(tszFirst, ai->targv[1], _countof(tszFirst) - 1);
+ wcsncpy(tszFirst, ai->targv[1], _countof(tszFirst) - 1);
if (ai->argc > 2)
tszFilter = ai->targv[2];
@@ -399,17 +399,17 @@ static TCHAR *parseListDir(ARGUMENTSINFO *ai)
return NULL;
}
if (((ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && (bDirs)) || ((!(ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) && (bFiles))) {
- tszRes = (TCHAR*)mir_alloc((mir_tstrlen(ffd.cFileName) + mir_tstrlen(tszSeperator) + 1)*sizeof(TCHAR));
+ tszRes = (wchar_t*)mir_alloc((mir_tstrlen(ffd.cFileName) + mir_tstrlen(tszSeperator) + 1)*sizeof(wchar_t));
mir_tstrcpy(tszRes, ffd.cFileName);
}
while (FindNextFile(hFind, &ffd) != 0) {
if (((ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && (bDirs)) || ((!(ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) && (bFiles))) {
if (tszRes != NULL) {
mir_tstrcat(tszRes, tszSeperator);
- tszRes = (TCHAR*)mir_realloc(tszRes, (mir_tstrlen(tszRes) + mir_tstrlen(ffd.cFileName) + mir_tstrlen(tszSeperator) + 1)*sizeof(TCHAR));
+ tszRes = (wchar_t*)mir_realloc(tszRes, (mir_tstrlen(tszRes) + mir_tstrlen(ffd.cFileName) + mir_tstrlen(tszSeperator) + 1)*sizeof(wchar_t));
}
else {
- tszRes = (TCHAR*)mir_alloc((mir_tstrlen(ffd.cFileName) + mir_tstrlen(tszSeperator) + 1)*sizeof(TCHAR));
+ tszRes = (wchar_t*)mir_alloc((mir_tstrlen(ffd.cFileName) + mir_tstrlen(tszSeperator) + 1)*sizeof(wchar_t));
mir_tstrcpy(tszRes, L"");
}
mir_tstrcat(tszRes, ffd.cFileName);
@@ -430,7 +430,7 @@ static BOOL CALLBACK MyProcessEnumerator(DWORD, WORD, char *szProcess, LPARAM lP
return TRUE;
}
-static TCHAR *parseProcessRunning(ARGUMENTSINFO *ai)
+static wchar_t *parseProcessRunning(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
@@ -447,18 +447,18 @@ static TCHAR *parseProcessRunning(ARGUMENTSINFO *ai)
}
#endif
-static TCHAR *parseRegistryValue(ARGUMENTSINFO *ai)
+static wchar_t *parseRegistryValue(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
DWORD len, type;
- TCHAR *key = mir_tstrdup(ai->targv[1]);
+ wchar_t *key = mir_tstrdup(ai->targv[1]);
if (key == NULL)
return NULL;
- TCHAR *cur = _tcschr(key, '\\');
+ wchar_t *cur = wcschr(key, '\\');
if (cur == NULL) {
mir_free(key);
return NULL;
@@ -478,18 +478,18 @@ static TCHAR *parseRegistryValue(ARGUMENTSINFO *ai)
mir_free(key);
return NULL;
}
- TCHAR *subKey = cur + 1;
+ wchar_t *subKey = cur + 1;
if (RegOpenKeyEx(hKey, subKey, 0, KEY_READ, &hKey) != ERROR_SUCCESS) {
mir_free(key);
return NULL;
}
mir_free(key);
len = MAX_REGVALUE_LENGTH + 1;
- TCHAR *res = (TCHAR*)mir_alloc(len*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc(len*sizeof(wchar_t));
if (res == NULL)
return NULL;
- memset(res, 0, (len * sizeof(TCHAR)));
+ memset(res, 0, (len * sizeof(wchar_t)));
int err = RegQueryValueEx(hKey, ai->targv[2], NULL, &type, (BYTE*)res, &len);
if ((err != ERROR_SUCCESS) || (type != REG_SZ)) {
RegCloseKey(hKey);
@@ -519,13 +519,13 @@ static int TsToSystemTime(SYSTEMTIME *sysTime, time_t timestamp)
return 0;
}
-static TCHAR *parseTimestamp2Date(ARGUMENTSINFO *ai)
+static wchar_t *parseTimestamp2Date(ARGUMENTSINFO *ai)
{
if (ai->argc <= 1)
return NULL;
SYSTEMTIME sysTime;
- TCHAR *szFormat;
+ wchar_t *szFormat;
time_t timestamp = ttoi(ai->targv[1]);
if (timestamp == 0)
return NULL;
@@ -539,7 +539,7 @@ static TCHAR *parseTimestamp2Date(ARGUMENTSINFO *ai)
return NULL;
int len = GetDateFormat(LOCALE_USER_DEFAULT, 0, &sysTime, szFormat, NULL, 0);
- TCHAR *res = (TCHAR*)mir_calloc((len + 1) * sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_calloc((len + 1) * sizeof(wchar_t));
if (res == NULL)
return NULL;
@@ -551,7 +551,7 @@ static TCHAR *parseTimestamp2Date(ARGUMENTSINFO *ai)
return res;
}
-static TCHAR *parseTimestamp2Time(ARGUMENTSINFO *ai)
+static wchar_t *parseTimestamp2Time(ARGUMENTSINFO *ai)
{
if (ai->argc <= 1)
return NULL;
@@ -561,7 +561,7 @@ static TCHAR *parseTimestamp2Time(ARGUMENTSINFO *ai)
if (timestamp == 0)
return NULL;
- TCHAR *szFormat;
+ wchar_t *szFormat;
if ((ai->argc == 2) || ((ai->argc > 2) && (mir_tstrlen(ai->targv[2]) == 0)))
szFormat = NULL;
else
@@ -571,7 +571,7 @@ static TCHAR *parseTimestamp2Time(ARGUMENTSINFO *ai)
return NULL;
int len = GetTimeFormat(LOCALE_USER_DEFAULT, 0, &sysTime, szFormat, NULL, 0);
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
if (res == NULL)
return NULL;
@@ -583,7 +583,7 @@ static TCHAR *parseTimestamp2Time(ARGUMENTSINFO *ai)
return res;
}
-static TCHAR *parseTextFile(ARGUMENTSINFO *ai)
+static wchar_t *parseTextFile(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -603,15 +603,15 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai)
unsigned int icur, bufSz;
DWORD readSz, totalReadSz;
unsigned long linePos;
- TCHAR tUC, *res;
+ wchar_t tUC, *res;
BYTE *pBuf, *pCur;
- ReadFile(hFile, &tUC, sizeof(TCHAR), &readSz, NULL);
- if (tUC != (TCHAR)0xFEFF) {
+ ReadFile(hFile, &tUC, sizeof(wchar_t), &readSz, NULL);
+ if (tUC != (wchar_t)0xFEFF) {
tUC = 0;
csz = sizeof(char);
SetFilePointer(hFile, 0, NULL, FILE_BEGIN);
}
- else csz = sizeof(TCHAR);
+ else csz = sizeof(wchar_t);
totalReadSz = 0;
lineCount = 1;
@@ -632,7 +632,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai)
CloseHandle(hFile);
if (tUC)
- res = (TCHAR*)pBuf;
+ res = (wchar_t*)pBuf;
else {
res = mir_a2t((char *)pBuf);
mir_free(pBuf);
@@ -659,11 +659,11 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai)
totalReadSz += readSz;
for (pCur = pBuf; *pCur != '\0'; pCur += csz) {
if (tUC) {
- if (!_tcsncmp((TCHAR*)pCur, L"\r\n", 2)) {
+ if (!wcsncmp((wchar_t*)pCur, L"\r\n", 2)) {
lineCount++;
pCur += csz;
}
- else if (*(TCHAR*)pCur == '\n')
+ else if (*(wchar_t*)pCur == '\n')
lineCount++;
}
else {
@@ -699,11 +699,11 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai)
linePos = (tUC ? csz : 0) + totalReadSz - readSz + pCur - pBuf;
if (tUC) {
- if (!_tcsncmp((TCHAR*)pCur, L"\r\n", 2)) {
+ if (!wcsncmp((wchar_t*)pCur, L"\r\n", 2)) {
lineCount++;
pCur += csz;
}
- else if (*(TCHAR*)pCur == '\n')
+ else if (*(wchar_t*)pCur == '\n')
lineCount++;
}
else {
@@ -715,7 +715,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai)
lineCount++;
}
}
- if (((tUC) && (*(TCHAR*)pCur == '\r')) || ((!tUC) && (*(char *)pCur == '\r'))) {
+ if (((tUC) && (*(wchar_t*)pCur == '\r')) || ((!tUC) && (*(char *)pCur == '\r'))) {
// in case the \r was at the end of the buffer, \n could be next
SetFilePointer(hFile, -1 * csz, NULL, FILE_CURRENT);
totalReadSz -= csz;
@@ -738,16 +738,16 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai)
return NULL;
}
for (pCur = pBuf; (pCur < pBuf + readSz); pCur += csz) {
- if ((tUC) && ((!_tcsncmp((TCHAR*)pCur, L"\r\n", 2)) || (*(TCHAR*)pCur == '\n')) ||
+ if ((tUC) && ((!wcsncmp((wchar_t*)pCur, L"\r\n", 2)) || (*(wchar_t*)pCur == '\n')) ||
((!tUC) && (((!strncmp((char *)pCur, "\r\n", 2)) || (*(char *)pCur == '\n'))))) {
CloseHandle(hFile);
if (tUC)
- *(TCHAR*)pCur = 0;
+ *(wchar_t*)pCur = 0;
else
*(char *)pCur = '\0';
if (tUC)
- res = (TCHAR*)pBuf;
+ res = (wchar_t*)pBuf;
else {
res = mir_a2t((char *)pBuf);
mir_free(pBuf);
@@ -760,7 +760,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai)
CloseHandle(hFile);
if (tUC) {
- res = (TCHAR*)pBuf;
+ res = (wchar_t*)pBuf;
}
else {
res = mir_a2t((char *)pBuf);
@@ -772,7 +772,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai)
if (readSz == bufSz - csz) {
// buffer must be increased
bufSz += TXTFILEBUFSZ*csz;
- if (((tUC) && (*(TCHAR*)pCur == '\r')) || ((!tUC) && (*(char *)pCur == '\r'))) {
+ if (((tUC) && (*(wchar_t*)pCur == '\r')) || ((!tUC) && (*(char *)pCur == '\r'))) {
pCur -= csz;
}
icur = pCur - pBuf;
@@ -787,7 +787,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai)
return NULL;
}
-static TCHAR *parseUpTime(ARGUMENTSINFO *ai)
+static wchar_t *parseUpTime(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
@@ -818,21 +818,21 @@ static TCHAR *parseUpTime(ARGUMENTSINFO *ai)
return NULL;
}
- TCHAR szVal[32];
+ wchar_t szVal[32];
mir_sntprintf(szVal, L"%u", cValue.largeValue);
PdhRemoveCounter(hCounter);
PdhCloseQuery(hQuery);
return mir_tstrdup(szVal);
}
-static TCHAR *parseUserName(ARGUMENTSINFO *ai)
+static wchar_t *parseUserName(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
ai->flags |= AIF_DONTPARSE;
DWORD len = UNLEN;
- TCHAR *res = (TCHAR*)mir_alloc(len + 1);
+ wchar_t *res = (wchar_t*)mir_alloc(len + 1);
if (res == NULL)
return NULL;
@@ -845,22 +845,22 @@ static TCHAR *parseUserName(ARGUMENTSINFO *ai)
}
// clipboard support
-static TCHAR *parseClipboard(ARGUMENTSINFO *ai)
+static wchar_t *parseClipboard(ARGUMENTSINFO *ai)
{
if (ai->argc != 1)
return NULL;
ai->flags |= AIF_DONTPARSE;
- TCHAR *res = NULL;
+ wchar_t *res = NULL;
if (IsClipboardFormatAvailable(CF_TEXT)) {
if (OpenClipboard(NULL)) {
HANDLE hData = GetClipboardData(CF_UNICODETEXT);
if (hData != NULL) {
- TCHAR *tszText = (TCHAR*)GlobalLock(hData);
+ wchar_t *tszText = (wchar_t*)GlobalLock(hData);
size_t len = mir_tstrlen(tszText);
- res = (TCHAR*)mir_alloc((len + 1) * sizeof(TCHAR));
+ res = (wchar_t*)mir_alloc((len + 1) * sizeof(wchar_t));
mir_tstrcpy(res, tszText);
res[len] = 0;
GlobalUnlock(hData);
diff --git a/plugins/Variables/src/parse_variables.cpp b/plugins/Variables/src/parse_variables.cpp
index bc19f44cfc..c54bbf6dce 100644
--- a/plugins/Variables/src/parse_variables.cpp
+++ b/plugins/Variables/src/parse_variables.cpp
@@ -24,7 +24,7 @@ static mir_cs csVarRegister;
static VARIABLEREGISTER *vr = NULL;
static int vrCount = 0;
-static int addToVariablesRegister(TCHAR *szName, TCHAR *szText)
+static int addToVariablesRegister(wchar_t *szName, wchar_t *szText)
{
if ((szName == NULL) || (szText == NULL) || (mir_tstrlen(szName) <= 0))
return -1;
@@ -48,7 +48,7 @@ static int addToVariablesRegister(TCHAR *szName, TCHAR *szText)
return 0;
}
-static TCHAR *searchVariableRegister(TCHAR *szName)
+static wchar_t *searchVariableRegister(wchar_t *szName)
{
if ((szName == NULL) || (mir_tstrlen(szName) <= 0))
return NULL;
@@ -61,7 +61,7 @@ static TCHAR *searchVariableRegister(TCHAR *szName)
return NULL;
}
-static TCHAR *parsePut(ARGUMENTSINFO *ai)
+static wchar_t *parsePut(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -77,7 +77,7 @@ static TCHAR *parsePut(ARGUMENTSINFO *ai)
return formatString(&fi);
}
-static TCHAR *parsePuts(ARGUMENTSINFO *ai)
+static wchar_t *parsePuts(ARGUMENTSINFO *ai)
{
if (ai->argc != 3)
return NULL;
@@ -88,7 +88,7 @@ static TCHAR *parsePuts(ARGUMENTSINFO *ai)
return mir_tstrdup(L"");
}
-static TCHAR *parseGet(ARGUMENTSINFO *ai)
+static wchar_t *parseGet(ARGUMENTSINFO *ai)
{
if (ai->argc != 2)
return NULL;
diff --git a/plugins/Variables/src/parse_variables.h b/plugins/Variables/src/parse_variables.h
index b623f5a4c1..ea83c3b1e0 100644
--- a/plugins/Variables/src/parse_variables.h
+++ b/plugins/Variables/src/parse_variables.h
@@ -18,8 +18,8 @@
*/
typedef struct {
- TCHAR *szName;
- TCHAR *szText;
+ wchar_t *szName;
+ wchar_t *szText;
DWORD dwOwnerThread;
} VARIABLEREGISTER;
diff --git a/plugins/Variables/src/stdafx.h b/plugins/Variables/src/stdafx.h
index 66570a7aa6..87b596ae77 100644
--- a/plugins/Variables/src/stdafx.h
+++ b/plugins/Variables/src/stdafx.h
@@ -88,7 +88,7 @@
#define SUBJECT L"subject"
#define MIR_EXTRATEXT L"extratext"
-#define VAR_HELP_TEXT LPGENT("--- Special characters ---\r\n\r\n\
+#define VAR_HELP_TEXT LPGENW("--- Special characters ---\r\n\r\n\
The following characters have a special meaning in a formatting string:\r\n\r\n\
?<function>(<arguments>)\r\n\
This will parse the function given the arguments, the result will be parsed again. Example: Today is ?cdate(yyyy/MM/dd).\r\n\r\n\
@@ -152,16 +152,16 @@ extern int hLangpack;
// variables.c
//int isValidTokenChar(char c);
-TCHAR *formatString(FORMATINFO *fi);
+wchar_t *formatString(FORMATINFO *fi);
int setParseOptions(struct ParseOptions *po);
int LoadVarModule();
int UnloadVarModule();
// tokenregister.c
-int registerIntToken(TCHAR *szToken, TCHAR *(*parseFunction)(ARGUMENTSINFO *ai), int extraFlags, char* szHelpText);
+int registerIntToken(wchar_t *szToken, wchar_t *(*parseFunction)(ARGUMENTSINFO *ai), int extraFlags, char* szHelpText);
INT_PTR registerToken(WPARAM wParam, LPARAM lParam);
-int deRegisterToken(TCHAR *var);
-TOKENREGISTEREX *searchRegister(TCHAR *var, int type);
-TCHAR *parseFromRegister(ARGUMENTSINFO *ai);
+int deRegisterToken(wchar_t *var);
+TOKENREGISTEREX *searchRegister(wchar_t *var, int type);
+wchar_t *parseFromRegister(ARGUMENTSINFO *ai);
TOKENREGISTEREX *getTokenRegister(int i);
int getTokenRegisterCount();
TOKENREGISTER *getTokenRegisterByIndex(int i);
@@ -169,9 +169,9 @@ void deRegisterTemporaryVariables();
int initTokenRegister();
int deinitTokenRegister();
// contact.c
-BYTE getContactInfoType(TCHAR* type);
-TCHAR* getContactInfoT(BYTE type, MCONTACT hContact);
-MCONTACT getContactFromString(const TCHAR *tszContact, DWORD dwFlags, int nMatch = 0);
+BYTE getContactInfoType(wchar_t* type);
+wchar_t* getContactInfoT(BYTE type, MCONTACT hContact);
+MCONTACT getContactFromString(const wchar_t *tszContact, DWORD dwFlags, int nMatch = 0);
int initContactModule();
int deinitContactModule();
// alias
@@ -206,5 +206,5 @@ INT_PTR showHelpExService(WPARAM wParam, LPARAM lParam);
INT_PTR getSkinItemService(WPARAM wParam, LPARAM lParam);
int iconsChanged(WPARAM wParam, LPARAM lParam);
-int ttoi(TCHAR *string);
-TCHAR *itot(int num);
+int ttoi(wchar_t *string);
+wchar_t *itot(int num);
diff --git a/plugins/Variables/src/tokenregister.cpp b/plugins/Variables/src/tokenregister.cpp
index b74465ce99..101d8024f1 100644
--- a/plugins/Variables/src/tokenregister.cpp
+++ b/plugins/Variables/src/tokenregister.cpp
@@ -39,19 +39,19 @@ static mir_cs csRegister;
unsigned long int hashlittle(void *key, size_t length, unsigned long int initval);
-static DWORD NameHashFunction(TCHAR *tszStr)
+static DWORD NameHashFunction(wchar_t *tszStr)
{
- return (DWORD)hashlittle(tszStr, mir_tstrlen(tszStr)*sizeof(TCHAR), 0);
+ return (DWORD)hashlittle(tszStr, mir_tstrlen(tszStr)*sizeof(wchar_t), 0);
}
-static TokenRegisterEntry* FindTokenRegisterByName(TCHAR *name)
+static TokenRegisterEntry* FindTokenRegisterByName(wchar_t *name)
{
TokenRegisterEntry temp;
temp.nameHash = NameHashFunction(name);
return tokens.find(&temp);
}
-int registerIntToken(TCHAR *szToken, TCHAR *(*parseFunction)(ARGUMENTSINFO *ai), int extraFlags, char* szHelpText)
+int registerIntToken(wchar_t *szToken, wchar_t *(*parseFunction)(ARGUMENTSINFO *ai), int extraFlags, char* szHelpText)
{
TOKENREGISTEREX tr = { 0 };
tr.cbSize = sizeof(tr);
@@ -65,7 +65,7 @@ int registerIntToken(TCHAR *szToken, TCHAR *(*parseFunction)(ARGUMENTSINFO *ai),
return registerToken(0, (LPARAM)&tr);
}
-int deRegisterToken(TCHAR *token)
+int deRegisterToken(wchar_t *token)
{
if (token == NULL)
return -1;
@@ -143,7 +143,7 @@ INT_PTR registerToken(WPARAM, LPARAM lParam)
return 0;
}
-TOKENREGISTEREX *searchRegister(TCHAR *tvar, int type)
+TOKENREGISTEREX *searchRegister(wchar_t *tvar, int type)
{
if (tvar == NULL)
return 0;
@@ -156,13 +156,13 @@ TOKENREGISTEREX *searchRegister(TCHAR *tvar, int type)
return &tre->tr;
}
-TCHAR *parseFromRegister(ARGUMENTSINFO *ai)
+wchar_t *parseFromRegister(ARGUMENTSINFO *ai)
{
if (ai == NULL || ai->argc == 0 || ai->targv[0] == NULL)
return NULL;
INT_PTR callRes = 0;
- TCHAR *res = NULL;
+ wchar_t *res = NULL;
mir_cslock lck(csRegister);
@@ -200,14 +200,14 @@ TCHAR *parseFromRegister(ARGUMENTSINFO *ai)
else if (thisVr->szService != NULL)
callRes = CallService(thisVr->szService, 0, (LPARAM)ai);
- if ((TCHAR*)callRes != NULL)
- res = mir_tstrdup((TCHAR*)callRes);
+ if ((wchar_t*)callRes != NULL)
+ res = mir_tstrdup((wchar_t*)callRes);
}
if (callRes != NULL) {
if (trCopy.flags & TRF_CLEANUP) {
if (trCopy.flags & TRF_CLEANUPFUNC)
- trCopy.cleanupFunctionT((TCHAR*)callRes);
+ trCopy.cleanupFunctionT((wchar_t*)callRes);
else if (trCopy.szCleanupService != NULL)
CallService(trCopy.szCleanupService, 0, (LPARAM)callRes);
}
diff --git a/plugins/Variables/src/variables.cpp b/plugins/Variables/src/variables.cpp
index 83c34b279a..44920139f4 100644
--- a/plugins/Variables/src/variables.cpp
+++ b/plugins/Variables/src/variables.cpp
@@ -36,16 +36,16 @@ HCURSOR hCurSplitNS;
struct ParseOptions gParseOpts;
-TCHAR* getArguments(TCHAR *string, TArgList &argv)
+wchar_t* getArguments(wchar_t *string, TArgList &argv)
{
- TCHAR *cur = string;
+ wchar_t *cur = string;
while (*cur == ' ')
cur++;
if (*cur != '(')
return NULL;
- TCHAR *scur = cur;
+ wchar_t *scur = cur;
cur++;
int brackets = 0;
bool bDontParse = false, bNewArg = false, bDone = false;
@@ -74,7 +74,7 @@ TCHAR* getArguments(TCHAR *string, TArgList &argv)
}
if (bNewArg) {
- TCHAR *tszArg = NULL;
+ wchar_t *tszArg = NULL;
if (cur > scur)
tszArg = mir_tstrndup(scur + 1, cur - (scur + 1));
if (tszArg == NULL)
@@ -96,7 +96,7 @@ TCHAR* getArguments(TCHAR *string, TArgList &argv)
return cur;
}
-int isValidTokenChar(TCHAR tc)
+int isValidTokenChar(wchar_t tc)
{
return
@@ -111,14 +111,14 @@ int isValidTokenChar(TCHAR tc)
}
/* pretty much the main loop */
-static TCHAR* replaceDynVars(FORMATINFO *fi)
+static wchar_t* replaceDynVars(FORMATINFO *fi)
{
if (fi->tszFormat == NULL)
return NULL;
int i, scurPos, curPos, tmpVarPos;
- TCHAR *string = mir_tstrdup(fi->tszFormat);
+ wchar_t *string = mir_tstrdup(fi->tszFormat);
if (string == NULL)
return NULL;
@@ -129,56 +129,56 @@ static TCHAR* replaceDynVars(FORMATINFO *fi)
for (size_t pos = 0; pos < mir_tstrlen(string); pos++) {
// string may move in memory, iterate by remembering the position in the string
- TCHAR *cur = string + pos;
+ wchar_t *cur = string + pos;
// new round
if (*cur == DONTPARSE_CHAR) {
- memmove(cur, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(TCHAR));
+ memmove(cur, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(wchar_t));
if (*cur == DONTPARSE_CHAR)
continue;
while ((*cur != DONTPARSE_CHAR) && (*cur != 0))
cur++;
- memmove(cur, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(TCHAR));
+ memmove(cur, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(wchar_t));
pos = cur - string - 1;
continue;
}
// remove end of lines
- else if ((!_tcsncmp(cur, L"\r\n", 2)) && (gParseOpts.bStripEOL)) {
- memmove(cur, cur + 2, (mir_tstrlen(cur + 2) + 1)*sizeof(TCHAR));
+ else if ((!wcsncmp(cur, L"\r\n", 2)) && (gParseOpts.bStripEOL)) {
+ memmove(cur, cur + 2, (mir_tstrlen(cur + 2) + 1)*sizeof(wchar_t));
pos = cur - string - 1;
continue;
}
else if ((*cur == '\n' && gParseOpts.bStripEOL) || (*cur == ' ' && gParseOpts.bStripWS)) {
- memmove(cur, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(TCHAR));
+ memmove(cur, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(wchar_t));
pos = cur - string - 1;
continue;
}
// remove comments
- else if (!_tcsncmp(cur, _T(COMMENT_STRING), mir_tstrlen(_T(COMMENT_STRING)))) {
- TCHAR *scur = cur;
- while (_tcsncmp(cur, L"\r\n", 2) && *cur != '\n' && *cur != 0)
+ else if (!wcsncmp(cur, _T(COMMENT_STRING), mir_tstrlen(_T(COMMENT_STRING)))) {
+ wchar_t *scur = cur;
+ while (wcsncmp(cur, L"\r\n", 2) && *cur != '\n' && *cur != 0)
cur++;
if (*cur == 0) {
*scur = 0;
- string = (TCHAR*)mir_realloc(string, (mir_tstrlen(string) + 1)*sizeof(TCHAR));
+ string = (wchar_t*)mir_realloc(string, (mir_tstrlen(string) + 1)*sizeof(wchar_t));
continue;
}
- memmove(scur, cur, (mir_tstrlen(cur) + 1)*sizeof(TCHAR));
+ memmove(scur, cur, (mir_tstrlen(cur) + 1)*sizeof(wchar_t));
pos = scur - string - 1;
continue;
}
else if ((*cur != FIELD_CHAR) && (*cur != FUNC_CHAR) && (*cur != FUNC_ONCE_CHAR)) {
if (gParseOpts.bStripAll) {
- memmove(cur, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(TCHAR));
+ memmove(cur, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(wchar_t));
pos = cur - string - 1;
}
continue;
}
- TCHAR *scur = cur + 1, *tcur = scur;
+ wchar_t *scur = cur + 1, *tcur = scur;
while (isValidTokenChar(*tcur))
tcur++;
@@ -224,7 +224,7 @@ static TCHAR* replaceDynVars(FORMATINFO *fi)
}
else if ((*cur == FUNC_CHAR) || (*cur == FUNC_ONCE_CHAR)) {
cur += mir_tstrlen(tr->tszTokenString) + 1;
- TCHAR *argcur = getArguments(cur, argv);
+ wchar_t *argcur = getArguments(cur, argv);
if (argcur == cur || argcur == NULL) {
fi->eCount++;
// error getting arguments
@@ -282,7 +282,7 @@ static TCHAR* replaceDynVars(FORMATINFO *fi)
curPos = cur - string;
if (tokenLen < parsedTokenLen) {
// string needs more memory
- string = (TCHAR*)mir_realloc(string, (initStrLen - tokenLen + parsedTokenLen + 1)*sizeof(TCHAR));
+ string = (wchar_t*)mir_realloc(string, (initStrLen - tokenLen + parsedTokenLen + 1)*sizeof(wchar_t));
if (string == NULL) {
fi->eCount++;
return NULL;
@@ -290,11 +290,11 @@ static TCHAR* replaceDynVars(FORMATINFO *fi)
}
scur = string + scurPos;
cur = string + curPos;
- memmove(scur + parsedTokenLen, cur, (mir_tstrlen(cur) + 1)*sizeof(TCHAR));
- memcpy(scur, parsedToken, parsedTokenLen*sizeof(TCHAR));
+ memmove(scur + parsedTokenLen, cur, (mir_tstrlen(cur) + 1)*sizeof(wchar_t));
+ memcpy(scur, parsedToken, parsedTokenLen*sizeof(wchar_t));
{
size_t len = mir_tstrlen(string);
- string = (TCHAR*)mir_realloc(string, (len + 1)*sizeof(TCHAR));
+ string = (wchar_t*)mir_realloc(string, (len + 1)*sizeof(wchar_t));
}
if ((ai.flags & AIF_DONTPARSE) || tmpVarPos >= 0)
pos += parsedTokenLen;
@@ -302,7 +302,7 @@ static TCHAR* replaceDynVars(FORMATINFO *fi)
pos--; // parse the same pos again, it changed
}
- return (TCHAR*)mir_realloc(string, (mir_tstrlen(string) + 1)*sizeof(TCHAR));
+ return (wchar_t*)mir_realloc(string, (mir_tstrlen(string) + 1)*sizeof(wchar_t));
}
/*
@@ -314,7 +314,7 @@ static INT_PTR formatStringService(WPARAM wParam, LPARAM)
int i;
BOOL copied;
FORMATINFO *fi, tempFi;
- TCHAR *tszFormat, *orgFormat, *tszSource, *orgSource, *tRes;
+ wchar_t *tszFormat, *orgFormat, *tszSource, *orgSource, *tRes;
if (((FORMATINFO *)wParam)->cbSize >= sizeof(FORMATINFO)) {
memset(&tempFi, 0, sizeof(FORMATINFO));
@@ -384,7 +384,7 @@ static INT_PTR formatStringService(WPARAM wParam, LPARAM)
return res;
}
-TCHAR* formatString(FORMATINFO *fi)
+wchar_t* formatString(FORMATINFO *fi)
{
if (fi == NULL)
return NULL;
diff --git a/plugins/Watrack_MPD/src/init.cpp b/plugins/Watrack_MPD/src/init.cpp
index b93924c163..d5328df19b 100755
--- a/plugins/Watrack_MPD/src/init.cpp
+++ b/plugins/Watrack_MPD/src/init.cpp
@@ -19,7 +19,7 @@
HINSTANCE hInst;
BOOL bWatrackService = FALSE;
int hLangpack = 0;
-TCHAR *gbHost, *gbPassword;
+wchar_t *gbHost, *gbPassword;
WORD gbPort;
HANDLE ghNetlibUser;
diff --git a/plugins/Watrack_MPD/src/options.cpp b/plugins/Watrack_MPD/src/options.cpp
index 54d0c2d6ce..315c2f4100 100755
--- a/plugins/Watrack_MPD/src/options.cpp
+++ b/plugins/Watrack_MPD/src/options.cpp
@@ -24,7 +24,7 @@ static INT_PTR CALLBACK DlgProcWaMpdOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM
{
TranslateDialogDefault(hwndDlg);
SetDlgItemInt(hwndDlg, IDC_PORT, db_get_w(NULL, szModuleName, "Port", 6600), FALSE);
- TCHAR *tmp = UniGetContactSettingUtf(NULL, szModuleName, "Server", L"127.0.0.1");
+ wchar_t *tmp = UniGetContactSettingUtf(NULL, szModuleName, "Server", L"127.0.0.1");
SetDlgItemText(hwndDlg, IDC_SERVER, tmp);
mir_free(tmp);
tmp = UniGetContactSettingUtf(NULL, szModuleName, "Password", L"");
@@ -47,7 +47,7 @@ static INT_PTR CALLBACK DlgProcWaMpdOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM
case PSN_APPLY:
{
- TCHAR szText[256];
+ wchar_t szText[256];
db_set_w(NULL, szModuleName, "Port", (WORD)GetDlgItemInt(hwndDlg, IDC_PORT, NULL, FALSE));
gbPort = (WORD)GetDlgItemInt(hwndDlg, IDC_PORT, NULL, FALSE);
GetDlgItemText(hwndDlg, IDC_SERVER, szText, _countof(szText));
@@ -71,9 +71,9 @@ int WaMpdOptInit(WPARAM wParam,LPARAM)
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_WA_MPD);
- odp.ptszTitle = LPGENT("Winamp Track");
- odp.ptszGroup = LPGENT("Plugins");
- odp.ptszTab = LPGENT("Watrack MPD");
+ odp.pwszTitle = LPGENW("Winamp Track");
+ odp.pwszGroup = LPGENW("Plugins");
+ odp.pwszTab = LPGENW("Watrack MPD");
odp.flags=ODPF_BOLDGROUPS|ODPF_TCHAR;
odp.pfnDlgProc = DlgProcWaMpdOpts;
Options_AddPage(wParam, &odp);
diff --git a/plugins/Watrack_MPD/src/stdafx.h b/plugins/Watrack_MPD/src/stdafx.h
index ae1ef95c07..f339704541 100755
--- a/plugins/Watrack_MPD/src/stdafx.h
+++ b/plugins/Watrack_MPD/src/stdafx.h
@@ -36,7 +36,7 @@
extern HINSTANCE hInst;
extern HANDLE ghNetlibUser;
extern BOOL bWatrackService;
-extern TCHAR *gbHost, *gbPassword;
+extern wchar_t *gbHost, *gbPassword;
extern WORD gbPort;
extern char *date();
diff --git a/plugins/Watrack_MPD/src/utilities.cpp b/plugins/Watrack_MPD/src/utilities.cpp
index 735c5f121a..edaf3f42bd 100755
--- a/plugins/Watrack_MPD/src/utilities.cpp
+++ b/plugins/Watrack_MPD/src/utilities.cpp
@@ -17,8 +17,8 @@
#include "stdafx.h"
-TCHAR* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,const char* szSetting, TCHAR* szDef)
+wchar_t* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,const char* szSetting, wchar_t* szDef)
{
- TCHAR *szRes = db_get_tsa(hContact, szModule, szSetting);
+ wchar_t *szRes = db_get_tsa(hContact, szModule, szSetting);
return szRes ? szRes : mir_tstrdup(szDef);
}
diff --git a/plugins/Watrack_MPD/src/utilities.h b/plugins/Watrack_MPD/src/utilities.h
index 39ee598973..3f594c7084 100755
--- a/plugins/Watrack_MPD/src/utilities.h
+++ b/plugins/Watrack_MPD/src/utilities.h
@@ -1,6 +1,6 @@
#ifndef UTILITIES_H
#define UTILITIES_H
-TCHAR* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,const char* szSetting, TCHAR* szDef);
+wchar_t* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModule,const char* szSetting, wchar_t* szDef);
#endif
diff --git a/plugins/Weather/src/stdafx.h b/plugins/Weather/src/stdafx.h
index a0bced3797..73a3eb9a60 100644
--- a/plugins/Weather/src/stdafx.h
+++ b/plugins/Weather/src/stdafx.h
@@ -187,19 +187,19 @@ struct MYOPTIONS
WORD pUnit;
WORD dUnit;
WORD eUnit;
- TCHAR DegreeSign[4];
+ wchar_t DegreeSign[4];
BYTE DoNotAppendUnit;
BYTE NoFrac;
// texts
- TCHAR *cText;
- TCHAR *bTitle;
- TCHAR *bText;
- TCHAR *nText;
- TCHAR *eText;
- TCHAR *hText;
- TCHAR *xText;
- TCHAR *sText;
+ wchar_t *cText;
+ wchar_t *bTitle;
+ wchar_t *bText;
+ wchar_t *nText;
+ wchar_t *eText;
+ wchar_t *hText;
+ wchar_t *xText;
+ wchar_t *sText;
// advanced
BYTE DisCondIcon;
@@ -224,11 +224,11 @@ struct MYOPTIONS
DWORD pDelay;
// popup texts
- TCHAR *pTitle;
- TCHAR *pText;
+ wchar_t *pTitle;
+ wchar_t *pText;
// other misc stuff
- TCHAR Default[64];
+ wchar_t Default[64];
MCONTACT DefStn;
};
@@ -253,12 +253,12 @@ void DestroyUpdateList(void);
#define WID_BREAK 2
typedef struct {
- TCHAR *Name;
- TCHAR *Start;
- TCHAR *End;
- TCHAR *Unit;
+ wchar_t *Name;
+ wchar_t *Start;
+ wchar_t *End;
+ wchar_t *Unit;
char *Url;
- TCHAR *Break;
+ wchar_t *Break;
int Type;
} WIDATAITEM;
@@ -272,27 +272,27 @@ typedef struct WITEMLIST WIDATAITEMLIST;
typedef struct {
BOOL Available;
char *SearchURL;
- TCHAR *NotFoundStr;
+ wchar_t *NotFoundStr;
WIDATAITEM Name;
} WIIDSEARCH;
typedef struct {
BOOL Available;
- TCHAR *First;
+ wchar_t *First;
WIDATAITEM Name;
WIDATAITEM ID;
} WINAMESEARCHTYPE;
typedef struct {
char *SearchURL;
- TCHAR *NotFoundStr;
- TCHAR *SingleStr;
+ wchar_t *NotFoundStr;
+ wchar_t *SingleStr;
WINAMESEARCHTYPE Single;
WINAMESEARCHTYPE Multiple;
} WINAMESEARCH;
struct STRLIST {
- TCHAR *Item;
+ wchar_t *Item;
struct STRLIST *Next;
};
@@ -304,22 +304,22 @@ typedef struct {
} WICONDLIST;
typedef struct {
- TCHAR *FileName;
- TCHAR *ShortFileName;
+ wchar_t *FileName;
+ wchar_t *ShortFileName;
BOOL Enabled;
// header
- TCHAR *DisplayName;
- TCHAR *InternalName;
- TCHAR *Description;
- TCHAR *Author;
- TCHAR *Version;
+ wchar_t *DisplayName;
+ wchar_t *InternalName;
+ wchar_t *Description;
+ wchar_t *Author;
+ wchar_t *Version;
int InternalVer;
size_t MemUsed;
// default
char *DefaultURL;
- TCHAR *DefaultMap;
+ wchar_t *DefaultMap;
char *UpdateURL;
char *UpdateURL2;
char *UpdateURL3;
@@ -371,8 +371,8 @@ extern BOOL ThreadRunning;
INT_PTR WeatherAddToList(WPARAM wParam,LPARAM lParam);
BOOL CheckSearch();
-int IDSearch(TCHAR *id, const int searchId);
-int NameSearch(TCHAR *name, const int searchId);
+int IDSearch(wchar_t *id, const int searchId);
+int NameSearch(wchar_t *name, const int searchId);
INT_PTR WeatherBasicSearch(WPARAM wParam,LPARAM lParam);
INT_PTR WeatherCreateAdvancedSearchUI(WPARAM wParam, LPARAM lParam);
@@ -391,36 +391,36 @@ int ContactDeleted(WPARAM wParam,LPARAM lParam);
BOOL IsMyContact(MCONTACT hContact);
// functions in weather_conv.c
-void GetTemp(TCHAR *tempchar, TCHAR *unit, TCHAR *str);
-void GetSpeed(TCHAR *tempchar, TCHAR *unit, TCHAR *str);
-void GetPressure(TCHAR *tempchar, TCHAR *unit, TCHAR *str);
-void GetDist(TCHAR *tempchar, TCHAR *unit, TCHAR *str);
-void GetElev(TCHAR *tempchar, TCHAR *unit, TCHAR *str);
-
-WORD GetIcon(const TCHAR* cond, WIDATA *Data);
-void CaseConv(TCHAR *str);
+void GetTemp(wchar_t *tempchar, wchar_t *unit, wchar_t *str);
+void GetSpeed(wchar_t *tempchar, wchar_t *unit, wchar_t *str);
+void GetPressure(wchar_t *tempchar, wchar_t *unit, wchar_t *str);
+void GetDist(wchar_t *tempchar, wchar_t *unit, wchar_t *str);
+void GetElev(wchar_t *tempchar, wchar_t *unit, wchar_t *str);
+
+WORD GetIcon(const wchar_t* cond, WIDATA *Data);
+void CaseConv(wchar_t *str);
void TrimString(char *str);
void TrimString(WCHAR *str);
void ConvertBackslashes(char *str);
char *GetSearchStr(char *dis);
-TCHAR *GetDisplay(WEATHERINFO *w, const TCHAR *dis, TCHAR* str);
+wchar_t *GetDisplay(WEATHERINFO *w, const wchar_t *dis, wchar_t* str);
INT_PTR GetDisplaySvcFunc(WPARAM wParam, LPARAM lParam);
-void GetSvc(TCHAR *pszID);
-void GetID(TCHAR *pszID);
+void GetSvc(wchar_t *pszID);
+void GetID(wchar_t *pszID);
-TCHAR *GetError(int code);
+wchar_t *GetError(int code);
// functions in weather_data.c
-void GetStationID(MCONTACT hContact, TCHAR* id, int idlen);
+void GetStationID(MCONTACT hContact, wchar_t* id, int idlen);
WEATHERINFO LoadWeatherInfo(MCONTACT Change);
int DBGetData(MCONTACT hContact, char *setting, DBVARIANT *dbv);
void EraseAllInfo(void);
-void GetDataValue(WIDATAITEM *UpdateData, TCHAR *Data, TCHAR** szInfo);
-void ConvertDataValue(WIDATAITEM *UpdateData, TCHAR *Data);
+void GetDataValue(WIDATAITEM *UpdateData, wchar_t *Data, wchar_t** szInfo);
+void ConvertDataValue(WIDATAITEM *UpdateData, wchar_t *Data);
void wSetData(char **Data, const char *Value);
void wSetData(WCHAR **Data, const char *Value);
void wSetData(WCHAR **Data, const WCHAR *Value);
@@ -430,14 +430,14 @@ void wfree(WCHAR **Data);
void DBDataManage(MCONTACT hContact, WORD Mode, WPARAM wParam, LPARAM lParam);
// functions in weather_http.c
-int InternetDownloadFile (char *szUrl, char *cookie, char *userAgent, TCHAR** szData);
+int InternetDownloadFile (char *szUrl, char *cookie, char *userAgent, wchar_t** szData);
void NetlibInit();
void NetlibHttpDisconnect(void);
// functions in weather_ini.c
-WIDATA* GetWIData(TCHAR *pszServ);
+WIDATA* GetWIData(wchar_t *pszServ);
-bool IsContainedInCondList(const TCHAR *pszStr, WICONDLIST *List);
+bool IsContainedInCondList(const wchar_t *pszStr, WICONDLIST *List);
void DestroyWIList();
bool LoadWIData(bool dial);
@@ -445,7 +445,7 @@ bool LoadWIData(bool dial);
INT_PTR CALLBACK DlgPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
// functions in weather_info.c
-void GetINIInfo(TCHAR *pszSvc);
+void GetINIInfo(wchar_t *pszSvc);
void MoreVarList();
@@ -460,7 +460,7 @@ int OptInit(WPARAM wParam,LPARAM lParam);
// functions in weather_popup.c
int WeatherPopup(WPARAM wParam, LPARAM lParam);
int WeatherError(WPARAM wParam, LPARAM lParam);
-int WPShowMessage(TCHAR* lpzText, WORD kind);
+int WPShowMessage(wchar_t* lpzText, WORD kind);
LRESULT CALLBACK PopupWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp
index 00d6b0baee..188bd35fe3 100644
--- a/plugins/Weather/src/weather.cpp
+++ b/plugins/Weather/src/weather.cpp
@@ -226,11 +226,11 @@ extern "C" int __declspec(dllexport) Load(void)
InitServices();
// add sound event
- SkinAddNewSoundExT("weatherupdated", _T(WEATHERPROTONAME), LPGENT("Weather Condition Changed"));
- SkinAddNewSoundExT("weatheralert", _T(WEATHERPROTONAME), LPGENT("Weather Alert Issued"));
+ SkinAddNewSoundExT("weatherupdated", _T(WEATHERPROTONAME), LPGENW("Weather Condition Changed"));
+ SkinAddNewSoundExT("weatheralert", _T(WEATHERPROTONAME), LPGENW("Weather Alert Issued"));
// window needed for popup commands
- TCHAR SvcFunc[100];
+ wchar_t SvcFunc[100];
mir_sntprintf(SvcFunc, L"%s__PopupWindow", _T(WEATHERPROTONAME));
hPopupWindow = CreateWindowEx(WS_EX_TOOLWINDOW, L"static", SvcFunc, 0, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, hInst, NULL);
diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp
index 304f1d2641..bf999c9dea 100644
--- a/plugins/Weather/src/weather_addstn.cpp
+++ b/plugins/Weather/src/weather_addstn.cpp
@@ -26,7 +26,7 @@ to the contact list. Contain code for both name and ID search.
// variables used for weather_addstn.c
static int sttSearchId = -1;
-static TCHAR name1[256];
+static wchar_t name1[256];
// ============ ADDING NEW STATION ============
@@ -35,7 +35,7 @@ static TCHAR name1[256];
INT_PTR WeatherAddToList(WPARAM, LPARAM lParam)
{
PROTOSEARCHRESULT *psr = (PROTOSEARCHRESULT*)lParam;
- if (!psr || !psr->email.t)
+ if (!psr || !psr->email.w)
return 0;
// search for existing contact
@@ -45,7 +45,7 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam)
DBVARIANT dbv;
// check ID to see if the contact already exist in the database
if (!db_get_ts(hContact, WEATHERPROTONAME, "ID", &dbv)) {
- if (!mir_tstrcmpi(psr->email.t, dbv.ptszVal)) {
+ if (!mir_tstrcmpi(psr->email.w, dbv.ptszVal)) {
// remove the flag for not on list and hidden, thus make the contact visible
// and add them on the list
if (db_get_b(hContact, "CList", "NotOnList", 1)) {
@@ -69,11 +69,11 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam)
CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE);
// set contact info and settings
- TCHAR svc[256];
- _tcsncpy(svc, psr->email.t, _countof(svc)); svc[_countof(svc) - 1] = 0;
+ wchar_t svc[256];
+ wcsncpy(svc, psr->email.w, _countof(svc)); svc[_countof(svc) - 1] = 0;
GetSvc(svc);
// set settings by obtaining the default for the service
- if (psr->lastName.t[0] != 0) {
+ if (psr->lastName.w[0] != 0) {
WIDATA *sData = GetWIData(svc);
db_set_ts(hContact, WEATHERPROTONAME, "MapURL", sData->DefaultMap);
db_set_s(hContact, WEATHERPROTONAME, "InfoURL", sData->DefaultURL);
@@ -83,14 +83,14 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam)
db_set_s(hContact, WEATHERPROTONAME, "InfoURL", "");
}
// write the other info and settings to the database
- db_set_ts(hContact, WEATHERPROTONAME, "ID", psr->email.t);
- db_set_ts(hContact, WEATHERPROTONAME, "Nick", psr->nick.t);
+ db_set_ts(hContact, WEATHERPROTONAME, "ID", psr->email.w);
+ db_set_ts(hContact, WEATHERPROTONAME, "Nick", psr->nick.w);
db_set_w(hContact, WEATHERPROTONAME, "Status", ID_STATUS_OFFLINE);
AvatarDownloaded(hContact);
- TCHAR str[256];
- mir_sntprintf(str, TranslateT("Current weather information for %s."), psr->nick.t);
+ wchar_t str[256];
+ mir_sntprintf(str, TranslateT("Current weather information for %s."), psr->nick.w);
db_set_ts(hContact, WEATHERPROTONAME, "About", str);
// make the last update tags to something invalid
@@ -134,7 +134,7 @@ BOOL CheckSearch()
// ============ BASIC ID SEARCH ============
-static TCHAR sttSID[32];
+static wchar_t sttSID[32];
// A timer process for the ID search (threaded)
static void __cdecl BasicSearchTimerProc(LPVOID)
@@ -156,7 +156,7 @@ static void __cdecl BasicSearchTimerProc(LPVOID)
INT_PTR WeatherBasicSearch(WPARAM, LPARAM lParam)
{
if (sttSearchId != -1) return 0; //only one search at a time
- _tcsncpy(sttSID, (TCHAR*)lParam, _countof(sttSID));
+ wcsncpy(sttSID, (wchar_t*)lParam, _countof(sttSID));
sttSID[_countof(sttSID) - 1] = 0;
sttSearchId = 1;
// create a thread for the ID search
@@ -225,22 +225,22 @@ INT_PTR WeatherAdvancedSearch(WPARAM, LPARAM lParam)
// searchId = -1
// sData = the ID search data for that particular weather service
// svcname = the name of the weather service that is currently searching (ie. Yahoo Weather)
-int IDSearchProc(TCHAR *sID, const int searchId, WIIDSEARCH *sData, TCHAR *svc, TCHAR *svcname)
+int IDSearchProc(wchar_t *sID, const int searchId, WIIDSEARCH *sData, wchar_t *svc, wchar_t *svcname)
{
- TCHAR str[MAX_DATA_LEN], newID[MAX_DATA_LEN];
+ wchar_t str[MAX_DATA_LEN], newID[MAX_DATA_LEN];
if (sData->Available) {
char loc[255];
- TCHAR *szData = NULL;
+ wchar_t *szData = NULL;
// load the page
mir_snprintf(loc, sData->SearchURL, sID);
BOOL bFound = (InternetDownloadFile(loc, NULL, NULL, &szData) == 0);
if (bFound) {
- TCHAR* szInfo = szData;
+ wchar_t* szInfo = szData;
// not found
- if (_tcsstr(szInfo, sData->NotFoundStr) == NULL)
+ if (wcsstr(szInfo, sData->NotFoundStr) == NULL)
GetDataValue(&sData->Name, str, &szInfo);
}
@@ -250,16 +250,16 @@ int IDSearchProc(TCHAR *sID, const int searchId, WIIDSEARCH *sData, TCHAR *svc,
}
// give no station name but only ID if the search is unavailable
- else _tcsncpy(str, TranslateT("<Enter station name here>"), MAX_DATA_LEN - 1);
+ else wcsncpy(str, TranslateT("<Enter station name here>"), MAX_DATA_LEN - 1);
mir_sntprintf(newID, L"%s/%s", svc, sID);
// set the search result and broadcast it
PROTOSEARCHRESULT psr = { sizeof(psr) };
psr.flags = PSR_TCHAR;
- psr.nick.t = str;
- psr.firstName.t = L" ";
- psr.lastName.t = svcname;
- psr.email.t = newID;
+ psr.nick.w = str;
+ psr.firstName.w = L" ";
+ psr.lastName.w = svcname;
+ psr.email.w = newID;
ProtoBroadcastAck(WEATHERPROTONAME, NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)searchId, (LPARAM)&psr);
return 0;
@@ -269,7 +269,7 @@ int IDSearchProc(TCHAR *sID, const int searchId, WIIDSEARCH *sData, TCHAR *svc,
// sID: the ID to search for
// searchId: don't change
// return 0 if no error
-int IDSearch(TCHAR *sID, const int searchId)
+int IDSearch(wchar_t *sID, const int searchId)
{
// for a normal ID search (ID != #)
if (mir_tstrcmp(sID, L"#")) {
@@ -287,10 +287,10 @@ int IDSearch(TCHAR *sID, const int searchId)
// return an empty contact on "#"
PROTOSEARCHRESULT psr = { sizeof(psr) };
psr.flags = PSR_TCHAR;
- psr.nick.t = TranslateT("<Enter station name here>"); // to be entered
- psr.firstName.t = L" ";
- psr.lastName.t = L"";
- psr.email.t = TranslateT("<Enter station ID here>"); // to be entered
+ psr.nick.w = TranslateT("<Enter station name here>"); // to be entered
+ psr.firstName.w = L" ";
+ psr.lastName.w = L"";
+ psr.email.w = TranslateT("<Enter station ID here>"); // to be entered
ProtoBroadcastAck(WEATHERPROTONAME, NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)searchId, (LPARAM)&psr);
}
@@ -304,21 +304,21 @@ int IDSearch(TCHAR *sID, const int searchId)
// searchId = -1
// sData = the name search data for that particular weather service
// svcname = the name of the weather service that is currently searching (ie. Yahoo Weather)
-int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR *svc, TCHAR *svcname)
+int NameSearchProc(wchar_t *name, const int searchId, WINAMESEARCH *sData, wchar_t *svc, wchar_t *svcname)
{
- TCHAR Name[MAX_DATA_LEN], str[MAX_DATA_LEN], sID[MAX_DATA_LEN], *szData = NULL, *search;
+ wchar_t Name[MAX_DATA_LEN], str[MAX_DATA_LEN], sID[MAX_DATA_LEN], *szData = NULL, *search;
// replace spaces with %20
char loc[256];
T2Utf szSearchName(name);
mir_snprintf(loc, sData->SearchURL, ptrA(mir_urlEncode(szSearchName)));
if (InternetDownloadFile(loc, NULL, NULL, &szData) == 0) {
- TCHAR* szInfo = szData;
- search = _tcsstr(szInfo, sData->NotFoundStr); // determine if data is available
+ wchar_t* szInfo = szData;
+ search = wcsstr(szInfo, sData->NotFoundStr); // determine if data is available
if (search == NULL) { // if data is found
// test if it is single result
if (sData->Single.Available && sData->Multiple.Available)
- search = _tcsstr(szInfo, sData->SingleStr);
+ search = wcsstr(szInfo, sData->SingleStr);
// for single result
if (sData->Single.Available && (search != NULL || !sData->Multiple.Available)) { // single result
// if station ID appears first in the downloaded data
@@ -344,16 +344,16 @@ int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR *
// if can't get the name, use the search string as name
if (Name[0] == 0)
- _tcsncpy(Name, name, _countof(Name));
+ wcsncpy(Name, name, _countof(Name));
// set the data and broadcast it
PROTOSEARCHRESULT psr = { sizeof(psr) };
psr.flags = PSR_TCHAR;
- psr.nick.t = Name;
- psr.firstName.t = L" ";
- psr.lastName.t = svcname;
- psr.email.t = sID;
- psr.id.t = sID;
+ psr.nick.w = Name;
+ psr.firstName.w = L" ";
+ psr.lastName.w = svcname;
+ psr.email.w = sID;
+ psr.id.w = sID;
ProtoBroadcastAck(WEATHERPROTONAME, NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)searchId, (LPARAM)&psr);
mir_free(szData);
return 0;
@@ -383,15 +383,15 @@ int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR *
// if can't get the name, use the search string as name
if (Name[0] == 0)
- _tcsncpy(Name, name, _countof(Name));
+ wcsncpy(Name, name, _countof(Name));
PROTOSEARCHRESULT psr = { sizeof(psr) };
psr.flags = PSR_TCHAR;
- psr.nick.t = Name;
- psr.firstName.t = L"";
- psr.lastName.t = svcname;
- psr.email.t = sID;
- psr.id.t = sID;
+ psr.nick.w = Name;
+ psr.firstName.w = L"";
+ psr.lastName.w = svcname;
+ psr.email.w = sID;
+ psr.id.w = sID;
ProtoBroadcastAck(WEATHERPROTONAME, NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)searchId, (LPARAM)&psr);
}
}
@@ -409,7 +409,7 @@ int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR *
// name: the station name to search for
// searchId: don't change
// return 0 if no error
-int NameSearch(TCHAR *name, const int searchId)
+int NameSearch(wchar_t *name, const int searchId)
{
WIDATALIST *Item = WIHead;
diff --git a/plugins/Weather/src/weather_contacts.cpp b/plugins/Weather/src/weather_contacts.cpp
index 447837c76e..77ecbb11cd 100644
--- a/plugins/Weather/src/weather_contacts.cpp
+++ b/plugins/Weather/src/weather_contacts.cpp
@@ -25,9 +25,9 @@ the contact.
#include "stdafx.h"
-static void OpenUrl(TCHAR* format, TCHAR* id)
+static void OpenUrl(wchar_t* format, wchar_t* id)
{
- TCHAR loc[512];
+ wchar_t loc[512];
GetID(id);
mir_sntprintf(loc, format, id);
Utils_OpenUrlT(loc);
@@ -56,7 +56,7 @@ INT_PTR ViewLog(WPARAM wParam, LPARAM lParam)
// wParam = current contact
INT_PTR LoadForecast(WPARAM wParam, LPARAM)
{
- TCHAR id[256], loc2[256];
+ wchar_t id[256], loc2[256];
GetStationID(wParam, id, _countof(id));
if (id[0] != 0) {
// check if the complte forecast URL is set. If it is not, display warning and quit
@@ -74,7 +74,7 @@ INT_PTR LoadForecast(WPARAM wParam, LPARAM)
// wParam = current contact
INT_PTR WeatherMap(WPARAM wParam, LPARAM)
{
- TCHAR id[256], loc2[256];
+ wchar_t id[256], loc2[256];
GetStationID(wParam, id, _countof(id));
if (id[0] != 0) {
// check if the weather map URL is set. If it is not, display warning and quit
@@ -106,7 +106,7 @@ typedef struct
static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
DBVARIANT dbv;
- TCHAR str[MAX_DATA_LEN], str2[256], city[256], filter[256], *pfilter, *chop;
+ wchar_t str[MAX_DATA_LEN], str2[256], city[256], filter[256], *pfilter, *chop;
char loc[512];
OPENFILENAME ofn; // common dialog box structure
MCONTACT hContact;
@@ -145,13 +145,13 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
SendDlgItemMessage(hwndDlg, IDC_RESET2, BUTTONSETASFLATBTN, TRUE, 0);
// set tooltip for the buttons
- SendDlgItemMessage(hwndDlg, IDC_GETNAME, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Get city name from ID"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_SVCINFO, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Weather INI information"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_BROWSE, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Browse"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_VIEW1, BUTTONADDTOOLTIP, (WPARAM)LPGENT("View webpage"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_RESET1, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Reset to default"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_VIEW2, BUTTONADDTOOLTIP, (WPARAM)LPGENT("View webpage"), BATF_TCHAR);
- SendDlgItemMessage(hwndDlg, IDC_RESET2, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Reset to default"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_GETNAME, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Get city name from ID"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_SVCINFO, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Weather INI information"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BROWSE, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Browse"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_VIEW1, BUTTONADDTOOLTIP, (WPARAM)LPGENW("View webpage"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_RESET1, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset to default"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_VIEW2, BUTTONADDTOOLTIP, (WPARAM)LPGENW("View webpage"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_RESET2, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset to default"), BATF_TCHAR);
// save the handle for the contact
WindowList_Add(hWindowList, hwndDlg, hContact);
@@ -205,7 +205,7 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
// check if there are 2 parts in the ID (svc/id) seperated by "/"
// if not, don't let user change the setting
GetDlgItemText(hwndDlg, IDC_ID, str, _countof(str));
- chop = _tcsstr(str, L"/");
+ chop = wcsstr(str, L"/");
if (chop == NULL)
EnableWindow(GetDlgItem(hwndDlg, IDC_CHANGE), FALSE);
else
@@ -236,10 +236,10 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
// load the page
mir_snprintf(loc, sData->IDSearch.SearchURL, str);
str[0] = 0;
- TCHAR *pData = NULL;
+ wchar_t *pData = NULL;
if (InternetDownloadFile(loc, NULL, sData->UserAgent, &pData) == 0) {
- TCHAR *szInfo = pData;
- TCHAR* search = _tcsstr(szInfo, sData->IDSearch.NotFoundStr);
+ wchar_t *szInfo = pData;
+ wchar_t* search = wcsstr(szInfo, sData->IDSearch.NotFoundStr);
// if the page is found (ie. valid ID), get the name of the city
if (search == NULL)
@@ -271,15 +271,15 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
ofn.lpstrFile = str;
ofn.nMaxFile = _countof(str);
// set filters
- _tcsncpy(filter, TranslateT("Text Files"), _countof(filter) - 1);
+ wcsncpy(filter, TranslateT("Text Files"), _countof(filter) - 1);
mir_tstrncat(filter, L" (*.txt)", _countof(filter) - mir_tstrlen(filter));
pfilter = filter + mir_tstrlen(filter) + 1;
- _tcsncpy(pfilter, L"*.txt", _countof(filter) - 1);
+ wcsncpy(pfilter, L"*.txt", _countof(filter) - 1);
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
- _tcsncpy(pfilter, TranslateT("All Files"), _countof(filter) - 1);
+ wcsncpy(pfilter, TranslateT("All Files"), _countof(filter) - 1);
mir_tstrncat(pfilter, L" (*.*)", _countof(filter) - mir_tstrlen(filter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
- _tcsncpy(pfilter, L"*.*", _countof(filter) - 1);
+ wcsncpy(pfilter, L"*.*", _countof(filter) - 1);
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
*pfilter = '\0';
ofn.lpstrFilter = filter;
@@ -452,12 +452,12 @@ int ContactDeleted(WPARAM wParam, LPARAM)
// if the station is not a default station, set it as the new default station
// this is the first weather station encountered from the search
if (mir_tstrcmp(opt.Default, tszID)) {
- _tcsncpy_s(opt.Default, tszID, _TRUNCATE);
+ wcsncpy_s(opt.Default, tszID, _TRUNCATE);
opt.DefStn = hContact;
ptrT tszNick(db_get_tsa(hContact, WEATHERPROTONAME, "Nick"));
if (tszNick != NULL) {
- TCHAR str[255];
- mir_sntprintf(str, TranslateT("%s is now the default weather station"), (TCHAR*)tszNick);
+ wchar_t str[255];
+ mir_sntprintf(str, TranslateT("%s is now the default weather station"), (wchar_t*)tszNick);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
}
db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default);
diff --git a/plugins/Weather/src/weather_conv.cpp b/plugins/Weather/src/weather_conv.cpp
index ec5cd06521..31b0e1b93a 100644
--- a/plugins/Weather/src/weather_conv.cpp
+++ b/plugins/Weather/src/weather_conv.cpp
@@ -30,7 +30,7 @@ string conversions, display text parsing, etc
// see if a string is a number
// s = the string to be determined
// return value = true if the string is a number, false if it isn't
-BOOL is_number(TCHAR *s)
+BOOL is_number(wchar_t *s)
{
BOOL tag = FALSE;
// looking character by character
@@ -47,7 +47,7 @@ BOOL is_number(TCHAR *s)
return FALSE;
}
-static void numToStr(double num, TCHAR *str, size_t strSize)
+static void numToStr(double num, wchar_t *str, size_t strSize)
{
int i = (int)(num * (opt.NoFrac ? 10 : 100));
int u = abs(i);
@@ -75,15 +75,15 @@ static void numToStr(double num, TCHAR *str, size_t strSize)
// tempchar = the string containing the temperature value
// unit = the unit for temperature
// return value = the converted temperature with degree sign and unit; if fails, return N/A
-void GetTemp(TCHAR *tempchar, TCHAR *unit, TCHAR* str)
+void GetTemp(wchar_t *tempchar, wchar_t *unit, wchar_t* str)
{
// unit can be C, F
double temp;
- TCHAR tstr[20];
+ wchar_t tstr[20];
TrimString(tempchar);
if (tempchar[0] == '-' && tempchar[1] == ' ')
- memmove(&tempchar[1], &tempchar[2], sizeof(TCHAR)*(mir_tstrlen(&tempchar[2]) + 1));
+ memmove(&tempchar[1], &tempchar[2], sizeof(wchar_t)*(mir_tstrlen(&tempchar[2]) + 1));
// quit if the value obtained is N/A or not a number
if (!mir_tstrcmp(tempchar, NODATA) || !mir_tstrcmp(tempchar, L"N/A")) {
@@ -108,7 +108,7 @@ void GetTemp(TCHAR *tempchar, TCHAR *unit, TCHAR* str)
// rounding
numToStr((temp - 32) / 9 * 5, tstr, _countof(tstr));
if (opt.DoNotAppendUnit)
- _tcsncpy_s(str, MAX_DATA_LEN, tstr, _TRUNCATE);
+ wcsncpy_s(str, MAX_DATA_LEN, tstr, _TRUNCATE);
else
mir_sntprintf(str, MAX_DATA_LEN, L"%s%sC", tstr, opt.DegreeSign);
break;
@@ -116,7 +116,7 @@ void GetTemp(TCHAR *tempchar, TCHAR *unit, TCHAR* str)
case 2:
numToStr(temp, tstr, _countof(tstr));
if (opt.DoNotAppendUnit)
- _tcsncpy_s(str, MAX_DATA_LEN, tstr, _TRUNCATE);
+ wcsncpy_s(str, MAX_DATA_LEN, tstr, _TRUNCATE);
else
mir_sntprintf(str, MAX_DATA_LEN, L"%s%sF", tstr, opt.DegreeSign);
break;
@@ -127,7 +127,7 @@ void GetTemp(TCHAR *tempchar, TCHAR *unit, TCHAR* str)
// tempchar = the string containing the pressure value
// unit = the unit for pressure
// return value = the converted pressure with unit; if fail, return the original string
-void GetPressure(TCHAR *tempchar, TCHAR *unit, TCHAR* str)
+void GetPressure(wchar_t *tempchar, wchar_t *unit, wchar_t* str)
{
// unit can be kPa, hPa, mb, in, mm, torr
double tempunit = 0, output;
@@ -184,11 +184,11 @@ void GetPressure(TCHAR *tempchar, TCHAR *unit, TCHAR* str)
// tempchar = the string containing the speed value
// unit = the unit for speed
// return value = the converted speed with unit; if fail, return _T(""
-void GetSpeed(TCHAR *tempchar, TCHAR *unit, TCHAR *str)
+void GetSpeed(wchar_t *tempchar, wchar_t *unit, wchar_t *str)
{
// unit can be km/h, mph, m/s, knots
double tempunit;
- TCHAR tstr[20];
+ wchar_t tstr[20];
str[0] = 0;
@@ -233,7 +233,7 @@ void GetSpeed(TCHAR *tempchar, TCHAR *unit, TCHAR *str)
// tempchar = the string containing the distance value
// unit = the unit for distance
// return value = the converted distance with unit; if fail, return original string
-void GetDist(TCHAR *tempchar, TCHAR *unit, TCHAR *str)
+void GetDist(wchar_t *tempchar, wchar_t *unit, wchar_t *str)
{
// unit can be km, miles
double tempunit = 0, output;
@@ -273,7 +273,7 @@ void GetDist(TCHAR *tempchar, TCHAR *unit, TCHAR *str)
// tempchar = the string containing the elevation value
// unit = the unit for elevation
// return value = the converted elevation with unit; if fail, return original string
-void GetElev(TCHAR *tempchar, TCHAR *unit, TCHAR *str)
+void GetElev(wchar_t *tempchar, wchar_t *unit, wchar_t *str)
{
// unit can be ft, m
double tempunit = 0, output;
@@ -316,10 +316,10 @@ void GetElev(TCHAR *tempchar, TCHAR *unit, TCHAR *str)
// cond = the string for weather condition
// return value = status for the icon (ONLINE, OFFLINE, etc)
-static const TCHAR *statusStr[10] = { L"Lightning", L"Fog", L"Snow Shower", L"Snow", L"Rain Shower", L"Rain", L"Partly Cloudy", L"Cloudy", L"Sunny", L"N/A" };
+static const wchar_t *statusStr[10] = { L"Lightning", L"Fog", L"Snow Shower", L"Snow", L"Rain Shower", L"Rain", L"Partly Cloudy", L"Cloudy", L"Sunny", L"N/A" };
static const WORD statusValue[10] = { LIGHT, FOG, SSHOWER, SNOW, RSHOWER, RAIN, PCLOUDY, CLOUDY, SUNNY, NA };
-WORD GetIcon(const TCHAR* cond, WIDATA *Data)
+WORD GetIcon(const wchar_t* cond, WIDATA *Data)
{
// set the icon using ini
for (int i = 0; i < 10; i++)
@@ -328,72 +328,72 @@ WORD GetIcon(const TCHAR* cond, WIDATA *Data)
// internal detection
if (
- _tcsstr(cond, L"mainy sunny") != NULL ||
- _tcsstr(cond, L"mainy clear") != NULL ||
- _tcsstr(cond, L"partly cloudy") != NULL ||
- _tcsstr(cond, L"mostly") != NULL ||
- _tcsstr(cond, L"clouds") != NULL) {
+ wcsstr(cond, L"mainy sunny") != NULL ||
+ wcsstr(cond, L"mainy clear") != NULL ||
+ wcsstr(cond, L"partly cloudy") != NULL ||
+ wcsstr(cond, L"mostly") != NULL ||
+ wcsstr(cond, L"clouds") != NULL) {
return PCLOUDY;
}
else if (
- _tcsstr(cond, L"sunny") != NULL ||
- _tcsstr(cond, L"clear") != NULL ||
- _tcsstr(cond, L"fair") != NULL) {
+ wcsstr(cond, L"sunny") != NULL ||
+ wcsstr(cond, L"clear") != NULL ||
+ wcsstr(cond, L"fair") != NULL) {
return SUNNY;
}
else if (
- _tcsstr(cond, L"thunder") != NULL ||
- _tcsstr(cond, L"t-storm") != NULL) {
+ wcsstr(cond, L"thunder") != NULL ||
+ wcsstr(cond, L"t-storm") != NULL) {
return LIGHT;
}
else if (
- _tcsstr(cond, L"cloud") != NULL ||
- _tcsstr(cond, L"overcast") != NULL) {
+ wcsstr(cond, L"cloud") != NULL ||
+ wcsstr(cond, L"overcast") != NULL) {
return CLOUDY;
}
else if (
- _tcsstr(cond, L"fog") != NULL ||
- _tcsstr(cond, L"mist") != NULL ||
- _tcsstr(cond, L"smoke") != NULL ||
- _tcsstr(cond, L"sand") != NULL ||
- _tcsstr(cond, L"dust") != NULL ||
- _tcsstr(cond, L"haze") != NULL) {
+ wcsstr(cond, L"fog") != NULL ||
+ wcsstr(cond, L"mist") != NULL ||
+ wcsstr(cond, L"smoke") != NULL ||
+ wcsstr(cond, L"sand") != NULL ||
+ wcsstr(cond, L"dust") != NULL ||
+ wcsstr(cond, L"haze") != NULL) {
return FOG;
}
else if (
- (_tcsstr(cond, L"shower") != NULL && _tcsstr(cond, L"snow") != NULL) ||
- _tcsstr(cond, L"flurries") != NULL) {
+ (wcsstr(cond, L"shower") != NULL && wcsstr(cond, L"snow") != NULL) ||
+ wcsstr(cond, L"flurries") != NULL) {
return SSHOWER;
}
else if (
- _tcsstr(cond, L"rain shower") != NULL ||
- _tcsstr(cond, L"shower") != NULL) {
+ wcsstr(cond, L"rain shower") != NULL ||
+ wcsstr(cond, L"shower") != NULL) {
return RSHOWER;
}
else if (
- _tcsstr(cond, L"snow") != NULL ||
- _tcsstr(cond, L"ice") != NULL ||
- _tcsstr(cond, L"freezing") != NULL ||
- _tcsstr(cond, L"wintry") != NULL) {
+ wcsstr(cond, L"snow") != NULL ||
+ wcsstr(cond, L"ice") != NULL ||
+ wcsstr(cond, L"freezing") != NULL ||
+ wcsstr(cond, L"wintry") != NULL) {
return SNOW;
}
else if (
- _tcsstr(cond, L"drizzle") != NULL ||
- _tcsstr(cond, L"rain") != NULL) {
+ wcsstr(cond, L"drizzle") != NULL ||
+ wcsstr(cond, L"rain") != NULL) {
return RAIN;
}
// set the icon using langpack
for (int i = 0; i < 9; i++) {
- TCHAR LangPackStr[64], LangPackStr1[128];
+ wchar_t LangPackStr[64], LangPackStr1[128];
int j = 0;
do {
j++;
// using the format _T("# Weather <condition name> <counter> #"
mir_sntprintf(LangPackStr, L"# Weather %s %i #", statusStr[i], j);
- _tcsncpy_s(LangPackStr1, TranslateTS(LangPackStr), _TRUNCATE);
+ wcsncpy_s(LangPackStr1, TranslateTS(LangPackStr), _TRUNCATE);
CharLowerBuff(LangPackStr1, (DWORD)mir_tstrlen(LangPackStr1));
- if (_tcsstr(cond, LangPackStr1) != NULL)
+ if (wcsstr(cond, LangPackStr1) != NULL)
return statusValue[i];
// loop until the translation string exists (ie, the translated string is differ from original)
} while (mir_tstrcmp(TranslateTS(LangPackStr), LangPackStr));
@@ -405,18 +405,18 @@ WORD GetIcon(const TCHAR* cond, WIDATA *Data)
//============ STRING CONVERSIONS ============
//
// this function convert the string to the format with 1 upper case followed by lower case char
-void CaseConv(TCHAR *str)
+void CaseConv(wchar_t *str)
{
BOOL nextUp = TRUE;
CharLowerBuff(str, (DWORD)mir_tstrlen(str));
- for (TCHAR *pstr = str; *pstr; pstr++) {
+ for (wchar_t *pstr = str; *pstr; pstr++) {
if (*pstr == ' ' || *pstr == '-')
nextUp = TRUE;
else {
- TCHAR ch = *pstr;
+ wchar_t ch = *pstr;
if (nextUp)
- *pstr = (TCHAR)CharUpper((LPTSTR)ch);
+ *pstr = (wchar_t)CharUpper((LPTSTR)ch);
nextUp = FALSE;
}
}
@@ -485,9 +485,9 @@ char *GetSearchStr(char *dis)
// w = WEATHERINFO data to be parsed
// dis = the string to parse
// return value = the parsed string
-TCHAR* GetDisplay(WEATHERINFO *w, const TCHAR *dis, TCHAR* str)
+wchar_t* GetDisplay(WEATHERINFO *w, const wchar_t *dis, wchar_t* str)
{
- TCHAR lpzDate[32], chr;
+ wchar_t lpzDate[32], chr;
char name[256], temp[2];
DBVARIANT dbv;
size_t i;
@@ -566,11 +566,11 @@ TCHAR* GetDisplay(WEATHERINFO *w, const TCHAR *dis, TCHAR* str)
return str;
}
-TCHAR svcReturnText[MAX_TEXT_SIZE];
+wchar_t svcReturnText[MAX_TEXT_SIZE];
INT_PTR GetDisplaySvcFunc(WPARAM wParam, LPARAM lParam)
{
WEATHERINFO winfo = LoadWeatherInfo(wParam);
- return (INT_PTR)GetDisplay(&winfo, (TCHAR*)lParam, svcReturnText);
+ return (INT_PTR)GetDisplay(&winfo, (wchar_t*)lParam, svcReturnText);
}
//============ ID MANAGEMENT ============
@@ -578,9 +578,9 @@ INT_PTR GetDisplaySvcFunc(WPARAM wParam, LPARAM lParam)
// get service data module internal name
// mod/id <- the mod part
// pszID = original 2-part id, return the service internal name
-void GetSvc(TCHAR *pszID)
+void GetSvc(wchar_t *pszID)
{
- TCHAR *chop = _tcsstr(pszID, L"/");
+ wchar_t *chop = wcsstr(pszID, L"/");
if (chop != NULL) *chop = '\0';
else pszID[0] = 0;
}
@@ -588,9 +588,9 @@ void GetSvc(TCHAR *pszID)
// get the id use for update without the service internal name
// mod/id <- the id part
// pszID = original 2-part id, return the single part id
-void GetID(TCHAR *pszID)
+void GetID(wchar_t *pszID)
{
- TCHAR *chop = _tcsstr(pszID, L"/");
+ wchar_t *chop = wcsstr(pszID, L"/");
if (chop != NULL) mir_tstrcpy(pszID, chop + 1);
else pszID[0] = 0;
}
@@ -601,9 +601,9 @@ void GetID(TCHAR *pszID)
// code = the error code obtained when updating weather
// str = the string for the error
//
-TCHAR *GetError(int code)
+wchar_t *GetError(int code)
{
- TCHAR *str, str2[100];
+ wchar_t *str, str2[100];
switch (code) {
case 10: str = E10; break;
case 11: str = E11; break;
diff --git a/plugins/Weather/src/weather_data.cpp b/plugins/Weather/src/weather_data.cpp
index 2fdd74ec15..88e9ca12e4 100644
--- a/plugins/Weather/src/weather_data.cpp
+++ b/plugins/Weather/src/weather_data.cpp
@@ -30,7 +30,7 @@ saving individual weather data for a weather contact.
// hContact = the current contact handle
// return value = the string for station ID
//
-void GetStationID(MCONTACT hContact, TCHAR* id, int idlen)
+void GetStationID(MCONTACT hContact, wchar_t* id, int idlen)
{
// accessing the database
if (db_get_tstatic(hContact, WEATHERPROTONAME, "ID", id, idlen))
@@ -50,35 +50,35 @@ WEATHERINFO LoadWeatherInfo(MCONTACT hContact)
GetStationID(hContact, winfo.id, _countof(winfo.id));
if (db_get_tstatic(hContact, WEATHERPROTONAME, "Nick", winfo.city, _countof(winfo.city)))
- _tcsncpy(winfo.city, NODATA, _countof(winfo.city) - 1);
+ wcsncpy(winfo.city, NODATA, _countof(winfo.city) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Update", winfo.update, _countof(winfo.update)))
- _tcsncpy(winfo.update, NODATA, _countof(winfo.update) - 1);
+ wcsncpy(winfo.update, NODATA, _countof(winfo.update) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Condition", winfo.cond, _countof(winfo.cond)))
- _tcsncpy(winfo.cond, NODATA, _countof(winfo.cond) - 1);
+ wcsncpy(winfo.cond, NODATA, _countof(winfo.cond) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Temperature", winfo.temp, _countof(winfo.temp)))
- _tcsncpy(winfo.temp, NODATA, _countof(winfo.temp) - 1);
+ wcsncpy(winfo.temp, NODATA, _countof(winfo.temp) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "High", winfo.high, _countof(winfo.high)))
- _tcsncpy(winfo.high, NODATA, _countof(winfo.high) - 1);
+ wcsncpy(winfo.high, NODATA, _countof(winfo.high) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Low", winfo.low, _countof(winfo.low)))
- _tcsncpy(winfo.low, NODATA, _countof(winfo.low) - 1);
+ wcsncpy(winfo.low, NODATA, _countof(winfo.low) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Sunset", winfo.sunset, _countof(winfo.sunset)))
- _tcsncpy(winfo.sunset, NODATA, _countof(winfo.sunset) - 1);
+ wcsncpy(winfo.sunset, NODATA, _countof(winfo.sunset) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Sunrise", winfo.sunrise, _countof(winfo.sunrise)))
- _tcsncpy(winfo.sunrise, NODATA, _countof(winfo.sunrise) - 1);
+ wcsncpy(winfo.sunrise, NODATA, _countof(winfo.sunrise) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Wind Speed", winfo.wind, _countof(winfo.wind)))
- _tcsncpy(winfo.wind, NODATA, _countof(winfo.wind) - 1);
+ wcsncpy(winfo.wind, NODATA, _countof(winfo.wind) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Wind Direction", winfo.winddir, _countof(winfo.winddir)))
- _tcsncpy(winfo.winddir, NODATA, _countof(winfo.winddir) - 1);
+ wcsncpy(winfo.winddir, NODATA, _countof(winfo.winddir) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Dewpoint", winfo.dewpoint, _countof(winfo.dewpoint)))
- _tcsncpy(winfo.dewpoint, NODATA, _countof(winfo.dewpoint) - 1);
+ wcsncpy(winfo.dewpoint, NODATA, _countof(winfo.dewpoint) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Pressure", winfo.pressure, _countof(winfo.pressure)))
- _tcsncpy(winfo.pressure, NODATA, _countof(winfo.pressure) - 1);
+ wcsncpy(winfo.pressure, NODATA, _countof(winfo.pressure) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Visibility", winfo.vis, _countof(winfo.vis)))
- _tcsncpy(winfo.vis, NODATA, _countof(winfo.vis) - 1);
+ wcsncpy(winfo.vis, NODATA, _countof(winfo.vis) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Humidity", winfo.humid, _countof(winfo.humid)))
- _tcsncpy(winfo.humid, NODATA, _countof(winfo.humid) - 1);
+ wcsncpy(winfo.humid, NODATA, _countof(winfo.humid) - 1);
if (db_get_tstatic(hContact, WEATHERCONDITION, "Feel", winfo.feel, _countof(winfo.feel)))
- _tcsncpy(winfo.feel, NODATA, _countof(winfo.feel) - 1);
+ wcsncpy(winfo.feel, NODATA, _countof(winfo.feel) - 1);
winfo.status = (WORD)db_get_w(hContact, WEATHERPROTONAME, "StatusIcon", ID_STATUS_OFFLINE);
return winfo;
@@ -107,7 +107,7 @@ int DBGetData(MCONTACT hContact, char *setting, DBVARIANT *dbv)
// lastver = the last used version number in dword (using PLUGIN_MAKE_VERSION)
void EraseAllInfo()
{
- TCHAR str[255];
+ wchar_t str[255];
int ContactCount = 0;
MCONTACT LastContact = NULL;
DBVARIANT dbv;
@@ -164,7 +164,7 @@ void EraseAllInfo()
// in case where the default station is missing
if (opt.DefStn == NULL && ContactCount != 0) {
if (!db_get_ts(LastContact, WEATHERPROTONAME, "ID", &dbv)) {
- _tcsncpy(opt.Default, dbv.ptszVal, _countof(opt.Default) - 1);
+ wcsncpy(opt.Default, dbv.ptszVal, _countof(opt.Default) - 1);
db_free(&dbv);
}
opt.DefStn = LastContact;
@@ -178,9 +178,9 @@ void EraseAllInfo()
db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default);
}
-void ConvertDataValue(WIDATAITEM *UpdateData, TCHAR *Data)
+void ConvertDataValue(WIDATAITEM *UpdateData, wchar_t *Data)
{
- TCHAR str[MAX_DATA_LEN];
+ wchar_t str[MAX_DATA_LEN];
// convert the unit
if (mir_tstrcmp(Data, TranslateT("<Error>")) && mir_tstrcmp(Data, NODATA) && mir_tstrcmp(Data, TranslateTS(NODATA))) {
@@ -245,12 +245,12 @@ void ConvertDataValue(WIDATAITEM *UpdateData, TCHAR *Data)
// Data = the string containing weather data obtained from UpdateData
// global var. used: szInfo = the downloaded string
//
-void GetDataValue(WIDATAITEM *UpdateData, TCHAR *Data, TCHAR** szData)
+void GetDataValue(WIDATAITEM *UpdateData, wchar_t *Data, wchar_t** szData)
{
- TCHAR last = 0, current, *start, *end;
+ wchar_t last = 0, current, *start, *end;
unsigned startloc = 0, endloc = 0, respos = 0;
BOOL tag = FALSE, symb = FALSE;
- TCHAR *szInfo = *szData;
+ wchar_t *szInfo = *szData;
Data[0] = 0;
// parse the data if available
@@ -258,7 +258,7 @@ void GetDataValue(WIDATAITEM *UpdateData, TCHAR *Data, TCHAR** szData)
start = szInfo;
// the start string must be found
if (UpdateData->Start[0] != 0) {
- start = _tcsstr(szInfo, UpdateData->Start);
+ start = wcsstr(szInfo, UpdateData->Start);
if (start != NULL) {
// set the starting location for getting data
start += mir_tstrlen(UpdateData->Start);
@@ -268,9 +268,9 @@ void GetDataValue(WIDATAITEM *UpdateData, TCHAR *Data, TCHAR** szData)
// the end string must be found too
if (UpdateData->End[0] != 0)
- end = _tcsstr(szInfo, UpdateData->End);
+ end = wcsstr(szInfo, UpdateData->End);
else
- end = _tcsstr(szInfo, L" ");
+ end = wcsstr(szInfo, L" ");
if (end != NULL) {
// set the ending location
@@ -291,7 +291,7 @@ void GetDataValue(WIDATAITEM *UpdateData, TCHAR *Data, TCHAR** szData)
(szInfo[startloc + 1] == ';' || szInfo[startloc + 2] == ';' || szInfo[startloc + 3] == ';' ||
szInfo[startloc + 4] == ';' || szInfo[startloc + 5] == ';' || szInfo[startloc + 6] == ';')) {
// ...but do NOT strip &minus;
- if ((endloc - startloc) > 7 && _tcsncmp(szInfo + startloc, L"&minus;", 7) == 0) {
+ if ((endloc - startloc) > 7 && wcsncmp(szInfo + startloc, L"&minus;", 7) == 0) {
Data[respos++] = '-';
startloc += 7;
continue;
@@ -319,7 +319,7 @@ void GetDataValue(WIDATAITEM *UpdateData, TCHAR *Data, TCHAR** szData)
mir_sntprintf(Data, MAX_DATA_LEN, TranslateT("Error when obtaining data: %s"), UpdateData->Name);
WPShowMessage(Data, SM_WARNING);
}
- _tcsncpy(Data, TranslateT("<Error>"), MAX_DATA_LEN);
+ wcsncpy(Data, TranslateT("<Error>"), MAX_DATA_LEN);
last = ' ';
respos = MAX_DATA_LEN - 1;
break;
diff --git a/plugins/Weather/src/weather_http.cpp b/plugins/Weather/src/weather_http.cpp
index 429f8f654c..5567dff83f 100644
--- a/plugins/Weather/src/weather_http.cpp
+++ b/plugins/Weather/src/weather_http.cpp
@@ -44,7 +44,7 @@ static int findHeader(const NETLIBHTTPREQUEST *nlhrReply, const char *hdr)
// return value = 0 for success, 1 or HTTP error code for failure
// global var used: szData, szInfo = containing the retrieved data
//
-int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, TCHAR **szData)
+int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, wchar_t **szData)
{
if (userAgent == NULL || userAgent[0] == 0)
userAgent = NETLIB_USER_AGENT;
@@ -77,7 +77,7 @@ int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, TCHAR **szD
NETLIBHTTPREQUEST *nlhrReply = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hNetlibUser, (LPARAM)&nlhr);
if (nlhrReply == 0) {
// if the data does not downloaded successfully (ie. disconnected), then return 1000 as error code
- *szData = (TCHAR*)mir_alloc(512);
+ *szData = (wchar_t*)mir_alloc(512);
// store the error code in szData
mir_tstrcpy(*szData, L"NetLib error occurred!!");
hNetlibHttp = NULL;
@@ -124,7 +124,7 @@ int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, TCHAR **szD
}
}
- TCHAR *retVal = NULL;
+ wchar_t *retVal = NULL;
if (bIsUtf)
retVal = mir_utf8decodeT(nlhrReply->pData);
if (retVal == NULL)
@@ -135,7 +135,7 @@ int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, TCHAR **szD
}
// return error code if the recieved code is neither 200 OK nor 302 Moved
else {
- *szData = (TCHAR*)mir_alloc(512);
+ *szData = (wchar_t*)mir_alloc(512);
// store the error code in szData
mir_sntprintf(*szData, 512, L"Error occured! HTTP Error: %i\n", nlhrReply->resultCode);
result = nlhrReply->resultCode;
diff --git a/plugins/Weather/src/weather_info.cpp b/plugins/Weather/src/weather_info.cpp
index 3372d4d3ce..f0b3ca4eac 100644
--- a/plugins/Weather/src/weather_info.cpp
+++ b/plugins/Weather/src/weather_info.cpp
@@ -32,7 +32,7 @@ regrading the loading of ini contents
// List INI Information for all loaded INI files
static void INIInfo(HWND hwndDlg)
{
- TCHAR str[16];
+ wchar_t str[16];
size_t memused = 0;
@@ -67,7 +67,7 @@ static void INIInfo(HWND hwndDlg)
}
ListView_SetItem(hIniList, &lvi);
lvi.iSubItem = 4;
- lvi.pszText = _ltot(Item->Data.UpdateDataCount, str, 10);
+ lvi.pszText = _ltow(Item->Data.UpdateDataCount, str, 10);
ListView_SetItem(hIniList, &lvi);
lvi.iSubItem = 5;
lvi.pszText = Item->Data.DisplayName;
@@ -80,24 +80,24 @@ static void INIInfo(HWND hwndDlg)
++lvi.iItem;
}
- SetDlgItemText(hwndDlg, IDC_INICOUNT, _itot(lvi.iItem, str, 10));
- SetDlgItemText(hwndDlg, IDC_MEMUSED, _ltot((long)memused, str, 10));
+ SetDlgItemText(hwndDlg, IDC_INICOUNT, _itow(lvi.iItem, str, 10));
+ SetDlgItemText(hwndDlg, IDC_MEMUSED, _ltow((long)memused, str, 10));
}
static const struct tag_Columns
{
- const TCHAR *name;
+ const wchar_t *name;
unsigned size;
}
columns[] =
{
- { LPGENT("Name"), 70 },
- { LPGENT("Author"), 100 },
- { LPGENT("File Version"), 70 },
- { LPGENT("INI Version"), 70 },
- { LPGENT("Items"), 40 },
- { LPGENT("Display Name"), 200 },
- { LPGENT("File Name"), 150 },
+ { LPGENW("Name"), 70 },
+ { LPGENW("Author"), 100 },
+ { LPGENW("File Version"), 70 },
+ { LPGENW("INI Version"), 70 },
+ { LPGENW("Items"), 40 },
+ { LPGENW("Display Name"), 200 },
+ { LPGENW("File Name"), 150 },
};
@@ -141,9 +141,9 @@ INT_PTR CALLBACK DlgProcINIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM)
// get the info of individual ini file
// pszSvc = the internal name of the service to get the data
-void GetINIInfo(TCHAR *pszSvc)
+void GetINIInfo(wchar_t *pszSvc)
{
- TCHAR str2[2048];
+ wchar_t str2[2048];
WIDATA *sData = GetWIData(pszSvc);
// if the service does not exist among the loaded INI's
if (sData == NULL) {
@@ -207,10 +207,10 @@ void GetINIInfo(TCHAR *pszSvc)
// can be found when click on "More" in text option dialog
void MoreVarList(void)
{
- TCHAR str[10240], tempstr[1024];
+ wchar_t str[10240], tempstr[1024];
// heading
- _tcsncpy(str, VARS_LIST, _countof(str) - 1);
+ wcsncpy(str, VARS_LIST, _countof(str) - 1);
mir_tstrncat(str, L"\n\n", _countof(str) - mir_tstrlen(str));
// loop through all weather services to find custom variables
for (WIDATALIST *Item = WIHead; Item != NULL; Item = Item->next) {
@@ -220,7 +220,7 @@ void MoreVarList(void)
// ignore the "hi" item and hidden items
if (mir_tstrcmp(WItem->Item.Name, L"Ignore") && WItem->Item.Name[0] != '#') {
mir_sntprintf(tempstr, L"%c[%s]", '%', WItem->Item.Name);
- TCHAR *find = _tcsstr(str, tempstr);
+ wchar_t *find = wcsstr(str, tempstr);
// if the custom variable does not exist in the list, add it to the list
if (find == NULL) {
mir_tstrncat(str, tempstr, _countof(str) - mir_tstrlen(str));
@@ -230,7 +230,7 @@ void MoreVarList(void)
}
}
// remove the last comma in the list
- TCHAR* find = _tcsrchr(str, ',');
+ wchar_t* find = wcsrchr(str, ',');
if (find != NULL)
*find = '\0';
diff --git a/plugins/Weather/src/weather_ini.cpp b/plugins/Weather/src/weather_ini.cpp
index df49fe4d80..f3af9cb3f6 100644
--- a/plugins/Weather/src/weather_ini.cpp
+++ b/plugins/Weather/src/weather_ini.cpp
@@ -48,7 +48,7 @@ static void WIListAdd(WIDATA Data)
// get the service data (from loaded ini file) by internal name
// pszServ = internal name for the service
// return value = the matching WIDATA struct for pszServ, NULL if no match found
-WIDATA* GetWIData(TCHAR *pszServ)
+WIDATA* GetWIData(wchar_t *pszServ)
{
// loop through the list to find matching internal name
for (WIDATALIST *Item = WIHead; Item != NULL; Item = Item->next)
@@ -76,7 +76,7 @@ void WIItemListAdd(WIDATAITEM *DataItem, WIDATA *Data)
// reset the data item by using empty string
// Item = the item to set
// name = the string to store in the "name" field
-void ResetDataItem(WIDATAITEM *Item, const TCHAR *name)
+void ResetDataItem(WIDATAITEM *Item, const wchar_t *name)
{
Item->Name = mir_tstrdup(name);
Item->Start = L"";
@@ -121,12 +121,12 @@ void WICondListAdd(char *str, WICONDLIST *List)
}
// check if the condition string matched for the assignment
-bool IsContainedInCondList(const TCHAR *pszStr, WICONDLIST *List)
+bool IsContainedInCondList(const wchar_t *pszStr, WICONDLIST *List)
{
// loop through the list to find matching internal name
for (WICONDITEM *Item = List->Head; Item != NULL; Item = Item->Next) {
// if internal name found, return true indicating that the data is found
- if (_tcsstr(pszStr, Item->Item))
+ if (wcsstr(pszStr, Item->Item))
return true;
}
@@ -178,13 +178,13 @@ static INT_PTR CALLBACK DlgProcSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case IDC_STEP2:
{
- TCHAR szPath[1024];
+ wchar_t szPath[1024];
GetModuleFileName(GetModuleHandle(NULL), szPath, _countof(szPath));
- TCHAR *chop = _tcsrchr(szPath, '\\');
+ wchar_t *chop = wcsrchr(szPath, '\\');
if (chop) {
*chop = '\0';
mir_tstrncat(szPath, L"\\Plugins\\weather\\", _countof(szPath) - mir_tstrlen(szPath));
- if (_tmkdir(szPath) == 0)
+ if (_wmkdir(szPath) == 0)
ShellExecute((HWND)lParam, L"open", szPath, L"", L"", SW_SHOW);
}
break;
@@ -222,7 +222,7 @@ static INT_PTR CALLBACK DlgProcSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
// pszFile = the file name + path for the ini file to be loaded
// pszShortFile = the file name of the ini file, but not including the path
// Data = the struct to load the ini content to, and return to previous function
-static void LoadStationData(TCHAR *pszFile, TCHAR *pszShortFile, WIDATA *Data)
+static void LoadStationData(wchar_t *pszFile, wchar_t *pszShortFile, WIDATA *Data)
{
WIDATAITEM DataItem;
char *Group, *Temp;
@@ -269,7 +269,7 @@ static void LoadStationData(TCHAR *pszFile, TCHAR *pszShortFile, WIDATA *Data)
else if (!mir_strcmp(Line, "[Weather 0.3.x Update Data 1.5]"))
Data->InternalVer = 7;
else {
- TCHAR str[4096];
+ wchar_t str[4096];
mir_sntprintf(str, TranslateT("Invalid ini format for: %s"), pszFile);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONERROR);
fclose(pfile);
@@ -323,7 +323,7 @@ static void LoadStationData(TCHAR *pszFile, TCHAR *pszShortFile, WIDATA *Data)
// initialize the linked list for update items
Data->UpdateDataCount = 0;
- Data->MemUsed = sizeof(WIDATA) + sizeof(WIDATALIST) + (mir_tstrlen(pszShortFile) + mir_tstrlen(pszFile) + 20)*sizeof(TCHAR);
+ Data->MemUsed = sizeof(WIDATA) + sizeof(WIDATALIST) + (mir_tstrlen(pszShortFile) + mir_tstrlen(pszFile) + 20)*sizeof(wchar_t);
Data->UpdateData = NULL;
Data->UpdateDataTail = NULL;
@@ -446,11 +446,11 @@ static void LoadStationData(TCHAR *pszFile, TCHAR *pszShortFile, WIDATA *Data)
else if (!_stricmp(ValName, "URL")) wSetData(&Data->UpdateDataTail->Item.Url, Value);
else if (!_stricmp(ValName, "HIDDEN")) {
if (!_stricmp(Value, "TRUE")) {
- TCHAR *nm = Data->UpdateDataTail->Item.Name;
+ wchar_t *nm = Data->UpdateDataTail->Item.Name;
size_t len = mir_tstrlen(nm) + 1;
- Data->UpdateDataTail->Item.Name = nm = (TCHAR*)mir_realloc(nm, sizeof(TCHAR)*(len + 3));
- memmove(nm + 1, nm, len*sizeof(TCHAR));
+ Data->UpdateDataTail->Item.Name = nm = (wchar_t*)mir_realloc(nm, sizeof(wchar_t)*(len + 3));
+ memmove(nm + 1, nm, len*sizeof(wchar_t));
*nm = '#';
}
}
@@ -485,14 +485,14 @@ bool LoadWIData(bool dial)
WIHead = WITail;
// find all *.ini file in the plugin\weather directory
- TCHAR szSearchPath[MAX_PATH], FileName[MAX_PATH];
+ wchar_t szSearchPath[MAX_PATH], FileName[MAX_PATH];
GetModuleFileName(GetModuleHandle(NULL), szSearchPath, _countof(szSearchPath));
- TCHAR *chop = _tcsrchr(szSearchPath, '\\');
+ wchar_t *chop = wcsrchr(szSearchPath, '\\');
if (chop == NULL)
return false;
*chop = '\0';
mir_tstrncat(szSearchPath, L"\\Plugins\\Weather\\*.ini", _countof(szSearchPath) - mir_tstrlen(szSearchPath));
- _tcsncpy(FileName, szSearchPath, MAX_PATH - 1);
+ wcsncpy(FileName, szSearchPath, MAX_PATH - 1);
WIN32_FIND_DATA fd;
HANDLE hFind = FindFirstFile(szSearchPath, &fd);
@@ -501,7 +501,7 @@ bool LoadWIData(bool dial)
// load the content of the ini file into memory
if (hFind != INVALID_HANDLE_VALUE) {
do {
- chop = _tcsrchr(FileName, '\\');
+ chop = wcsrchr(FileName, '\\');
chop[1] = '\0';
mir_tstrncat(FileName, fd.cFileName, _countof(FileName) - mir_tstrlen(FileName));
if (mir_tstrcmpi(fd.cFileName, L"SAMPLE_INI.INI")) {
diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp
index 61f323d8d9..fdd83c3d94 100644
--- a/plugins/Weather/src/weather_mwin.cpp
+++ b/plugins/Weather/src/weather_mwin.cpp
@@ -159,10 +159,10 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
{
FontIDT fntid = { 0 };
mir_tstrcpy(fntid.group, _T(WEATHERPROTONAME));
- mir_tstrcpy(fntid.name, LPGENT("Frame Font"));
+ mir_tstrcpy(fntid.name, LPGENW("Frame Font"));
fntc = CallService(MS_FONT_GETT, (WPARAM)&fntid, (LPARAM)&lfnt);
- mir_tstrcpy(fntid.name, LPGENT("Frame Title Font"));
+ mir_tstrcpy(fntid.name, LPGENW("Frame Title Font"));
fntc1 = CallService(MS_FONT_GETT, (WPARAM)&fntid, (LPARAM)&lfnt1);
}
@@ -197,7 +197,7 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
HFONT hfnt = CreateFontIndirect(&lfnt1);
HFONT hfntold = (HFONT)SelectObject(hdc, hfnt);
- TCHAR *nick = (TCHAR*)pcli->pfnGetContactDisplayName(data->hContact, 0);
+ wchar_t *nick = (wchar_t*)pcli->pfnGetContactDisplayName(data->hContact, 0);
SIZE fontSize;
GetTextExtentPoint32(hdc, L"|", 1, &fontSize);
@@ -241,7 +241,7 @@ static void addWindow(MCONTACT hContact)
if (db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv))
return;
- TCHAR winname[512];
+ wchar_t winname[512];
mir_sntprintf(winname, L"Weather: %s", dbv.ptszVal);
db_free(&dbv);
@@ -328,7 +328,7 @@ void InitMwin(void)
colourid.cbSize = sizeof(ColourIDT);
mir_strcpy(colourid.dbSettingsGroup, WEATHERPROTONAME);
mir_strcpy(colourid.setting, "ColorMwinFrame");
- mir_tstrcpy(colourid.name, LPGENT("Frame Background"));
+ mir_tstrcpy(colourid.name, LPGENW("Frame Background"));
mir_tstrcpy(colourid.group, _T(WEATHERPROTONAME));
colourid.defcolour = GetSysColor(COLOR_3DFACE);
ColourRegisterT(&colourid);
@@ -338,7 +338,7 @@ void InitMwin(void)
fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID;
mir_strcpy(fontid.dbSettingsGroup, WEATHERPROTONAME);
mir_tstrcpy(fontid.group, _T(WEATHERPROTONAME));
- mir_tstrcpy(fontid.name, LPGENT("Frame Font"));
+ mir_tstrcpy(fontid.name, LPGENW("Frame Font"));
mir_strcpy(fontid.prefix, "fnt0");
HDC hdc = GetDC(NULL);
@@ -348,11 +348,11 @@ void InitMwin(void)
fontid.deffontsettings.charset = DEFAULT_CHARSET;
mir_tstrcpy(fontid.deffontsettings.szFace, L"Verdana");
mir_tstrcpy(fontid.backgroundGroup, _T(WEATHERPROTONAME));
- mir_tstrcpy(fontid.backgroundName, LPGENT("Frame Background"));
+ mir_tstrcpy(fontid.backgroundName, LPGENW("Frame Background"));
FontRegisterT(&fontid);
fontid.deffontsettings.style = DBFONTF_BOLD;
- mir_tstrcpy(fontid.name, LPGENT("Frame Title Font"));
+ mir_tstrcpy(fontid.name, LPGENW("Frame Title Font"));
mir_strcpy(fontid.prefix, "fnt1");
FontRegisterT(&fontid);
diff --git a/plugins/Weather/src/weather_opt.cpp b/plugins/Weather/src/weather_opt.cpp
index 48d275e12b..ea567ff901 100644
--- a/plugins/Weather/src/weather_opt.cpp
+++ b/plugins/Weather/src/weather_opt.cpp
@@ -33,46 +33,46 @@ int RedrawFrame(WPARAM wParam, LPARAM lParam);
// in = string to determine which field to set default "CBNEHXPp"
void SetTextDefault(const char* in)
{
- TCHAR str[MAX_TEXT_SIZE];
+ wchar_t str[MAX_TEXT_SIZE];
if (strchr(in, 'C') != NULL) {
- _tcsncpy(str, C_DEFAULT, MAX_TEXT_SIZE - 1);
+ wcsncpy(str, C_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.cText, str);
}
if (strchr(in, 'b') != NULL) {
- _tcsncpy(str, b_DEFAULT, MAX_TEXT_SIZE - 1);
+ wcsncpy(str, b_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.bTitle, str);
}
if (strchr(in, 'B') != NULL) {
- _tcsncpy(str, B_DEFAULT, MAX_TEXT_SIZE - 1);
+ wcsncpy(str, B_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.bText, str);
}
if (strchr(in, 'N') != NULL) {
- _tcsncpy(str, N_DEFAULT, MAX_TEXT_SIZE - 1);
+ wcsncpy(str, N_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.nText, str);
}
if (strchr(in, 'E') != NULL) {
- _tcsncpy(str, E_DEFAULT, MAX_TEXT_SIZE - 1);
+ wcsncpy(str, E_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.eText, str);
}
if (strchr(in, 'H') != NULL) {
- _tcsncpy(str, H_DEFAULT, MAX_TEXT_SIZE - 1);
+ wcsncpy(str, H_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.hText, str);
}
if (strchr(in, 'X') != NULL) {
- _tcsncpy(str, X_DEFAULT, MAX_TEXT_SIZE - 1);
+ wcsncpy(str, X_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.xText, str);
}
if (strchr(in, 'P') != NULL) {
- _tcsncpy(str, P_DEFAULT, MAX_TEXT_SIZE - 1);
+ wcsncpy(str, P_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.pTitle, str);
}
if (strchr(in, 'p') != NULL) {
- _tcsncpy(str, p_DEFAULT, MAX_TEXT_SIZE - 1);
+ wcsncpy(str, p_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.pText, str);
}
if (strchr(in, 'S') != NULL) {
- _tcsncpy(str, s_DEFAULT, MAX_TEXT_SIZE - 1);
+ wcsncpy(str, s_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.sText, str);
}
}
@@ -115,7 +115,7 @@ void LoadOptions(void)
opt.eUnit = db_get_w(NULL, WEATHERPROTONAME, "eUnit", 2);
ptrT szValue(db_get_tsa(NULL, WEATHERPROTONAME, "DegreeSign"));
- _tcsncpy_s(opt.DegreeSign, (szValue == NULL) ? L"" : szValue, _TRUNCATE);
+ wcsncpy_s(opt.DegreeSign, (szValue == NULL) ? L"" : szValue, _TRUNCATE);
opt.DoNotAppendUnit = db_get_b(NULL, WEATHERPROTONAME, "DoNotAppendUnit", 0);
opt.NoFrac = db_get_b(NULL, WEATHERPROTONAME, "NoFractions", 0);
@@ -191,7 +191,7 @@ void LoadOptions(void)
// misc
if (szValue = db_get_tsa(NULL, WEATHERPROTONAME, "Default"))
- _tcsncpy_s(opt.Default, szValue, _TRUNCATE);
+ wcsncpy_s(opt.Default, szValue, _TRUNCATE);
else
opt.Default[0] = 0;
}
@@ -255,14 +255,14 @@ void SaveOptions(void)
// weather options
static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
{
- TCHAR str[512];
+ wchar_t str[512];
switch (msg) {
case WM_INITDIALOG:
opt_startup = TRUE;
TranslateDialogDefault(hdlg);
// load settings
- _ltot(opt.UpdateTime, str, 10);
+ _ltow(opt.UpdateTime, str, 10);
SetDlgItemText(hdlg, IDC_UPDATETIME, str);
SetDlgItemText(hdlg, IDC_DEGREE, opt.DegreeSign);
@@ -335,7 +335,7 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l
// get update time and remove the old timer
GetDlgItemText(hdlg, IDC_UPDATETIME, str, _countof(str));
- opt.UpdateTime = (WORD)_ttoi(str);
+ opt.UpdateTime = (WORD)_wtoi(str);
if (opt.UpdateTime < 1) opt.UpdateTime = 1;
KillTimer(NULL, timerId);
timerId = SetTimer(NULL, 0, opt.UpdateTime * 60000, timerProc);
@@ -417,14 +417,14 @@ static void FreeTextVar(void)
static const char *varname[8] = { "C", "b", "B", "N", "X", "E", "H", "S" };
static const int cname[8] = { IDC_CTEXT, IDC_BTITLE, IDC_BTEXT, IDC_NTEXT, IDC_XTEXT, IDC_ETEXT, IDC_HTEXT, IDC_BTITLE2 };
-static TCHAR* const *var[8] = { &opt.cText, &opt.bTitle, &opt.bText, &opt.nText, &opt.xText, &opt.eText, &opt.hText, &opt.sText };
+static wchar_t* const *var[8] = { &opt.cText, &opt.bTitle, &opt.bText, &opt.nText, &opt.xText, &opt.eText, &opt.hText, &opt.sText };
static INT_PTR CALLBACK DlgProcText(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
RECT rc, pos;
HWND button;
HMENU hMenu, hMenu1;
- TCHAR str[4096];
+ wchar_t str[4096];
switch (msg) {
case WM_INITDIALOG:
opt_startup = TRUE;
@@ -433,7 +433,7 @@ static INT_PTR CALLBACK DlgProcText(HWND hdlg, UINT msg, WPARAM wParam, LPARAM l
SetWindowPos(hdlg, HWND_TOPMOST, rc.left, rc.top, 0, 0, SWP_NOSIZE);
TranslateDialogDefault(hdlg);
// generate the display text for variable list
- _tcsncpy(str, VAR_LIST_OPT, _countof(str) - 1);
+ wcsncpy(str, VAR_LIST_OPT, _countof(str) - 1);
SetDlgItemText(hdlg, IDC_VARLIST, str);
// make the more variable and other buttons flat
@@ -498,7 +498,7 @@ static INT_PTR CALLBACK DlgProcText(HWND hdlg, UINT msg, WPARAM wParam, LPARAM l
case ID_MRESET:
unsigned varo = LOWORD(wParam) - IDC_TM1;
// remove the old setting from db and free memory
- TCHAR* vartmp = *var[varo];
+ wchar_t* vartmp = *var[varo];
wfree(&vartmp);
SetTextDefault(varname[varo]);
SetDlgItemText(hdlg, cname[varo], *var[varo]);
@@ -535,7 +535,7 @@ static INT_PTR CALLBACK DlgProcText(HWND hdlg, UINT msg, WPARAM wParam, LPARAM l
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
// save the option
- TCHAR textstr[MAX_TEXT_SIZE];
+ wchar_t textstr[MAX_TEXT_SIZE];
// free memory for old settings
FreeTextVar();
// save new settings to memory
@@ -577,25 +577,25 @@ int OptInit(WPARAM wParam, LPARAM)
odp.position = 95600;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.pfnDlgProc = OptionsProc;
- odp.ptszGroup = LPGENT("Network");
- odp.ptszTitle = _T(WEATHERPROTOTEXT);
- odp.ptszTab = LPGENT("General");
+ odp.pwszGroup = LPGENW("Network");
+ odp.pwszTitle = _T(WEATHERPROTOTEXT);
+ odp.pwszTab = LPGENW("General");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &odp);
// text options
odp.pszTemplate = MAKEINTRESOURCEA(IDD_TEXTOPT);
odp.pfnDlgProc = DlgProcText;
- odp.ptszTab = LPGENT("Display");
+ odp.pwszTab = LPGENW("Display");
Options_AddPage(wParam, &odp);
// if popup service exists, load the weather popup options
if ((ServiceExists(MS_POPUP_ADDPOPUPT))) {
odp.position = 100000000;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUP);
- odp.ptszGroup = LPGENT("Popups");
+ odp.pwszGroup = LPGENW("Popups");
odp.groupPosition = 910000000;
- odp.ptszTab = NULL;
+ odp.pwszTab = NULL;
odp.pfnDlgProc = DlgPopupOpts;
Options_AddPage(wParam, &odp);
}
diff --git a/plugins/Weather/src/weather_popup.cpp b/plugins/Weather/src/weather_popup.cpp
index fcd891e70c..4e721a07a5 100644
--- a/plugins/Weather/src/weather_popup.cpp
+++ b/plugins/Weather/src/weather_popup.cpp
@@ -40,7 +40,7 @@ int WeatherError(WPARAM wParam, LPARAM lParam)
if (!opt.UsePopup)
return 0;
- TCHAR* tszMsg = (TCHAR*)wParam;
+ wchar_t* tszMsg = (wchar_t*)wParam;
if ((DWORD)lParam == SM_WARNING)
PUShowMessageT(tszMsg, SM_WARNING);
@@ -48,19 +48,19 @@ int WeatherError(WPARAM wParam, LPARAM lParam)
PUShowMessageT(tszMsg, SM_NOTIFY);
else if ((DWORD)lParam == SM_WEATHERALERT) {
POPUPDATAT ppd = { 0 };
- TCHAR str1[512], str2[512];
+ wchar_t str1[512], str2[512];
// get the 2 strings
- _tcsncpy(str1, tszMsg, _countof(str1) - 1);
- _tcsncpy(str2, tszMsg, _countof(str2) - 1);
- TCHAR *chop = _tcschr(str1, 255);
+ wcsncpy(str1, tszMsg, _countof(str1) - 1);
+ wcsncpy(str2, tszMsg, _countof(str2) - 1);
+ wchar_t *chop = wcschr(str1, 255);
if (chop != NULL)
*chop = '\0';
else
str1[0] = 0;
- chop = _tcschr(str2, 255);
+ chop = wcschr(str2, 255);
if (chop != NULL)
- _tcsncpy(str2, chop + 1, _countof(str2) - 1);
+ wcsncpy(str2, chop + 1, _countof(str2) - 1);
else
str2[0] = 0;
@@ -81,7 +81,7 @@ int WeatherError(WPARAM wParam, LPARAM lParam)
// (threaded)
// lpzText = error text
// kind = display type (see m_popup.h)
-int WPShowMessage(TCHAR* lpzText, WORD kind)
+int WPShowMessage(wchar_t* lpzText, WORD kind)
{
NotifyEventHooks(hHookWeatherError, (WPARAM)lpzText, (LPARAM)kind);
return 0;
@@ -211,8 +211,8 @@ static void SelectMenuItem(HMENU hMenu, int Check)
// but does not write to the database
void ReadPopupOpt(HWND hdlg)
{
- TCHAR text[MAX_TEXT_SIZE];
- TCHAR str[512];
+ wchar_t text[MAX_TEXT_SIZE];
+ wchar_t str[512];
// popup colour
opt.TextColour = SendDlgItemMessage(hdlg, IDC_TEXTCOLOUR, CPM_GETCOLOUR, 0, 0);
@@ -220,7 +220,7 @@ void ReadPopupOpt(HWND hdlg)
// get delay time
GetDlgItemText(hdlg, IDC_DELAY, str, _countof(str));
- int num = _ttoi(str);
+ int num = _wtoi(str);
opt.pDelay = num;
// other options
@@ -244,7 +244,7 @@ void ReadPopupOpt(HWND hdlg)
INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
int ID;
- TCHAR str[512];
+ wchar_t str[512];
HMENU hMenu, hMenu1;
RECT pos;
HWND button;
@@ -273,7 +273,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
SetDlgItemText(hdlg, IDC_PText, opt.pText);
SetDlgItemText(hdlg, IDC_PTitle, opt.pTitle);
// setting popup delay option
- _ltot(opt.pDelay, str, 10);
+ _ltow(opt.pDelay, str, 10);
SetDlgItemText(hdlg, IDC_DELAY, str);
if (opt.pDelay == -1)
CheckRadioButton(hdlg, IDC_PD1, IDC_PD3, IDC_PD2);
@@ -394,7 +394,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
case IDC_VAR3:
// display variable list
- _tcsncpy(str, L" \n", _countof(str) - 1); // to make the message box wider
+ wcsncpy(str, L" \n", _countof(str) - 1); // to make the message box wider
mir_tstrncat(str, VAR_LIST_POPUP, _countof(str) - mir_tstrlen(str));
mir_tstrncat(str, L"\n", _countof(str) - mir_tstrlen(str));
mir_tstrncat(str, CUSTOM_VARS, _countof(str) - mir_tstrlen(str));
diff --git a/plugins/Weather/src/weather_svcs.cpp b/plugins/Weather/src/weather_svcs.cpp
index 753c91c1e8..cd283324bb 100644
--- a/plugins/Weather/src/weather_svcs.cpp
+++ b/plugins/Weather/src/weather_svcs.cpp
@@ -123,17 +123,17 @@ INT_PTR WeatherGetInfo(WPARAM, LPARAM lParam)
}
// avatars
-static const TCHAR *statusStr[] = { L"Light", L"Fog", L"SShower", L"Snow", L"RShower", L"Rain", L"PCloudy", L"Cloudy", L"Sunny", L"NA" };
+static const wchar_t *statusStr[] = { L"Light", L"Fog", L"SShower", L"Snow", L"RShower", L"Rain", L"PCloudy", L"Cloudy", L"Sunny", L"NA" };
static const WORD statusValue[] = { LIGHT, FOG, SSHOWER, SNOW, RSHOWER, RAIN, PCLOUDY, CLOUDY, SUNNY, NA };
INT_PTR WeatherGetAvatarInfo(WPARAM, LPARAM lParam)
{
- TCHAR szSearchPath[MAX_PATH], *chop;
+ wchar_t szSearchPath[MAX_PATH], *chop;
unsigned i;
PROTO_AVATAR_INFORMATION *pai = (PROTO_AVATAR_INFORMATION*)lParam;
GetModuleFileName(GetModuleHandle(NULL), szSearchPath, _countof(szSearchPath));
- chop = _tcsrchr(szSearchPath, '\\');
+ chop = wcsrchr(szSearchPath, '\\');
if (chop) *chop = '\0';
else szSearchPath[0] = 0;
@@ -148,12 +148,12 @@ INT_PTR WeatherGetAvatarInfo(WPARAM, LPARAM lParam)
pai->format = PA_FORMAT_PNG;
mir_sntprintf(pai->filename, L"%s\\Plugins\\Weather\\%s.png", szSearchPath, statusStr[i]);
- if (_taccess(pai->filename, 4) == 0)
+ if (_waccess(pai->filename, 4) == 0)
return GAIR_SUCCESS;
pai->format = PA_FORMAT_GIF;
mir_sntprintf(pai->filename, L"%s\\Plugins\\Weather\\%s.gif", szSearchPath, statusStr[i]);
- if (_taccess(pai->filename, 4) == 0)
+ if (_waccess(pai->filename, 4) == 0)
return GAIR_SUCCESS;
pai->format = PA_FORMAT_UNKNOWN;
@@ -225,11 +225,11 @@ void UpdateMenu(BOOL State)
db_set_b(NULL, WEATHERPROTONAME, "AutoUpdate", (BYTE)State);
if (State) { // to enable auto-update
- Menu_ModifyItem(hEnableDisableMenu, LPGENT("Auto Update Enabled"), GetIconHandle("main"));
+ Menu_ModifyItem(hEnableDisableMenu, LPGENW("Auto Update Enabled"), GetIconHandle("main"));
opt.AutoUpdate = 1;
}
else { // to disable auto-update
- Menu_ModifyItem(hEnableDisableMenu, LPGENT("Auto Update Disabled"), GetIconHandle("disabled"));
+ Menu_ModifyItem(hEnableDisableMenu, LPGENW("Auto Update Disabled"), GetIconHandle("disabled"));
opt.AutoUpdate = 0;
}
@@ -243,9 +243,9 @@ void UpdatePopupMenu(BOOL State)
db_set_b(NULL, WEATHERPROTONAME, "UsePopup", (BYTE)opt.UsePopup);
if (State) // to enable popup
- Menu_ModifyItem(hEnableDisablePopupMenu, LPGENT("Disable &weather notification"), GetIconHandle("popup"));
+ Menu_ModifyItem(hEnableDisablePopupMenu, LPGENW("Disable &weather notification"), GetIconHandle("popup"));
else // to disable popup
- Menu_ModifyItem(hEnableDisablePopupMenu, LPGENT("Enable &weather notification"), GetIconHandle("nopopup"));
+ Menu_ModifyItem(hEnableDisablePopupMenu, LPGENW("Enable &weather notification"), GetIconHandle("nopopup"));
}
// update the weather auto-update menu item when click on it
@@ -326,7 +326,7 @@ void AddMenuItems(void)
Menu_AddContactMenuItem(&mi, WEATHERPROTONAME);
// adding main menu items
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Weather"), 500099000);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Weather"), 500099000);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "82809D2F-2CF0-4E15-9350-D257A7748552");
SET_UID(mi, 0x5ad16188, 0xe0a0, 0x4c31, 0x85, 0xc3, 0xe4, 0x85, 0x79, 0x7e, 0x4b, 0x9c);
@@ -361,7 +361,7 @@ void AddMenuItems(void)
mi.name.a = LPGEN("Weather Notification");
mi.hIcolibItem = GetIconHandle("popup");
mi.position = 0;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Popups"), 0);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Popups"), 0);
mi.pszService = WEATHERPROTONAME "/PopupMenu";
hEnableDisablePopupMenu = Menu_AddMainMenuItem(&mi);
UpdatePopupMenu(opt.UsePopup);
diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp
index 6a6403dbdd..65c814dee1 100644
--- a/plugins/Weather/src/weather_update.cpp
+++ b/plugins/Weather/src/weather_update.cpp
@@ -34,7 +34,7 @@ UPDATELIST *UpdateListHead, *UpdateListTail;
// hContact = current contact
int UpdateWeather(MCONTACT hContact)
{
- TCHAR str[256], str2[MAX_TEXT_SIZE];
+ wchar_t str[256], str2[MAX_TEXT_SIZE];
DBVARIANT dbv;
BOOL Ch = FALSE;
@@ -59,7 +59,7 @@ int UpdateWeather(MCONTACT hContact)
mir_sntprintf(str, _countof(str) - 105,
TranslateT("Unable to retrieve weather information for %s"), dbv.ptszVal);
mir_tstrncat(str, L"\n", _countof(str) - mir_tstrlen(str));
- TCHAR *tszError = GetError(code);
+ wchar_t *tszError = GetError(code);
mir_tstrncat(str, tszError, _countof(str) - mir_tstrlen(str));
WPShowMessage(str, SM_WARNING);
mir_free(tszError);
@@ -172,12 +172,12 @@ int UpdateWeather(MCONTACT hContact)
DeleteFile(dbv.ptszVal);
// open the file and set point to the end of file
- FILE *file = _tfopen(dbv.ptszVal, L"a");
+ FILE *file = _wfopen(dbv.ptszVal, L"a");
db_free(&dbv);
if (file != NULL) {
// write data to the file and close
GetDisplay(&winfo, opt.eText, str2);
- _fputts(str2, file);
+ fputws(str2, file);
fclose(file);
}
}
@@ -379,17 +379,17 @@ INT_PTR UpdateAllRemove(WPARAM, LPARAM)
int GetWeatherData(MCONTACT hContact)
{
// get each part of the id's
- TCHAR id[256];
+ wchar_t id[256];
GetStationID(hContact, id, _countof(id));
// test ID format
- TCHAR* szInfo = _tcschr(id, '/');
+ wchar_t* szInfo = wcschr(id, '/');
if (szInfo == NULL)
return INVALID_ID_FORMAT;
GetID(id);
- TCHAR Svc[256];
+ wchar_t Svc[256];
GetStationID(hContact, Svc, _countof(Svc));
GetSvc(Svc);
@@ -431,13 +431,13 @@ int GetWeatherData(MCONTACT hContact)
continue;
// download the html file from the internet
- TCHAR* szData = NULL;
+ wchar_t* szData = NULL;
int retval = InternetDownloadFile(loc, Data->Cookie, Data->UserAgent, &szData);
if (retval != 0) {
mir_free(szData);
return retval;
}
- if (_tcsstr(szData, L"Document Not Found") != NULL) {
+ if (wcsstr(szData, L"Document Not Found") != NULL) {
mir_free(szData);
return DOC_NOT_FOUND;
}
@@ -452,21 +452,21 @@ int GetWeatherData(MCONTACT hContact)
continue;
}
- TCHAR DataValue[MAX_DATA_LEN];
+ wchar_t DataValue[MAX_DATA_LEN];
switch (Item->Item.Type) {
case WID_NORMAL:
// if it is a normal item with start= and end=, then parse through the downloaded string
// to get a data value.
GetDataValue(&Item->Item, DataValue, &szInfo);
if (mir_tstrcmp(Item->Item.Name, L"Condition") && mir_tstrcmpi(Item->Item.Unit, L"Cond"))
- _tcsncpy(DataValue, TranslateTS(DataValue), MAX_DATA_LEN - 1);
+ wcsncpy(DataValue, TranslateTS(DataValue), MAX_DATA_LEN - 1);
break;
case WID_SET:
{
// for the "Set Data=" operation
DBVARIANT dbv;
- TCHAR *chop, *str, str2[MAX_DATA_LEN];
+ wchar_t *chop, *str, str2[MAX_DATA_LEN];
BOOL hasvar = FALSE;
size_t stl;
@@ -476,12 +476,12 @@ int GetWeatherData(MCONTACT hContact)
// go through each part of the operation string seperated by the & operator
do {
// the end of the string, last item
- chop = _tcsstr(str, L" & ");
+ chop = wcsstr(str, L" & ");
if (chop == NULL)
- chop = _tcschr(str, '\0');
+ chop = wcschr(str, '\0');
stl = min(sizeof(str2) - 1, (unsigned)(chop - str - 2));
- _tcsncpy(str2, str + 1, stl);
+ wcsncpy(str2, str + 1, stl);
str2[stl] = 0;
switch (str[0]) {
@@ -512,7 +512,7 @@ int GetWeatherData(MCONTACT hContact)
// for the "Break Data=" operation
DBVARIANT dbv;
if (!DBGetData(hContact, _T2A(Item->Item.Start), &dbv)) {
- _tcsncpy(DataValue, dbv.ptszVal, _countof(DataValue));
+ wcsncpy(DataValue, dbv.ptszVal, _countof(DataValue));
DataValue[_countof(DataValue) - 1] = 0;
db_free(&dbv);
}
@@ -522,7 +522,7 @@ int GetWeatherData(MCONTACT hContact)
}
// generate the strings
- TCHAR* end = _tcsstr(DataValue, Item->Item.Break);
+ wchar_t* end = wcsstr(DataValue, Item->Item.Break);
if (end == NULL) {
DataValue[0] = 0;
break; // exit if break string is not found
@@ -552,7 +552,7 @@ int GetWeatherData(MCONTACT hContact)
if (!mir_tstrcmp(Svc, opt.Default))
db_set_ts(NULL, DEFCURRENTWEATHER, _T2A(Item->Item.Name), DataValue);
if (!mir_tstrcmp(Item->Item.Name, L"Condition")) {
- TCHAR buf[128], *cbuf;
+ wchar_t buf[128], *cbuf;
mir_sntprintf(buf, L"#%s Weather", DataValue);
cbuf = TranslateTS(buf);
if (cbuf[0] == '#')
@@ -562,7 +562,7 @@ int GetWeatherData(MCONTACT hContact)
cond = GetIcon(DataValue, Data);
}
else if (mir_tstrcmpi(Item->Item.Unit, L"Cond") == 0) {
- TCHAR buf[128], *cbuf;
+ wchar_t buf[128], *cbuf;
mir_sntprintf(buf, L"#%s Weather", DataValue);
cbuf = TranslateTS(buf);
if (cbuf[0] == '#')
diff --git a/plugins/Weather/src/weather_userinfo.cpp b/plugins/Weather/src/weather_userinfo.cpp
index b1538f332e..b4adc2bf28 100644
--- a/plugins/Weather/src/weather_userinfo.cpp
+++ b/plugins/Weather/src/weather_userinfo.cpp
@@ -55,13 +55,13 @@ static int BriefDlgResizer(HWND, LPARAM, UTILRESIZECONTROL *urc)
static void LoadBriefInfoText(HWND hwndDlg, MCONTACT hContact)
{
WEATHERINFO winfo;
- TCHAR str[4096];
+ wchar_t str[4096];
// load weather information from the contact into the WEATHERINFO struct
winfo = LoadWeatherInfo(hContact);
// check if data exist. If not, display error message box
if (!(BOOL)db_get_b(hContact, WEATHERPROTONAME, "IsUpdated", FALSE))
- _tcsncpy(str, WEATHER_NO_INFO, _countof(str) - 1);
+ wcsncpy(str, WEATHER_NO_INFO, _countof(str) - 1);
else
// set the display text and show the message box
GetDisplay(&winfo, opt.bText, str);
@@ -210,7 +210,7 @@ static INT_PTR CALLBACK DlgProcMoreData(HWND hwndDlg, UINT msg, WPARAM wParam, L
case WM_LBUTTONUP:
TEXTRANGE tr;
tr.chrg = enlink->chrg;
- tr.lpstrText = (LPTSTR)mir_alloc(sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 8));
+ tr.lpstrText = (LPTSTR)mir_alloc(sizeof(wchar_t)*(tr.chrg.cpMax - tr.chrg.cpMin + 8));
SendMessage(pNmhdr->hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
Utils_OpenUrlT(tr.lpstrText);
mir_free(tr.lpstrText);
@@ -239,7 +239,7 @@ static INT_PTR CALLBACK DlgProcMoreData(HWND hwndDlg, UINT msg, WPARAM wParam, L
static INT_PTR CALLBACK DlgProcUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
WEATHERINFO w;
- TCHAR str[MAX_TEXT_SIZE];
+ wchar_t str[MAX_TEXT_SIZE];
MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
@@ -316,7 +316,7 @@ int UserInfoInit(WPARAM wParam, LPARAM lParam)
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.position = 100000000;
- odp.ptszTitle = _T(WEATHERPROTONAME);
+ odp.pwszTitle = _T(WEATHERPROTONAME);
if (lParam == 0) {
odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO);
diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp
index fbdc6e9442..802227954d 100644
--- a/plugins/WebView/src/main.cpp
+++ b/plugins/WebView/src/main.cpp
@@ -164,7 +164,7 @@ extern "C" int __declspec(dllexport) Load()
InitServices();
//add sound event to options
- SkinAddNewSoundExT("webviewalert", _T(MODULENAME), LPGENT("Alert event"));
+ SkinAddNewSoundExT("webviewalert", _T(MODULENAME), LPGENW("Alert event"));
//value is 1 if menu is disabled
db_set_b(NULL, MODULENAME, MENU_IS_DISABLED_KEY, 1);
@@ -183,9 +183,9 @@ extern "C" int __declspec(dllexport) Load()
CreateServiceFunction("DisableWebview", AutoUpdateMCmd);
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE));
if (db_get_b(NULL, MODULENAME, DISABLE_AUTOUPDATE_KEY, 0))
- mi.name.t = LPGENT("Auto update disabled");
+ mi.name.w = LPGENW("Auto update disabled");
else
- mi.name.t = LPGENT("Auto update enabled");
+ mi.name.w = LPGENW("Auto update enabled");
mi.pszService = "DisableWebview";
hMenuItem1 = Menu_AddMainMenuItem(&mi);
@@ -194,7 +194,7 @@ extern "C" int __declspec(dllexport) Load()
CreateServiceFunction("UpdateAll", UpdateAllMenuCommand);
mi.position = 500090002;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL));
- mi.name.t = LPGENT("Update all Webview sites");
+ mi.name.w = LPGENW("Update all Webview sites");
mi.pszService = "UpdateAll";
Menu_AddMainMenuItem(&mi);
@@ -203,7 +203,7 @@ extern "C" int __declspec(dllexport) Load()
CreateServiceFunction("MarkAllSitesRead", MarkAllReadMenuCommand);
mi.position = 500090099;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_MARKALLREAD));
- mi.name.t = LPGENT("Mark all Webview sites as read");
+ mi.name.w = LPGENW("Mark all Webview sites as read");
mi.pszService = "MarkAllSitesRead";
Menu_AddMainMenuItem(&mi);
@@ -212,7 +212,7 @@ extern "C" int __declspec(dllexport) Load()
CreateServiceFunction("OpenCacheFolder", OpenCacheDir);
mi.position = 500090099;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_FOLDER));
- mi.name.t = LPGENT("Open cache folder");
+ mi.name.w = LPGENW("Open cache folder");
mi.pszService = "OpenCacheFolder";
Menu_AddMainMenuItem(&mi);
@@ -220,11 +220,11 @@ extern "C" int __declspec(dllexport) Load()
SET_UID(mi, 0xbb1a94a9, 0xca63, 0x4966, 0x98, 0x48, 0x8b, 0x3f, 0x9d, 0xac, 0x6a, 0x10);
CreateServiceFunction("Countdown", CountdownMenuCommand);
mi.flags |= CMIF_KEEPUNTRANSLATED;
- TCHAR countername[100];
+ wchar_t countername[100];
mir_sntprintf(countername, TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
mi.position = 600090099;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL));
- mi.name.t = countername;
+ mi.name.w = countername;
mi.pszService = "Countdown";
hMenuItemCountdown = Menu_AddMainMenuItem(&mi);
}
@@ -237,49 +237,49 @@ extern "C" int __declspec(dllexport) Load()
mi.position = 100;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_URL));
mi.pszService = "Open web page";
- mi.name.t = LPGENT("Open web page");
+ mi.name.w = LPGENW("Open web page");
Menu_AddContactMenuItem(&mi, MODULENAME);
SET_UID(mi, 0x9d803e61, 0xc929, 0x4c6e, 0x9e, 0x7, 0x93, 0x0, 0xab, 0x14, 0x13, 0x50);
CreateServiceFunction("OpenClose Window", DataWndMenuCommand);
mi.pszService = "OpenClose Window";
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SHOW_HIDE));
- mi.name.t = LPGENT("Open/Close window");
+ mi.name.w = LPGENW("Open/Close window");
Menu_AddContactMenuItem(&mi, MODULENAME);
SET_UID(mi, 0x3840cc71, 0xcc85, 0x448d, 0xb5, 0xc8, 0x1a, 0x7d, 0xfe, 0xf0, 0x8, 0x85);
mi.position = 2222220;
mi.pszService = "UpdateData";
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATE));
- mi.name.t = LPGENT("Update data");
+ mi.name.w = LPGENW("Update data");
Menu_AddContactMenuItem(&mi, MODULENAME);
SET_UID(mi, 0xd1ab586c, 0x2c71, 0x429c, 0xb1, 0x79, 0x7b, 0x3a, 0x1d, 0x4a, 0xc1, 0x7d);
CreateServiceFunction("ContactOptions", CntOptionsMenuCommand);
mi.pszService = "ContactOptions";
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_OPTIONS));
- mi.name.t = LPGENT("Contact options");
+ mi.name.w = LPGENW("Contact options");
Menu_AddContactMenuItem(&mi, MODULENAME);
SET_UID(mi, 0xe4cda597, 0x9def, 0x4f54, 0x8a, 0xc6, 0x69, 0x3b, 0x5a, 0x7d, 0x77, 0xb6);
CreateServiceFunction("ContactAlertOpts", CntAlertMenuCommand);
mi.pszService = "ContactAlertOpts";
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ALERT));
- mi.name.t = LPGENT("Contact alert options");
+ mi.name.w = LPGENW("Contact alert options");
Menu_AddContactMenuItem(&mi, MODULENAME);
SET_UID(mi, 0x63fdeed8, 0xf880, 0x423f, 0x95, 0xae, 0x20, 0x8c, 0x86, 0x3c, 0x5, 0xd8);
CreateServiceFunction("PingWebsite", PingWebsiteMenuCommand);
mi.pszService = "PingWebsite";
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_PING));
- mi.name.t = LPGENT("Ping web site");
+ mi.name.w = LPGENW("Ping web site");
Menu_AddContactMenuItem(&mi, MODULENAME);
SET_UID(mi, 0x28fd36de, 0x6ce1, 0x43d0, 0xa1, 0x6e, 0x98, 0x71, 0x53, 0xe8, 0xc9, 0xf4);
CreateServiceFunction("StopDataProcessing", StpPrcssMenuCommand);
mi.pszService = "StopDataProcessing";
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_STOP));
- mi.name.t = LPGENT("Stop data processing");
+ mi.name.w = LPGENW("Stop data processing");
Menu_AddContactMenuItem(&mi, MODULENAME);
hWindowList = WindowList_Create();
diff --git a/plugins/WebView/src/stdafx.h b/plugins/WebView/src/stdafx.h
index 7b97ef0a5d..2dc3a797e8 100644
--- a/plugins/WebView/src/stdafx.h
+++ b/plugins/WebView/src/stdafx.h
@@ -9,7 +9,6 @@
#include <process.h>
#include <stdio.h>
#include <string.h>
-#include <tchar.h>
#include <time.h>
#include <wchar.h>
diff --git a/plugins/WebView/src/webview.cpp b/plugins/WebView/src/webview.cpp
index 74c4c28809..78721ee7e5 100644
--- a/plugins/WebView/src/webview.cpp
+++ b/plugins/WebView/src/webview.cpp
@@ -50,9 +50,9 @@ void ChangeMenuItem1()
// Enable or Disable auto updates
LPCTSTR ptszName;
if (!db_get_b(NULL, MODULENAME, DISABLE_AUTOUPDATE_KEY, 0))
- ptszName = LPGENT("Auto update enabled");
+ ptszName = LPGENW("Auto update enabled");
else
- ptszName = LPGENT("Auto update disabled");
+ ptszName = LPGENW("Auto update disabled");
Menu_ModifyItem(hMenuItem1, ptszName, LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE)));
}
@@ -63,7 +63,7 @@ void ChangeMenuItemCountdown()
// countdown
HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL));
- TCHAR countername[100];
+ wchar_t countername[100];
mir_sntprintf(countername, TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
Menu_ModifyItem(hMenuItemCountdown, countername, hIcon, CMIF_KEEPUNTRANSLATED);
@@ -295,8 +295,8 @@ static int OptInitialise(WPARAM wParam, LPARAM)
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT);
- odp.ptszGroup = LPGENT("Network");
- odp.ptszTitle = _T(MODULENAME);
+ odp.pwszGroup = LPGENW("Network");
+ odp.pwszTitle = _T(MODULENAME);
odp.pfnDlgProc = DlgProcOpt;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &odp);
@@ -304,7 +304,7 @@ static int OptInitialise(WPARAM wParam, LPARAM)
// if popup service exists
if ((ServiceExists(MS_POPUP_ADDPOPUPT))) {
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUP);
- odp.ptszGroup = LPGENT("Popups");
+ odp.pwszGroup = LPGENW("Popups");
odp.pfnDlgProc = DlgPopUpOpts;
Options_AddPage(wParam, &odp);
}
diff --git a/plugins/WebView/src/webview.h b/plugins/WebView/src/webview.h
index 82a264fc1b..967645e4b8 100644
--- a/plugins/WebView/src/webview.h
+++ b/plugins/WebView/src/webview.h
@@ -23,6 +23,7 @@
#define CFM_BACKCOLOR 0x04000000
#define MODULENAME "WebView"
+#define MODULENAMEW L"WebView"
#define MENU_OFF "DisableMenu"
#define REFRESH_KEY "Refresh interval"
@@ -156,7 +157,7 @@ void SavewinSettings(void);
void ValidatePosition(HWND hwndDlg);
int ModulesLoaded(WPARAM wParam, LPARAM lParam);
void ChangeMenuItem3();
-TCHAR* FixButtonText(TCHAR *url, size_t len);
+wchar_t* FixButtonText(wchar_t *url, size_t len);
int ContactMenuItemUpdateData (WPARAM wParam, LPARAM lParam);
int Doubleclick(WPARAM wParam, LPARAM lParam);
@@ -224,8 +225,8 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
void AckFunc(void *dummy);
int SiteDeleted(WPARAM wParam, LPARAM lParam);
-int WErrorPopup(MCONTACT hContact, TCHAR *textdisplay);
-int WAlertPopup(MCONTACT hContact, TCHAR *displaytext);
+int WErrorPopup(MCONTACT hContact, wchar_t *textdisplay);
+int WAlertPopup(MCONTACT hContact, wchar_t *displaytext);
//////////////////////
// wrappers
diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp
index 6397413cda..8c909b50d0 100644
--- a/plugins/WebView/src/webview_alerts.cpp
+++ b/plugins/WebView/src/webview_alerts.cpp
@@ -88,21 +88,21 @@ int WDisplayDataAlert(MCONTACT hContact)
}
/*****************************************************************************/
-int WAlertPopup(MCONTACT hContact, TCHAR *displaytext)
+int WAlertPopup(MCONTACT hContact, wchar_t *displaytext)
{
NotifyEventHooks(hHookAlertPopup, hContact, (LPARAM)displaytext);
return 0;
}
/*****************************************************************************/
-int WErrorPopup(MCONTACT hContact, TCHAR *textdisplay)
+int WErrorPopup(MCONTACT hContact, wchar_t *textdisplay)
{
NotifyEventHooks(hHookErrorPopup, hContact, (LPARAM) textdisplay);
return 0;
}
/*****************************************************************************/
-int WAlertOSD(MCONTACT hContact, TCHAR *displaytext)
+int WAlertOSD(MCONTACT hContact, wchar_t *displaytext)
{
NotifyEventHooks(hHookAlertOSD, hContact, (LPARAM) displaytext);
return 0;
@@ -124,7 +124,7 @@ int PopupAlert(WPARAM wParam, LPARAM lParam)
ppd.lchContact = wParam;
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE));
- TCHAR *displaytext = (TCHAR*)lParam;
+ wchar_t *displaytext = (wchar_t*)lParam;
if ((mir_tstrlen(displaytext) == MAX_SECONDLINE) || (mir_tstrlen(displaytext) > MAX_SECONDLINE))
mir_sntprintf(ppd.lptzText, displaytext);
else if (mir_tstrlen(displaytext) < MAX_SECONDLINE)
@@ -181,12 +181,12 @@ int OSDAlert(WPARAM hContact, LPARAM lParam)
int ErrorMsgs(WPARAM wParam, LPARAM lParam)
{
MCONTACT hContact = wParam;
- TCHAR newdisplaytext[2000], *displaytext = (TCHAR*)lParam;
+ wchar_t newdisplaytext[2000], *displaytext = (wchar_t*)lParam;
if (db_get_b(NULL, MODULENAME, SUPPRESS_ERR_KEY, 0))
return 0;
- TCHAR *ptszContactName = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *ptszContactName = pcli->pfnGetContactDisplayName(hContact, 0);
if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, MODULENAME, ERROR_POPUP_KEY, 0)) {
mir_sntprintf(newdisplaytext, L"%s\n%s", ptszContactName, displaytext);
PUShowMessageT(newdisplaytext, SM_WARNING);
@@ -255,7 +255,7 @@ void SaveToFile(MCONTACT hContact, char *truncated)
int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactname, int notpresent)
{
char alertstring[255];
- TCHAR displaystring[300];
+ wchar_t displaystring[300];
FILE *pcachefile;
DBVARIANT tdbv;
int wasAlert = 0;
@@ -420,9 +420,9 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn
}
else if (eventIndex == 1) { // webpage changed
// TEST GET NAME FOR CACHE
- TCHAR cachepath[MAX_PATH], cachedirectorypath[MAX_PATH], newcachepath[MAX_PATH + 50];
+ wchar_t cachepath[MAX_PATH], cachedirectorypath[MAX_PATH], newcachepath[MAX_PATH + 50];
GetModuleFileName(hInst, cachepath, _countof(cachepath));
- TCHAR *cacheend = _tcsrchr(cachepath, '\\');
+ wchar_t *cacheend = wcsrchr(cachepath, '\\');
cacheend++;
*cacheend = '\0';
@@ -430,8 +430,8 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn
CreateDirectory(cachedirectorypath, NULL);
mir_sntprintf(newcachepath, L"%s%S%S%S%S", cachepath, MODULENAME, "cache\\", contactname, ".txt");
// file exists?
- if ( _taccess(newcachepath, 0) != -1) {
- if ((pcachefile = _tfopen(newcachepath, L"r")) == NULL)
+ if ( _waccess(newcachepath, 0) != -1) {
+ if ((pcachefile = _wfopen(newcachepath, L"r")) == NULL)
WErrorPopup((UINT_PTR)contactname, TranslateT("Cannot read from file"));
else {
memset(&cachecompare, 0, sizeof(cachecompare));
@@ -440,7 +440,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn
}
}
// write to cache
- if ((pcachefile = _tfopen(newcachepath, L"w")) == NULL)
+ if ((pcachefile = _wfopen(newcachepath, L"w")) == NULL)
WErrorPopup((UINT_PTR)contactname, TranslateT("Cannot write to file 1"));
else {
fwrite(tempraw, mir_strlen(tempraw), 1, pcachefile); //smaller cache
@@ -632,9 +632,9 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn
///////////////
if (((strstr(tempraw, Alerttempstring)) != 0) && ((strstr(tempraw, Alerttempstring2)) != 0)) {
// TEST GET NAME FOR CACHE
- TCHAR cachepath[MAX_PATH], cachedirectorypath[MAX_PATH], newcachepath[MAX_PATH + 50];
+ wchar_t cachepath[MAX_PATH], cachedirectorypath[MAX_PATH], newcachepath[MAX_PATH + 50];
GetModuleFileName(hInst, cachepath, _countof(cachepath));
- TCHAR *cacheend = _tcsrchr(cachepath, '\\');
+ wchar_t *cacheend = wcsrchr(cachepath, '\\');
cacheend++;
*cacheend = '\0';
@@ -642,8 +642,8 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn
CreateDirectory(cachedirectorypath, NULL);
mir_sntprintf(newcachepath, L"%s%S%S%S%S", cachepath, MODULENAME, "cache\\", contactname, ".txt");
// file exists?
- if ( _taccess(newcachepath, 0) != -1) {
- if ((pcachefile = _tfopen(newcachepath, L"r")) == NULL)
+ if ( _waccess(newcachepath, 0) != -1) {
+ if ((pcachefile = _wfopen(newcachepath, L"r")) == NULL)
WErrorPopup((UINT_PTR)contactname, TranslateT("Cannot read from file"));
else {
memset(&cachecompare, 0, sizeof(cachecompare));
@@ -652,7 +652,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn
}
}
// write to cache
- if ((pcachefile = _tfopen(newcachepath, L"w")) == NULL)
+ if ((pcachefile = _wfopen(newcachepath, L"w")) == NULL)
WErrorPopup((UINT_PTR)contactname, TranslateT("Cannot write to file 2"));
else {
fwrite(raw, mir_strlen(raw), 1, pcachefile); //smaller cache
diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp
index da1314d9a1..57d59b4bba 100644
--- a/plugins/WebView/src/webview_datawnd.cpp
+++ b/plugins/WebView/src/webview_datawnd.cpp
@@ -117,12 +117,12 @@ INT_PTR CALLBACK DlgProcFind(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
/*****************************************************************************/
-static TCHAR tszSizeString[] = L"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
+static wchar_t tszSizeString[] = L"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
static MCONTACT FindContactByUrl(HWND hwndDlg)
{
MCONTACT res = NULL;
- TCHAR urltext[300], titlebartxt[300];
+ wchar_t urltext[300], titlebartxt[300];
int contactcount = 0;
GetDlgItemText(hwndDlg, IDC_OPEN_URL, urltext, _countof(urltext));
@@ -148,7 +148,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
{
DBVARIANT dbv;
RECT rc;
- TCHAR url[300];
+ wchar_t url[300];
MCONTACT hContact;
switch (msg) {
@@ -162,7 +162,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
url[0] = '\0';
if (!db_get_ts(hContact2, MODULENAME, URL_KEY, &dbv)) {
- _tcsncpy_s(url, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(url, dbv.ptszVal, _TRUNCATE);
db_free(&dbv);
}
SetDlgItemText(hwndDlg, IDC_OPEN_URL, FixButtonText(url, _countof(url)));
@@ -358,7 +358,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
if (hContact = FindContactByUrl(hwndDlg))
OnTopMenuCommand(wParam, lParam, hContact);
{
- TCHAR *ptszToolTip;
+ wchar_t *ptszToolTip;
HWND hTopmost;
if (!db_get_b(hContact, MODULENAME, ON_TOP_KEY, 0)) {
hTopmost = HWND_NOTOPMOST;
diff --git a/plugins/WebView/src/webview_getdata.cpp b/plugins/WebView/src/webview_getdata.cpp
index a97f3c31e2..55299017a5 100644
--- a/plugins/WebView/src/webview_getdata.cpp
+++ b/plugins/WebView/src/webview_getdata.cpp
@@ -139,7 +139,7 @@ void GetData(void *param)
if (nlhrReply->resultCode < 200 || nlhrReply->resultCode >= 300) {
db_set_w(hContact, MODULENAME, "Status", ID_STATUS_AWAY);
- TCHAR *statusText = TranslateT("The server replied with a failure code");
+ wchar_t *statusText = TranslateT("The server replied with a failure code");
SetDlgItemText(hwndDlg, IDC_STATUSBAR, statusText);
WErrorPopup(hContact, statusText);
db_set_ts(hContact, "CList", "StatusMsg", statusText);
@@ -155,7 +155,7 @@ void GetData(void *param)
if (!nlhrReply) {
db_set_w(hContact, MODULENAME, "Status", ID_STATUS_NA);
- TCHAR *statusText = TranslateT("The server is down or lagging.");
+ wchar_t *statusText = TranslateT("The server is down or lagging.");
SetDlgItemText(hwndDlg, IDC_STATUSBAR, statusText);
WErrorPopup(hContact, statusText);
db_set_ts(hContact, "CList", "StatusMsg", statusText);
@@ -232,7 +232,7 @@ void GetData(void *param)
DownloadSuccess = 1;
}
else if (db_get_b(hContact, MODULENAME, U_ALLSITE_KEY, 0) == 0) {
- TCHAR *szStatusText = TranslateT("Invalid search parameters.");
+ wchar_t *szStatusText = TranslateT("Invalid search parameters.");
WErrorPopup(hContact, szStatusText);
DownloadSuccess = 0;
@@ -246,7 +246,7 @@ void GetData(void *param)
if (DownloadSuccess) { // download success
if (statpos == 0 && statposend == 0) {
if (db_get_b(hContact, MODULENAME, U_ALLSITE_KEY, 0) == 0) {
- TCHAR *statusText = TranslateT("Both search strings not found or strings not set.");
+ wchar_t *statusText = TranslateT("Both search strings not found or strings not set.");
WErrorPopup(hContact, statusText);
db_set_ts(hContact, "CList", "StatusMsg", statusText);
@@ -355,7 +355,7 @@ void GetData(void *param)
SetDlgItemText(hwndDlg, IDC_STATUSBAR, TranslateT("Processing data (Stage 1)"));
if (db_get_b(hContact, MODULENAME, STOP_KEY, 1) == 1) {
-LBL_Stop: TCHAR *statusText = TranslateT("Processing data stopped by user.");
+LBL_Stop: wchar_t *statusText = TranslateT("Processing data stopped by user.");
SetDlgItemText(hwndDlg, IDC_STATUSBAR, statusText);
db_set_b(hContact, MODULENAME, STOP_KEY, 0);
db_set_w(hContact, MODULENAME, "Status", ID_STATUS_ONLINE);
diff --git a/plugins/WebView/src/webview_opts.cpp b/plugins/WebView/src/webview_opts.cpp
index dc894668fd..206334e5e1 100644
--- a/plugins/WebView/src/webview_opts.cpp
+++ b/plugins/WebView/src/webview_opts.cpp
@@ -23,38 +23,38 @@
#include "stdafx.h"
#include "webview.h"
-const TCHAR *szTrackerBarDescr[] = {
- LPGENT("No whitespace removal"),
- LPGENT("Minimal level of whitespace removal"),
- LPGENT("Medium level of whitespace removal"),
- LPGENT("Large level of whitespace removal"),
- LPGENT("Remove all whitespace")
+const wchar_t *szTrackerBarDescr[] = {
+ LPGENW("No whitespace removal"),
+ LPGENW("Minimal level of whitespace removal"),
+ LPGENW("Medium level of whitespace removal"),
+ LPGENW("Large level of whitespace removal"),
+ LPGENW("Remove all whitespace")
};
static char *fontSizes[] = { "8", "10", "14", "16", "18", "20", "24", "28" };
-static TCHAR *AlertTypes[] = { LPGENT("Popup plugin"), LPGENT("Log to file"), LPGENT("Open data display window"), LPGENT("Use OSD plugin") };
-static TCHAR *EventTypes[] = { LPGENT("A string is present"), LPGENT("The web page changes"), LPGENT("A specific part of web page changes") };
+static wchar_t *AlertTypes[] = { LPGENW("Popup plugin"), LPGENW("Log to file"), LPGENW("Open data display window"), LPGENW("Use OSD plugin") };
+static wchar_t *EventTypes[] = { LPGENW("A string is present"), LPGENW("The web page changes"), LPGENW("A specific part of web page changes") };
#define M_FILLSCRIPTCOMBO (WM_USER+16)
-TCHAR* FixButtonText(TCHAR *url, size_t len)
+wchar_t* FixButtonText(wchar_t *url, size_t len)
{
- TCHAR buttontext[256], stringbefore[256], newbuttontext[256];
- _tcsncpy_s(buttontext, url, _TRUNCATE);
- _tcsncpy_s(newbuttontext, url, _TRUNCATE);
+ wchar_t buttontext[256], stringbefore[256], newbuttontext[256];
+ wcsncpy_s(buttontext, url, _TRUNCATE);
+ wcsncpy_s(newbuttontext, url, _TRUNCATE);
- if (_tcschr(newbuttontext, '&') != 0) {
+ if (wcschr(newbuttontext, '&') != 0) {
while (true) {
- if (_tcschr(newbuttontext, '&') == 0)
+ if (wcschr(newbuttontext, '&') == 0)
break;
- _tcsncpy_s(buttontext, newbuttontext, _TRUNCATE);
- TCHAR *stringafter = _tcschr(buttontext, '&');
+ wcsncpy_s(buttontext, newbuttontext, _TRUNCATE);
+ wchar_t *stringafter = wcschr(buttontext, '&');
int pos = (stringafter - buttontext);
int posbefore = (stringafter - buttontext) - 1;
int posafter = (stringafter - buttontext) + 1;
strdelt(stringafter, 1);
- _tcsncpy_s(stringbefore, pos, buttontext, _TRUNCATE);
+ wcsncpy_s(stringbefore, pos, buttontext, _TRUNCATE);
mir_sntprintf(newbuttontext, L"%s!!%s", stringbefore, stringafter);
posafter = 0;
@@ -62,17 +62,17 @@ TCHAR* FixButtonText(TCHAR *url, size_t len)
}
while (true) {
- if (_tcschr(newbuttontext, '!') != 0) {
- TCHAR *stringafter = _tcschr(newbuttontext, '!');
+ if (wcschr(newbuttontext, '!') != 0) {
+ wchar_t *stringafter = wcschr(newbuttontext, '!');
int pos = (stringafter - newbuttontext);
newbuttontext[pos] = '&';
}
- if (_tcschr(newbuttontext, '!') == 0)
+ if (wcschr(newbuttontext, '!') == 0)
break;
}
}
- _tcsncpy_s(url, len, newbuttontext, _TRUNCATE);
+ wcsncpy_s(url, len, newbuttontext, _TRUNCATE);
return url;
}
@@ -188,7 +188,7 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
case IDC_PREVIEW:
{
- TCHAR str3[512];
+ wchar_t str3[512];
POPUPDATAT ppd = { 0 };
GetDlgItemText(hdlg, IDC_DELAY, str3, _countof(str3));
@@ -212,7 +212,7 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
ppd.colorBack = BGColour;
ppd.colorText = TextColour;
ppd.PluginWindowProc = NULL;
- ppd.iSeconds = _ttol(str3);
+ ppd.iSeconds = _wtol(str3);
// display popups
PUAddPopupT(&ppd);
}
@@ -224,10 +224,10 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
case PSN_APPLY:
{
int popupdelayval = 0;
- TCHAR str2[512];
+ wchar_t str2[512];
GetDlgItemText(hdlg, IDC_DELAY, str2, _countof(str2));
- popupdelayval = _ttol(str2);
+ popupdelayval = _wtol(str2);
db_set_dw(NULL, MODULENAME, POP_DELAY_KEY, popupdelayval);
db_set_b(NULL, MODULENAME, LCLK_WINDOW_KEY, (BYTE)IsDlgButtonChecked(hdlg, IDC_LCLK_WINDOW));
@@ -439,7 +439,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
switch (LOWORD(wParam)) {
case IDC_BROWSE:
{
- TCHAR szFileName[MAX_PATH];
+ wchar_t szFileName[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_FILENAME, szFileName, _countof(szFileName));
OPENFILENAME ofn = { 0 };
@@ -698,7 +698,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case IDC_OK2:
{
hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
eventIndex = db_get_b(hContact, MODULENAME, EVNT_INDEX_KEY, 0);
alertIndex = db_get_b(hContact, MODULENAME, ALRT_INDEX_KEY, 0);
@@ -799,7 +799,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
DBVARIANT dbv;
- TCHAR url[300];
+ wchar_t url[300];
HWND ParentHwnd = GetParent(hwndDlg);
static int test;
static int test2;
@@ -914,7 +914,7 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
case IDC_CPY_STRINGS:
{
- TCHAR string[128];
+ wchar_t string[128];
hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
GetDlgItemText(hwndDlg, IDC_START, string, _countof(string));
@@ -950,7 +950,7 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
case IDC_OPT_APPLY:
case IDOK:
{
- TCHAR str[128], contactname[128];
+ wchar_t str[128], contactname[128];
if (!GetWindowTextLength(GetDlgItem(hwndDlg, IDC_URL))) {
MessageBox(NULL, TranslateT("You need to supply a URL."), _T(MODULENAME), MB_OK);
break;
@@ -973,39 +973,39 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
}
GetDlgItemText(hwndDlg, IDC_SITE_NAME, contactname, _countof(contactname));
- if (_tcschr(contactname, '\\') != NULL) {
+ if (wcschr(contactname, '\\') != NULL) {
MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _T(MODULENAME), MB_OK);
break;
}
- if (_tcschr(contactname, '/') != NULL) {
+ if (wcschr(contactname, '/') != NULL) {
MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _T(MODULENAME), MB_OK);
break;
}
- if (_tcschr(contactname, ':') != NULL) {
+ if (wcschr(contactname, ':') != NULL) {
MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _T(MODULENAME), MB_OK);
break;
}
- if (_tcschr(contactname, '*') != NULL) {
+ if (wcschr(contactname, '*') != NULL) {
MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _T(MODULENAME), MB_OK);
break;
}
- if (_tcschr(contactname, '?') != NULL) {
+ if (wcschr(contactname, '?') != NULL) {
MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _T(MODULENAME), MB_OK);
break;
}
- if (_tcschr(contactname, '\"') != NULL) {
+ if (wcschr(contactname, '\"') != NULL) {
MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _T(MODULENAME), MB_OK);
break;
}
- if (_tcschr(contactname, '<') != NULL) {
+ if (wcschr(contactname, '<') != NULL) {
MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _T(MODULENAME), MB_OK);
break;
}
- if (_tcschr(contactname, '>') != NULL) {
+ if (wcschr(contactname, '>') != NULL) {
MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _T(MODULENAME), MB_OK);
break;
}
- if (_tcschr(contactname, '|') != NULL) {
+ if (wcschr(contactname, '|') != NULL) {
MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _T(MODULENAME), MB_OK);
break;
}
@@ -1267,7 +1267,7 @@ INT_PTR CALLBACK DlgProcOpt(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
db_set_b(NULL, MODULENAME, NO_PROTECT_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NO_PROTECT));
db_set_b(NULL, MODULENAME, DATA_POPUP_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DATAPOPUP));
- TCHAR str[100];
+ wchar_t str[100];
GetDlgItemText(hwndDlg, IDC_TYPEFACE, str, _countof(str));
db_set_ts(NULL, MODULENAME, FONT_FACE_KEY, str);
diff --git a/plugins/WebView/src/webview_services.cpp b/plugins/WebView/src/webview_services.cpp
index 537c83fe86..718c57fdbf 100644
--- a/plugins/WebView/src/webview_services.cpp
+++ b/plugins/WebView/src/webview_services.cpp
@@ -24,7 +24,7 @@
#include "webview.h"
static int searchId = -1;
-static TCHAR sID[32];
+static wchar_t sID[32];
/*****************************************************************************/
static char szInvalidChars[] = { '\\', '/', ':', '*', '?', '\"', '<', '>', '|' };
@@ -50,15 +50,15 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam)
if (oldName == NULL)
return 0;
- TCHAR nick[100];
+ wchar_t nick[100];
ptrT oldnick( db_get_tsa(hContact, "CList", "MyHandle"));
if (oldnick != NULL)
- _tcsncpy_s(nick, oldnick, _TRUNCATE);
+ wcsncpy_s(nick, oldnick, _TRUNCATE);
else
nick[0] = 0;
for (int i=0; i < _countof(szInvalidChars); i++ ) {
- TCHAR *p = _tcschr(nick, szInvalidChars[i]);
+ wchar_t *p = wcschr(nick, szInvalidChars[i]);
if (p != NULL) {
WErrorPopup((UINT_PTR)"ERROR", TranslateT("Invalid symbol present in contact name."));
*p = '_';
@@ -68,33 +68,33 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam)
if (invalidpresent) {
srand((unsigned)time(NULL));
- TCHAR ranStr[7];
- _itot((int)10000 *rand() / (RAND_MAX + 1.0), ranStr, 10);
+ wchar_t ranStr[7];
+ _itow((int)10000 *rand() / (RAND_MAX + 1.0), ranStr, 10);
mir_tstrcat(nick, ranStr);
}
- if ( _tcschr(nick, '(') == 0) {
+ if ( wcschr(nick, '(') == 0) {
db_set_ts(hContact, MODULENAME, PRESERVE_NAME_KEY, nick);
db_set_ts(hContact, MODULENAME, "Nick", nick);
db_set_ts(hContact, "CList", "MyHandle", nick);
}
// TEST GET NAME FOR CACHE
- TCHAR cachepath[MAX_PATH], cachedirectorypath[MAX_PATH];
+ wchar_t cachepath[MAX_PATH], cachedirectorypath[MAX_PATH];
GetModuleFileName(hInst, cachepath, _countof(cachepath));
- TCHAR *cacheend = _tcsrchr(cachepath, '\\');
+ wchar_t *cacheend = wcsrchr(cachepath, '\\');
cacheend++;
*cacheend = '\0';
- mir_sntprintf(cachedirectorypath, L"%s" MODULENAME L"cache\\", cachepath);
+ mir_sntprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\", cachepath);
CreateDirectory(cachedirectorypath, NULL);
- TCHAR newcachepath[MAX_PATH + 50], renamedcachepath[MAX_PATH + 50];
- mir_sntprintf(newcachepath, L"%s" MODULENAME L"cache\\%s.txt", cachepath, oldName);
- mir_sntprintf(renamedcachepath, L"%s" MODULENAME L"cache\\%s.txt", cachepath, nick);
+ wchar_t newcachepath[MAX_PATH + 50], renamedcachepath[MAX_PATH + 50];
+ mir_sntprintf(newcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, oldName);
+ mir_sntprintf(renamedcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, nick);
// file exists?
- if ( _taccess(newcachepath, 0) != -1) {
- FILE *pcachefile = _tfopen(newcachepath, L"r");
+ if ( _waccess(newcachepath, 0) != -1) {
+ FILE *pcachefile = _wfopen(newcachepath, L"r");
if (pcachefile != NULL) {
fclose(pcachefile);
if (mir_tstrcmp(newcachepath, renamedcachepath)) {
@@ -118,18 +118,18 @@ int SiteDeleted(WPARAM wParam, LPARAM)
ptrT contactName( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY));
// TEST GET NAME FOR CACHE
- TCHAR cachepath[MAX_PATH], cachedirectorypath[MAX_PATH], newcachepath[MAX_PATH + 50];
+ wchar_t cachepath[MAX_PATH], cachedirectorypath[MAX_PATH], newcachepath[MAX_PATH + 50];
GetModuleFileName(hInst, cachepath, _countof(cachepath));
- TCHAR *cacheend = _tcsrchr(cachepath, '\\');
+ wchar_t *cacheend = wcsrchr(cachepath, '\\');
cacheend++;
*cacheend = '\0';
- mir_sntprintf(cachedirectorypath, L"%s" MODULENAME L"cache\\", cachepath);
+ mir_sntprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\", cachepath);
CreateDirectory(cachedirectorypath, NULL);
- mir_sntprintf(newcachepath, L"%s" MODULENAME L"cache\\%s.txt", cachepath, contactName);
+ mir_sntprintf(newcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, contactName);
// file exists?
- if ( _taccess(newcachepath, 0) != -1) {
- FILE *pcachefile = _tfopen(newcachepath, L"r");
+ if ( _waccess(newcachepath, 0) != -1) {
+ FILE *pcachefile = _wfopen(newcachepath, L"r");
if (pcachefile != NULL) {
fclose(pcachefile);
DeleteFile(newcachepath);
@@ -143,15 +143,15 @@ int SiteDeleted(WPARAM wParam, LPARAM)
INT_PTR OpenCacheDir(WPARAM, LPARAM)
{
//GET NAME FOR CACHE
- TCHAR cachepath[MAX_PATH], cachedirectorypath[MAX_PATH];
+ wchar_t cachepath[MAX_PATH], cachedirectorypath[MAX_PATH];
GetModuleFileName(hInst, cachepath, _countof(cachepath));
- TCHAR *cacheend = _tcsrchr(cachepath, '\\');
+ wchar_t *cacheend = wcsrchr(cachepath, '\\');
cacheend++;
*cacheend = '\0';
- mir_sntprintf(cachedirectorypath, L"%s" MODULENAME L"cache\\%s", cachepath, cacheend);
+ mir_sntprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\%s", cachepath, cacheend);
- if( _taccess(cachedirectorypath, 0) != 0)
+ if( _waccess(cachedirectorypath, 0) != 0)
WErrorPopup((UINT_PTR)"ERROR", TranslateT("Cache folder does not exist."));
else
ShellExecute(NULL, L"open", cachedirectorypath, NULL, NULL, SW_SHOWNORMAL);
@@ -171,14 +171,14 @@ INT_PTR PingWebsiteMenuCommand(WPARAM wParam, LPARAM)
if (url == NULL)
return 0;
- TCHAR Cnick[200], *Oldnick;
- _tcsncpy(Cnick, url, _countof(Cnick));
- if ((Oldnick = _tcsstr(Cnick, L"://")) != 0)
+ wchar_t Cnick[200], *Oldnick;
+ wcsncpy(Cnick, url, _countof(Cnick));
+ if ((Oldnick = wcsstr(Cnick, L"://")) != 0)
Oldnick += 3;
else
Oldnick = Cnick;
- TCHAR *Nend = _tcschr(Oldnick, '/');
+ wchar_t *Nend = wcschr(Oldnick, '/');
if (Nend) *Nend = '\0';
ShellExecute(NULL, L"open", L"psite.bat", Oldnick, NULL, SW_HIDE);
@@ -304,7 +304,7 @@ INT_PTR BPLoadIcon(WPARAM wParam, LPARAM)
static void __cdecl BasicSearchTimerProc(void *pszNick)
{
PROTOSEARCHRESULT psr = { sizeof(psr) };
- psr.nick.t = (TCHAR*) pszNick;
+ psr.nick.w = (wchar_t*) pszNick;
// broadcast the search result
ProtoBroadcastAck(MODULENAME, NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)&psr);
@@ -316,15 +316,15 @@ static void __cdecl BasicSearchTimerProc(void *pszNick)
INT_PTR BasicSearch(WPARAM, LPARAM lParam)
{
- static TCHAR buf[300];
+ static wchar_t buf[300];
if (lParam)
- mir_tstrncpy(buf, (const TCHAR*) lParam, 256);
+ mir_tstrncpy(buf, (const wchar_t*) lParam, 256);
if (searchId != -1)
return 0; // only one search at a time
- mir_tstrncpy(sID, (TCHAR*)lParam, _countof(sID));
+ mir_tstrncpy(sID, (wchar_t*)lParam, _countof(sID));
searchId = 1;
// create a thread for the ID search
@@ -343,7 +343,7 @@ INT_PTR AddToList(WPARAM, LPARAM lParam)
if (psr == NULL)
return 0;
- if (psr->nick.t == NULL) {
+ if (psr->nick.w == NULL) {
WErrorPopup((UINT_PTR)"ERROR", TranslateT("Please select site in Find/Add contacts..."));
return 0;
}
@@ -355,7 +355,7 @@ INT_PTR AddToList(WPARAM, LPARAM lParam)
// check ID to see if the contact already exist in the database
if (db_get_ts(hContact, MODULENAME, "URL", &dbv))
continue;
- if (!mir_tstrcmpi(psr->nick.t, dbv.ptszVal)) {
+ if (!mir_tstrcmpi(psr->nick.w, dbv.ptszVal)) {
// remove the flag for not on list and hidden, thus make the
// contact visible
// and add them on the list
@@ -378,30 +378,30 @@ INT_PTR AddToList(WPARAM, LPARAM lParam)
db_set_b(hContact, MODULENAME, RWSPACE_KEY, 1);
//Convert url into a name for contact
- TCHAR Cnick[255];
- if (psr->nick.t != NULL)
- _tcsncpy(Cnick, psr->nick.t, _countof(Cnick));
+ wchar_t Cnick[255];
+ if (psr->nick.w != NULL)
+ wcsncpy(Cnick, psr->nick.w, _countof(Cnick));
else
Cnick[0] = 0;
- TCHAR *Oldnick = _tcsstr(Cnick, L"://");
+ wchar_t *Oldnick = wcsstr(Cnick, L"://");
if (Oldnick != 0)
Oldnick += 3;
else
Oldnick = Cnick;
- TCHAR *Newnick = _tcsstr(Oldnick, L"www.");
+ wchar_t *Newnick = wcsstr(Oldnick, L"www.");
if (Newnick != 0)
Newnick += 4;
else {
- Newnick = _tcsstr(Oldnick, L"WWW.");
+ Newnick = wcsstr(Oldnick, L"WWW.");
if (Newnick != 0)
Newnick += 4;
else
Newnick = Oldnick;
}
- TCHAR *Nend = _tcschr(Newnick, '.');
+ wchar_t *Nend = wcschr(Newnick, '.');
if (Nend) *Nend = '\0';
for (MCONTACT hContact2 = db_find_first(MODULENAME); hContact2 != NULL; hContact2 = db_find_next(hContact2, MODULENAME)) {
@@ -425,8 +425,8 @@ INT_PTR AddToList(WPARAM, LPARAM lParam)
{
srand((unsigned) time(NULL));
- TCHAR ranStr[10];
- _itot((int) 10000 *rand() / (RAND_MAX + 1.0), ranStr, 10);
+ wchar_t ranStr[10];
+ _itow((int) 10000 *rand() / (RAND_MAX + 1.0), ranStr, 10);
mir_tstrcat(Newnick, ranStr);
}
//end convert
@@ -436,8 +436,8 @@ INT_PTR AddToList(WPARAM, LPARAM lParam)
db_set_ts(hContact, MODULENAME, "Nick", Newnick);
db_set_b(hContact, MODULENAME, CLEAR_DISPLAY_KEY, 1);
db_set_s(hContact, MODULENAME, START_STRING_KEY, "");
- db_set_ts(hContact, MODULENAME, URL_KEY, psr->nick.t);
- db_set_ts(hContact, MODULENAME, "Homepage", psr->nick.t);
+ db_set_ts(hContact, MODULENAME, URL_KEY, psr->nick.w);
+ db_set_ts(hContact, MODULENAME, "Homepage", psr->nick.w);
db_set_b(hContact, MODULENAME, U_ALLSITE_KEY, 1);
db_set_w(hContact, MODULENAME, "Status", ID_STATUS_ONLINE);
diff --git a/plugins/WhenWasIt/src/WhenWasIt.cpp b/plugins/WhenWasIt/src/WhenWasIt.cpp
index 52a0b587b7..cb5da2f666 100644
--- a/plugins/WhenWasIt/src/WhenWasIt.cpp
+++ b/plugins/WhenWasIt/src/WhenWasIt.cpp
@@ -74,7 +74,7 @@ extern "C" int __declspec(dllexport) Load(void)
CMenuItem mi;
mi.position = 10000000;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Birthdays (When Was It)"), mi.position);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Birthdays (When Was It)"), mi.position);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "95D842AE-FCCE-43C9-87E3-C28546B7E00E");
SET_UID(mi, 0x4efbd640, 0xabbd, 0x470e, 0x9a, 0xa, 0x64, 0x76, 0x1a, 0x74, 0xf3, 0x24);
@@ -131,8 +131,8 @@ extern "C" int __declspec(dllexport) Load(void)
hotkey.pszService = MS_WWI_CHECK_BIRTHDAYS;
Hotkey_Register(&hotkey);
- SkinAddNewSoundExT(BIRTHDAY_NEAR_SOUND, LPGENT("WhenWasIt"), LPGENT("Birthday near"));
- SkinAddNewSoundExT(BIRTHDAY_TODAY_SOUND, LPGENT("WhenWasIt"), LPGENT("Birthday today"));
+ SkinAddNewSoundExT(BIRTHDAY_NEAR_SOUND, LPGENW("WhenWasIt"), LPGENW("Birthday near"));
+ SkinAddNewSoundExT(BIRTHDAY_TODAY_SOUND, LPGENW("WhenWasIt"), LPGENW("Birthday today"));
Log("%s", "Leaving function " __FUNCTION__);
return 0;
diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp
index d3658eb3a8..3b269468c9 100644
--- a/plugins/WhenWasIt/src/dlg_handlers.cpp
+++ b/plugins/WhenWasIt/src/dlg_handlers.cpp
@@ -29,23 +29,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define UPCOMING_TIMER_ID 1002
-const TCHAR *szShowAgeMode[] = { LPGENT("Upcoming age"), LPGENT("Current age") };
+const wchar_t *szShowAgeMode[] = { LPGENW("Upcoming age"), LPGENW("Current age") };
const int cShowAgeMode = sizeof(szShowAgeMode) / sizeof(szShowAgeMode[0]);
-const TCHAR *szSaveModule[] = { LPGENT("UserInfo module"), LPGENT("Protocol module"), LPGENT("mBirthday module") };
+const wchar_t *szSaveModule[] = { LPGENW("UserInfo module"), LPGENW("Protocol module"), LPGENW("mBirthday module") };
const int cSaveModule = sizeof(szSaveModule) / sizeof(szSaveModule[0]);
-const TCHAR *szPopupClick[] = { LPGENT("Nothing"), LPGENT("Dismiss"), LPGENT("Message window") };
+const wchar_t *szPopupClick[] = { LPGENW("Nothing"), LPGENW("Dismiss"), LPGENW("Message window") };
const int cPopupClick = sizeof(szPopupClick) / sizeof(szPopupClick[0]);
-const TCHAR *szNotifyFor[] = { LPGENT("All contacts"), LPGENT("All contacts except hidden ones"), LPGENT("All contacts except ignored ones"), LPGENT("All contacts except hidden and ignored ones") };
+const wchar_t *szNotifyFor[] = { LPGENW("All contacts"), LPGENW("All contacts except hidden ones"), LPGENW("All contacts except ignored ones"), LPGENW("All contacts except hidden and ignored ones") };
const int cNotifyFor = sizeof(szNotifyFor) / sizeof(szNotifyFor[0]);
#define MIN_BIRTHDAYS_WIDTH 200
#define MIN_BIRTHDAYS_HEIGHT 200
#include "commctrl.h"
-void CreateToolTip(HWND target, TCHAR* tooltip, LPARAM width)
+void CreateToolTip(HWND target, wchar_t* tooltip, LPARAM width)
{
HWND hwndToolTip = CreateWindow(TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, target, NULL, NULL, NULL);
@@ -121,7 +121,7 @@ SIZE GetControlTextSize(HWND hCtrl)
HFONT font = (HFONT)SendMessage(hCtrl, WM_GETFONT, 0, 0);
HFONT oldFont = (HFONT)SelectObject(hDC, font);
const size_t maxSize = 2048;
- TCHAR buffer[maxSize];
+ wchar_t buffer[maxSize];
SIZE size;
GetWindowText(hCtrl, buffer, _countof(buffer));
GetTextExtentPoint32(hDC, buffer, (int)mir_tstrlen(buffer), &size);
@@ -141,17 +141,17 @@ int EnlargeControl(HWND hCtrl, HWND, SIZE oldSize)
return 0;
}
-TCHAR *strtrim(TCHAR *str)
+wchar_t *strtrim(wchar_t *str)
{
size_t i = 0;
size_t len = mir_tstrlen(str);
- while ((i < len) && (str[i] == _T(' '))) { i++; }
+ while ((i < len) && (str[i] == ' ')) { i++; }
if (i) {
memmove(str, str + i, len - i + 1);
len -= i;
}
- while ((len > 0) && (str[--len] == _T(' ')))
+ while ((len > 0) && (str[--len] == ' '))
str[len] = 0;
return str;
@@ -190,18 +190,18 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
CreateToolTip(GetDlgItem(hWnd, IDC_POPUP_TIMEOUT), TranslateT("Set popup delay when notifying of upcoming birthdays.\nFormat: default delay [ | delay for birthdays occurring today]"), 400);
- TCHAR buffer[1024];
- _itot(commonData.daysInAdvance, buffer, 10);
+ wchar_t buffer[1024];
+ _itow(commonData.daysInAdvance, buffer, 10);
SetDlgItemText(hWnd, IDC_DAYS_IN_ADVANCE, buffer);
- _itot(commonData.checkInterval, buffer, 10);
+ _itow(commonData.checkInterval, buffer, 10);
SetDlgItemText(hWnd, IDC_CHECK_INTERVAL, buffer);
mir_sntprintf(buffer, L"%d|%d", commonData.popupTimeout, commonData.popupTimeoutToday);
SetDlgItemText(hWnd, IDC_POPUP_TIMEOUT, buffer);
- _itot(commonData.cSoundNearDays, buffer, 10);
+ _itow(commonData.cSoundNearDays, buffer, 10);
SetDlgItemText(hWnd, IDC_SOUND_NEAR_DAYS_EDIT, buffer);
- _itot(commonData.cDlgTimeout, buffer, 10);
+ _itow(commonData.cDlgTimeout, buffer, 10);
SetDlgItemText(hWnd, IDC_DLG_TIMEOUT, buffer);
- _itot(commonData.daysAfter, buffer, 10);
+ _itow(commonData.daysAfter, buffer, 10);
SetDlgItemText(hWnd, IDC_DAYS_AFTER, buffer);
CheckDlgButton(hWnd, IDC_OPENINBACKGROUND, (commonData.bOpenInBackground) ? BST_CHECKED : BST_UNCHECKED);
@@ -304,47 +304,47 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
commonData.bOpenInBackground = IsDlgButtonChecked(hWnd, IDC_OPENINBACKGROUND);
{
const int maxSize = 1024;
- TCHAR buffer[maxSize];
+ wchar_t buffer[maxSize];
GetDlgItemText(hWnd, IDC_DAYS_IN_ADVANCE, buffer, _countof(buffer));
- TCHAR *stop = NULL;
- commonData.daysInAdvance = _tcstol(buffer, &stop, 10);
+ wchar_t *stop = NULL;
+ commonData.daysInAdvance = wcstol(buffer, &stop, 10);
if (*stop) { commonData.daysInAdvance = DAYS_TO_NOTIFY; }
GetDlgItemText(hWnd, IDC_DAYS_AFTER, buffer, _countof(buffer));
- commonData.daysAfter = _tcstol(buffer, &stop, 10);
+ commonData.daysAfter = wcstol(buffer, &stop, 10);
if (*stop) { commonData.daysAfter = DAYS_TO_NOTIFY_AFTER; }
GetDlgItemText(hWnd, IDC_CHECK_INTERVAL, buffer, _countof(buffer));
- commonData.checkInterval = _ttol(buffer);
+ commonData.checkInterval = _wtol(buffer);
if (!commonData.checkInterval) { commonData.checkInterval = CHECK_INTERVAL; }
GetDlgItemText(hWnd, IDC_POPUP_TIMEOUT, buffer, _countof(buffer));
- TCHAR *pos;
- pos = _tcschr(buffer, _T('|'));
+ wchar_t *pos;
+ pos = wcschr(buffer, '|');
if (pos) {
- TCHAR tmp[128];
+ wchar_t tmp[128];
*pos = 0;
mir_tstrcpy(tmp, buffer);
strtrim(tmp);
- commonData.popupTimeout = _ttol(tmp);
+ commonData.popupTimeout = _wtol(tmp);
mir_tstrcpy(tmp, pos + 1);
strtrim(tmp);
- commonData.popupTimeoutToday = _ttol(tmp);
+ commonData.popupTimeoutToday = _wtol(tmp);
}
- else commonData.popupTimeout = commonData.popupTimeoutToday = _ttol(buffer);
+ else commonData.popupTimeout = commonData.popupTimeoutToday = _wtol(buffer);
GetDlgItemText(hWnd, IDC_SOUND_NEAR_DAYS_EDIT, buffer, _countof(buffer));
- //cSoundNearDays = _ttol(buffer);
- commonData.cSoundNearDays = _tcstol(buffer, &stop, 10);
+ //cSoundNearDays = _wtol(buffer);
+ commonData.cSoundNearDays = wcstol(buffer, &stop, 10);
if (*stop) { commonData.cSoundNearDays = BIRTHDAY_NEAR_DEFAULT_DAYS; }
GetDlgItemText(hWnd, IDC_DLG_TIMEOUT, buffer, _countof(buffer));
- commonData.cDlgTimeout = _tcstol(buffer, &stop, 10);
+ commonData.cDlgTimeout = wcstol(buffer, &stop, 10);
if (*stop) { commonData.cDlgTimeout = POPUP_TIMEOUT; }
db_set_b(NULL, ModuleName, "IgnoreSubcontacts", commonData.bIgnoreSubcontacts);
@@ -412,11 +412,11 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l
case WM_SHOWWINDOW:
{
- TCHAR *szTooltipText = TranslateT("Please select the module where you want the date of birth to be saved.\r\n\"UserInfo\" is the default location.\r\nUse \"Protocol module\" to make the data visible in User Details.\n\"mBirthday module\" uses the same module as mBirthday plugin.");
- TCHAR *szCurrentModuleTooltip = NULL;
+ wchar_t *szTooltipText = TranslateT("Please select the module where you want the date of birth to be saved.\r\n\"UserInfo\" is the default location.\r\nUse \"Protocol module\" to make the data visible in User Details.\n\"mBirthday module\" uses the same module as mBirthday plugin.");
+ wchar_t *szCurrentModuleTooltip = NULL;
char *szProto = GetContactProto(hContact);
- TCHAR buffer[2048];
+ wchar_t buffer[2048];
mir_sntprintf(buffer, TranslateT("Set birthday for %s:"), pcli->pfnGetContactDisplayName(hContact, 0));
SetWindowText(hWnd, buffer);
@@ -516,7 +516,7 @@ void AddAnchorWindowToDeferList(HDWP &hdWnds, HWND window, RECT *rParent, WINDOW
#define NA TranslateT("N/A")
-TCHAR* GetBirthdayModule(int module, MCONTACT)
+wchar_t* GetBirthdayModule(int module, MCONTACT)
{
switch (module) {
case DOB_MBIRTHDAY: return L"mBirthday";
@@ -540,8 +540,8 @@ INT_PTR CALLBACK BirthdaysCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam
{
BirthdaysSortParams params = *(BirthdaysSortParams *)myParam;
const int maxSize = 1024;
- TCHAR text1[maxSize];
- TCHAR text2[maxSize];
+ wchar_t text1[maxSize];
+ wchar_t text2[maxSize];
long value1, value2;
ListView_GetItemText(params.hList, (int)lParam1, params.column, text1, _countof(text1));
ListView_GetItemText(params.hList, (int)lParam2, params.column, text2, _countof(text2));
@@ -549,9 +549,9 @@ INT_PTR CALLBACK BirthdaysCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam
int res = 0;
if ((params.column == 2) || (params.column == 4)) {
- TCHAR *err1, *err2;
- value1 = _tcstol(text1, &err1, 10);
- value2 = _tcstol(text2, &err2, 10);
+ wchar_t *err1, *err2;
+ value1 = wcstol(text1, &err1, 10);
+ value2 = wcstol(text2, &err2, 10);
if ((err1[0]) || (err2[0]))
res = (err1[0]) ? 1 : -1;
@@ -592,7 +592,7 @@ int UpdateBirthdayEntry(HWND hList, MCONTACT hContact, int entry, int bShowAll,
char *szProto = GetContactProto(hContact);
PROTOACCOUNT *pAcc = Proto_GetAccount(szProto);
- TCHAR *ptszAccName = (pAcc == NULL) ? TranslateT("Unknown") : pAcc->tszAccountName;
+ wchar_t *ptszAccName = (pAcc == NULL) ? TranslateT("Unknown") : pAcc->tszAccountName;
LVITEM item = { 0 };
item.mask = LVIF_TEXT | LVIF_PARAM;
@@ -607,7 +607,7 @@ int UpdateBirthdayEntry(HWND hList, MCONTACT hContact, int entry, int bShowAll,
ListView_SetItemText(hList, entry, 1, pcli->pfnGetContactDisplayName(hContact, 0));
- TCHAR buffer[2048];
+ wchar_t buffer[2048];
if ((dtb <= 366) && (dtb >= 0))
mir_sntprintf(buffer, L"%d", dtb);
else
@@ -693,7 +693,7 @@ static LRESULT CALLBACK BirthdaysListSubclassProc(HWND hWnd, UINT msg, WPARAM wP
void SetBirthdaysCount(HWND hWnd)
{
int count = ListView_GetItemCount((GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST)));
- TCHAR title[512];
+ wchar_t title[512];
mir_sntprintf(title, TranslateT("Birthday list (%d)"), count);
SetWindowText(hWnd, title);
}
@@ -879,7 +879,7 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar
case WM_TIMER:
{
const int MAX_SIZE = 512;
- TCHAR buffer[MAX_SIZE];
+ wchar_t buffer[MAX_SIZE];
timeout--;
mir_sntprintf(buffer, (timeout != 2) ? TranslateT("Closing in %d seconds") : TranslateT("Closing in %d second"), timeout);
SetDlgItemText(hWnd, IDC_CLOSE, buffer);
@@ -913,7 +913,7 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar
item.pszText = data->message;
ListView_InsertItem(hList, &item);
- TCHAR buffer[512];
+ wchar_t buffer[512];
mir_sntprintf(buffer, L"%d", data->age);
ListView_SetItemText(hList, index, 1, buffer);
mir_sntprintf(buffer, L"%d", data->dtb);
diff --git a/plugins/WhenWasIt/src/hooked_events.cpp b/plugins/WhenWasIt/src/hooked_events.cpp
index 63f54e866f..d263f72196 100644
--- a/plugins/WhenWasIt/src/hooked_events.cpp
+++ b/plugins/WhenWasIt/src/hooked_events.cpp
@@ -46,8 +46,8 @@ static int OnOptionsInitialise(WPARAM wParam, LPARAM)
odp.position = 100000000;
odp.hInstance = hInstance;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_WWI);
- odp.ptszTitle = LPGENT("Birthdays");
- odp.ptszGroup = LPGENT("Contacts");
+ odp.pwszTitle = LPGENW("Birthdays");
+ odp.pwszGroup = LPGENW("Contacts");
odp.groupPosition = 910000000;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pfnDlgProc = DlgProcOptions;
diff --git a/plugins/WhenWasIt/src/icons.cpp b/plugins/WhenWasIt/src/icons.cpp
index 131d97ed06..5526639a3e 100644
--- a/plugins/WhenWasIt/src/icons.cpp
+++ b/plugins/WhenWasIt/src/icons.cpp
@@ -29,21 +29,21 @@ HANDLE hDTBMore = NULL;
HANDLE hWWIExtraIcons = (HANDLE)-1;
-static HANDLE AddIcon(char *name, char *description, TCHAR *tszPath, int iDefaultIdx)
+static HANDLE AddIcon(char *name, char *description, wchar_t *tszPath, int iDefaultIdx)
{
SKINICONDESC sid = { 0 };
sid.flags = SIDF_PATH_TCHAR;
sid.section.a = LPGEN("WhenWasIt");
sid.description.a = description;
sid.pszName = name;
- sid.defaultFile.t = tszPath;
+ sid.defaultFile.w = tszPath;
sid.iDefaultIndex = -iDefaultIdx;
return IcoLib_AddIcon(&sid);
}
int AddIcons()
{
- TCHAR tszPath[MAX_PATH];
+ wchar_t tszPath[MAX_PATH];
GetModuleFileName(hInstance, tszPath, _countof(tszPath));
hCheckMenu = AddIcon("MenuCheck", LPGEN("Check birthdays menu item"), tszPath, IDI_CHECK);
diff --git a/plugins/WhenWasIt/src/notifiers.cpp b/plugins/WhenWasIt/src/notifiers.cpp
index 4844dcece1..f7eeb0c150 100644
--- a/plugins/WhenWasIt/src/notifiers.cpp
+++ b/plugins/WhenWasIt/src/notifiers.cpp
@@ -35,12 +35,12 @@ void PopupNotifyNoBirthdays()
FillPopupData(pd, -1);
pd.lchIcon = GetDTBIcon(-1);
- _tcsncpy(pd.lptzContactName, TranslateT("WhenWasIt"), MAX_CONTACTNAME - 1);
- _tcsncpy(pd.lptzText, TranslateT("No upcoming birthdays."), MAX_SECONDLINE - 1);
+ wcsncpy(pd.lptzContactName, TranslateT("WhenWasIt"), MAX_CONTACTNAME - 1);
+ wcsncpy(pd.lptzText, TranslateT("No upcoming birthdays."), MAX_SECONDLINE - 1);
PUAddPopupT(&pd);
}
-TCHAR *BuildDTBText(int dtb, TCHAR *name, TCHAR *text, int size)
+wchar_t *BuildDTBText(int dtb, wchar_t *name, wchar_t *text, int size)
{
if (dtb > 1)
mir_sntprintf(text, size, TranslateT("%s has birthday in %d days."), name, dtb);
@@ -52,7 +52,7 @@ TCHAR *BuildDTBText(int dtb, TCHAR *name, TCHAR *text, int size)
return text;
}
-TCHAR *BuildDABText(int dab, TCHAR *name, TCHAR *text, int size)
+wchar_t *BuildDABText(int dab, wchar_t *name, wchar_t *text, int size)
{
if (dab > 1)
mir_sntprintf(text, size, TranslateT("%s had birthday %d days ago."), name, dab);
@@ -69,9 +69,9 @@ int PopupNotifyBirthday(MCONTACT hContact, int dtb, int age)
if (commonData.bIgnoreSubcontacts && db_mc_isSub(hContact))
return 0;
- TCHAR *name = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *name = pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR text[1024];
+ wchar_t text[1024];
BuildDTBText(dtb, name, text, _countof(text));
int gender = GetContactGender(hContact);
@@ -82,12 +82,12 @@ int PopupNotifyBirthday(MCONTACT hContact, int dtb, int age)
pd.lchIcon = GetDTBIcon(dtb);
mir_sntprintf(pd.lptzContactName, MAX_CONTACTNAME, TranslateT("Birthday - %s"), name);
- TCHAR *sex;
+ wchar_t *sex;
switch (toupper(gender)) {
- case _T('M'):
+ case 'M':
sex = TranslateT("He");
break;
- case _T('F'):
+ case 'F':
sex = TranslateT("She");
break;
default:
@@ -113,9 +113,9 @@ int PopupNotifyMissedBirthday(MCONTACT hContact, int dab, int age)
if (commonData.bIgnoreSubcontacts && db_mc_isSub(hContact))
return 0;
- TCHAR *name = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *name = pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR text[1024];
+ wchar_t text[1024];
BuildDABText(dab, name, text, _countof(text));
int gender = GetContactGender(hContact);
@@ -126,12 +126,12 @@ int PopupNotifyMissedBirthday(MCONTACT hContact, int dab, int age)
pd.lchIcon = GetDTBIcon(dab);
mir_sntprintf(pd.lptzContactName, MAX_CONTACTNAME, TranslateT("Birthday - %s"), name);
- TCHAR *sex;
+ wchar_t *sex;
switch (toupper(gender)) {
- case _T('M'):
+ case 'M':
sex = TranslateT("He");
break;
- case _T('F'):
+ case 'F':
sex = TranslateT("She");
break;
default:
@@ -153,9 +153,9 @@ int PopupNotifyMissedBirthday(MCONTACT hContact, int dab, int age)
int DialogNotifyBirthday(MCONTACT hContact, int dtb, int age)
{
- TCHAR *name = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *name = pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR text[1024];
+ wchar_t text[1024];
BuildDTBText(dtb, name, text, _countof(text));
if (!hUpcomingDlg) {
hUpcomingDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_UPCOMING), NULL, DlgProcUpcoming);
@@ -175,9 +175,9 @@ int DialogNotifyBirthday(MCONTACT hContact, int dtb, int age)
int DialogNotifyMissedBirthday(MCONTACT hContact, int dab, int age)
{
- TCHAR *name = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *name = pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR text[1024];
+ wchar_t text[1024];
BuildDABText(dab, name, text, _countof(text));
if (!hUpcomingDlg) {
hUpcomingDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_UPCOMING), NULL, DlgProcUpcoming);
diff --git a/plugins/WhenWasIt/src/notifiers.h b/plugins/WhenWasIt/src/notifiers.h
index 7fbeb682c3..58c9e81dfd 100644
--- a/plugins/WhenWasIt/src/notifiers.h
+++ b/plugins/WhenWasIt/src/notifiers.h
@@ -31,8 +31,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct TUpcomingBirthday{
MCONTACT hContact;
- TCHAR *name;
- TCHAR *message;
+ wchar_t *name;
+ wchar_t *message;
int dtb;
int age;
};
diff --git a/plugins/WhenWasIt/src/services.cpp b/plugins/WhenWasIt/src/services.cpp
index 8eeaf21b6a..a40f104f13 100644
--- a/plugins/WhenWasIt/src/services.cpp
+++ b/plugins/WhenWasIt/src/services.cpp
@@ -176,12 +176,12 @@ INT_PTR AddBirthdayService(WPARAM hContact, LPARAM)
return ShowWindow(hWnd, SW_SHOW);
}
-void ShowPopupMessage(const TCHAR *title, const TCHAR *message, HANDLE icon)
+void ShowPopupMessage(const wchar_t *title, const wchar_t *message, HANDLE icon)
{
POPUPDATAT pd = { 0 };
pd.lchIcon = IcoLib_GetIconByHandle(icon);
- _tcsncpy_s(pd.lptzContactName, title, _TRUNCATE);
- _tcsncpy_s(pd.lptzText, message, _TRUNCATE);
+ wcsncpy_s(pd.lptzContactName, title, _TRUNCATE);
+ wcsncpy_s(pd.lptzText, message, _TRUNCATE);
pd.colorText = commonData.foreground;
pd.colorBack = commonData.background;
PUAddPopupT(&pd);
@@ -212,12 +212,12 @@ INT_PTR RefreshUserDetailsService(WPARAM, LPARAM)
INT_PTR ImportBirthdaysService(WPARAM, LPARAM)
{
- TCHAR fileName[1024] = { 0 };
+ wchar_t fileName[1024] = { 0 };
OPENFILENAME of = { 0 };
of.lStructSize = sizeof(OPENFILENAME);
//of.hInstance = hInstance;
- TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, L"%s (*" _T(BIRTHDAY_EXTENSION) L")%c*" _T(BIRTHDAY_EXTENSION) L"%c", TranslateT("Birthdays files"), 0, 0);
+ wchar_t filter[MAX_PATH];
+ mir_sntprintf(filter, L"%s (*" BIRTHDAY_EXTENSION L")%c*" BIRTHDAY_EXTENSION L"%c", TranslateT("Birthdays files"), 0, 0);
of.lpstrFilter = filter;
of.lpstrFile = fileName;
of.nMaxFile = _countof(fileName);
@@ -225,7 +225,7 @@ INT_PTR ImportBirthdaysService(WPARAM, LPARAM)
of.Flags = OFN_FILEMUSTEXIST;
if (GetOpenFileName(&of)) {
- TCHAR buffer[2048];
+ wchar_t buffer[2048];
mir_sntprintf(buffer, TranslateT("Importing birthdays from file: %s"), fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), buffer, hImportBirthdays);
DoImport(fileName);
@@ -237,22 +237,22 @@ INT_PTR ImportBirthdaysService(WPARAM, LPARAM)
INT_PTR ExportBirthdaysService(WPARAM, LPARAM)
{
- TCHAR fileName[1024] = { 0 };
+ wchar_t fileName[1024] = { 0 };
OPENFILENAME of = { 0 };
of.lStructSize = sizeof(OPENFILENAME);
//of.hInstance = hInstance;
- TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, L"%s (*" _T(BIRTHDAY_EXTENSION) L")%c*" _T(BIRTHDAY_EXTENSION) L"%c%s (*.*)%c*.*%c", TranslateT("Birthdays files"), 0, 0, TranslateT("All Files"), 0, 0);
+ wchar_t filter[MAX_PATH];
+ mir_sntprintf(filter, L"%s (*" BIRTHDAY_EXTENSION L")%c*" BIRTHDAY_EXTENSION L"%c%s (*.*)%c*.*%c", TranslateT("Birthdays files"), 0, 0, TranslateT("All Files"), 0, 0);
of.lpstrFilter = filter;
of.lpstrFile = fileName;
of.nMaxFile = _countof(fileName);
of.lpstrTitle = TranslateT("Please select a file to export birthdays to...");
if (GetSaveFileName(&of)) {
- TCHAR buffer[2048];
- TCHAR *fn = _tcsrchr(fileName, _T('\\')) + 1;
- if (!_tcschr(fn, _T('.')))
- mir_tstrcat(fileName, _T(BIRTHDAY_EXTENSION));
+ wchar_t buffer[2048];
+ wchar_t *fn = wcsrchr(fileName, '\\') + 1;
+ if (!wcschr(fn, '.'))
+ mir_tstrcat(fileName, BIRTHDAY_EXTENSION);
mir_sntprintf(buffer, TranslateT("Exporting birthdays to file: %s"), fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), buffer, hExportBirthdays);
@@ -263,9 +263,9 @@ INT_PTR ExportBirthdaysService(WPARAM, LPARAM)
return 0;
}
-int DoImport(TCHAR *fileName)
+int DoImport(wchar_t *fileName)
{
- FILE *fin = _tfopen(fileName, L"rt");
+ FILE *fin = _wfopen(fileName, L"rt");
if (!fin) {
MessageBox(0, TranslateT("Could not open file to import birthdays"), TranslateT("Error"), MB_OK | MB_ICONERROR);
return 1;
@@ -274,32 +274,32 @@ int DoImport(TCHAR *fileName)
int mode = commonData.cDefaultModule;
while (!feof(fin)) {
- TCHAR buffer[4096];
- _fgetts(buffer, _countof(buffer), fin);
- if (buffer[0] == _T(COMMENT_CHAR))
+ wchar_t buffer[4096];
+ fgetws(buffer, _countof(buffer), fin);
+ if (buffer[0] == COMMENT_CHAR)
continue;
- TCHAR *delAccount = _tcsstr(buffer, L" : ");
+ wchar_t *delAccount = wcsstr(buffer, L" : ");
if (delAccount) {
int tmp = delAccount[0];
- delAccount[0] = _T('\0');
- TCHAR *delProto = _tcsrchr(buffer, _T('@'));
+ delAccount[0] = '\0';
+ wchar_t *delProto = wcsrchr(buffer, '@');
if (delProto) {
- delProto[0] = _T('\0');
+ delProto[0] = '\0';
- TCHAR *szHandle = buffer;
- TCHAR *szProto = delProto + 1;
+ wchar_t *szHandle = buffer;
+ wchar_t *szProto = delProto + 1;
MCONTACT hContact = GetContactFromID(szHandle, szProto);
if (hContact) {
delProto[0] = tmp;
delAccount[0] = tmp;
int year, month, day;
- _stscanf(delAccount, L" : %02d/%02d/%04d", &day, &month, &year);
+ swscanf(delAccount, L" : %02d/%02d/%04d", &day, &month, &year);
SaveBirthday(hContact, year, month, day, mode);
}
else {
- CMString msg(FORMAT, TranslateT(NOTFOUND_FORMAT), szHandle, szProto);
+ CMString msg(FORMAT, TranslateT("Could not find UID '%s [%S]' in current database, skipping"), szHandle, szProto);
ShowPopupMessage(TranslateT("Warning"), msg, hImportBirthdays);
}
}
@@ -310,26 +310,26 @@ int DoImport(TCHAR *fileName)
return 0;
}
-int DoExport(TCHAR *fileName)
+int DoExport(wchar_t *fileName)
{
- FILE *fout = _tfopen(fileName, L"wt");
+ FILE *fout = _wfopen(fileName, L"wt");
if (!fout) {
MessageBox(0, TranslateT("Could not open file to export birthdays"), TranslateT("Error"), MB_OK | MB_ICONERROR);
return 1;
}
- _ftprintf(fout, L"%c%s", _T(COMMENT_CHAR), TranslateT("Please do not edit this file by hand. Use the export function of WhenWasIt plugin.\n"));
- _ftprintf(fout, L"%c%s", _T(COMMENT_CHAR), TranslateT("Warning! Please do not mix Unicode and Ansi exported birthday files. You should use the same version (Ansi/Unicode) of WhenWasIt that was used to export the info.\n"));
- _ftprintf(fout, L"%c%s", _T(COMMENT_CHAR), TranslateT("This file was exported with a Unicode version of WhenWasIt. Please only use a Unicode version of the plugin to import the birthdays.\n"));
+ fwprintf(fout, L"%c%s", COMMENT_CHAR, TranslateT("Please do not edit this file by hand. Use the export function of WhenWasIt plugin.\n"));
+ fwprintf(fout, L"%c%s", COMMENT_CHAR, TranslateT("Warning! Please do not mix Unicode and Ansi exported birthday files. You should use the same version (Ansi/Unicode) of WhenWasIt that was used to export the info.\n"));
+ fwprintf(fout, L"%c%s", COMMENT_CHAR, TranslateT("This file was exported with a Unicode version of WhenWasIt. Please only use a Unicode version of the plugin to import the birthdays.\n"));
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
int year, month, day;
GetContactDOB(hContact, year, month, day);
if (IsDOBValid(year, month, day)) {
char *szProto = GetContactProto(hContact);
- TCHAR *szHandle = GetContactID(hContact, szProto);
+ wchar_t *szHandle = GetContactID(hContact, szProto);
if ((szHandle) && (mir_strlen(szProto) > 0))
- _ftprintf(fout, _T(BIRTHDAYS_EXPORT_FORMAT), szHandle, szProto, day, month, year);
+ fwprintf(fout, L"%s@%S : %02d/%02d/%04d\n", szHandle, szProto, day, month, year);
if (szHandle)
free(szHandle);
diff --git a/plugins/WhenWasIt/src/services.h b/plugins/WhenWasIt/src/services.h
index d4c19194a1..25d1c453b8 100644
--- a/plugins/WhenWasIt/src/services.h
+++ b/plugins/WhenWasIt/src/services.h
@@ -30,11 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define REFRESH_DETAILS_DELAY 3000
-
-#define BIRTHDAY_EXTENSION ".bdaysW"
-#define BIRTHDAYS_EXPORT_FORMAT "%s@%S : %02d/%02d/%04d\n"
-#define NOTFOUND_FORMAT LPGEN("Could not find UID '%s [%S]' in current database, skipping")
-
+#define BIRTHDAY_EXTENSION L".bdaysW"
extern int bShouldCheckBirthdays;
extern int bBirthdayFound;
@@ -45,8 +41,8 @@ int DestroyServices();
int NotifyContactBirthday(MCONTACT hContact, time_t now, int daysInAdvance);
int NotifyMissedContactBirthday(MCONTACT hContact, time_t now, int daysAfter);
-int DoExport(TCHAR *fileName);
-int DoImport(TCHAR *fileName);
+int DoExport(wchar_t *fileName);
+int DoImport(wchar_t *fileName);
INT_PTR CheckBirthdaysService(WPARAM wParam, LPARAM lParam);
INT_PTR ShowListService(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/WhenWasIt/src/utils.cpp b/plugins/WhenWasIt/src/utils.cpp
index 9667b1bc37..6c0c253a12 100644
--- a/plugins/WhenWasIt/src/utils.cpp
+++ b/plugins/WhenWasIt/src/utils.cpp
@@ -138,22 +138,22 @@ int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, si
return GetStringFromDatabase(NULL, ModuleName, szSettingName, szError, szResult, size);
}
-TCHAR* GetContactID(MCONTACT hContact)
+wchar_t* GetContactID(MCONTACT hContact)
{
return GetContactID(hContact, NULL);
}
-TCHAR* GetContactID(MCONTACT hContact, char *szProto)
+wchar_t* GetContactID(MCONTACT hContact, char *szProto)
{
ptrT res(Contact_GetInfo(CNF_UNIQUEID, hContact, szProto));
- return (res) ? _tcsdup(res) : NULL;
+ return (res) ? wcsdup(res) : NULL;
}
-MCONTACT GetContactFromID(TCHAR *szID, char *szProto)
+MCONTACT GetContactFromID(wchar_t *szID, char *szProto)
{
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *m_szProto = GetContactProto(hContact);
- TCHAR *szHandle = GetContactID(hContact, szProto);
+ wchar_t *szHandle = GetContactID(hContact, szProto);
if (szHandle) {
bool found = (!mir_tstrcmpi(szHandle, szID) && !_stricmp(szProto, m_szProto));
free(szHandle);
@@ -164,7 +164,7 @@ MCONTACT GetContactFromID(TCHAR *szID, char *szProto)
return NULL;
}
-MCONTACT GetContactFromID(TCHAR *szID, wchar_t *szProto)
+MCONTACT GetContactFromID(wchar_t *szID, wchar_t *szProto)
{
char protocol[1024];
WideCharToMultiByte(CP_ACP, 0, szProto, -1, protocol, sizeof(protocol), NULL, NULL);
diff --git a/plugins/WhenWasIt/src/utils.h b/plugins/WhenWasIt/src/utils.h
index a90f9a83f3..b432c623c1 100644
--- a/plugins/WhenWasIt/src/utils.h
+++ b/plugins/WhenWasIt/src/utils.h
@@ -44,9 +44,9 @@ RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos,
int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, int size);
-TCHAR* GetContactID(MCONTACT hContact);
-TCHAR* GetContactID(MCONTACT hContact, char *szProto);
-MCONTACT GetContactFromID(TCHAR *szID, char *szProto);
-MCONTACT GetContactFromID(TCHAR *szID, wchar_t *szProto);
+wchar_t* GetContactID(MCONTACT hContact);
+wchar_t* GetContactID(MCONTACT hContact, char *szProto);
+MCONTACT GetContactFromID(wchar_t *szID, char *szProto);
+MCONTACT GetContactFromID(wchar_t *szID, wchar_t *szProto);
#endif \ No newline at end of file
diff --git a/plugins/WhoUsesMyFiles/src/stdafx.h b/plugins/WhoUsesMyFiles/src/stdafx.h
index 1369af3336..66c4fc31fa 100644
--- a/plugins/WhoUsesMyFiles/src/stdafx.h
+++ b/plugins/WhoUsesMyFiles/src/stdafx.h
@@ -70,13 +70,13 @@ struct WUMF_OPTIONS
COLORREF ColorText;
COLORREF ColorBack;
- TCHAR LogFile[255];
+ wchar_t LogFile[255];
};
struct Wumf
{
DWORD dwID;
- TCHAR szID[10], szPerm[10];
+ wchar_t szID[10], szPerm[10];
LPTSTR szUser;
LPTSTR szPath;
LPTSTR szComp;
diff --git a/plugins/WhoUsesMyFiles/src/wumf.cpp b/plugins/WhoUsesMyFiles/src/wumf.cpp
index 730fbc152f..00508fe262 100644
--- a/plugins/WhoUsesMyFiles/src/wumf.cpp
+++ b/plugins/WhoUsesMyFiles/src/wumf.cpp
@@ -139,7 +139,7 @@ void LogWumf(PWumf w)
if (hLogger == NULL) {
hLogger = mir_createLog("wumf", L"WhoIsUsingMyFiles log file", WumfOptions.LogFile, 0);
if (hLogger == NULL) {
- TCHAR str[256];
+ wchar_t str[256];
mir_sntprintf(str, L"Can't open log file %s", WumfOptions.LogFile);
MessageBox(NULL, str, TranslateT("Error opening file"), MB_OK | MB_ICONSTOP);
WumfOptions.LogToFile = FALSE;
@@ -150,7 +150,7 @@ void LogWumf(PWumf w)
SYSTEMTIME time;
GetLocalTime(&time);
- TCHAR lpDateStr[20], lpTimeStr[20];
+ wchar_t lpDateStr[20], lpTimeStr[20];
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &time, NULL, lpDateStr, 20);
GetTimeFormat(LOCALE_USER_DEFAULT, TIME_FORCE24HOURFORMAT | TIME_NOTIMEMARKER, &time, NULL, lpTimeStr, 20);
mir_writeLogT(hLogger, L"%s %s %20s\t%s\r\n", lpDateStr, lpTimeStr, w->szUser, w->szPath);
diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp
index 5d9bfde86d..f39cb61e82 100644
--- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp
+++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp
@@ -28,7 +28,7 @@ void LoadOptions()
memset(&WumfOptions, 0, sizeof(WumfOptions));
if (db_get_ts(NULL, MODULENAME, OPT_FILE, &dbv) == 0)
{
- _tcsncpy(WumfOptions.LogFile, dbv.ptszVal, 255);
+ wcsncpy(WumfOptions.LogFile, dbv.ptszVal, 255);
db_free(&dbv);
}
else
@@ -116,7 +116,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
void ShowWumfPopup(PWumf w)
{
- TCHAR text[512], title[512];
+ wchar_t text[512], title[512];
if (!WumfOptions.AlertFolders && (w->dwAttr & FILE_ATTRIBUTE_DIRECTORY)) return;
mir_sntprintf(title, L"%s (%s)", w->szComp, w->szUser);
@@ -222,11 +222,11 @@ static INT_PTR WumfMenuCommand(WPARAM,LPARAM)
{
if (WumfOptions.PopupsEnabled == TRUE) {
WumfOptions.PopupsEnabled = FALSE;
- Menu_ModifyItem(hMenuItem, LPGENT("Enable WUMF popups"), LoadIcon(hInst,MAKEINTRESOURCE(IDI_NOPOPUP)));
+ Menu_ModifyItem(hMenuItem, LPGENW("Enable WUMF popups"), LoadIcon(hInst,MAKEINTRESOURCE(IDI_NOPOPUP)));
}
else {
WumfOptions.PopupsEnabled = TRUE;
- Menu_ModifyItem(hMenuItem, LPGENT("Disable WUMF popups"), LoadIcon(hInst,MAKEINTRESOURCE(IDI_POPUP)));
+ Menu_ModifyItem(hMenuItem, LPGENW("Disable WUMF popups"), LoadIcon(hInst,MAKEINTRESOURCE(IDI_POPUP)));
}
db_set_b(NULL, MODULENAME, POPUPS_ENABLED, (BYTE)WumfOptions.PopupsEnabled);
@@ -252,7 +252,7 @@ void DisableDelayOptions(HWND hwndDlg)
void ChooseFile(HWND hwndDlg)
{
- TCHAR szFile[MAX_PATH]; szFile[0]=0;
+ wchar_t szFile[MAX_PATH]; szFile[0]=0;
// Initialize OPENFILENAME
OPENFILENAME ofn = {0}; // common dialog box structure
@@ -273,7 +273,7 @@ void ChooseFile(HWND hwndDlg)
}
}
else if (CommDlgExtendedError() != 0) {
- TCHAR str[256];
+ wchar_t str[256];
mir_sntprintf(str, TranslateT("Common Dialog Error 0x%lx"), CommDlgExtendedError());
MessageBox(hwndDlg, str, TranslateT("Error"), MB_OK | MB_ICONSTOP);
}
@@ -492,7 +492,7 @@ extern "C" __declspec(dllexport) int Load(void)
CMenuItem mi;
SET_UID(mi, 0xcfce6487, 0x907b, 0x4822, 0xb0, 0x49, 0x18, 0x4e, 0x47, 0x17, 0x0, 0x69);
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Popups"), 1999990000);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Popups"), 1999990000);
if (WumfOptions.PopupsEnabled == FALSE) {
mi.name.a = LPGEN("Enable WUMF popups");
mi.hIcolibItem = LoadIcon(hInst,MAKEINTRESOURCE(IDI_NOPOPUP));
diff --git a/plugins/WinterSpeak/src/DialogConfigEngine.cpp b/plugins/WinterSpeak/src/DialogConfigEngine.cpp
index 1f0ccbca6e..8914402120 100644
--- a/plugins/WinterSpeak/src/DialogConfigEngine.cpp
+++ b/plugins/WinterSpeak/src/DialogConfigEngine.cpp
@@ -93,7 +93,7 @@ void DialogConfigEngine::command(HWND window, int control)
case IDC_BUTTON_TEST:
if (createTts(window))
{
- m_test_tts->say(TranslateW(L"testing testing 1 2 3"));
+ m_test_tts->say(TranslateT("testing testing 1 2 3"));
}
break;
}
diff --git a/plugins/WinterSpeak/src/EventInformation.cpp b/plugins/WinterSpeak/src/EventInformation.cpp
index 3332a7c235..451449f343 100644
--- a/plugins/WinterSpeak/src/EventInformation.cpp
+++ b/plugins/WinterSpeak/src/EventInformation.cpp
@@ -8,11 +8,11 @@
EventInformation::EventInformation() : m_event_strings(), m_event_info()
{
// insert the event strings into a map for easy access
- m_event_strings[EVENTTYPE_MESSAGE] = TranslateW(L"incoming message from %u");
- m_event_strings[EVENTTYPE_URL] = TranslateW(L"incoming URL from %u");
- m_event_strings[EVENTTYPE_ADDED] = TranslateW(L"you have been added to %u's contact list");
- m_event_strings[EVENTTYPE_AUTHREQUEST] = TranslateW(L"%u requests your authorization");
- m_event_strings[EVENTTYPE_FILE] = TranslateW(L"there is an incoming file from %u");
+ m_event_strings[EVENTTYPE_MESSAGE] = TranslateT("incoming message from %u");
+ m_event_strings[EVENTTYPE_URL] = TranslateT("incoming URL from %u");
+ m_event_strings[EVENTTYPE_ADDED] = TranslateT("you have been added to %u's contact list");
+ m_event_strings[EVENTTYPE_AUTHREQUEST] = TranslateT("%u requests your authorization");
+ m_event_strings[EVENTTYPE_FILE] = TranslateT("there is an incoming file from %u");
memset(&m_event_info, 0, sizeof(m_event_info));
}
@@ -65,7 +65,7 @@ bool EventInformation::isValidEvent(MEVENT event)
//------------------------------------------------------------------------------
std::wstring EventInformation::getMessage()
{
- const std::wstring intro = TranslateW(L"%u says");
+ const std::wstring intro = TranslateT("%u says");
return intro + L" " + mir_a2t_cp((char*)m_event_info.pBlob, CP_UTF8);
}
diff --git a/plugins/WinterSpeak/src/UserInformation.cpp b/plugins/WinterSpeak/src/UserInformation.cpp
index d39ad691be..63576269e3 100644
--- a/plugins/WinterSpeak/src/UserInformation.cpp
+++ b/plugins/WinterSpeak/src/UserInformation.cpp
@@ -4,14 +4,14 @@
UserInformation::UserInformation() : m_status_info(), m_status_strings() {
// insert the status strings into a map for easy access
- m_status_strings[ID_STATUS_OFFLINE] = LPGENT("%u is now offline");
- m_status_strings[ID_STATUS_ONLINE] = LPGENT("%u is now online");
- m_status_strings[ID_STATUS_AWAY] = LPGENT("%u is away");
- m_status_strings[ID_STATUS_INVISIBLE] = LPGENT("%u is invisible");
- m_status_strings[ID_STATUS_NA] = LPGENT("%u is not available");
- m_status_strings[ID_STATUS_DND] = LPGENT("%u does not want to be disturbed");
- m_status_strings[ID_STATUS_OCCUPIED] = LPGENT("%u is occupied");
- m_status_strings[ID_STATUS_FREECHAT] = LPGENT("%u is free for chat");
+ m_status_strings[ID_STATUS_OFFLINE] = LPGENW("%u is now offline");
+ m_status_strings[ID_STATUS_ONLINE] = LPGENW("%u is now online");
+ m_status_strings[ID_STATUS_AWAY] = LPGENW("%u is away");
+ m_status_strings[ID_STATUS_INVISIBLE] = LPGENW("%u is invisible");
+ m_status_strings[ID_STATUS_NA] = LPGENW("%u is not available");
+ m_status_strings[ID_STATUS_DND] = LPGENW("%u does not want to be disturbed");
+ m_status_strings[ID_STATUS_OCCUPIED] = LPGENW("%u is occupied");
+ m_status_strings[ID_STATUS_FREECHAT] = LPGENW("%u is free for chat");
}
//------------------------------------------------------------------------------
diff --git a/plugins/WinterSpeak/src/main.cpp b/plugins/WinterSpeak/src/main.cpp
index 25852f7b5f..d01560d6f4 100644
--- a/plugins/WinterSpeak/src/main.cpp
+++ b/plugins/WinterSpeak/src/main.cpp
@@ -71,18 +71,18 @@ int dialogOptionsInitialise(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = g_hInst;
- odp.ptszGroup = LPGENT("Speak");
+ odp.pwszGroup = LPGENW("Speak");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
if (g_speak_config)
{
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CONFIG);
- odp.ptszTitle = LPGENT("Engine/Voice");
+ odp.pwszTitle = LPGENW("Engine/Voice");
odp.pfnDlgProc = DialogConfigEngine::process;
Options_AddPage(wParam, &odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_ACTIVEMODES);
- odp.ptszTitle = LPGENT("Active Modes");
+ odp.pwszTitle = LPGENW("Active Modes");
odp.pfnDlgProc = DialogConfigActive::process;
Options_AddPage(wParam, &odp);
}
@@ -90,7 +90,7 @@ int dialogOptionsInitialise(WPARAM wParam, LPARAM)
if (g_speak_announce)
{
odp.pszTemplate = MAKEINTRESOURCEA(IDD_ANNOUNCE);
- odp.ptszTitle = LPGENT("Announce");
+ odp.pwszTitle = LPGENW("Announce");
odp.pfnDlgProc = AnnounceDialog::process;
Options_AddPage(wParam, &odp);
}
diff --git a/plugins/XSoundNotify/src/dialog.cpp b/plugins/XSoundNotify/src/dialog.cpp
index 34da7e7d13..5a6bff9772 100644
--- a/plugins/XSoundNotify/src/dialog.cpp
+++ b/plugins/XSoundNotify/src/dialog.cpp
@@ -28,10 +28,10 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP
if ((INT_PTR)szUniqueId != CALLSERVICE_NOTFOUND && szUniqueId != NULL) {
DBVARIANT dbvuid = { 0 };
if (!db_get(hContact, pa->szModuleName, szUniqueId, &dbvuid)) {
- TCHAR uid[MAX_PATH];
+ wchar_t uid[MAX_PATH];
switch (dbvuid.type) {
case DBVT_DWORD:
- _itot(dbvuid.dVal, uid, 10);
+ _itow(dbvuid.dVal, uid, 10);
break;
case DBVT_ASCIIZ:
@@ -43,8 +43,8 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP
break;
}
- TCHAR *nick = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0);
- TCHAR value[100];
+ wchar_t *nick = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t value[100];
mir_sntprintf(value, TranslateT("Custom sound for %s (%s)"), nick, uid);
SetWindowText(hwndDlg, value);
db_free(&dbvuid);
@@ -80,7 +80,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP
p = XSN_Users.find((XSN_Data *)&hContact);
if (p != NULL) {
if (mir_tstrcmpi(p->path, L"")) {
- TCHAR shortpath[MAX_PATH];
+ wchar_t shortpath[MAX_PATH];
PathToRelativeT(p->path, shortpath);
db_set_ts(hContact, SETTINGSNAME, SETTINGSKEY, shortpath);
}
@@ -93,12 +93,12 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP
case IDC_CONT_BUTTON_CHOOSE_SOUND:
{
- TCHAR FileName[MAX_PATH];
- TCHAR *tszMirDir = Utils_ReplaceVarsT(L"%miranda_path%");
+ wchar_t FileName[MAX_PATH];
+ wchar_t *tszMirDir = Utils_ReplaceVarsT(L"%miranda_path%");
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
- TCHAR tmp[MAX_PATH];
+ wchar_t tmp[MAX_PATH];
if (GetModuleHandle(L"bass_interface.dll"))
mir_sntprintf(tmp, L"%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%c", TranslateT("Sound files"), 0, 0, 0);
else
@@ -119,7 +119,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP
if (p == NULL)
XSN_Users.insert(new XSN_Data(hContact, FileName, IsDlgButtonChecked(hwndDlg, IDC_CONT_IGNORE_SOUND) ? 1 : 0));
else {
- _tcsncpy(p->path, FileName, _countof(p->path));
+ wcsncpy(p->path, FileName, _countof(p->path));
p->ignore = IsDlgButtonChecked(hwndDlg, IDC_CONT_IGNORE_SOUND) ? 1 : 0;
}
EnableWindow(GetDlgItem(hwndDlg, IDC_CONT_BUTTON_TEST_PLAY), TRUE);
@@ -135,14 +135,14 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP
if (p == NULL) {
DBVARIANT dbv;
if (!db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
- TCHAR longpath[MAX_PATH] = { 0 };
+ wchar_t longpath[MAX_PATH] = { 0 };
PathToAbsoluteT(dbv.ptszVal, longpath);
SkinPlaySoundFile(longpath);
db_free(&dbv);
}
}
else {
- TCHAR longpath[MAX_PATH] = { 0 };
+ wchar_t longpath[MAX_PATH] = { 0 };
PathToAbsoluteT(p->path, longpath);
SkinPlaySoundFile(longpath);
}
@@ -168,7 +168,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP
if (p == NULL) {
DBVARIANT dbv;
if (!db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
- TCHAR longpath[MAX_PATH];
+ wchar_t longpath[MAX_PATH];
PathToAbsoluteT(dbv.ptszVal, longpath);
XSN_Users.insert(new XSN_Data(hContact, longpath, IsDlgButtonChecked(hwndDlg, IDC_CONT_IGNORE_SOUND) ? 1 : 0));
db_free(&dbv);
diff --git a/plugins/XSoundNotify/src/options.cpp b/plugins/XSoundNotify/src/options.cpp
index 6317a5ecb6..775cfc6ffd 100644
--- a/plugins/XSoundNotify/src/options.cpp
+++ b/plugins/XSoundNotify/src/options.cpp
@@ -59,10 +59,10 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
if ((INT_PTR)szUniqueId != CALLSERVICE_NOTFOUND && szUniqueId != NULL) {
DBVARIANT dbvuid = { 0 };
if (!db_get(hContact, pa->szModuleName, szUniqueId, &dbvuid)) {
- TCHAR uid[MAX_PATH];
+ wchar_t uid[MAX_PATH];
switch (dbvuid.type) {
case DBVT_DWORD:
- _itot(dbvuid.dVal, uid, 10);
+ _itow(dbvuid.dVal, uid, 10);
break;
case DBVT_ASCIIZ:
@@ -77,9 +77,9 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
mir_tstrcpy(uid, TranslateT("(Unknown contact)"));
}
- TCHAR *nick = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *nick = (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0);
size_t value_max_len = (mir_tstrlen(uid) + mir_tstrlen(nick) + 4);
- TCHAR *value = (TCHAR *)mir_alloc(sizeof(TCHAR) * value_max_len);
+ wchar_t *value = (wchar_t *)mir_alloc(sizeof(wchar_t) * value_max_len);
mir_sntprintf(value, value_max_len, L"%s (%s)", nick, uid);
SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_SETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_ADDSTRING, 0, (LPARAM)value), hContact);
mir_free(value);
@@ -115,12 +115,12 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case IDC_OPT_BUTTON_CHOOSE_SOUND:
{
- TCHAR FileName[MAX_PATH];
- TCHAR *tszMirDir = Utils_ReplaceVarsT(L"%miranda_path%");
+ wchar_t FileName[MAX_PATH];
+ wchar_t *tszMirDir = Utils_ReplaceVarsT(L"%miranda_path%");
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
- TCHAR tmp[MAX_PATH];
+ wchar_t tmp[MAX_PATH];
if (GetModuleHandle(L"bass_interface.dll"))
mir_sntprintf(tmp, L"%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%c", TranslateT("Sound files"), 0, 0, 0);
else
@@ -144,7 +144,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
XSN_Users.insert(new XSN_Data(hContact, FileName, IsDlgButtonChecked(hwndDlg, IDC_OPT_IGNORE_SOUND) ? 1 : 0));
else
{
- _tcsncpy(p->path, FileName, _countof(p->path));
+ wcsncpy(p->path, FileName, _countof(p->path));
p->ignore = IsDlgButtonChecked(hwndDlg, IDC_OPT_IGNORE_SOUND) ? 1 : 0;
}
EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_BUTTON_TEST_PLAY), TRUE);
@@ -164,14 +164,14 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
if (p == NULL) {
DBVARIANT dbv;
if (!db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
- TCHAR longpath[MAX_PATH];
+ wchar_t longpath[MAX_PATH];
PathToAbsoluteT(dbv.ptszVal, longpath);
SkinPlaySoundFile(longpath);
db_free(&dbv);
}
}
else {
- TCHAR longpath[MAX_PATH] = { 0 };
+ wchar_t longpath[MAX_PATH] = { 0 };
PathToAbsoluteT(p->path, longpath);
SkinPlaySoundFile(longpath);
}
@@ -205,7 +205,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
if (p == NULL) {
DBVARIANT dbv;
if (!db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
- TCHAR longpath[MAX_PATH];
+ wchar_t longpath[MAX_PATH];
PathToAbsoluteT(dbv.ptszVal, longpath);
XSN_Users.insert(new XSN_Data(hContact, longpath, IsDlgButtonChecked(hwndDlg, IDC_OPT_IGNORE_SOUND) ? 1 : 0));
db_free(&dbv);
@@ -225,7 +225,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case PSN_APPLY:
for (int i = 0; i < XSN_Users.getCount(); i++) {
if (mir_tstrcmpi(XSN_Users[i]->path, L"")) {
- TCHAR shortpath[MAX_PATH];
+ wchar_t shortpath[MAX_PATH];
PathToRelativeT(XSN_Users[i]->path, shortpath);
db_set_ts(XSN_Users[i]->hContact, SETTINGSNAME, SETTINGSKEY, shortpath);
}
@@ -244,8 +244,8 @@ INT OptInit(WPARAM wParam, LPARAM)
odp.hInstance = hInst;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.ptszGroup = LPGENT("Sounds");
- odp.ptszTitle = LPGENT("XSound Notify");
+ odp.pwszGroup = LPGENW("Sounds");
+ odp.pwszTitle = LPGENW("XSound Notify");
odp.pfnDlgProc = OptsProc;
Options_AddPage(wParam, &odp);
return 0;
diff --git a/plugins/XSoundNotify/src/stdafx.h b/plugins/XSoundNotify/src/stdafx.h
index 6bee45d772..ae497266c6 100644
--- a/plugins/XSoundNotify/src/stdafx.h
+++ b/plugins/XSoundNotify/src/stdafx.h
@@ -23,13 +23,13 @@
struct XSN_Data
{
MCONTACT hContact;
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
BYTE ignore;
- __forceinline XSN_Data(MCONTACT _aContact, TCHAR *_path, BYTE _ignore) :
+ __forceinline XSN_Data(MCONTACT _aContact, wchar_t *_path, BYTE _ignore) :
hContact(_aContact)
{
- _tcsncpy(path, _path, _countof(path));
+ wcsncpy(path, _path, _countof(path));
ignore = _ignore;
}
};
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp
index d8ffcb9d97..afb720d85b 100644
--- a/plugins/XSoundNotify/src/xsn_main.cpp
+++ b/plugins/XSoundNotify/src/xsn_main.cpp
@@ -76,7 +76,7 @@ void InitSelfSounds()
char namebuf[128];
mir_snprintf(namebuf, "%s%s", protos[i]->szModuleName, selfSounds[j].szName);
- TCHAR infobuf[256];
+ wchar_t infobuf[256];
mir_sntprintf(infobuf, L"%s [%s]", TranslateT("Self status"), protos[i]->tszAccountName);
SkinAddNewSoundExT(namebuf, infobuf, pcli->pfnGetStatusModeDescription(selfSounds[j].iStatus, 0));
}
@@ -118,7 +118,7 @@ static int ProcessEvent(WPARAM hContact, LPARAM lParam)
isIgnoreSound = db_get_b(hContact, SETTINGSNAME, SETTINGSIGNOREKEY, 0);
DBVARIANT dbv;
if (!isIgnoreSound && !db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
- TCHAR PlaySoundPath[MAX_PATH] = { 0 };
+ wchar_t PlaySoundPath[MAX_PATH] = { 0 };
PathToAbsoluteT(dbv.ptszVal, PlaySoundPath);
isOwnSound = 0;
SkinPlaySoundFile(PlaySoundPath);
@@ -144,11 +144,11 @@ static int ProcessChatEvent(WPARAM, LPARAM lParam)
ptrT nick(db_get_tsa(hContact, gcd->pszModule, "MyNick"));
if (nick == NULL || gce->ptszText == NULL)
return 0;
- if (_tcsstr(gce->ptszText, nick)) {
+ if (wcsstr(gce->ptszText, nick)) {
isIgnoreSound = db_get_b(hContact, SETTINGSNAME, SETTINGSIGNOREKEY, 0);
DBVARIANT dbv;
if (!isIgnoreSound && !db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
- TCHAR PlaySoundPath[MAX_PATH] = { 0 };
+ wchar_t PlaySoundPath[MAX_PATH] = { 0 };
PathToAbsoluteT(dbv.ptszVal, PlaySoundPath);
isOwnSound = 0;
SkinPlaySoundFile(PlaySoundPath);
@@ -182,7 +182,7 @@ static int OnLoadInit(WPARAM, LPARAM)
mi.position = -0x7FFFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- mi.name.t = LPGENT("Custom contact sound");
+ mi.name.w = LPGENW("Custom contact sound");
mi.pszService = "XSoundNotify/ContactMenuCommand";
hChangeSound = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/YAMN/src/account.cpp b/plugins/YAMN/src/account.cpp
index 004dc1bd1b..a79c650ce7 100644
--- a/plugins/YAMN/src/account.cpp
+++ b/plugins/YAMN/src/account.cpp
@@ -162,18 +162,18 @@ void StopSignalFcn(HACCOUNT Which)
void CodeDecodeString(char *Dest, BOOL Encrypt)
{
- TCHAR Code = STARTCODEPSW;
+ wchar_t Code = STARTCODEPSW;
if (Dest == NULL)
return;
- for (; *Dest != (TCHAR)0; Dest++)
+ for (; *Dest != (wchar_t)0; Dest++)
{
if (Encrypt)
*Dest = *Dest + Code;
else
*Dest = *Dest - Code;
- Code += (TCHAR)ADDCODEPSW;
+ Code += (wchar_t)ADDCODEPSW;
}
}
@@ -204,7 +204,7 @@ static DWORD PostFileToMemory(HANDLE File, char **MemFile, char **End)
return 0;
}
-DWORD FileToMemory(TCHAR *FileName, char **MemFile, char **End)
+DWORD FileToMemory(wchar_t *FileName, char **MemFile, char **End)
{
HANDLE hFile = CreateFile(FileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
@@ -214,23 +214,23 @@ DWORD FileToMemory(TCHAR *FileName, char **MemFile, char **End)
}
#if defined(DEBUG_FILEREAD) || defined(DEBUG_FILEREADMESSAGES)
-DWORD ReadStringFromMemory(char **Parser,TCHAR *End,char **StoreTo,TCHAR *DebugString)
+DWORD ReadStringFromMemory(char **Parser,wchar_t *End,char **StoreTo,wchar_t *DebugString)
{
//This is the debug version of ReadStringFromMemory function. This version shows MessageBox where
//read string is displayed
- TCHAR *Dest,*Finder;
+ wchar_t *Dest,*Finder;
DWORD Size;
- TCHAR Debug[65536];
+ wchar_t Debug[65536];
Finder=*Parser;
- while((*Finder != (TCHAR)0) && (Finder<=End)) Finder++;
+ while((*Finder != (wchar_t)0) && (Finder<=End)) Finder++;
mir_sntprintf(Debug, L"%s: %s,length is %d, remaining %d chars", DebugString, *Parser, Finder-*Parser, End-Finder);
MessageBox(NULL,Debug,L"debug",MB_OK);
if (Finder>=End)
return EACC_FILECOMPATIBILITY;
if (Size=Finder-*Parser)
{
- if (NULL==(Dest=*StoreTo=new TCHAR[Size+1]))
+ if (NULL==(Dest=*StoreTo=new wchar_t[Size+1]))
return EACC_ALLOC;
for (;*Parser<=Finder;(*Parser)++,Dest++)
*Dest=**Parser;
@@ -250,7 +250,7 @@ DWORD ReadStringFromMemory(char **Parser, char *End, char **StoreTo)
DWORD Size;
Finder = *Parser;
- while ((*Finder != (TCHAR)0) && (Finder <= End)) Finder++;
+ while ((*Finder != (wchar_t)0) && (Finder <= End)) Finder++;
if (Finder >= End)
return EACC_FILECOMPATIBILITY;
if (Size = Finder - *Parser)
@@ -269,7 +269,7 @@ DWORD ReadStringFromMemory(char **Parser, char *End, char **StoreTo)
}
#if defined(DEBUG_FILEREAD) || defined(DEBUG_FILEREADMESSAGES)
-DWORD ReadStringFromMemoryW(WCHAR **Parser,TCHAR *End,WCHAR **StoreTo,WCHAR *DebugString)
+DWORD ReadStringFromMemoryW(WCHAR **Parser,wchar_t *End,WCHAR **StoreTo,WCHAR *DebugString)
{
//This is the debug version of ReadStringFromMemoryW function. This version shows MessageBox where
//read string is displayed
@@ -327,7 +327,7 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT
{
DWORD Stat;
#ifdef DEBUG_FILEREAD
- TCHAR Debug[65536];
+ wchar_t Debug[65536];
#endif
Which->Flags = *(DWORD *)(*Parser);
@@ -393,7 +393,7 @@ DWORD ReadMessagesFromMemory(HACCOUNT Which, char **Parser, char *End)
do
{
Finder = *Parser;
- while ((*Finder != (TCHAR)0) && (Finder <= End)) Finder++;
+ while ((*Finder != (wchar_t)0) && (Finder <= End)) Finder++;
if (Finder >= End)
return EACC_FILECOMPATIBILITY;
if (Size = Finder - *Parser)
@@ -485,7 +485,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End)
{
DWORD Stat;
#ifdef DEBUG_FILEREAD
- TCHAR Debug[65536];
+ wchar_t Debug[65536];
#endif
//Read name of account
@@ -735,7 +735,7 @@ static INT_PTR PerformAccountReading(HYAMNPROTOPLUGIN Plugin, char *MemFile, cha
INT_PTR AddAccountsFromFileSvc(WPARAM wParam, LPARAM lParam)
{
char *MemFile, *End;
- DWORD Stat = FileToMemory((TCHAR*)lParam, &MemFile, &End);
+ DWORD Stat = FileToMemory((wchar_t*)lParam, &MemFile, &End);
if (Stat != NO_ERROR)
return (INT_PTR)Stat;
@@ -846,7 +846,7 @@ static INT_PTR PerformAccountWriting(HYAMNPROTOPLUGIN Plugin, HANDLE File)
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"WriteAccountsToFile:ActualAccountSO-read enter\n");
#endif
- if ((ActualAccount->Name == NULL) || (*ActualAccount->Name == (TCHAR)0))
+ if ((ActualAccount->Name == NULL) || (*ActualAccount->Name == (wchar_t)0))
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"WriteAccountsToFile:ActualAccountSO-read done\n");
@@ -976,7 +976,7 @@ INT_PTR WriteAccountsToFileSvc(WPARAM wParam, LPARAM lParam)
HYAMNPROTOPLUGIN Plugin = (HYAMNPROTOPLUGIN)wParam;
mir_cslock lck(csFileWritingCS);
- HANDLE hFile = CreateFile((TCHAR*)lParam, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ HANDLE hFile = CreateFile((wchar_t*)lParam, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
return EACC_SYSTEM;
@@ -1226,7 +1226,7 @@ int DeleteAccounts(HYAMNPROTOPLUGIN Plugin)
return 1;
}
-void WINAPI GetStatusFcn(HACCOUNT Which, TCHAR *Value)
+void WINAPI GetStatusFcn(HACCOUNT Which, wchar_t *Value)
{
if (Which == NULL)
return;
@@ -1235,7 +1235,7 @@ void WINAPI GetStatusFcn(HACCOUNT Which, TCHAR *Value)
mir_tstrcpy(Value, Which->Status);
}
-void WINAPI SetStatusFcn(HACCOUNT Which, TCHAR *Value)
+void WINAPI SetStatusFcn(HACCOUNT Which, wchar_t *Value)
{
if (Which != NULL) {
mir_cslock lck(csAccountStatusCS);
diff --git a/plugins/YAMN/src/browser/badconnect.cpp b/plugins/YAMN/src/browser/badconnect.cpp
index 80816e0704..d6e4fdf2e6 100644
--- a/plugins/YAMN/src/browser/badconnect.cpp
+++ b/plugins/YAMN/src/browser/badconnect.cpp
@@ -85,7 +85,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg, UINT msg, WPARAM wParam, LP
DWORD ErrorCode;
char* TitleStrA;
char *Message1A = NULL;
- TCHAR *Message1W = NULL;
+ wchar_t *Message1W = NULL;
POPUPDATAT BadConnectPopup;
ActualAccount = ((struct BadConnectionParam *)lParam)->account;
@@ -125,7 +125,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg, UINT msg, WPARAM wParam, LP
if (ActualAccount->Plugin->Fcn != NULL && ActualAccount->Plugin->Fcn->GetErrorStringWFcnPtr != NULL) {
Message1W = ActualAccount->Plugin->Fcn->GetErrorStringWFcnPtr(ErrorCode);
SetDlgItemText(hDlg, IDC_STATICMSG, Message1W);
- _tcsncpy_s(BadConnectPopup.lptzText, Message1W, _TRUNCATE);
+ wcsncpy_s(BadConnectPopup.lptzText, Message1W, _TRUNCATE);
if (ShowPopup)
PUAddPopupT(&BadConnectPopup);
}
@@ -133,7 +133,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg, UINT msg, WPARAM wParam, LP
{
Message1W = ActualAccount->Plugin->Fcn->GetErrorStringWFcnPtr(ErrorCode);
SetDlgItemText(hDlg, IDC_STATICMSG, Message1W);
- _tcsncpy_s(BadConnectPopup.lptzText, Message1W, _TRUNCATE);
+ wcsncpy_s(BadConnectPopup.lptzText, Message1W, _TRUNCATE);
if (ShowPopup)
PUAddPopupT(&BadConnectPopup);
}
@@ -141,7 +141,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg, UINT msg, WPARAM wParam, LP
{
Message1W = TranslateT("Unknown error");
SetDlgItemText(hDlg, IDC_STATICMSG, Message1W);
- _tcsncpy_s(BadConnectPopup.lptzText, Message1W, _TRUNCATE);
+ wcsncpy_s(BadConnectPopup.lptzText, Message1W, _TRUNCATE);
if (ShowPopup)
PUAddPopupT(&BadConnectPopup);
}
@@ -185,7 +185,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg, UINT msg, WPARAM wParam, LP
}
return 0;
case WM_CHAR:
- switch ((TCHAR)wParam)
+ switch ((wchar_t)wParam)
{
case 27:
case 13:
@@ -257,7 +257,7 @@ void __cdecl BadConnection(void *Param)
nid.hIcon = g_LoadIconEx(3);
nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
nid.uCallbackMessage = WM_YAMN_NOTIFYICON;
- mir_sntprintf(nid.szTip, L"%S%s", ActualAccount->Name, TranslateT(" - connection error"));
+ mir_sntprintf(nid.szTip, L"%S%s", ActualAccount->Name, TranslateT(" - connection error"));
Shell_NotifyIcon(NIM_ADD, &nid);
}
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp
index ccd681a1d5..d768f3e363 100644
--- a/plugins/YAMN/src/browser/mailbrowser.cpp
+++ b/plugins/YAMN/src/browser/mailbrowser.cpp
@@ -177,7 +177,7 @@ typedef struct _SAMPLELISTVIEWCOLUMN
int nSortType; // sorting type (STRING = 0, NUMERIC, DATE, DATETIME)
int nSortOrder; // sorting order (ASCENDING = -1, NONE, DESCENDING)
int nPriority; // sort priority (-1 for none, 0, 1, ..., nColumns - 1 maximum)
- TCHAR lpszName[128]; // column name
+ wchar_t lpszName[128]; // column name
} SAMPLELISTVIEWCOLUMN;
// Compare priority
@@ -633,12 +633,12 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D
CallService(MS_KBDNOTIFY_STARTBLINK, (WPARAM)MN->Real.PopupNC + MN->Virtual.PopupNC, NULL);
if ((nflags & YAMN_ACC_CONT) && (MN->Real.PopupRun + MN->Virtual.PopupRun)) {
- TCHAR tszMsg[250];
+ wchar_t tszMsg[250];
mir_sntprintf(tszMsg, TranslateT("%s : %d new mail message(s), %d total"), _A2T(ActualAccount->Name), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC);
if (!(nflags & YAMN_ACC_CONTNOEVENT)) {
- CLISTEVENT evt = {};
- evt.flags = CLEF_TCHAR;
+ CLISTEVENT evt = {};
+ evt.flags = CLEF_TCHAR;
evt.hContact = ActualAccount->hContact;
evt.hIcon = g_LoadIconEx(2);
evt.hDbEvent = ActualAccount->hContact;
@@ -1268,7 +1268,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR
HWND hListView = GetDlgItem(hDlg, IDC_LISTHEADERS);
mir_subclassWindow(GetDlgItem(hDlg, IDC_SPLITTER), SplitterSubclassProc);
SetWindowLongPtr(hDlg, DWLP_USER, (LONG_PTR)MailParam);
- Window_SetIcon_IcoLib(hDlg, g_GetIconHandle(2));
+ Window_SetIcon_IcoLib(hDlg, g_GetIconHandle(2));
ListView_SetUnicodeFormat(hListView, TRUE);
ListView_SetExtendedListViewStyle(hListView, LVS_EX_FULLROWSELECT);
@@ -1437,11 +1437,11 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR
if (From && Subj)
mir_sntprintf(title, size, L"%s (%s)", Subj, From);
else if (From)
- _tcsncpy_s(title, size, From, _TRUNCATE);
+ wcsncpy_s(title, size, From, _TRUNCATE);
else if (Subj)
- _tcsncpy_s(title, size, Subj, _TRUNCATE);
+ wcsncpy_s(title, size, Subj, _TRUNCATE);
else
- _tcsncpy_s(title, size, L"none", _TRUNCATE);
+ wcsncpy_s(title, size, L"none", _TRUNCATE);
if (Subj) delete[] Subj;
if (From) delete[] From;
SetWindowTextW(hDlg, title);
@@ -1475,7 +1475,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR
return (INT_PTR)GetSysColorBrush(COLOR_WINDOW);
case WM_DESTROY:
- Window_FreeIcon_IcoLib(hDlg);
+ Window_FreeIcon_IcoLib(hDlg);
{
RECT coord;
if (GetWindowRect(hDlg, &coord)) {
@@ -1557,7 +1557,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR
if (nReturnCmd > 0) {
int courRow = 0;
size_t sizeNeeded = 0;
- TCHAR headname[64] = { 0 }, headvalue[256] = { 0 };
+ wchar_t headname[64] = { 0 }, headvalue[256] = { 0 };
for (courRow = 0; courRow < numRows; courRow++) {
if ((nReturnCmd == 1) && (ListView_GetItemState(hList, courRow, LVIS_SELECTED) == 0)) continue;
ListView_GetItemText(hList, courRow, 0, headname, _countof(headname));
@@ -1568,8 +1568,8 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR
}
if (sizeNeeded && OpenClipboard(hDlg)) {
EmptyClipboard();
- HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, (sizeNeeded + 1)*sizeof(TCHAR));
- TCHAR *buff = (TCHAR*)GlobalLock(hData);
+ HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, (sizeNeeded + 1)*sizeof(wchar_t));
+ wchar_t *buff = (wchar_t*)GlobalLock(hData);
int courPos = 0;
for (courRow = 0; courRow < numRows; courRow++) {
if ((nReturnCmd == 1) && (ListView_GetItemState(hList, courRow, LVIS_SELECTED) == 0)) continue;
@@ -1687,7 +1687,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR
WindowList_Add(YAMNVar.NewMailAccountWnd, hDlg, (UINT_PTR)ActualAccount);
{
- TCHAR accstatus[512];
+ wchar_t accstatus[512];
GetStatusFcn(ActualAccount, accstatus);
SetDlgItemText(hDlg, IDC_STSTATUS, accstatus);
}
@@ -1706,7 +1706,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR
LVCOLUMN ColInfo;
HYAMNMAIL Parser;
- Window_FreeIcon_IcoLib(hDlg);
+ Window_FreeIcon_IcoLib(hDlg);
struct CMailWinUserInfo *mwui = (struct CMailWinUserInfo *)GetWindowLongPtr(hDlg, DWLP_USER);
if (NULL == (ActualAccount = GetWindowAccount(hDlg)))
@@ -1802,7 +1802,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR
if ((HACCOUNT)wParam != ActualAccount)
break;
- TCHAR accstatus[512];
+ wchar_t accstatus[512];
GetStatusFcn(ActualAccount, accstatus);
SetDlgItemText(hDlg, IDC_STSTATUS, accstatus);
return 1;
@@ -2037,7 +2037,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR
WriteDoneFcn(ActualAccount->MessagesAccessSO);
if (Total) {
- TCHAR DeleteMsg[1024];
+ wchar_t DeleteMsg[1024];
mir_sntprintf(DeleteMsg, TranslateT("Do you really want to delete %d selected mails?"), Total);
if (IDOK == MessageBox(hDlg, DeleteMsg, TranslateT("Delete confirmation"), MB_OKCANCEL | MB_ICONWARNING)) {
@@ -2236,7 +2236,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR
if (nReturnCmd > 0) {
int courRow = 0;
size_t sizeNeeded = 0;
- TCHAR from[128] = { 0 }, subject[256] = { 0 }, size[16] = { 0 }, date[64] = { 0 };
+ wchar_t from[128] = { 0 }, subject[256] = { 0 }, size[16] = { 0 }, date[64] = { 0 };
for (courRow = 0; courRow < numRows; courRow++) {
if ((nReturnCmd == 1) && (ListView_GetItemState(hList, courRow, LVIS_SELECTED) == 0)) continue;
ListView_GetItemText(hList, courRow, 0, from, _countof(from));
@@ -2247,8 +2247,8 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR
}
if (sizeNeeded && OpenClipboard(hDlg)) {
EmptyClipboard();
- HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, (sizeNeeded + 1)*sizeof(TCHAR));
- TCHAR *buff = (TCHAR *)GlobalLock(hData);
+ HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, (sizeNeeded + 1)*sizeof(wchar_t));
+ wchar_t *buff = (wchar_t *)GlobalLock(hData);
int courPos = 0;
for (courRow = 0; courRow < numRows; courRow++) {
if ((nReturnCmd == 1) && (ListView_GetItemState(hList, courRow, LVIS_SELECTED) == 0)) continue;
@@ -2344,7 +2344,7 @@ void __cdecl MailBrowser(void *Param)
WndFound = TRUE;
if ((hMailBrowser == NULL) && ((MyParam.nflags & YAMN_ACC_MSG) || (MyParam.nflags & YAMN_ACC_ICO) || (MyParam.nnflags & YAMN_ACC_MSG))) {
hMailBrowser = CreateDialogParamW(YAMNVar.hInst, MAKEINTRESOURCEW(IDD_DLGVIEWMESSAGES), NULL, DlgProcYAMNMailBrowser, (LPARAM)&MyParam);
- Window_SetIcon_IcoLib(hMailBrowser, g_GetIconHandle(2));
+ Window_SetIcon_IcoLib(hMailBrowser, g_GetIconHandle(2));
MoveWindow(hMailBrowser, PosX, PosY, SizeX, SizeY, TRUE);
}
diff --git a/plugins/YAMN/src/debug.cpp b/plugins/YAMN/src/debug.cpp
index 6655ebd3a9..fcf594018d 100644
--- a/plugins/YAMN/src/debug.cpp
+++ b/plugins/YAMN/src/debug.cpp
@@ -14,21 +14,21 @@
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
-TCHAR DebugUserDirectory[MAX_PATH] = L".";
+wchar_t DebugUserDirectory[MAX_PATH] = L".";
CRITICAL_SECTION FileAccessCS;
#ifdef DEBUG_SYNCHRO
-TCHAR DebugSynchroFileName2[]=L"%s\\yamn-debug.synchro.log";
+wchar_t DebugSynchroFileName2[]=L"%s\\yamn-debug.synchro.log";
HANDLE SynchroFile;
#endif
#ifdef DEBUG_COMM
-TCHAR DebugCommFileName2[]=L"%s\\yamn-debug.comm.log";
+wchar_t DebugCommFileName2[]=L"%s\\yamn-debug.comm.log";
HANDLE CommFile;
#endif
#ifdef DEBUG_DECODE
-TCHAR DebugDecodeFileName2[]=L"%s\\yamn-debug.decode.log";
+wchar_t DebugDecodeFileName2[]=L"%s\\yamn-debug.decode.log";
HANDLE DecodeFile;
#endif
@@ -38,7 +38,7 @@ HANDLE DecodeFile;
void InitDebug()
{
#if defined (DEBUG_SYNCHRO) || defined (DEBUG_COMM) || defined (DEBUG_DECODE)
- TCHAR DebugFileName[MAX_PATH];
+ wchar_t DebugFileName[MAX_PATH];
#endif
InitializeCriticalSection(&FileAccessCS);
diff --git a/plugins/YAMN/src/debug.h b/plugins/YAMN/src/debug.h
index 9581117503..d902d4c8b7 100644
--- a/plugins/YAMN/src/debug.h
+++ b/plugins/YAMN/src/debug.h
@@ -33,7 +33,7 @@ extern HANDLE DecodeFile;
#if defined(DEBUG_FILEREAD) || defined(DEBUG_FILEREADMESSAGES)
DWORD ReadStringFromMemory(char **Parser,char *End,char **StoreTo,char *DebugString);
-DWORD ReadStringFromMemoryW(char **Parser,TCHAR *End,char **StoreTo,TCHAR *DebugString);
+DWORD ReadStringFromMemoryW(char **Parser,wchar_t *End,char **StoreTo,wchar_t *DebugString);
#else
DWORD ReadStringFromMemory(char **Parser,char *End,char **StoreTo);
diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp
index bf60915d95..230ee89486 100644
--- a/plugins/YAMN/src/main.cpp
+++ b/plugins/YAMN/src/main.cpp
@@ -12,11 +12,11 @@
//--------------------------------------------------------------------------------------------------
-TCHAR ProfileName[MAX_PATH];
-TCHAR UserDirectory[MAX_PATH];
+wchar_t ProfileName[MAX_PATH];
+wchar_t UserDirectory[MAX_PATH];
-TCHAR szMirandaDir[MAX_PATH];
-TCHAR szProfileDir[MAX_PATH];
+wchar_t szMirandaDir[MAX_PATH];
+wchar_t szProfileDir[MAX_PATH];
int YAMN_STATUS;
@@ -58,10 +58,10 @@ HGENMENU hMenuItemContApp = 0;
#define FIXED_TAB_SIZE 100 // default value for fixed width tabs
-static void GetProfileDirectory(TCHAR *szPath, int cbPath)
+static void GetProfileDirectory(wchar_t *szPath, int cbPath)
//This is copied from Miranda's sources. In 0.2.1.0 it is needed, in newer vesions of Miranda use MS_DB_GETPROFILEPATH service
{
- TCHAR tszOldPath[MAX_PATH];
+ wchar_t tszOldPath[MAX_PATH];
CallService(MS_DB_GETPROFILEPATHT, _countof(tszOldPath), (LPARAM)tszOldPath);
mir_tstrcat(tszOldPath, L"\\*.book");
@@ -78,7 +78,7 @@ static void GetProfileDirectory(TCHAR *szPath, int cbPath)
L"" };
SHFileOperation(&file_op);
- _tcsncpy(szPath, ptszNewPath, cbPath);
+ wcsncpy(szPath, ptszNewPath, cbPath);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -99,13 +99,13 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
/////////////////////////////////////////////////////////////////////////////////////////
#ifdef _DEBUG
-static TCHAR unknownCP[1500] = {0};
+static wchar_t unknownCP[1500] = {0};
#endif
// The callback function
BOOL CALLBACK EnumSystemCodePagesProc(LPTSTR cpStr)
{
//Convert code page string to number
- UINT cp = _ttoi(cpStr);
+ UINT cp = _wtoi(cpStr);
if (!IsValidCodePage(cp))
return TRUE;
@@ -206,7 +206,7 @@ void WINAPI g_ReleaseIcon( HICON hIcon )
static void LoadPlugins()
{
- TCHAR szSearchPath[MAX_PATH];
+ wchar_t szSearchPath[MAX_PATH];
mir_sntprintf(szSearchPath, L"%s\\Plugins\\YAMN\\*.dll", szMirandaDir);
hDllPlugins = NULL;
@@ -216,19 +216,19 @@ static void LoadPlugins()
if (hFind != INVALID_HANDLE_VALUE) {
do {
//rewritten from Miranda sources... Needed because Win32 API has a bug in FindFirstFile, search is done for *.dlllllll... too
- TCHAR *dot = _tcsrchr(fd.cFileName, '.');
+ wchar_t *dot = wcsrchr(fd.cFileName, '.');
if (dot == NULL )
continue;
// we have a dot
int len = (int)mir_tstrlen(fd.cFileName); // find the length of the string
- TCHAR* end = fd.cFileName+len; // get a pointer to the NULL
+ wchar_t* end = fd.cFileName+len; // get a pointer to the NULL
int safe = (end-dot)-1; // figure out how many chars after the dot are "safe", not including NULL
if ((safe != 3) || (mir_tstrcmpi(dot+1, L"dll") != 0)) //not bound, however the "dll" string should mean only 3 chars are compared
continue;
- TCHAR szPluginPath[MAX_PATH];
+ wchar_t szPluginPath[MAX_PATH];
mir_sntprintf(szPluginPath, L"%s\\Plugins\\YAMN\\%s", szMirandaDir, fd.cFileName);
HINSTANCE hDll = LoadLibrary(szPluginPath);
if (hDll == NULL)
@@ -269,7 +269,7 @@ extern "C" int __declspec(dllexport) Load(void)
// retrieve the current profile name
CallService(MS_DB_GETPROFILENAMET, (WPARAM)_countof(ProfileName), (LPARAM)ProfileName); //not to pass entire array to fcn
- TCHAR *fc = _tcsrchr(ProfileName, '.');
+ wchar_t *fc = wcsrchr(ProfileName, '.');
if ( fc != NULL ) *fc = 0;
// we get the user path where our yamn-account.book.ini is stored from mirandaboot.ini file
diff --git a/plugins/YAMN/src/proto/pop3/pop3comm.cpp b/plugins/YAMN/src/proto/pop3/pop3comm.cpp
index d4f06bed62..cd8c3121db 100644
--- a/plugins/YAMN/src/proto/pop3/pop3comm.cpp
+++ b/plugins/YAMN/src/proto/pop3/pop3comm.cpp
@@ -61,7 +61,7 @@ void __cdecl DeleteMailsPOP3(void *param);
//Function makes readable message about error. It sends it back to YAMN, so YAMN then
//can show it to the message window
-TCHAR* WINAPI GetErrorString(DWORD Code);
+wchar_t* WINAPI GetErrorString(DWORD Code);
//Function deletes string allocated in GetErrorString
void WINAPI DeleteErrorString(LPVOID String);
@@ -130,7 +130,7 @@ YAMN_PROTOREGISTRATION POP3ProtocolRegistration =
__AUTHORWEB,
};
-static TCHAR *FileName = NULL;
+static wchar_t *FileName = NULL;
HANDLE RegisterNLClient(const char *name);
@@ -247,7 +247,7 @@ int RegisterPOP3Plugin(WPARAM, LPARAM)
//You must first register account, before using this function as YAMN must use CreatePOP3Account function to add new accounts
//But if CreatePOP3Account is not implemented (equals to NULL), YAMN creates account as YAMN's standard HACCOUNT
if (FileName) CallService(MS_YAMN_DELETEFILENAME, (WPARAM)FileName, 0); //shoud not happen (only for secure)
- FileName = (TCHAR *)CallService(MS_YAMN_GETFILENAME, (WPARAM)L"pop3", 0);
+ FileName = (wchar_t *)CallService(MS_YAMN_GETFILENAME, (WPARAM)L"pop3", 0);
switch (CallService(MS_YAMN_READACCOUNTS, (WPARAM)POP3Plugin, (LPARAM)FileName)) {
case EACC_FILEVERSION:
@@ -268,7 +268,7 @@ int RegisterPOP3Plugin(WPARAM, LPARAM)
case EACC_SYSTEM:
if (ERROR_FILE_NOT_FOUND != GetLastError())
{
- TCHAR temp[1024] = { 0 };
+ wchar_t temp[1024] = { 0 };
mir_sntprintf(temp, L"%s\n%s", TranslateT("Reading file error. File already in use?"), FileName);
MessageBox(NULL, temp, TranslateT("YAMN (internal POP3) read error"), MB_OK);
CallService(MS_YAMN_DELETEFILENAME, (WPARAM)FileName, 0);
@@ -343,7 +343,7 @@ DWORD WINAPI WritePOP3Accounts()
{
DWORD ReturnValue = CallService(MS_YAMN_WRITEACCOUNTS, (WPARAM)POP3Plugin, (LPARAM)FileName);
if (ReturnValue == EACC_SYSTEM) {
- TCHAR temp[1024] = { 0 };
+ wchar_t temp[1024] = { 0 };
mir_sntprintf(temp, L"%s\n%s", TranslateT("Error while copying data to disk occurred. Is file in use?"), FileName);
MessageBox(NULL, temp, TranslateT("POP3 plugin - write file error"), MB_OK);
}
@@ -366,7 +366,7 @@ DWORD WINAPI ReadPOP3Options(HACCOUNT Which, char **Parser, char *End)
{
DWORD Ver;
#ifdef DEBUG_FILEREAD
- TCHAR Debug[256];
+ wchar_t Debug[256];
#endif
Ver = *(DWORD *)(*Parser);
(*Parser) += sizeof(DWORD);
@@ -712,7 +712,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
HYAMNMAIL NewMsgsPtr = NULL;
for (NewMsgsPtr = (HYAMNMAIL)NewMails; NewMsgsPtr != NULL; NewMsgsPtr = NewMsgsPtr->Next) {
if (!mir_strcmp(MsgQueuePtr->ID, NewMsgsPtr->ID)) {
- TCHAR accstatus[512];
+ wchar_t accstatus[512];
mir_sntprintf(accstatus, TranslateT("Reading body %s"), NewMsgsPtr->ID);
SetAccountStatus(ActualAccount, accstatus);
DataRX = MyClient->Top(MsgQueuePtr->Number, 100);
@@ -780,7 +780,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
try
{
- TCHAR accstatus[512];
+ wchar_t accstatus[512];
for (i = 0, MsgQueuePtr = NewMails; MsgQueuePtr != NULL; i++)
{
@@ -1500,46 +1500,46 @@ void ExtractList(char *stream, int len, HYAMNMAIL queue)
}
}
-TCHAR* WINAPI GetErrorString(DWORD Code)
+wchar_t* WINAPI GetErrorString(DWORD Code)
{
- static TCHAR *POP3Errors[] =
+ static wchar_t *POP3Errors[] =
{
- LPGENT("Memory allocation error."), //memory allocation
- LPGENT("Account is about to be stopped."), //stop account
- LPGENT("Cannot connect to POP3 server."),
- LPGENT("Cannot allocate memory for received data."),
- LPGENT("Cannot login to POP3 server."),
- LPGENT("Bad user or password."),
- LPGENT("Server does not support APOP authorization."),
- LPGENT("Error while executing POP3 command."),
- LPGENT("Error while executing POP3 command."),
- LPGENT("Error while executing POP3 command."),
+ LPGENW("Memory allocation error."), //memory allocation
+ LPGENW("Account is about to be stopped."), //stop account
+ LPGENW("Cannot connect to POP3 server."),
+ LPGENW("Cannot allocate memory for received data."),
+ LPGENW("Cannot login to POP3 server."),
+ LPGENW("Bad user or password."),
+ LPGENW("Server does not support APOP authorization."),
+ LPGENW("Error while executing POP3 command."),
+ LPGENW("Error while executing POP3 command."),
+ LPGENW("Error while executing POP3 command."),
};
- static TCHAR *NetlibErrors[] =
+ static wchar_t *NetlibErrors[] =
{
- LPGENT("Cannot connect to server with NetLib."),
- LPGENT("Cannot send data."),
- LPGENT("Cannot receive data."),
- LPGENT("Cannot allocate memory for received data."),
+ LPGENW("Cannot connect to server with NetLib."),
+ LPGENW("Cannot send data."),
+ LPGENW("Cannot receive data."),
+ LPGENW("Cannot allocate memory for received data."),
};
- static TCHAR *SSLErrors[] =
+ static wchar_t *SSLErrors[] =
{
- LPGENT("OpenSSL not loaded."),
- LPGENT("Windows socket 2.0 init failed."),
- LPGENT("DNS lookup error."),
- LPGENT("Error while creating base socket."),
- LPGENT("Error connecting to server with socket."),
- LPGENT("Error while creating SSL structure."),
- LPGENT("Error connecting socket with SSL."),
- LPGENT("Server rejected connection with SSL."),
- LPGENT("Cannot write SSL data."),
- LPGENT("Cannot read SSL data."),
- LPGENT("Cannot allocate memory for received data."),
+ LPGENW("OpenSSL not loaded."),
+ LPGENW("Windows socket 2.0 init failed."),
+ LPGENW("DNS lookup error."),
+ LPGENW("Error while creating base socket."),
+ LPGENW("Error connecting to server with socket."),
+ LPGENW("Error while creating SSL structure."),
+ LPGENW("Error connecting socket with SSL."),
+ LPGENW("Server rejected connection with SSL."),
+ LPGENW("Cannot write SSL data."),
+ LPGENW("Cannot read SSL data."),
+ LPGENW("Cannot allocate memory for received data."),
};
- TCHAR *ErrorString = new TCHAR[ERRORSTR_MAXLEN];
+ wchar_t *ErrorString = new wchar_t[ERRORSTR_MAXLEN];
POP3_ERRORCODE *ErrorCode = (POP3_ERRORCODE *)(UINT_PTR)Code;
mir_sntprintf(ErrorString, ERRORSTR_MAXLEN, TranslateT("Error %d-%d-%d-%d:"), ErrorCode->AppError, ErrorCode->POP3Error, ErrorCode->NetError, ErrorCode->SystemError);
diff --git a/plugins/YAMN/src/proto/pop3/pop3opt.cpp b/plugins/YAMN/src/proto/pop3/pop3opt.cpp
index 20ae0c8eac..4e083211fd 100644
--- a/plugins/YAMN/src/proto/pop3/pop3opt.cpp
+++ b/plugins/YAMN/src/proto/pop3/pop3opt.cpp
@@ -365,7 +365,7 @@ BOOL DlgShowAccount(HWND hDlg, WPARAM wParam, LPARAM lParam)
int i;
if ((DWORD)wParam == M_SHOWACTUAL) {
- TCHAR accstatus[256];
+ wchar_t accstatus[256];
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read wait\n");
#endif
@@ -672,7 +672,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP
case WM_YAMN_CHANGESTATUS:
if ((HPOP3ACCOUNT)wParam == ActualAccount) {
- TCHAR accstatus[256];
+ wchar_t accstatus[256];
GetAccountStatus(ActualAccount, accstatus);
SetDlgItemText(hDlg, IDC_STSTATUS, accstatus);
return TRUE;
@@ -686,7 +686,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP
case WM_YAMN_CHANGETIME:
if ((HPOP3ACCOUNT)wParam == ActualAccount) {
- TCHAR Text[256];
+ wchar_t Text[256];
mir_sntprintf(Text, TranslateT("Time left to next check [s]: %d"), (DWORD)lParam);
SetDlgItemText(hDlg, IDC_STTIMELEFT, Text);
}
@@ -829,7 +829,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP
case IDC_BTNAPP:
{
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
mir_sntprintf(filter, L"%s (*.exe;*.bat;*.cmd;*.com)%c*.exe;*.bat;*.cmd;*.com%c%s (*.*)%c*.*%c",
TranslateT("Executables"), 0, 0, TranslateT("All Files"), 0, 0);
@@ -839,8 +839,8 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP
OFNStruct.lpstrFilter = filter;
OFNStruct.nFilterIndex = 1;
OFNStruct.nMaxFile = MAX_PATH;
- OFNStruct.lpstrFile = new TCHAR[MAX_PATH];
- OFNStruct.lpstrFile[0] = (TCHAR)0;
+ OFNStruct.lpstrFile = new wchar_t[MAX_PATH];
+ OFNStruct.lpstrFile[0] = (wchar_t)0;
OFNStruct.lpstrTitle = TranslateT("Select executable used for notification");
OFNStruct.Flags = OFN_FILEMUSTEXIST | OFN_NONETWORKBUTTON | OFN_PATHMUSTEXIST | OFN_NOCHANGEDIR;
if (!GetOpenFileName(&OFNStruct)) {
@@ -1373,7 +1373,7 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
{
- TCHAR Text[MAX_PATH];
+ wchar_t Text[MAX_PATH];
BOOL Translated, CheckPopup, CheckPopupW;
BOOL CheckNPopup, CheckNPopupW, CheckFPopup, CheckFPopupW;
BOOL CheckPopN;
diff --git a/plugins/YAMN/src/protoplugin.cpp b/plugins/YAMN/src/protoplugin.cpp
index e2a492d718..25e7a5a42c 100644
--- a/plugins/YAMN/src/protoplugin.cpp
+++ b/plugins/YAMN/src/protoplugin.cpp
@@ -175,7 +175,7 @@ INT_PTR UnregisterProtoPlugins()
INT_PTR GetFileNameSvc(WPARAM wParam,LPARAM)
{
- TCHAR *FileName = new TCHAR[MAX_PATH];
+ wchar_t *FileName = new wchar_t[MAX_PATH];
if (FileName == NULL)
return NULL;
@@ -185,8 +185,8 @@ INT_PTR GetFileNameSvc(WPARAM wParam,LPARAM)
INT_PTR DeleteFileNameSvc(WPARAM wParam,LPARAM)
{
- if (( TCHAR* )wParam != NULL)
- delete[] ( TCHAR* ) wParam;
+ if (( wchar_t* )wParam != NULL)
+ delete[] ( wchar_t* ) wParam;
return 0;
}
diff --git a/plugins/YAMN/src/stdafx.h b/plugins/YAMN/src/stdafx.h
index 31ec1ca5dd..e932de1d2e 100644
--- a/plugins/YAMN/src/stdafx.h
+++ b/plugins/YAMN/src/stdafx.h
@@ -76,14 +76,14 @@ int InitAccount(HACCOUNT Which);
void DeInitAccount(HACCOUNT Which);
void StopSignalFcn(HACCOUNT Which);
void CodeDecodeString(char *Dest, BOOL Encrypt);
-DWORD FileToMemory(TCHAR *FileName, char **MemFile, char **End);
+DWORD FileToMemory(wchar_t *FileName, char **MemFile, char **End);
#if defined(DEBUG_FILEREAD) || defined(DEBUG_FILEREADMESSAGES)
DWORD ReadStringFromMemory(char **Parser,char *End,char **StoreTo,char *DebugString);
#endif
DWORD ReadStringFromMemory(char **Parser, char *End, char **StoreTo);
DWORD ReadMessagesFromMemory(HACCOUNT Which, char **Parser, char *End);
-DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, TCHAR *End);
+DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, wchar_t *End);
INT_PTR AddAccountsFromFileSvc(WPARAM wParam, LPARAM lParam);
DWORD WriteStringToFile(HANDLE File, char *Source);
@@ -102,8 +102,8 @@ int StopAccounts(HYAMNPROTOPLUGIN Plugin);
int WaitForAllAccounts(HYAMNPROTOPLUGIN Plugin, BOOL GetAccountBrowserAccess = FALSE);
int DeleteAccounts(HYAMNPROTOPLUGIN Plugin);
-void WINAPI GetStatusFcn(HACCOUNT Which, TCHAR *Value);
-void WINAPI SetStatusFcn(HACCOUNT Which, TCHAR *Value);
+void WINAPI GetStatusFcn(HACCOUNT Which, wchar_t *Value);
+void WINAPI SetStatusFcn(HACCOUNT Which, wchar_t *Value);
INT_PTR UnregisterProtoPlugins();
INT_PTR RegisterProtocolPluginSvc(WPARAM, LPARAM);
@@ -162,8 +162,8 @@ int PostLoad(WPARAM, LPARAM); //Executed after all plugins loaded YAMN reads
int Shutdown(WPARAM, LPARAM); //Executed before Miranda is going to shutdown
int AddTopToolbarIcon(WPARAM, LPARAM); //Executed when TopToolBar plugin loaded Adds bitmap to toolbar
-extern TCHAR UserDirectory[]; //e.g. "F:\WINNT\Profiles\UserXYZ"
-extern TCHAR ProfileName[]; //e.g. "majvan"
+extern wchar_t UserDirectory[]; //e.g. "F:\WINNT\Profiles\UserXYZ"
+extern wchar_t ProfileName[]; //e.g. "majvan"
extern SWMRG *AccountBrowserSO;
extern YAMN_VARIABLES YAMNVar;
extern HANDLE hNewMailHook;
@@ -183,7 +183,7 @@ DWORD WINAPI WaitToReadFcn(PSWMRG SObject);
void WINAPI ReadDoneFcn(PSWMRG SObject);
DWORD WINAPI SCIncFcn(PSCOUNTER SCounter);
DWORD WINAPI SCDecFcn(PSCOUNTER SCounter);
-BOOL WINAPI SWMRGInitialize(PSWMRG, TCHAR *);
+BOOL WINAPI SWMRGInitialize(PSWMRG, wchar_t *);
void WINAPI SWMRGDelete(PSWMRG);
DWORD WINAPI SWMRGWaitToWrite(PSWMRG pSWMRG, DWORD dwTimeout);
void WINAPI SWMRGDoneWriting(PSWMRG pSWMRG);
@@ -203,7 +203,7 @@ char *ExtractFromContentType(char *ContentType, char *value);
WCHAR *ParseMultipartBody(char *src, char *bond);
//From account.cpp
-void WINAPI GetStatusFcn(HACCOUNT Which, TCHAR *Value);
+void WINAPI GetStatusFcn(HACCOUNT Which, wchar_t *Value);
extern HYAMNPROTOPLUGIN POP3Plugin;
diff --git a/plugins/YAMN/src/synchro.cpp b/plugins/YAMN/src/synchro.cpp
index 6b37e151dc..e008fe9db0 100644
--- a/plugins/YAMN/src/synchro.cpp
+++ b/plugins/YAMN/src/synchro.cpp
@@ -14,7 +14,7 @@
// the structure's address is passed as the first parameter.
// The lpszName parameter is the name of the object. Pass
// NULL if you do not want to share the object.
-BOOL WINAPI SWMRGInitialize(PSWMRG pSWMRG,TCHAR *Name);
+BOOL WINAPI SWMRGInitialize(PSWMRG pSWMRG,wchar_t *Name);
// Deletes the system resources associated with a SWMRG
// structure. The structure must be deleted only when
@@ -98,7 +98,7 @@ void WINAPI SWMRGDelete(PSWMRG pSWMRG)
CloseHandle(pSWMRG->hFinishEV);
}
-BOOL WINAPI SWMRGInitialize(PSWMRG pSWMRG,TCHAR *Name)
+BOOL WINAPI SWMRGInitialize(PSWMRG pSWMRG,wchar_t *Name)
{
pSWMRG->hEventNoWriter=NULL;
pSWMRG->hEventNoReaders=NULL;
@@ -109,25 +109,25 @@ BOOL WINAPI SWMRGInitialize(PSWMRG pSWMRG,TCHAR *Name)
// no writer threads are writing.
// Initially no reader threads are reading.
if (Name != NULL)
- Name[0]=(TCHAR)'W';
+ Name[0]=(wchar_t)'W';
pSWMRG->hEventNoWriter=CreateEvent(NULL,FALSE,TRUE,Name);
// Creates the manual-reset event that is signalled when
// no reader threads are reading.
// Initially no reader threads are reading.
if (Name != NULL)
- Name[0]=(TCHAR)'R';
+ Name[0]=(wchar_t)'R';
pSWMRG->hEventNoReaders=CreateEvent(NULL,TRUE,TRUE,Name);
// Initializes the variable that indicates the number of
// reader threads that are reading.
// Initially no reader threads are reading.
if (Name != NULL)
- Name[0]=(TCHAR)'C';
+ Name[0]=(wchar_t)'C';
pSWMRG->hSemNumReaders=CreateSemaphore(NULL,0,0x7FFFFFFF,Name);
if (Name != NULL)
- Name[0]=(TCHAR)'F';
+ Name[0]=(wchar_t)'F';
pSWMRG->hFinishEV=CreateEvent(NULL,TRUE,FALSE,Name);
// If a synchronization object could not be created,
diff --git a/plugins/YAPP/src/message_pump.h b/plugins/YAPP/src/message_pump.h
index a6fbb1c164..d432706822 100644
--- a/plugins/YAPP/src/message_pump.h
+++ b/plugins/YAPP/src/message_pump.h
@@ -19,12 +19,12 @@ struct PopupData
HICON hIcon;
union {
char *pszTitle;
- TCHAR *ptzTitle;
+ wchar_t *ptzTitle;
wchar_t *pwzTitle;
};
union {
char *pszText;
- TCHAR *ptzText;
+ wchar_t *ptzText;
wchar_t *pwzText;
};
COLORREF colorBack; // if colorBack and colorText are equal, defaults will be used
diff --git a/plugins/YAPP/src/popwin.cpp b/plugins/YAPP/src/popwin.cpp
index 3bfa589fb7..7bbdc6ca52 100644
--- a/plugins/YAPP/src/popwin.cpp
+++ b/plugins/YAPP/src/popwin.cpp
@@ -187,7 +187,7 @@ struct PopupWindowData
bool custom_col;
HBRUSH bkBrush, barBrush, underlineBrush;
HPEN bPen;
- TCHAR tbuff[128];
+ wchar_t tbuff[128];
int tb_height, av_height, text_height, time_height, time_width;
int real_av_width, real_av_height;
bool have_av;
@@ -469,7 +469,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (pwd->custom_col) SetTextColor(ps.hdc, pd->colorText);
else SetTextColor(ps.hdc, colFirstLine);
- TCHAR *title = mir_u2t(pd->pwzTitle);
+ wchar_t *title = mir_u2t(pd->pwzTitle);
DrawText(ps.hdc, title, -1, &tr, DT_VCENTER | DT_LEFT | DT_END_ELLIPSIS | DT_SINGLELINE | DT_NOPREFIX);
mir_free(title);
@@ -491,7 +491,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (options.av_layout != PAV_NONE && options.time_layout == PT_WITHAV && pwd->time_height <= pwd->tb_height && !pwd->have_av)
GetClientRect(hwnd, &r);
- TCHAR *text = mir_u2t(pd->pwzText);
+ wchar_t *text = mir_u2t(pd->pwzText);
tr.left = r.left + options.padding + options.text_indent; tr.right = r.right - options.padding; tr.top = tr.bottom + options.padding; tr.bottom = r.bottom - options.padding;
DrawText(ps.hdc, text, -1, &tr, DT_NOPREFIX | DT_WORDBREAK | DT_EXTERNALLEADING | DT_TOP | DT_LEFT | DT_WORD_ELLIPSIS);
mir_free(text);
@@ -560,7 +560,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
return TRUE;
case PUM_SETTEXT:
- replaceStrT(pd->ptzText, (TCHAR*)lParam);
+ replaceStrT(pd->ptzText, (wchar_t*)lParam);
InvalidateRect(hwnd, 0, TRUE);
RepositionWindows();
return TRUE;
@@ -592,7 +592,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
// titlebar height
if (hFontFirstLine) SelectObject(hdc, (HGDIOBJ)hFontFirstLine);
- TCHAR *title = mir_u2t(pd->pwzTitle);
+ wchar_t *title = mir_u2t(pd->pwzTitle);
GetTextExtentPoint32(hdc, title, (int)mir_tstrlen(title), &size);
mir_free(title);
pwd->tb_height = size.cy;
@@ -630,7 +630,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
r.right -= pwd->time_width + options.padding;
if (hFontSecondLine) SelectObject(hdc, (HGDIOBJ)hFontSecondLine);
- TCHAR *text = mir_u2t(pd->pwzText);
+ wchar_t *text = mir_u2t(pd->pwzText);
DrawText(hdc, text, -1, &r, DT_CALCRECT | DT_NOPREFIX | DT_WORDBREAK | DT_EXTERNALLEADING | DT_TOP | DT_LEFT | DT_WORD_ELLIPSIS);
pwd->text_height = r.bottom;
mir_free(text);
diff --git a/plugins/YAPP/src/services.cpp b/plugins/YAPP/src/services.cpp
index c77273cb5b..8b74676a1b 100644
--- a/plugins/YAPP/src/services.cpp
+++ b/plugins/YAPP/src/services.cpp
@@ -195,11 +195,11 @@ void UpdateMenu()
{
bool isEnabled = db_get_b(0, "Popup", "ModuleIsEnabled", 1) == 1;
if (isEnabled) {
- Menu_ModifyItem(hMenuItem, LPGENT("Disable Popups"), IcoLib_GetIcon(ICO_POPUP_ON));
+ Menu_ModifyItem(hMenuItem, LPGENW("Disable Popups"), IcoLib_GetIcon(ICO_POPUP_ON));
Menu_ModifyItem(hMenuRoot, NULL, IcoLib_GetIcon(ICO_POPUP_ON));
}
else {
- Menu_ModifyItem(hMenuItem, LPGENT("Enable Popups"), IcoLib_GetIcon(ICO_POPUP_OFF));
+ Menu_ModifyItem(hMenuItem, LPGENW("Enable Popups"), IcoLib_GetIcon(ICO_POPUP_OFF));
Menu_ModifyItem(hMenuRoot, NULL, IcoLib_GetIcon(ICO_POPUP_OFF));
}
@@ -291,7 +291,7 @@ static INT_PTR ShowMessage(WPARAM wParam, LPARAM lParam)
POPUPDATAT pd = {0};
mir_tstrcpy(pd.lptzContactName, lParam == SM_WARNING ? L"Warning" : L"Notification");
pd.lchIcon = LoadIcon(0, lParam == SM_WARNING ? IDI_WARNING : IDI_INFORMATION);
- _tcsncpy(pd.lptzText, _A2T((char *)wParam), MAX_SECONDLINE); pd.lptzText[MAX_SECONDLINE-1] = 0;
+ wcsncpy(pd.lptzText, _A2T((char *)wParam), MAX_SECONDLINE); pd.lptzText[MAX_SECONDLINE-1] = 0;
CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&pd, 0);
}
return 0;
diff --git a/plugins/YAPP/src/yapp.cpp b/plugins/YAPP/src/yapp.cpp
index 9b64c9803b..06ce6610fd 100644
--- a/plugins/YAPP/src/yapp.cpp
+++ b/plugins/YAPP/src/yapp.cpp
@@ -94,8 +94,8 @@ static void InitFonts()
{
font_id_firstline.cbSize = sizeof(FontIDT);
font_id_firstline.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(font_id_firstline.group, LPGENT("Popups"));
- mir_tstrcpy(font_id_firstline.name, LPGENT("First line"));
+ mir_tstrcpy(font_id_firstline.group, LPGENW("Popups"));
+ mir_tstrcpy(font_id_firstline.name, LPGENW("First line"));
mir_strcpy(font_id_firstline.dbSettingsGroup, MODULE);
mir_strcpy(font_id_firstline.prefix, "FontFirst");
mir_tstrcpy(font_id_firstline.backgroundGroup, L"Popups");
@@ -105,8 +105,8 @@ static void InitFonts()
font_id_secondline.cbSize = sizeof(FontIDT);
font_id_secondline.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(font_id_secondline.group, LPGENT("Popups"));
- mir_tstrcpy(font_id_secondline.name, LPGENT("Second line"));
+ mir_tstrcpy(font_id_secondline.group, LPGENW("Popups"));
+ mir_tstrcpy(font_id_secondline.name, LPGENW("Second line"));
mir_strcpy(font_id_secondline.dbSettingsGroup, MODULE);
mir_strcpy(font_id_secondline.prefix, "FontSecond");
mir_tstrcpy(font_id_secondline.backgroundGroup, L"Popups");
@@ -116,8 +116,8 @@ static void InitFonts()
font_id_time.cbSize = sizeof(FontIDT);
font_id_time.flags = FIDF_ALLOWEFFECTS;
- mir_tstrcpy(font_id_time.group, LPGENT("Popups"));
- mir_tstrcpy(font_id_time.name, LPGENT("Time"));
+ mir_tstrcpy(font_id_time.group, LPGENW("Popups"));
+ mir_tstrcpy(font_id_time.name, LPGENW("Time"));
mir_strcpy(font_id_time.dbSettingsGroup, MODULE);
mir_strcpy(font_id_time.prefix, "FontTime");
mir_tstrcpy(font_id_time.backgroundGroup, L"Popups");
@@ -126,8 +126,8 @@ static void InitFonts()
FontRegisterT(&font_id_time);
colour_id_bg.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colour_id_bg.group, LPGENT("Popups"));
- mir_tstrcpy(colour_id_bg.name, LPGENT("Background"));
+ mir_tstrcpy(colour_id_bg.group, LPGENW("Popups"));
+ mir_tstrcpy(colour_id_bg.name, LPGENW("Background"));
mir_strcpy(colour_id_bg.dbSettingsGroup, MODULE);
mir_strcpy(colour_id_bg.setting, "ColourBg");
colour_id_bg.defcolour = GetSysColor(COLOR_3DSHADOW);
@@ -135,8 +135,8 @@ static void InitFonts()
ColourRegisterT(&colour_id_bg);
colour_id_border.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colour_id_border.group, LPGENT("Popups"));
- mir_tstrcpy(colour_id_border.name, LPGENT("Border"));
+ mir_tstrcpy(colour_id_border.group, LPGENW("Popups"));
+ mir_tstrcpy(colour_id_border.name, LPGENW("Border"));
mir_strcpy(colour_id_border.dbSettingsGroup, MODULE);
mir_strcpy(colour_id_border.setting, "ColourBorder");
colour_id_border.defcolour = RGB(0, 0, 0);
@@ -144,8 +144,8 @@ static void InitFonts()
ColourRegisterT(&colour_id_border);
colour_id_sidebar.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colour_id_sidebar.group, LPGENT("Popups"));
- mir_tstrcpy(colour_id_sidebar.name, LPGENT("Sidebar"));
+ mir_tstrcpy(colour_id_sidebar.group, LPGENW("Popups"));
+ mir_tstrcpy(colour_id_sidebar.name, LPGENW("Sidebar"));
mir_strcpy(colour_id_sidebar.dbSettingsGroup, MODULE);
mir_strcpy(colour_id_sidebar.setting, "ColourSidebar");
colour_id_sidebar.defcolour = RGB(128, 128, 128);
@@ -153,8 +153,8 @@ static void InitFonts()
ColourRegisterT(&colour_id_sidebar);
colour_id_titleunderline.cbSize = sizeof(ColourIDT);
- mir_tstrcpy(colour_id_titleunderline.group, LPGENT("Popups"));
- mir_tstrcpy(colour_id_titleunderline.name, LPGENT("Title underline"));
+ mir_tstrcpy(colour_id_titleunderline.group, LPGENW("Popups"));
+ mir_tstrcpy(colour_id_titleunderline.name, LPGENW("Title underline"));
mir_strcpy(colour_id_titleunderline.dbSettingsGroup, MODULE);
mir_strcpy(colour_id_titleunderline.setting, "ColourTitleUnderline");
colour_id_titleunderline.defcolour = GetSysColor(COLOR_3DSHADOW);
@@ -168,7 +168,7 @@ void InitMenuItems(void)
{
bool isEnabled = db_get_b(0, "Popup", "ModuleIsEnabled", 1) == 1;
- hMenuRoot = Menu_CreateRoot(MO_MAIN, LPGENT("Popups"), 500010000, IcoLib_GetIcon(isEnabled ? ICO_POPUP_ON : ICO_POPUP_OFF, 0));
+ hMenuRoot = Menu_CreateRoot(MO_MAIN, LPGENW("Popups"), 500010000, IcoLib_GetIcon(isEnabled ? ICO_POPUP_ON : ICO_POPUP_OFF, 0));
Menu_ConfigureItem(hMenuRoot, MCI_OPT_UID, "043A641A-2767-4C57-AA57-9233D6F9DC54");
CMenuItem mi;
@@ -178,13 +178,13 @@ void InitMenuItems(void)
SET_UID(mi, 0x92c386ae, 0x6e81, 0x452d, 0xb5, 0x71, 0x87, 0x46, 0xe9, 0x2, 0x66, 0xe9);
mi.hIcolibItem = IcoLib_GetIcon(ICO_HISTORY, 0);
mi.pszService= MS_POPUP_SHOWHISTORY;
- mi.name.t = LPGENT("Popup History");
+ mi.name.w = LPGENW("Popup History");
hMenuItemHistory = Menu_AddMainMenuItem(&mi);
SET_UID(mi, 0x4353d44e, 0x177, 0x4843, 0x88, 0x30, 0x25, 0x5d, 0x91, 0xad, 0xdf, 0x3f);
mi.hIcolibItem = IcoLib_GetIcon(isEnabled ? ICO_POPUP_ON : ICO_POPUP_OFF, 0);
mi.pszService = "Popup/EnableDisableMenuCommand";
- mi.name.t = (isEnabled ? LPGENT("Disable Popups") : LPGENT("Enable Popups"));
+ mi.name.w = (isEnabled ? LPGENW("Disable Popups") : LPGENW("Enable Popups"));
hMenuItem = Menu_AddMainMenuItem(&mi);
}
diff --git a/plugins/YAPP/src/yapp_history.h b/plugins/YAPP/src/yapp_history.h
index c07c32f2ae..ff13d28b34 100644
--- a/plugins/YAPP/src/yapp_history.h
+++ b/plugins/YAPP/src/yapp_history.h
@@ -39,12 +39,12 @@ struct PopupHistoryData{
union{
char *message;
wchar_t *messageW;
- TCHAR *messageT;
+ wchar_t *messageT;
};
union{
char *title;
wchar_t *titleW;
- TCHAR *titleT;
+ wchar_t *titleT;
};
time_t timestamp;
};
diff --git a/plugins/YAPP/src/yapp_history_dlg.cpp b/plugins/YAPP/src/yapp_history_dlg.cpp
index 67a1fcaa14..535b4a7ee5 100644
--- a/plugins/YAPP/src/yapp_history_dlg.cpp
+++ b/plugins/YAPP/src/yapp_history_dlg.cpp
@@ -16,7 +16,7 @@
HWND hHistoryWindow = 0; //the history window
PopupHistoryList lstPopupHistory; //defined in main.cpp
-const TCHAR *szHistoryColumns[] = {L"Title", L"Message", L"Timestamp"}; //need to make sure that the string and size vectors have the same number of elements
+const wchar_t *szHistoryColumns[] = {L"Title", L"Message", L"Timestamp"}; //need to make sure that the string and size vectors have the same number of elements
const int cxHistoryColumns[] = {100, 450, 115};
const int cHistoryColumns = sizeof(szHistoryColumns) / sizeof(szHistoryColumns[0]);
@@ -118,59 +118,59 @@ struct SortParams{
static int lastColumn = -1; //last sort column
-int MatchesFilterCS(const TCHAR *filter, const PopupHistoryData *popupItem) //case sensitive
+int MatchesFilterCS(const wchar_t *filter, const PopupHistoryData *popupItem) //case sensitive
{
if (mir_tstrlen(filter) <= 0) { return 1; } //if no filter is set then the popup item matches the filter
int match = 0;
- match = (_tcsstr(popupItem->messageT, filter)) ? 1 : match; //check message part
+ match = (wcsstr(popupItem->messageT, filter)) ? 1 : match; //check message part
if (!match) //check title part of no match has been found
{
- match = (_tcsstr(popupItem->titleT, filter)) ? 1 : match;
+ match = (wcsstr(popupItem->titleT, filter)) ? 1 : match;
}
if (!match) //if no match has been found yet try to match the timestamp
{
- TCHAR buffer[1024];
+ wchar_t buffer[1024];
struct tm *myTime = localtime(&popupItem->timestamp);
- _tcsftime(buffer, 1024, L"%c", myTime);
- match = (_tcsstr(buffer, filter)) ? 1 : match;
+ wcsftime(buffer, 1024, L"%c", myTime);
+ match = (wcsstr(buffer, filter)) ? 1 : match;
}
return match;
}
-__inline void ConvertCase(TCHAR *dest, const TCHAR *source, size_t size)
+__inline void ConvertCase(wchar_t *dest, const wchar_t *source, size_t size)
{
- _tcsncpy(dest, source, size);
- _tcslwr(dest);
+ wcsncpy(dest, source, size);
+ wcslwr(dest);
}
-int MatchesFilterCI(const TCHAR *filterS, const PopupHistoryData *popupItem)
+int MatchesFilterCI(const wchar_t *filterS, const PopupHistoryData *popupItem)
{
if (mir_tstrlen(filterS) <= 0) { return 1; } //if no filter is set then the popup item matches the filter
int match = 0;
const int BUFFER_SIZE = 1024;
- TCHAR buffer[BUFFER_SIZE];
- TCHAR filterI[BUFFER_SIZE];
+ wchar_t buffer[BUFFER_SIZE];
+ wchar_t filterI[BUFFER_SIZE];
ConvertCase(filterI, filterS, BUFFER_SIZE);
ConvertCase(buffer, popupItem->messageT, BUFFER_SIZE); //check message part
- match = (_tcsstr(buffer, filterI)) ? 1 : match;
+ match = (wcsstr(buffer, filterI)) ? 1 : match;
if (!match) // check title part of no match has been found
{
ConvertCase(buffer, popupItem->titleT, BUFFER_SIZE);
- match = (_tcsstr(buffer, filterI)) ? 1 : match;
+ match = (wcsstr(buffer, filterI)) ? 1 : match;
}
if (!match) //if no match has been found yet try to match the timestamp
{
struct tm *myTime = localtime(&popupItem->timestamp);
- _tcsftime(buffer, 1024, L"%c", myTime);
- match = (_tcsstr(buffer, filterI)) ? 1 : match;
+ wcsftime(buffer, 1024, L"%c", myTime);
+ match = (wcsstr(buffer, filterI)) ? 1 : match;
}
return match;
@@ -180,8 +180,8 @@ int CALLBACK PopupsCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam)
{
SortParams params = *(SortParams *) myParam;
const int MAX_SIZE = 512;
- TCHAR text1[MAX_SIZE];
- TCHAR text2[MAX_SIZE];
+ wchar_t text1[MAX_SIZE];
+ wchar_t text2[MAX_SIZE];
int res;
ListView_GetItemText(params.hList, (int) lParam1, params.column, text1, _countof(text1));
@@ -323,8 +323,8 @@ void DeleteOldEvents(HWND hWnd, int renderer)
}
}
-typedef int (*SIG_MATCHESFILTER)(const TCHAR *filter, const PopupHistoryData *popupItem);
-typedef void (*SIG_ADDEVENTS)(HWND hWnd, int renderer, TCHAR *filter, SIG_MATCHESFILTER MatchesFilter);
+typedef int (*SIG_MATCHESFILTER)(const wchar_t *filter, const PopupHistoryData *popupItem);
+typedef void (*SIG_ADDEVENTS)(HWND hWnd, int renderer, wchar_t *filter, SIG_MATCHESFILTER MatchesFilter);
IEVIEWEVENTDATA *CreateAndFillEventData(PopupHistoryData *popupItem)
{
@@ -345,7 +345,7 @@ IEVIEWEVENTDATA *CreateAndFillEventData(PopupHistoryData *popupItem)
return eventData;
}
-void AddEventsCustomControl(HWND hWnd, int renderer, TCHAR *filter, SIG_MATCHESFILTER MatchesFilter)
+void AddEventsCustomControl(HWND hWnd, int renderer, wchar_t *filter, SIG_MATCHESFILTER MatchesFilter)
{
PopupHistoryWindowData *pwData = (PopupHistoryWindowData *) GetWindowLongPtr(hWnd, GWLP_USERDATA);
if (pwData)
@@ -401,10 +401,10 @@ void AddEventsCustomControl(HWND hWnd, int renderer, TCHAR *filter, SIG_MATCHESF
}
}
-void AddEventsDefault(HWND hWnd, int, TCHAR *filter, SIG_MATCHESFILTER MatchesFilter)
+void AddEventsDefault(HWND hWnd, int, wchar_t *filter, SIG_MATCHESFILTER MatchesFilter)
{
HWND hHistoryList = GetDlgItem(hWnd, IDC_LST_HISTORY);
- TCHAR buffer[1024];
+ wchar_t buffer[1024];
struct tm *myTime;
LVITEM item = {0};
@@ -423,7 +423,7 @@ void AddEventsDefault(HWND hWnd, int, TCHAR *filter, SIG_MATCHESFILTER MatchesFi
ListView_InsertItem(hHistoryList, &item);
ListView_SetItemText(hHistoryList, lIndex, 1, popupItem->messageT);
myTime = localtime(&popupItem->timestamp);
- _tcsftime(buffer, 1024, L"%c", myTime);
+ wcsftime(buffer, 1024, L"%c", myTime);
ListView_SetItemText(hHistoryList, lIndex++, 2, buffer);
}
}
@@ -437,7 +437,7 @@ void RefreshPopupHistory(HWND hWnd, int renderer)
SIG_ADDEVENTS AddEvents = (renderer == RENDER_DEFAULT) ? AddEventsDefault : AddEventsCustomControl;
- TCHAR filter[MAX_FILTER_SIZE];
+ wchar_t filter[MAX_FILTER_SIZE];
DeleteOldEvents(hWnd, renderer); //delete events
GetDlgItemText(hWnd, IDC_HISTORY_FILTER, filter, _countof(filter)); //get filter text
@@ -466,9 +466,9 @@ void CopyPopupDataToClipboard(HWND hList, int selection)
{
if (OpenClipboard(hList))
{
- TCHAR buffer[2048];
- buffer[0] = _T('\0');
- TCHAR *clipboard;
+ wchar_t buffer[2048];
+ buffer[0] = '\0';
+ wchar_t *clipboard;
int i;
int found = 0;
int count = ListView_GetItemCount(hList);
@@ -491,10 +491,10 @@ void CopyPopupDataToClipboard(HWND hList, int selection)
EmptyClipboard();
int len = (int)mir_tstrlen(buffer);
- HANDLE hData = GlobalAlloc(GMEM_MOVEABLE, (len + 2) * sizeof(TCHAR));
- clipboard = (TCHAR *) GlobalLock(hData);
- _tcsncpy(clipboard, buffer, len);
- clipboard[len] = _T('\0');
+ HANDLE hData = GlobalAlloc(GMEM_MOVEABLE, (len + 2) * sizeof(wchar_t));
+ clipboard = (wchar_t *) GlobalLock(hData);
+ wcsncpy(clipboard, buffer, len);
+ clipboard[len] = '\0';
GlobalUnlock(hData);
if (!SetClipboardData(textType, hData))
{
diff --git a/plugins/YARelay/src/main.cpp b/plugins/YARelay/src/main.cpp
index 96d331ceea..f611fce2f5 100644
--- a/plugins/YARelay/src/main.cpp
+++ b/plugins/YARelay/src/main.cpp
@@ -26,7 +26,7 @@ HINSTANCE hInst;
int hLangpack;
MCONTACT hForwardFrom, hForwardTo;
-TCHAR tszForwardTemplate[MAXTEMPLATESIZE];
+wchar_t tszForwardTemplate[MAXTEMPLATESIZE];
int iSplit, iSplitMaxSize, iSendParts, iMarkRead, iSendAndHistory, iForwardOnStatus;
LIST<MESSAGE_PROC> arMessageProcs(10, HandleKeySortT);
@@ -141,7 +141,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDBEvent)
continue;
}
- TCHAR buf[100];
+ wchar_t buf[100];
switch(*++p) {
case 'u':
case 'U':
@@ -153,7 +153,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDBEvent)
{
ptrT id(Contact_GetInfo(CNF_UNIQUEID, NULL));
if (id != NULL)
- _tcsncpy_s(buf, id, _TRUNCATE);
+ wcsncpy_s(buf, id, _TRUNCATE);
else
mir_sntprintf(buf, L"%p", hContact);
}
@@ -162,13 +162,13 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDBEvent)
case 't':
case 'T':
- _tcsftime(buf, 10, L"%H:%M", tm_time);
+ wcsftime(buf, 10, L"%H:%M", tm_time);
szUtfMsg.append(T2Utf(buf));
break;
case 'd':
case 'D':
- _tcsftime(buf, 12, L"%d/%m/%Y", tm_time);
+ wcsftime(buf, 12, L"%d/%m/%Y", tm_time);
szUtfMsg.append(T2Utf(buf));
break;
@@ -230,12 +230,12 @@ extern "C" int __declspec(dllexport) Load()
iForwardOnStatus = db_get_dw(NULL, "yaRelay", "ForwardOnStatus", STATUS_OFFLINE | STATUS_AWAY | STATUS_NA);
- TCHAR *szForwardTemplate = db_get_tsa(NULL, "yaRelay", "ForwardTemplate");
+ wchar_t *szForwardTemplate = db_get_tsa(NULL, "yaRelay", "ForwardTemplate");
if (szForwardTemplate){
- _tcsncpy(tszForwardTemplate, szForwardTemplate, _countof(tszForwardTemplate));
+ wcsncpy(tszForwardTemplate, szForwardTemplate, _countof(tszForwardTemplate));
mir_free(szForwardTemplate);
}
- else _tcsncpy(tszForwardTemplate, L"%u: %m", MAXTEMPLATESIZE-1);
+ else wcsncpy(tszForwardTemplate, L"%u: %m", MAXTEMPLATESIZE-1);
iSplit = db_get_dw(NULL, "yaRelay", "Split", 0);
iSplitMaxSize = db_get_dw(NULL, "yaRelay", "SplitMaxSize", 100);
diff --git a/plugins/YARelay/src/options.cpp b/plugins/YARelay/src/options.cpp
index 198905d6e1..66a00bbe04 100644
--- a/plugins/YARelay/src/options.cpp
+++ b/plugins/YARelay/src/options.cpp
@@ -69,7 +69,7 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
SendDlgItemMessage(hwndDlg, IDC_COMBO_TO, CB_SETCURSEL, (WPARAM)idx, 0);
for (hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- TCHAR *ptszNick = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *ptszNick = pcli->pfnGetContactDisplayName(hContact, 0);
if (ptszNick){
idx = SendDlgItemMessage(hwndDlg, IDC_COMBO_TO, CB_ADDSTRING, 0, (LPARAM)ptszNick);
SendDlgItemMessage(hwndDlg, IDC_COMBO_TO, CB_SETITEMDATA, (WPARAM)idx, hContact);
diff --git a/plugins/YARelay/src/stdafx.h b/plugins/YARelay/src/stdafx.h
index 01a6ff2792..eef4c08ce8 100644
--- a/plugins/YARelay/src/stdafx.h
+++ b/plugins/YARelay/src/stdafx.h
@@ -47,7 +47,7 @@ Features:
extern HINSTANCE hInst;
extern MCONTACT hForwardFrom, hForwardTo;
-extern TCHAR tszForwardTemplate[MAXTEMPLATESIZE];
+extern wchar_t tszForwardTemplate[MAXTEMPLATESIZE];
extern int iSplit, iSplitMaxSize, iSendParts, iMarkRead, iSendAndHistory, iForwardOnStatus;
struct MESSAGE_PROC
diff --git a/plugins/YahooGroups/src/hooked_events.cpp b/plugins/YahooGroups/src/hooked_events.cpp
index 19efd4ffda..774537e696 100644
--- a/plugins/YahooGroups/src/hooked_events.cpp
+++ b/plugins/YahooGroups/src/hooked_events.cpp
@@ -55,8 +55,8 @@ int OnOptionsInitialise(WPARAM wParam, LPARAM)
odp.position = 100000000;
odp.hInstance = hInstance;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.ptszTitle = LPGENT("Yahoo Groups");
- odp.ptszGroup = LPGENT("Plugins");
+ odp.pwszTitle = LPGENW("Yahoo Groups");
+ odp.pwszGroup = LPGENW("Plugins");
odp.groupPosition = 810000000;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pfnDlgProc = DlgProcOptions;
diff --git a/plugins/YahooGroups/src/utils.cpp b/plugins/YahooGroups/src/utils.cpp
index b33d7d888f..57ac86c10c 100644
--- a/plugins/YahooGroups/src/utils.cpp
+++ b/plugins/YahooGroups/src/utils.cpp
@@ -34,14 +34,14 @@ int Info(char *title, char *format, ...)
return MessageBoxA(0, str, title, MB_OK | MB_ICONINFORMATION);
}
-int MyPUShowMessage(TCHAR *lpzText, BYTE kind)
+int MyPUShowMessage(wchar_t *lpzText, BYTE kind)
{
if (ServiceExists(MS_POPUP_SHOWMESSAGE))
{
return PUShowMessageT(lpzText, kind);
}
else{
- TCHAR *title = (kind == SM_NOTIFY) ? TranslateT("Notify") : TranslateT("Warning");
+ wchar_t *title = (kind == SM_NOTIFY) ? TranslateT("Notify") : TranslateT("Warning");
return MessageBox(NULL, lpzText, title, MB_OK | (kind == SM_NOTIFY) ? MB_ICONINFORMATION : MB_ICONEXCLAMATION);
}
@@ -158,10 +158,10 @@ int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult,
return GetStringFromDatabase(NULL, ModuleName, szSettingName, szError, szResult, count);
}
-TCHAR* GetContactName(MCONTACT hContact, char *szProto)
+wchar_t* GetContactName(MCONTACT hContact, char *szProto)
{
ptrT id(Contact_GetInfo(CNF_DISPLAYUID, hContact, szProto));
- return (id != NULL) ? _tcsdup(id) : NULL;
+ return (id != NULL) ? wcsdup(id) : NULL;
}
void GetContactProtocol(MCONTACT hContact, char *szProto, int size)
@@ -169,7 +169,7 @@ void GetContactProtocol(MCONTACT hContact, char *szProto, int size)
GetStringFromDatabase(hContact, "Protocol", "p", NULL, szProto, size);
}
-TCHAR *GetContactID(MCONTACT hContact)
+wchar_t *GetContactID(MCONTACT hContact)
{
char protocol[256];
GetContactProtocol(hContact, protocol, sizeof(protocol));
@@ -177,18 +177,18 @@ TCHAR *GetContactID(MCONTACT hContact)
return GetContactID(hContact, protocol);
}
-TCHAR* GetContactID(MCONTACT hContact, char *szProto)
+wchar_t* GetContactID(MCONTACT hContact, char *szProto)
{
ptrT id(Contact_GetInfo(CNF_DISPLAY, hContact, szProto));
- return (id != NULL) ? _tcsdup(id) : NULL;
+ return (id != NULL) ? wcsdup(id) : NULL;
}
-MCONTACT GetContactFromID(TCHAR *szID, char *szProto)
+MCONTACT GetContactFromID(wchar_t *szID, char *szProto)
{
- TCHAR *szHandle;
- TCHAR dispName[1024];
+ wchar_t *szHandle;
+ wchar_t dispName[1024];
char cProtocol[256];
- TCHAR *tmp;
+ wchar_t *tmp;
int found = 0;
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
@@ -196,7 +196,7 @@ MCONTACT GetContactFromID(TCHAR *szID, char *szProto)
szHandle = GetContactID(hContact, cProtocol);
tmp = pcli->pfnGetContactDisplayName(hContact, 0);
- _tcsncpy(dispName, tmp, _countof(dispName));
+ wcsncpy(dispName, tmp, _countof(dispName));
if ((szHandle) && ((mir_tstrcmpi(szHandle, szID) == 0) || (mir_tstrcmpi(dispName, szID) == 0)) && ((szProto == NULL) || (_stricmp(szProto, cProtocol) == 0)))
found = 1;
@@ -212,7 +212,7 @@ MCONTACT GetContactFromID(TCHAR *szID, char *szProto)
#pragma warning (default: 4312)
#pragma warning (disable: 4312)
-MCONTACT GetContactFromID(TCHAR *szID, wchar_t *szProto)
+MCONTACT GetContactFromID(wchar_t *szID, wchar_t *szProto)
{
char protocol[1024];
WideCharToMultiByte(CP_ACP, 0, szProto, -1, protocol, sizeof(protocol), NULL, NULL);
diff --git a/plugins/YahooGroups/src/utils.h b/plugins/YahooGroups/src/utils.h
index 8269e2c61c..fc94116254 100644
--- a/plugins/YahooGroups/src/utils.h
+++ b/plugins/YahooGroups/src/utils.h
@@ -44,11 +44,11 @@ int GetStringFromDatabase(MCONTACT hContact, char *szModule, char *szSettingName
int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, int size);
int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult, int count);
-TCHAR *GetContactName(MCONTACT hContact, char *szProto);
-TCHAR *GetContactID(MCONTACT hContact);
-TCHAR *GetContactID(MCONTACT hContact, char *szProto);
-MCONTACT GetContactFromID(TCHAR *szID, char *szProto);
-MCONTACT GetContactFromID(TCHAR *szID, wchar_t *szProto);
+wchar_t *GetContactName(MCONTACT hContact, char *szProto);
+wchar_t *GetContactID(MCONTACT hContact);
+wchar_t *GetContactID(MCONTACT hContact, char *szProto);
+MCONTACT GetContactFromID(wchar_t *szID, char *szProto);
+MCONTACT GetContactFromID(wchar_t *szID, wchar_t *szProto);
void GetContactProtocol(MCONTACT hContact, char *szProto, int size);
int MyPUShowMessage(char *lpzText, BYTE kind);
diff --git a/plugins/ZeroNotification/src/main.cpp b/plugins/ZeroNotification/src/main.cpp
index eafa43a031..c2e11e5c54 100644
--- a/plugins/ZeroNotification/src/main.cpp
+++ b/plugins/ZeroNotification/src/main.cpp
@@ -20,7 +20,7 @@ int hLangpack;
struct CheckBoxValues_t
{
DWORD style;
- TCHAR *szDescr;
+ wchar_t *szDescr;
};
static const struct CheckBoxValues_t statusValues[] = {
@@ -208,8 +208,8 @@ static int OptionsInitialize(WPARAM wParam, LPARAM)
odp.hInstance = hInst;
odp.flags = ODPF_TCHAR;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_NOSOUND);
- odp.ptszTitle = LPGENT("Zero Notifications");
- odp.ptszGroup = LPGENT("Plugins");
+ odp.pwszTitle = LPGENW("Zero Notifications");
+ odp.pwszGroup = LPGENW("Plugins");
odp.groupPosition = 100000000;
odp.pfnDlgProc = DlgProcNoSoundOpts;
Options_AddPage(wParam, &odp);
diff --git a/plugins/ZeroNotification/src/stdafx.h b/plugins/ZeroNotification/src/stdafx.h
index f881395cb5..bd1e1dc792 100644
--- a/plugins/ZeroNotification/src/stdafx.h
+++ b/plugins/ZeroNotification/src/stdafx.h
@@ -17,6 +17,6 @@
#define DEFAULT_NOBLINK 0x00000000
#define DEFAULT_NOCLCBLINK 0x00000000
-#define DISABLE_SOUND LPGENT("Disable &Sounds")
-#define ENABLE_SOUND LPGENT("Enable &Sounds")
+#define DISABLE_SOUND LPGENW("Disable &Sounds")
+#define ENABLE_SOUND LPGENW("Enable &Sounds")
diff --git a/plugins/ZeroSwitch/src/stdafx.h b/plugins/ZeroSwitch/src/stdafx.h
index f5502963ee..b2583c407e 100644
--- a/plugins/ZeroSwitch/src/stdafx.h
+++ b/plugins/ZeroSwitch/src/stdafx.h
@@ -6,7 +6,6 @@
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
-#include <tchar.h>
#include <newpluginapi.h>
#include <m_clist.h>
diff --git a/plugins/helpers/gen_helpers.cpp b/plugins/helpers/gen_helpers.cpp
index e2806a5a0c..41f4f20276 100644
--- a/plugins/helpers/gen_helpers.cpp
+++ b/plugins/helpers/gen_helpers.cpp
@@ -20,7 +20,7 @@
#include "commonheaders.h"
#include "gen_helpers.h"
-TCHAR *Hlp_GetProtocolName(const char *proto) {
+wchar_t *Hlp_GetProtocolName(const char *proto) {
char protoname[256];
if ((!ProtoServiceExists(proto, PS_GETNAME)) || (CallProtoService(proto, PS_GETNAME, (WPARAM)sizeof(protoname), (LPARAM)protoname)))
@@ -30,27 +30,27 @@ TCHAR *Hlp_GetProtocolName(const char *proto) {
}
-TCHAR *Hlp_GetDlgItemText(HWND hwndDlg, int nIDDlgItem) {
+wchar_t *Hlp_GetDlgItemText(HWND hwndDlg, int nIDDlgItem) {
int len = SendDlgItemMessage(hwndDlg, nIDDlgItem, WM_GETTEXTLENGTH, 0, 0);
if (len < 0)
return NULL;
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
- memset(res, 0, ((len + 1) * sizeof(TCHAR)));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
+ memset(res, 0, ((len + 1) * sizeof(wchar_t)));
GetDlgItemText(hwndDlg, nIDDlgItem, res, len + 1);
return res;
}
-TCHAR *Hlp_GetWindowText(HWND hwndDlg)
+wchar_t *Hlp_GetWindowText(HWND hwndDlg)
{
int len = GetWindowTextLength(hwndDlg);
if (len < 0)
return NULL;
- TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
- memset(res, 0, ((len + 1) * sizeof(TCHAR)));
+ wchar_t *res = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t));
+ memset(res, 0, ((len + 1) * sizeof(wchar_t)));
GetWindowText(hwndDlg, res, len + 1);
return res;
@@ -94,11 +94,11 @@ int AddDebugLogMessageA(const char* fmt, ...)
return res;
}
-int AddDebugLogMessage(const TCHAR* fmt, ...)
+int AddDebugLogMessage(const wchar_t* fmt, ...)
{
int res;
- TCHAR tszText[MAX_DEBUG], tszFinal[MAX_DEBUG];
+ wchar_t tszText[MAX_DEBUG], tszFinal[MAX_DEBUG];
char *szFinal;
va_list va;
@@ -108,7 +108,7 @@ int AddDebugLogMessage(const TCHAR* fmt, ...)
#ifdef MODULENAME
mir_sntprintf(tszFinal, L"%s: %s", MODULENAME, tszText);
#else
- _tcsncpy(tszFinal, tszText, _countof(tszFinal));
+ wcsncpy(tszFinal, tszText, _countof(tszFinal));
#endif
@@ -120,15 +120,15 @@ int AddDebugLogMessage(const TCHAR* fmt, ...)
return res;
}
-int ttoi(TCHAR *string)
+int ttoi(wchar_t *string)
{
- return (string == NULL) ? 0 : _ttoi(string);
+ return (string == NULL) ? 0 : _wtoi(string);
}
-TCHAR *itot(int num)
+wchar_t *itot(int num)
{
- TCHAR tRes[32];
+ wchar_t tRes[32];
// check this
- _itot(num, tRes, 10);
+ _itow(num, tRes, 10);
return mir_tstrdup(tRes);
}
diff --git a/plugins/mTextControl/src/FormattedTextDraw.cpp b/plugins/mTextControl/src/FormattedTextDraw.cpp
index 8bce9290e3..61bd51534a 100644
--- a/plugins/mTextControl/src/FormattedTextDraw.cpp
+++ b/plugins/mTextControl/src/FormattedTextDraw.cpp
@@ -120,7 +120,7 @@ HRESULT CFormattedTextDraw::putTextA(char *newVal)
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_FACE | CFM_BOLD;
cf.dwEffects = 0;
- _tcsncpy_s(cf.szFaceName, L"MS Shell Dlg", _TRUNCATE);
+ wcsncpy_s(cf.szFaceName, L"MS Shell Dlg", _TRUNCATE);
m_spTextServices->TxSendMessage(EM_SETCHARFORMAT, (WPARAM)(SCF_ALL), (LPARAM)&cf, &lResult);
return S_OK;
@@ -148,7 +148,7 @@ HRESULT CFormattedTextDraw::putTextW(WCHAR *newVal)
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_FACE | CFM_BOLD;
cf.dwEffects = 0;
- _tcsncpy_s(cf.szFaceName, L"MS Shell Dlg", _TRUNCATE);
+ wcsncpy_s(cf.szFaceName, L"MS Shell Dlg", _TRUNCATE);
m_spTextServices->TxSendMessage(EM_SETCHARFORMAT, (WPARAM)(SCF_ALL), (LPARAM)&cf, &lResult);
return S_OK;
}
@@ -170,7 +170,7 @@ HRESULT CFormattedTextDraw::Draw(void *hdcDraw, RECT *prc)
cf.crTextColor = GetTextColor((HDC)hdcDraw);
cf.bCharSet = lf.lfCharSet;
cf.yHeight = 1440 * abs(lf.lfHeight) / GetDeviceCaps((HDC)hdcDraw, LOGPIXELSY);
- _tcsncpy_s(cf.szFaceName, lf.lfFaceName, _TRUNCATE);
+ wcsncpy_s(cf.szFaceName, lf.lfFaceName, _TRUNCATE);
m_spTextServices->TxSendMessage(EM_SETCHARFORMAT, (WPARAM)(SCF_ALL), (LPARAM)&cf, &lResult);
m_spTextServices->TxDraw(
@@ -211,7 +211,7 @@ HRESULT CFormattedTextDraw::get_NaturalSize(void *hdcDraw, long *Width, long *He
cf.crTextColor = GetTextColor((HDC)hdcDraw);
cf.bCharSet = lf.lfCharSet;
cf.yHeight = 1440 * abs(lf.lfHeight) / GetDeviceCaps((HDC)hdcDraw, LOGPIXELSY);
- _tcsncpy_s(cf.szFaceName, lf.lfFaceName, _TRUNCATE);
+ wcsncpy_s(cf.szFaceName, lf.lfFaceName, _TRUNCATE);
if (!m_spTextServices)
return S_FALSE;
@@ -384,7 +384,7 @@ HRESULT CFormattedTextDraw::TxGetScrollBars(DWORD *pdwScrollBar)
return S_OK;
}
-HRESULT CFormattedTextDraw::TxGetPasswordChar(TCHAR *)
+HRESULT CFormattedTextDraw::TxGetPasswordChar(wchar_t *)
{
return S_FALSE;
}
diff --git a/plugins/mTextControl/src/FormattedTextDraw.h b/plugins/mTextControl/src/FormattedTextDraw.h
index 0eeaa850bb..8f318717e6 100644
--- a/plugins/mTextControl/src/FormattedTextDraw.h
+++ b/plugins/mTextControl/src/FormattedTextDraw.h
@@ -151,7 +151,7 @@ public:
HRESULT TxGetBackStyle(TXTBACKSTYLE *pstyle);
HRESULT TxGetMaxLength(DWORD *plength);
HRESULT TxGetScrollBars(DWORD *pdwScrollBar);
- HRESULT TxGetPasswordChar(TCHAR *pch);
+ HRESULT TxGetPasswordChar(wchar_t *pch);
HRESULT TxGetAcceleratorPos(LONG *pcp);
HRESULT TxGetExtent(LPSIZEL lpExtent);
HRESULT OnTxCharFormatChange(const CHARFORMATW * pcf);
diff --git a/plugins/mTextControl/src/fancy_rtf.cpp b/plugins/mTextControl/src/fancy_rtf.cpp
index a210632700..17f5f76dba 100644
--- a/plugins/mTextControl/src/fancy_rtf.cpp
+++ b/plugins/mTextControl/src/fancy_rtf.cpp
@@ -2,9 +2,9 @@
struct BBCodeInfo
{
- TCHAR *start;
- TCHAR *end;
- bool(*func)(IFormattedTextDraw *ftd, CHARRANGE range, TCHAR *txt, DWORD cookie);
+ wchar_t *start;
+ wchar_t *end;
+ bool(*func)(IFormattedTextDraw *ftd, CHARRANGE range, wchar_t *txt, DWORD cookie);
DWORD cookie;
};
@@ -14,7 +14,7 @@ enum {
BBS_IMG1, BBS_IMG2
};
-static bool bbCodeSimpleFunc(IFormattedTextDraw *ftd, CHARRANGE range, TCHAR *, DWORD cookie)
+static bool bbCodeSimpleFunc(IFormattedTextDraw *ftd, CHARRANGE range, wchar_t *, DWORD cookie)
{
CHARFORMAT cf = { 0 };
cf.cbSize = sizeof(cf);
@@ -60,7 +60,7 @@ static bool bbCodeSimpleFunc(IFormattedTextDraw *ftd, CHARRANGE range, TCHAR *,
return true;
}
-static bool bbCodeImageFunc(IFormattedTextDraw *ftd, CHARRANGE range, TCHAR *txt, DWORD)
+static bool bbCodeImageFunc(IFormattedTextDraw *ftd, CHARRANGE range, wchar_t *txt, DWORD)
{
ITextServices *ts = ftd->getTextService();
ITextDocument *td = ftd->getTextDocument();
@@ -73,9 +73,9 @@ static bool bbCodeImageFunc(IFormattedTextDraw *ftd, CHARRANGE range, TCHAR *txt
td->Freeze(&cnt);
#ifdef _WIN64
- bool res = InsertBitmap(RichEditOle, CacheIconToEmf((HICON)_tstoi64(txt)));
+ bool res = InsertBitmap(RichEditOle, CacheIconToEmf((HICON)_wtoi64(txt)));
#else
- bool res = InsertBitmap(RichEditOle, CacheIconToEmf((HICON)_ttoi(txt)));
+ bool res = InsertBitmap(RichEditOle, CacheIconToEmf((HICON)_wtoi(txt)));
#endif
td->Unfreeze(&cnt);
@@ -115,7 +115,7 @@ void bbCodeParse(IFormattedTextDraw *ftd)
for (bool found = true; found;) {
found = false;
CHARRANGE fRange; fRange.cpMin = -1;
- TCHAR *fText = 0;
+ wchar_t *fText = 0;
BBCodeInfo *fBBCode = NULL;
for (int i = 0; i < bbCodeCount; i++) {
@@ -154,7 +154,7 @@ void bbCodeParse(IFormattedTextDraw *ftd)
TEXTRANGE trg;
trg.chrg.cpMin = fte.chrg.cpMin;
trg.chrg.cpMax = fte.chrgText.cpMin;
- trg.lpstrText = new TCHAR[trg.chrg.cpMax - trg.chrg.cpMin + 1];
+ trg.lpstrText = new wchar_t[trg.chrg.cpMax - trg.chrg.cpMin + 1];
ts->TxSendMessage(EM_GETTEXTRANGE, 0, (LPARAM)&trg, &lResult);
fText = trg.lpstrText;
}
diff --git a/plugins/mTextControl/src/richeditutils.cpp b/plugins/mTextControl/src/richeditutils.cpp
index d94785d475..3f3614dc1b 100644
--- a/plugins/mTextControl/src/richeditutils.cpp
+++ b/plugins/mTextControl/src/richeditutils.cpp
@@ -76,7 +76,7 @@ public:
HRESULT STDMETHODCALLTYPE GetNewStorage(LPSTORAGE * lplpstg)
{
- TCHAR sztName[64];
+ wchar_t sztName[64];
mir_sntprintf(sztName, L"s%u", this->nextStgId);
if (this->pictStg == NULL)
return STG_E_MEDIUMFULL;
diff --git a/plugins/mTextControl/src/stdafx.h b/plugins/mTextControl/src/stdafx.h
index e46827e586..3840d89738 100644
--- a/plugins/mTextControl/src/stdafx.h
+++ b/plugins/mTextControl/src/stdafx.h
@@ -47,8 +47,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "fancy_rtf.h"
#include "textcontrol.h"
-#define MODULNAME "MTextControl" //DB modul for this plugin
-#define MODULTITLE "Text Display"
+#define MODULNAME "MTextControl" // DB module for this plugin
+#define MODULNAMEW L"MTextControl" // DB module for this plugin
+
+#define MODULTITLE "Text Display"
// globals
extern HINSTANCE hInst;
diff --git a/plugins/mTextControl/src/textcontrol.cpp b/plugins/mTextControl/src/textcontrol.cpp
index daf7b6ad71..4dad57ec55 100644
--- a/plugins/mTextControl/src/textcontrol.cpp
+++ b/plugins/mTextControl/src/textcontrol.cpp
@@ -26,7 +26,7 @@ LRESULT MTextControl_OnPaint(HWND hwnd, WPARAM wParam, LPARAM lParam);
struct TextControlData
{
HANDLE htu;
- TCHAR *text;
+ wchar_t *text;
HANDLE mtext;
};
@@ -43,7 +43,7 @@ void MTextControl_RegisterClass()
wcl.hCursor = LoadCursor(NULL, IDC_ARROW);
wcl.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
wcl.lpszMenuName = NULL;
- wcl.lpszClassName = _T(MODULNAME);
+ wcl.lpszClassName = MODULNAMEW;
wcl.hIconSm = 0;
RegisterClassEx(&wcl);
}
@@ -74,7 +74,7 @@ LRESULT CALLBACK MTextControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (data->mtext) MTI_MTextDestroy(data->mtext);
{
int textLength = GetWindowTextLength(hwnd);
- data->text = new TCHAR[textLength + 1];
+ data->text = new wchar_t[textLength + 1];
GetWindowText(hwnd, data->text, textLength + 1);
data->mtext = MTI_MTextCreateW(data->htu, data->text);
diff --git a/plugins/wbOSD/src/events.cpp b/plugins/wbOSD/src/events.cpp
index 58f4d4153e..015e240ff4 100644
--- a/plugins/wbOSD/src/events.cpp
+++ b/plugins/wbOSD/src/events.cpp
@@ -23,7 +23,7 @@ void showmsgwnd(unsigned int param)
CallService(MS_MSG_SENDMESSAGET, (WPARAM)param, 0);
}
-LRESULT ShowOSD(TCHAR *str, int timeout, COLORREF color, MCONTACT user)
+LRESULT ShowOSD(wchar_t *str, int timeout, COLORREF color, MCONTACT user)
{
logmsg("ShowOSD");
@@ -62,7 +62,7 @@ int ProtoAck(WPARAM,LPARAM lparam)
if ( ack->result == ACKRESULT_SUCCESS && (LPARAM)ack->hProcess != ack->lParam ) {
DWORD ann = db_get_dw( NULL, THIS_MODULE, "announce", DEFAULT_ANNOUNCE );
if ( ann & ( 1 << ( ack->lParam - ID_STATUS_OFFLINE ))) {
- TCHAR buffer[512];
+ wchar_t buffer[512];
mir_sntprintf(buffer, TranslateT("%s is %s"), pcli->pfnGetContactDisplayName(ack->hContact, 0), pcli->pfnGetStatusModeDescription(ack->lParam, 0));
ShowOSD(buffer, 0, db_get_dw(NULL,THIS_MODULE, "clr_status", DEFAULT_CLRSTATUS), ack->hContact);
} } }
@@ -120,7 +120,7 @@ int ContactStatusChanged(WPARAM wParam, LPARAM lParam)
)
return 0;
- TCHAR bufferW[512];
+ wchar_t bufferW[512];
mir_sntprintf(bufferW, TranslateT("%s is %s"), pcli->pfnGetContactDisplayName(wParam, 0), pcli->pfnGetStatusModeDescription(newStatus, 0));
ShowOSD(bufferW, 0, db_get_dw(NULL,THIS_MODULE, "clr_status", DEFAULT_CLRSTATUS), hContact);
return 0;
@@ -150,8 +150,8 @@ int HookedNewEvent(WPARAM wParam, LPARAM hDBEvent)
logmsg("HookedNewEvent2");
- TCHAR buf[512];
- _tcsncpy(buf, DEFAULT_MESSAGEFORMAT,_countof(buf));
+ wchar_t buf[512];
+ wcsncpy(buf, DEFAULT_MESSAGEFORMAT,_countof(buf));
DBVARIANT dbv;
if(!db_get_ts(NULL,THIS_MODULE,"message_format",&dbv)) {
@@ -160,7 +160,7 @@ int HookedNewEvent(WPARAM wParam, LPARAM hDBEvent)
}
int i1=-1, i2=-1;
- TCHAR* pbuf = buf;
+ wchar_t* pbuf = buf;
while (*pbuf) {
if (*pbuf=='%') {
if (*(pbuf+1)=='n') {
@@ -181,7 +181,7 @@ int HookedNewEvent(WPARAM wParam, LPARAM hDBEvent)
pbuf++;
}
- TCHAR *c1 = 0, *c2 = 0;
+ wchar_t *c1 = 0, *c2 = 0;
if ( i1 == 1 )
c1 = mir_tstrdup(pcli->pfnGetContactDisplayName(wParam, 0));
else if ( i1 == 2 )
@@ -192,7 +192,7 @@ int HookedNewEvent(WPARAM wParam, LPARAM hDBEvent)
else if ( i2 == 2 )
c2 = DbGetEventTextT( &dbe, 0 );
- TCHAR buffer[512];
+ wchar_t buffer[512];
mir_sntprintf(buffer, buf, c1, c2);
ShowOSD(buffer, 0, db_get_dw(NULL,THIS_MODULE, "clr_msg", DEFAULT_CLRMSG), wParam);
diff --git a/plugins/wbOSD/src/options.cpp b/plugins/wbOSD/src/options.cpp
index de0c49a6cc..76af0a3bb1 100644
--- a/plugins/wbOSD/src/options.cpp
+++ b/plugins/wbOSD/src/options.cpp
@@ -249,7 +249,7 @@ INT_PTR CALLBACK OptDlgProc(HWND hDlg, UINT msg, WPARAM wparam, LPARAM lparam)
SendDlgItemMessage(hDlg, IDC_SLIDER1, TBM_SETPOS, TRUE, (LPARAM)ps->alpha);
{
- TCHAR buf[20];
+ wchar_t buf[20];
mir_sntprintf(buf, L"%d %%", ps->alpha * 100 / 255);
SetDlgItemText(hDlg, IDC_ALPHATXT, buf);
}
@@ -265,7 +265,7 @@ INT_PTR CALLBACK OptDlgProc(HWND hDlg, UINT msg, WPARAM wparam, LPARAM lparam)
ps = (plgsettings*)GetWindowLongPtr(hDlg, GWLP_USERDATA);
ps->alpha = SendDlgItemMessage(hDlg, IDC_SLIDER1, TBM_GETPOS, 0, 0);
{
- TCHAR buf[20];
+ wchar_t buf[20];
mir_sntprintf(buf, L"%d %%", ps->alpha * 100 / 255);
SetDlgItemText(hDlg, IDC_ALPHATXT, buf);
}
@@ -414,8 +414,8 @@ int OptionsInit(WPARAM wparam, LPARAM)
odp.groupPosition = 950000000;
odp.hInstance = hI;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG1);
- odp.ptszGroup = LPGENT("Plugins");
- odp.ptszTitle = LPGENT("OSD");
+ odp.pwszGroup = LPGENW("Plugins");
+ odp.pwszTitle = LPGENW("OSD");
odp.pfnDlgProc = OptDlgProc;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wparam, &odp);
diff --git a/plugins/wbOSD/src/stdafx.h b/plugins/wbOSD/src/stdafx.h
index 8e0d3f2248..3c301b30a1 100644
--- a/plugins/wbOSD/src/stdafx.h
+++ b/plugins/wbOSD/src/stdafx.h
@@ -86,7 +86,7 @@ typedef struct _plgsettings {
int align, salign, altShadow, showShadow, a_user, distance, onlyfromlist, showmystatus;
int showMsgWindow;
int messages; //also other events...
- TCHAR msgformat[256];
+ wchar_t msgformat[256];
int winx, winy, winxpos, winypos, alpha, transparent, timeout;
COLORREF clr_msg, clr_status, clr_shadow, bkclr;
DWORD announce, showWhen;
@@ -94,7 +94,7 @@ typedef struct _plgsettings {
} plgsettings;
typedef struct _osdmsg {
- TCHAR *text;
+ wchar_t *text;
int timeout; //ms
COLORREF color;
void (*callback)(unsigned int param);
diff --git a/plugins/wbOSD/src/wbOSD.cpp b/plugins/wbOSD/src/wbOSD.cpp
index 5159a3b437..bc602ec52c 100644
--- a/plugins/wbOSD/src/wbOSD.cpp
+++ b/plugins/wbOSD/src/wbOSD.cpp
@@ -9,10 +9,10 @@ Distributed under GNU's GPL 2 or later
#include "stdafx.h"
-TCHAR szClassName[] = L"wbOSD";
+wchar_t szClassName[] = L"wbOSD";
const static osdmsg defstr = { L"", 0, RGB(0, 0, 0), 0, 0 };
-int DrawMe(HWND hwnd, TCHAR *string, COLORREF color)
+int DrawMe(HWND hwnd, wchar_t *string, COLORREF color)
{
logmsg("DrawMe");
if (!string) string = L"bullshit";
@@ -161,7 +161,7 @@ LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM
logmsg("WindowProcedure::USER+1");
ms = (osdmsg*)mir_alloc(sizeof(osdmsg));
- ms->text = mir_tstrdup((TCHAR *)wParam);
+ ms->text = mir_tstrdup((wchar_t *)wParam);
if (lParam == 0)
lParam = db_get_dw(NULL, THIS_MODULE, "timeout", DEFAULT_TIMEOUT);
ms->timeout = lParam;
diff --git a/protocols/AimOscar/src/aim.cpp b/protocols/AimOscar/src/aim.cpp
index 6d595ae8e9..d9cbc9b6de 100644
--- a/protocols/AimOscar/src/aim.cpp
+++ b/protocols/AimOscar/src/aim.cpp
@@ -86,7 +86,7 @@ static int OnModulesLoaded(WPARAM, LPARAM)
/////////////////////////////////////////////////////////////////////////////////////////
// Load
-static PROTO_INTERFACE* protoInit(const char* pszProtoName, const TCHAR* tszUserName)
+static PROTO_INTERFACE* protoInit(const char* pszProtoName, const wchar_t* tszUserName)
{
CAimProto *ppro = new CAimProto(pszProtoName, tszUserName);
g_Instances.insert(ppro);
diff --git a/protocols/AimOscar/src/avatars.cpp b/protocols/AimOscar/src/avatars.cpp
index 52280c13e2..ec3b7c3812 100644
--- a/protocols/AimOscar/src/avatars.cpp
+++ b/protocols/AimOscar/src/avatars.cpp
@@ -95,11 +95,11 @@ void CAimProto::avatar_retrieval_handler(const char* sn, const char* /*hash*/, c
ai.hContact = contact_from_sn(sn);
if (data_len > 0) {
- const TCHAR *type;
+ const wchar_t *type;
ai.format = ProtoGetBufferFormat(data, &type);
get_avatar_filename(ai.hContact, ai.filename, _countof(ai.filename), type);
- int fileId = _topen(ai.filename, _O_CREAT | _O_TRUNC | _O_WRONLY | O_BINARY, _S_IREAD | _S_IWRITE);
+ int fileId = _wopen(ai.filename, _O_CREAT | _O_TRUNC | _O_WRONLY | O_BINARY, _S_IREAD | _S_IWRITE);
if (fileId >= 0) {
_write(fileId, data, data_len);
_close(fileId);
@@ -116,11 +116,11 @@ void CAimProto::avatar_retrieval_handler(const char* sn, const char* /*hash*/, c
ProtoBroadcastAck(ai.hContact, ACKTYPE_AVATAR, res ? ACKRESULT_SUCCESS : ACKRESULT_FAILED, &ai, 0);
}
-int CAimProto::get_avatar_filename(MCONTACT hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext)
+int CAimProto::get_avatar_filename(MCONTACT hContact, wchar_t* pszDest, size_t cbLen, const wchar_t *ext)
{
int tPathLen = mir_sntprintf(pszDest, cbLen, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
- if (ext && _taccess(pszDest, 0))
+ if (ext && _waccess(pszDest, 0))
CreateDirectoryTreeT(pszDest);
size_t tPathLen2 = tPathLen;
@@ -138,7 +138,7 @@ int CAimProto::get_avatar_filename(MCONTACT hContact, TCHAR* pszDest, size_t cbL
long hFile = _tfindfirst(pszDest, &c_file);
if (hFile > -1L) {
do {
- if (_tcsrchr(c_file.name, '.')) {
+ if (wcsrchr(c_file.name, '.')) {
mir_sntprintf(pszDest + tPathLen2, cbLen - tPathLen2, L"\\%s", c_file.name);
found = true;
}
@@ -150,15 +150,15 @@ int CAimProto::get_avatar_filename(MCONTACT hContact, TCHAR* pszDest, size_t cbL
}
else {
mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, ext);
- found = _taccess(pszDest, 0) == 0;
+ found = _waccess(pszDest, 0) == 0;
}
return found ? GAIR_SUCCESS : GAIR_WAITFOR;
}
-bool get_avatar_hash(const TCHAR* file, char* hash, char** data, unsigned short &size)
+bool get_avatar_hash(const wchar_t* file, char* hash, char** data, unsigned short &size)
{
- int fileId = _topen(file, _O_RDONLY | _O_BINARY, _S_IREAD);
+ int fileId = _wopen(file, _O_RDONLY | _O_BINARY, _S_IREAD);
if (fileId == -1) return false;
long lAvatar = _filelength(fileId);
diff --git a/protocols/AimOscar/src/avatars.h b/protocols/AimOscar/src/avatars.h
index 1188a1ec82..647e897f3f 100644
--- a/protocols/AimOscar/src/avatars.h
+++ b/protocols/AimOscar/src/avatars.h
@@ -46,7 +46,7 @@ struct avatar_up_req
{ mir_free(data1); mir_free(data2); }
};
-bool get_avatar_hash(const TCHAR* file, char* hash, char** data, unsigned short &size);
+bool get_avatar_hash(const wchar_t* file, char* hash, char** data, unsigned short &size);
void rescale_image(char *data, unsigned short size, char *&data1, unsigned short &size1);
#endif
diff --git a/protocols/AimOscar/src/chat.cpp b/protocols/AimOscar/src/chat.cpp
index 82508f63f0..dcc0d9449e 100644
--- a/protocols/AimOscar/src/chat.cpp
+++ b/protocols/AimOscar/src/chat.cpp
@@ -36,7 +36,7 @@ void CAimProto::chat_register(void)
void CAimProto::chat_start(const char* id, unsigned short exchange)
{
- TCHAR *idt = mir_a2t(id);
+ wchar_t *idt = mir_a2t(id);
GCSESSION gcw = { sizeof(gcw) };
gcw.iType = GCW_CHATROOM;
@@ -64,13 +64,13 @@ void CAimProto::chat_start(const char* id, unsigned short exchange)
mir_free(idt);
}
-void CAimProto::chat_event(const char* id, const char* sn, int evt, const TCHAR* msg)
+void CAimProto::chat_event(const char* id, const char* sn, int evt, const wchar_t* msg)
{
- TCHAR *idt = mir_a2t(id);
- TCHAR *snt = mir_a2t(sn);
+ wchar_t *idt = mir_a2t(id);
+ wchar_t *snt = mir_a2t(sn);
MCONTACT hContact = contact_from_sn(sn);
- TCHAR *nick = hContact ? (TCHAR*)pcli->pfnGetContactDisplayName(
+ wchar_t *nick = hContact ? (wchar_t*)pcli->pfnGetContactDisplayName(
WPARAM(hContact), 0) : snt;
GCDEST gcd = { m_szModuleName, idt, evt };
@@ -91,7 +91,7 @@ void CAimProto::chat_event(const char* id, const char* sn, int evt, const TCHAR*
void CAimProto::chat_leave(const char* id)
{
- TCHAR *idt = mir_a2t(id);
+ wchar_t *idt = mir_a2t(id);
GCDEST gcd = { m_szModuleName, idt, GC_EVENT_CONTROL };
GCEVENT gce = { sizeof(gce), &gcd };
diff --git a/protocols/AimOscar/src/conv.cpp b/protocols/AimOscar/src/conv.cpp
index 287aec3a84..a2e3420b2e 100644
--- a/protocols/AimOscar/src/conv.cpp
+++ b/protocols/AimOscar/src/conv.cpp
@@ -538,7 +538,7 @@ char* rtf_to_html(HWND hwndDlg, int DlgItem)
isSize = 1;
else
isSize = 3;
- TCHAR text[3] = L"";
+ wchar_t text[3] = L"";
SendDlgItemMessage(hwndDlg, DlgItem, EM_GETSELTEXT, 0, (LPARAM)&text);
if (Bold != isBold) {
Bold = isBold;
@@ -724,11 +724,11 @@ char* get_fname(char *path)
return pszFile;
}
-TCHAR* get_dir(TCHAR *path)
+wchar_t* get_dir(wchar_t *path)
{
- TCHAR *cpath = mir_tstrdup(path);
+ wchar_t *cpath = mir_tstrdup(path);
- TCHAR *swd = _tcsrchr(cpath, '\\');
+ wchar_t *swd = wcsrchr(cpath, '\\');
if (swd) swd[1] = 0; else cpath[0] = 0;
return cpath;
diff --git a/protocols/AimOscar/src/conv.h b/protocols/AimOscar/src/conv.h
index b7490cf63e..d12506189b 100644
--- a/protocols/AimOscar/src/conv.h
+++ b/protocols/AimOscar/src/conv.h
@@ -32,7 +32,7 @@ char* bytes_to_string(char* bytes, int num_bytes);
void string_to_bytes(char* string, char* bytes);
bool is_utf(const char* msg);
char* get_fname(char* path);
-TCHAR* get_dir(TCHAR* path);
+wchar_t* get_dir(wchar_t* path);
struct aimString
{
diff --git a/protocols/AimOscar/src/file.cpp b/protocols/AimOscar/src/file.cpp
index 9d19984558..d2a392b9a7 100644
--- a/protocols/AimOscar/src/file.cpp
+++ b/protocols/AimOscar/src/file.cpp
@@ -93,10 +93,10 @@ bool send_init_oft2(file_transfer *ft, char* file)
return Netlib_Send(ft->hConn, (char*)oft, len, 0) > 0;
}
-void CAimProto::report_file_error(TCHAR *fname)
+void CAimProto::report_file_error(wchar_t *fname)
{
- TCHAR errmsg[512];
- TCHAR* error = mir_a2t(_strerror(NULL));
+ wchar_t errmsg[512];
+ wchar_t* error = mir_a2t(_strerror(NULL));
mir_sntprintf(errmsg, TranslateT("Failed to open file: %s : %s"), fname, error);
mir_free(error);
ShowPopup((char*)errmsg, ERROR_POPUP | TCHAR_POPUP);
@@ -104,13 +104,13 @@ void CAimProto::report_file_error(TCHAR *fname)
bool setup_next_file_send(file_transfer *ft)
{
- TCHAR *file;
+ wchar_t *file;
struct _stati64 statbuf;
for (;;) {
file = ft->pfts.ptszFiles[ft->cf];
if (file == NULL) return false;
- if (_tstati64(file, &statbuf) == 0 && (statbuf.st_mode & _S_IFDIR) == 0)
+ if (_wstat64(file, &statbuf) == 0 && (statbuf.st_mode & _S_IFDIR) == 0)
break;
++ft->cf;
@@ -177,7 +177,7 @@ int CAimProto::sending_file(file_transfer *ft, HANDLE hServerPacketRecver, NETLI
if (type == 0x0202 || type == 0x0207) {
debugLogA("P2P: Buddy Accepts our file transfer.");
- int fid = _topen(ft->pfts.tszCurrentFile, _O_RDONLY | _O_BINARY, _S_IREAD);
+ int fid = _wopen(ft->pfts.tszCurrentFile, _O_RDONLY | _O_BINARY, _S_IREAD);
if (fid < 0) {
report_file_error(ft->pfts.tszCurrentFile);
return 2;
@@ -309,7 +309,7 @@ int CAimProto::receiving_file(file_transfer *ft, HANDLE hServerPacketRecver, NET
memcpy(buf, recv_ft->filename, buflen);
enc = _htons(recv_ft->encoding);
- TCHAR *name;
+ wchar_t *name;
if (enc == 2) {
wchar_t* wbuf = (wchar_t*)buf;
wcs_htons(wbuf);
@@ -323,7 +323,7 @@ int CAimProto::receiving_file(file_transfer *ft, HANDLE hServerPacketRecver, NET
mir_free(buf);
- TCHAR fname[256];
+ wchar_t fname[256];
mir_sntprintf(fname, L"%s%s", ft->pfts.tszWorkingDir, name);
mir_free(name);
mir_free(ft->pfts.tszCurrentFile);
@@ -334,14 +334,14 @@ int CAimProto::receiving_file(file_transfer *ft, HANDLE hServerPacketRecver, NET
WaitForSingleObject(ft->hResumeEvent, INFINITE);
if (ft->pfts.tszCurrentFile) {
- TCHAR* dir = get_dir(ft->pfts.tszCurrentFile);
+ wchar_t* dir = get_dir(ft->pfts.tszCurrentFile);
CreateDirectoryTreeT(dir);
mir_free(dir);
oft->type = _htons(ft->pfts.currentFileProgress ? 0x0205 : 0x0202);
const int flag = ft->pfts.currentFileProgress ? 0 : _O_TRUNC;
- fid = _topen(ft->pfts.tszCurrentFile, _O_CREAT | _O_WRONLY | _O_BINARY | flag, _S_IREAD | _S_IWRITE);
+ fid = _wopen(ft->pfts.tszCurrentFile, _O_CREAT | _O_WRONLY | _O_BINARY | flag, _S_IREAD | _S_IWRITE);
if (fid < 0) {
report_file_error(fname);
diff --git a/protocols/AimOscar/src/links.cpp b/protocols/AimOscar/src/links.cpp
index 25ae226baa..ea50d67c58 100644
--- a/protocols/AimOscar/src/links.cpp
+++ b/protocols/AimOscar/src/links.cpp
@@ -22,7 +22,7 @@ static HANDLE hServiceParseLink;
extern OBJLIST<CAimProto> g_Instances;
-static int SingleHexToDecimal(TCHAR c)
+static int SingleHexToDecimal(wchar_t c)
{
if (c >= '0' && c <= '9') return c - '0';
if (c >= 'a' && c <= 'f') return c - 'a' + 10;
@@ -30,9 +30,9 @@ static int SingleHexToDecimal(TCHAR c)
return -1;
}
-static TCHAR* url_decode(TCHAR* str)
+static wchar_t* url_decode(wchar_t* str)
{
- TCHAR* s = str, *d = str;
+ wchar_t* s = str, *d = str;
while (*s) {
if (*s == '%') {
@@ -41,7 +41,7 @@ static TCHAR* url_decode(TCHAR* str)
int digit2 = SingleHexToDecimal(s[2]);
if (digit2 != -1) {
s += 3;
- *d++ = (TCHAR)((digit1 << 4) | digit2);
+ *d++ = (wchar_t)((digit1 << 4) | digit2);
continue;
}
}
@@ -57,15 +57,15 @@ static INT_PTR ServiceParseAimLink(WPARAM, LPARAM lParam)
{
if (lParam == 0) return 1; /* sanity check */
- TCHAR *arg = (TCHAR*)lParam;
+ wchar_t *arg = (wchar_t*)lParam;
/* skip leading prefix */
- arg = _tcschr(arg, ':');
+ arg = wcschr(arg, ':');
if (arg == NULL) return 1; /* parse failed */
for (++arg; *arg == '/'; ++arg);
- arg = NEWTSTR_ALLOCA(arg);
+ arg = NEWWSTR_ALLOCA(arg);
if (g_Instances.getCount() == 0) return 0;
@@ -84,16 +84,16 @@ static INT_PTR ServiceParseAimLink(WPARAM, LPARAM lParam)
open chatroom: aim:gochat?roomname=ROOM&exchange=NUM
*/
/* add a contact to the list */
- if (!_tcsnicmp(arg, L"addbuddy?", 9)) {
- TCHAR *tok, *tok2;
+ if (!wcsnicmp(arg, L"addbuddy?", 9)) {
+ wchar_t *tok, *tok2;
char *sn = NULL, *group = NULL;
for (tok = arg + 8; tok != NULL; tok = tok2) {
- tok2 = _tcschr(++tok, '&'); /* first token */
+ tok2 = wcschr(++tok, '&'); /* first token */
if (tok2) *tok2 = 0;
- if (!_tcsnicmp(tok, L"screenname=", 11) && *(tok + 11) != 0)
+ if (!wcsnicmp(tok, L"screenname=", 11) && *(tok + 11) != 0)
sn = mir_t2a(url_decode(tok + 11));
- if (!_tcsnicmp(tok, L"groupname=", 10) && *(tok + 10) != 0)
+ if (!wcsnicmp(tok, L"groupname=", 10) && *(tok + 10) != 0)
group = mir_utf8encodeT(url_decode(tok + 10)); /* group is currently ignored */
}
if (sn == NULL) {
@@ -111,16 +111,16 @@ static INT_PTR ServiceParseAimLink(WPARAM, LPARAM lParam)
return 0;
}
/* send a message to a contact */
- else if (!_tcsnicmp(arg, L"goim?", 5)) {
- TCHAR *tok, *tok2, *msg = NULL;
+ else if (!wcsnicmp(arg, L"goim?", 5)) {
+ wchar_t *tok, *tok2, *msg = NULL;
char *sn = NULL;
for (tok = arg + 4; tok != NULL; tok = tok2) {
- tok2 = _tcschr(++tok, '&'); /* first token */
+ tok2 = wcschr(++tok, '&'); /* first token */
if (tok2) *tok2 = 0;
- if (!_tcsnicmp(tok, L"screenname=", 11) && *(tok + 11) != 0)
+ if (!wcsnicmp(tok, L"screenname=", 11) && *(tok + 11) != 0)
sn = mir_t2a(url_decode(tok + 11));
- if (!_tcsnicmp(tok, L"message=", 8) && *(tok + 8) != 0)
+ if (!wcsnicmp(tok, L"message=", 8) && *(tok + 8) != 0)
msg = url_decode(tok + 8);
}
if (sn == NULL) return 1; /* parse failed */
@@ -134,21 +134,21 @@ static INT_PTR ServiceParseAimLink(WPARAM, LPARAM lParam)
}
/* open a chatroom */
- else if (!_tcsnicmp(arg, L"gochat?", 7)) {
- TCHAR *tok, *tok2;
+ else if (!wcsnicmp(arg, L"gochat?", 7)) {
+ wchar_t *tok, *tok2;
char *rm = NULL;
int exchange = 0;
for (tok = arg + 6; tok != NULL; tok = tok2) {
- tok2 = _tcschr(++tok, '&'); /* first token */
+ tok2 = wcschr(++tok, '&'); /* first token */
if (tok2) *tok2 = 0;
- if (!_tcsnicmp(tok, L"roomname=", 9) && *(tok + 9) != 0) {
+ if (!wcsnicmp(tok, L"roomname=", 9) && *(tok + 9) != 0) {
rm = mir_t2a(url_decode(tok + 9));
for (char *ch = rm; *ch; ++ch)
if (*ch == '+') *ch = ' ';
}
- if (!_tcsnicmp(tok, L"exchange=", 9))
- exchange = _ttoi(tok + 9);
+ if (!wcsnicmp(tok, L"exchange=", 9))
+ exchange = _wtoi(tok + 9);
}
if (rm == NULL || exchange <= 0) {
mir_free(rm);
diff --git a/protocols/AimOscar/src/popup.cpp b/protocols/AimOscar/src/popup.cpp
index 03b4fa8ba3..8747508724 100644
--- a/protocols/AimOscar/src/popup.cpp
+++ b/protocols/AimOscar/src/popup.cpp
@@ -71,7 +71,7 @@ void CAimProto::ShowPopup(const char* msg, int flags, char* url)
{
if (flags & TCHAR_POPUP)
{
- char* errmsg = mir_t2a((TCHAR*)msg);
+ char* errmsg = mir_t2a((wchar_t*)msg);
debugLogA(errmsg);
mir_free(errmsg);
}
@@ -79,8 +79,8 @@ void CAimProto::ShowPopup(const char* msg, int flags, char* url)
debugLogA(msg);
}
- TCHAR *msgt = (flags & TCHAR_POPUP) ? mir_tstrdup((TCHAR*)msg) : mir_a2t(msg);
- _tcsncpy_s(ppd.lptzText, TranslateTS(msgt), _TRUNCATE);
+ wchar_t *msgt = (flags & TCHAR_POPUP) ? mir_tstrdup((wchar_t*)msg) : mir_a2t(msg);
+ wcsncpy_s(ppd.lptzText, TranslateTS(msgt), _TRUNCATE);
mir_free(msgt);
if (!ServiceExists(MS_POPUP_ADDPOPUPT))
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp
index 67e1faa684..a198c04b63 100644
--- a/protocols/AimOscar/src/proto.cpp
+++ b/protocols/AimOscar/src/proto.cpp
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "stdafx.h"
-CAimProto::CAimProto(const char* aProtoName, const TCHAR* aUserName) :
+CAimProto::CAimProto(const char* aProtoName, const wchar_t* aUserName) :
PROTO<CAimProto>(aProtoName, aUserName),
m_chat_rooms(5)
{
@@ -46,7 +46,7 @@ CAimProto::CAimProto(const char* aProtoName, const TCHAR* aUserName) :
offline_contacts();
- TCHAR descr[MAX_PATH];
+ wchar_t descr[MAX_PATH];
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
@@ -122,7 +122,7 @@ MCONTACT CAimProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
if (m_state != 1)
return 0;
- TCHAR *id = psr->id.t ? psr->id.t : psr->nick.t;
+ wchar_t *id = psr->id.w ? psr->id.w : psr->nick.w;
char *sn = psr->flags & PSR_UNICODE ? mir_u2a((wchar_t*)id) : mir_strdup((char*)id);
MCONTACT hContact = contact_from_sn(sn, true, (flags & PALF_TEMPORARY) != 0);
mir_free(sn);
@@ -132,7 +132,7 @@ MCONTACT CAimProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
////////////////////////////////////////////////////////////////////////////////////////
// PSS_AUTHREQUEST
-int __cdecl CAimProto::AuthRequest(MCONTACT hContact, const TCHAR*)
+int __cdecl CAimProto::AuthRequest(MCONTACT hContact, const wchar_t*)
{
//Not a real authrequest- only used b/c we don't know the group until now.
if (m_state != 1)
@@ -151,7 +151,7 @@ int __cdecl CAimProto::AuthRequest(MCONTACT hContact, const TCHAR*)
////////////////////////////////////////////////////////////////////////////////////////
// FileAllow - starts a file transfer
-HANDLE __cdecl CAimProto::FileAllow(MCONTACT, HANDLE hTransfer, const TCHAR *szPath)
+HANDLE __cdecl CAimProto::FileAllow(MCONTACT, HANDLE hTransfer, const wchar_t *szPath)
{
file_transfer *ft = (file_transfer*)hTransfer;
if (ft && m_ft_list.find_by_ft(ft)) {
@@ -199,7 +199,7 @@ int __cdecl CAimProto::FileCancel(MCONTACT, HANDLE hTransfer)
////////////////////////////////////////////////////////////////////////////////////////
// FileDeny - denies a file transfer
-int __cdecl CAimProto::FileDeny(MCONTACT, HANDLE hTransfer, const TCHAR* /*szReason*/)
+int __cdecl CAimProto::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t* /*szReason*/)
{
file_transfer *ft = (file_transfer*)hTransfer;
if (!m_ft_list.find_by_ft(ft))
@@ -214,7 +214,7 @@ int __cdecl CAimProto::FileDeny(MCONTACT, HANDLE hTransfer, const TCHAR* /*szRea
////////////////////////////////////////////////////////////////////////////////////////
// FileResume - processes file renaming etc
-int __cdecl CAimProto::FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename)
+int __cdecl CAimProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename)
{
file_transfer *ft = (file_transfer*)hTransfer;
if (!m_ft_list.find_by_ft(ft))
@@ -224,7 +224,7 @@ int __cdecl CAimProto::FileResume(HANDLE hTransfer, int* action, const TCHAR** s
case FILERESUME_RESUME:
{
struct _stati64 statbuf;
- _tstati64(ft->pfts.tszCurrentFile, &statbuf);
+ _wstat64(ft->pfts.tszCurrentFile, &statbuf);
ft->pfts.currentFileProgress = statbuf.st_size;
}
break;
@@ -306,7 +306,7 @@ void __cdecl CAimProto::basic_search_ack_success(void *p)
else {
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
- psr.id.t = (TCHAR*)sn;
+ psr.id.w = (wchar_t*)sn;
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)& psr);
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)1, 0);
}
@@ -315,7 +315,7 @@ void __cdecl CAimProto::basic_search_ack_success(void *p)
mir_free(p);
}
-HANDLE __cdecl CAimProto::SearchBasic(const TCHAR *szId)
+HANDLE __cdecl CAimProto::SearchBasic(const wchar_t *szId)
{
if (m_state != 1)
return 0;
@@ -328,7 +328,7 @@ HANDLE __cdecl CAimProto::SearchBasic(const TCHAR *szId)
////////////////////////////////////////////////////////////////////////////////////////
// SearchByEmail - searches the contact by its e-mail
-HANDLE __cdecl CAimProto::SearchByEmail(const TCHAR *email)
+HANDLE __cdecl CAimProto::SearchByEmail(const wchar_t *email)
{
// Maximum email size should really be 320, but the char string is limited to 255.
if (m_state != 1 || email == NULL || mir_tstrlen(email) >= 254)
@@ -363,7 +363,7 @@ int __cdecl CAimProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT *pre)
////////////////////////////////////////////////////////////////////////////////////////
// SendFile - sends a file
-HANDLE __cdecl CAimProto::SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles)
+HANDLE __cdecl CAimProto::SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles)
{
if (m_state != 1)
return 0;
@@ -377,7 +377,7 @@ HANDLE __cdecl CAimProto::SendFile(MCONTACT hContact, const TCHAR* szDescription
int count = 0;
while (ppszFiles[count] != NULL) {
struct _stati64 statbuf;
- if (_tstati64(ppszFiles[count++], &statbuf) == 0) {
+ if (_wstat64(ppszFiles[count++], &statbuf) == 0) {
if (statbuf.st_mode & _S_IFDIR) {
if (ft->pfts.totalFiles == 0) isDir = true;
}
@@ -593,7 +593,7 @@ int __cdecl CAimProto::RecvAwayMsg(MCONTACT hContact, int, PROTORECVEVENT* pre)
////////////////////////////////////////////////////////////////////////////////////////
// SetAwayMsg - sets the away m_iStatus message
-int __cdecl CAimProto::SetAwayMsg(int status, const TCHAR* msg)
+int __cdecl CAimProto::SetAwayMsg(int status, const wchar_t* msg)
{
char **msgptr = get_status_msg_loc(status);
if (msgptr == NULL) return 1;
diff --git a/protocols/AimOscar/src/proto.h b/protocols/AimOscar/src/proto.h
index 7afb407100..79980483eb 100755
--- a/protocols/AimOscar/src/proto.h
+++ b/protocols/AimOscar/src/proto.h
@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
struct CAimProto : public PROTO<CAimProto>
{
- CAimProto(const char*, const TCHAR*);
+ CAimProto(const char*, const wchar_t*);
~CAimProto();
//====================================================================================
@@ -30,28 +30,28 @@ struct CAimProto : public PROTO<CAimProto>
virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
- virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage );
+ virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t* szMessage );
- virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath );
+ virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath );
virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer );
- virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason );
- virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const TCHAR** szFilename );
+ virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason );
+ virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const wchar_t** szFilename );
virtual DWORD_PTR __cdecl GetCaps( int type, MCONTACT hContact = NULL );
- virtual HANDLE __cdecl SearchBasic( const TCHAR* id );
- virtual HANDLE __cdecl SearchByEmail( const TCHAR* email );
+ virtual HANDLE __cdecl SearchBasic( const wchar_t* id );
+ virtual HANDLE __cdecl SearchByEmail( const wchar_t* email );
virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT* );
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles);
+ virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles);
virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg );
virtual int __cdecl SetStatus( int iNewStatus );
virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact );
virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt );
- virtual int __cdecl SetAwayMsg( int m_iStatus, const TCHAR* msg );
+ virtual int __cdecl SetAwayMsg( int m_iStatus, const wchar_t* msg );
virtual int __cdecl UserIsTyping(MCONTACT hContact, int type );
@@ -196,7 +196,7 @@ struct CAimProto : public PROTO<CAimProto>
void avatar_request_handler(MCONTACT hContact, char* hash, unsigned char type);
void avatar_retrieval_handler(const char* sn, const char* hash, const char* data, int data_len);
- int get_avatar_filename(MCONTACT hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext);
+ int get_avatar_filename(MCONTACT hContact, wchar_t* pszDest, size_t cbLen, const wchar_t *ext);
//////////////////////////////////////////////////////////////////////////////////////
// away.cpp
@@ -217,7 +217,7 @@ struct CAimProto : public PROTO<CAimProto>
void chat_register(void);
void chat_start(const char* id, unsigned short exchange);
- void chat_event(const char* id, const char* sn, int evt, const TCHAR* msg = NULL);
+ void chat_event(const char* id, const char* sn, int evt, const wchar_t* msg = NULL);
void chat_leave(const char* id);
chat_list_item* find_chat_by_cid(unsigned short cid);
@@ -321,7 +321,7 @@ struct CAimProto : public PROTO<CAimProto>
int sending_file(file_transfer *ft, HANDLE hServerPacketRecver, NETLIBPACKETRECVER &packetRecv);
int receiving_file(file_transfer *ft, HANDLE hServerPacketRecver, NETLIBPACKETRECVER &packetRecv);
- void report_file_error(TCHAR* fname);
+ void report_file_error(wchar_t* fname);
void shutdown_file_transfers(void);
//////////////////////////////////////////////////////////////////////////////////////
@@ -413,7 +413,7 @@ struct CAimProto : public PROTO<CAimProto>
void offline_contact(MCONTACT hContact, bool remove_settings);
unsigned short get_default_port(void);
- int open_contact_file(const char* sn, const TCHAR* file, const char* mode, TCHAR* &path, bool contact_dir);
+ int open_contact_file(const char* sn, const wchar_t* file, const char* mode, wchar_t* &path, bool contact_dir);
void write_away_message(const char* sn, const char* msg, bool utf);
void write_profile(const char* sn, const char* msg, bool utf);
diff --git a/protocols/AimOscar/src/server.cpp b/protocols/AimOscar/src/server.cpp
index fa297a5664..34bc6151e2 100644
--- a/protocols/AimOscar/src/server.cpp
+++ b/protocols/AimOscar/src/server.cpp
@@ -487,7 +487,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003
char* msg_s = process_status_msg(msg, sn);
db_set_utf(hContact, MOD_KEY_CL, OTH_KEY_SM, msg_s);
- TCHAR* tszMsg = mir_utf8decodeT(msg_s);
+ wchar_t* tszMsg = mir_utf8decodeT(msg_s);
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, NULL, (LPARAM)tszMsg);
mir_free(tszMsg);
mir_free(msg);
@@ -1247,18 +1247,18 @@ void CAimProto::snac_received_message(SNAC &snac, HANDLE hServerConn, unsigned s
if (!descr_included) msg_buf = NULL;
- TCHAR* filenameT = mir_utf8decodeT(filename);
+ wchar_t* filenameT = mir_utf8decodeT(filename);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
pre.fileCount = 1;
pre.timestamp = time(NULL);
- pre.descr.t = mir_utf8decodeT(msg_buf);
- pre.files.t = &filenameT;
+ pre.descr.w = mir_utf8decodeT(msg_buf);
+ pre.files.w = &filenameT;
pre.lParam = (LPARAM)ft;
ProtoChainRecvFile(hContact, &pre);
- mir_free(pre.descr.t);
+ mir_free(pre.descr.w);
mir_free(filenameT);
char cip[20];
@@ -1659,7 +1659,7 @@ void CAimProto::snac_mail_response(SNAC &snac)//family 0x0018
position += TLV_HEADER_SIZE + tlv.len();
}
if (new_mail && num_msgs) {
- TCHAR msg[1024];
+ wchar_t msg[1024];
int len = mir_sntprintf(msg, L"%S@%S (%d)\r\n%s ", sn, address, num_msgs,
TranslateT("You've got mail! Checked at"));
@@ -1733,10 +1733,10 @@ void CAimProto::snac_email_search_results(SNAC &snac)//family 0x000A
while (offset < snac.len()) { // Loop through all the TLVs and pull out the buddy name
TLV tlv(snac.val(offset));
offset += TLV_HEADER_SIZE;
- psr.id.t = (TCHAR*)tlv.dup();
+ psr.id.w = (wchar_t*)tlv.dup();
offset += tlv.len();
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)& psr);
- mir_free(psr.nick.t);
+ mir_free(psr.nick.w);
}
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)1, 0);
}
@@ -1834,7 +1834,7 @@ void CAimProto::snac_chat_joined_left_users(SNAC &snac, chat_list_item* item)//f
void CAimProto::snac_chat_received_message(SNAC &snac, chat_list_item* item)//family 0x000E
{
if (snac.subcmp(0x0006)) {
- TCHAR* message = NULL;
+ wchar_t* message = NULL;
char* sn = NULL;
// unsigned long cookie = snac.ulong(0);
diff --git a/protocols/AimOscar/src/services.cpp b/protocols/AimOscar/src/services.cpp
index c4be0f3401..c108139a3e 100644
--- a/protocols/AimOscar/src/services.cpp
+++ b/protocols/AimOscar/src/services.cpp
@@ -392,14 +392,14 @@ INT_PTR CAimProto::GetAvatarCaps(WPARAM wParam, LPARAM lParam)
INT_PTR CAimProto::GetAvatar(WPARAM wParam, LPARAM lParam)
{
- TCHAR* buf = (TCHAR*)wParam;
+ wchar_t* buf = (wchar_t*)wParam;
size_t size = (size_t)lParam;
if (buf == NULL || size <= 0)
return -1;
PROTO_AVATAR_INFORMATION ai = { 0 };
if (GetAvatarInfo(0, (LPARAM)&ai) == GAIR_SUCCESS) {
- _tcsncpy_s(buf, size, ai.filename, _TRUNCATE);
+ wcsncpy_s(buf, size, ai.filename, _TRUNCATE);
return 0;
}
@@ -408,7 +408,7 @@ INT_PTR CAimProto::GetAvatar(WPARAM wParam, LPARAM lParam)
INT_PTR CAimProto::SetAvatar(WPARAM, LPARAM lParam)
{
- TCHAR *szFileName = (TCHAR*)lParam;
+ wchar_t *szFileName = (wchar_t*)lParam;
if (m_state != 1)
return 1;
@@ -461,10 +461,10 @@ INT_PTR CAimProto::SetAvatar(WPARAM, LPARAM lParam)
avatar_up_req *req = new avatar_up_req(data, size, data1, size1);
ForkThread(&CAimProto::avatar_upload_thread, req);
- TCHAR tFileName[MAX_PATH];
- TCHAR *ext = _tcsrchr(szFileName, '.');
+ wchar_t tFileName[MAX_PATH];
+ wchar_t *ext = wcsrchr(szFileName, '.');
get_avatar_filename(NULL, tFileName, _countof(tFileName), ext);
- int fileId = _topen(tFileName, _O_CREAT | _O_TRUNC | _O_WRONLY | O_BINARY, _S_IREAD | _S_IWRITE);
+ int fileId = _wopen(tFileName, _O_CREAT | _O_TRUNC | _O_WRONLY | O_BINARY, _S_IREAD | _S_IWRITE);
if (fileId < 0) {
char errmsg[512];
mir_snprintf(errmsg, "Cannot store avatar. File '%s' could not be created/overwritten", tFileName);
diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp
index 134011214f..ab6c8a80ad 100644
--- a/protocols/AimOscar/src/theme.cpp
+++ b/protocols/AimOscar/src/theme.cpp
@@ -179,19 +179,19 @@ int CAimProto::OnPreBuildContactMenu(WPARAM hContact, LPARAM)
switch (m_pd_mode) {
case 1:
- Menu_ModifyItem(m_hBlockContextMenuItem, LPGENT("&Block"));
+ Menu_ModifyItem(m_hBlockContextMenuItem, LPGENW("&Block"));
break;
case 2:
- Menu_ModifyItem(m_hBlockContextMenuItem, LPGENT("&Unblock"));
+ Menu_ModifyItem(m_hBlockContextMenuItem, LPGENW("&Unblock"));
break;
case 3:
- Menu_ModifyItem(m_hBlockContextMenuItem, m_allow_list.find_id(id) ? LPGENT("&Block") : LPGENT("&Unblock"));
+ Menu_ModifyItem(m_hBlockContextMenuItem, m_allow_list.find_id(id) ? LPGENW("&Block") : LPGENW("&Unblock"));
break;
case 4:
- Menu_ModifyItem(m_hBlockContextMenuItem, m_block_list.find_id(id) ? LPGENT("&Unblock") : LPGENT("&Block"));
+ Menu_ModifyItem(m_hBlockContextMenuItem, m_block_list.find_id(id) ? LPGENW("&Unblock") : LPGENW("&Block"));
break;
default:
diff --git a/protocols/AimOscar/src/ui.cpp b/protocols/AimOscar/src/ui.cpp
index 2b906bc355..ee833e6eee 100755
--- a/protocols/AimOscar/src/ui.cpp
+++ b/protocols/AimOscar/src/ui.cpp
@@ -190,7 +190,7 @@ static INT_PTR CALLBACK userinfo_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, L
DBVARIANT dbv;
if (!db_get_utf(NULL, ppro->m_szModuleName, AIM_KEY_PR, &dbv)) {
html_decode(dbv.pszVal);
- TCHAR *txt = mir_utf8decodeT(dbv.pszVal);
+ wchar_t *txt = mir_utf8decodeT(dbv.pszVal);
SetDlgItemText(hwndDlg, IDC_PROFILE, txt);
mir_free(txt);
db_free(&dbv);
@@ -685,15 +685,15 @@ int CAimProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam)
odp.position = -1900000000;
odp.flags = ODPF_USERINFOTAB | ODPF_TCHAR;
odp.hInstance = hInstance;
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
odp.dwInitParam = LPARAM(this);
- odp.ptszTab = LPGENT("Profile");
+ odp.pwszTab = LPGENW("Profile");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO);
odp.pfnDlgProc = userinfo_dialog;
UserInfo_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Admin");
+ odp.pwszTab = LPGENW("Admin");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_ADMIN);
odp.pfnDlgProc = admin_dialog;
UserInfo_AddPage(wParam, &odp);
@@ -1058,17 +1058,17 @@ int CAimProto::OnOptionsInit(WPARAM wParam, LPARAM)
OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 1003000;
odp.hInstance = hInstance;
- odp.ptszGroup = LPGENT("Network");
- odp.ptszTitle = m_tszUserName;
+ odp.pwszGroup = LPGENW("Network");
+ odp.pwszTitle = m_tszUserName;
odp.dwInitParam = LPARAM(this);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.ptszTab = LPGENT("Basic");
+ odp.pwszTab = LPGENW("Basic");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_AIM);
odp.pfnDlgProc = options_dialog;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Privacy");
+ odp.pwszTab = LPGENW("Privacy");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_PRIVACY);
odp.pfnDlgProc = privacy_dialog;
Options_AddPage(wParam, &odp);
@@ -1267,7 +1267,7 @@ static void clist_chat_invite_send(MCONTACT hItem, HWND hwndList, chat_list_item
int chk = SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0);
if (chk) {
if (IsHContactInfo(hItem)) {
- TCHAR buf[128] = L"";
+ wchar_t buf[128] = L"";
SendMessage(hwndList, CLM_GETITEMTEXT, (WPARAM)hItem, (LPARAM)buf);
char *sn = mir_t2a(buf);
@@ -1364,7 +1364,7 @@ INT_PTR CALLBACK invite_to_chat_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LP
switch (LOWORD(wParam)) {
case IDC_ADDSCR:
if (param->ppro->m_state == 1) {
- TCHAR sn[64];
+ wchar_t sn[64];
GetDlgItemText(hwndDlg, IDC_EDITSCR, sn, _countof(sn));
CLCINFOITEM cii = { 0 };
diff --git a/protocols/AimOscar/src/utility.cpp b/protocols/AimOscar/src/utility.cpp
index b5e23b21aa..247d8bd3fa 100755
--- a/protocols/AimOscar/src/utility.cpp
+++ b/protocols/AimOscar/src/utility.cpp
@@ -363,7 +363,7 @@ void create_group(const char *group)
{
if (mir_strcmp(group, AIM_DEFAULT_GROUP) == 0) return;
- TCHAR* szGroupName = mir_utf8decodeT(group);
+ wchar_t* szGroupName = mir_utf8decodeT(group);
Clist_GroupCreate(0, szGroupName);
mir_free(szGroupName);
}
@@ -529,21 +529,21 @@ int CAimProto::deleteGroupId(MCONTACT hContact, int i)
/////////////////////////////////////////////////////////////////////////////////////////
-int CAimProto::open_contact_file(const char*, const TCHAR* file, const char*, TCHAR* &path, bool contact_dir)
+int CAimProto::open_contact_file(const char*, const wchar_t* file, const char*, wchar_t* &path, bool contact_dir)
{
- path = (TCHAR*)mir_alloc(MAX_PATH * sizeof(TCHAR));
+ path = (wchar_t*)mir_alloc(MAX_PATH * sizeof(wchar_t));
int pos = mir_sntprintf(path, MAX_PATH, L"%s\\%S", VARST(L"%miranda_userdata%"), m_szModuleName);
if (contact_dir)
pos += mir_sntprintf(path + pos, MAX_PATH - pos, L"\\%S", m_szModuleName);
- if (_taccess(path, 0))
+ if (_waccess(path, 0))
CreateDirectoryTreeT(path);
mir_sntprintf(path + pos, MAX_PATH - pos, L"\\%s", file);
- int fid = _topen(path, _O_CREAT | _O_RDWR | _O_BINARY, _S_IREAD);
+ int fid = _wopen(path, _O_CREAT | _O_RDWR | _O_BINARY, _S_IREAD);
if (fid < 0) {
- TCHAR errmsg[512];
+ wchar_t errmsg[512];
mir_sntprintf(errmsg, TranslateT("Failed to open file: %s %s"), path, __tcserror(NULL));
ShowPopup((char*)errmsg, ERROR_POPUP | TCHAR_POPUP);
}
@@ -552,7 +552,7 @@ int CAimProto::open_contact_file(const char*, const TCHAR* file, const char*, TC
void CAimProto::write_away_message(const char* sn, const char* msg, bool utf)
{
- TCHAR* path;
+ wchar_t* path;
int fid = open_contact_file(sn, L"away.html", "wb", path, 1);
if (fid >= 0) {
if (utf) _write(fid, "\xEF\xBB\xBF", 3);
@@ -570,7 +570,7 @@ void CAimProto::write_away_message(const char* sn, const char* msg, bool utf)
void CAimProto::write_profile(const char* sn, const char* msg, bool utf)
{
- TCHAR* path;
+ wchar_t* path;
int fid = open_contact_file(sn, L"profile.html", "wb", path, 1);
if (fid >= 0) {
if (utf) _write(fid, "\xEF\xBB\xBF", 3);
@@ -604,10 +604,10 @@ unsigned long aim_oft_checksum_chunk(unsigned long dwChecksum, const unsigned ch
return checksum << 16;
}
-unsigned int aim_oft_checksum_file(TCHAR *filename, unsigned __int64 size)
+unsigned int aim_oft_checksum_file(wchar_t *filename, unsigned __int64 size)
{
unsigned long checksum = 0xffff0000;
- int fid = _topen(filename, _O_RDONLY | _O_BINARY, _S_IREAD);
+ int fid = _wopen(filename, _O_RDONLY | _O_BINARY, _S_IREAD);
if (fid >= 0) {
unsigned __int64 sz = _filelengthi64(fid);
if (size > sz) size = sz;
diff --git a/protocols/AimOscar/src/utility.h b/protocols/AimOscar/src/utility.h
index 6b8404ea00..17d50af9e1 100755
--- a/protocols/AimOscar/src/utility.h
+++ b/protocols/AimOscar/src/utility.h
@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
char *normalize_name(const char *s);
char* trim_str(char* s);
void create_group(const char *group);
-unsigned int aim_oft_checksum_file(TCHAR *filename, unsigned __int64 size = -1);
+unsigned int aim_oft_checksum_file(wchar_t *filename, unsigned __int64 size = -1);
char* long_ip_to_char_ip(unsigned long host, char* ip);
unsigned long char_ip_to_long_ip(char* ip);
unsigned short get_random(void);
diff --git a/protocols/Dummy/src/dummy_proto.cpp b/protocols/Dummy/src/dummy_proto.cpp
index 533b137199..11643b57b3 100644
--- a/protocols/Dummy/src/dummy_proto.cpp
+++ b/protocols/Dummy/src/dummy_proto.cpp
@@ -39,7 +39,7 @@ void CDummyProto::SearchIdAckThread(void *targ)
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
psr.flags = PSR_TCHAR;
- psr.id.t = (TCHAR*)targ;
+ psr.id.w = (wchar_t*)targ;
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, targ, (LPARAM)&psr);
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, targ, 0);
@@ -54,7 +54,7 @@ static int sttCompareProtocols(const CDummyProto *p1, const CDummyProto *p2)
LIST<CDummyProto> dummy_Instances(1, sttCompareProtocols);
-CDummyProto::CDummyProto(const char *szModuleName, const TCHAR *ptszUserName) :
+CDummyProto::CDummyProto(const char *szModuleName, const wchar_t *ptszUserName) :
PROTO<CDummyProto>(szModuleName, ptszUserName)
{
CreateProtoService(PS_CREATEACCMGRUI, &CDummyProto::SvcCreateAccMgrUI);
@@ -142,19 +142,19 @@ int CDummyProto::SetStatus(int)
return 0;
}
-HANDLE CDummyProto::SearchBasic(const TCHAR* id)
+HANDLE CDummyProto::SearchBasic(const wchar_t* id)
{
if (uniqueIdSetting[0] == '\0')
return 0;
- TCHAR *tid = mir_tstrdup(id);
+ wchar_t *tid = mir_tstrdup(id);
ForkThread(&CDummyProto::SearchIdAckThread, tid);
return tid;
}
MCONTACT CDummyProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
{
- if (psr->id.t == NULL)
+ if (psr->id.w == NULL)
return NULL;
MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD);
@@ -173,8 +173,8 @@ MCONTACT CDummyProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
db_unset(hContact, "CList", "Hidden");
db_unset(hContact, "CList", "NotOnList");
}
- setTString(hContact, uniqueIdSetting, psr->id.t);
- setTString(hContact, "Nick", psr->id.t);
+ setTString(hContact, uniqueIdSetting, psr->id.w);
+ setTString(hContact, "Nick", psr->id.w);
}
return hContact;
diff --git a/protocols/Dummy/src/dummy_proto.h b/protocols/Dummy/src/dummy_proto.h
index d2da9b0d61..2543c949da 100644
--- a/protocols/Dummy/src/dummy_proto.h
+++ b/protocols/Dummy/src/dummy_proto.h
@@ -19,7 +19,7 @@ struct CDummyProto;
struct CDummyProto : public PROTO<CDummyProto>
{
- CDummyProto(const char*, const TCHAR*);
+ CDummyProto(const char*, const wchar_t*);
~CDummyProto();
//====================================================================================
@@ -32,7 +32,7 @@ struct CDummyProto : public PROTO<CDummyProto>
virtual int __cdecl SetStatus(int iNewStatus);
- virtual HANDLE __cdecl SearchBasic(const TCHAR* id);
+ virtual HANDLE __cdecl SearchBasic(const wchar_t* id);
virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
diff --git a/protocols/Dummy/src/main.cpp b/protocols/Dummy/src/main.cpp
index 87b112e219..8eff3f47ae 100644
--- a/protocols/Dummy/src/main.cpp
+++ b/protocols/Dummy/src/main.cpp
@@ -63,7 +63,7 @@ static int OnModulesLoaded(WPARAM, LPARAM)
/////////////////////////////////////////////////////////////////////////////////////////
// OnLoad - initialize the plugin instance
-static CDummyProto* dummyProtoInit(const char* pszProtoName, const TCHAR *tszUserName)
+static CDummyProto* dummyProtoInit(const char* pszProtoName, const wchar_t *tszUserName)
{
CDummyProto *ppro = new CDummyProto(pszProtoName, tszUserName);
return ppro;
diff --git a/protocols/Dummy/src/stdafx.h b/protocols/Dummy/src/stdafx.h
index 305d636215..a28d1fd992 100644
--- a/protocols/Dummy/src/stdafx.h
+++ b/protocols/Dummy/src/stdafx.h
@@ -23,7 +23,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdio.h>
#include <malloc.h>
-#include <tchar.h>
#include <time.h>
#include <newpluginapi.h>
diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp
index daccd9332f..1ba95f8429 100644
--- a/protocols/EmLanProto/src/mlan.cpp
+++ b/protocols/EmLanProto/src/mlan.cpp
@@ -404,7 +404,7 @@ INT_PTR CMLan::AddToContactList(u_int flags, EMPSEARCHRESULT *psr)
bool TempAdd = flags&PALF_TEMPORARY;
- MCONTACT contact = FindContact(addr, psr->nick.t, true, !TempAdd, !TempAdd, psr->stat);
+ MCONTACT contact = FindContact(addr, psr->nick.a, true, !TempAdd, !TempAdd, psr->stat);
if (contact != NULL) {
db_set_w(contact, PROTONAME, "Status", psr->stat);
db_set_w(contact, PROTONAME, "RemoteVersion", psr->ver);
@@ -483,10 +483,10 @@ void CMLan::SearchExt(TDataHolder* hold)
size_t len = mir_tstrlen(buf);
buf[len] = '@';
mir_tstrcpy(buf + len + 1, inet_ntoa(cont->m_addr));
- psr.nick.t = cont->m_nick;
- psr.firstName.t = "";
- psr.lastName.t = "";
- psr.email.t = buf;
+ psr.nick.a = cont->m_nick;
+ psr.firstName.a = "";
+ psr.lastName.a = "";
+ psr.email.a = buf;
psr.ipaddr = cont->m_addr.S_un.S_addr;
psr.stat = cont->m_status;
psr.ver = cont->m_ver;
diff --git a/protocols/FacebookRM/src/avatars.cpp b/protocols/FacebookRM/src/avatars.cpp
index b85699b520..c41c7026d5 100644
--- a/protocols/FacebookRM/src/avatars.cpp
+++ b/protocols/FacebookRM/src/avatars.cpp
@@ -33,19 +33,19 @@ bool FacebookProto::GetDbAvatarInfo(PROTO_AVATAR_INFORMATION &pai, std::string *
utils::text::replace_first(url, "%s", std::string(id));
}
- std::tstring filename = GetAvatarFolder() + _T('\\') + std::tstring(_A2T(id)) + L".jpg";
+ std::wstring filename = GetAvatarFolder() + L'\\' + std::wstring(_A2T(id)) + L".jpg";
- _tcsncpy_s(pai.filename, filename.c_str(), _TRUNCATE);
+ wcsncpy_s(pai.filename, filename.c_str(), _TRUNCATE);
pai.format = ProtoGetAvatarFormat(pai.filename);
return true;
}
void FacebookProto::CheckAvatarChange(MCONTACT hContact, const std::string &image_url)
{
- std::tstring::size_type pos = image_url.rfind("/");
+ std::wstring::size_type pos = image_url.rfind("/");
// Facebook contacts always have some avatar - keep avatar in database even if we have loaded empty one (e.g. for 'On Mobile' contacts)
- if (image_url.empty() || pos == std::tstring::npos)
+ if (image_url.empty() || pos == std::wstring::npos)
return;
// Get name of image
@@ -53,7 +53,7 @@ void FacebookProto::CheckAvatarChange(MCONTACT hContact, const std::string &imag
// Remove eventual parameters from name
pos = image_name.rfind("?");
- if (pos != std::tstring::npos)
+ if (pos != std::wstring::npos)
image_name = image_name.substr(0, pos);
// Append our parameters to allow comparing for avatar/settings change
@@ -123,9 +123,9 @@ void FacebookProto::UpdateAvatarWorker(void *)
Netlib_CloseHandle(nlc);
}
-std::tstring FacebookProto::GetAvatarFolder()
+std::wstring FacebookProto::GetAvatarFolder()
{
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
mir_sntprintf(path, L"%s\\%s", VARST(L"%miranda_avatarcache%"), m_tszUserName);
return path;
}
@@ -180,7 +180,7 @@ INT_PTR FacebookProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
PROTO_AVATAR_INFORMATION* pai = (PROTO_AVATAR_INFORMATION*)lParam;
if (GetDbAvatarInfo(*pai, NULL))
{
- bool fileExist = _taccess(pai->filename, 0) == 0;
+ bool fileExist = _waccess(pai->filename, 0) == 0;
bool needLoad;
if (pai->hContact)
@@ -216,13 +216,13 @@ INT_PTR FacebookProto::GetMyAvatar(WPARAM wParam, LPARAM lParam)
if (!wParam || !lParam)
return -3;
- TCHAR* buf = (TCHAR*)wParam;
+ wchar_t* buf = (wchar_t*)wParam;
int size = (int)lParam;
PROTO_AVATAR_INFORMATION ai = { 0 };
switch (GetAvatarInfo(0, (LPARAM)&ai)) {
case GAIR_SUCCESS:
- _tcsncpy(buf, ai.filename, size);
+ wcsncpy(buf, ai.filename, size);
buf[size - 1] = 0;
return 0;
diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp
index a5a94c2d06..9901e6896e 100644
--- a/protocols/FacebookRM/src/chat.cpp
+++ b/protocols/FacebookRM/src/chat.cpp
@@ -244,7 +244,7 @@ bool FacebookProto::IsChatContact(const char *chat_id, const char *id)
return (users != NULL && strstr(users, id) != NULL);
}
-void FacebookProto::AddChat(const char *id, const TCHAR *tname)
+void FacebookProto::AddChat(const char *id, const wchar_t *tname)
{
ptrT tid(mir_a2t(id));
@@ -377,8 +377,8 @@ int FacebookProto::OnGCMenuHook(WPARAM, LPARAM lParam)
{
static const struct gc_item Items[] =
{
- { LPGENT("&Invite user..."), 10, MENU_ITEM, FALSE },
- { LPGENT("&Leave chat session"), 20, MENU_ITEM, FALSE }
+ { LPGENW("&Invite user..."), 10, MENU_ITEM, FALSE },
+ { LPGENW("&Leave chat session"), 20, MENU_ITEM, FALSE }
};
gcmi->nItems = _countof(Items);
gcmi->Item = (gc_item*)Items;
@@ -389,10 +389,10 @@ int FacebookProto::OnGCMenuHook(WPARAM, LPARAM lParam)
{
/*static const struct gc_item Items[] =
{
- { LPGENT("User &details"), 10, MENU_ITEM, FALSE },
- { LPGENT("User &history"), 20, MENU_ITEM, FALSE },
+ { LPGENW("User &details"), 10, MENU_ITEM, FALSE },
+ { LPGENW("User &history"), 20, MENU_ITEM, FALSE },
{ L"", 100, MENU_SEPARATOR, FALSE },
- { LPGENT("&Leave chat session"), 110, MENU_ITEM, FALSE }
+ { LPGENW("&Leave chat session"), 110, MENU_ITEM, FALSE }
};
gcmi->nItems = _countof(Items);
gcmi->Item = (gc_item*)Items;*/
@@ -403,8 +403,8 @@ int FacebookProto::OnGCMenuHook(WPARAM, LPARAM lParam)
{
static const struct gc_item Items[] =
{
- { LPGENT("User &details"), 10, MENU_ITEM, FALSE },
- { LPGENT("User &history"), 20, MENU_ITEM, FALSE }
+ { LPGENW("User &details"), 10, MENU_ITEM, FALSE },
+ { LPGENW("User &history"), 20, MENU_ITEM, FALSE }
};
gcmi->nItems = _countof(Items);
gcmi->Item = (gc_item*)Items;
@@ -429,7 +429,7 @@ void FacebookProto::PrepareNotificationsChatRoom() {
// Prepare notifications chatroom if not exists
MCONTACT hNotificationsChatRoom = ChatIDToHContact(FACEBOOK_NOTIFICATIONS_CHATROOM);
if (hNotificationsChatRoom == NULL || getDword(hNotificationsChatRoom, "Status", ID_STATUS_OFFLINE) != ID_STATUS_ONLINE) {
- TCHAR nameT[200];
+ wchar_t nameT[200];
mir_sntprintf(nameT, L"%s: %s", m_tszUserName, TranslateT("Notifications"));
// Create the group chat session
diff --git a/protocols/FacebookRM/src/client.h b/protocols/FacebookRM/src/client.h
index f065893af7..7df4d7a4d3 100644
--- a/protocols/FacebookRM/src/client.h
+++ b/protocols/FacebookRM/src/client.h
@@ -93,7 +93,7 @@ public:
// Client vs protocol communication
- void client_notify(TCHAR* message);
+ void client_notify(wchar_t* message);
////////////////////////////////////////////////////////////
@@ -209,7 +209,7 @@ public:
// HTTP communication
http::response flap(RequestType request_type, std::string *post_data = NULL, std::string *get_data = NULL);
- bool save_url(const std::string &url,const std::tstring &filename, HANDLE &nlc);
+ bool save_url(const std::string &url,const std::wstring &filename, HANDLE &nlc);
bool notify_errors(RequestType);
std::string choose_server(RequestType);
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp
index 486bc08696..cfbae1cbc9 100644
--- a/protocols/FacebookRM/src/communication.cpp
+++ b/protocols/FacebookRM/src/communication.cpp
@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-void facebook_client::client_notify(TCHAR* message)
+void facebook_client::client_notify(wchar_t* message)
{
parent->NotifyEvent(parent->m_tszUserName, message, NULL, FACEBOOK_EVENT_CLIENT);
}
@@ -723,13 +723,13 @@ void facebook_client::insert_reader(MCONTACT hContact, time_t timestamp, const s
}
}
- std::tstring treaderName = _A2T(name.c_str(), CP_UTF8);
- std::tstring treaders;
+ std::wstring treaderName = _A2T(name.c_str(), CP_UTF8);
+ std::wstring treaders;
// Load old readers
ptrT told(parent->getTStringA(hContact, FACEBOOK_KEY_MESSAGE_READERS));
if (told)
- treaders = std::tstring(told) + L", ";
+ treaders = std::wstring(told) + L", ";
// Append new reader name and remember them
treaders += utils::text::prepare_name(treaderName, true);
@@ -771,7 +771,7 @@ void loginError(FacebookProto *proto, std::string error_str) {
proto->debugLogA("!!! Login error: %s", !error_str.empty() ? error_str.c_str() : "Unknown error");
- TCHAR buf[200];
+ wchar_t buf[200];
mir_sntprintf(buf, TranslateT("Login error: %s"),
(error_str.empty()) ? TranslateT("Unknown error") : ptrT(mir_utf8decodeT(error_str.c_str())));
proto->facy.client_notify(buf);
@@ -1664,7 +1664,7 @@ bool facebook_client::post_status(status_data *status)
//////////////////////////////////////////////////////////////////////////////
-bool facebook_client::save_url(const std::string &url, const std::tstring &filename, HANDLE &nlc)
+bool facebook_client::save_url(const std::string &url, const std::wstring &filename, HANDLE &nlc)
{
NETLIBHTTPREQUEST req = { sizeof(req) };
NETLIBHTTPREQUEST *resp;
@@ -1683,17 +1683,17 @@ bool facebook_client::save_url(const std::string &url, const std::tstring &filen
parent->debugLogA("@@@ Saving URL %s to file %s", url.c_str(), _T2A(filename.c_str()));
// Create folder if necessary
- std::tstring dir = filename.substr(0, filename.rfind('\\'));
- if (_taccess(dir.c_str(), 0))
+ std::wstring dir = filename.substr(0, filename.rfind('\\'));
+ if (_waccess(dir.c_str(), 0))
CreateDirectoryTreeT(dir.c_str());
// Write to file
- FILE *f = _tfopen(filename.c_str(), L"wb");
+ FILE *f = _wfopen(filename.c_str(), L"wb");
if (f != NULL) {
fwrite(resp->pData, 1, resp->dataLength, f);
fclose(f);
- ret = _taccess(filename.c_str(), 0) == 0;
+ ret = _waccess(filename.c_str(), 0) == 0;
}
CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)resp);
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp
index 92e547a4a4..028c2a918f 100644
--- a/protocols/FacebookRM/src/contacts.cpp
+++ b/protocols/FacebookRM/src/contacts.cpp
@@ -400,7 +400,7 @@ void FacebookProto::LoadChatInfo(facebook_chatroom *fbc)
if (namesUsed > 0)
fbc->chat_name += L", ";
- std::tstring tname = _A2T(participant.c_str(), CP_UTF8);
+ std::wstring tname = _A2T(participant.c_str(), CP_UTF8);
fbc->chat_name += utils::text::prepare_name(tname, false);
if (++namesUsed >= FACEBOOK_CHATROOM_NAMES_COUNT)
@@ -408,14 +408,14 @@ void FacebookProto::LoadChatInfo(facebook_chatroom *fbc)
}
if (fbc->participants.size() > namesUsed) {
- TCHAR more[200];
+ wchar_t more[200];
mir_sntprintf(more, TranslateT("%s and more (%d)"), fbc->chat_name.c_str(), fbc->participants.size() - namesUsed);
fbc->chat_name = more;
}
// If there are no participants to create a name from, use just thread_id
if (fbc->chat_name.empty())
- fbc->chat_name = std::tstring(_A2T(fbc->thread_id.c_str())); // TODO: is this needed? Isn't it showed automatically as id if there is no name?
+ fbc->chat_name = std::wstring(_A2T(fbc->thread_id.c_str())); // TODO: is this needed? Isn't it showed automatically as id if there is no name?
}
debugLogA("*** Chat thread info processed");
diff --git a/protocols/FacebookRM/src/dialogs.cpp b/protocols/FacebookRM/src/dialogs.cpp
index 2f349531ff..75aa98da3b 100644
--- a/protocols/FacebookRM/src/dialogs.cpp
+++ b/protocols/FacebookRM/src/dialogs.cpp
@@ -272,9 +272,9 @@ INT_PTR CALLBACK FBMindProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpara
{
data = reinterpret_cast<post_status_data*>(GetWindowLongPtr(hwnd, GWLP_USERDATA));
- TCHAR mindMessageT[FACEBOOK_MIND_LIMIT + 1];
- TCHAR urlT[1024];
- TCHAR placeT[100];
+ wchar_t mindMessageT[FACEBOOK_MIND_LIMIT + 1];
+ wchar_t urlT[1024];
+ wchar_t placeT[100];
GetDlgItemText(hwnd, IDC_MINDMSG, mindMessageT, _countof(mindMessageT));
GetDlgItemText(hwnd, IDC_PLACE, placeT, _countof(placeT));
@@ -394,7 +394,7 @@ INT_PTR CALLBACK FBOptionsProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
case WM_NOTIFY:
if (reinterpret_cast<NMHDR*>(lparam)->code == PSN_APPLY)
{
- char str[128]; TCHAR tstr[128];
+ char str[128]; wchar_t tstr[128];
GetDlgItemTextA(hwnd, IDC_UN, str, _countof(str));
db_set_s(0, proto->ModuleName(), FACEBOOK_KEY_LOGIN, str);
diff --git a/protocols/FacebookRM/src/entities.h b/protocols/FacebookRM/src/entities.h
index a70757e1c3..43c8f18f86 100644
--- a/protocols/FacebookRM/src/entities.h
+++ b/protocols/FacebookRM/src/entities.h
@@ -55,7 +55,7 @@ struct facebook_user
this->type = CONTACT_NONE;
}
- TCHAR *getMirVer()
+ wchar_t *getMirVer()
{
switch (this->client) {
case CLIENT_APP:
@@ -87,7 +87,7 @@ struct chatroom_participant
struct facebook_chatroom
{
std::string thread_id;
- std::tstring chat_name;
+ std::wstring chat_name;
std::map<std::string, chatroom_participant> participants;
bool can_reply;
bool is_archived;
@@ -219,9 +219,9 @@ struct wall_data
this->title = NULL;
this->isPage = false;
}
- wall_data(std::string user_id, TCHAR *title, bool isPage = false) : user_id(user_id), title(title), isPage(isPage) {}
+ wall_data(std::string user_id, wchar_t *title, bool isPage = false) : user_id(user_id), title(title), isPage(isPage) {}
std::string user_id;
- TCHAR *title;
+ wchar_t *title;
bool isPage;
};
@@ -236,7 +236,7 @@ struct post_status_data {
struct open_url
{
- open_url(TCHAR *browser, TCHAR *url) : browser(browser), url(url) {}
- TCHAR *browser;
- TCHAR *url;
+ open_url(wchar_t *browser, wchar_t *url) : browser(browser), url(url) {}
+ wchar_t *browser;
+ wchar_t *url;
};
diff --git a/protocols/FacebookRM/src/events.cpp b/protocols/FacebookRM/src/events.cpp
index 0fc052b563..660b2424f5 100644
--- a/protocols/FacebookRM/src/events.cpp
+++ b/protocols/FacebookRM/src/events.cpp
@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-HWND FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, MCONTACT contact, DWORD flags, std::string *url, std::string *notification_id, const char *icon)
+HWND FacebookProto::NotifyEvent(wchar_t* title, wchar_t* info, MCONTACT contact, DWORD flags, std::string *url, std::string *notification_id, const char *icon)
{
if (title == NULL || info == NULL)
return NULL;
@@ -83,8 +83,8 @@ HWND FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, MCONTACT contact, DWO
}*/
POPUPDATACLASS pd = { sizeof(pd) };
- pd.ptszTitle = title;
- pd.ptszText = info;
+ pd.pwszTitle = title;
+ pd.pwszText = info;
pd.pszClassName = name;
pd.hContact = contact;
if (icon != NULL) {
diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp
index 9be06826d7..68d3934e0f 100644
--- a/protocols/FacebookRM/src/json.cpp
+++ b/protocols/FacebookRM/src/json.cpp
@@ -311,7 +311,7 @@ void parseAttachments(FacebookProto *proto, std::string *message_text, const JSO
*message_text += "\n\n";
if (!attachments_text.empty()) {
- std::tstring newText;
+ std::wstring newText;
if (type == "sticker")
newText = TranslateT("a sticker");
else if (type == "share")
@@ -327,7 +327,7 @@ void parseAttachments(FacebookProto *proto, std::string *message_text, const JSO
else
newText = _A2T(type.c_str());
- TCHAR title[200];
+ wchar_t title[200];
mir_sntprintf(title, TranslateT("User sent %s:"), newText.c_str());
*message_text += T2Utf(title);
@@ -760,7 +760,7 @@ int facebook_json_parser::parse_messages(std::string *pData, std::vector<faceboo
// Probably means client: guess 0 = web, 8 = messenger, 10 = something else?
if (vc_) {
int vc = vc_.as_int();
- TCHAR *client;
+ wchar_t *client;
if (vc == 0) {
client = _T(FACEBOOK_CLIENT_WEB);
@@ -877,7 +877,7 @@ int facebook_json_parser::parse_messages(std::string *pData, std::vector<faceboo
}
// Probably means client: guess 0 = web, 8 = messenger, 10 = something else?
if (vc_) {
- TCHAR *client = _T(FACEBOOK_CLIENT_WEB);
+ wchar_t *client = _T(FACEBOOK_CLIENT_WEB);
/*if (vc == 0) {
// means active some time ago? (on messenger or also on web)
@@ -1073,7 +1073,7 @@ int facebook_json_parser::parse_thread_messages(std::string *data, std::vector<
chatrooms->erase(iter); // this is not chatroom
}
else {
- iter->second->chat_name = std::tstring(ptrT(mir_utf8decodeT(name.as_string().c_str()))); // TODO: create name from users if there is no name...
+ iter->second->chat_name = std::wstring(ptrT(mir_utf8decodeT(name.as_string().c_str()))); // TODO: create name from users if there is no name...
const JSONNode &participants = (*it)["participants"];
for (auto jt = participants.begin(); jt != participants.end(); ++jt) {
@@ -1275,7 +1275,7 @@ int facebook_json_parser::parse_chat_info(std::string *data, facebook_chatroom*
fbc->is_archived = (*it)["is_archived"].as_bool();
fbc->is_subscribed = (*it)["is_subscribed"].as_bool();
fbc->read_only = (*it)["read_only"].as_bool();
- fbc->chat_name = std::tstring(ptrT(mir_utf8decodeT(name_.as_string().c_str())));
+ fbc->chat_name = std::wstring(ptrT(mir_utf8decodeT(name_.as_string().c_str())));
}
return EXIT_SUCCESS;
diff --git a/protocols/FacebookRM/src/main.cpp b/protocols/FacebookRM/src/main.cpp
index 8c50a507ba..bf63f1f8a7 100644
--- a/protocols/FacebookRM/src/main.cpp
+++ b/protocols/FacebookRM/src/main.cpp
@@ -74,7 +74,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC
/////////////////////////////////////////////////////////////////////////////////////////
// Load
-static PROTO_INTERFACE* protoInit(const char *proto_name, const TCHAR *username)
+static PROTO_INTERFACE* protoInit(const char *proto_name, const wchar_t *username)
{
FacebookProto *proto = new FacebookProto(proto_name, username);
g_Instances.insert(proto);
diff --git a/protocols/FacebookRM/src/messages.cpp b/protocols/FacebookRM/src/messages.cpp
index bfb4dd24d4..e5777e6f29 100644
--- a/protocols/FacebookRM/src/messages.cpp
+++ b/protocols/FacebookRM/src/messages.cpp
@@ -217,10 +217,10 @@ void FacebookProto::StickerAsSmiley(std::string sticker, const std::string &url,
std::string b64 = ptrA(mir_base64_encode((PBYTE)sticker.c_str(), (unsigned)sticker.length()));
b64 = utils::url::encode(b64);
- std::tstring filename = GetAvatarFolder() + L"\\stickers\\";
+ std::wstring filename = GetAvatarFolder() + L"\\stickers\\";
ptrT dir(mir_tstrdup(filename.c_str()));
- filename += (TCHAR*)_A2T(b64.c_str());
+ filename += (wchar_t*)_A2T(b64.c_str());
filename += L".png";
// Check if we have this sticker already and download it it not
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp
index 1a169b684c..6be6c3f539 100644
--- a/protocols/FacebookRM/src/process.cpp
+++ b/protocols/FacebookRM/src/process.cpp
@@ -516,9 +516,9 @@ void FacebookProto::SyncThreads(void*)
}
std::string truncateUtf8(std::string &text, size_t maxLength) {
- // To not split some unicode character we need to transform it to TCHAR first, then split it, and then convert it back, because we want std::string as result
+ // To not split some unicode character we need to transform it to wchar_t first, then split it, and then convert it back, because we want std::string as result
// TODO: Probably there is much simpler and nicer way
- std::tstring ttext = ptrT(mir_utf8decodeT(text.c_str()));
+ std::wstring ttext = ptrT(mir_utf8decodeT(text.c_str()));
if (ttext.length() > maxLength) {
ttext = ttext.substr(0, maxLength) + L"\x2026"; // unicode ellipsis
return std::string(_T2A(ttext.c_str(), CP_UTF8));
@@ -1192,7 +1192,7 @@ void FacebookProto::SearchAckThread(void *targ)
int count = 0;
- std::string search = utils::url::encode(T2Utf((TCHAR *)targ).str());
+ std::string search = utils::url::encode(T2Utf((wchar_t *)targ).str());
std::string ssid;
while (count < 50 && !isOffline())
@@ -1246,11 +1246,11 @@ void FacebookProto::SearchAckThread(void *targ)
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
psr.flags = PSR_TCHAR;
- psr.id.t = tid;
- psr.nick.t = tnick;
- psr.firstName.t = tname;
- psr.lastName.t = tsurname;
- psr.email.t = tcommon;
+ psr.id.w = tid;
+ psr.nick.w = tnick;
+ psr.firstName.w = tname;
+ psr.lastName.w = tsurname;
+ psr.email.w = tcommon;
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, targ, (LPARAM)&psr);
}
@@ -1271,7 +1271,7 @@ void FacebookProto::SearchIdAckThread(void *targ)
{
facy.handle_entry("searchIdAckThread");
- std::string search = utils::url::encode(T2Utf((TCHAR*)targ).str()) + "?";
+ std::string search = utils::url::encode(T2Utf((wchar_t*)targ).str()) + "?";
if (!isOffline())
{
@@ -1307,9 +1307,9 @@ void FacebookProto::SearchIdAckThread(void *targ)
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
psr.flags = PSR_TCHAR;
- psr.id.t = tid;
- psr.firstName.t = tname;
- psr.lastName.t = tsurname;
+ psr.id.w = tid;
+ psr.firstName.w = tname;
+ psr.lastName.w = tsurname;
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, targ, (LPARAM)&psr);
}
}
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index 0795f2ba16..a0fdcf6c52 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-FacebookProto::FacebookProto(const char* proto_name, const TCHAR* username) :
+FacebookProto::FacebookProto(const char* proto_name, const wchar_t* username) :
PROTO<FacebookProto>(proto_name, username),
m_tszDefaultGroup(getTStringA(FACEBOOK_KEY_DEF_GROUP))
{
@@ -82,7 +82,7 @@ FacebookProto::FacebookProto(const char* proto_name, const TCHAR* username) :
InitSounds();
// Create standard network connection
- TCHAR descr[512];
+ wchar_t descr[512];
NETLIBUSER nlu = { sizeof(nlu) };
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
nlu.szSettingsModule = m_szModuleName;
@@ -90,7 +90,7 @@ FacebookProto::FacebookProto(const char* proto_name, const TCHAR* username) :
nlu.ptszDescriptiveName = descr;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
if (m_hNetlibUser == NULL) {
- TCHAR error[200];
+ wchar_t error[200];
mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
MessageBox(NULL, error, L"Miranda NG", MB_OK | MB_ICONERROR);
}
@@ -216,7 +216,7 @@ int FacebookProto::SetStatus(int new_status)
return 0;
}
-int FacebookProto::SetAwayMsg(int, const TCHAR *msg)
+int FacebookProto::SetAwayMsg(int, const wchar_t *msg)
{
if (!msg) {
last_status_msg_.clear();
@@ -248,38 +248,38 @@ void FacebookProto::SetAwayMsgWorker(void *p)
}
}
-HANDLE FacebookProto::SearchBasic(const TCHAR* id)
+HANDLE FacebookProto::SearchBasic(const wchar_t* id)
{
if (isOffline())
return 0;
- TCHAR *tid = mir_tstrdup(id);
+ wchar_t *tid = mir_tstrdup(id);
ForkThread(&FacebookProto::SearchIdAckThread, tid);
return tid;
}
-HANDLE FacebookProto::SearchByEmail(const TCHAR* email)
+HANDLE FacebookProto::SearchByEmail(const wchar_t* email)
{
if (isOffline())
return 0;
- TCHAR *temail = mir_tstrdup(email);
+ wchar_t *temail = mir_tstrdup(email);
ForkThread(&FacebookProto::SearchAckThread, temail);
return temail;
}
-HANDLE FacebookProto::SearchByName(const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName)
+HANDLE FacebookProto::SearchByName(const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName)
{
- TCHAR arg[200];
+ wchar_t arg[200];
mir_sntprintf(arg, L"%s %s %s", nick, firstName, lastName);
return SearchByEmail(arg); // Facebook is using one search method for everything (except IDs)
}
MCONTACT FacebookProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
{
- ptrA id(mir_t2a_cp(psr->id.t, CP_UTF8));
- ptrA name(mir_t2a_cp(psr->firstName.t, CP_UTF8));
- ptrA surname(mir_t2a_cp(psr->lastName.t, CP_UTF8));
+ ptrA id(mir_t2a_cp(psr->id.w, CP_UTF8));
+ ptrA name(mir_t2a_cp(psr->firstName.w, CP_UTF8));
+ ptrA surname(mir_t2a_cp(psr->lastName.w, CP_UTF8));
if (id == NULL)
return NULL;
@@ -310,7 +310,7 @@ MCONTACT FacebookProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
return hContact;
}
-int FacebookProto::AuthRequest(MCONTACT hContact, const TCHAR *)
+int FacebookProto::AuthRequest(MCONTACT hContact, const wchar_t *)
{
return RequestFriendship(hContact, NULL);
}
@@ -327,7 +327,7 @@ int FacebookProto::Authorize(MEVENT hDbEvent)
return ApproveFriendship(hContact, NULL);
}
-int FacebookProto::AuthDeny(MEVENT hDbEvent, const TCHAR *)
+int FacebookProto::AuthDeny(MEVENT hDbEvent, const wchar_t *)
{
if (!hDbEvent || isOffline())
return 1;
@@ -499,31 +499,31 @@ int FacebookProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = g_hInstance;
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
odp.dwInitParam = LPARAM(this);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
odp.position = 271828;
- odp.ptszGroup = LPGENT("Network");
- odp.ptszTab = LPGENT("Account");
+ odp.pwszGroup = LPGENW("Network");
+ odp.pwszTab = LPGENW("Account");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.pfnDlgProc = FBOptionsProc;
Options_AddPage(wParam, &odp);
odp.position = 271829;
- odp.ptszTab = LPGENT("Events");
+ odp.pwszTab = LPGENW("Events");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS_EVENTS);
odp.pfnDlgProc = FBOptionsEventsProc;
Options_AddPage(wParam, &odp);
odp.position = 271830;
- odp.ptszTab = LPGENT("Statuses");
+ odp.pwszTab = LPGENW("Statuses");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS_STATUSES);
odp.pfnDlgProc = FBOptionsStatusesProc;
Options_AddPage(wParam, &odp);
odp.position = 271831;
- odp.ptszTab = LPGENT("Messaging");
+ odp.pwszTab = LPGENW("Messaging");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS_MESSAGING);
odp.pfnDlgProc = FBOptionsMessagingProc;
Options_AddPage(wParam, &odp);
@@ -561,7 +561,7 @@ INT_PTR FacebookProto::OnMind(WPARAM wParam, LPARAM)
wall->user_id = id;
wall->isPage = false;
if (wall->user_id == facy.self_.user_id) {
- wall->title = _tcsdup(TranslateT("Own wall"));
+ wall->title = wcsdup(TranslateT("Own wall"));
}
else
wall->title = getTStringA(hContact, FACEBOOK_KEY_NICK);
@@ -789,7 +789,7 @@ INT_PTR FacebookProto::CancelFriendship(WPARAM wParam, LPARAM lParam)
if (tname == NULL)
return 1;
- TCHAR tstr[256];
+ wchar_t tstr[256];
mir_sntprintf(tstr, TranslateT("Do you want to cancel your friendship with '%s'?"), tname);
if (MessageBox(0, tstr, m_tszUserName, MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2) == IDYES) {
@@ -1005,7 +1005,7 @@ void FacebookProto::InitPopups()
ppc.PluginWindowProc = PopupDlgProc;
ppc.lParam = APF_RETURN_HWND;
- TCHAR desc[256];
+ wchar_t desc[256];
char name[256];
// Client
@@ -1102,15 +1102,15 @@ void FacebookProto::InitHotkeys()
hkd.dwFlags = HKD_TCHAR;
mir_strcpy(tDest, "/VisitProfile");
- hkd.ptszDescription = LPGENT("Visit profile");
+ hkd.ptszDescription = LPGENW("Visit profile");
Hotkey_Register(&hkd);
mir_strcpy(tDest, "/VisitNotifications");
- hkd.ptszDescription = LPGENT("Visit notifications");
+ hkd.ptszDescription = LPGENW("Visit notifications");
Hotkey_Register(&hkd);
mir_strcpy(tDest, "/Mind");
- hkd.ptszDescription = LPGENT("Show 'Share status' window");
+ hkd.ptszDescription = LPGENW("Show 'Share status' window");
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT | HOTKEYF_EXT, 'F');
Hotkey_Register(&hkd);
}
@@ -1120,12 +1120,12 @@ void FacebookProto::InitHotkeys()
*/
void FacebookProto::InitSounds()
{
- SkinAddNewSoundExT("Notification", m_tszUserName, LPGENT("Notification"));
- SkinAddNewSoundExT("NewsFeed", m_tszUserName, LPGENT("Newsfeed event"));
- SkinAddNewSoundExT("OtherEvent", m_tszUserName, LPGENT("Other event"));
- SkinAddNewSoundExT("Friendship", m_tszUserName, LPGENT("Friendship event"));
- SkinAddNewSoundExT("Ticker", m_tszUserName, LPGENT("Ticker event"));
- SkinAddNewSoundExT("Memories", m_tszUserName, LPGENT("Memories"));
+ SkinAddNewSoundExT("Notification", m_tszUserName, LPGENW("Notification"));
+ SkinAddNewSoundExT("NewsFeed", m_tszUserName, LPGENW("Newsfeed event"));
+ SkinAddNewSoundExT("OtherEvent", m_tszUserName, LPGENW("Other event"));
+ SkinAddNewSoundExT("Friendship", m_tszUserName, LPGENW("Friendship event"));
+ SkinAddNewSoundExT("Ticker", m_tszUserName, LPGENW("Ticker event"));
+ SkinAddNewSoundExT("Memories", m_tszUserName, LPGENW("Memories"));
}
/**
@@ -1142,8 +1142,8 @@ void FacebookProto::MessageRead(MCONTACT hContact)
if (!time)
return;
- TCHAR ttime[64];
- _tcsftime(ttime, _countof(ttime), L"%X", localtime(&time));
+ wchar_t ttime[64];
+ wcsftime(ttime, _countof(ttime), L"%X", localtime(&time));
StatusTextData st = { 0 };
st.cbSize = sizeof(st);
diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h
index 92a2799b88..d7792aa029 100644
--- a/protocols/FacebookRM/src/proto.h
+++ b/protocols/FacebookRM/src/proto.h
@@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
class FacebookProto : public PROTO<FacebookProto>
{
public:
- FacebookProto(const char *proto_name, const TCHAR *username);
+ FacebookProto(const char *proto_name, const wchar_t *username);
~FacebookProto();
inline const char* ModuleName() const
@@ -83,15 +83,15 @@ public:
virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
virtual int __cdecl Authorize(MEVENT hDbEvent);
- virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR* szReason);
- virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage);
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t* szReason);
+ virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t* szMessage);
virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
virtual int __cdecl GetInfo(MCONTACT hContact, int infoType);
- virtual HANDLE __cdecl SearchBasic(const TCHAR* id);
- virtual HANDLE __cdecl SearchByEmail(const TCHAR* email);
- virtual HANDLE __cdecl SearchByName(const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName);
+ virtual HANDLE __cdecl SearchBasic(const wchar_t* id);
+ virtual HANDLE __cdecl SearchByEmail(const wchar_t* email);
+ virtual HANDLE __cdecl SearchByName(const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName);
virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*);
virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg);
@@ -99,7 +99,7 @@ public:
virtual int __cdecl SetStatus(int iNewStatus);
virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
- virtual int __cdecl SetAwayMsg(int iStatus, const TCHAR* msg);
+ virtual int __cdecl SetAwayMsg(int iStatus, const wchar_t* msg);
virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
@@ -208,7 +208,7 @@ public:
void StopTyping(MCONTACT hContact);
// Chats handling
- void AddChat(const char *chat_id, const TCHAR *name);
+ void AddChat(const char *chat_id, const wchar_t *name);
void UpdateChat(const char *chat_id, const char *id, const char *name, const char *message, DWORD timestamp = 0, bool is_old = false);
void RenameChat(const char *chat_id, const char *name);
bool IsChatContact(const char *chat_id, const char *id);
@@ -228,7 +228,7 @@ public:
facebook_client facy; // TODO: Refactor to "client" and make dynamic
// Helpers
- std::tstring GetAvatarFolder();
+ std::wstring GetAvatarFolder();
bool GetDbAvatarInfo(PROTO_AVATAR_INFORMATION &ai, std::string *url);
void CheckAvatarChange(MCONTACT hContact, const std::string &image_url);
void ToggleStatusMenuItems(bool bEnable);
@@ -260,6 +260,6 @@ public:
static void CALLBACK APC_callback(ULONG_PTR p);
// Information providing
- HWND NotifyEvent(TCHAR* title, TCHAR* info, MCONTACT contact, DWORD flags, std::string *url = NULL, std::string *notification_id = NULL, const char *icon = NULL);
+ HWND NotifyEvent(wchar_t* title, wchar_t* info, MCONTACT contact, DWORD flags, std::string *url = NULL, std::string *notification_id = NULL, const char *icon = NULL);
void ShowNotifications();
};
diff --git a/protocols/GTalkExt/src/avatar.cpp b/protocols/GTalkExt/src/avatar.cpp
index b0d6c61896..edd023c8d5 100644
--- a/protocols/GTalkExt/src/avatar.cpp
+++ b/protocols/GTalkExt/src/avatar.cpp
@@ -32,19 +32,19 @@
LPTSTR CreateAvaFile(HANDLE *hFile)
{
- TCHAR name[MAX_PATH + 2];
+ wchar_t name[MAX_PATH + 2];
if (CallService(MS_DB_GETPROFILENAMET, (WPARAM)_countof(name), (LPARAM)&name))
return NULL;
- TCHAR *p = _tcsrchr(name, '.');
+ wchar_t *p = wcsrchr(name, '.');
if (p)
*p = 0;
- TCHAR path[MAX_PATH + 2];
+ wchar_t path[MAX_PATH + 2];
if (CallService(MS_DB_GETPROFILEPATHT, (WPARAM)_countof(path), (LPARAM)&path))
return NULL;
- TCHAR full[MAX_PATH + 2];
+ wchar_t full[MAX_PATH + 2];
mir_sntprintf(full, AVA_FILE_NAME_FORMAT, path, name);
CreateDirectoryTreeT(full);
diff --git a/protocols/GTalkExt/src/handlers.cpp b/protocols/GTalkExt/src/handlers.cpp
index 1948a21dbf..5dd4cf0345 100644
--- a/protocols/GTalkExt/src/handlers.cpp
+++ b/protocols/GTalkExt/src/handlers.cpp
@@ -31,8 +31,6 @@
LRESULT CALLBACK PopupProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam);
-#include <tchar.h>
-
GoogleTalkAcc* isGoogle(LPARAM lParam)
{
return g_accs.find((GoogleTalkAcc*)&lParam);
@@ -42,7 +40,7 @@ GoogleTalkAcc* isGoogle(LPARAM lParam)
void FormatMessageUrl(LPCTSTR format, LPTSTR buf, LPCTSTR mailbox, LPCTSTR tid)
{
- ULARGE_INTEGER iTid; iTid.QuadPart = _tstoi64(tid);
+ ULARGE_INTEGER iTid; iTid.QuadPart = _wtoi64(tid);
size_t l = mir_tstrlen(buf);
mir_sntprintf(buf, l, format, mailbox, iTid.HighPart, iTid.LowPart);
assert(l >= mir_tstrlen(buf));
@@ -50,8 +48,8 @@ void FormatMessageUrl(LPCTSTR format, LPTSTR buf, LPCTSTR mailbox, LPCTSTR tid)
void MakeUrlHex(LPTSTR url, LPCTSTR tid)
{
- ULARGE_INTEGER iTid; iTid.QuadPart = _tstoi64(tid);
- LPTSTR tidInUrl = _tcsstr(url, tid);
+ ULARGE_INTEGER iTid; iTid.QuadPart = _wtoi64(tid);
+ LPTSTR tidInUrl = wcsstr(url, tid);
LPTSTR trail = tidInUrl + mir_tstrlen(tid);
wsprintf(tidInUrl, L"%x%08x", iTid.HighPart, iTid.LowPart); //!!!!!!!!!!!!
wmemmove(tidInUrl + mir_tstrlen(tidInUrl), trail, mir_tstrlen(trail) + 1);
@@ -59,13 +57,13 @@ void MakeUrlHex(LPTSTR url, LPCTSTR tid)
LPTSTR ExtractJid(LPCTSTR jidWithRes)
{
- LPCTSTR p = _tcsrchr(jidWithRes, '/');
+ LPCTSTR p = wcsrchr(jidWithRes, '/');
if (p == NULL)
return mir_tstrdup(jidWithRes);
size_t l = size_t(p - jidWithRes);
- LPTSTR result = (LPTSTR)mir_alloc((l + 1) * sizeof(TCHAR));
- _tcsncpy(result, jidWithRes, l);
+ LPTSTR result = (LPTSTR)mir_alloc((l + 1) * sizeof(wchar_t));
+ wcsncpy(result, jidWithRes, l);
result[l] = 0;
return result;
}
@@ -166,7 +164,7 @@ BOOL MailListHandler(IJabberInterface *ji, HXML node, void *)
__finally {
if (jidWithRes)
ji->AddTemporaryIqHandler(TimerHandler, JABBER_IQ_TYPE_RESULT, 0,
- (PVOID)_tcsdup(jidWithRes), TIMER_INTERVAL);
+ (PVOID)wcsdup(jidWithRes), TIMER_INTERVAL);
// Never get a real result stanza. Results elapsed request after WAIT_TIMER_INTERVAL ms
}
}
@@ -186,7 +184,7 @@ void RequestMail(LPCTSTR jidWithRes, IJabberInterface *ji)
lastMailTime(ReadJidSetting(LAST_MAIL_TIME_FROM_JID, jid)),
lastThreadId(ReadJidSetting(LAST_THREAD_ID_FROM_JID, jid));
- TCHAR id[30];
+ wchar_t id[30];
mir_sntprintf(id, JABBER_IQID_FORMAT, uID);
xmlAddAttr(node, ATTRNAME_ID, id);
@@ -246,7 +244,7 @@ void SetNotificationSetting(LPCTSTR jidWithResource, IJabberInterface *ji)
ptrT jid(ExtractJid(jidWithResource));
xmlAddAttr(node, ATTRNAME_TO, jid);
- TCHAR id[30];
+ wchar_t id[30];
mir_sntprintf(id, JABBER_IQID_FORMAT, ji->SerialNext());
xmlAddAttr(node, ATTRNAME_ID, id);
@@ -293,7 +291,7 @@ BOOL SendHandler(IJabberInterface *ji, HXML node, void *)
if (queryNode) {
LPCTSTR ptszId = xmlGetAttrValue(node, ATTRNAME_ID);
if (ptszId)
- ji->AddTemporaryIqHandler(DiscoverHandler, JABBER_IQ_TYPE_RESULT, _ttoi(ptszId + 4), NULL, RESPONSE_TIMEOUT, 500);
+ ji->AddTemporaryIqHandler(DiscoverHandler, JABBER_IQ_TYPE_RESULT, _wtoi(ptszId + 4), NULL, RESPONSE_TIMEOUT, 500);
}
if (!mir_tstrcmp(xmlGetName(node), L"presence") && xmlGetAttrValue(node, ATTRNAME_TO) == 0) {
@@ -412,7 +410,7 @@ int OnExtListInit(WPARAM wParam, LPARAM lParam)
{
GoogleTalkAcc *gta = isGoogle(lParam);
if (gta != NULL) {
- LIST<TCHAR> *pList = (LIST<TCHAR>*)wParam;
+ LIST<wchar_t> *pList = (LIST<wchar_t>*)wParam;
pList->insert(JABBER_EXT_GTALK_PMUC);
}
return 0;
diff --git a/protocols/GTalkExt/src/inbox.cpp b/protocols/GTalkExt/src/inbox.cpp
index 5b0ab1159e..f4e6c3ee4d 100644
--- a/protocols/GTalkExt/src/inbox.cpp
+++ b/protocols/GTalkExt/src/inbox.cpp
@@ -200,12 +200,12 @@ void OpenContactInbox(LPCSTR szModuleName)
if (tszJid == NULL)
return;
- LPTSTR host = _tcschr(tszJid, '@');
+ LPTSTR host = wcschr(tszJid, '@');
if (!host)
return;
*host++ = 0;
- TCHAR buf[1024];
+ wchar_t buf[1024];
if (mir_tstrcmpi(host, COMMON_GMAIL_HOST1) && mir_tstrcmpi(host, COMMON_GMAIL_HOST2))
mir_sntprintf(buf, INBOX_URL_FORMAT, L"a/", host); // hosted
else
diff --git a/protocols/GTalkExt/src/notifications.cpp b/protocols/GTalkExt/src/notifications.cpp
index 6b167af949..fda2db7eb5 100644
--- a/protocols/GTalkExt/src/notifications.cpp
+++ b/protocols/GTalkExt/src/notifications.cpp
@@ -177,7 +177,7 @@ MCONTACT SetupPseudocontact(LPCTSTR jid, LPCTSTR unreadCount, LPCSTR acc, LPCTST
// SetAvatar(hContact);
if (displayName == NULL) {
- TCHAR *tszTemp = (TCHAR*)alloca((mir_tstrlen(jid) + mir_tstrlen(unreadCount) + 3 + 1) * sizeof(TCHAR));
+ wchar_t *tszTemp = (wchar_t*)alloca((mir_tstrlen(jid) + mir_tstrlen(unreadCount) + 3 + 1) * sizeof(wchar_t));
FormatPseudocontactDisplayName(tszTemp, jid, unreadCount);
db_set_ts(hContact, CLIST_MODULE_NAME, CONTACT_DISPLAY_NAME_SETTING, tszTemp);
}
@@ -230,8 +230,8 @@ void ShowNotification(LPCSTR acc, POPUPDATAT *data, LPCTSTR jid, LPCTSTR url, LP
}
data->PluginWindowProc = PopupProc;
- size_t lurl = (mir_tstrlen(url) + 1) * sizeof(TCHAR);
- size_t ljid = (mir_tstrlen(jid) + 1) * sizeof(TCHAR);
+ size_t lurl = (mir_tstrlen(url) + 1) * sizeof(wchar_t);
+ size_t ljid = (mir_tstrlen(jid) + 1) * sizeof(wchar_t);
POPUP_DATA_HEADER *ppdh = (POPUP_DATA_HEADER*)malloc(sizeof(POPUP_DATA_HEADER) + lurl + ljid);
ppdh->MarkRead = FALSE;
diff --git a/protocols/GTalkExt/src/options.cpp b/protocols/GTalkExt/src/options.cpp
index d141179cc8..02394e0949 100644
--- a/protocols/GTalkExt/src/options.cpp
+++ b/protocols/GTalkExt/src/options.cpp
@@ -26,15 +26,15 @@
#define ACCOUNT_PROP_NAME L"{BF447EBA-27AE-4DB7-893C-FC42A3F74D75}"
#define DIALOG_INITIALIZED_PROP_NAME L"{5EE59FE5-679A-4A29-B0A1-03092E7AC20E}"
-#define POPUPS_OPTIONS_GROUP LPGENT("Popups")
-#define NETWORK_OPTIONS_GROUP LPGENT("Network")
+#define POPUPS_OPTIONS_GROUP LPGENW("Popups")
+#define NETWORK_OPTIONS_GROUP LPGENW("Network")
#define NOTIFY_SETTINGS_FROM_MOD_NAME SHORT_PLUGIN_NAME ".NotifySettingsFromModName"
-#define TEST_LETTER_SUBJECT LPGENT("Why C sucks")
+#define TEST_LETTER_SUBJECT LPGENW("Why C sucks")
#define TEST_LETTER_INBOX L"brickstrace@gmail.com [1]"
#define TEST_LETTER_SENDER L" bems\n"
-#define TEST_LETTER_SNIP LPGENT("* Primitive type system\n* No overloading\n* Limited possibility of data abstraction, polymorphism, subtyping and code reuse\n* No metaprogramming except preprocessor macros\n* No exceptions")
+#define TEST_LETTER_SNIP LPGENW("* Primitive type system\n* No overloading\n* Limited possibility of data abstraction, polymorphism, subtyping and code reuse\n* No metaprogramming except preprocessor macros\n* No exceptions")
void CheckControlsEnabled(HWND wnd)
{
@@ -159,10 +159,10 @@ void ShowTestPopup(HWND wnd)
mir_sntprintf(data.lptzText, TranslateTS(FULL_NOTIFICATION_FORMAT), TranslateTS(TEST_LETTER_SUBJECT), TranslateTS(TEST_LETTER_SENDER), TranslateTS(TEST_LETTER_SNIP));
int len = SendDlgItemMessage(wnd, IDC_TIMEOUTEDIT, WM_GETTEXTLENGTH, 0, 0) + 1;
- LPTSTR timeout = (LPTSTR)_alloca(len * sizeof(TCHAR));
+ LPTSTR timeout = (LPTSTR)_alloca(len * sizeof(wchar_t));
GetDlgItemText(wnd, IDC_TIMEOUTEDIT, timeout, len);
- data.iSeconds = _ttoi(timeout);
+ data.iSeconds = _wtoi(timeout);
data.lchIcon = IcoLib_GetIconByHandle(iconList[0].hIcolib);
data.colorBack = (COLORREF)SendDlgItemMessage(wnd, IDC_BACKCOLORPICKER, CPM_GETCOLOUR, 0, 0);
@@ -176,7 +176,7 @@ void ShowTestPopup(HWND wnd)
INT_PTR CALLBACK PopupsOptionsDlgProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TCHAR timeout[20];
+ wchar_t timeout[20];
switch (msg) {
case WM_INITDIALOG:
@@ -184,7 +184,7 @@ INT_PTR CALLBACK PopupsOptionsDlgProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM
SendDlgItemMessage(wnd, IDC_BACKCOLORPICKER, CPM_SETCOLOUR, 0, (LPARAM)db_get_dw(0, SHORT_PLUGIN_NAME, BACK_COLOR_SETTING, 0));
SendDlgItemMessage(wnd, IDC_TEXTCOLORPICKER, CPM_SETCOLOUR, 0, (LPARAM)db_get_dw(0, SHORT_PLUGIN_NAME, TEXT_COLOR_SETTING, 0));
- _itot(db_get_dw(0, SHORT_PLUGIN_NAME, TIMEOUT_SETTING, 0), timeout, 10);
+ _itow(db_get_dw(0, SHORT_PLUGIN_NAME, TIMEOUT_SETTING, 0), timeout, 10);
SetDlgItemText(wnd, IDC_TIMEOUTEDIT, timeout);
SetProp(wnd, DIALOG_INITIALIZED_PROP_NAME, (HANDLE)TRUE);
@@ -212,7 +212,7 @@ INT_PTR CALLBACK PopupsOptionsDlgProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM
db_set_dw(0, SHORT_PLUGIN_NAME, TEXT_COLOR_SETTING, (DWORD)SendDlgItemMessage(wnd, IDC_TEXTCOLORPICKER, CPM_GETCOLOUR, 0, 0));
GetDlgItemText(wnd, IDC_TIMEOUTEDIT, timeout, _countof(timeout));
- db_set_dw(0, SHORT_PLUGIN_NAME, TIMEOUT_SETTING, _ttoi(timeout));
+ db_set_dw(0, SHORT_PLUGIN_NAME, TIMEOUT_SETTING, _wtoi(timeout));
}
return 0;
}
@@ -223,11 +223,11 @@ int OptionsInitialization(WPARAM wParam, LPARAM)
{
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
OPTIONSDIALOGPAGE odp = { 0 };
- odp.ptszTitle = MAIL_NOTIFICATIONS;
+ odp.pwszTitle = MAIL_NOTIFICATIONS;
odp.pfnDlgProc = PopupsOptionsDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPSETTINGS);
odp.hInstance = g_hInst;
- odp.ptszGroup = POPUPS_OPTIONS_GROUP;
+ odp.pwszGroup = POPUPS_OPTIONS_GROUP;
odp.flags = ODPF_UNICODE | ODPF_USERINFOTAB;
Options_AddPage(wParam, &odp);
}
@@ -237,13 +237,13 @@ int OptionsInitialization(WPARAM wParam, LPARAM)
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (pa != NULL) {
OPTIONSDIALOGPAGE odp = { 0 };
- odp.ptszTitle = pa->tszAccountName;
+ odp.pwszTitle = pa->tszAccountName;
odp.pfnDlgProc = AccOptionsDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_MAILSETTINGS);
odp.hInstance = g_hInst;
- odp.ptszGroup = NETWORK_OPTIONS_GROUP;
+ odp.pwszGroup = NETWORK_OPTIONS_GROUP;
odp.flags = ODPF_UNICODE | ODPF_USERINFOTAB | ODPF_DONTTRANSLATE;
- odp.ptszTab = MAIL_NOTIFICATIONS;
+ odp.pwszTab = MAIL_NOTIFICATIONS;
odp.dwInitParam = (LPARAM)szProto;
Options_AddPage(wParam, &odp);
}
diff --git a/protocols/GTalkExt/src/options.h b/protocols/GTalkExt/src/options.h
index f6de20a154..b9bb84ceea 100644
--- a/protocols/GTalkExt/src/options.h
+++ b/protocols/GTalkExt/src/options.h
@@ -25,9 +25,9 @@
#define JABBER_FEAT_GTALK_PMUC L"http://www.google.com/xmpp/protocol/pmuc/v1"
-#define MAIL_NOTIFICATIONS LPGENT("GMail notifications")
-#define FULL_NOTIFICATION_FORMAT LPGENT("subject\n %s\nfrom\n%s\n%s\n")
-#define SHORT_NOTIFICATION_FORMAT LPGENT("subject\n %s\nfrom\n%s")
+#define MAIL_NOTIFICATIONS LPGENW("GMail notifications")
+#define FULL_NOTIFICATION_FORMAT LPGENW("subject\n %s\nfrom\n%s\n%s\n")
+#define SHORT_NOTIFICATION_FORMAT LPGENW("subject\n %s\nfrom\n%s")
#define PSEUDOCONTACT_LINK "GTalkExtNotifyContact"
#define PSEUDOCONTACT_FLAG "IsNotifyContact"
diff --git a/protocols/GTalkExt/src/stdafx.h b/protocols/GTalkExt/src/stdafx.h
index 6df16f3fee..f545ff3b25 100644
--- a/protocols/GTalkExt/src/stdafx.h
+++ b/protocols/GTalkExt/src/stdafx.h
@@ -27,7 +27,6 @@
#include <malloc.h>
#include <time.h>
#include <stdlib.h>
-#include <tchar.h>
// Windows Header Files:
#include <windows.h>
diff --git a/protocols/GTalkExt/src/tipper_items.cpp b/protocols/GTalkExt/src/tipper_items.cpp
index 3839aeb5d1..ef886b764f 100644
--- a/protocols/GTalkExt/src/tipper_items.cpp
+++ b/protocols/GTalkExt/src/tipper_items.cpp
@@ -40,7 +40,7 @@ static LPSTR TipperItemProps[] =
#define TIPPER_ITEMS_MOD_NAME "Tipper_Items"
#define TIPPER_ITEM_COUNT_SETTING "DINumValues"
#define UNREAD_THREADS_RAW L"%raw:" _T(SHORT_PLUGIN_NAME) L"/UnreadThreads%"
-#define UNREAD_THREADS_LABEL LPGENT("Unread threads:")
+#define UNREAD_THREADS_LABEL LPGENW("Unread threads:")
void ShiftTipperSettings(LPSTR buff, int count, LPSTR format)
{
@@ -99,7 +99,7 @@ void AddTipperItem()
for (i = itemCount; i > 0; i /= 10) l++; // var setting path
l += 30; // const setting part
- LPSTR setting = (LPSTR)_alloca(l * sizeof(TCHAR));
+ LPSTR setting = (LPSTR)_alloca(l * sizeof(wchar_t));
for (i = 0; i < itemCount; i++) {
mir_snprintf(setting, l, VALUE_SETTING_PROP, i);
diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp
index 0ecdd36433..f3c8a3cc05 100644
--- a/protocols/Gadu-Gadu/src/avatar.cpp
+++ b/protocols/Gadu-Gadu/src/avatar.cpp
@@ -26,28 +26,28 @@
//////////////////////////////////////////////////////////
// Avatars support
//
-void GGPROTO::getAvatarFilename(MCONTACT hContact, TCHAR *pszDest, int cbLen)
+void GGPROTO::getAvatarFilename(MCONTACT hContact, wchar_t *pszDest, int cbLen)
{
int tPathLen = mir_sntprintf(pszDest, cbLen, L"%s\\%S", VARST( L"%miranda_avatarcache%"), m_szModuleName);
- if (_taccess(pszDest, 0)) {
+ if (_waccess(pszDest, 0)) {
int ret = CreateDirectoryTreeT(pszDest);
if (ret == 0)
debugLog(L"getAvatarFilename(): Created new directory for avatar cache: %s.", pszDest);
else {
debugLog(L"getAvatarFilename(): Can not create directory for avatar cache: %s. errno=%d: %s", pszDest, errno, ws_strerror(errno));
- TCHAR error[512];
+ wchar_t error[512];
mir_sntprintf(error, TranslateT("Cannot create avatars cache directory. ERROR: %d: %s\n%s"), errno, ws_strerror(errno), pszDest);
showpopup(m_tszUserName, error, GG_POPUP_ERROR | GG_POPUP_ALLOW_MSGBOX | GG_POPUP_ONCE);
}
}
- const TCHAR *avatartype = ProtoGetAvatarExtension(getByte(hContact, GG_KEY_AVATARTYPE, GG_KEYDEF_AVATARTYPE));
+ const wchar_t *avatartype = ProtoGetAvatarExtension(getByte(hContact, GG_KEY_AVATARTYPE, GG_KEYDEF_AVATARTYPE));
if (hContact != NULL) {
DBVARIANT dbv;
if (!getString(hContact, GG_KEY_AVATARHASH, &dbv)) {
- TCHAR* avatarHashT = mir_a2t(dbv.pszVal);
+ wchar_t* avatarHashT = mir_a2t(dbv.pszVal);
mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s%s", avatarHashT, avatartype);
mir_free(avatarHashT);
db_free(&dbv);
@@ -83,11 +83,11 @@ bool GGPROTO::getAvatarFileInfo(uin_t uin, char **avatarurl, char **avatarts)
if ((strncmp(resp->pData, "<result>", 8) == 0) || (strncmp(resp->pData, "<?xml", 5) == 0)){
//if this url returned xml data (before and after 11.2013 gg convention)
- TCHAR *xmlAction = mir_a2t(resp->pData);
+ wchar_t *xmlAction = mir_a2t(resp->pData);
HXML hXml = xmlParseString(xmlAction, 0, L"result");
if (hXml != NULL) {
HXML node = xmlGetChildByPath(hXml, L"users/user/avatars/avatar", 0);
- const TCHAR *blank = (node != NULL) ? xmlGetAttrValue(node, L"blank") : NULL;
+ const wchar_t *blank = (node != NULL) ? xmlGetAttrValue(node, L"blank") : NULL;
if (blank != NULL && mir_tstrcmp(blank, L"1")) {
node = xmlGetChildByPath(hXml, L"users/user/avatars/avatar/timestamp", 0);
*avatarts = node != NULL ? mir_t2a(xmlGetText(node)) : NULL;
@@ -262,15 +262,15 @@ void __cdecl GGPROTO::avatarrequestthread(void*)
setByte(data->hContact, GG_KEY_AVATARTYPE, (BYTE)avatarType);
getAvatarFilename(ai.hContact, ai.filename, _countof(ai.filename));
- file_fd = _topen(ai.filename, _O_WRONLY | _O_TRUNC | _O_BINARY | _O_CREAT, _S_IREAD | _S_IWRITE);
+ file_fd = _wopen(ai.filename, _O_WRONLY | _O_TRUNC | _O_BINARY | _O_CREAT, _S_IREAD | _S_IWRITE);
if (file_fd != -1) {
_write(file_fd, resp->pData, resp->dataLength);
_close(file_fd);
result = 1;
debugLog(L"avatarrequestthread() new avatar_transfers item. Saved data to file=%s.", ai.filename);
} else {
- debugLog(L"avatarrequestthread(): _topen file %s error. errno=%d: %s", ai.filename, errno, ws_strerror(errno));
- TCHAR error[512];
+ debugLog(L"avatarrequestthread(): _wopen file %s error. errno=%d: %s", ai.filename, errno, ws_strerror(errno));
+ wchar_t error[512];
mir_sntprintf(error, TranslateT("Cannot create avatar file. ERROR: %d: %s\n%s"), errno, ws_strerror(errno), ai.filename);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
}
@@ -358,11 +358,11 @@ void __cdecl GGPROTO::setavatarthread(void *param)
debugLogA("setavatarthread(): started. Trying to set user avatar.");
//read file
- TCHAR *szFilename = (TCHAR*)param;
- int file_fd = _topen(szFilename, _O_RDONLY | _O_BINARY, _S_IREAD);
+ wchar_t *szFilename = (wchar_t*)param;
+ int file_fd = _wopen(szFilename, _O_RDONLY | _O_BINARY, _S_IREAD);
if (file_fd == -1) {
debugLog(L"setavatarthread(): Failed to open avatar file errno=%d: %s", errno, ws_strerror(errno));
- TCHAR error[512];
+ wchar_t error[512];
mir_sntprintf(error, TranslateT("Cannot open avatar file. ERROR: %d: %s\n%s"), errno, ws_strerror(errno), szFilename);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
mir_free(szFilename);
@@ -507,7 +507,7 @@ void __cdecl GGPROTO::setavatarthread(void *param)
}
-void GGPROTO::setAvatar(const TCHAR *szFilename)
+void GGPROTO::setAvatar(const wchar_t *szFilename)
{
#ifdef DEBUGMODE
debugLogA("setAvatar(): ForkThread 3 GGPROTO::setavatarthread");
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp
index 2632b89d75..05e746cf8f 100644
--- a/protocols/Gadu-Gadu/src/core.cpp
+++ b/protocols/Gadu-Gadu/src/core.cpp
@@ -236,19 +236,19 @@ void __cdecl GGPROTO::mainthread(void *)
int hostnum = 0, hostcount = 0;
GGHOST hosts[64];
// Gadu-gadu login errors
- static const struct tagReason { int type; TCHAR *str; } reason[] = {
- { GG_FAILURE_RESOLVING, LPGENT("Miranda was unable to resolve the name of the Gadu-Gadu server to its numeric address.") },
- { GG_FAILURE_CONNECTING, LPGENT("Miranda was unable to make a connection with a server. It is likely that the server is down, in which case you should wait for a while and try again later.") },
- { GG_FAILURE_INVALID, LPGENT("Received invalid server response.") },
- { GG_FAILURE_READING, LPGENT("The connection with the server was abortively closed during the connection attempt. You may have lost your local network connection.") },
- { GG_FAILURE_WRITING, LPGENT("The connection with the server was abortively closed during the connection attempt. You may have lost your local network connection.") },
- { GG_FAILURE_PASSWORD, LPGENT("Your Gadu-Gadu number and password combination was rejected by the Gadu-Gadu server. Please check login details at Options -> Network -> Gadu-Gadu and try again.") },
- { GG_FAILURE_404, LPGENT("Connecting to Gadu-Gadu hub failed.") },
- { GG_FAILURE_TLS, LPGENT("Cannot establish secure connection.") },
- { GG_FAILURE_NEED_EMAIL, LPGENT("Server disconnected asking you for changing your e-mail.") },
- { GG_FAILURE_INTRUDER, LPGENT("Too many login attempts with invalid password.") },
- { GG_FAILURE_UNAVAILABLE, LPGENT("Gadu-Gadu servers are now down. Try again later.") },
- { 0, LPGENT("Unknown") }
+ static const struct tagReason { int type; wchar_t *str; } reason[] = {
+ { GG_FAILURE_RESOLVING, LPGENW("Miranda was unable to resolve the name of the Gadu-Gadu server to its numeric address.") },
+ { GG_FAILURE_CONNECTING, LPGENW("Miranda was unable to make a connection with a server. It is likely that the server is down, in which case you should wait for a while and try again later.") },
+ { GG_FAILURE_INVALID, LPGENW("Received invalid server response.") },
+ { GG_FAILURE_READING, LPGENW("The connection with the server was abortively closed during the connection attempt. You may have lost your local network connection.") },
+ { GG_FAILURE_WRITING, LPGENW("The connection with the server was abortively closed during the connection attempt. You may have lost your local network connection.") },
+ { GG_FAILURE_PASSWORD, LPGENW("Your Gadu-Gadu number and password combination was rejected by the Gadu-Gadu server. Please check login details at Options -> Network -> Gadu-Gadu and try again.") },
+ { GG_FAILURE_404, LPGENW("Connecting to Gadu-Gadu hub failed.") },
+ { GG_FAILURE_TLS, LPGENW("Cannot establish secure connection.") },
+ { GG_FAILURE_NEED_EMAIL, LPGENW("Server disconnected asking you for changing your e-mail.") },
+ { GG_FAILURE_INTRUDER, LPGENW("Too many login attempts with invalid password.") },
+ { GG_FAILURE_UNAVAILABLE, LPGENW("Gadu-Gadu servers are now down. Try again later.") },
+ { 0, LPGENW("Unknown") }
};
time_t logonTime = 0;
time_t timeDeviation = getWord(GG_KEY_TIMEDEVIATION, GG_KEYDEF_TIMEDEVIATION);
@@ -359,8 +359,8 @@ void __cdecl GGPROTO::mainthread(void *)
if (dcc && getByte(GG_KEY_FORWARDING, GG_KEYDEF_FORWARDING)) {
if (!getString(GG_KEY_FORWARDHOST, &dbv)) {
if (!(p.external_addr = gg_dnslookup(this, dbv.pszVal))) {
- TCHAR error[128];
- TCHAR* forwardHostT = mir_a2t(dbv.pszVal);
+ wchar_t error[128];
+ wchar_t* forwardHostT = mir_a2t(dbv.pszVal);
mir_sntprintf(error, TranslateT("External direct connections hostname %s is invalid. Disabling external host forwarding."), forwardHostT);
mir_free(forwardHostT);
showpopup(m_tszUserName, error, GG_POPUP_WARNING | GG_POPUP_ALLOW_MSGBOX);
@@ -390,8 +390,8 @@ retry:
{
if (!(p.server_addr = gg_dnslookup(this, hosts[hostnum].hostname)))
{
- TCHAR error[128];
- TCHAR* hostnameT = mir_a2t(hosts[hostnum].hostname);
+ wchar_t error[128];
+ wchar_t* hostnameT = mir_a2t(hosts[hostnum].hostname);
mir_sntprintf(error, TranslateT("Server hostname %s is invalid. Using default hostname provided by the network."), hostnameT);
mir_free(hostnameT);
showpopup(m_tszUserName, error, GG_POPUP_WARNING | GG_POPUP_ALLOW_MSGBOX);
@@ -414,7 +414,7 @@ retry:
// Check if connection attempt wasn't cancelled by the user
if (m_iDesiredStatus != ID_STATUS_OFFLINE)
{
- TCHAR error[128], *perror = NULL;
+ wchar_t error[128], *perror = NULL;
// Lookup for error desciption
if (errno == EACCES) {
for (int i = 0; reason[i].type; i++) if (reason[i].type == gg_failno) {
@@ -480,7 +480,7 @@ retry:
{
broadcastnewstatus(m_iDesiredStatus);
// Change status of the contact with our own UIN (if got yourself added to the contact list)
- TCHAR *status_descr = mir_utf8decodeT(p.status_descr);
+ wchar_t *status_descr = mir_utf8decodeT(p.status_descr);
changecontactstatus(p.uin, p.status, status_descr, 0, 0, 0, 0);
mir_free(status_descr);
}
@@ -562,7 +562,7 @@ retry:
for (; n->uin; n++)
{
- TCHAR *descrT = (e->type == GG_EVENT_NOTIFY_DESCR) ? mir_utf8decodeT(e->event.notify_descr.descr) : NULL;
+ wchar_t *descrT = (e->type == GG_EVENT_NOTIFY_DESCR) ? mir_utf8decodeT(e->event.notify_descr.descr) : NULL;
changecontactstatus(n->uin, n->status, descrT, 0, n->remote_ip, n->remote_port, n->version);
if (descrT) mir_free(descrT);
}
@@ -575,7 +575,7 @@ retry:
int i;
for(i = 0; e->event.notify60[i].uin; i++) {
if (e->event.notify60[i].uin == uin) continue;
- TCHAR *descrT = mir_utf8decodeT(e->event.notify60[i].descr);
+ wchar_t *descrT = mir_utf8decodeT(e->event.notify60[i].descr);
changecontactstatus(e->event.notify60[i].uin, e->event.notify60[i].status, descrT,
e->event.notify60[i].time, e->event.notify60[i].remote_ip, e->event.notify60[i].remote_port,
e->event.notify60[i].version);
@@ -617,12 +617,12 @@ retry:
{
// Loadup fields
const char *__fmnumber = gg_pubdir50_get(res, i, GG_PUBDIR50_UIN);
- TCHAR *__nickname = mir_utf8decodeT(gg_pubdir50_get(res, i, GG_PUBDIR50_NICKNAME));
- TCHAR *__firstname = mir_utf8decodeT(gg_pubdir50_get(res, i, GG_PUBDIR50_FIRSTNAME));
- TCHAR *__lastname = mir_utf8decodeT(gg_pubdir50_get(res, i, GG_PUBDIR50_LASTNAME));
- TCHAR *__familyname = mir_utf8decodeT(gg_pubdir50_get(res, i, GG_PUBDIR50_FAMILYNAME));
- TCHAR *__city = mir_utf8decodeT(gg_pubdir50_get(res, i, GG_PUBDIR50_CITY));
- TCHAR *__familycity = mir_utf8decodeT(gg_pubdir50_get(res, i, GG_PUBDIR50_FAMILYCITY));
+ wchar_t *__nickname = mir_utf8decodeT(gg_pubdir50_get(res, i, GG_PUBDIR50_NICKNAME));
+ wchar_t *__firstname = mir_utf8decodeT(gg_pubdir50_get(res, i, GG_PUBDIR50_FIRSTNAME));
+ wchar_t *__lastname = mir_utf8decodeT(gg_pubdir50_get(res, i, GG_PUBDIR50_LASTNAME));
+ wchar_t *__familyname = mir_utf8decodeT(gg_pubdir50_get(res, i, GG_PUBDIR50_FAMILYNAME));
+ wchar_t *__city = mir_utf8decodeT(gg_pubdir50_get(res, i, GG_PUBDIR50_CITY));
+ wchar_t *__familycity = mir_utf8decodeT(gg_pubdir50_get(res, i, GG_PUBDIR50_FAMILYCITY));
const char *__birthyear = gg_pubdir50_get(res, i, GG_PUBDIR50_BIRTHYEAR);
const char *__gender = gg_pubdir50_get(res, i, GG_PUBDIR50_GENDER);
const char *__status = gg_pubdir50_get(res, i, GG_PUBDIR50_STATUS);
@@ -632,10 +632,10 @@ retry:
debugLogA("mainthread() (%x): Search result for uin %d, seq %d.", this, uin, res->seq);
if (res->seq == GG_SEQ_SEARCH)
{
- TCHAR strFmt1[64];
- TCHAR strFmt2[64];
+ wchar_t strFmt1[64];
+ wchar_t strFmt2[64];
- _tcsncpy_s(strFmt2, pcli->pfnGetStatusModeDescription( status_gg2m(atoi(__status)), 0), _TRUNCATE);
+ wcsncpy_s(strFmt2, pcli->pfnGetStatusModeDescription( status_gg2m(atoi(__status)), 0), _TRUNCATE);
if (__city) {
mir_sntprintf(strFmt1, L", %s %s", TranslateT("City:"), __city);
mir_tstrncat(strFmt2, strFmt1, _countof(strFmt2) - mir_tstrlen(strFmt2));
@@ -655,11 +655,11 @@ retry:
memset(&psr, 0, sizeof(psr));
psr.cbSize = sizeof(psr);
psr.flags = PSR_TCHAR;
- psr.nick.t = __nickname;
- psr.firstName.t = __firstname;
- psr.lastName.t = __lastname;
- psr.email.t = strFmt2;
- psr.id.t = _ultot(uin, strFmt1, 10);
+ psr.nick.w = __nickname;
+ psr.firstName.w = __firstname;
+ psr.lastName.w = __lastname;
+ psr.email.w = strFmt2;
+ psr.id.w = _ultot(uin, strFmt1, 10);
psr.uin = uin;
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE) 1, (LPARAM)&psr);
}
@@ -757,7 +757,7 @@ retry:
// Status (deprecated)
case GG_EVENT_STATUS:
{
- TCHAR *descrT = mir_utf8decodeT(e->event.status.descr);
+ wchar_t *descrT = mir_utf8decodeT(e->event.status.descr);
changecontactstatus(e->event.status.uin, e->event.status.status, descrT, 0, 0, 0, 0);
mir_free(descrT);
}
@@ -770,7 +770,7 @@ retry:
int oldstatus = getWord(hContact, GG_KEY_STATUS, (WORD)ID_STATUS_OFFLINE);
uin_t uin = (uin_t)getDword(GG_KEY_UIN, 0);
- TCHAR *descrT = mir_utf8decodeT(e->event.status60.descr);
+ wchar_t *descrT = mir_utf8decodeT(e->event.status60.descr);
if (e->event.status60.uin == uin)
{
@@ -822,19 +822,19 @@ retry:
// Check if groupchat
if (e->event.msg.recipients_count && gc_enabled && !getByte(GG_KEY_IGNORECONF, GG_KEYDEF_IGNORECONF))
{
- TCHAR *chat = gc_getchat(e->event.msg.sender, e->event.msg.recipients, e->event.msg.recipients_count);
+ wchar_t *chat = gc_getchat(e->event.msg.sender, e->event.msg.recipients, e->event.msg.recipients_count);
if (chat)
{
- TCHAR id[32];
+ wchar_t id[32];
UIN2IDT(e->event.msg.sender, id);
GCDEST gcd = { m_szModuleName, chat, GC_EVENT_MESSAGE };
GCEVENT gce = { sizeof(gce), &gcd };
time_t t = time(NULL);
gce.ptszUID = id;
- TCHAR* messageT = mir_utf8decodeT(e->event.msg.message);
+ wchar_t* messageT = mir_utf8decodeT(e->event.msg.message);
gce.ptszText = messageT;
- gce.ptszNick = (TCHAR*) pcli->pfnGetContactDisplayName( getcontact(e->event.msg.sender, 1, 0, NULL), 0);
+ gce.ptszNick = (wchar_t*) pcli->pfnGetContactDisplayName( getcontact(e->event.msg.sender, 1, 0, NULL), 0);
gce.time = (!(e->event.msg.msgclass & GG_CLASS_OFFLINE) || e->event.msg.time > (t - timeDeviation)) ? t : e->event.msg.time;
gce.dwFlags = GCEF_ADDTOLOG;
debugLog(L"mainthread() (%x): Conference message to room %s & id %s.", this, chat, id);
@@ -886,18 +886,18 @@ retry:
case GG_EVENT_MULTILOGON_MSG:
if (e->event.multilogon_msg.recipients_count && gc_enabled && !getByte(GG_KEY_IGNORECONF, GG_KEYDEF_IGNORECONF))
{
- TCHAR *chat = gc_getchat(e->event.multilogon_msg.sender, e->event.multilogon_msg.recipients, e->event.multilogon_msg.recipients_count);
+ wchar_t *chat = gc_getchat(e->event.multilogon_msg.sender, e->event.multilogon_msg.recipients, e->event.multilogon_msg.recipients_count);
if (chat)
{
- TCHAR id[32];
+ wchar_t id[32];
UIN2IDT(getDword(GG_KEY_UIN, 0), id);
GCDEST gcd = { m_szModuleName, chat, GC_EVENT_MESSAGE };
GCEVENT gce = { sizeof(gce), &gcd };
gce.ptszUID = id;
- TCHAR* messageT = mir_utf8decodeT(e->event.multilogon_msg.message);
+ wchar_t* messageT = mir_utf8decodeT(e->event.multilogon_msg.message);
gce.ptszText = messageT;
- TCHAR* nickT;
+ wchar_t* nickT;
if (!getTString(GG_KEY_NICK, &dbv)){
nickT = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
@@ -965,12 +965,12 @@ retry:
sessions_updatedlg();
if (ServiceExists(MS_POPUP_ADDPOPUPCLASS))
{
- const TCHAR* szText = time(NULL) - logonTime > 3
+ const wchar_t* szText = time(NULL) - logonTime > 3
? TranslateT("You have logged in at another location")
: TranslateT("You are logged in at another location");
for (i = 0; i < e->event.multilogon_info.count; i++)
{
- TCHAR szMsg[MAX_SECONDLINE];
+ wchar_t szMsg[MAX_SECONDLINE];
if (iIndexes && iIndexes[i])
continue;
@@ -1052,14 +1052,14 @@ retry:
debugLogA("mainthread() (%x): Client: %d, File ack filename \"%s\" size %d.", this, dcc7->peer_uin,
dcc7->filename, dcc7->size);
- TCHAR* filenameT = mir_a2t((char*)dcc7->filename);
+ wchar_t* filenameT = mir_a2t((char*)dcc7->filename);
PROTORECVFILET pre = {0};
pre.dwFlags = PRFF_TCHAR;
pre.fileCount = 1;
pre.timestamp = time(NULL);
- pre.descr.t = filenameT;
- pre.files.t = &filenameT;
+ pre.descr.w = filenameT;
+ pre.files.w = &filenameT;
pre.lParam = (LPARAM)dcc7;
ProtoChainRecvFile((UINT_PTR)dcc7->contact, &pre);
@@ -1146,8 +1146,8 @@ retry:
case GG_EVENT_XML_ACTION:
if (getByte(GG_KEY_ENABLEAVATARS, GG_KEYDEF_ENABLEAVATARS)) {
HXML hXml;
- TCHAR *xmlAction;
- TCHAR *tag;
+ wchar_t *xmlAction;
+ wchar_t *tag;
xmlAction = mir_a2t(e->event.xml_action.data);
tag = mir_a2t("events");
@@ -1307,7 +1307,7 @@ int GGPROTO::contactdeleted(WPARAM hContact, LPARAM)
////////////////////////////////////////////////////////////
// When db settings changed
-static TCHAR* sttSettingToTchar( DBVARIANT* value )
+static wchar_t* sttSettingToTchar( DBVARIANT* value )
{
switch(value->type) {
case DBVT_ASCIIZ:
@@ -1342,7 +1342,7 @@ int GGPROTO::dbsettingchanged(WPARAM hContact, LPARAM lParam)
// Contact is being renamed
if (gc_enabled && !strcmp(cws->szModule, m_szModuleName) && !strcmp(cws->szSetting, GG_KEY_NICK)){
- TCHAR* ptszVal = sttSettingToTchar(&(cws->value));
+ wchar_t* ptszVal = sttSettingToTchar(&(cws->value));
if(ptszVal==NULL) return 0;
// Groupchat window contact is being renamed
@@ -1375,7 +1375,7 @@ int GGPROTO::dbsettingchanged(WPARAM hContact, LPARAM lParam)
{
// If name changed... change nick
if (!strcmp(cws->szSetting, "MyHandle")){
- TCHAR* ptszVal = sttSettingToTchar(&(cws->value));
+ wchar_t* ptszVal = sttSettingToTchar(&(cws->value));
if(ptszVal==NULL) return 0;
setTString(hContact, GG_KEY_NICK, ptszVal);
mir_free(ptszVal);
@@ -1518,7 +1518,7 @@ void GGPROTO::notifyall()
////////////////////////////////////////////////////////////
// Get contact by uin
//
-MCONTACT GGPROTO::getcontact(uin_t uin, int create, int inlist, TCHAR *szNick)
+MCONTACT GGPROTO::getcontact(uin_t uin, int create, int inlist, wchar_t *szNick)
{
#ifdef DEBUGMODE
debugLogA("getcontact(): uin=%d create=%d inlist=%d", uin, create, inlist);
@@ -1570,7 +1570,7 @@ MCONTACT GGPROTO::getcontact(uin_t uin, int create, int inlist, TCHAR *szNick)
gg_pubdir50(sess, req);
gg_LeaveCriticalSection(&sess_mutex, "getcontact", 31, 1, "sess_mutex", 1);
gg_pubdir50_free(req);
- TCHAR* uinT = mir_a2t(ditoa(uin));
+ wchar_t* uinT = mir_a2t(ditoa(uin));
setTString(hContact, GG_KEY_NICK, uinT);
mir_free(uinT);
debugLogA("getcontact(): Search for nick on uin: %d", uin);
@@ -1591,7 +1591,7 @@ MCONTACT GGPROTO::getcontact(uin_t uin, int create, int inlist, TCHAR *szNick)
// Change status of the contact with our own UIN (if got yourself added to the contact list)
if (getDword(GG_KEY_UIN, 0) == uin) {
gg_EnterCriticalSection(&modemsg_mutex, "getcontact", 33, "modemsg_mutex", 1);
- TCHAR *szMsg = mir_tstrdup(getstatusmsg(m_iStatus));
+ wchar_t *szMsg = mir_tstrdup(getstatusmsg(m_iStatus));
gg_LeaveCriticalSection(&modemsg_mutex, "getcontact", 33, 1, "modemsg_mutex", 1);
changecontactstatus(uin, status_m2gg(m_iStatus, szMsg != NULL), szMsg, 0, 0, 0, 0);
mir_free(szMsg);
@@ -1685,7 +1685,7 @@ int GGPROTO::status_gg2m(int status)
////////////////////////////////////////////////////////////
// Called when contact status is changed
//
-void GGPROTO::changecontactstatus(uin_t uin, int status, const TCHAR *idescr, int, uint32_t remote_ip, uint16_t remote_port, uint32_t version)
+void GGPROTO::changecontactstatus(uin_t uin, int status, const wchar_t *idescr, int, uint32_t remote_ip, uint16_t remote_port, uint32_t version)
{
#ifdef DEBUGMODE
debugLogA("changecontactstatus(): uin=%d status=%d", uin, status);
diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp
index f3c500cc79..e4a593496f 100644
--- a/protocols/Gadu-Gadu/src/dialogs.cpp
+++ b/protocols/Gadu-Gadu/src/dialogs.cpp
@@ -38,9 +38,9 @@ extern INT_PTR CALLBACK gg_userutildlgproc(HWND hwndDlg, UINT msg, WPARAM wParam
static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule, char *szSetting, int special, int disableIfUndef)
{
DBVARIANT dbv = {0};
- TCHAR str[256];
- TCHAR *ptstr = NULL;
- TCHAR* valT = NULL;
+ wchar_t str[256];
+ wchar_t *ptstr = NULL;
+ wchar_t* valT = NULL;
int unspecified = 0;
dbv.type = DBVT_DELETED;
@@ -69,7 +69,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule
}
} else {
unspecified = (special == SVS_ZEROISUNSPEC && dbv.bVal == 0);
- ptstr = _itot(special == SVS_SIGNED ? dbv.cVal : dbv.bVal, str, 10);
+ ptstr = _itow(special == SVS_SIGNED ? dbv.cVal : dbv.bVal, str, 10);
}
break;
case DBVT_WORD:
@@ -84,7 +84,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule
}
else {
unspecified = (special == SVS_ZEROISUNSPEC && dbv.wVal == 0);
- ptstr = _itot(special == SVS_SIGNED ? dbv.sVal : dbv.wVal, str, 10);
+ ptstr = _itow(special == SVS_SIGNED ? dbv.sVal : dbv.wVal, str, 10);
}
break;
case DBVT_DWORD:
@@ -104,7 +104,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule
ptstr = str;
mir_sntprintf(str, L"%S", (char *)gg_version2string(dbv.dVal));
} else {
- ptstr = _itot(special == SVS_SIGNED ? dbv.lVal : dbv.dVal, str, 10);
+ ptstr = _itow(special == SVS_SIGNED ? dbv.lVal : dbv.dVal, str, 10);
}
break;
case DBVT_ASCIIZ:
@@ -120,7 +120,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule
unspecified = (special == SVS_ZEROISUNSPEC && dbv.pszVal[0] == '\0');
valT = mir_utf8decodeT(dbv.pszVal);
ptstr = str;
- _tcscpy_s(str, _countof(str), valT);
+ wcscpy_s(str, _countof(str), valT);
mir_free(valT);
break;
default:
@@ -170,7 +170,7 @@ void GGPROTO::checknewuser(uin_t uin, const char* passwd)
//
static void gg_optsdlgcheck(HWND hwndDlg)
{
- TCHAR text[128];
+ wchar_t text[128];
GetDlgItemText(hwndDlg, IDC_UIN, text, _countof(text));
if (text[0]) {
GetDlgItemText(hwndDlg, IDC_EMAIL, text, _countof(text));
@@ -785,7 +785,7 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
if (!dat || dat->hContact || dat->disableUpdate)
break;
{
- TCHAR text[256];
+ wchar_t text[256];
GGPROTO *gg = dat->gg;
if (!gg->isonline())
@@ -873,22 +873,22 @@ int GGPROTO::options_init(WPARAM wParam, LPARAM)
odp.flags = ODPF_TCHAR;
odp.position = 1003000;
odp.hInstance = hInstance;
- odp.ptszGroup = LPGENT("Network");
- odp.ptszTitle = m_tszUserName;
+ odp.pwszGroup = LPGENW("Network");
+ odp.pwszTitle = m_tszUserName;
odp.dwInitParam = (LPARAM)this;
odp.flags = ODPF_TCHAR | ODPF_BOLDGROUPS | ODPF_DONTTRANSLATE;
- odp.ptszTab = LPGENT("General");
+ odp.pwszTab = LPGENW("General");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GG_GENERAL);
odp.pfnDlgProc = gg_genoptsdlgproc;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Conference");
+ odp.pwszTab = LPGENW("Conference");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GG_CONFERENCE);
odp.pfnDlgProc = gg_confoptsdlgproc;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Advanced");
+ odp.pwszTab = LPGENW("Advanced");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GG_ADVANCED);
odp.pfnDlgProc = gg_advoptsdlgproc;
Options_AddPage(wParam, &odp);
@@ -923,7 +923,7 @@ int GGPROTO::details_init(WPARAM wParam, LPARAM lParam)
odp.pfnDlgProc = gg_detailsdlgproc;
odp.position = -1900000000;
odp.pszTemplate = pszTemplate;
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
odp.dwInitParam = (LPARAM)this;
UserInfo_AddPage(wParam, &odp);
diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp
index 2b65aefdb4..14a82d4b58 100644
--- a/protocols/Gadu-Gadu/src/filetransfer.cpp
+++ b/protocols/Gadu-Gadu/src/filetransfer.cpp
@@ -381,14 +381,14 @@ void __cdecl GGPROTO::dccmainthread(void*)
{
// Make new ggtransfer struct
local_dcc->contact = (void*)getcontact(local_dcc->peer_uin, 0, 0, NULL);
- TCHAR* filenameT = mir_utf8decodeT((char*)dcc->file_info.filename);
+ wchar_t* filenameT = mir_utf8decodeT((char*)dcc->file_info.filename);
PROTORECVFILET pre = {0};
pre.dwFlags = PRFF_TCHAR;
pre.fileCount = 1;
pre.timestamp = time(NULL);
- pre.descr.t = filenameT;
- pre.files.t = &filenameT;
+ pre.descr.w = filenameT;
+ pre.files.w = &filenameT;
pre.lParam = (LPARAM)local_dcc;
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 7, "ft_mutex", 1);
@@ -659,7 +659,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
debugLogA("dccmainthread(): end. DCC Server Thread Ending");
}
-HANDLE GGPROTO::dccfileallow(HANDLE hTransfer, const TCHAR* szPath)
+HANDLE GGPROTO::dccfileallow(HANDLE hTransfer, const wchar_t* szPath)
{
struct gg_dcc *dcc = (struct gg_dcc *) hTransfer;
char fileName[MAX_PATH], *path = mir_t2a(szPath);
@@ -677,7 +677,7 @@ HANDLE GGPROTO::dccfileallow(HANDLE hTransfer, const TCHAR* szPath)
if ((dcc->file_fd = _open(fileName, _O_WRONLY | _O_APPEND | _O_BINARY | _O_CREAT, _S_IREAD | _S_IWRITE)) == -1)
{
debugLogA("dccfileallow(): Failed to create file \"%s\". errno=%d: %s", fileName, errno, strerror(errno));
- TCHAR error[512];
+ wchar_t error[512];
mir_sntprintf(error, TranslateT("Cannot create transfer file. ERROR: %d: %s (dcc)\n%s"), errno, _tcserror(errno), szPath);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
ProtoBroadcastAck((UINT_PTR)dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc, 0);
@@ -699,7 +699,7 @@ HANDLE GGPROTO::dccfileallow(HANDLE hTransfer, const TCHAR* szPath)
return hTransfer;
}
-HANDLE GGPROTO::dcc7fileallow(HANDLE hTransfer, const TCHAR* szPath)
+HANDLE GGPROTO::dcc7fileallow(HANDLE hTransfer, const wchar_t* szPath)
{
struct gg_dcc7 *dcc7 = (struct gg_dcc7 *) hTransfer;
char fileName[MAX_PATH], *path = mir_t2a(szPath);
@@ -726,7 +726,7 @@ HANDLE GGPROTO::dcc7fileallow(HANDLE hTransfer, const TCHAR* szPath)
if ((dcc7->file_fd = _open(fileName, _O_WRONLY | _O_APPEND | _O_BINARY | _O_CREAT, _S_IREAD | _S_IWRITE)) == -1)
{
debugLogA("dcc7fileallow(): Failed to create file \"%s\". errno=%d: %s", fileName, errno, strerror(errno));
- TCHAR error[512];
+ wchar_t error[512];
mir_sntprintf(error, TranslateT("Cannot create transfer file. ERROR: %d: %s (dcc7)\n%s"), errno, _tcserror(errno), szPath);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
gg_dcc7_reject(dcc7, GG_DCC7_REJECT_USER);
@@ -850,7 +850,7 @@ int GGPROTO::dcc7filecancel(HANDLE hTransfer)
////////////////////////////////////////////////////////////
// File receiving allowed
//
-HANDLE GGPROTO::FileAllow(MCONTACT, HANDLE hTransfer, const TCHAR* szPath)
+HANDLE GGPROTO::FileAllow(MCONTACT, HANDLE hTransfer, const wchar_t* szPath)
{
// Check if its proper dcc
struct gg_common *c = (struct gg_common *) hTransfer;
@@ -882,7 +882,7 @@ int GGPROTO::FileCancel(MCONTACT, HANDLE hTransfer)
////////////////////////////////////////////////////////////
// File receiving denied
//
-int GGPROTO::FileDeny(MCONTACT, HANDLE hTransfer, const TCHAR *)
+int GGPROTO::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t *)
{
// Check if its proper dcc
struct gg_common *c = (struct gg_common *) hTransfer;
@@ -906,7 +906,7 @@ int GGPROTO::RecvFile(MCONTACT hContact, PROTORECVFILET* pre)
////////////////////////////////////////////////////////////
// Called when user sends a file
//
-HANDLE GGPROTO::SendFile(MCONTACT hContact, const TCHAR *, TCHAR** ppszFiles)
+HANDLE GGPROTO::SendFile(MCONTACT hContact, const wchar_t *, wchar_t** ppszFiles)
{
char *bslash, *filename;
DWORD ip, ver;
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp
index 62b12b934b..11c44a47de 100644
--- a/protocols/Gadu-Gadu/src/gg.cpp
+++ b/protocols/Gadu-Gadu/src/gg.cpp
@@ -55,14 +55,14 @@ static unsigned long crc_table[256];
//////////////////////////////////////////////////////////
// Extra winsock function for error description
//
-TCHAR* ws_strerror(int code)
+wchar_t* ws_strerror(int code)
{
- static TCHAR err_desc[160];
+ static wchar_t err_desc[160];
// Not a windows error display WinSock
if (code == 0)
{
- TCHAR buff[128];
+ wchar_t buff[128];
int len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, WSAGetLastError(), 0, buff, _countof(buff), NULL);
if (len == 0)
mir_sntprintf(err_desc, L"WinSock %u: Unknown error.", WSAGetLastError());
@@ -132,7 +132,7 @@ unsigned long crc_get(char *mem)
// http_error_string()
//
// returns http error text
-const TCHAR *http_error_string(int h)
+const wchar_t *http_error_string(int h)
{
switch (h)
{
@@ -173,22 +173,22 @@ void GGPROTO::cleanuplastplugin(DWORD version)
if (version < PLUGIN_MAKE_VERSION(0, 11, 0, 2)){
debugLogA("cleanuplastplugin() 1: version=%d Cleaning junk avatar files from < 0.11.0.2", version);
- TCHAR avatarsPath[MAX_PATH];
+ wchar_t avatarsPath[MAX_PATH];
mir_sntprintf(avatarsPath, L"%s\\%s", VARST( L"%miranda_avatarcache%"), m_tszUserName);
debugLog(L"cleanuplastplugin() 1: miranda_avatarcache = %s", avatarsPath);
- TCHAR spec[MAX_PATH + 10];
+ wchar_t spec[MAX_PATH + 10];
mir_sntprintf(spec, L"%s\\*.(null)", avatarsPath);
WIN32_FIND_DATA ffd;
HANDLE hFind = FindFirstFile(spec, &ffd);
if (hFind != INVALID_HANDLE_VALUE) {
do {
- TCHAR filePathT [2*MAX_PATH + 10];
+ wchar_t filePathT [2*MAX_PATH + 10];
mir_sntprintf(filePathT, L"%s\\%s", avatarsPath, ffd.cFileName);
- if (!_taccess(filePathT, 0)){
+ if (!_waccess(filePathT, 0)){
debugLog(L"cleanuplastplugin() 1: remove file = %s", filePathT);
- _tremove(filePathT);
+ _wremove(filePathT);
}
} while (FindNextFile(hFind, &ffd) != 0);
FindClose(hFind);
@@ -238,7 +238,7 @@ static int gg_prebuildcontactmenu(WPARAM hContact, LPARAM)
if (gg->getDword(hContact, GG_KEY_UIN, 0) == gg->getByte(GG_KEY_UIN, 0) || gg->isChatRoom(hContact) || db_get_b(hContact, "CList", "NotOnList", 0))
Menu_ShowItem(gg->hBlockMenuItem, false);
else
- Menu_ModifyItem(gg->hBlockMenuItem, gg->getByte(hContact, GG_KEY_BLOCK, 0) ? LPGENT("&Unblock") : LPGENT("&Block"));
+ Menu_ModifyItem(gg->hBlockMenuItem, gg->getByte(hContact, GG_KEY_BLOCK, 0) ? LPGENW("&Unblock") : LPGENW("&Block"));
return 0;
}
@@ -289,12 +289,12 @@ void GGPROTO::menus_init()
mi.root = hRoot;
mi.flags = CMIF_TCHAR;
- mi.name.t = LPGENT("Conference");
+ mi.name.w = LPGENW("Conference");
mi.position = 200001;
mi.hIcolibItem = iconList[14].hIcolib;
HGENMENU hGCRoot = Menu_AddProtoMenuItem(&mi, m_szModuleName);
- mi.name.t = LPGENT("Contact list");
+ mi.name.w = LPGENW("Contact list");
mi.position = 200002;
mi.hIcolibItem = iconList[7].hIcolib;
HGENMENU hCLRoot = Menu_AddProtoMenuItem(&mi, m_szModuleName);
@@ -307,7 +307,7 @@ void GGPROTO::menus_init()
//////////////////////////////////////////////////////////
// Module instance initialization
//
-static GGPROTO *gg_proto_init(const char* pszProtoName, const TCHAR* tszUserName)
+static GGPROTO *gg_proto_init(const char* pszProtoName, const wchar_t* tszUserName)
{
GGPROTO *gg = new GGPROTO(pszProtoName, tszUserName);
g_Instances.insert(gg);
diff --git a/protocols/Gadu-Gadu/src/gg.h b/protocols/Gadu-Gadu/src/gg.h
index 4dc5f9bf3b..34e753122c 100644
--- a/protocols/Gadu-Gadu/src/gg.h
+++ b/protocols/Gadu-Gadu/src/gg.h
@@ -101,7 +101,7 @@ typedef struct
{
uin_t *recipients;
int recipients_count;
- TCHAR id[32];
+ wchar_t id[32];
BOOL ignore;
} GGGC;
@@ -306,11 +306,11 @@ extern IconItem iconList[];
// Methods
/* Helper functions */
-const TCHAR *http_error_string(int h);
+const wchar_t *http_error_string(int h);
unsigned long crc_get(char *mem);
int gg_normalizestatus(int status);
char *gg_status2db(int status, const char *suffix);
-TCHAR *ws_strerror(int code);
+wchar_t *ws_strerror(int code);
char *as_strerror(int code);
uint32_t swap32(uint32_t x);
const char *gg_version2string(int v);
@@ -329,7 +329,7 @@ void gg_links_instancemenu_init();
void gg_links_init();
#define UIN2IDA(uin,id) _itoa(uin,id,10)
-#define UIN2IDT(uin,id) _itot(uin,id,10)
+#define UIN2IDT(uin,id) _itow(uin,id,10)
// Debug functions
const char *ggdebug_eventtype(gg_event *e);
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp
index 81eb4f0bf6..10ea01e41b 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.cpp
+++ b/protocols/Gadu-Gadu/src/gg_proto.cpp
@@ -21,7 +21,7 @@
#include "gg.h"
-GGPROTO::GGPROTO(const char *pszProtoName, const TCHAR *tszUserName) :
+GGPROTO::GGPROTO(const char *pszProtoName, const wchar_t *tszUserName) :
PROTO<GGPROTO>(pszProtoName, tszUserName),
avatar_requests(1, NumericKeySortT),
avatar_transfers(1, NumericKeySortT)
@@ -39,7 +39,7 @@ GGPROTO::GGPROTO(const char *pszProtoName, const TCHAR *tszUserName) :
InitializeCriticalSection(&sessions_mutex);
// Register m_hNetlibUser user
- TCHAR name[128];
+ wchar_t name[128];
mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = { 0 };
@@ -67,8 +67,8 @@ GGPROTO::GGPROTO(const char *pszProtoName, const TCHAR *tszUserName) :
db_set_resident(m_szModuleName, GG_KEY_AVATARREQUESTED);
- TCHAR szPath[MAX_PATH];
- mir_sntprintf(szPath, L"%s\\%s\\ImageCache", (TCHAR*)VARST(L"%miranda_userdata%"), m_tszUserName);
+ wchar_t szPath[MAX_PATH];
+ mir_sntprintf(szPath, L"%s\\%s\\ImageCache", (wchar_t*)VARST(L"%miranda_userdata%"), m_tszUserName);
hImagesFolder = FoldersRegisterCustomPathT(LPGEN("Images"), m_szModuleName, szPath, m_tszUserName);
DWORD dwVersion;
@@ -131,9 +131,9 @@ MCONTACT GGPROTO::AddToList(int flags, PROTOSEARCHRESULT *pmsr)
if (psr->cbSize == sizeof(GGSEARCHRESULT))
uin = psr->uin;
else
- uin = _ttoi(psr->id.t);
+ uin = _wtoi(psr->id.w);
- return getcontact(uin, 1, flags & PALF_TEMPORARY ? 0 : 1, psr->nick.t);
+ return getcontact(uin, 1, flags & PALF_TEMPORARY ? 0 : 1, psr->nick.w);
}
//////////////////////////////////////////////////////////
@@ -252,7 +252,7 @@ void __cdecl GGPROTO::searchthread(void *)
//////////////////////////////////////////////////////////
// when basic search
//
-HANDLE GGPROTO::SearchBasic(const TCHAR *id)
+HANDLE GGPROTO::SearchBasic(const wchar_t *id)
{
if (!isonline())
return 0;
@@ -289,7 +289,7 @@ HANDLE GGPROTO::SearchBasic(const TCHAR *id)
//////////////////////////////////////////////////////////
// search by details
//
-HANDLE GGPROTO::SearchByName(const TCHAR *nick, const TCHAR *firstName, const TCHAR *lastName)
+HANDLE GGPROTO::SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName)
{
// Check if connected and if there's a search data
if (!isonline())
@@ -377,7 +377,7 @@ HWND GGPROTO::SearchAdvanced(HWND hwndDlg)
CMStringA szQuery;
// Fetch search data
- TCHAR text[64];
+ wchar_t text[64];
GetDlgItemText(hwndDlg, IDC_FIRSTNAME, text, _countof(text));
if (mir_tstrlen(text)) {
T2Utf firstName_utf8(text);
@@ -622,10 +622,10 @@ HANDLE GGPROTO::GetAwayMsg(MCONTACT hContact)
// when away message is being set
// registered as ProtoService PS_SETAWAYMSGT
//
-int GGPROTO::SetAwayMsg(int iStatus, const TCHAR *newMsg)
+int GGPROTO::SetAwayMsg(int iStatus, const wchar_t *newMsg)
{
int status = gg_normalizestatus(iStatus);
- TCHAR **msgPtr;
+ wchar_t **msgPtr;
debugLog(L"SetAwayMsg(): PS_SETAWAYMSG(%d, \"%s\".)", iStatus, newMsg);
diff --git a/protocols/Gadu-Gadu/src/gg_proto.h b/protocols/Gadu-Gadu/src/gg_proto.h
index 6508103fef..9107c49cdd 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.h
+++ b/protocols/Gadu-Gadu/src/gg_proto.h
@@ -24,7 +24,7 @@
struct GGPROTO : public PROTO<GGPROTO>
{
- GGPROTO( const char*, const TCHAR* );
+ GGPROTO( const char*, const wchar_t* );
~GGPROTO();
//====================================================================================
@@ -33,28 +33,28 @@ struct GGPROTO : public PROTO<GGPROTO>
virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
- virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath );
+ virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath );
virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer );
- virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason );
+ virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason );
virtual DWORD_PTR __cdecl GetCaps( int type, MCONTACT hContact = NULL );
virtual int __cdecl GetInfo(MCONTACT hContact, int infoType );
- virtual HANDLE __cdecl SearchBasic( const TCHAR* id );
- virtual HANDLE __cdecl SearchByName( const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName );
+ virtual HANDLE __cdecl SearchBasic( const wchar_t* id );
+ virtual HANDLE __cdecl SearchByName( const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName );
virtual HWND __cdecl SearchAdvanced( HWND owner );
virtual HWND __cdecl CreateExtendedSearchUI( HWND owner );
virtual int __cdecl RecvFile(MCONTACT hContact, PROTORECVFILET* );
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles );
+ virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles );
virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg );
virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode );
virtual int __cdecl SetStatus( int iNewStatus );
virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact );
- virtual int __cdecl SetAwayMsg( int m_iStatus, const TCHAR* msg );
+ virtual int __cdecl SetAwayMsg( int m_iStatus, const wchar_t* msg );
virtual int __cdecl UserIsTyping(MCONTACT hContact, int type );
@@ -97,7 +97,7 @@ struct GGPROTO : public PROTO<GGPROTO>
void notifyuser(MCONTACT hContact, int refresh);
void setalloffline();
void disconnect();
- MCONTACT getcontact(uin_t uin, int create, int inlist, TCHAR *nick);
+ MCONTACT getcontact(uin_t uin, int create, int inlist, wchar_t *nick);
void __cdecl mainthread(void *empty);
int isonline();
int refreshstatus(int status);
@@ -107,8 +107,8 @@ struct GGPROTO : public PROTO<GGPROTO>
int contactdeleted(WPARAM wParam, LPARAM lParam);
int dbsettingchanged(WPARAM wParam, LPARAM lParam);
void notifyall();
- void changecontactstatus(uin_t uin, int status, const TCHAR *idescr, int time, uint32_t remote_ip, uint16_t remote_port, uint32_t version);
- TCHAR *getstatusmsg(int status);
+ void changecontactstatus(uin_t uin, int status, const wchar_t *idescr, int time, uint32_t remote_ip, uint16_t remote_port, uint32_t version);
+ wchar_t *getstatusmsg(int status);
void dccstart();
void dccconnect(uin_t uin);
int gettoken(GGTOKEN *token);
@@ -117,11 +117,11 @@ struct GGPROTO : public PROTO<GGPROTO>
void menus_init();
/* Avatar functions */
- void getAvatarFilename(MCONTACT hContact, TCHAR *pszDest, int cbLen);
+ void getAvatarFilename(MCONTACT hContact, wchar_t *pszDest, int cbLen);
void requestAvatarTransfer(MCONTACT hContact, char *szAvatarURL);
void requestAvatarInfo(MCONTACT hContact, int iWaitFor);
void getOwnAvatar();
- void setAvatar(const TCHAR *szFilename);
+ void setAvatar(const wchar_t *szFilename);
bool getAvatarFileInfo(uin_t uin, char **avatarurl, char **avatarts);
INT_PTR __cdecl getavatarcaps(WPARAM wParam, LPARAM lParam);
@@ -136,14 +136,14 @@ struct GGPROTO : public PROTO<GGPROTO>
void __cdecl setavatarthread(void*);
/* File transfer functions */
- HANDLE fileallow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath);
+ HANDLE fileallow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath);
int filecancel(MCONTACT hContact, HANDLE hTransfer);
- int filedeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason);
+ int filedeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason);
int recvfile(MCONTACT hContact, PROTORECVFILET* pre);
- HANDLE sendfile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles);
+ HANDLE sendfile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles);
- HANDLE dccfileallow(HANDLE hTransfer, const TCHAR* szPath);
- HANDLE dcc7fileallow(HANDLE hTransfer, const TCHAR* szPath);
+ HANDLE dccfileallow(HANDLE hTransfer, const wchar_t* szPath);
+ HANDLE dcc7fileallow(HANDLE hTransfer, const wchar_t* szPath);
int dccfiledeny(HANDLE hTransfer);
int dcc7filedeny(HANDLE hTransfer);
@@ -170,7 +170,7 @@ struct GGPROTO : public PROTO<GGPROTO>
int img_shutdown();
int img_sendonrequest(gg_event* e);
BOOL img_opened(uin_t uin);
- void *img_loadpicture(gg_event* e, TCHAR *szFileName);
+ void *img_loadpicture(gg_event* e, wchar_t *szFileName);
int img_display(MCONTACT hContact, void *img);
int img_displayasmsg(MCONTACT hContact, void *img);
@@ -193,9 +193,9 @@ struct GGPROTO : public PROTO<GGPROTO>
int gc_init();
void gc_menus_init(HGENMENU hRoot);
int gc_destroy();
- TCHAR * gc_getchat(uin_t sender, uin_t *recipients, int recipients_count);
- GGGC *gc_lookup(const TCHAR *id);
- int gc_changenick(MCONTACT hContact, TCHAR *ptszNick);
+ wchar_t * gc_getchat(uin_t sender, uin_t *recipients, int recipients_count);
+ GGGC *gc_lookup(const wchar_t *id);
+ int gc_changenick(MCONTACT hContact, wchar_t *ptszNick);
int __cdecl gc_event(WPARAM wParam, LPARAM lParam);
@@ -204,7 +204,7 @@ struct GGPROTO : public PROTO<GGPROTO>
/* Popups functions */
void initpopups();
- void showpopup(const TCHAR* nickname, const TCHAR* msg, int flags);
+ void showpopup(const wchar_t* nickname, const wchar_t* msg, int flags);
/* Sessions functions */
INT_PTR __cdecl sessions_view(WPARAM wParam, LPARAM lParam);
@@ -235,12 +235,12 @@ struct GGPROTO : public PROTO<GGPROTO>
UINT_PTR timer;
struct
{
- TCHAR *online;
- TCHAR *away;
- TCHAR *dnd;
- TCHAR *freechat;
- TCHAR *invisible;
- TCHAR *offline;
+ wchar_t *online;
+ wchar_t *away;
+ wchar_t *dnd;
+ wchar_t *freechat;
+ wchar_t *invisible;
+ wchar_t *offline;
} modemsg;
HGENMENU hMainMenu[7];
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp
index 5bf54545b1..85790434eb 100644
--- a/protocols/Gadu-Gadu/src/groupchat.cpp
+++ b/protocols/Gadu-Gadu/src/groupchat.cpp
@@ -66,7 +66,7 @@ void GGPROTO::gc_menus_init(HGENMENU hRoot)
CreateProtoService(mi.pszService, &GGPROTO::gc_openconf);
mi.position = 2000050001;
mi.hIcolibItem = iconList[14].hIcolib;
- mi.name.t = LPGENT("Open &conference...");
+ mi.name.w = LPGENW("Open &conference...");
hMainMenu[0] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
// Clear ignored conferences
@@ -74,7 +74,7 @@ void GGPROTO::gc_menus_init(HGENMENU hRoot)
CreateProtoService(mi.pszService, &GGPROTO::gc_clearignored);
mi.position = 2000050002;
mi.hIcolibItem = iconList[15].hIcolib;
- mi.name.t = LPGENT("&Clear ignored conferences");
+ mi.name.w = LPGENW("&Clear ignored conferences");
hMainMenu[1] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
}
}
@@ -94,7 +94,7 @@ int GGPROTO::gc_destroy()
return 1;
}
-GGGC* GGPROTO::gc_lookup(const TCHAR *id)
+GGGC* GGPROTO::gc_lookup(const wchar_t *id)
{
GGGC *chat;
list_t l;
@@ -149,7 +149,7 @@ int GGPROTO::gc_event(WPARAM, LPARAM lParam)
// Message typed / send only if online
if (isonline() && (gch->pDest->iType == GC_USER_MESSAGE) && gch->ptszText) {
- TCHAR id[32];
+ wchar_t id[32];
UIN2IDT(uin, id);
DBVARIANT dbv;
@@ -157,7 +157,7 @@ int GGPROTO::gc_event(WPARAM, LPARAM lParam)
GCEVENT gce = { sizeof(gce), &gcd };
gce.ptszUID = id;
gce.ptszText = gch->ptszText;
- TCHAR* nickT;
+ wchar_t* nickT;
if (!getTString(GG_KEY_NICK, &dbv)){
nickT = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
@@ -188,7 +188,7 @@ int GGPROTO::gc_event(WPARAM, LPARAM lParam)
if (gch->pDest->iType == GC_USER_PRIVMESS)
{
MCONTACT hContact = NULL;
- if ((uin = _ttoi(gch->ptszUID)) && (hContact = getcontact(uin, 1, 0, NULL)))
+ if ((uin = _wtoi(gch->ptszUID)) && (hContact = getcontact(uin, 1, 0, NULL)))
CallService(MS_MSG_SENDMESSAGE, hContact, 0);
}
debugLog(L"gc_event(): Unhandled event %d, chat %x, uin %d, text \"%s\".", gch->pDest->iType, chat, uin, gch->ptszText);
@@ -207,11 +207,11 @@ typedef struct _gg_gc_echat
////////////////////////////////////////////////////////////////////////////////
// This is main groupchat initialization routine
//
-TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count)
+wchar_t* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count)
{
list_t l;
GGGC *chat;
- TCHAR id[32];
+ wchar_t id[32];
uin_t uin;
DBVARIANT dbv;
GCDEST gcd = { m_szModuleName, 0, GC_EVENT_ADDGROUP };
@@ -279,9 +279,9 @@ TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count
(getWord(GG_KEY_GC_POLICY_UNKNOWN, GG_KEYDEF_GC_POLICY_UNKNOWN) == 1 &&
unknown >= getWord(GG_KEY_GC_COUNT_UNKNOWN, GG_KEYDEF_GC_COUNT_UNKNOWN))))
{
- TCHAR *senderName = unknownSender ?
+ wchar_t *senderName = unknownSender ?
TranslateT("Unknown") : pcli->pfnGetContactDisplayName(getcontact(sender, 0, 0, NULL), 0);
- TCHAR error[256];
+ wchar_t error[256];
mir_sntprintf(error, TranslateT("%s has initiated conference with %d participants (%d unknowns).\nDo you want to participate?"),
senderName, recipients_count + 1, unknown);
chat->ignore = MessageBox(NULL, error, m_tszUserName, MB_OKCANCEL | MB_ICONEXCLAMATION) != IDOK;
@@ -302,8 +302,8 @@ TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count
}
// Create new chat window
- TCHAR status[256];
- TCHAR *senderName;
+ wchar_t status[256];
+ wchar_t *senderName;
if (sender)
{
senderName = pcli->pfnGetContactDisplayName(getcontact(sender, 1, 0, NULL), 0);
@@ -324,7 +324,7 @@ TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count
gcwindow.ptszStatusbarText = status;
// Here we put nice new hash sign
- TCHAR *name = (TCHAR*)calloc(mir_tstrlen(gcwindow.ptszName) + 2, sizeof(TCHAR));
+ wchar_t *name = (wchar_t*)calloc(mir_tstrlen(gcwindow.ptszName) + 2, sizeof(wchar_t));
*name = '#'; mir_tstrcpy(name + 1, gcwindow.ptszName);
gcwindow.ptszName = name;
@@ -352,7 +352,7 @@ TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count
{
UIN2IDT(uin, id);
- TCHAR* nickT;
+ wchar_t* nickT;
if (!getTString(GG_KEY_NICK, &dbv)) {
nickT = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
@@ -470,7 +470,7 @@ static INT_PTR CALLBACK gg_gc_openconfdlg(HWND hwndDlg, UINT message, WPARAM wPa
else if (hwndList && (count = gg_gc_countcheckmarks(hwndList)) >= 2)
{
// Create new participiants table
- TCHAR* chat;
+ wchar_t* chat;
uin_t* participants = (uin_t*)calloc(count, sizeof(uin_t));
gg->debugLogA("gg_gc_openconfdlg(): WM_COMMAND IDOK Opening new conference for %d contacts.", count);
for (MCONTACT hContact = db_find_first(); hContact && i < count; hContact = db_find_next(hContact)) {
@@ -617,7 +617,7 @@ INT_PTR GGPROTO::gc_openconf(WPARAM, LPARAM)
return 1;
}
-int GGPROTO::gc_changenick(MCONTACT hContact, TCHAR *ptszNick)
+int GGPROTO::gc_changenick(MCONTACT hContact, wchar_t *ptszNick)
{
list_t l;
uin_t uin = getDword(hContact, GG_KEY_UIN, 0);
@@ -632,7 +632,7 @@ int GGPROTO::gc_changenick(MCONTACT hContact, TCHAR *ptszNick)
// Rename this window if it's exising in the chat
if (chat->recipients[i] == uin)
{
- TCHAR id[32];
+ wchar_t id[32];
UIN2IDT(uin, id);
GCDEST gcd = { m_szModuleName, chat->id, GC_EVENT_NICK };
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp
index bd6313b5b0..a883917caf 100644
--- a/protocols/Gadu-Gadu/src/image.cpp
+++ b/protocols/Gadu-Gadu/src/image.cpp
@@ -40,7 +40,7 @@
typedef struct _GGIMAGEENTRY
{
HBITMAP hBitmap;
- TCHAR *lpszFileName;
+ wchar_t *lpszFileName;
char *lpData;
unsigned long nSize;
struct _GGIMAGEENTRY *lpNext;
@@ -212,20 +212,20 @@ int gg_img_paint(HWND hwnd, GGIMAGEENTRY *dat)
////////////////////////////////////////////////////////////////////////////////
// Returns supported image filters
//
-TCHAR *gg_img_getfilter(TCHAR *szFilter, int nSize)
+wchar_t *gg_img_getfilter(wchar_t *szFilter, int nSize)
{
- TCHAR *szFilterName, *szFilterMask;
- TCHAR *pFilter = szFilter;
+ wchar_t *szFilterName, *szFilterMask;
+ wchar_t *pFilter = szFilter;
// Match relative to ImgDecoder presence
szFilterName = TranslateT("Image files (*.bmp,*.gif,*.jpeg,*.jpg,*.png)");
szFilterMask = L"*.bmp;*.gif;*.jpeg;*.jpg;*.png";
// Make up filter
- _tcsncpy(pFilter, szFilterName, nSize);
+ wcsncpy(pFilter, szFilterName, nSize);
pFilter += mir_tstrlen(pFilter) + 1;
if (pFilter >= szFilter + nSize) return NULL;
- _tcsncpy(pFilter, szFilterMask, nSize - (pFilter - szFilter));
+ wcsncpy(pFilter, szFilterMask, nSize - (pFilter - szFilter));
pFilter += mir_tstrlen(pFilter) + 1;
if (pFilter >= szFilter + nSize) return NULL;
*pFilter = 0;
@@ -243,11 +243,11 @@ int gg_img_saveimage(HWND hwnd, GGIMAGEENTRY *dat)
GGPROTO* gg = ((GGIMAGEDLGDATA *)GetWindowLongPtr(hwnd, GWLP_USERDATA))->gg;
- TCHAR szFilter[128];
+ wchar_t szFilter[128];
gg_img_getfilter(szFilter, _countof(szFilter));
- TCHAR szFileName[MAX_PATH];
- _tcsncpy(szFileName, dat->lpszFileName, _countof(szFileName));
+ wchar_t szFileName[MAX_PATH];
+ wcsncpy(szFileName, dat->lpszFileName, _countof(szFileName));
OPENFILENAME ofn = {0};
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
@@ -259,7 +259,7 @@ int gg_img_saveimage(HWND hwnd, GGIMAGEENTRY *dat)
ofn.Flags = OFN_PATHMUSTEXIST | OFN_NOCHANGEDIR | OFN_OVERWRITEPROMPT;
if (GetSaveFileName(&ofn))
{
- FILE *fp = _tfopen(szFileName, L"w+b");
+ FILE *fp = _wfopen(szFileName, L"w+b");
if (fp)
{
fwrite(dat->lpData, dat->nSize, 1, fp);
@@ -418,7 +418,7 @@ static INT_PTR CALLBACK gg_img_dlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
// Set main window image
Window_SetIcon_IcoLib(hwndDlg, GetIconHandle(IDI_IMAGE));
- TCHAR *szName = pcli->pfnGetContactDisplayName(dat->hContact, 0), szTitle[128];
+ wchar_t *szName = pcli->pfnGetContactDisplayName(dat->hContact, 0), szTitle[128];
if (dat->bReceiving)
mir_sntprintf(szTitle, TranslateT("Image from %s"), szName);
else
@@ -494,7 +494,7 @@ static INT_PTR CALLBACK gg_img_dlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (dat->bReceiving)
{
- TCHAR szTitle[128];
+ wchar_t szTitle[128];
mir_sntprintf(szTitle, L"%s (%d / %d)", img->lpszFileName, dat->nImg, dat->nImgTotal);
SetDlgItemText(hwndDlg, IDC_IMG_NAME, szTitle);
}
@@ -660,8 +660,8 @@ static INT_PTR CALLBACK gg_img_dlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case WM_CHOOSEIMG:
{
- TCHAR szFilter[128];
- TCHAR szFileName[MAX_PATH];
+ wchar_t szFilter[128];
+ wchar_t szFileName[MAX_PATH];
OPENFILENAME ofn = {0};
gg_img_getfilter(szFilter, _countof(szFilter));
@@ -738,16 +738,16 @@ GGIMAGEDLGDATA *gg_img_recvdlg(GGPROTO *gg, MCONTACT hContact)
// Checks if an image is already saved to the specified path
// Returns 1 if yes, 0 if no or -1 if different image on this path is found
//
-int gg_img_isexists(TCHAR *szPath, GGIMAGEENTRY *dat)
+int gg_img_isexists(wchar_t *szPath, GGIMAGEENTRY *dat)
{
struct _stat st;
- if (_tstat(szPath, &st) != 0)
+ if (_wstat(szPath, &st) != 0)
return 0;
if (st.st_size == dat->nSize)
{
- FILE *fp = _tfopen(szPath, L"rb");
+ FILE *fp = _wfopen(szPath, L"rb");
if (!fp) return 0;
char *lpData = (char*)mir_alloc(dat->nSize);
if (fread(lpData, 1, dat->nSize, fp) == dat->nSize)
@@ -770,11 +770,11 @@ int gg_img_isexists(TCHAR *szPath, GGIMAGEENTRY *dat)
////////////////////////////////////////////////////////////////////////////
// Determine if image's file name has the proper extension
//
-TCHAR *gg_img_hasextension(TCHAR *filename)
+wchar_t *gg_img_hasextension(wchar_t *filename)
{
if (filename != NULL && *filename != '\0')
{
- TCHAR *imgtype = _tcsrchr(filename, '.');
+ wchar_t *imgtype = wcsrchr(filename, '.');
if (imgtype != NULL)
{
size_t len = mir_tstrlen(imgtype);
@@ -797,12 +797,12 @@ TCHAR *gg_img_hasextension(TCHAR *filename)
int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img)
{
GGIMAGEENTRY *dat = (GGIMAGEENTRY *)img;
- TCHAR szPath[MAX_PATH], path[MAX_PATH], *pImgext, imgext[6];
+ wchar_t szPath[MAX_PATH], path[MAX_PATH], *pImgext, imgext[6];
size_t tPathLen;
int i, res;
if (hImagesFolder == NULL || FoldersGetCustomPathT(hImagesFolder, path, MAX_PATH, L"")) {
- TCHAR *tmpPath = Utils_ReplaceVarsT( L"%miranda_userdata%");
+ wchar_t *tmpPath = Utils_ReplaceVarsT( L"%miranda_userdata%");
tPathLen = mir_sntprintf(szPath, L"%s\\%s\\ImageCache", tmpPath, m_tszUserName);
mir_free(tmpPath);
}
@@ -811,13 +811,13 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img)
tPathLen = mir_tstrlen(szPath);
}
- if ( _taccess(szPath, 0)){
+ if ( _waccess(szPath, 0)){
int ret = CreateDirectoryTreeT(szPath);
if (ret == 0){
debugLog(L"img_displayasmsg(): Created new directory for image cache: %s.", szPath);
} else {
debugLog(L"img_displayasmsg(): Can not create directory for image cache: %s. errno=%d: %s", szPath, errno, strerror(errno));
- TCHAR error[512];
+ wchar_t error[512];
mir_sntprintf(error, TranslateT("Cannot create image cache directory. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szPath);
showpopup(m_tszUserName, error, GG_POPUP_ERROR | GG_POPUP_ALLOW_MSGBOX | GG_POPUP_ONCE);
}
@@ -826,7 +826,7 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img)
mir_sntprintf(szPath + tPathLen, MAX_PATH - tPathLen, L"\\%s", dat->lpszFileName);
if ((pImgext = gg_img_hasextension(szPath)) == NULL)
pImgext = szPath + mir_tstrlen(szPath);
- _tcsncpy_s(imgext, pImgext, _TRUNCATE);
+ wcsncpy_s(imgext, pImgext, _TRUNCATE);
for (i = 1; ; ++i)
{
if ((res = gg_img_isexists(szPath, dat)) != -1) break;
@@ -835,13 +835,13 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img)
if (res == 0) {
// Image file not found, thus create it
- FILE *fp = _tfopen(szPath, L"w+b");
+ FILE *fp = _wfopen(szPath, L"w+b");
if (fp) {
res = fwrite(dat->lpData, dat->nSize, 1, fp) > 0;
fclose(fp);
} else {
debugLog(L"img_displayasmsg(): Cannot open file %s for write image. errno=%d: %s", szPath, errno, strerror(errno));
- TCHAR error[512];
+ wchar_t error[512];
mir_sntprintf(error, TranslateT("Cannot save received image to file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szPath);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
return 0;
@@ -849,7 +849,7 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img)
}
if (res != 0) {
- TCHAR image_msg[MAX_PATH + 11];
+ wchar_t image_msg[MAX_PATH + 11];
mir_sntprintf(image_msg, L"[img]%s[/img]", szPath);
T2Utf szMessage(image_msg);
@@ -926,7 +926,7 @@ int GGPROTO::img_display(MCONTACT hContact, void *img)
////////////////////////////////////////////////////////////////////////////
// Helper function to determine image file format and the right extension
//
-const TCHAR *gg_img_guessfileextension(const char *lpData)
+const wchar_t *gg_img_guessfileextension(const char *lpData)
{
if (lpData != NULL)
{
@@ -945,7 +945,7 @@ const TCHAR *gg_img_guessfileextension(const char *lpData)
////////////////////////////////////////////////////////////////////////////
// Image Window : Loading picture and sending for display
//
-void* GGPROTO::img_loadpicture(gg_event* e, TCHAR *szFileName)
+void* GGPROTO::img_loadpicture(gg_event* e, wchar_t *szFileName)
{
if (!szFileName &&
(!e || !e->event.image_reply.size || !e->event.image_reply.image || !e->event.image_reply.filename))
@@ -958,11 +958,11 @@ void* GGPROTO::img_loadpicture(gg_event* e, TCHAR *szFileName)
// Copy the file name
if (szFileName)
{
- FILE *fp = _tfopen(szFileName, L"rb");
+ FILE *fp = _wfopen(szFileName, L"rb");
if (!fp) {
free(dat);
debugLog(L"img_loadpicture(): fopen(\"%s\", \"rb\" failed. errno=%d: %s)", szFileName, errno, strerror(errno));
- TCHAR error[512];
+ wchar_t error[512];
mir_sntprintf(error, TranslateT("Cannot open image file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szFileName);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
return NULL;
@@ -996,7 +996,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, TCHAR *szFileName)
return NULL;
}
fclose(fp);
- dat->lpszFileName = _tcsdup(szFileName);
+ dat->lpszFileName = wcsdup(szFileName);
}
// Copy picture from packet
else if (e && e->event.image_reply.filename)
@@ -1008,9 +1008,9 @@ void* GGPROTO::img_loadpicture(gg_event* e, TCHAR *szFileName)
ptrT tmpFileName( mir_a2t(e->event.image_reply.filename));
if (!gg_img_hasextension(tmpFileName)) {
// Add missing file extension
- const TCHAR *szImgType = gg_img_guessfileextension(dat->lpData);
+ const wchar_t *szImgType = gg_img_guessfileextension(dat->lpData);
if (*szImgType) {
- dat->lpszFileName = (TCHAR*)calloc(sizeof(TCHAR), mir_tstrlen(tmpFileName) + mir_tstrlen(szImgType) + 1);
+ dat->lpszFileName = (wchar_t*)calloc(sizeof(wchar_t), mir_tstrlen(tmpFileName) + mir_tstrlen(szImgType) + 1);
if (dat->lpszFileName != NULL) {
mir_tstrcpy(dat->lpszFileName, tmpFileName);
mir_tstrcat(dat->lpszFileName, szImgType);
@@ -1019,7 +1019,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, TCHAR *szFileName)
}
if (dat->lpszFileName == NULL)
- dat->lpszFileName = _tcsdup( _A2T( e->event.image_reply.filename));
+ dat->lpszFileName = wcsdup( _A2T( e->event.image_reply.filename));
}
////////////////////////////////////////////////////////////////////
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp
index 9b5a0cde73..08a882079e 100644
--- a/protocols/Gadu-Gadu/src/import.cpp
+++ b/protocols/Gadu-Gadu/src/import.cpp
@@ -223,12 +223,12 @@ void GGPROTO::parsecontacts(char *contacts)
// Write misc data
if (hContact && strFirstName){
- TCHAR *tstrFirstName = mir_a2t(strFirstName);
+ wchar_t *tstrFirstName = mir_a2t(strFirstName);
setTString(hContact, GG_KEY_PD_FIRSTNAME, tstrFirstName);
mir_free(tstrFirstName);
}
if (hContact && strLastName){
- TCHAR *tstrLastName = mir_a2t(strLastName);
+ wchar_t *tstrLastName = mir_a2t(strLastName);
setTString(hContact, GG_KEY_PD_LASTNAME, tstrLastName);
mir_free(tstrLastName);
}
@@ -276,7 +276,7 @@ INT_PTR GGPROTO::import_server(WPARAM, LPARAM)
gg_EnterCriticalSection(&sess_mutex, "import_server", 65, "sess_mutex", 1);
if (gg_userlist_request(sess, GG_USERLIST_GET, NULL) == -1)
{
- TCHAR error[128];
+ wchar_t error[128];
gg_LeaveCriticalSection(&sess_mutex, "import_server", 65, 1, "sess_mutex", 1);
mir_sntprintf(error, TranslateT("List cannot be imported because of error:\n\t%s (Error: %d)"), ws_strerror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
@@ -314,7 +314,7 @@ INT_PTR GGPROTO::remove_server(WPARAM, LPARAM)
gg_EnterCriticalSection(&sess_mutex, "remove_server", 66, "sess_mutex", 1);
if (gg_userlist_request(sess, GG_USERLIST_PUT, NULL) == -1)
{
- TCHAR error[128];
+ wchar_t error[128];
gg_LeaveCriticalSection(&sess_mutex, "remove_server", 66, 1, "sess_mutex", 1);
mir_sntprintf(error, TranslateT("List cannot be removed because of error: %s (Error: %d)"), ws_strerror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
@@ -330,30 +330,30 @@ INT_PTR GGPROTO::remove_server(WPARAM, LPARAM)
INT_PTR GGPROTO::import_text(WPARAM, LPARAM)
{
- TCHAR str[MAX_PATH];
- TCHAR filter[512], *pfilter;
+ wchar_t str[MAX_PATH];
+ wchar_t filter[512], *pfilter;
struct _stat st;
OPENFILENAME ofn = {0};
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
- _tcsncpy(filter, TranslateT("Text files"), _countof(filter));
+ wcsncpy(filter, TranslateT("Text files"), _countof(filter));
mir_tstrncat(filter, L" (*.txt)", _countof(filter) - mir_tstrlen(filter));
pfilter = filter + mir_tstrlen(filter) + 1;
if (pfilter >= filter + _countof(filter))
return 0;
- _tcsncpy(pfilter, L"*.TXT", _countof(filter) - (pfilter - filter));
+ wcsncpy(pfilter, L"*.TXT", _countof(filter) - (pfilter - filter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + _countof(filter))
return 0;
- _tcsncpy(pfilter, TranslateT("All Files"), _countof(filter) - (pfilter - filter));
+ wcsncpy(pfilter, TranslateT("All Files"), _countof(filter) - (pfilter - filter));
mir_tstrncat(pfilter, L" (*)", _countof(filter) - (pfilter - filter) - mir_tstrlen(pfilter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + _countof(filter))
return 0;
- _tcsncpy(pfilter, L"*", _countof(filter) - (pfilter - filter));
+ wcsncpy(pfilter, L"*", _countof(filter) - (pfilter - filter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + _countof(filter))
return 0;
@@ -373,8 +373,8 @@ INT_PTR GGPROTO::import_text(WPARAM, LPARAM)
#endif
if (!GetOpenFileName(&ofn)) return 0;
- FILE *f = _tfopen(str, L"r");
- _tstat(str, &st);
+ FILE *f = _wfopen(str, L"r");
+ _wstat(str, &st);
if (f && st.st_size)
{
@@ -389,7 +389,7 @@ INT_PTR GGPROTO::import_text(WPARAM, LPARAM)
}
else
{
- TCHAR error[256];
+ wchar_t error[256];
mir_sntprintf(error, TranslateT("List cannot be imported from file \"%s\" because of error:\n\t%s (Error: %d)"), str, _tcserror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
debugLog(L"import_text(): Cannot import list from file \"%s\". errno=%d: %s", str, errno, _tcserror(errno));
@@ -401,29 +401,29 @@ INT_PTR GGPROTO::import_text(WPARAM, LPARAM)
INT_PTR GGPROTO::export_text(WPARAM, LPARAM)
{
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
OPENFILENAME ofn = {0};
- TCHAR filter[512], *pfilter;
+ wchar_t filter[512], *pfilter;
- _tcsncpy(str, TranslateT("contacts"), _countof(str));
+ wcsncpy(str, TranslateT("contacts"), _countof(str));
mir_tstrncat(str, L".txt", _countof(str) - mir_tstrlen(str));
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
- _tcsncpy(filter, TranslateT("Text files"), _countof(filter));
+ wcsncpy(filter, TranslateT("Text files"), _countof(filter));
mir_tstrncat(filter, L" (*.txt)", _countof(filter) - mir_tstrlen(filter));
pfilter = filter + mir_tstrlen(filter) + 1;
if (pfilter >= filter + _countof(filter))
return 0;
- _tcsncpy(pfilter, L"*.TXT", _countof(filter) - (pfilter - filter));
+ wcsncpy(pfilter, L"*.TXT", _countof(filter) - (pfilter - filter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + _countof(filter))
return 0;
- _tcsncpy(pfilter, TranslateT("All Files"), _countof(filter) - (pfilter - filter));
+ wcsncpy(pfilter, TranslateT("All Files"), _countof(filter) - (pfilter - filter));
mir_tstrncat(pfilter, L" (*)", _countof(filter) - (pfilter - filter) - mir_tstrlen(pfilter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + _countof(filter))
return 0;
- _tcsncpy(pfilter, L"*", _countof(filter) - (pfilter - filter));
+ wcsncpy(pfilter, L"*", _countof(filter) - (pfilter - filter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + _countof(filter))
return 0;
@@ -440,7 +440,7 @@ INT_PTR GGPROTO::export_text(WPARAM, LPARAM)
#endif
if (!GetSaveFileName(&ofn)) return 0;
- FILE *f = _tfopen(str, L"w");
+ FILE *f = _wfopen(str, L"w");
if (f) {
char *contacts = gg_makecontacts(this, 0);
fwrite(contacts, sizeof(char), mir_strlen(contacts), f);
@@ -451,7 +451,7 @@ INT_PTR GGPROTO::export_text(WPARAM, LPARAM)
}
else
{
- TCHAR error[128];
+ wchar_t error[128];
mir_sntprintf(error, TranslateT("List cannot be exported to file \"%s\" because of error:\n\t%s (Error: %d)"), str, _tcserror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
debugLog(L"export_text(): Cannot export list to file \"%s\". errno=%d: %s", str, errno, _tcserror(errno));
@@ -494,7 +494,7 @@ INT_PTR GGPROTO::export_server(WPARAM, LPARAM)
gg_EnterCriticalSection(&sess_mutex, "export_server", 67, "sess_mutex", 1);
if (gg_userlist_request(sess, GG_USERLIST_PUT, contacts) == -1)
{
- TCHAR error[128];
+ wchar_t error[128];
gg_LeaveCriticalSection(&sess_mutex, "export_server", 67, 1, "sess_mutex", 1);
mir_sntprintf(error, TranslateT("List cannot be exported because of error:\n\t%s (Error: %d)"), ws_strerror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
@@ -524,7 +524,7 @@ void GGPROTO::import_init(HGENMENU hRoot)
CreateProtoService(mi.pszService, &GGPROTO::import_server);
mi.position = 2000500001;
mi.hIcolibItem = iconList[1].hIcolib;
- mi.name.t = LPGENT("Import List From &Server");
+ mi.name.w = LPGENW("Import List From &Server");
hMainMenu[2] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
// Import from textfile
@@ -533,7 +533,7 @@ void GGPROTO::import_init(HGENMENU hRoot)
CreateProtoService(mi.pszService, &GGPROTO::import_text);
mi.position = 2000500002;
mi.hIcolibItem = iconList[2].hIcolib;
- mi.name.t = LPGENT("Import List From &Text File...");
+ mi.name.w = LPGENW("Import List From &Text File...");
hMainMenu[3] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
// Remove from server
@@ -542,7 +542,7 @@ void GGPROTO::import_init(HGENMENU hRoot)
CreateProtoService(mi.pszService, &GGPROTO::remove_server);
mi.position = 2000500003;
mi.hIcolibItem = iconList[3].hIcolib;
- mi.name.t = LPGENT("&Remove List From Server");
+ mi.name.w = LPGENW("&Remove List From Server");
hMainMenu[4] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
// Export to server
@@ -551,7 +551,7 @@ void GGPROTO::import_init(HGENMENU hRoot)
CreateProtoService(mi.pszService, &GGPROTO::export_server);
mi.position = 2005000001;
mi.hIcolibItem = iconList[4].hIcolib;
- mi.name.t = LPGENT("Export List To &Server");
+ mi.name.w = LPGENW("Export List To &Server");
hMainMenu[5] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
// Export to textfile
@@ -560,6 +560,6 @@ void GGPROTO::import_init(HGENMENU hRoot)
CreateProtoService(mi.pszService, &GGPROTO::export_text);
mi.position = 2005000002;
mi.hIcolibItem = iconList[5].hIcolib;
- mi.name.t = LPGENT("Export List To &Text File...");
+ mi.name.w = LPGENW("Export List To &Text File...");
hMainMenu[6] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
}
diff --git a/protocols/Gadu-Gadu/src/links.cpp b/protocols/Gadu-Gadu/src/links.cpp
index 7033e9749a..cc388ac8e8 100644
--- a/protocols/Gadu-Gadu/src/links.cpp
+++ b/protocols/Gadu-Gadu/src/links.cpp
@@ -118,7 +118,7 @@ void GGPROTO::links_instance_init()
CMenuItem mi;
mi.flags = CMIF_TCHAR;
mi.position = g_Instances.getCount();
- mi.name.t = m_tszUserName;
+ mi.name.w = m_tszUserName;
hInstanceMenuItem = Menu_AddItem(hInstanceMenu, &mi, this);
}
}
diff --git a/protocols/Gadu-Gadu/src/oauth.cpp b/protocols/Gadu-Gadu/src/oauth.cpp
index 2bcff16f9e..818daa2d8d 100644
--- a/protocols/Gadu-Gadu/src/oauth.cpp
+++ b/protocols/Gadu-Gadu/src/oauth.cpp
@@ -315,7 +315,7 @@ int GGPROTO::oauth_receivetoken()
if (resp) {
nlc = resp->nlc;
if (resp->resultCode == 200 && resp->dataLength > 0 && resp->pData) {
- TCHAR *xmlAction = mir_a2t(resp->pData);
+ wchar_t *xmlAction = mir_a2t(resp->pData);
HXML hXml = xmlParseString(xmlAction, 0, L"result");
if (hXml != NULL) {
HXML node = xmlGetChildByPath(hXml, L"oauth_token", 0);
@@ -384,7 +384,7 @@ int GGPROTO::oauth_receivetoken()
resp = (NETLIBHTTPREQUEST *)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)m_hNetlibUser, (LPARAM)&req);
if (resp) {
if (resp->resultCode == 200 && resp->dataLength > 0 && resp->pData) {
- TCHAR *xmlAction = mir_a2t(resp->pData);
+ wchar_t *xmlAction = mir_a2t(resp->pData);
HXML hXml = xmlParseString(xmlAction, 0, L"result");
if (hXml != NULL) {
HXML node = xmlGetChildByPath(hXml, L"oauth_token", 0);
diff --git a/protocols/Gadu-Gadu/src/ownerinfo.cpp b/protocols/Gadu-Gadu/src/ownerinfo.cpp
index 125c0da27d..7d7ebeb5cd 100644
--- a/protocols/Gadu-Gadu/src/ownerinfo.cpp
+++ b/protocols/Gadu-Gadu/src/ownerinfo.cpp
@@ -56,7 +56,7 @@ void __cdecl GGPROTO::remindpasswordthread(void *param)
if (!(h = gg_remind_passwd3(rp->uin, rp->email, token.id, token.val, 0)))
{
- TCHAR error[128];
+ wchar_t error[128];
mir_sntprintf(error, TranslateT("Password could not be reminded because of error:\n\t%s (Error: %d)"), ws_strerror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
debugLog(L"remindpasswordthread(): Password could not be reminded. errno=%d: %s", errno, ws_strerror(errno));
diff --git a/protocols/Gadu-Gadu/src/popups.cpp b/protocols/Gadu-Gadu/src/popups.cpp
index e8ca28f164..ca8ff1fa74 100644
--- a/protocols/Gadu-Gadu/src/popups.cpp
+++ b/protocols/Gadu-Gadu/src/popups.cpp
@@ -23,8 +23,8 @@
struct PopupData
{
unsigned flags;
- TCHAR* title;
- TCHAR* text;
+ wchar_t* title;
+ wchar_t* text;
GGPROTO* gg;
};
@@ -72,7 +72,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar
//
void GGPROTO::initpopups()
{
- TCHAR szDescr[256];
+ wchar_t szDescr[256];
char szName[256];
POPUPCLASS puc = {0};
@@ -111,8 +111,8 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam)
if (ServiceExists(MS_POPUP_ADDPOPUPCLASS)) {
char szName[256];
POPUPDATACLASS ppd = {sizeof(ppd)};
- ppd.ptszTitle = puData->title;
- ppd.ptszText = puData->text;
+ ppd.pwszTitle = puData->title;
+ ppd.pwszText = puData->text;
ppd.PluginData = puData;
ppd.pszClassName = szName;
@@ -149,7 +149,7 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam)
mir_free(puData);
}
-void GGPROTO::showpopup(const TCHAR* nickname, const TCHAR* msg, int flags)
+void GGPROTO::showpopup(const wchar_t* nickname, const wchar_t* msg, int flags)
{
if (Miranda_Terminated()) return;
diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp
index d5c5c99217..f067ae87b7 100644
--- a/protocols/Gadu-Gadu/src/services.cpp
+++ b/protocols/Gadu-Gadu/src/services.cpp
@@ -49,7 +49,7 @@ char *gg_status2db(int status, const char *suffix)
//////////////////////////////////////////////////////////
// gets protocol status
//
-TCHAR* GGPROTO::getstatusmsg(int status)
+wchar_t* GGPROTO::getstatusmsg(int status)
{
switch(status) {
case ID_STATUS_ONLINE:
@@ -99,7 +99,7 @@ int GGPROTO::refreshstatus(int status)
}
else
{
- TCHAR *szMsg = NULL;
+ wchar_t *szMsg = NULL;
// Select proper msg
gg_EnterCriticalSection(&modemsg_mutex, "refreshstatus", 69, "modemsg_mutex", 1);
szMsg = getstatusmsg(status);
@@ -191,7 +191,7 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam)
if (!db_get_ts(pai->hContact, "ContactPhoto", "Backup", &dbv)) {
if ((mir_tstrlen(dbv.ptszVal)>0) && db_get_b(pai->hContact, "ContactPhoto", "Locked", 0)){
debugLogA("getavatarinfo(): Incoming request for avatar information. Contact has assigned Locked ContactPhoto. return GAIR_SUCCESS");
- _tcscpy_s(pai->filename, _countof(pai->filename) ,dbv.ptszVal);
+ wcscpy_s(pai->filename, _countof(pai->filename) ,dbv.ptszVal);
pai->format = ProtoGetAvatarFormat(pai->filename);
db_free(&dbv);
return GAIR_SUCCESS;
@@ -229,7 +229,7 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam)
if (AvatarHash != NULL && AvatarSavedHash != NULL) {
getAvatarFilename(pai->hContact, pai->filename, _countof(pai->filename));
if (!mir_strcmp(AvatarHash, AvatarSavedHash)) {
- if (_taccess(pai->filename, 0) == 0){
+ if (_waccess(pai->filename, 0) == 0){
debugLogA("getavatarinfo(): Incoming request for avatar information. uin=%d. Avatar hash unchanged. return GAIR_SUCCESS", uin);
return GAIR_SUCCESS;
}
@@ -239,9 +239,9 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam)
return GAIR_WAITFOR;
}
if ((wParam & GAIF_FORCE) != 0) {
- if (_tremove(pai->filename) != 0){
- debugLog(L"getavatarinfo(): refresh. _tremove 1 file %s error. errno=%d: %s", pai->filename, errno, _tcserror(errno));
- TCHAR error[512];
+ if (_wremove(pai->filename) != 0){
+ debugLog(L"getavatarinfo(): refresh. _wremove 1 file %s error. errno=%d: %s", pai->filename, errno, _tcserror(errno));
+ wchar_t error[512];
mir_sntprintf(error, TranslateT("Cannot remove old avatar file before refresh. ERROR: %d: %s\n%s"), errno, _tcserror(errno), pai->filename);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
}
@@ -254,9 +254,9 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam)
else if ((wParam & GAIF_FORCE) != 0) {
if (AvatarHash == NULL && AvatarSavedHash != NULL) {
getAvatarFilename(pai->hContact, pai->filename, _countof(pai->filename));
- if (_tremove(pai->filename) != 0){
- debugLog(L"getavatarinfo(): delete. _tremove file %s error. errno=%d: %s", pai->filename, errno, _tcserror(errno));
- TCHAR error[512];
+ if (_wremove(pai->filename) != 0){
+ debugLog(L"getavatarinfo(): delete. _wremove file %s error. errno=%d: %s", pai->filename, errno, _tcserror(errno));
+ wchar_t error[512];
mir_sntprintf(error, TranslateT("Cannot remove old avatar file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), pai->filename);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
}
@@ -284,7 +284,7 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam)
//
INT_PTR GGPROTO::getmyavatar(WPARAM wParam, LPARAM lParam)
{
- TCHAR *szFilename = (TCHAR*)wParam;
+ wchar_t *szFilename = (wchar_t*)wParam;
int len = (int)lParam;
if (szFilename == NULL || len <= 0) {
@@ -298,7 +298,7 @@ INT_PTR GGPROTO::getmyavatar(WPARAM wParam, LPARAM lParam)
}
getAvatarFilename(NULL, szFilename, len);
- if (_taccess(szFilename, 0) == 0){
+ if (_waccess(szFilename, 0) == 0){
debugLogA("getmyavatar(): Incoming request for self avatar information. returned ok.");
return 0;
} else {
@@ -314,7 +314,7 @@ INT_PTR GGPROTO::getmyavatar(WPARAM wParam, LPARAM lParam)
//
INT_PTR GGPROTO::setmyavatar(WPARAM, LPARAM lParam)
{
- TCHAR *szFilename = (TCHAR*)lParam;
+ wchar_t *szFilename = (wchar_t*)lParam;
if (!getByte(GG_KEY_ENABLEAVATARS, GG_KEYDEF_ENABLEAVATARS))
return -2;
@@ -335,7 +335,7 @@ INT_PTR GGPROTO::setmyavatar(WPARAM, LPARAM lParam)
setByte(GG_KEY_AVATARTYPEPREV, getByte(GG_KEY_AVATARTYPE, -1));
setByte(GG_KEY_AVATARTYPE, (BYTE)iAvType);
- TCHAR szMyFilename[MAX_PATH];
+ wchar_t szMyFilename[MAX_PATH];
getAvatarFilename(NULL, szMyFilename, _countof(szMyFilename));
if ( mir_tstrcmp(szFilename, szMyFilename) && !CopyFile(szFilename, szMyFilename, FALSE)) {
debugLogA("setmyavatar(): Failed to set user avatar. File with type %d could not be created/overwritten.", iAvType);
@@ -355,7 +355,7 @@ INT_PTR GGPROTO::getmyawaymsg(WPARAM wParam, LPARAM lParam)
INT_PTR res = 0;
gg_EnterCriticalSection(&modemsg_mutex, "refreshstatus", 72, "modemsg_mutex", 1);
- TCHAR *szMsg = getstatusmsg(wParam ? gg_normalizestatus(wParam) : m_iStatus);
+ wchar_t *szMsg = getstatusmsg(wParam ? gg_normalizestatus(wParam) : m_iStatus);
if (isonline() && szMsg)
res = (lParam & SGMA_UNICODE) ? (INT_PTR)mir_t2u(szMsg) : (INT_PTR)mir_t2a(szMsg);
gg_LeaveCriticalSection(&modemsg_mutex, "refreshstatus", 72, 1, "modemsg_mutex", 1);
diff --git a/protocols/Gadu-Gadu/src/sessions.cpp b/protocols/Gadu-Gadu/src/sessions.cpp
index bd68343587..13db5b1072 100644
--- a/protocols/Gadu-Gadu/src/sessions.cpp
+++ b/protocols/Gadu-Gadu/src/sessions.cpp
@@ -127,7 +127,7 @@ static BOOL IsOverAction(HWND hwndDlg)
LVHITTESTINFO hti;
RECT rc;
HDC hdc;
- TCHAR szText[256];
+ wchar_t szText[256];
SIZE textSize;
int textPosX;
@@ -164,7 +164,7 @@ static INT_PTR CALLBACK gg_sessions_viewdlg(HWND hwndDlg, UINT message, WPARAM w
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)lParam);
{
- TCHAR oldTitle[256], newTitle[256];
+ wchar_t oldTitle[256], newTitle[256];
HANDLE hProtoAckEvent;
GetWindowText(hwndDlg, oldTitle, _countof(oldTitle));
@@ -265,7 +265,7 @@ static INT_PTR CALLBACK gg_sessions_viewdlg(HWND hwndDlg, UINT message, WPARAM w
ListView_GetSubItemRect(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, LVIR_LABEL, &rc);
if (nm->nmcd.hdr.idFrom == IDC_SESSIONS && nm->iSubItem == 3)
{
- TCHAR szText[256];
+ wchar_t szText[256];
szText[0] = 0;
ListView_GetItemText(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, szText, _countof(szText));
FillRect(nm->nmcd.hdc, &rc, GetSysColorBrush(COLOR_WINDOW));
@@ -320,7 +320,7 @@ static INT_PTR CALLBACK gg_sessions_viewdlg(HWND hwndDlg, UINT message, WPARAM w
switch (iSelection) {
case 10001:
{
- TCHAR szText[512], szClientName[256], szIP[64], szLoginTime[64];
+ wchar_t szText[512], szClientName[256], szIP[64], szLoginTime[64];
HGLOBAL hData;
if (!OpenClipboard(hwndDlg))
break;
@@ -333,7 +333,7 @@ static INT_PTR CALLBACK gg_sessions_viewdlg(HWND hwndDlg, UINT message, WPARAM w
mir_sntprintf(szText, L"%s\t%s\t%s", szClientName, szIP, szLoginTime);
if ((hData = GlobalAlloc(GMEM_MOVEABLE, mir_tstrlen(szText) + 1)) != NULL)
{
- mir_tstrcpy((TCHAR*)GlobalLock(hData), szText);
+ mir_tstrcpy((wchar_t*)GlobalLock(hData), szText);
GlobalUnlock(hData);
SetClipboardData(CF_TEXT, hData);
}
@@ -343,7 +343,7 @@ static INT_PTR CALLBACK gg_sessions_viewdlg(HWND hwndDlg, UINT message, WPARAM w
case 10002:
{
- TCHAR szUrl[256], szIP[64];
+ wchar_t szUrl[256], szIP[64];
szIP[0] = 0;
ListView_GetItemText(hList, lvhti.iItem, 1, szIP, _countof(szIP));
mir_sntprintf(szUrl, L"http://whois.domaintools.com/%s", szIP);
@@ -424,6 +424,6 @@ void GGPROTO::sessions_menus_init(HGENMENU hRoot)
CreateProtoService(mi.pszService, &GGPROTO::sessions_view);
mi.position = 200003;
mi.hIcolibItem = iconList[16].hIcolib;
- mi.name.t = LPGENT("Concurrent &sessions");
+ mi.name.w = LPGENW("Concurrent &sessions");
Menu_AddProtoMenuItem(&mi, m_szModuleName);
}
diff --git a/protocols/Gadu-Gadu/src/token.cpp b/protocols/Gadu-Gadu/src/token.cpp
index 0a76e2e3ae..da89d11331 100644
--- a/protocols/Gadu-Gadu/src/token.cpp
+++ b/protocols/Gadu-Gadu/src/token.cpp
@@ -113,7 +113,7 @@ int GGPROTO::gettoken(GGTOKEN *token)
struct gg_http *h = gg_token(0);
if (!h || gg_token_watch_fd(h) || h->state == GG_STATE_ERROR || h->state != GG_STATE_DONE) {
- TCHAR error[128];
+ wchar_t error[128];
mir_sntprintf(error, TranslateT("Token retrieval failed because of error:\n\t%s"), http_error_string(h ? h->error : 0));
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
gg_free_pubdir(h);
@@ -122,7 +122,7 @@ int GGPROTO::gettoken(GGTOKEN *token)
struct gg_token *t = (struct gg_token *)h->data;
if (!t || !h->body) {
- TCHAR error[128];
+ wchar_t error[128];
mir_sntprintf(error, TranslateT("Token retrieval failed because of error:\n\t%s"), http_error_string(h->error));
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
gg_free_pubdir(h);
diff --git a/protocols/Gadu-Gadu/src/userutils.cpp b/protocols/Gadu-Gadu/src/userutils.cpp
index 4f40b99e37..0a2e424c2f 100644
--- a/protocols/Gadu-Gadu/src/userutils.cpp
+++ b/protocols/Gadu-Gadu/src/userutils.cpp
@@ -39,7 +39,7 @@ void *gg_doregister(GGPROTO *gg, char *newPass, char *newEmail)
if (!gg->gettoken(&token)) return NULL;
if (!(h = gg_register3(newEmail, newPass, token.id, token.val, 0)) || !(s = (gg_pubdir*)h->data) || !s->success || !s->uin) {
- TCHAR error[128];
+ wchar_t error[128];
mir_sntprintf(error, TranslateT("Cannot register new account because of error:\n\t%s"),
(h && !s) ? http_error_string(h->error) :
(s ? TranslateT("Registration rejected") : ws_strerror(errno)));
@@ -85,7 +85,7 @@ void *gg_dounregister(GGPROTO *gg, uin_t uin, char *password)
if (!(h = gg_unregister3(uin, password, token.id, token.val, 0)) || !(s = (gg_pubdir*)h->data) || !s->success || s->uin != uin)
{
- TCHAR error[128];
+ wchar_t error[128];
mir_sntprintf(error, TranslateT("Your account cannot be removed because of error:\n\t%s"),
(h && !s) ? http_error_string(h->error) :
(s ? TranslateT("Bad number or password") : ws_strerror(errno)));
@@ -137,7 +137,7 @@ void *gg_dochpass(GGPROTO *gg, uin_t uin, char *password, char *newPass)
if (!(h = gg_change_passwd4(uin, email, password, newPass, token.id, token.val, 0)) || !(s = (gg_pubdir*)h->data) || !s->success)
{
- TCHAR error[128];
+ wchar_t error[128];
mir_sntprintf(error, TranslateT("Your password cannot be changed because of error:\n\t%s"),
(h && !s) ? http_error_string(h->error) :
(s ? TranslateT("Invalid data entered") : ws_strerror(errno)));
@@ -179,7 +179,7 @@ void *gg_dochemail(GGPROTO *gg, uin_t uin, char *password, char *email, char *ne
struct gg_http *h = gg_change_passwd4(uin, newEmail, password, password, token.id, token.val, 0);
if (!h || !(s = (gg_pubdir*)h->data) || !s->success)
{
- TCHAR error[128];
+ wchar_t error[128];
mir_sntprintf(error, TranslateT("Your e-mail cannot be changed because of error:\n\t%s"),
(h && !s) ? http_error_string(h->error) : (s ? TranslateT("Bad old e-mail or password") : ws_strerror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp
index 6a15e93456..3f3676869e 100644
--- a/protocols/IRCG/src/clist.cpp
+++ b/protocols/IRCG/src/clist.cpp
@@ -25,18 +25,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
BOOL CIrcProto::CList_AddDCCChat(const CMString& name, const CMString& hostmask, unsigned long adr, int port)
{
MCONTACT hContact;
- TCHAR szNick[256];
+ wchar_t szNick[256];
char szService[256];
bool bFlag = false;
- CONTACT usertemp = { (TCHAR*)name.c_str(), NULL, NULL, false, false, true };
+ CONTACT usertemp = { (wchar_t*)name.c_str(), NULL, NULL, false, false, true };
MCONTACT hc = CList_FindContact(&usertemp);
if (hc && db_get_b(hc, "CList", "NotOnList", 0) == 0 && db_get_b(hc, "CList", "Hidden", 0) == 0)
bFlag = true;
CMString contactname = name; contactname += DCCSTRING;
- CONTACT user = { (TCHAR*)contactname.c_str(), NULL, NULL, false, false, true };
+ CONTACT user = { (wchar_t*)contactname.c_str(), NULL, NULL, false, false, true };
hContact = CList_AddContact(&user, false, false);
setByte(hContact, "DCC", 1);
@@ -165,7 +165,7 @@ MCONTACT CIrcProto::CList_FindContact(CONTACT *user)
if (!user || !user->name)
return 0;
- TCHAR* lowercasename = mir_tstrdup(user->name);
+ wchar_t* lowercasename = mir_tstrdup(user->name);
CharLower(lowercasename);
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
@@ -198,7 +198,7 @@ MCONTACT CIrcProto::CList_FindContact(CONTACT *user)
hContact_temp = hContact;
}
}
- else if (_tcschr(user->name, ' ') == 0) {
+ else if (wcschr(user->name, ' ') == 0) {
if ((DBDefault && !mir_tstrcmpi(DBDefault, user->name) || DBNick && !mir_tstrcmpi(DBNick, user->name) ||
DBWildcard && WCCmp(DBWildcard, lowercasename))
&& (WCCmp(DBUser, user->user) && WCCmp(DBHost, user->host))) {
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp
index f72796fde8..8a10cecca7 100644
--- a/protocols/IRCG/src/commandmonitor.cpp
+++ b/protocols/IRCG/src/commandmonitor.cpp
@@ -69,7 +69,7 @@ VOID CALLBACK KeepAliveTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
return;
}
- TCHAR temp2[270];
+ wchar_t temp2[270];
if (!ppro->m_info.sServerName.IsEmpty())
mir_sntprintf(temp2, L"PING %s", ppro->m_info.sServerName.c_str());
else
@@ -164,8 +164,8 @@ VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
db_free(&dbv);
DBVARIANT dbv2;
- TCHAR* DBNick = NULL;
- TCHAR* DBWildcard = NULL;
+ wchar_t* DBNick = NULL;
+ wchar_t* DBWildcard = NULL;
if (!ppro->getTString(hContact, "Nick", &dbv))
DBNick = dbv.ptszVal;
if (!ppro->getTString(hContact, "UWildcard", &dbv2))
@@ -216,7 +216,7 @@ VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
ppro->SetChatTimer(ppro->OnlineNotifTimer, ppro->m_onlineNotificationTime * 1000, OnlineNotifTimerProc);
}
-int CIrcProto::AddOutgoingMessageToDB(MCONTACT hContact, TCHAR* msg)
+int CIrcProto::AddOutgoingMessageToDB(MCONTACT hContact, wchar_t* msg)
{
if (m_iStatus == ID_STATUS_OFFLINE || m_iStatus == ID_STATUS_CONNECTING)
return 0;
@@ -260,7 +260,7 @@ void __cdecl CIrcProto::ResolveIPThread(LPVOID di)
bool CIrcProto::OnIrc_PING(const CIrcMessage* pmsg)
{
- TCHAR szResponse[100];
+ wchar_t szResponse[100];
mir_sntprintf(szResponse, L"PONG %s", pmsg->parameters[0].c_str());
SendIrcMessage(szResponse);
return false;
@@ -272,13 +272,13 @@ bool CIrcProto::OnIrc_WELCOME(const CIrcMessage* pmsg)
m_info.sNick = pmsg->parameters[0];
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 1) {
- static TCHAR host[1024];
+ static wchar_t host[1024];
int i = 0;
CMString word = GetWord(pmsg->parameters[1].c_str(), i);
while (!word.IsEmpty()) {
- if (_tcschr(word.c_str(), '!') && _tcschr(word.c_str(), '@')) {
+ if (wcschr(word.c_str(), '!') && wcschr(word.c_str(), '@')) {
mir_tstrncpy(host, word.c_str(), _countof(host));
- TCHAR* p1 = _tcschr(host, '@');
+ wchar_t* p1 = wcschr(host, '@');
if (p1)
ForkThread(&CIrcProto::ResolveIPThread, new IPRESOLVE(_T2A(p1 + 1), IP_AUTO));
}
@@ -531,7 +531,7 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg)
}
if (m_oldStyleModes) {
- TCHAR temp[256];
+ wchar_t temp[256];
mir_sntprintf(temp, TranslateT("%s sets mode %s"),
pmsg->prefix.sNick.c_str(), pmsg->parameters[1].c_str());
@@ -545,7 +545,7 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg)
for (int i = iParametercount; i < (int)pmsg->parameters.getCount(); i++)
sParams += L" " + pmsg->parameters[i];
- TCHAR temp[4000];
+ wchar_t temp[4000];
mir_sntprintf(temp, TranslateT("%s sets mode %s%s"), pmsg->prefix.sNick.c_str(), sModes.c_str(), sParams.c_str());
DoEvent(GC_EVENT_INFORMATION, pmsg->parameters[0].c_str(), pmsg->prefix.sNick.c_str(), temp, NULL, NULL, NULL, true, false);
}
@@ -554,7 +554,7 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg)
PostIrcMessage(L"/MODE %s", pmsg->parameters[0].c_str());
}
else {
- TCHAR temp[256];
+ wchar_t temp[256];
mir_sntprintf(temp, TranslateT("%s sets mode %s"), pmsg->prefix.sNick.c_str(), pmsg->parameters[1].c_str());
CMString sMessage = temp;
@@ -583,7 +583,7 @@ bool CIrcProto::OnIrc_NICK(const CIrcMessage* pmsg)
DoEvent(GC_EVENT_NICK, NULL, pmsg->prefix.sNick.c_str(), pmsg->parameters[0].c_str(), NULL, host.c_str(), NULL, true, bIsMe);
DoEvent(GC_EVENT_CHUID, NULL, pmsg->prefix.sNick.c_str(), pmsg->parameters[0].c_str(), NULL, NULL, NULL, true, false);
- struct CONTACT user = { (TCHAR*)pmsg->prefix.sNick.c_str(), (TCHAR*)pmsg->prefix.sUser.c_str(), (TCHAR*)pmsg->prefix.sHost.c_str(), false, false, false };
+ struct CONTACT user = { (wchar_t*)pmsg->prefix.sNick.c_str(), (wchar_t*)pmsg->prefix.sUser.c_str(), (wchar_t*)pmsg->prefix.sHost.c_str(), false, false, false };
MCONTACT hContact = CList_FindContact(&user);
if (hContact) {
if (getWord(hContact, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
@@ -644,9 +644,9 @@ bool CIrcProto::OnIrc_NOTICE(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_YOURHOST(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming) {
- static const TCHAR* lpszFmt = L"Your host is %99[^ \x5b,], running version %99s";
- TCHAR szHostName[100], szVersion[100];
- if (_stscanf(pmsg->parameters[1].c_str(), lpszFmt, &szHostName, &szVersion) > 0)
+ static const wchar_t* lpszFmt = L"Your host is %99[^ \x5b,], running version %99s";
+ wchar_t szHostName[100], szVersion[100];
+ if (swscanf(pmsg->parameters[1].c_str(), lpszFmt, &szHostName, &szVersion) > 0)
m_info.sServerName = szHostName;
if (pmsg->parameters[0] != m_info.sNick)
m_info.sNick = pmsg->parameters[0];
@@ -671,7 +671,7 @@ bool CIrcProto::OnIrc_INVITE(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_PINGPONG(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming && pmsg->sCommand == L"PING") {
- TCHAR szResponse[100];
+ wchar_t szResponse[100];
mir_sntprintf(szResponse, L"PONG %s", pmsg->parameters[0].c_str());
SendIrcMessage(szResponse);
}
@@ -691,7 +691,7 @@ bool CIrcProto::OnIrc_PRIVMSG(const CIrcMessage* pmsg)
if (pmsg->m_bIncoming && !bIsChannel) {
mess = DoColorCodes(mess.c_str(), TRUE, FALSE);
- struct CONTACT user = { (TCHAR*)pmsg->prefix.sNick.c_str(), (TCHAR*)pmsg->prefix.sUser.c_str(), (TCHAR*)pmsg->prefix.sHost.c_str(), false, false, false };
+ struct CONTACT user = { (wchar_t*)pmsg->prefix.sNick.c_str(), (wchar_t*)pmsg->prefix.sUser.c_str(), (wchar_t*)pmsg->prefix.sHost.c_str(), false, false, false };
if (CallService(MS_IGNORE_ISIGNORED, NULL, IGNOREEVENT_MESSAGE))
if (!CList_FindContact(&user))
@@ -742,7 +742,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
// exploit???
if (mess.Find(1) != -1 || mess.Find(L"%newl") != -1) {
- TCHAR temp[4096];
+ wchar_t temp[4096];
mir_sntprintf(temp, TranslateT("CTCP ERROR: Malformed CTCP command received from %s!%s@%s. Possible attempt to take control of your IRC client registered"), pmsg->prefix.sNick.c_str(), pmsg->prefix.sUser.c_str(), pmsg->prefix.sHost.c_str());
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), temp, NULL, NULL, NULL, true, false);
return true;
@@ -800,16 +800,16 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
else if (pmsg->m_bIncoming && command == L"finger") {
PostIrcMessage(L"/NOTICE %s \001FINGER %s (%s)\001", pmsg->prefix.sNick.c_str(), m_name, m_userID);
- TCHAR temp[300];
+ wchar_t temp[300];
mir_sntprintf(temp, TranslateT("CTCP FINGER requested by %s"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
// incoming VERSION
else if (pmsg->m_bIncoming && command == L"version") {
- PostIrcMessage(L"/NOTICE %s \001VERSION Miranda NG %%mirver (IRC v.%%version)" L", " _T(__COPYRIGHT) L"\001", pmsg->prefix.sNick.c_str());
+ PostIrcMessage(L"/NOTICE %s \001VERSION Miranda NG %%mirver (IRC v.%%version)" L", " _A2W(__COPYRIGHT) L"\001", pmsg->prefix.sNick.c_str());
- TCHAR temp[300];
+ wchar_t temp[300];
mir_sntprintf(temp, TranslateT("CTCP VERSION requested by %s"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
@@ -818,7 +818,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
else if (pmsg->m_bIncoming && command == L"source") {
PostIrcMessage(L"/NOTICE %s \001SOURCE Get Miranda IRC here: http://miranda-ng.org/ \001", pmsg->prefix.sNick.c_str());
- TCHAR temp[300];
+ wchar_t temp[300];
mir_sntprintf(temp, TranslateT("CTCP SOURCE requested by %s"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
@@ -827,7 +827,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
else if (pmsg->m_bIncoming && command == L"userinfo") {
PostIrcMessage(L"/NOTICE %s \001USERINFO %s\001", pmsg->prefix.sNick.c_str(), m_userInfo);
- TCHAR temp[300];
+ wchar_t temp[300];
mir_sntprintf(temp, TranslateT("CTCP USERINFO requested by %s"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
@@ -836,16 +836,16 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
else if (pmsg->m_bIncoming && command == L"ping") {
PostIrcMessage(L"/NOTICE %s \001%s\001", pmsg->prefix.sNick.c_str(), mess.c_str());
- TCHAR temp[300];
+ wchar_t temp[300];
mir_sntprintf(temp, TranslateT("CTCP PING requested by %s"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
// incoming TIME
else if (pmsg->m_bIncoming && command == L"time") {
- TCHAR temp[300];
+ wchar_t temp[300];
time_t tim = time(NULL);
- mir_tstrncpy(temp, _tctime(&tim), 25);
+ mir_tstrncpy(temp, _wctime(&tim), 25);
PostIrcMessage(L"/NOTICE %s \001TIME %s\001", pmsg->prefix.sNick.c_str(), temp);
mir_sntprintf(temp, TranslateT("CTCP TIME requested by %s"), pmsg->prefix.sNick.c_str());
@@ -879,9 +879,9 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
begin = mess.Find(' ', end);
if (begin >= 0) {
CMString rest = mess.Mid(begin);
- dwAdr = _tcstoul(GetWord(rest.c_str(), 0).c_str(), NULL, 10);
- iPort = _ttoi(GetWord(rest.c_str(), 1).c_str());
- dwSize = _ttoi64(GetWord(rest.c_str(), 2).c_str());
+ dwAdr = wcstoul(GetWord(rest.c_str(), 0).c_str(), NULL, 10);
+ iPort = _wtoi(GetWord(rest.c_str(), 1).c_str());
+ dwSize = _wtoi64(GetWord(rest.c_str(), 2).c_str());
sToken = GetWord(rest.c_str(), 3);
}
}
@@ -904,7 +904,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
// if all characters are number it indicates we have found the adress, port and size parameters
int ind = 0;
while (sTemp[ind] != '\0') {
- if (!_istdigit(sTemp[ind]))
+ if (!iswdigit(sTemp[ind]))
break;
ind++;
}
@@ -915,8 +915,8 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
}
if (bFlag) {
- TCHAR* p1 = _tcsdup(GetWordAddress(mess.c_str(), 2));
- TCHAR* p2 = (TCHAR*)GetWordAddress(p1, index - 5);
+ wchar_t* p1 = wcsdup(GetWordAddress(mess.c_str(), 2));
+ wchar_t* p2 = (wchar_t*)GetWordAddress(p1, index - 5);
if (type == L"send") {
if (p2 > p1) {
@@ -932,9 +932,9 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
free(p1);
- dwAdr = _tcstoul(GetWord(mess.c_str(), index - (bIsChat ? 2 : 3)).c_str(), NULL, 10);
- iPort = _ttoi(GetWord(mess.c_str(), index - (bIsChat ? 1 : 2)).c_str());
- dwSize = _ttoi64(GetWord(mess.c_str(), index - 1).c_str());
+ dwAdr = wcstoul(GetWord(mess.c_str(), index - (bIsChat ? 2 : 3)).c_str(), NULL, 10);
+ iPort = _wtoi(GetWord(mess.c_str(), index - (bIsChat ? 1 : 2)).c_str());
+ dwSize = _wtoi64(GetWord(mess.c_str(), index - 1).c_str());
sToken = GetWord(mess.c_str(), index);
}
}
@@ -952,8 +952,8 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
begin = mess.Find(' ', end);
if (begin >= 0) {
CMString rest = mess.Mid(begin);
- iPort = _ttoi(GetWord(rest.c_str(), 0).c_str());
- dwSize = _ttoi(GetWord(rest.c_str(), 1).c_str());
+ iPort = _wtoi(GetWord(rest.c_str(), 0).c_str());
+ dwSize = _wtoi(GetWord(rest.c_str(), 1).c_str());
sToken = GetWord(rest.c_str(), 2);
}
}
@@ -972,7 +972,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
int ind = 0;
while (sTemp[ind] != '\0') {
- if (!_istdigit(sTemp[ind]))
+ if (!iswdigit(sTemp[ind]))
break;
ind++;
}
@@ -982,8 +982,8 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
index++;
}
if (bFlag) {
- TCHAR* p1 = _tcsdup(GetWordAddress(mess.c_str(), 2));
- TCHAR* p2 = (TCHAR*)GetWordAddress(p1, index - 4);
+ wchar_t* p1 = wcsdup(GetWordAddress(mess.c_str(), 2));
+ wchar_t* p2 = (wchar_t*)GetWordAddress(p1, index - 4);
if (p2 > p1) {
p2--;
@@ -996,8 +996,8 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
free(p1);
- iPort = _ttoi(GetWord(mess.c_str(), index - 2).c_str());
- dwSize = _ttoi64(GetWord(mess.c_str(), index - 1).c_str());
+ iPort = _wtoi(GetWord(mess.c_str(), index - 2).c_str());
+ dwSize = _wtoi64(GetWord(mess.c_str(), index - 1).c_str());
sToken = GetWord(mess.c_str(), index);
}
}
@@ -1006,7 +1006,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
// 2. Check for malformed dcc commands or other errors
if (bIsChat || type == L"send") {
- TCHAR szTemp[256];
+ wchar_t szTemp[256];
szTemp[0] = '\0';
unsigned long ulAdr = 0;
@@ -1040,7 +1040,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
sFile = sFileCorrected;
}
else if (type == L"accept" || type == L"resume") {
- TCHAR szTemp[256];
+ wchar_t szTemp[256];
szTemp[0] = '\0';
if (type == L"resume" && !m_DCCFileEnabled)
@@ -1066,7 +1066,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
// incoming chat request
if (bIsChat) {
- CONTACT user = { (TCHAR*)pmsg->prefix.sNick.c_str(), 0, 0, false, false, true };
+ CONTACT user = { (wchar_t*)pmsg->prefix.sNick.c_str(), 0, 0, false, false, true };
MCONTACT hContact = CList_FindContact(&user);
// check if it should be ignored
@@ -1078,7 +1078,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
CList_AddDCCChat(pmsg->prefix.sNick, host, dwAdr, iPort); // add a CHAT event to the clist
}
else {
- TCHAR szTemp[512];
+ wchar_t szTemp[512];
mir_sntprintf(szTemp, TranslateT("DCC: Chat request from %s denied"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
}
@@ -1090,7 +1090,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
if (sToken.IsEmpty())
dcc = FindDCCSendByPort(iPort);
else
- dcc = FindPassiveDCCSend(_ttoi(sToken.c_str())); // reverse ft
+ dcc = FindPassiveDCCSend(_wtoi(sToken.c_str())); // reverse ft
if (dcc) {
InterlockedExchange(&dcc->dwWhatNeedsDoing, (long)FILERESUME_RESUME);
@@ -1128,14 +1128,14 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
// a reverse filetransfer. The plugin should connect to that computer
// and start sedning the file (if the token is valid). Compare to DCC RECV
if (!sToken.IsEmpty() && iPort) {
- CDccSession* dcc = FindPassiveDCCSend(_ttoi(sToken.c_str()));
+ CDccSession* dcc = FindPassiveDCCSend(_wtoi(sToken.c_str()));
if (dcc) {
dcc->SetupPassive(dwAdr, iPort);
dcc->Connect();
}
}
else {
- struct CONTACT user = { (TCHAR*)pmsg->prefix.sNick.c_str(), (TCHAR*)pmsg->prefix.sUser.c_str(), (TCHAR*)pmsg->prefix.sHost.c_str(), false, false, false };
+ struct CONTACT user = { (wchar_t*)pmsg->prefix.sNick.c_str(), (wchar_t*)pmsg->prefix.sUser.c_str(), (wchar_t*)pmsg->prefix.sHost.c_str(), false, false, false };
if (CallService(MS_IGNORE_ISIGNORED, NULL, IGNOREEVENT_FILE))
if (!CList_FindContact(&user))
return true;
@@ -1160,13 +1160,13 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
setTString(hContact, "User", pmsg->prefix.sUser.c_str());
setTString(hContact, "Host", pmsg->prefix.sHost.c_str());
- TCHAR* tszTemp = (TCHAR*)sFile.c_str();
+ wchar_t* tszTemp = (wchar_t*)sFile.c_str();
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
pre.timestamp = (DWORD)time(NULL);
pre.fileCount = 1;
- pre.files.t = &tszTemp;
+ pre.files.w = &tszTemp;
pre.lParam = (LPARAM)di;
ProtoChainRecvFile(hContact, &pre);
}
@@ -1175,7 +1175,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
// end type == "send"
}
else if (pmsg->m_bIncoming) {
- TCHAR temp[300];
+ wchar_t temp[300];
mir_sntprintf(temp, TranslateT("CTCP %s requested by %s"), ocommand.c_str(), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
@@ -1183,12 +1183,12 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
// handle incoming ctcp in notices. This technique is used for replying to CTCP queries
else if (pmsg->sCommand == L"NOTICE") {
- TCHAR szTemp[300];
+ wchar_t szTemp[300];
szTemp[0] = '\0';
//if we got incoming CTCP Version for contact in CList - then write its as MirVer for that contact!
if (pmsg->m_bIncoming && command == L"version") {
- struct CONTACT user = { (TCHAR*)pmsg->prefix.sNick.c_str(), (TCHAR*)pmsg->prefix.sUser.c_str(), (TCHAR*)pmsg->prefix.sHost.c_str(), false, false, false };
+ struct CONTACT user = { (wchar_t*)pmsg->prefix.sNick.c_str(), (wchar_t*)pmsg->prefix.sUser.c_str(), (wchar_t*)pmsg->prefix.sHost.c_str(), false, false, false };
MCONTACT hContact = CList_FindContact(&user);
if (hContact)
setTString(hContact, "MirVer", DoColorCodes(GetWordAddress(mess.c_str(), 1), TRUE, FALSE));
@@ -1205,8 +1205,8 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
}
if (pmsg->m_bIncoming && command == L"ping") {
SetActiveWindow(m_whoisDlg->GetHwnd());
- int s = (int)time(0) - (int)_ttol(GetWordAddress(mess.c_str(), 1));
- TCHAR szTmp[30];
+ int s = (int)time(0) - (int)_wtol(GetWordAddress(mess.c_str(), 1));
+ wchar_t szTmp[30];
if (s == 1)
mir_sntprintf(szTmp, TranslateT("%u second"), s);
else
@@ -1220,7 +1220,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
//... else show the reply in the current window
if (pmsg->m_bIncoming && command == L"ping") {
- int s = (int)time(0) - (int)_ttol(GetWordAddress(mess.c_str(), 1));
+ int s = (int)time(0) - (int)_wtol(GetWordAddress(mess.c_str(), 1));
mir_sntprintf(szTemp, TranslateT("CTCP PING reply from %s: %u sec(s)"), pmsg->prefix.sNick.c_str(), s);
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false);
}
@@ -1254,7 +1254,7 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg)
i++;
if (!name.IsEmpty()) {
int index = 0;
- while (_tcschr(sUserModePrefixes.c_str(), name[index]))
+ while (wcschr(sUserModePrefixes.c_str(), name[index]))
index++;
if (!mir_tstrcmpi(name.Mid(index).c_str(), m_info.sNick.c_str())) {
@@ -1265,7 +1265,7 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg)
}
if (bFlag) {
- const TCHAR* sChanName = pmsg->parameters[1].c_str();
+ const wchar_t* sChanName = pmsg->parameters[1].c_str();
if (sChanName[0] == '@' || sChanName[0] == '*' || sChanName[0] == '=')
sChanName++;
@@ -1372,7 +1372,7 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg)
sTopicTime = L"";
} }
- gcd.ptszID = (TCHAR*)sID.c_str();
+ gcd.ptszID = (wchar_t*)sID.c_str();
gcd.iType = GC_EVENT_CONTROL;
gce.cbSize = sizeof(GCEVENT);
gce.dwFlags = 0;
@@ -1454,11 +1454,11 @@ bool CIrcProto::OnIrc_INITIALTOPIC(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_INITIALTOPICNAME(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 3) {
- TCHAR tTimeBuf[128], *tStopStr;
+ wchar_t tTimeBuf[128], *tStopStr;
time_t ttTopicTime;
sTopicName = pmsg->parameters[2];
- ttTopicTime = _tcstol(pmsg->parameters[3].c_str(), &tStopStr, 10);
- _tcsftime(tTimeBuf, 128, L"%#c", localtime(&ttTopicTime));
+ ttTopicTime = wcstol(pmsg->parameters[3].c_str(), &tStopStr, 10);
+ wcsftime(tTimeBuf, 128, L"%#c", localtime(&ttTopicTime));
sTopicTime = tTimeBuf;
}
ShowMessage(pmsg);
@@ -1506,20 +1506,20 @@ bool CIrcProto::OnIrc_LIST(const CIrcMessage* pmsg)
lvItem.iItem = ListView_GetItemCount(hListView);
lvItem.mask = LVIF_TEXT | LVIF_PARAM;
lvItem.iSubItem = 0;
- lvItem.pszText = (TCHAR*)pmsg->parameters[1].c_str();
+ lvItem.pszText = (wchar_t*)pmsg->parameters[1].c_str();
lvItem.lParam = lvItem.iItem;
lvItem.iItem = ListView_InsertItem(hListView, &lvItem);
lvItem.mask = LVIF_TEXT;
lvItem.iSubItem = 1;
- lvItem.pszText = (TCHAR*)pmsg->parameters[pmsg->parameters.getCount() - 2].c_str();
+ lvItem.pszText = (wchar_t*)pmsg->parameters[pmsg->parameters.getCount() - 2].c_str();
ListView_SetItem(hListView, &lvItem);
- TCHAR* temp = mir_tstrdup(pmsg->parameters[pmsg->parameters.getCount() - 1]);
- TCHAR* find = _tcsstr(temp, L"[+");
- TCHAR* find2 = _tcsstr(temp, L"]");
- TCHAR* save = temp;
+ wchar_t* temp = mir_tstrdup(pmsg->parameters[pmsg->parameters.getCount() - 1]);
+ wchar_t* find = wcsstr(temp, L"[+");
+ wchar_t* find2 = wcsstr(temp, L"]");
+ wchar_t* save = temp;
if (find == temp && find2 != NULL && find + 8 >= find2) {
- temp = _tcsstr(temp, L"]");
+ temp = wcsstr(temp, L"]");
if (mir_tstrlen(temp) > 1) {
temp++;
temp[0] = '\0';
@@ -1534,7 +1534,7 @@ bool CIrcProto::OnIrc_LIST(const CIrcMessage* pmsg)
lvItem.iSubItem = 3;
CMString S = DoColorCodes(temp, TRUE, FALSE);
- lvItem.pszText = (TCHAR*)S.c_str();
+ lvItem.pszText = (wchar_t*)S.c_str();
ListView_SetItem(hListView, &lvItem);
temp = save;
mir_free(temp);
@@ -1543,7 +1543,7 @@ bool CIrcProto::OnIrc_LIST(const CIrcMessage* pmsg)
if (m_noOfChannels > 0)
percent = (int)(m_channelNumber * 100) / m_noOfChannels;
- TCHAR text[100];
+ wchar_t text[100];
if (percent < 100)
mir_sntprintf(text, TranslateT("Downloading list (%u%%) - %u channels"), percent, m_channelNumber);
else
@@ -1564,7 +1564,7 @@ bool CIrcProto::OnIrc_LISTEND(const CIrcMessage* pmsg)
ListView_SetColumnWidth(GetDlgItem(m_listDlg->GetHwnd(), IDC_INFO_LISTVIEW), 3, LVSCW_AUTOSIZE);
m_listDlg->UpdateList();
- TCHAR text[100];
+ wchar_t text[100];
mir_sntprintf(text, TranslateT("Done: %u channels"), m_channelNumber);
int percent = 100;
if (m_noOfChannels > 0)
@@ -1593,8 +1593,8 @@ bool CIrcProto::OnIrc_BANLIST(const CIrcMessage* pmsg)
S += pmsg->parameters[3];
if (pmsg->parameters.getCount() > 4) {
S += L" - ( ";
- time_t time = _ttoi(pmsg->parameters[4].c_str());
- S += _tctime(&time);
+ time_t time = _wtoi(pmsg->parameters[4].c_str());
+ S += _wctime(&time);
S.Replace(L"\n", L" ");
S += L")";
}
@@ -1676,7 +1676,7 @@ bool CIrcProto::OnIrc_WHOIS_AWAY(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_WHOIS_OTHER(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming && m_whoisDlg && pmsg->parameters.getCount() > 2 && m_manualWhoisCount > 0) {
- TCHAR temp[1024], temp2[1024];
+ wchar_t temp[1024], temp2[1024];
m_whoisDlg->m_InfoOther.GetText(temp, 1000);
mir_tstrcat(temp, L"%s\r\n");
mir_sntprintf(temp2, temp, pmsg->parameters[2].c_str());
@@ -1689,7 +1689,7 @@ bool CIrcProto::OnIrc_WHOIS_OTHER(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_WHOIS_END(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 1 && m_manualWhoisCount < 1) {
- CONTACT user = { (TCHAR*)pmsg->parameters[1].c_str(), NULL, NULL, false, false, true };
+ CONTACT user = { (wchar_t*)pmsg->parameters[1].c_str(), NULL, NULL, false, false, true };
MCONTACT hContact = CList_FindContact(&user);
if (hContact)
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)WhoisAwayReply.c_str());
@@ -1705,7 +1705,7 @@ bool CIrcProto::OnIrc_WHOIS_END(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_WHOIS_IDLE(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming && m_whoisDlg && pmsg->parameters.getCount() > 2 && m_manualWhoisCount > 0) {
- int S = _ttoi(pmsg->parameters[2].c_str());
+ int S = _wtoi(pmsg->parameters[2].c_str());
int D = S / (60 * 60 * 24);
S -= (D * 60 * 60 * 24);
int H = S / (60 * 60);
@@ -1713,7 +1713,7 @@ bool CIrcProto::OnIrc_WHOIS_IDLE(const CIrcMessage* pmsg)
int M = S / 60;
S -= (M * 60);
- TCHAR temp[100];
+ wchar_t temp[100];
if (D)
mir_sntprintf(temp, TranslateT("%ud, %uh, %um, %us"), D, H, M, S);
else if (H)
@@ -1725,10 +1725,10 @@ bool CIrcProto::OnIrc_WHOIS_IDLE(const CIrcMessage* pmsg)
else
temp[0] = 0;
- TCHAR temp3[256];
- TCHAR tTimeBuf[128], *tStopStr;
- time_t ttTime = _tcstol(pmsg->parameters[3].c_str(), &tStopStr, 10);
- _tcsftime(tTimeBuf, 128, L"%c", localtime(&ttTime));
+ wchar_t temp3[256];
+ wchar_t tTimeBuf[128], *tStopStr;
+ time_t ttTime = wcstol(pmsg->parameters[3].c_str(), &tStopStr, 10);
+ wcsftime(tTimeBuf, 128, L"%c", localtime(&ttTime));
mir_sntprintf(temp3, TranslateT("online since %s, idle %s"), tTimeBuf, temp);
m_whoisDlg->m_AwayTime.SetText(temp3);
}
@@ -1764,10 +1764,10 @@ bool CIrcProto::OnIrc_WHOIS_NO_USER(const CIrcMessage* pmsg)
if (m_whoisDlg)
m_whoisDlg->ShowMessageNoUser(pmsg);
- CONTACT user = { (TCHAR*)pmsg->parameters[1].c_str(), NULL, NULL, false, false, false };
+ CONTACT user = { (wchar_t*)pmsg->parameters[1].c_str(), NULL, NULL, false, false, false };
MCONTACT hContact = CList_FindContact(&user);
if (hContact) {
- AddOutgoingMessageToDB(hContact, (TCHAR*)((CMString)L"> " + pmsg->parameters[2] + (CMString)L": " + pmsg->parameters[1]).c_str());
+ AddOutgoingMessageToDB(hContact, (wchar_t*)((CMString)L"> " + pmsg->parameters[2] + (CMString)L": " + pmsg->parameters[1]).c_str());
DBVARIANT dbv;
if (!getTString(hContact, "Default", &dbv)) {
@@ -1814,7 +1814,7 @@ bool CIrcProto::OnIrc_NICK_ERR(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming) {
if (nickflag && ((m_alternativeNick[0] != 0)) && (pmsg->parameters.getCount() > 2 && mir_tstrcmp(pmsg->parameters[1].c_str(), m_alternativeNick))) {
- TCHAR m[200];
+ wchar_t m[200];
mir_sntprintf(m, L"NICK %s", m_alternativeNick);
if (IsConnected())
SendIrcMessage(m);
@@ -1882,7 +1882,7 @@ bool CIrcProto::OnIrc_ENDMOTD(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_NOOFCHANNELS(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 1)
- m_noOfChannels = _ttoi(pmsg->parameters[1].c_str());
+ m_noOfChannels = _wtoi(pmsg->parameters[1].c_str());
if (pmsg->m_bIncoming && !bPerformDone)
DoOnConnect(pmsg);
@@ -1905,7 +1905,7 @@ bool CIrcProto::OnIrc_ERROR(const CIrcMessage* pmsg)
else
S = TranslateT("Unknown");
- msn.tszInfo = (TCHAR*)S.c_str();
+ msn.tszInfo = (wchar_t*)S.c_str();
msn.dwInfoFlags = NIIF_ERROR | NIIF_INTERN_UNICODE;
msn.uTimeout = 15000;
CallService(MS_CLIST_SYSTRAY_NOTIFY, 0, (LPARAM)&msn);
@@ -1944,9 +1944,9 @@ bool CIrcProto::OnIrc_WHO_END(const CIrcMessage* pmsg)
/// if it is not a channel
ptrT UserList(mir_tstrdup(m_whoReply.c_str()));
- const TCHAR* p1 = UserList;
+ const wchar_t* p1 = UserList;
m_whoReply = L"";
- CONTACT ccUser = { (TCHAR*)pmsg->parameters[1].c_str(), NULL, NULL, false, true, false };
+ CONTACT ccUser = { (wchar_t*)pmsg->parameters[1].c_str(), NULL, NULL, false, true, false };
MCONTACT hContact = CList_FindContact(&ccUser);
if (hContact && getByte(hContact, "AdvancedMode", 0) == 1) {
@@ -1991,7 +1991,7 @@ bool CIrcProto::OnIrc_WHO_END(const CIrcMessage* pmsg)
if (DBWildcard && DBNick && !WCCmp(CharLower(DBWildcard), CharLower(DBNick))) {
setTString(hContact, "Nick", DBDefault);
- DoUserhostWithReason(2, ((CMString)L"S" + DBWildcard).c_str(), true, (TCHAR*)DBWildcard);
+ DoUserhostWithReason(2, ((CMString)L"S" + DBWildcard).c_str(), true, (wchar_t*)DBWildcard);
setString(hContact, "User", "");
setString(hContact, "Host", "");
@@ -2017,7 +2017,7 @@ bool CIrcProto::OnIrc_WHO_REPLY(const CIrcMessage* pmsg)
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 6 && command[0] == 'S') {
m_whoReply.AppendFormat(L"%s %s %s %s ", pmsg->parameters[5].c_str(), pmsg->parameters[2].c_str(), pmsg->parameters[3].c_str(), pmsg->parameters[6].c_str());
if (mir_tstrcmpi(pmsg->parameters[5].c_str(), m_info.sNick.c_str()) == 0) {
- TCHAR host[1024];
+ wchar_t host[1024];
mir_tstrncpy(host, pmsg->parameters[3].c_str(), 1024);
ForkThread(&CIrcProto::ResolveIPThread, new IPRESOLVE(_T2A(host), IP_AUTO));
}
@@ -2076,16 +2076,16 @@ bool CIrcProto::OnIrc_USERHOST_REPLY(const CIrcMessage* pmsg)
if (sTemp.IsEmpty())
break;
- TCHAR *p1 = mir_tstrdup(sTemp.c_str());
+ wchar_t *p1 = mir_tstrdup(sTemp.c_str());
// Pull out host, user and nick
- TCHAR *p2 = _tcschr(p1, '@');
+ wchar_t *p2 = wcschr(p1, '@');
if (p2) {
*p2 = '\0';
p2++;
host = p2;
}
- p2 = _tcschr(p1, '=');
+ p2 = wcschr(p1, '=');
if (p2) {
if (*(p2 - 1) == '*')
*(p2 - 1) = '\0'; // remove special char for IRCOps
@@ -2106,9 +2106,9 @@ bool CIrcProto::OnIrc_USERHOST_REPLY(const CIrcMessage* pmsg)
// Do command
switch (command[0]) {
case 'S': // Status check
- finduser.name = (TCHAR*)nick.c_str();
- finduser.host = (TCHAR*)host.c_str();
- finduser.user = (TCHAR*)user.c_str();
+ finduser.name = (wchar_t*)nick.c_str();
+ finduser.host = (wchar_t*)host.c_str();
+ finduser.user = (wchar_t*)user.c_str();
{
MCONTACT hContact = CList_FindContact(&finduser);
if (hContact && getByte(hContact, "AdvancedMode", 0) == 0) {
@@ -2167,7 +2167,7 @@ bool CIrcProto::OnIrc_USERHOST_REPLY(const CIrcMessage* pmsg)
// Status-check post-processing: make buddies in ckeck-list offline
if (command[0] == 'S') {
for (int i = 0; i < checklist.getCount(); i++) {
- finduser.name = (TCHAR*)checklist[i].c_str();
+ finduser.name = (wchar_t*)checklist[i].c_str();
finduser.ExactNick = true;
CList_SetOffline(&finduser);
}
@@ -2184,10 +2184,10 @@ bool CIrcProto::OnIrc_USERHOST_REPLY(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_SUPPORT(const CIrcMessage* pmsg)
{
- static const TCHAR *lpszFmt = L"Try server %99[^ ,], port %19s";
- TCHAR szAltServer[100];
- TCHAR szAltPort[20];
- if (pmsg->parameters.getCount() > 1 && _stscanf(pmsg->parameters[1].c_str(), lpszFmt, &szAltServer, &szAltPort) == 2) {
+ static const wchar_t *lpszFmt = L"Try server %99[^ ,], port %19s";
+ wchar_t szAltServer[100];
+ wchar_t szAltPort[20];
+ if (pmsg->parameters.getCount() > 1 && swscanf(pmsg->parameters[1].c_str(), lpszFmt, &szAltServer, &szAltPort) == 2) {
ShowMessage(pmsg);
mir_strncpy(m_serverName, _T2A(szAltServer), 99);
mir_strncpy(m_portStart, _T2A(szAltPort), 9);
@@ -2203,22 +2203,22 @@ bool CIrcProto::OnIrc_SUPPORT(const CIrcMessage* pmsg)
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 0) {
CMString S;
for (int i = 0; i < pmsg->parameters.getCount(); i++) {
- TCHAR* temp = mir_tstrdup(pmsg->parameters[i].c_str());
- if (_tcsstr(temp, L"CHANTYPES=")) {
- TCHAR* p1 = _tcschr(temp, '=');
+ wchar_t* temp = mir_tstrdup(pmsg->parameters[i].c_str());
+ if (wcsstr(temp, L"CHANTYPES=")) {
+ wchar_t* p1 = wcschr(temp, '=');
p1++;
if (mir_tstrlen(p1) > 0)
sChannelPrefixes = p1;
}
- if (_tcsstr(temp, L"CHANMODES=")) {
- TCHAR* p1 = _tcschr(temp, '=');
+ if (wcsstr(temp, L"CHANMODES=")) {
+ wchar_t* p1 = wcschr(temp, '=');
p1++;
if (mir_tstrlen(p1) > 0)
sChannelModes = (char*)_T2A(p1);
}
- if (_tcsstr(temp, L"PREFIX=")) {
- TCHAR* p1 = _tcschr(temp, '(');
- TCHAR* p2 = _tcschr(temp, ')');
+ if (wcsstr(temp, L"PREFIX=")) {
+ wchar_t* p1 = wcschr(temp, '(');
+ wchar_t* p2 = wcschr(temp, ')');
if (p1 && p2) {
p1++;
if (p1 != p2)
@@ -2229,7 +2229,7 @@ bool CIrcProto::OnIrc_SUPPORT(const CIrcMessage* pmsg)
sUserModePrefixes = p2;
}
else {
- p1 = _tcschr(temp, '=');
+ p1 = wcschr(temp, '=');
p1++;
sUserModePrefixes = p1;
for (int n = 0; n < sUserModePrefixes.GetLength() + 1; n++) {
@@ -2417,13 +2417,13 @@ int CIrcProto::IsIgnored(CMString user, char type)
if (type == 0 && !mir_tstrcmpi(user.c_str(), C.mask.c_str()))
return i + 1;
- bool bUserContainsWild = (_tcschr(user.c_str(), '*') != NULL || _tcschr(user.c_str(), '?') != NULL);
+ bool bUserContainsWild = (wcschr(user.c_str(), '*') != NULL || wcschr(user.c_str(), '?') != NULL);
if (!bUserContainsWild && WCCmp(C.mask.c_str(), user.c_str()) ||
bUserContainsWild && !mir_tstrcmpi(user.c_str(), C.mask.c_str())) {
if (C.flags.IsEmpty() || C.flags[0] != '+')
continue;
- if (!_tcschr(C.flags.c_str(), type))
+ if (!wcschr(C.flags.c_str(), type))
continue;
if (C.network.IsEmpty())
@@ -2437,7 +2437,7 @@ int CIrcProto::IsIgnored(CMString user, char type)
return 0;
}
-bool CIrcProto::AddIgnore(const TCHAR* mask, const TCHAR* flags, const TCHAR* network)
+bool CIrcProto::AddIgnore(const wchar_t* mask, const wchar_t* flags, const wchar_t* network)
{
RemoveIgnore(mask);
m_ignoreItems.insert(new CIrcIgnoreItem(mask, (L"+" + CMString(flags)).c_str(), network));
@@ -2448,7 +2448,7 @@ bool CIrcProto::AddIgnore(const TCHAR* mask, const TCHAR* flags, const TCHAR* ne
return true;
}
-bool CIrcProto::RemoveIgnore(const TCHAR* mask)
+bool CIrcProto::RemoveIgnore(const wchar_t* mask)
{
int idx;
while ((idx = IsIgnored(mask, '\0')) != 0)
diff --git a/protocols/IRCG/src/input.cpp b/protocols/IRCG/src/input.cpp
index d8204e63dc..aef90b870e 100644
--- a/protocols/IRCG/src/input.cpp
+++ b/protocols/IRCG/src/input.cpp
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void CIrcProto::FormatMsg(CMString& text)
{
- TCHAR temp[30];
+ wchar_t temp[30];
mir_tstrncpy(temp, GetWord(text.c_str(), 0).c_str(), 29);
CharLower(temp);
CMString command = temp;
@@ -42,7 +42,7 @@ void CIrcProto::FormatMsg(CMString& text)
S = GetWord(text.c_str(), 0) + L" " + GetWord(text.c_str(), 1) + L" " + GetWord(text.c_str(), 2) + L" :" + GetWordAddress(text.c_str(), 3);
}
else if (command == L"/nick") {
- if (!_tcsstr(GetWord(text.c_str(), 1).c_str(), NICKSUBSTITUTE)) {
+ if (!wcsstr(GetWord(text.c_str(), 1).c_str(), NICKSUBSTITUTE)) {
sNick4Perform = GetWord(text.c_str(), 1);
S = GetWordAddress(text.c_str(), 0);
}
@@ -72,15 +72,15 @@ static void AddCR(CMString& text)
text.Replace(L"\r\r", L"\r");
}
-CMString CIrcProto::DoAlias(const TCHAR *text, TCHAR *window)
+CMString CIrcProto::DoAlias(const wchar_t *text, wchar_t *window)
{
CMString Messageout = L"";
- const TCHAR* p1 = text;
- const TCHAR* p2 = text;
+ const wchar_t* p1 = text;
+ const wchar_t* p2 = text;
bool LinebreakFlag = false, hasAlias = false;
- p2 = _tcsstr(p1, L"\r\n");
+ p2 = wcsstr(p1, L"\r\n");
if (!p2)
- p2 = _tcschr(p1, '\0');
+ p2 = wcschr(p1, '\0');
if (p1 == p2)
return (CMString)text;
@@ -88,38 +88,38 @@ CMString CIrcProto::DoAlias(const TCHAR *text, TCHAR *window)
if (LinebreakFlag)
Messageout += L"\r\n";
- TCHAR* line = new TCHAR[p2 - p1 + 1];
+ wchar_t* line = new wchar_t[p2 - p1 + 1];
mir_tstrncpy(line, p1, p2 - p1 + 1);
- TCHAR* test = line;
+ wchar_t* test = line;
while (*test == ' ')
test++;
if (*test == '/') {
mir_tstrncpy(line, GetWordAddress(line, 0), p2 - p1 + 1);
CMString S = line;
delete[] line;
- line = new TCHAR[S.GetLength() + 2];
+ line = new wchar_t[S.GetLength() + 2];
mir_tstrncpy(line, S.c_str(), S.GetLength() + 1);
CMString alias(m_alias);
- const TCHAR* p3 = _tcsstr(alias.c_str(), (GetWord(line, 0) + L" ").c_str());
+ const wchar_t* p3 = wcsstr(alias.c_str(), (GetWord(line, 0) + L" ").c_str());
if (p3 != alias.c_str()) {
CMString str = L"\r\n";
str += GetWord(line, 0) + L" ";
- p3 = _tcsstr(alias.c_str(), str.c_str());
+ p3 = wcsstr(alias.c_str(), str.c_str());
if (p3)
p3 += 2;
}
if (p3 != NULL) {
hasAlias = true;
- const TCHAR* p4 = _tcsstr(p3, L"\r\n");
+ const wchar_t* p4 = wcsstr(p3, L"\r\n");
if (!p4)
- p4 = _tcschr(p3, '\0');
+ p4 = wcschr(p3, '\0');
- *(TCHAR*)p4 = 0;
+ *(wchar_t*)p4 = 0;
CMString str = p3;
str.Replace(L"##", window);
str.Replace(L"$?", L"%question");
- TCHAR buf[5];
+ wchar_t buf[5];
for (int index = 1; index < 8; index++) {
mir_sntprintf(buf, L"#$%u", index);
if (!GetWord(line, index).IsEmpty() && IsChannel(GetWord(line, index)))
@@ -147,9 +147,9 @@ CMString CIrcProto::DoAlias(const TCHAR *text, TCHAR *window)
p1 = p2;
if (*p1 == '\r')
p1 += 2;
- p2 = _tcsstr(p1, L"\r\n");
+ p2 = wcsstr(p1, L"\r\n");
if (!p2)
- p2 = _tcschr(p1, '\0');
+ p2 = wcschr(p1, '\0');
delete[] line;
LinebreakFlag = true;
}
@@ -158,10 +158,10 @@ CMString CIrcProto::DoAlias(const TCHAR *text, TCHAR *window)
return hasAlias ? DoIdentifiers(Messageout, window) : Messageout;
}
-CMString CIrcProto::DoIdentifiers(CMString text, const TCHAR*)
+CMString CIrcProto::DoIdentifiers(CMString text, const wchar_t*)
{
SYSTEMTIME time;
- TCHAR str[2];
+ wchar_t str[2];
GetLocalTime(&time);
text.Replace(L"%mnick", m_nick);
@@ -176,8 +176,7 @@ CMString CIrcProto::DoIdentifiers(CMString text, const TCHAR*)
char mirver[100];
CallService(MS_SYSTEM_GETVERSIONTEXT, _countof(mirver), LPARAM(mirver));
text.Replace(L"%mirver", _A2T(mirver));
-
- text.Replace(L"%version", _T(__VERSION_STRING_DOTS));
+ text.Replace(L"%version", _A2T(__VERSION_STRING_DOTS));
str[0] = 3; str[1] = '\0';
text.Replace(L"%color", str);
@@ -210,7 +209,7 @@ static void __stdcall sttSetTimerOff(void* _pro)
ppro->KillChatTimer(ppro->OnlineNotifTimer3);
}
-BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hContact)
+BOOL CIrcProto::DoHardcodedCommand(CMString text, wchar_t *window, MCONTACT hContact)
{
CMString command(GetWord(text, 0)); command.MakeLower();
CMString one = GetWord(text, 1);
@@ -230,7 +229,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
else if (command == L"/sleep" || command == L"/wait") {
if (!one.IsEmpty()) {
int ms;
- if (_stscanf(one.c_str(), L"%d", &ms) == 1 && ms > 0 && ms <= 4000)
+ if (swscanf(one.c_str(), L"%d", &ms) == 1 && ms > 0 && ms <= 4000)
Sleep(ms);
else
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("Incorrect parameters. Usage: /sleep [ms], ms should be greater than 0 and less than 4000."), NULL, NULL, NULL, true, false);
@@ -260,7 +259,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
if (command == L"/ignore") {
if (IsConnected()) {
CMString IgnoreFlags;
- TCHAR temp[500];
+ wchar_t temp[500];
if (one.IsEmpty()) {
if (m_ignore)
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("Ignore system is enabled"), NULL, NULL, NULL, true, false);
@@ -278,21 +277,21 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("Ignore system is disabled"), NULL, NULL, NULL, true, false);
return true;
}
- if (!_tcschr(one.c_str(), '!') && !_tcschr(one.c_str(), '@'))
+ if (!wcschr(one.c_str(), '!') && !wcschr(one.c_str(), '@'))
one += L"!*@*";
if (!two.IsEmpty() && two[0] == '+') {
- if (_tcschr(two.c_str(), 'q'))
+ if (wcschr(two.c_str(), 'q'))
IgnoreFlags += 'q';
- if (_tcschr(two.c_str(), 'n'))
+ if (wcschr(two.c_str(), 'n'))
IgnoreFlags += 'n';
- if (_tcschr(two.c_str(), 'i'))
+ if (wcschr(two.c_str(), 'i'))
IgnoreFlags += 'i';
- if (_tcschr(two.c_str(), 'd'))
+ if (wcschr(two.c_str(), 'd'))
IgnoreFlags += 'd';
- if (_tcschr(two.c_str(), 'c'))
+ if (wcschr(two.c_str(), 'c'))
IgnoreFlags += 'c';
- if (_tcschr(two.c_str(), 'm'))
+ if (wcschr(two.c_str(), 'm'))
IgnoreFlags += 'm';
}
else IgnoreFlags = L"qnidc";
@@ -312,10 +311,10 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
}
if (command == L"/unignore") {
- if (!_tcschr(one.c_str(), '!') && !_tcschr(one.c_str(), '@'))
+ if (!wcschr(one.c_str(), '!') && !wcschr(one.c_str(), '@'))
one += L"!*@*";
- TCHAR temp[500];
+ wchar_t temp[500];
if (RemoveIgnore(one.c_str()))
mir_sntprintf(temp, TranslateT("%s is not ignored now"), one.c_str());
else
@@ -363,7 +362,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
}
if (command == L"/nusers") {
- TCHAR szTemp[40];
+ wchar_t szTemp[40];
CMString S = MakeWndID(window);
GC_INFO gci = { 0 };
gci.Flags = GCF_BYID | GCF_NAME | GCF_COUNT;
@@ -412,14 +411,14 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
CallFunctionAsync(sttSetTimerOff, this);
}
if (!mir_tstrcmpi(one.c_str(), L"time") && !two.IsEmpty()) {
- m_iTempCheckTime = _ttoi(two.c_str());
+ m_iTempCheckTime = _wtoi(two.c_str());
if (m_iTempCheckTime < 10 && m_iTempCheckTime != 0)
m_iTempCheckTime = 10;
if (m_iTempCheckTime == 0)
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("The time interval for the buddy check function is now at default setting"), NULL, NULL, NULL, true, false);
else {
- TCHAR temp[200];
+ wchar_t temp[200];
mir_sntprintf(temp, TranslateT("The time interval for the buddy check function is now %u seconds"), m_iTempCheckTime);
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), temp, NULL, NULL, NULL, true, false);
}
@@ -507,7 +506,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
if (one.IsEmpty())
return true;
- TCHAR szTemp[4000];
+ wchar_t szTemp[4000];
mir_sntprintf(szTemp, L"\001ACTION %s\001", GetWordAddress(text.c_str(), 1));
PostIrcMessageWnd(window, hContact, szTemp);
return true;
@@ -537,7 +536,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
if (one.IsEmpty() || two.IsEmpty())
return true;
- TCHAR szTemp[4000];
+ wchar_t szTemp[4000];
mir_sntprintf(szTemp, L"/PRIVMSG %s", GetWordAddress(text.c_str(), 1));
PostIrcMessageWnd(window, hContact, szTemp);
@@ -548,7 +547,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
if (one.IsEmpty() || IsChannel(one.c_str()))
return true;
- CONTACT user = { (TCHAR*)one.c_str(), NULL, NULL, false, false, false };
+ CONTACT user = { (wchar_t*)one.c_str(), NULL, NULL, false, false, false };
MCONTACT hContact2 = CList_AddContact(&user, false, false);
if (hContact2) {
if (getByte(hContact, "AdvancedMode", 0) == 0)
@@ -572,7 +571,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
}
if (!two.IsEmpty()) {
- TCHAR szTemp[4000];
+ wchar_t szTemp[4000];
mir_sntprintf(szTemp, L"/PRIVMSG %s", GetWordAddress(text.c_str(), 1));
PostIrcMessageWnd(window, hContact, szTemp);
}
@@ -583,7 +582,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
if (one.IsEmpty() || two.IsEmpty())
return true;
- TCHAR szTemp[1000];
+ wchar_t szTemp[1000];
unsigned long ulAdr = 0;
if (m_manualHost)
ulAdr = ConvertIPToInteger(m_mySpecifiedHostIP);
@@ -612,7 +611,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
return true;
if (mir_tstrcmpi(one.c_str(), L"send") == 0) {
- TCHAR szTemp[1000];
+ wchar_t szTemp[1000];
unsigned long ulAdr = 0;
if (m_manualHost)
@@ -621,7 +620,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
ulAdr = ConvertIPToInteger(m_IPFromServer ? m_myHost : m_myLocalHost);
if (ulAdr) {
- CONTACT user = { (TCHAR*)two.c_str(), NULL, NULL, false, false, true };
+ CONTACT user = { (wchar_t*)two.c_str(), NULL, NULL, false, false, true };
MCONTACT ccNew = CList_AddContact(&user, false, false);
if (ccNew) {
CMString s;
@@ -646,8 +645,8 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
CallService(MS_FILE_SENDFILE, ccNew, 0);
else {
CMString temp = GetWordAddress(text.c_str(), 3);
- TCHAR* pp[2];
- TCHAR* p = (TCHAR*)temp.c_str();
+ wchar_t* pp[2];
+ wchar_t* p = (wchar_t*)temp.c_str();
pp[0] = p;
pp[1] = NULL;
CallService(MS_FILE_SENDSPECIFICFILEST, ccNew, (LPARAM)pp);
@@ -662,7 +661,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
}
if (mir_tstrcmpi(one.c_str(), L"chat") == 0) {
- TCHAR szTemp[1000];
+ wchar_t szTemp[1000];
unsigned long ulAdr = 0;
if (m_manualHost)
@@ -672,7 +671,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
if (ulAdr) {
CMString contact = two; contact += DCCSTRING;
- CONTACT user = { (TCHAR*)contact.c_str(), NULL, NULL, false, false, true };
+ CONTACT user = { (wchar_t*)contact.c_str(), NULL, NULL, false, false, true };
MCONTACT ccNew = CList_AddContact(&user, false, false);
setByte(ccNew, "DCC", 1);
@@ -716,43 +715,43 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
struct DoInputRequestParam
{
- DoInputRequestParam(CIrcProto* _pro, const TCHAR* _str) :
+ DoInputRequestParam(CIrcProto* _pro, const wchar_t* _str) :
ppro(_pro),
str(mir_tstrdup(_str))
{}
CIrcProto *ppro;
- TCHAR* str;
+ wchar_t* str;
};
static void __stdcall DoInputRequestAliasApcStub(void* _par)
{
DoInputRequestParam* param = (DoInputRequestParam*)_par;
CIrcProto *ppro = param->ppro;
- TCHAR* str = param->str;
+ wchar_t* str = param->str;
- TCHAR* infotext = NULL;
- TCHAR* title = NULL;
- TCHAR* defaulttext = NULL;
- CMString command = (TCHAR*)str;
- TCHAR* p = _tcsstr((TCHAR*)str, L"%question");
+ wchar_t* infotext = NULL;
+ wchar_t* title = NULL;
+ wchar_t* defaulttext = NULL;
+ CMString command = (wchar_t*)str;
+ wchar_t* p = wcsstr((wchar_t*)str, L"%question");
if (p[9] == '=' && p[10] == '\"') {
infotext = &p[11];
- p = _tcschr(infotext, '\"');
+ p = wcschr(infotext, '\"');
if (p) {
*p = '\0';
p++;
if (*p == ',' && p[1] == '\"') {
p++; p++;
title = p;
- p = _tcschr(title, '\"');
+ p = wcschr(title, '\"');
if (p) {
*p = '\0';
p++;
if (*p == ',' && p[1] == '\"') {
p++; p++;
defaulttext = p;
- p = _tcschr(defaulttext, '\"');
+ p = wcschr(defaulttext, '\"');
if (p)
*p = '\0';
}
@@ -785,24 +784,24 @@ static void __stdcall DoInputRequestAliasApcStub(void* _par)
delete param;
}
-bool CIrcProto::PostIrcMessage(const TCHAR* fmt, ...)
+bool CIrcProto::PostIrcMessage(const wchar_t* fmt, ...)
{
if (!fmt || mir_tstrlen(fmt) < 1 || mir_tstrlen(fmt) > 4000)
return 0;
va_list marker;
va_start(marker, fmt);
- static TCHAR szBuf[4 * 1024];
+ static wchar_t szBuf[4 * 1024];
mir_vsntprintf(szBuf, _countof(szBuf), fmt, marker);
va_end(marker);
return PostIrcMessageWnd(NULL, NULL, szBuf);
}
-bool CIrcProto::PostIrcMessageWnd(TCHAR *window, MCONTACT hContact, const TCHAR *szBuf)
+bool CIrcProto::PostIrcMessageWnd(wchar_t *window, MCONTACT hContact, const wchar_t *szBuf)
{
DBVARIANT dbv;
- TCHAR windowname[256];
+ wchar_t windowname[256];
BYTE bDCC = 0;
if (hContact)
@@ -821,7 +820,7 @@ bool CIrcProto::PostIrcMessageWnd(TCHAR *window, MCONTACT hContact, const TCHAR
mir_tstrncpy(windowname, SERVERWINDOW, 255);
if (mir_tstrcmpi(window, SERVERWINDOW) != 0) {
- TCHAR* p1 = _tcschr(windowname, ' ');
+ wchar_t* p1 = wcschr(windowname, ' ');
if (p1)
*p1 = '\0';
}
diff --git a/protocols/IRCG/src/irc_dlg.h b/protocols/IRCG/src/irc_dlg.h
index 327130838f..a9610a97f3 100644
--- a/protocols/IRCG/src/irc_dlg.h
+++ b/protocols/IRCG/src/irc_dlg.h
@@ -165,7 +165,7 @@ struct CManagerDlg : public CCoolIrcDlg
void ApplyQuestion();
void CloseQuestion();
- void InitManager(int mode, const TCHAR* window);
+ void InitManager(int mode, const wchar_t* window);
};
struct CQuestionDlg : public CCoolIrcDlg
@@ -302,9 +302,9 @@ struct CAddIgnoreDlg : public CProtoDlgBase < CIrcProto >
CCtrlButton m_Ok;
CIgnorePrefsDlg* m_owner;
- TCHAR szOldMask[500];
+ wchar_t szOldMask[500];
- CAddIgnoreDlg(CIrcProto* _pro, const TCHAR* mask, CIgnorePrefsDlg* parent);
+ CAddIgnoreDlg(CIrcProto* _pro, const wchar_t* mask, CIgnorePrefsDlg* parent);
virtual void OnInitDialog();
virtual void OnClose();
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp
index bac5fd2d2b..3828a45f5f 100644
--- a/protocols/IRCG/src/irclib.cpp
+++ b/protocols/IRCG/src/irclib.cpp
@@ -36,7 +36,7 @@ OBJLIST<CIrcHandler> CIrcProto::m_handlers( 30, CompareHandlers );
////////////////////////////////////////////////////////////////////
-CIrcMessage::CIrcMessage( CIrcProto* _pro, const TCHAR* lpszCmdLine, int codepage, bool bIncoming, bool bNotify ) :
+CIrcMessage::CIrcMessage( CIrcProto* _pro, const wchar_t* lpszCmdLine, int codepage, bool bIncoming, bool bNotify ) :
m_proto( _pro ),
m_bIncoming( bIncoming ),
m_bNotify( bNotify ),
@@ -89,29 +89,29 @@ CIrcMessage& CIrcMessage::operator = (const CIrcMessage& m)
return *this;
}
-CIrcMessage& CIrcMessage::operator = (const TCHAR* lpszCmdLine)
+CIrcMessage& CIrcMessage::operator = (const wchar_t* lpszCmdLine)
{
Reset();
ParseIrcCommand(lpszCmdLine);
return *this;
}
-void CIrcMessage::ParseIrcCommand(const TCHAR* lpszCmdLine)
+void CIrcMessage::ParseIrcCommand(const wchar_t* lpszCmdLine)
{
- const TCHAR* p1 = lpszCmdLine;
- const TCHAR* p2 = lpszCmdLine;
+ const wchar_t* p1 = lpszCmdLine;
+ const wchar_t* p2 = lpszCmdLine;
// prefix exists ?
if (*p1 == ':') {
// break prefix into its components (nick!user@host)
p2 = ++p1;
- while (*p2 && !_tcschr(L" !", *p2))
+ while (*p2 && !wcschr(L" !", *p2))
++p2;
prefix.sNick.SetString(p1, p2 - p1);
if (*p2 != '!')
goto end_of_prefix;
p1 = ++p2;
- while (*p2 && !_tcschr(L" @", *p2))
+ while (*p2 && !wcschr(L" @", *p2))
++p2;
prefix.sUser.SetString(p1, p2 - p1);
if (*p2 != '@')
@@ -168,7 +168,7 @@ int CIrcProto::getCodepage() const
return (con != NULL) ? codepage : CP_ACP;
}
-void CIrcProto::SendIrcMessage(const TCHAR* msg, bool bNotify, int cp)
+void CIrcProto::SendIrcMessage(const wchar_t* msg, bool bNotify, int cp)
{
if (cp == -1)
cp = getCodepage();
@@ -200,7 +200,7 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info)
ncon.wPort = info.iPort;
con = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)m_hNetlibUser, (LPARAM)&ncon);
if (con == NULL) {
- TCHAR szTemp[300];
+ wchar_t szTemp[300];
mir_sntprintf(szTemp, L"\0035%s \002%s\002 (%S: %u).",
TranslateT("Failed to connect to"), si.sNetwork.c_str(), si.sServer.c_str(), si.iPort);
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false);
@@ -233,7 +233,7 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info)
NLSend(L"NICK %s\r\n", info.sNick.c_str());
CMString userID = GetWord(info.sUserID.c_str(), 0);
- TCHAR szHostName[MAX_PATH];
+ wchar_t szHostName[MAX_PATH];
DWORD cbHostName = _countof(szHostName);
GetComputerName(szHostName, &cbHostName);
CMString HostName = GetWord(szHostName, 0);
@@ -283,12 +283,12 @@ int CIrcProto::NLSend(const unsigned char* buf, int cbBuf)
return Netlib_Send(con, (const char*)buf, cbBuf, MSG_DUMPASTEXT);
}
-int CIrcProto::NLSend(const TCHAR* fmt, ...)
+int CIrcProto::NLSend(const wchar_t* fmt, ...)
{
va_list marker;
va_start(marker, fmt);
- TCHAR szBuf[1024 * 4];
+ wchar_t szBuf[1024 * 4];
mir_vsntprintf(szBuf, _countof(szBuf), fmt, marker);
va_end(marker);
@@ -332,7 +332,7 @@ void CIrcProto::KillIdent()
}
}
-void CIrcProto::InsertIncomingEvent(TCHAR* pszRaw)
+void CIrcProto::InsertIncomingEvent(wchar_t* pszRaw)
{
CIrcMessage msg(this, pszRaw, true);
Notify(&msg);
@@ -341,7 +341,7 @@ void CIrcProto::InsertIncomingEvent(TCHAR* pszRaw)
void CIrcProto::createMessageFromPchar(const char* p)
{
- TCHAR* ptszMsg;
+ wchar_t* ptszMsg;
if (codepage != CP_UTF8 && m_utfAutodetect) {
if (mir_utf8decodecp(NEWSTR_ALLOCA(p), codepage, &ptszMsg) == NULL)
ptszMsg = mir_a2t_cp(p, codepage);
@@ -518,7 +518,7 @@ CDccSession* CIrcProto::FindDCCSendByPort(int iPort)
return 0;
}
-CDccSession* CIrcProto::FindDCCRecvByPortAndName(int iPort, const TCHAR* szName)
+CDccSession* CIrcProto::FindDCCRecvByPortAndName(int iPort, const wchar_t* szName)
{
mir_cslock lck(m_dcc);
@@ -589,7 +589,7 @@ void CIrcProto::CheckDCCTimeout(void)
////////////////////////////////////////////////////////////////////
-CIrcIgnoreItem::CIrcIgnoreItem(const TCHAR* _mask, const TCHAR* _flags, const TCHAR* _network) :
+CIrcIgnoreItem::CIrcIgnoreItem(const wchar_t* _mask, const wchar_t* _flags, const wchar_t* _network) :
mask(_mask),
flags(_flags),
network(_network)
@@ -597,9 +597,9 @@ CIrcIgnoreItem::CIrcIgnoreItem(const TCHAR* _mask, const TCHAR* _flags, const TC
}
CIrcIgnoreItem::CIrcIgnoreItem(int codepage, const char* _mask, const char* _flags, const char* _network) :
- mask((TCHAR*)_A2T(_mask, codepage)),
- flags((TCHAR*)_A2T(_flags, codepage)),
- network((TCHAR*)_A2T(_network, codepage))
+ mask((wchar_t*)_A2T(_mask, codepage)),
+ flags((wchar_t*)_A2T(_flags, codepage)),
+ network((wchar_t*)_A2T(_network, codepage))
{
}
@@ -673,7 +673,7 @@ void CIrcProto::OnIrcMessage(const CIrcMessage* pmsg)
else OnIrcDisconnected();
}
-PfnIrcMessageHandler CIrcProto::FindMethod(const TCHAR* lpszName)
+PfnIrcMessageHandler CIrcProto::FindMethod(const wchar_t* lpszName)
{
CIrcHandler temp(lpszName, NULL);
CIrcHandler* p = m_handlers.find(&temp);
@@ -814,7 +814,7 @@ int CDccSession::NLReceive(const unsigned char* buf, int cbBuf)
return n;
}
-int CDccSession::SendStuff(const TCHAR* fmt)
+int CDccSession::SendStuff(const wchar_t* fmt)
{
CMStringA buf = _T2A(fmt, m_proto->getCodepage());
return NLSend((const unsigned char*)buf.c_str(), buf.GetLength());
@@ -861,11 +861,11 @@ int CDccSession::SetupConnection()
// Set up stuff needed for the filetransfer dialog (if it is a filetransfer)
if (di->iType == DCC_SEND) {
- file[0] = (TCHAR*)di->sFileAndPath.c_str();
+ file[0] = (wchar_t*)di->sFileAndPath.c_str();
file[1] = 0;
- pfts.tszCurrentFile = (TCHAR*)di->sFileAndPath.c_str();
- pfts.tszWorkingDir = (TCHAR*)di->sPath.c_str();
+ pfts.tszCurrentFile = (wchar_t*)di->sFileAndPath.c_str();
+ pfts.tszWorkingDir = (wchar_t*)di->sPath.c_str();
pfts.hContact = di->hContact;
pfts.flags = PFTS_TCHAR + ((di->bSender) ? PFTS_SENDING : PFTS_RECEIVING);
pfts.totalFiles = 1;
@@ -967,7 +967,7 @@ int CDccSession::SetupConnection()
hBindPort = (HANDLE)CallService(MS_NETLIB_BINDPORT, (WPARAM)m_proto->hNetlibDCC, (LPARAM)&nb);
if (hBindPort == NULL) {
- m_proto->DoEvent(GC_EVENT_INFORMATION, 0, m_proto->m_info.sNick.c_str(), LPGENT("DCC ERROR: Unable to bind local port for passive file transfer"), NULL, NULL, NULL, true, false);
+ m_proto->DoEvent(GC_EVENT_INFORMATION, 0, m_proto->m_info.sNick.c_str(), LPGENW("DCC ERROR: Unable to bind local port for passive file transfer"), NULL, NULL, NULL, true, false);
delete this; // dcc objects destroy themselves when the connection has been closed or failed for some reasson.
return 0;
}
@@ -1083,7 +1083,7 @@ void CDccSession::DoSendFile()
// is there a connection?
if (con) {
// open the file for reading
- int hFile = _topen(di->sFileAndPath.c_str(), _O_RDONLY | _O_BINARY, _S_IREAD);
+ int hFile = _wopen(di->sFileAndPath.c_str(), _O_RDONLY | _O_BINARY, _S_IREAD);
if (hFile >= 0) {
unsigned __int64 dwLastAck = 0;
@@ -1226,7 +1226,7 @@ void CDccSession::DoReceiveFile()
ProtoBroadcastAck(m_proto->m_szModuleName, di->hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, (void *)di, 0);
// open the file for writing (and reading in case it is a resume)
- int hFile = _topen(di->sFileAndPath.c_str(),
+ int hFile = _wopen(di->sFileAndPath.c_str(),
(dwWhatNeedsDoing == FILERESUME_RESUME ? _O_APPEND : _O_TRUNC | _O_CREAT) | _O_RDWR | _O_BINARY,
_S_IREAD | _S_IWRITE);
if (hFile >= 0) {
diff --git a/protocols/IRCG/src/irclib.h b/protocols/IRCG/src/irclib.h
index 043a83ca76..069c545a12 100644
--- a/protocols/IRCG/src/irclib.h
+++ b/protocols/IRCG/src/irclib.h
@@ -69,17 +69,17 @@ public :
int m_codePage;
//CIrcMessage( CIrcProto* ); // default constructor
- CIrcMessage( CIrcProto*, const TCHAR* lpszCmdLine, int codepage, bool bIncoming=false, bool bNotify = true); // parser constructor
+ CIrcMessage( CIrcProto*, const wchar_t* lpszCmdLine, int codepage, bool bIncoming=false, bool bNotify = true); // parser constructor
CIrcMessage( const CIrcMessage& m ); // copy constructor
~CIrcMessage();
void Reset();
CIrcMessage& operator = (const CIrcMessage& m);
- CIrcMessage& operator = (const TCHAR* lpszCmdLine);
+ CIrcMessage& operator = (const wchar_t* lpszCmdLine);
private :
- void ParseIrcCommand(const TCHAR* lpszCmdLine);
+ void ParseIrcCommand(const wchar_t* lpszCmdLine);
};
////////////////////////////////////////////////////////////////////
@@ -110,7 +110,7 @@ struct CIrcSessionInfo
struct CIrcIgnoreItem
{
- CIrcIgnoreItem( const TCHAR*, const TCHAR*, const TCHAR* );
+ CIrcIgnoreItem( const wchar_t*, const wchar_t*, const wchar_t* );
CIrcIgnoreItem( int codepage, const char*, const char*, const char* );
~CIrcIgnoreItem();
@@ -132,7 +132,7 @@ protected:
int iGlobalToken;
PROTOFILETRANSFERSTATUS pfts; // structure used to setup and update the filetransfer dialogs of miranda
- TCHAR* file[2];
+ wchar_t* file[2];
int SetupConnection();
void DoSendFile();
@@ -154,7 +154,7 @@ public:
HANDLE hEvent; // Manual object
long dwWhatNeedsDoing; // Set to indicate what FILERESUME_ action is chosen by the user
- TCHAR* NewFileName; // contains new file name if FILERESUME_RENAME chosen
+ wchar_t* NewFileName; // contains new file name if FILERESUME_RENAME chosen
unsigned __int64 dwResumePos; // position to resume from if FILERESUME_RESUME
int iToken; // used to identify (find) objects in reverse dcc filetransfers
@@ -163,7 +163,7 @@ public:
int Connect();
void SetupPassive( DWORD adr, DWORD port );
- int SendStuff(const TCHAR* fmt);
+ int SendStuff(const wchar_t* fmt);
int IncomingConnection(HANDLE hConnection, DWORD dwIP);
int Disconnect();
};
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index eaa7f8541b..dc17feab0a 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -31,7 +31,7 @@ static int CompareSessions(const CDccSession* p1, const CDccSession* p2)
return INT_PTR(p1->di->hContact) - INT_PTR(p2->di->hContact);
}
-CIrcProto::CIrcProto(const char* szModuleName, const TCHAR* tszUserName) :
+CIrcProto::CIrcProto(const char* szModuleName, const wchar_t* tszUserName) :
PROTO<CIrcProto>(szModuleName, tszUserName),
m_dcc_chats(10, CompareSessions),
m_dcc_xfers(10, CompareSessions),
@@ -174,7 +174,7 @@ static int sttCheckPerform(const char *szSetting, LPARAM lParam)
int CIrcProto::OnModulesLoaded(WPARAM, LPARAM)
{
NETLIBUSER nlu = { 0 };
- TCHAR name[128];
+ wchar_t name[128];
db_unset(NULL, m_szModuleName, "JTemp");
@@ -208,7 +208,7 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM)
gcw.iType = GCW_SERVER;
gcw.ptszID = SERVERWINDOW;
gcw.pszModule = m_szModuleName;
- gcw.ptszName = NEWTSTR_ALLOCA((TCHAR*)_A2T(m_network));
+ gcw.ptszName = NEWWSTR_ALLOCA((wchar_t*)_A2T(m_network));
CallServiceSync(MS_GC_NEWSESSION, 0, (LPARAM)&gcw);
GCDEST gcd = { m_szModuleName, SERVERWINDOW, GC_EVENT_CONTROL };
@@ -218,9 +218,9 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM)
else
CallChatEvent(WINDOW_HIDDEN, (LPARAM)&gce);
- TCHAR szTemp[MAX_PATH];
+ wchar_t szTemp[MAX_PATH];
mir_sntprintf(szTemp, L"%%miranda_path%%\\Plugins\\%S_perform.ini", m_szModuleName);
- TCHAR *szLoadFileName = Utils_ReplaceVarsT(szTemp);
+ wchar_t *szLoadFileName = Utils_ReplaceVarsT(szTemp);
char* pszPerformData = IrcLoadFile(szLoadFileName);
if (pszPerformData != NULL) {
char *p1 = pszPerformData, *p2 = pszPerformData;
@@ -240,7 +240,7 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM)
setString(("PERFORM:" + sNetwork).c_str(), rtrim(p1));
}
delete[] pszPerformData;
- ::_tremove(szLoadFileName);
+ ::_wremove(szLoadFileName);
}
mir_free(szLoadFileName);
@@ -272,7 +272,7 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM)
HookProtoEvent(ME_OPT_INITIALISE, &CIrcProto::OnInitOptionsPages);
if (m_nick[0]) {
- TCHAR szBuf[40];
+ wchar_t szBuf[40];
if (mir_tstrlen(m_alternativeNick) == 0) {
mir_sntprintf(szBuf, L"%s%u", m_nick, rand() % 9999);
setTString("AlernativeNick", szBuf);
@@ -297,7 +297,7 @@ MCONTACT __cdecl CIrcProto::AddToList(int, PROTOSEARCHRESULT* psr)
if (m_iStatus == ID_STATUS_OFFLINE || m_iStatus == ID_STATUS_CONNECTING)
return 0;
- TCHAR *id = psr->id.t ? psr->id.t : psr->nick.t;
+ wchar_t *id = psr->id.w ? psr->id.w : psr->nick.w;
id = psr->flags & PSR_UNICODE ? mir_u2t((wchar_t*)id) : mir_a2t((char*)id);
CONTACT user = { id, NULL, NULL, true, false, false };
@@ -341,7 +341,7 @@ int __cdecl CIrcProto::Authorize(MEVENT)
////////////////////////////////////////////////////////////////////////////////////////
// AuthDeny - handles the unsuccessful authorization
-int __cdecl CIrcProto::AuthDeny(MEVENT, const TCHAR*)
+int __cdecl CIrcProto::AuthDeny(MEVENT, const wchar_t*)
{
return 0;
}
@@ -349,7 +349,7 @@ int __cdecl CIrcProto::AuthDeny(MEVENT, const TCHAR*)
////////////////////////////////////////////////////////////////////////////////////////
// FileAllow - starts a file transfer
-HANDLE __cdecl CIrcProto::FileAllow(MCONTACT, HANDLE hTransfer, const TCHAR* szPath)
+HANDLE __cdecl CIrcProto::FileAllow(MCONTACT, HANDLE hTransfer, const wchar_t* szPath)
{
DCCINFO* di = (DCCINFO*)hTransfer;
@@ -386,7 +386,7 @@ int __cdecl CIrcProto::FileCancel(MCONTACT, HANDLE hTransfer)
////////////////////////////////////////////////////////////////////////////////////////
// FileDeny - denies a file transfer
-int __cdecl CIrcProto::FileDeny(MCONTACT, HANDLE hTransfer, const TCHAR*)
+int __cdecl CIrcProto::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t*)
{
DCCINFO* di = (DCCINFO*)hTransfer;
delete di;
@@ -396,7 +396,7 @@ int __cdecl CIrcProto::FileDeny(MCONTACT, HANDLE hTransfer, const TCHAR*)
////////////////////////////////////////////////////////////////////////////////////////
// FileResume - processes file renaming etc
-int __cdecl CIrcProto::FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename)
+int __cdecl CIrcProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename)
{
DCCINFO* di = (DCCINFO*)hTransfer;
@@ -406,7 +406,7 @@ int __cdecl CIrcProto::FileResume(HANDLE hTransfer, int* action, const TCHAR** s
if (dcc) {
InterlockedExchange(&dcc->dwWhatNeedsDoing, i);
if (*action == FILERESUME_RENAME) {
- TCHAR* szTemp = _tcsdup(*szFilename);
+ wchar_t* szTemp = wcsdup(*szFilename);
InterlockedExchangePointer((PVOID*)&dcc->NewFileName, szTemp);
}
@@ -414,7 +414,7 @@ int __cdecl CIrcProto::FileResume(HANDLE hTransfer, int* action, const TCHAR** s
unsigned __int64 dwPos = 0;
struct _stati64 statbuf;
- if (_tstati64(di->sFileAndPath.c_str(), &statbuf) == 0 && (statbuf.st_mode & _S_IFDIR) == 0)
+ if (_wstat64(di->sFileAndPath.c_str(), &statbuf) == 0 && (statbuf.st_mode & _S_IFDIR) == 0)
dwPos = statbuf.st_size;
CMString sFileWithQuotes = di->sFile;
@@ -475,7 +475,7 @@ DWORD_PTR __cdecl CIrcProto::GetCaps(int type, MCONTACT)
struct AckBasicSearchParam
{
- TCHAR buf[50];
+ wchar_t buf[50];
};
void __cdecl CIrcProto::AckBasicSearch(void *arg)
@@ -485,13 +485,13 @@ void __cdecl CIrcProto::AckBasicSearch(void *arg)
AckBasicSearchParam *param = (AckBasicSearchParam*)arg;
PROTOSEARCHRESULT psr = { sizeof(psr) };
psr.flags = PSR_TCHAR;
- psr.id.t = psr.nick.t = param->buf;
+ psr.id.w = psr.nick.w = param->buf;
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)& psr);
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)1, 0);
delete param;
}
-HANDLE __cdecl CIrcProto::SearchBasic(const TCHAR* szId)
+HANDLE __cdecl CIrcProto::SearchBasic(const wchar_t* szId)
{
if (szId) {
if (m_iStatus != ID_STATUS_OFFLINE && m_iStatus != ID_STATUS_CONNECTING &&
@@ -509,7 +509,7 @@ HANDLE __cdecl CIrcProto::SearchBasic(const TCHAR* szId)
////////////////////////////////////////////////////////////////////////////////////////
// SendFile - sends a file
-HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR** ppszFiles)
+HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t** ppszFiles)
{
DCCINFO* dci = NULL;
int iPort = 0;
@@ -537,7 +537,7 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR** ppsz
//get file size
while (ppszFiles[index]) {
struct _stati64 statbuf;
- if (_tstati64(ppszFiles[index], &statbuf) == 0 && (statbuf.st_mode & _S_IFDIR) == 0) {
+ if (_wstat64(ppszFiles[index], &statbuf) == 0 && (statbuf.st_mode & _S_IFDIR) == 0) {
size = statbuf.st_size;
break;
}
@@ -588,7 +588,7 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR** ppsz
// is it an reverse filetransfer (receiver acts as server)
if (dci->bReverse) {
- TCHAR szTemp[256];
+ wchar_t szTemp[256];
PostIrcMessage(L"/CTCP %s DCC SEND %s 200 0 %I64u %u",
dci->sContactName.c_str(), sFileWithQuotes.c_str(), dci->dwSize, dcc->iToken);
@@ -607,7 +607,7 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR** ppsz
else { // ... normal filetransfer.
iPort = dcc->Connect();
if (iPort) {
- TCHAR szTemp[256];
+ wchar_t szTemp[256];
PostIrcMessage(L"/CTCP %s DCC SEND %s %u %u %I64u",
dci->sContactName.c_str(), sFileWithQuotes.c_str(), ulAdr, iPort, dci->dwSize);
@@ -619,7 +619,7 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR** ppsz
if (m_sendNotice) {
mir_sntprintf(szTemp,
L"/NOTICE %s I am sending the file '\002%s\002' (%I64u kB) to you, please accept it. [IP: %s]",
- dci->sContactName.c_str(), sFileCorrect.c_str(), dci->dwSize / 1024, (TCHAR*)_A2T(ConvertIntegerToIP(ulAdr)));
+ dci->sContactName.c_str(), sFileCorrect.c_str(), dci->dwSize / 1024, (wchar_t*)_A2T(ConvertIntegerToIP(ulAdr)));
PostIrcMessage(szTemp);
}
}
@@ -630,7 +630,7 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR** ppsz
// fix for sending multiple files
index++;
while (ppszFiles[index]) {
- if (_taccess(ppszFiles[index], 0) == 0) {
+ if (_waccess(ppszFiles[index], 0) == 0) {
PostIrcMessage(L"/DCC SEND %s %S", dci->sContactName.c_str(), ppszFiles[index]);
}
index++;
@@ -692,7 +692,7 @@ int __cdecl CIrcProto::SendMsg(MCONTACT hContact, int, const char* pszSrc)
return 0;
}
- TCHAR *result;
+ wchar_t *result;
mir_utf8decode(NEWSTR_ALLOCA(pszSrc), &result);
PostIrcMessageWnd(NULL, hContact, result);
mir_free(result);
@@ -806,7 +806,7 @@ HANDLE __cdecl CIrcProto::GetAwayMsg(MCONTACT hContact)
////////////////////////////////////////////////////////////////////////////////////////
// SetAwayMsg - sets the away status message
-int __cdecl CIrcProto::SetAwayMsg(int status, const TCHAR* msg)
+int __cdecl CIrcProto::SetAwayMsg(int status, const wchar_t* msg)
{
switch (status) {
case ID_STATUS_ONLINE: case ID_STATUS_INVISIBLE: case ID_STATUS_FREECHAT:
diff --git a/protocols/IRCG/src/main.cpp b/protocols/IRCG/src/main.cpp
index 549e9dc8ed..d82a0e9b6c 100644
--- a/protocols/IRCG/src/main.cpp
+++ b/protocols/IRCG/src/main.cpp
@@ -73,7 +73,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC
/////////////////////////////////////////////////////////////////////////////////////////
-static CIrcProto* ircProtoInit(const char* pszProtoName, const TCHAR* tszUserName)
+static CIrcProto* ircProtoInit(const char* pszProtoName, const wchar_t* tszUserName)
{
CIrcProto *ppro = new CIrcProto(pszProtoName, tszUserName);
g_Instances.insert(ppro);
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp
index 608cd844bb..3dee470d0d 100644
--- a/protocols/IRCG/src/options.cpp
+++ b/protocols/IRCG/src/options.cpp
@@ -63,10 +63,10 @@ void CIrcProto::ReadSettings(TDbSetting* sets, int count)
if (!getTString(p->name, &dbv)) {
if (p->size != -1) {
size_t len = min(p->size - 1, mir_tstrlen(dbv.ptszVal));
- memcpy(ptr, dbv.pszVal, len*sizeof(TCHAR));
- *(TCHAR*)&ptr[len*sizeof(TCHAR)] = 0;
+ memcpy(ptr, dbv.pszVal, len*sizeof(wchar_t));
+ *(wchar_t*)&ptr[len*sizeof(wchar_t)] = 0;
}
- else *(TCHAR**)ptr = mir_tstrdup(dbv.ptszVal);
+ else *(wchar_t**)ptr = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
else {
@@ -74,9 +74,9 @@ void CIrcProto::ReadSettings(TDbSetting* sets, int count)
if (p->defStr == NULL)
*ptr = 0;
else
- mir_tstrncpy((TCHAR*)ptr, p->defStr, (int)p->size);
+ mir_tstrncpy((wchar_t*)ptr, p->defStr, (int)p->size);
}
- else *(TCHAR**)ptr = mir_tstrdup(p->defStr);
+ else *(wchar_t**)ptr = mir_tstrdup(p->defStr);
}
break;
} } }
@@ -102,9 +102,9 @@ void CIrcProto::WriteSettings( TDbSetting* sets, int count )
case DBVT_TCHAR:
if (p->size == -1)
- setTString(p->name, *(TCHAR**)ptr);
+ setTString(p->name, *(wchar_t**)ptr);
else
- setTString(p->name, (TCHAR*)ptr);
+ setTString(p->name, (wchar_t*)ptr);
break;
} } }
@@ -173,11 +173,11 @@ void RereadServers()
/////////////////////////////////////////////////////////////////////////////////////////
-static void removeSpaces(TCHAR* p)
+static void removeSpaces(wchar_t* p)
{
while (*p) {
if (*p == ' ')
- memmove(p, p + 1, sizeof(TCHAR)*mir_tstrlen(p));
+ memmove(p, p + 1, sizeof(wchar_t)*mir_tstrlen(p));
p++;
}
}
@@ -231,36 +231,36 @@ HANDLE GetIconHandle(int iconId)
/////////////////////////////////////////////////////////////////////////////////////////
// code page handler
-struct { UINT cpId; TCHAR *cpName; } static cpTable[] =
-{
- { 874, LPGENT("Thai") },
- { 932, LPGENT("Japanese") },
- { 936, LPGENT("Simplified Chinese") },
- { 949, LPGENT("Korean") },
- { 950, LPGENT("Traditional Chinese") },
- { 1250, LPGENT("Central European") },
- { 1251, LPGENT("Cyrillic (Windows)") },
- { 20866, LPGENT("Cyrillic (KOI8R)") },
- { 1252, LPGENT("Latin I") },
- { 1253, LPGENT("Greek") },
- { 1254, LPGENT("Turkish") },
- { 1255, LPGENT("Hebrew") },
- { 1256, LPGENT("Arabic") },
- { 1257, LPGENT("Baltic") },
- { 1258, LPGENT("Vietnamese") },
- { 1361, LPGENT("Korean (Johab)") }
+struct { UINT cpId; wchar_t *cpName; } static cpTable[] =
+{
+ { 874, LPGENW("Thai") },
+ { 932, LPGENW("Japanese") },
+ { 936, LPGENW("Simplified Chinese") },
+ { 949, LPGENW("Korean") },
+ { 950, LPGENW("Traditional Chinese") },
+ { 1250, LPGENW("Central European") },
+ { 1251, LPGENW("Cyrillic (Windows)") },
+ { 20866, LPGENW("Cyrillic (KOI8R)") },
+ { 1252, LPGENW("Latin I") },
+ { 1253, LPGENW("Greek") },
+ { 1254, LPGENW("Turkish") },
+ { 1255, LPGENW("Hebrew") },
+ { 1256, LPGENW("Arabic") },
+ { 1257, LPGENW("Baltic") },
+ { 1258, LPGENW("Vietnamese") },
+ { 1361, LPGENW("Korean (Johab)") }
};
static CCtrlCombo* sttCombo;
-static BOOL CALLBACK sttLangAddCallback(TCHAR *str)
+static BOOL CALLBACK sttLangAddCallback(wchar_t *str)
{
- UINT cp = _ttoi(str);
+ UINT cp = _wtoi(str);
CPINFOEX cpinfo;
if (GetCPInfoEx(cp, 0, &cpinfo)) {
- TCHAR* b = _tcschr(cpinfo.CodePageName, '(');
+ wchar_t* b = wcschr(cpinfo.CodePageName, '(');
if (b) {
- TCHAR* e = _tcsrchr(cpinfo.CodePageName, ')');
+ wchar_t* e = wcsrchr(cpinfo.CodePageName, ')');
if (e) {
*e = 0;
sttCombo->AddString(b + 1, cp);
@@ -601,8 +601,8 @@ void CConnectPrefsDlg::OnDeleteServer(CCtrlButton*)
m_del.Disable();
SERVER_INFO *pData = (SERVER_INFO*)m_serverCombo.GetItemData(i);
- TCHAR temp[200];
- mir_sntprintf(temp, TranslateT("Do you want to delete\r\n%s"), (TCHAR*)_A2T(pData->m_name));
+ wchar_t temp[200];
+ mir_sntprintf(temp, TranslateT("Do you want to delete\r\n%s"), (wchar_t*)_A2T(pData->m_name));
if (MessageBox(m_hwnd, temp, TranslateT("Delete server"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
g_servers.remove(pData);
@@ -693,7 +693,7 @@ void CConnectPrefsDlg::OnApply()
m_nick.GetText(m_proto->m_nick, _countof(m_proto->m_nick));
removeSpaces(m_proto->m_nick);
- _tcsncpy_s(m_proto->m_pNick, m_proto->m_nick, _TRUNCATE);
+ wcsncpy_s(m_proto->m_pNick, m_proto->m_nick, _TRUNCATE);
m_nick2.GetText(m_proto->m_alternativeNick, _countof(m_proto->m_alternativeNick));
removeSpaces(m_proto->m_alternativeNick);
m_userID.GetText(m_proto->m_userID, _countof(m_proto->m_userID));
@@ -827,7 +827,7 @@ void CCtcpPrefsDlg::OnInitDialog()
m_combo.AddStringA("4096");
m_combo.AddStringA("8192");
- TCHAR szTemp[10];
+ wchar_t szTemp[10];
mir_sntprintf(szTemp, L"%u", m_proto->m_DCCPacketSize);
int i = m_combo.SelectString(szTemp);
if (i == CB_ERR)
@@ -849,14 +849,14 @@ void CCtcpPrefsDlg::OnInitDialog()
else {
if (m_proto->m_IPFromServer) {
if (m_proto->m_myHost[0]) {
- CMString s = (CMString)TranslateT("<Resolved IP: ") + (TCHAR*)_A2T(m_proto->m_myHost) + L">";
+ CMString s = (CMString)TranslateT("<Resolved IP: ") + (wchar_t*)_A2T(m_proto->m_myHost) + L">";
m_ip.SetText(s.c_str());
}
else m_ip.SetText(TranslateT("<Automatic>"));
}
else {
if (m_proto->m_myLocalHost[0]) {
- CMString s = (CMString)TranslateT("<Local IP: ") + (TCHAR*)_A2T(m_proto->m_myLocalHost) + L">";
+ CMString s = (CMString)TranslateT("<Local IP: ") + (wchar_t*)_A2T(m_proto->m_myLocalHost) + L">";
m_ip.SetText(s.c_str());
}
else m_ip.SetText(TranslateT("<Automatic>"));
@@ -874,14 +874,14 @@ void CCtcpPrefsDlg::OnClicked(CCtrlData*)
else {
if (m_fromServer.GetState()) {
if (m_proto->m_myHost[0]) {
- CMString s = (CMString)TranslateT("<Resolved IP: ") + (TCHAR*)_A2T(m_proto->m_myHost) + L">";
+ CMString s = (CMString)TranslateT("<Resolved IP: ") + (wchar_t*)_A2T(m_proto->m_myHost) + L">";
m_ip.SetText(s.c_str());
}
else m_ip.SetText(TranslateT("<Automatic>"));
}
else {
if (m_proto->m_myLocalHost[0]) {
- CMString s = (CMString)TranslateT("<Local IP: ") + (TCHAR*)_A2T(m_proto->m_myLocalHost) + L">";
+ CMString s = (CMString)TranslateT("<Local IP: ") + (wchar_t*)_A2T(m_proto->m_myLocalHost) + L">";
m_ip.SetText(s.c_str());
}
else m_ip.SetText(TranslateT("<Automatic>"));
@@ -1089,7 +1089,7 @@ void COtherPrefsDlg::OnPerform(CCtrlData*)
void COtherPrefsDlg::OnAdd(CCtrlButton*)
{
- TCHAR* temp = m_pertormEdit.GetText();
+ wchar_t* temp = m_pertormEdit.GetText();
if (my_strstri(temp, L"/away"))
MessageBox(NULL, TranslateT("The usage of /AWAY in your perform buffer is restricted\n as IRC sends this command automatically."), TranslateT("IRC Error"), MB_OK);
@@ -1186,7 +1186,7 @@ void COtherPrefsDlg::addPerformComboValue(int idx, const char* szValueName)
/////////////////////////////////////////////////////////////////////////////////////////
// 'add ignore' preferences dialog
-CAddIgnoreDlg::CAddIgnoreDlg(CIrcProto* _pro, const TCHAR* mask, CIgnorePrefsDlg* _owner)
+CAddIgnoreDlg::CAddIgnoreDlg(CIrcProto* _pro, const wchar_t* mask, CIgnorePrefsDlg* _owner)
: CProtoDlgBase<CIrcProto>(_pro, IDD_ADDIGNORE, false),
m_Ok(this, IDOK),
m_owner(_owner)
@@ -1196,7 +1196,7 @@ CAddIgnoreDlg::CAddIgnoreDlg(CIrcProto* _pro, const TCHAR* mask, CIgnorePrefsDlg
if (mask == NULL)
szOldMask[0] = 0;
else
- _tcsncpy(szOldMask, mask, _countof(szOldMask));
+ wcsncpy(szOldMask, mask, _countof(szOldMask));
m_Ok.OnClick = Callback(this, &CAddIgnoreDlg::OnOk);
}
@@ -1216,8 +1216,8 @@ void CAddIgnoreDlg::OnInitDialog()
void CAddIgnoreDlg::OnOk(CCtrlButton*)
{
- TCHAR szMask[500];
- TCHAR szNetwork[500];
+ wchar_t szMask[500];
+ wchar_t szNetwork[500];
CMString flags;
if (IsDlgButtonChecked(m_hwnd, IDC_Q) == BST_CHECKED) flags += 'q';
if (IsDlgButtonChecked(m_hwnd, IDC_N) == BST_CHECKED) flags += 'n';
@@ -1231,7 +1231,7 @@ void CAddIgnoreDlg::OnOk(CCtrlButton*)
CMString Mask = GetWord(szMask, 0);
if (Mask.GetLength() != 0) {
- if (!_tcschr(Mask.c_str(), '!') && !_tcschr(Mask.c_str(), '@'))
+ if (!wcschr(Mask.c_str(), '!') && !wcschr(Mask.c_str(), '@'))
Mask += L"!*@*";
if (!flags.IsEmpty()) {
@@ -1265,8 +1265,8 @@ static int CALLBACK IgnoreListSort(LPARAM lParam1, LPARAM lParam2, LPARAM lParam
if (!hwndDlg->GetHwnd())
return 1;
- TCHAR temp1[512];
- TCHAR temp2[512];
+ wchar_t temp1[512];
+ wchar_t temp2[512];
LVITEM lvm;
lvm.mask = LVIF_TEXT;
@@ -1315,9 +1315,9 @@ static LRESULT CALLBACK ListviewSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
void CIrcProto::InitIgnore(void)
{
- TCHAR szTemp[MAX_PATH];
+ wchar_t szTemp[MAX_PATH];
mir_sntprintf(szTemp, L"%%miranda_path%%\\Plugins\\%S_ignore.ini", m_szModuleName);
- TCHAR *szLoadFileName = Utils_ReplaceVarsT(szTemp);
+ wchar_t *szLoadFileName = Utils_ReplaceVarsT(szTemp);
char* pszIgnoreData = IrcLoadFile(szLoadFileName);
if (pszIgnoreData != NULL) {
char *p1 = pszIgnoreData;
@@ -1347,7 +1347,7 @@ void CIrcProto::InitIgnore(void)
RewriteIgnoreSettings();
delete[] pszIgnoreData;
- ::_tremove(szLoadFileName);
+ ::_wremove(szLoadFileName);
}
mir_free(szLoadFileName);
@@ -1432,7 +1432,7 @@ void CIgnorePrefsDlg::OnInitDialog()
lvC.iSubItem = index;
lvC.cx = COLUMNS_SIZES[index];
- TCHAR* text = NULL;
+ wchar_t* text = NULL;
switch (index) {
case 0: text = TranslateT("Ignore mask"); break;
case 1: text = TranslateT("Flags"); break;
@@ -1492,9 +1492,9 @@ void CIgnorePrefsDlg::OnEdit(CCtrlButton*)
if (!m_add.Enabled())
return;
- TCHAR szMask[512];
- TCHAR szFlags[512];
- TCHAR szNetwork[512];
+ wchar_t szMask[512];
+ wchar_t szFlags[512];
+ wchar_t szNetwork[512];
int i = m_list.GetSelectionMark();
m_list.GetItemText(i, 0, szMask, 511);
m_list.GetItemText(i, 1, szFlags, 511);
@@ -1504,17 +1504,17 @@ void CIgnorePrefsDlg::OnEdit(CCtrlButton*)
HWND hWnd = dlg->GetHwnd();
SetWindowText(hWnd, TranslateT("Edit ignore"));
if (szFlags[0]) {
- if (_tcschr(szFlags, 'q'))
+ if (wcschr(szFlags, 'q'))
CheckDlgButton(hWnd, IDC_Q, BST_CHECKED);
- if (_tcschr(szFlags, 'n'))
+ if (wcschr(szFlags, 'n'))
CheckDlgButton(hWnd, IDC_N, BST_CHECKED);
- if (_tcschr(szFlags, 'i'))
+ if (wcschr(szFlags, 'i'))
CheckDlgButton(hWnd, IDC_I, BST_CHECKED);
- if (_tcschr(szFlags, 'd'))
+ if (wcschr(szFlags, 'd'))
CheckDlgButton(hWnd, IDC_D, BST_CHECKED);
- if (_tcschr(szFlags, 'c'))
+ if (wcschr(szFlags, 'c'))
CheckDlgButton(hWnd, IDC_C, BST_CHECKED);
- if (_tcschr(szFlags, 'm'))
+ if (wcschr(szFlags, 'm'))
CheckDlgButton(hWnd, IDC_M, BST_CHECKED);
}
SetDlgItemText(hWnd, IDC_MASK, szMask);
@@ -1529,7 +1529,7 @@ void CIgnorePrefsDlg::OnDelete(CCtrlButton*)
if (!m_del.Enabled())
return;
- TCHAR szMask[512];
+ wchar_t szMask[512];
int i = m_list.GetSelectionMark();
m_list.GetItemText(i, 0, szMask, _countof(szMask));
m_proto->RemoveIgnore(szMask);
@@ -1558,7 +1558,7 @@ void CIgnorePrefsDlg::OnDestroy()
int i = m_list.GetItemCount();
for (int j = 0; j < i; j++) {
- TCHAR szMask[512], szFlags[40], szNetwork[100];
+ wchar_t szMask[512], szFlags[40], szNetwork[100];
m_list.GetItemText(j, 0, szMask, _countof(szMask));
m_list.GetItemText(j, 1, szFlags, _countof(szFlags));
m_list.GetItemText(j, 2, szNetwork, _countof(szNetwork));
@@ -1595,17 +1595,17 @@ void CIgnorePrefsDlg::RebuildList()
lvItem.mask = LVIF_TEXT | LVIF_PARAM;
lvItem.iSubItem = 0;
lvItem.lParam = lvItem.iItem;
- lvItem.pszText = (TCHAR*)C.mask.c_str();
+ lvItem.pszText = (wchar_t*)C.mask.c_str();
lvItem.iItem = m_list.InsertItem(&lvItem);
lvItem.mask = LVIF_TEXT;
lvItem.iSubItem = 1;
- lvItem.pszText = (TCHAR*)C.flags.c_str();
+ lvItem.pszText = (wchar_t*)C.flags.c_str();
m_list.SetItem(&lvItem);
lvItem.mask = LVIF_TEXT;
lvItem.iSubItem = 2;
- lvItem.pszText = (TCHAR*)C.network.c_str();
+ lvItem.pszText = (wchar_t*)C.network.c_str();
m_list.SetItem(&lvItem);
}
@@ -1636,23 +1636,23 @@ void CIgnorePrefsDlg::UpdateList()
int CIrcProto::OnInitOptionsPages(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.ptszTitle = m_tszUserName;
- odp.ptszGroup = LPGENT("Network");
+ odp.pwszTitle = m_tszUserName;
+ odp.pwszGroup = LPGENW("Network");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.ptszTab = LPGENT("Account");
+ odp.pwszTab = LPGENW("Account");
odp.pDialog = new CConnectPrefsDlg(this);
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("DCC and CTCP");
+ odp.pwszTab = LPGENW("DCC and CTCP");
odp.pDialog = new CCtcpPrefsDlg(this);
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Advanced");
+ odp.pwszTab = LPGENW("Advanced");
odp.pDialog = new COtherPrefsDlg(this);
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Ignore");
+ odp.pwszTab = LPGENW("Ignore");
odp.pDialog = new CIgnorePrefsDlg(this);
Options_AddPage(wParam, &odp);
return 0;
@@ -1782,7 +1782,7 @@ struct CDlgAccMgrUI : public CProtoDlgBase<CIrcProto>
m_nick.GetText(m_proto->m_nick, _countof(m_proto->m_nick));
removeSpaces(m_proto->m_nick);
- _tcsncpy_s(m_proto->m_pNick, m_proto->m_nick, _TRUNCATE);
+ wcsncpy_s(m_proto->m_pNick, m_proto->m_nick, _TRUNCATE);
m_nick2.GetText(m_proto->m_alternativeNick, _countof(m_proto->m_alternativeNick));
removeSpaces(m_proto->m_alternativeNick);
m_userID.GetText(m_proto->m_userID, _countof(m_proto->m_userID));
@@ -1819,9 +1819,9 @@ INT_PTR CIrcProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
// Initialize servers list
-static void sttImportIni(const TCHAR* szIniFile)
+static void sttImportIni(const wchar_t* szIniFile)
{
- FILE* serverFile = _tfopen(szIniFile, L"r");
+ FILE* serverFile = _wfopen(szIniFile, L"r");
if (serverFile == NULL)
return;
@@ -1842,20 +1842,20 @@ static void sttImportIni(const TCHAR* szIniFile)
db_set_s(NULL, SERVERSMODULE, buf2, p1);
}
fclose(serverFile);
- ::_tremove(szIniFile);
+ ::_wremove(szIniFile);
}
void InitServers()
{
- TCHAR *szTemp = Utils_ReplaceVarsT(L"%miranda_path%\\Plugins\\IRC_servers.ini");
+ wchar_t *szTemp = Utils_ReplaceVarsT(L"%miranda_path%\\Plugins\\IRC_servers.ini");
sttImportIni(szTemp);
mir_free(szTemp);
RereadServers();
if (g_servers.getCount() == 0) {
- TCHAR *szIniFile = Utils_ReplaceVarsT(L"%temp%\\default_servers.ini");
- FILE *serverFile = _tfopen(szIniFile, L"a");
+ wchar_t *szIniFile = Utils_ReplaceVarsT(L"%temp%\\default_servers.ini");
+ FILE *serverFile = _wfopen(szIniFile, L"a");
if (serverFile) {
char* pszSvrs = (char*)LockResource(LoadResource(hInst, FindResource(hInst, MAKEINTRESOURCE(IDR_SERVERS), L"TEXT")));
if (pszSvrs)
diff --git a/protocols/IRCG/src/output.cpp b/protocols/IRCG/src/output.cpp
index 8ff9d2a7b8..711b164e22 100644
--- a/protocols/IRCG/src/output.cpp
+++ b/protocols/IRCG/src/output.cpp
@@ -27,7 +27,7 @@ static CMString FormatOutput(const CIrcMessage* pmsg)
if (pmsg->m_bIncoming) { // Is it an incoming message?
if (pmsg->sCommand == L"WALLOPS" && pmsg->parameters.getCount() > 0) {
- TCHAR temp[200]; *temp = '\0';
+ wchar_t temp[200]; *temp = '\0';
mir_sntprintf(temp, TranslateT("WallOps from %s: "), pmsg->prefix.sNick.c_str());
sMessage = temp;
for (int i = 0; i < (int)pmsg->parameters.getCount(); i++) {
@@ -39,7 +39,7 @@ static CMString FormatOutput(const CIrcMessage* pmsg)
}
if (pmsg->sCommand == L"INVITE" && pmsg->parameters.getCount() > 1) {
- TCHAR temp[256]; *temp = '\0';
+ wchar_t temp[256]; *temp = '\0';
mir_sntprintf(temp, TranslateT("%s invites you to %s"), pmsg->prefix.sNick.c_str(), pmsg->parameters[1].c_str());
sMessage = temp;
for (int i = 2; i < (int)pmsg->parameters.getCount(); i++) {
@@ -50,9 +50,9 @@ static CMString FormatOutput(const CIrcMessage* pmsg)
goto THE_END;
}
- int index = _ttoi(pmsg->sCommand.c_str());
+ int index = _wtoi(pmsg->sCommand.c_str());
if (index == 301 && pmsg->parameters.getCount() > 0) {
- TCHAR temp[500]; *temp = '\0';
+ wchar_t temp[500]; *temp = '\0';
mir_sntprintf(temp, TranslateT("%s is away"), pmsg->parameters[1].c_str());
sMessage = temp;
for (int i = 2; i < (int)pmsg->parameters.getCount(); i++) {
@@ -80,7 +80,7 @@ static CMString FormatOutput(const CIrcMessage* pmsg)
return pmsg->parameters[2] + L": " + pmsg->parameters[1];
}
else if (pmsg->sCommand == L"NOTICE" && pmsg->parameters.getCount() > 1) {
- TCHAR temp[500]; *temp = '\0';
+ wchar_t temp[500]; *temp = '\0';
int l = pmsg->parameters[1].GetLength();
if (l > 3 && pmsg->parameters[1][0] == 1 && pmsg->parameters[1][l - 1] == 1) {
@@ -136,13 +136,13 @@ BOOL CIrcProto::ShowMessage(const CIrcMessage* pmsg)
if (!pmsg->m_bIncoming)
mess.Replace(L"%%", L"%");
- int iTemp = _ttoi(pmsg->sCommand.c_str());
+ int iTemp = _wtoi(pmsg->sCommand.c_str());
//To active window
if ((iTemp > 400 || iTemp < 500) && pmsg->sCommand[0] == '4' //all error messages
|| pmsg->sCommand == L"303" //ISON command
|| pmsg->sCommand == L"INVITE"
- || ((pmsg->sCommand == L"NOTICE") && ((pmsg->parameters.getCount() > 2) ? (_tcsstr(pmsg->parameters[1].c_str(), L"\001") == NULL) : false)) // CTCP answers should go to m_network Log window!
+ || ((pmsg->sCommand == L"NOTICE") && ((pmsg->parameters.getCount() > 2) ? (wcsstr(pmsg->parameters[1].c_str(), L"\001") == NULL) : false)) // CTCP answers should go to m_network Log window!
|| pmsg->sCommand == L"515") //chanserv error
{
DoEvent(GC_EVENT_INFORMATION, NULL, pmsg->m_bIncoming ? pmsg->prefix.sNick.c_str() : m_info.sNick.c_str(), mess.c_str(), NULL, NULL, NULL, true, pmsg->m_bIncoming ? false : true);
diff --git a/protocols/IRCG/src/scripting.cpp b/protocols/IRCG/src/scripting.cpp
index ef968fb631..1620b46e24 100644
--- a/protocols/IRCG/src/scripting.cpp
+++ b/protocols/IRCG/src/scripting.cpp
@@ -26,7 +26,7 @@ INT_PTR __cdecl CIrcProto::Scripting_InsertRawIn(WPARAM, LPARAM lParam)
char* pszRaw = (char*)lParam;
if (m_scriptingEnabled && pszRaw && IsConnected()) {
- TCHAR* p = mir_a2t(pszRaw);
+ wchar_t* p = mir_a2t(pszRaw);
InsertIncomingEvent(p);
mir_free(p);
return 0;
@@ -83,17 +83,17 @@ INT_PTR __cdecl CIrcProto::Scripting_InsertGuiOut(WPARAM, LPARAM lParam)
gchook->dwData = gch->dwData;
gchook->pDest->iType = gch->pDest->iType;
if (gch->ptszText)
- gchook->ptszText = _tcsdup(gch->ptszText);
+ gchook->ptszText = wcsdup(gch->ptszText);
else gchook->ptszText = NULL;
if (gch->ptszUID)
- gchook->ptszUID = _tcsdup(gch->ptszUID);
+ gchook->ptszUID = wcsdup(gch->ptszUID);
else
gchook->ptszUID = NULL;
if (gch->pDest->ptszID) {
CMString S = MakeWndID(gch->pDest->ptszID);
- gchook->pDest->ptszID = _tcsdup(S.c_str());
+ gchook->pDest->ptszID = wcsdup(S.c_str());
}
else gchook->pDest->ptszID = NULL;
@@ -117,7 +117,7 @@ INT_PTR __cdecl CIrcProto::Scripting_GetIrcData(WPARAM, LPARAM lparam)
int i = sString.Find("|");
if (i != -1) {
sRequest = sString.Mid(0, i);
- TCHAR* p = mir_a2t(sString.Mid(i + 1));
+ wchar_t* p = mir_a2t(sString.Mid(i + 1));
sChannel = p;
mir_free(p);
}
@@ -148,7 +148,7 @@ INT_PTR __cdecl CIrcProto::Scripting_GetIrcData(WPARAM, LPARAM lparam)
gci.pszModule = m_szModuleName;
gci.pszID = S.c_str();
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci)) {
- TCHAR szTemp[40];
+ wchar_t szTemp[40];
mir_sntprintf(szTemp, L"%u", gci.iCount);
sOutput = szTemp;
}
@@ -186,7 +186,7 @@ INT_PTR __cdecl CIrcProto::Scripting_GetIrcData(WPARAM, LPARAM lparam)
}
if (!S.IsEmpty())
- sOutput = (TCHAR*)S.c_str();
+ sOutput = (wchar_t*)S.c_str();
}
// send it to mbot
if (!sOutput.IsEmpty())
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp
index 559e3bf29d..2f7e814455 100644
--- a/protocols/IRCG/src/services.cpp
+++ b/protocols/IRCG/src/services.cpp
@@ -181,7 +181,7 @@ INT_PTR __cdecl CIrcProto::OnDoubleclicked(WPARAM, LPARAM lParam)
CMessageBoxDlg* dlg = new CMessageBoxDlg(this, pdci);
dlg->Show();
HWND hWnd = dlg->GetHwnd();
- TCHAR szTemp[500];
+ wchar_t szTemp[500];
mir_sntprintf(szTemp, TranslateT("%s (%s) is requesting a client-to-client chat connection."),
pdci->sContactName.c_str(), pdci->sHostmask.c_str());
SetDlgItemText(hWnd, IDC_TEXT, szTemp);
@@ -389,12 +389,12 @@ INT_PTR __cdecl CIrcProto::OnChangeNickMenuCommand(WPARAM, LPARAM)
return 0;
}
-static void DoChatFormatting(TCHAR* pszText)
+static void DoChatFormatting(wchar_t* pszText)
{
- TCHAR* p1 = pszText;
+ wchar_t* p1 = pszText;
int iFG = -1;
int iRemoveChars;
- TCHAR InsertThis[50];
+ wchar_t InsertThis[50];
while (*p1 != '\0') {
iRemoveChars = 0;
@@ -422,9 +422,9 @@ static void DoChatFormatting(TCHAR* pszText)
mir_tstrcpy(InsertThis, L"\003");
iRemoveChars = 2;
- TCHAR szTemp[3];
+ wchar_t szTemp[3];
mir_tstrncpy(szTemp, p1 + 2, 3);
- iFG = _ttoi(szTemp);
+ iFG = _wtoi(szTemp);
}
break;
case 'C':
@@ -467,8 +467,8 @@ static void DoChatFormatting(TCHAR* pszText)
break;
}
- memmove(p1 + mir_tstrlen(InsertThis), p1 + iRemoveChars, sizeof(TCHAR)*(mir_tstrlen(p1) - iRemoveChars + 1));
- memcpy(p1, InsertThis, sizeof(TCHAR)*mir_tstrlen(InsertThis));
+ memmove(p1 + mir_tstrlen(InsertThis), p1 + iRemoveChars, sizeof(wchar_t)*(mir_tstrlen(p1) - iRemoveChars + 1));
+ memcpy(p1, InsertThis, sizeof(wchar_t)*mir_tstrlen(InsertThis));
if (iRemoveChars || mir_tstrlen(InsertThis))
p1 += mir_tstrlen(InsertThis);
else
@@ -488,8 +488,8 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam)
// handle the hook
if (gch) {
if (!mir_strcmpi(gch->pDest->pszModule, m_szModuleName)) {
- TCHAR *p1 = mir_tstrdup(gch->pDest->ptszID);
- TCHAR *p2 = _tcsstr(p1, L" - ");
+ wchar_t *p1 = mir_tstrdup(gch->pDest->ptszID);
+ wchar_t *p2 = wcsstr(p1, L" - ");
if (p2)
*p2 = '\0';
@@ -500,7 +500,7 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam)
case GC_USER_MESSAGE:
if (gch && gch->ptszText && *gch->ptszText) {
- TCHAR* pszText = new TCHAR[mir_tstrlen(gch->ptszText) + 1000];
+ wchar_t* pszText = new wchar_t[mir_tstrlen(gch->ptszText) + 1000];
mir_tstrcpy(pszText, gch->ptszText);
DoChatFormatting(pszText);
PostIrcMessageWnd(p1, NULL, pszText);
@@ -514,7 +514,7 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam)
case GC_USER_PRIVMESS:
{
- TCHAR szTemp[4000];
+ wchar_t szTemp[4000];
mir_sntprintf(szTemp, L"/QUERY %s", gch->ptszUID);
PostIrcMessageWnd(p1, NULL, szTemp);
}
@@ -566,7 +566,7 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam)
SetDlgItemText(question_hWnd, IDC_HIDDENEDIT, L"/nickserv IDENTIFY %question=\"%s\",\"%s\"");
SetWindowLongPtr(GetDlgItem(question_hWnd, IDC_EDIT), GWL_STYLE,
(LONG)GetWindowLongPtr(GetDlgItem(question_hWnd, IDC_EDIT), GWL_STYLE) | ES_PASSWORD);
- SendMessage(hEditCtrl, EM_SETPASSWORDCHAR, (WPARAM)_T('*'), 0);
+ SendMessage(hEditCtrl, EM_SETPASSWORDCHAR, (WPARAM)'*', 0);
SetFocus(hEditCtrl);
dlg->Activate();
}
@@ -727,8 +727,8 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam)
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
psr.flags = PSR_TCHAR;
- psr.id.t = gch->ptszUID;
- psr.nick.t = gch->ptszUID;
+ psr.id.w = gch->ptszUID;
+ psr.nick.w = gch->ptszUID;
ADDCONTACTSTRUCT acs = { 0 };
acs.handleType = HANDLE_SEARCHRESULT;
@@ -759,74 +759,74 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
static gc_item logItems[] = {
- { LPGENT("&Change your nickname"), 1, MENU_ITEM, FALSE },
- { LPGENT("Channel &settings"), 2, MENU_ITEM, FALSE },
+ { LPGENW("&Change your nickname"), 1, MENU_ITEM, FALSE },
+ { LPGENW("Channel &settings"), 2, MENU_ITEM, FALSE },
{ L"", 0, MENU_SEPARATOR, FALSE },
- { LPGENT("NickServ"), 0, MENU_NEWPOPUP, FALSE },
- { LPGENT("Register nick"), 5, MENU_POPUPITEM, TRUE },
- { LPGENT("Auth nick"), 6, MENU_POPUPITEM, FALSE },
- { LPGENT("Delete nick"), 7, MENU_POPUPITEM, FALSE },
- { LPGENT("Identify nick"), 8, MENU_POPUPITEM, FALSE },
- { LPGENT("Remind password"), 9, MENU_POPUPITEM, FALSE },
- { LPGENT("Set new password"), 10, MENU_POPUPITEM, TRUE },
- { LPGENT("Set language"), 11, MENU_POPUPITEM, FALSE },
- { LPGENT("Set homepage"), 12, MENU_POPUPITEM, FALSE },
- { LPGENT("Set e-mail"), 13, MENU_POPUPITEM, FALSE },
- { LPGENT("Set info"), 14, MENU_POPUPITEM, FALSE },
+ { LPGENW("NickServ"), 0, MENU_NEWPOPUP, FALSE },
+ { LPGENW("Register nick"), 5, MENU_POPUPITEM, TRUE },
+ { LPGENW("Auth nick"), 6, MENU_POPUPITEM, FALSE },
+ { LPGENW("Delete nick"), 7, MENU_POPUPITEM, FALSE },
+ { LPGENW("Identify nick"), 8, MENU_POPUPITEM, FALSE },
+ { LPGENW("Remind password"), 9, MENU_POPUPITEM, FALSE },
+ { LPGENW("Set new password"), 10, MENU_POPUPITEM, TRUE },
+ { LPGENW("Set language"), 11, MENU_POPUPITEM, FALSE },
+ { LPGENW("Set homepage"), 12, MENU_POPUPITEM, FALSE },
+ { LPGENW("Set e-mail"), 13, MENU_POPUPITEM, FALSE },
+ { LPGENW("Set info"), 14, MENU_POPUPITEM, FALSE },
{ L"", 0, MENU_POPUPSEPARATOR, FALSE },
- { LPGENT("Hide e-mail from info"), 20, MENU_POPUPITEM, FALSE },
- { LPGENT("Show e-mail in info"), 21, MENU_POPUPITEM, FALSE },
+ { LPGENW("Hide e-mail from info"), 20, MENU_POPUPITEM, FALSE },
+ { LPGENW("Show e-mail in info"), 21, MENU_POPUPITEM, FALSE },
{ L"", 0, MENU_POPUPSEPARATOR, FALSE },
- { LPGENT("Set security for nick"), 22, MENU_POPUPITEM, FALSE },
- { LPGENT("Remove security for nick"), 23, MENU_POPUPITEM, FALSE },
+ { LPGENW("Set security for nick"), 22, MENU_POPUPITEM, FALSE },
+ { LPGENW("Remove security for nick"), 23, MENU_POPUPITEM, FALSE },
{ L"", 0, MENU_POPUPSEPARATOR, FALSE },
- { LPGENT("Link nick to current"), 24, MENU_POPUPITEM, FALSE },
- { LPGENT("Unlink nick from current"), 25, MENU_POPUPITEM, FALSE },
- { LPGENT("Set main nick"), 26, MENU_POPUPITEM, FALSE },
- { LPGENT("List all your nicks"), 27, MENU_POPUPITEM, FALSE },
- { LPGENT("List your channels"), 28, MENU_POPUPITEM, FALSE },
+ { LPGENW("Link nick to current"), 24, MENU_POPUPITEM, FALSE },
+ { LPGENW("Unlink nick from current"), 25, MENU_POPUPITEM, FALSE },
+ { LPGENW("Set main nick"), 26, MENU_POPUPITEM, FALSE },
+ { LPGENW("List all your nicks"), 27, MENU_POPUPITEM, FALSE },
+ { LPGENW("List your channels"), 28, MENU_POPUPITEM, FALSE },
{ L"", 0, MENU_POPUPSEPARATOR, FALSE },
- { LPGENT("Kill unauthorized: off"), 15, MENU_POPUPITEM, FALSE },
- { LPGENT("Kill unauthorized: on"), 16, MENU_POPUPITEM, FALSE },
- { LPGENT("Kill unauthorized: quick"), 17, MENU_POPUPITEM, FALSE },
+ { LPGENW("Kill unauthorized: off"), 15, MENU_POPUPITEM, FALSE },
+ { LPGENW("Kill unauthorized: on"), 16, MENU_POPUPITEM, FALSE },
+ { LPGENW("Kill unauthorized: quick"), 17, MENU_POPUPITEM, FALSE },
{ L"", 0, MENU_POPUPSEPARATOR, FALSE },
- { LPGENT("Hide nick from list"), 18, MENU_POPUPITEM, FALSE },
- { LPGENT("Show nick to list"), 19, MENU_POPUPITEM, FALSE },
- { LPGENT("Show the server &window"), 4, MENU_ITEM, FALSE },
+ { LPGENW("Hide nick from list"), 18, MENU_POPUPITEM, FALSE },
+ { LPGENW("Show nick to list"), 19, MENU_POPUPITEM, FALSE },
+ { LPGENW("Show the server &window"), 4, MENU_ITEM, FALSE },
{ L"", 0, MENU_SEPARATOR, FALSE },
- { LPGENT("&Leave the channel"), 3, MENU_ITEM, FALSE }
+ { LPGENW("&Leave the channel"), 3, MENU_ITEM, FALSE }
};
static gc_item nickItems[] = {
- { LPGENT("&WhoIs info"), 10, MENU_ITEM, FALSE }, //0
- { LPGENT("&Invite to channel"), 23, MENU_ITEM, FALSE },
- { LPGENT("Send &notice"), 22, MENU_ITEM, FALSE },
- { LPGENT("&Slap"), 31, MENU_ITEM, FALSE },
- { LPGENT("Nickserv info"), 32, MENU_ITEM, FALSE },
- { LPGENT("Nickserv kill ghost"), 33, MENU_ITEM, FALSE }, //5
- { LPGENT("&Control"), 0, MENU_NEWPOPUP, FALSE },
- { LPGENT("Give Owner"), 18, MENU_POPUPITEM, FALSE }, //7
- { LPGENT("Take Owner"), 19, MENU_POPUPITEM, FALSE },
- { LPGENT("Give Admin"), 20, MENU_POPUPITEM, FALSE },
- { LPGENT("Take Admin"), 21, MENU_POPUPITEM, FALSE }, //10
- { LPGENT("Give &Op"), 1, MENU_POPUPITEM, FALSE },
- { LPGENT("Take O&p"), 2, MENU_POPUPITEM, FALSE },
- { LPGENT("Give &Halfop"), 16, MENU_POPUPITEM, FALSE },
- { LPGENT("Take H&alfop"), 17, MENU_POPUPITEM, FALSE },
- { LPGENT("Give &Voice"), 3, MENU_POPUPITEM, FALSE }, //15
- { LPGENT("Take V&oice"), 4, MENU_POPUPITEM, FALSE },
+ { LPGENW("&WhoIs info"), 10, MENU_ITEM, FALSE }, //0
+ { LPGENW("&Invite to channel"), 23, MENU_ITEM, FALSE },
+ { LPGENW("Send &notice"), 22, MENU_ITEM, FALSE },
+ { LPGENW("&Slap"), 31, MENU_ITEM, FALSE },
+ { LPGENW("Nickserv info"), 32, MENU_ITEM, FALSE },
+ { LPGENW("Nickserv kill ghost"), 33, MENU_ITEM, FALSE }, //5
+ { LPGENW("&Control"), 0, MENU_NEWPOPUP, FALSE },
+ { LPGENW("Give Owner"), 18, MENU_POPUPITEM, FALSE }, //7
+ { LPGENW("Take Owner"), 19, MENU_POPUPITEM, FALSE },
+ { LPGENW("Give Admin"), 20, MENU_POPUPITEM, FALSE },
+ { LPGENW("Take Admin"), 21, MENU_POPUPITEM, FALSE }, //10
+ { LPGENW("Give &Op"), 1, MENU_POPUPITEM, FALSE },
+ { LPGENW("Take O&p"), 2, MENU_POPUPITEM, FALSE },
+ { LPGENW("Give &Halfop"), 16, MENU_POPUPITEM, FALSE },
+ { LPGENW("Take H&alfop"), 17, MENU_POPUPITEM, FALSE },
+ { LPGENW("Give &Voice"), 3, MENU_POPUPITEM, FALSE }, //15
+ { LPGENW("Take V&oice"), 4, MENU_POPUPITEM, FALSE },
{ L"", 0, MENU_POPUPSEPARATOR, FALSE },
- { LPGENT("&Kick"), 5, MENU_POPUPITEM, FALSE },
- { LPGENT("Ki&ck (reason)"), 6, MENU_POPUPITEM, FALSE },
- { LPGENT("&Ban"), 7, MENU_POPUPITEM, FALSE }, //20
- { LPGENT("Ban'&n kick"), 8, MENU_POPUPITEM, FALSE },
- { LPGENT("Ban'n kick (&reason)"), 9, MENU_POPUPITEM, FALSE },
- { LPGENT("&Direct Connection"), 0, MENU_NEWPOPUP, FALSE },
- { LPGENT("Request &Chat"), 13, MENU_POPUPITEM, FALSE },
- { LPGENT("Send &File"), 14, MENU_POPUPITEM, FALSE }, //25
- { LPGENT("Add to &ignore list"), 15, MENU_ITEM, FALSE },
+ { LPGENW("&Kick"), 5, MENU_POPUPITEM, FALSE },
+ { LPGENW("Ki&ck (reason)"), 6, MENU_POPUPITEM, FALSE },
+ { LPGENW("&Ban"), 7, MENU_POPUPITEM, FALSE }, //20
+ { LPGENW("Ban'&n kick"), 8, MENU_POPUPITEM, FALSE },
+ { LPGENW("Ban'n kick (&reason)"), 9, MENU_POPUPITEM, FALSE },
+ { LPGENW("&Direct Connection"), 0, MENU_NEWPOPUP, FALSE },
+ { LPGENW("Request &Chat"), 13, MENU_POPUPITEM, FALSE },
+ { LPGENW("Send &File"), 14, MENU_POPUPITEM, FALSE }, //25
+ { LPGENW("Add to &ignore list"), 15, MENU_ITEM, FALSE },
{ L"", 12, MENU_SEPARATOR, FALSE },
- { LPGENT("&Add User"), 30, MENU_ITEM, FALSE }
+ { LPGENW("&Add User"), 30, MENU_ITEM, FALSE }
};
int __cdecl CIrcProto::GCMenuHook(WPARAM, LPARAM lParam)
@@ -843,7 +843,7 @@ int __cdecl CIrcProto::GCMenuHook(WPARAM, LPARAM lParam)
}
if (gcmi->Type == MENU_ON_NICKLIST) {
- CONTACT user = { (TCHAR*)gcmi->pszUID, NULL, NULL, false, false, false };
+ CONTACT user = { (wchar_t*)gcmi->pszUID, NULL, NULL, false, false, false };
MCONTACT hContact = CList_FindContact(&user);
gcmi->nItems = _countof(nickItems);
@@ -858,8 +858,8 @@ int __cdecl CIrcProto::GCMenuHook(WPARAM, LPARAM lParam)
ulAdr = ConvertIPToInteger(m_IPFromServer ? m_myHost : m_myLocalHost);
gcmi->Item[23].bDisabled = ulAdr == 0 ? TRUE : FALSE; //DCC submenu
- TCHAR stzChanName[100];
- const TCHAR* temp = _tcschr(gcmi->pszID, ' ');
+ wchar_t stzChanName[100];
+ const wchar_t* temp = wcschr(gcmi->pszID, ' ');
size_t len = min(((temp == NULL) ? mir_tstrlen(gcmi->pszID) : (int)(temp - gcmi->pszID + 1)), _countof(stzChanName) - 1);
mir_tstrncpy(stzChanName, gcmi->pszID, len);
stzChanName[len] = 0;
@@ -1036,7 +1036,7 @@ void CIrcProto::ConnectToServer(void)
si.sFullName = m_name;
si.sPassword = m_password;
si.bIdentServer = ((m_ident) ? (true) : (false));
- si.iIdentServerPort = _ttoi(m_identPort);
+ si.iIdentServerPort = _wtoi(m_identPort);
si.sIdentServerType = m_identSystem;
si.m_iSSL = m_iSSL;
si.sNetwork = m_network;
@@ -1055,7 +1055,7 @@ void CIrcProto::ConnectToServer(void)
else if (m_bConnectRequested < 1)
InterlockedIncrement((long *)&m_bConnectRequested);
- TCHAR szTemp[300];
+ wchar_t szTemp[300];
mir_sntprintf(szTemp, L"\033%s \002%s\002 (%S: %u)",
TranslateT("Connecting to"), si.sNetwork.c_str(), si.sServer.c_str(), si.iPort);
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false);
@@ -1080,7 +1080,7 @@ INT_PTR __cdecl CIrcProto::GetMyAwayMsg(WPARAM wParam, LPARAM lParam)
if ((int)wParam != m_iStatus)
return 0;
- const TCHAR* p = m_statusMessage.c_str();
+ const wchar_t* p = m_statusMessage.c_str();
return (lParam & SGMA_UNICODE) ? (INT_PTR)mir_t2u(p) : (INT_PTR)mir_t2a(p);
}
diff --git a/protocols/IRCG/src/stdafx.h b/protocols/IRCG/src/stdafx.h
index 2fa3ab877b..460b5a54f2 100644
--- a/protocols/IRCG/src/stdafx.h
+++ b/protocols/IRCG/src/stdafx.h
@@ -120,10 +120,10 @@ struct IPRESOLVE // Contains info about the channels
struct CHANNELINFO // Contains info about the channels
{
- TCHAR* pszTopic;
- TCHAR* pszMode;
- TCHAR* pszPassword;
- TCHAR* pszLimit;
+ wchar_t* pszTopic;
+ wchar_t* pszMode;
+ wchar_t* pszPassword;
+ wchar_t* pszLimit;
BYTE OwnMode; /* own mode on the channel. Bitmask:
0: voice
1: halfop
@@ -143,7 +143,7 @@ struct SERVER_INFO // Contains info about different servers
struct PERFORM_INFO // Contains 'm_perform buffer' for different networks
{
- PERFORM_INFO( const char* szSetting, const TCHAR* value ) :
+ PERFORM_INFO( const char* szSetting, const wchar_t* value ) :
mSetting( szSetting ),
mText( value )
{}
@@ -157,9 +157,9 @@ struct PERFORM_INFO // Contains 'm_perform buffer' for different networks
struct CONTACT // Contains info about users
{
- TCHAR* name;
- TCHAR* user;
- TCHAR* host;
+ wchar_t* name;
+ wchar_t* user;
+ wchar_t* host;
bool ExactOnly;
bool ExactWCOnly;
bool ExactNick;
@@ -174,7 +174,7 @@ struct TDbSetting
union
{
int defValue;
- TCHAR* defStr;
+ wchar_t* defStr;
};
};
@@ -189,18 +189,18 @@ typedef bool (CIrcProto::*PfnIrcMessageHandler)(const CIrcMessage* pmsg);
struct CIrcHandler
{
- CIrcHandler( const TCHAR* _name, PfnIrcMessageHandler _handler ) :
+ CIrcHandler( const wchar_t* _name, PfnIrcMessageHandler _handler ) :
m_name( _name ),
m_handler( _handler )
{}
- const TCHAR* m_name;
+ const wchar_t* m_name;
PfnIrcMessageHandler m_handler;
};
struct CIrcProto : public PROTO<CIrcProto>
{
- CIrcProto(const char*, const TCHAR*);
+ CIrcProto(const char*, const wchar_t*);
~CIrcProto();
// Protocol interface
@@ -208,24 +208,24 @@ struct CIrcProto : public PROTO<CIrcProto>
virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
virtual int __cdecl Authorize(MEVENT hDbEvent);
- virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR* szReason);
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t* szReason);
- virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath);
+ virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath);
virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer );
- virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason);
- virtual int __cdecl FileResume( HANDLE hTransfer, int *action, const TCHAR **szFilename);
+ virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szReason);
+ virtual int __cdecl FileResume( HANDLE hTransfer, int *action, const wchar_t **szFilename);
virtual DWORD_PTR __cdecl GetCaps( int type, MCONTACT hContact = NULL);
- virtual HANDLE __cdecl SearchBasic(const TCHAR* id);
+ virtual HANDLE __cdecl SearchBasic(const wchar_t* id);
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles);
+ virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles);
virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg);
virtual int __cdecl SetStatus(int iNewStatus);
virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
- virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg);
+ virtual int __cdecl SetAwayMsg(int m_iStatus, const wchar_t *msg);
virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
@@ -262,24 +262,24 @@ struct CIrcProto : public PROTO<CIrcProto>
char m_serverName[100];
char m_password [500];
- TCHAR m_identSystem[10];
+ wchar_t m_identSystem[10];
char m_network[30];
char m_portStart[10];
char m_portEnd[10];
int m_iSSL;
- TCHAR m_identPort[10];
- TCHAR m_nick[30], m_pNick[30];
- TCHAR m_alternativeNick[30];
- TCHAR m_name[200];
- TCHAR m_userID[200];
- TCHAR m_quitMessage[400];
- TCHAR m_userInfo[500];
+ wchar_t m_identPort[10];
+ wchar_t m_nick[30], m_pNick[30];
+ wchar_t m_alternativeNick[30];
+ wchar_t m_name[200];
+ wchar_t m_userID[200];
+ wchar_t m_quitMessage[400];
+ wchar_t m_userInfo[500];
char m_myHost[50];
char m_mySpecifiedHost[500];
char m_mySpecifiedHostIP[50];
char m_myLocalHost[50];
WORD m_myLocalPort;
- TCHAR* m_alias;
+ wchar_t* m_alias;
int m_serverComboSelection;
int m_quickComboSelection;
int m_onlineNotificationTime;
@@ -368,27 +368,27 @@ struct CIrcProto : public PROTO<CIrcProto>
//commandmonitor.cpp
UINT_PTR IdentTimer, InitTimer, KeepAliveTimer, OnlineNotifTimer, OnlineNotifTimer3;
- int AddOutgoingMessageToDB(MCONTACT hContact, TCHAR *msg);
+ int AddOutgoingMessageToDB(MCONTACT hContact, wchar_t *msg);
bool DoOnConnect(const CIrcMessage *pmsg);
int DoPerform(const char *event);
void __cdecl ResolveIPThread(void *di);
- bool AddIgnore(const TCHAR *mask, const TCHAR *mode, const TCHAR *network) ;
+ bool AddIgnore(const wchar_t *mask, const wchar_t *mode, const wchar_t *network) ;
int IsIgnored(const CMString &nick, const CMString &address, const CMString &host, char type) ;
int IsIgnored(CMString user, char type);
- bool RemoveIgnore(const TCHAR *mask) ;
+ bool RemoveIgnore(const wchar_t *mask) ;
//input.cpp
- CMString DoAlias( const TCHAR *text, TCHAR *window);
- BOOL DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hContact);
- CMString DoIdentifiers(CMString text, const TCHAR *window);
+ CMString DoAlias( const wchar_t *text, wchar_t *window);
+ BOOL DoHardcodedCommand(CMString text, wchar_t *window, MCONTACT hContact);
+ CMString DoIdentifiers(CMString text, const wchar_t *window);
void FormatMsg(CMString &text);
- bool PostIrcMessageWnd(TCHAR *pszWindow, MCONTACT hContact, const TCHAR *szBuf);
- bool PostIrcMessage(const TCHAR *fmt, ...);
+ bool PostIrcMessageWnd(wchar_t *pszWindow, MCONTACT hContact, const wchar_t *szBuf);
+ bool PostIrcMessage(const wchar_t *fmt, ...);
// irclib.cpp
UINT_PTR DCCTimer;
- void SendIrcMessage(const TCHAR*, bool bNotify = true, int codepage = -1);
+ void SendIrcMessage(const wchar_t*, bool bNotify = true, int codepage = -1);
// ircproto.cpp
void __cdecl AckBasicSearch(void* param);
@@ -439,16 +439,16 @@ struct CIrcProto : public PROTO<CIrcProto>
void __cdecl DisconnectServerThread( void* );
//tools.cpp
- void AddToJTemp(TCHAR op, CMString& sCommand);
- bool AddWindowItemData(CMString window, const TCHAR* pszLimit, const TCHAR* pszMode, const TCHAR* pszPassword, const TCHAR* pszTopic);
+ void AddToJTemp(wchar_t op, CMString& sCommand);
+ bool AddWindowItemData(CMString window, const wchar_t* pszLimit, const wchar_t* pszMode, const wchar_t* pszPassword, const wchar_t* pszTopic);
INT_PTR CallChatEvent(WPARAM wParam, LPARAM lParam);
- INT_PTR DoEvent(int iEvent, const TCHAR* pszWindow, const TCHAR* pszNick, const TCHAR* pszText, const TCHAR* pszStatus, const TCHAR* pszUserInfo, DWORD_PTR dwItemData, bool bAddToLog, bool bIsMe,time_t timestamp = 1);
+ INT_PTR DoEvent(int iEvent, const wchar_t* pszWindow, const wchar_t* pszNick, const wchar_t* pszText, const wchar_t* pszStatus, const wchar_t* pszUserInfo, DWORD_PTR dwItemData, bool bAddToLog, bool bIsMe,time_t timestamp = 1);
void FindLocalIP(HANDLE con);
bool FreeWindowItemData(CMString window, CHANNELINFO* wis);
bool IsChannel(const char* sName);
- bool IsChannel(const TCHAR* sName);
+ bool IsChannel(const wchar_t* sName);
void KillChatTimer(UINT_PTR &nIDEvent);
- CMString MakeWndID(const TCHAR* sWindow);
+ CMString MakeWndID(const wchar_t* sWindow);
CMString ModeToStatus(int sMode);
CMString PrefixToStatus(int cPrefix);
int SetChannelSBText(CMString sWindow, CHANNELINFO * wi);
@@ -473,7 +473,7 @@ struct CIrcProto : public PROTO<CIrcProto>
CDccSession* FindDCCSession(MCONTACT hContact);
CDccSession* FindDCCSession(DCCINFO* pdci);
CDccSession* FindDCCSendByPort(int iPort);
- CDccSession* FindDCCRecvByPortAndName(int iPort, const TCHAR* szName);
+ CDccSession* FindDCCRecvByPortAndName(int iPort, const wchar_t* szName);
CDccSession* FindPassiveDCCSend(int iToken);
CDccSession* FindPassiveDCCRecv(CMString sName, CMString sToken);
@@ -484,12 +484,12 @@ struct CIrcProto : public PROTO<CIrcProto>
void Disconnect(void);
void KillIdent(void);
- int NLSend(const TCHAR* fmt, ...);
+ int NLSend(const wchar_t* fmt, ...);
int NLSend(const char* fmt, ...);
int NLSend(const unsigned char* buf, int cbBuf);
int NLSendNoScript( const unsigned char* buf, int cbBuf);
int NLReceive(unsigned char* buf, int cbBuf);
- void InsertIncomingEvent(TCHAR* pszRaw);
+ void InsertIncomingEvent(wchar_t* pszRaw);
__inline bool IsConnected() const { return con != NULL; }
@@ -572,7 +572,7 @@ private :
static OBJLIST<CIrcHandler> m_handlers;
- PfnIrcMessageHandler FindMethod(const TCHAR* lpszName);
+ PfnIrcMessageHandler FindMethod(const wchar_t* lpszName);
void OnIrcMessage(const CIrcMessage* pmsg);
CMString sNick4Perform;
@@ -581,7 +581,7 @@ private :
// map actual member functions to their associated IRC command.
// put any number of this macro in the class's constructor.
#define IRC_MAP_ENTRY(name, member) \
- m_handlers.insert( new CIrcHandler( _T(name), &CIrcProto::OnIrc_##member ));
+ m_handlers.insert( new CIrcHandler( L##name, &CIrcProto::OnIrc_##member ));
/////////////////////////////////////////////////////////////////////////////////////////
// Functions
@@ -617,13 +617,13 @@ HICON LoadIconEx(int iIndex, bool big = false);
HANDLE GetIconHandle(int iconId);
//tools.cpp
-int __stdcall WCCmp(const TCHAR* wild, const TCHAR* string);
-char* __stdcall IrcLoadFile(TCHAR * szPath);
-CMString __stdcall GetWord(const TCHAR* text, int index);
-const TCHAR* __stdcall GetWordAddress(const TCHAR* text, int index);
+int __stdcall WCCmp(const wchar_t* wild, const wchar_t* string);
+char* __stdcall IrcLoadFile(wchar_t * szPath);
+CMString __stdcall GetWord(const wchar_t* text, int index);
+const wchar_t* __stdcall GetWordAddress(const wchar_t* text, int index);
void __stdcall RemoveLinebreaks( CMString& Message );
-TCHAR* __stdcall my_strstri(const TCHAR *s1, const TCHAR *s2) ;
-TCHAR* __stdcall DoColorCodes (const TCHAR* text, bool bStrip, bool bReplacePercent);
+wchar_t* __stdcall my_strstri(const wchar_t *s1, const wchar_t *s2) ;
+wchar_t* __stdcall DoColorCodes (const wchar_t* text, bool bStrip, bool bReplacePercent);
CMStringA __stdcall GetWord(const char* text, int index);
diff --git a/protocols/IRCG/src/tools.cpp b/protocols/IRCG/src/tools.cpp
index cfae12a301..6a2af3446e 100644
--- a/protocols/IRCG/src/tools.cpp
+++ b/protocols/IRCG/src/tools.cpp
@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/////////////////////////////////////////////////////////////////////////////////////////
-void CIrcProto::AddToJTemp(TCHAR op, CMString& sCommand)
+void CIrcProto::AddToJTemp(wchar_t op, CMString& sCommand)
{
CMString res;
@@ -49,20 +49,20 @@ void CIrcProto::AddToJTemp(TCHAR op, CMString& sCommand)
setTString("JTemp", res.c_str());
}
-CMString __stdcall GetWord(const TCHAR* text, int index)
+CMString __stdcall GetWord(const wchar_t* text, int index)
{
if (text && *text) {
- TCHAR* p1 = (TCHAR*)text;
- TCHAR* p2 = NULL;
+ wchar_t* p1 = (wchar_t*)text;
+ wchar_t* p2 = NULL;
while (*p1 == ' ')
p1++;
if (*p1 != '\0') {
for (int i = 0; i < index; i++) {
- p2 = _tcschr(p1, ' ');
+ p2 = wcschr(p1, ' ');
if (!p2)
- p2 = _tcschr(p1, '\0');
+ p2 = wcschr(p1, '\0');
else
while (*p2 == ' ')
p2++;
@@ -70,9 +70,9 @@ CMString __stdcall GetWord(const TCHAR* text, int index)
p1 = p2;
}
- p2 = _tcschr(p1, ' ');
+ p2 = wcschr(p1, ' ');
if (!p2)
- p2 = _tcschr(p1, '\0');
+ p2 = wcschr(p1, '\0');
if (p1 != p2)
return CMString(p1, p2 - p1);
@@ -82,12 +82,12 @@ CMString __stdcall GetWord(const TCHAR* text, int index)
return CMString();
}
-const TCHAR* __stdcall GetWordAddress(const TCHAR* text, int index)
+const wchar_t* __stdcall GetWordAddress(const wchar_t* text, int index)
{
if (!text || !mir_tstrlen(text))
return text;
- const TCHAR* temp = text;
+ const wchar_t* temp = text;
while (*temp == ' ')
temp++;
@@ -96,9 +96,9 @@ const TCHAR* __stdcall GetWordAddress(const TCHAR* text, int index)
return temp;
for (int i = 0; i < index; i++) {
- temp = _tcschr(temp, ' ');
+ temp = wcschr(temp, ' ');
if (!temp)
- temp = (TCHAR*)_tcschr(text, '\0');
+ temp = (wchar_t*)wcschr(text, '\0');
else
while (*temp == ' ')
temp++;
@@ -120,11 +120,11 @@ void __stdcall RemoveLinebreaks(CMString &Message)
Message.Delete(Message.GetLength() - 2, 2);
}
-char* __stdcall IrcLoadFile(TCHAR* szPath)
+char* __stdcall IrcLoadFile(wchar_t* szPath)
{
char * szContainer = NULL;
DWORD dwSiz = 0;
- FILE *hFile = _tfopen(szPath, L"rb");
+ FILE *hFile = _wfopen(szPath, L"rb");
if (hFile != NULL) {
fseek(hFile, 0, SEEK_END); // seek to end
dwSiz = ftell(hFile); // size
@@ -139,12 +139,12 @@ char* __stdcall IrcLoadFile(TCHAR* szPath)
return 0;
}
-int __stdcall WCCmp(const TCHAR* wild, const TCHAR* string)
+int __stdcall WCCmp(const wchar_t* wild, const wchar_t* string)
{
if (wild == NULL || !mir_tstrlen(wild) || string == NULL || !mir_tstrlen(string))
return 1;
- const TCHAR *cp = NULL, *mp = NULL;
+ const wchar_t *cp = NULL, *mp = NULL;
while ((*string) && (*wild != '*')) {
if ((*wild != *string) && (*wild != '?'))
return 0;
@@ -177,7 +177,7 @@ int __stdcall WCCmp(const TCHAR* wild, const TCHAR* string)
return !*wild;
}
-bool CIrcProto::IsChannel(const TCHAR* sName)
+bool CIrcProto::IsChannel(const wchar_t* sName)
{
return (sChannelPrefixes.Find(sName[0]) != -1);
}
@@ -220,21 +220,21 @@ bool CIrcProto::IsChannel(const char* sName)
return (sChannelPrefixes.Find(sName[0]) != -1);
}
-TCHAR* __stdcall my_strstri(const TCHAR* s1, const TCHAR* s2)
+wchar_t* __stdcall my_strstri(const wchar_t* s1, const wchar_t* s2)
{
int i, j, k;
for (i = 0; s1[i]; i++)
- for (j = i, k = 0; _totlower(s1[j]) == _totlower(s2[k]); j++, k++)
+ for (j = i, k = 0; towlower(s1[j]) == towlower(s2[k]); j++, k++)
if (!s2[k + 1])
- return (TCHAR*)(s1 + i);
+ return (wchar_t*)(s1 + i);
return NULL;
}
-TCHAR* __stdcall DoColorCodes(const TCHAR* text, bool bStrip, bool bReplacePercent)
+wchar_t* __stdcall DoColorCodes(const wchar_t* text, bool bStrip, bool bReplacePercent)
{
- static TCHAR szTemp[4000]; szTemp[0] = '\0';
- TCHAR* p = szTemp;
+ static wchar_t szTemp[4000]; szTemp[0] = '\0';
+ wchar_t* p = szTemp;
bool bBold = false;
bool bUnderline = false;
bool bItalics = false;
@@ -305,7 +305,7 @@ TCHAR* __stdcall DoColorCodes(const TCHAR* text, bool bStrip, bool bReplacePerce
break;
}
else { // some colors should be set... need to find out who
- TCHAR buf[3];
+ wchar_t buf[3];
// fix foreground index
if (text[1] > 47 && text[1] < 58 && text[1] != '\0')
@@ -313,7 +313,7 @@ TCHAR* __stdcall DoColorCodes(const TCHAR* text, bool bStrip, bool bReplacePerce
else
mir_tstrncpy(buf, text, 2);
text += mir_tstrlen(buf);
- iFG = _ttoi(buf);
+ iFG = _wtoi(buf);
// fix background color
if (*text == ',' && text[1] > 47 && text[1] < 58 && text[1] != '\0') {
@@ -324,7 +324,7 @@ TCHAR* __stdcall DoColorCodes(const TCHAR* text, bool bStrip, bool bReplacePerce
else
mir_tstrncpy(buf, text, 2);
text += mir_tstrlen(buf);
- iBG = _ttoi(buf);
+ iBG = _wtoi(buf);
}
}
@@ -337,7 +337,7 @@ TCHAR* __stdcall DoColorCodes(const TCHAR* text, bool bStrip, bool bReplacePerce
// create tag for chat.dll
if (!bStrip) {
- TCHAR buf[10];
+ wchar_t buf[10];
if (iFG >= 0 && iFG != 99) {
*p++ = '%';
*p++ = 'c';
@@ -381,8 +381,8 @@ INT_PTR CIrcProto::CallChatEvent(WPARAM wParam, LPARAM lParam)
return CallServiceSync(MS_GC_EVENT, wParam, (LPARAM)lParam);
}
-INT_PTR CIrcProto::DoEvent(int iEvent, const TCHAR* pszWindow, const TCHAR* pszNick,
- const TCHAR* pszText, const TCHAR* pszStatus, const TCHAR* pszUserInfo,
+INT_PTR CIrcProto::DoEvent(int iEvent, const wchar_t* pszWindow, const wchar_t* pszNick,
+ const wchar_t* pszText, const wchar_t* pszStatus, const wchar_t* pszUserInfo,
DWORD_PTR dwItemData, bool bAddToLog, bool bIsMe, time_t timestamp)
{
GCDEST gcd = { m_szModuleName, NULL, iEvent };
@@ -404,7 +404,7 @@ INT_PTR CIrcProto::DoEvent(int iEvent, const TCHAR* pszWindow, const TCHAR* pszN
sID = pszWindow + (CMString)L" - " + m_info.sNetwork;
else
sID = pszWindow;
- gcd.ptszID = (TCHAR*)sID.c_str();
+ gcd.ptszID = (wchar_t*)sID.c_str();
}
else gcd.ptszID = NULL;
@@ -454,7 +454,7 @@ CMString CIrcProto::ModeToStatus(int sMode)
CMString CIrcProto::PrefixToStatus(int cPrefix)
{
- const TCHAR* p = _tcschr(sUserModePrefixes.c_str(), cPrefix);
+ const wchar_t* p = wcschr(sUserModePrefixes.c_str(), cPrefix);
if (p) {
int index = int(p - sUserModePrefixes.c_str());
return ModeToStatus(sUserModes[index]);
@@ -545,9 +545,9 @@ int CIrcProto::SetChannelSBText(CMString sWindow, CHANNELINFO * wi)
return DoEvent(GC_EVENT_SETSBTEXT, sWindow.c_str(), NULL, sTemp.c_str(), NULL, NULL, NULL, FALSE, FALSE, 0);
}
-CMString CIrcProto::MakeWndID(const TCHAR* sWindow)
+CMString CIrcProto::MakeWndID(const wchar_t* sWindow)
{
- TCHAR buf[200];
+ wchar_t buf[200];
mir_sntprintf(buf, L"%s - %s", sWindow, (IsConnected()) ? m_info.sNetwork.c_str() : TranslateT("Offline"));
return CMString(buf);
}
@@ -570,24 +570,24 @@ bool CIrcProto::FreeWindowItemData(CMString window, CHANNELINFO* wis)
return false;
}
-bool CIrcProto::AddWindowItemData(CMString window, const TCHAR* pszLimit, const TCHAR* pszMode, const TCHAR* pszPassword, const TCHAR* pszTopic)
+bool CIrcProto::AddWindowItemData(CMString window, const wchar_t* pszLimit, const wchar_t* pszMode, const wchar_t* pszPassword, const wchar_t* pszTopic)
{
CHANNELINFO *wi = (CHANNELINFO *)DoEvent(GC_EVENT_GETITEMDATA, window.c_str(), NULL, NULL, NULL, NULL, NULL, FALSE, FALSE, 0);
if (wi) {
if (pszLimit) {
- wi->pszLimit = (TCHAR*)realloc(wi->pszLimit, sizeof(TCHAR)*(mir_tstrlen(pszLimit) + 1));
+ wi->pszLimit = (wchar_t*)realloc(wi->pszLimit, sizeof(wchar_t)*(mir_tstrlen(pszLimit) + 1));
mir_tstrcpy(wi->pszLimit, pszLimit);
}
if (pszMode) {
- wi->pszMode = (TCHAR*)realloc(wi->pszMode, sizeof(TCHAR)*(mir_tstrlen(pszMode) + 1));
+ wi->pszMode = (wchar_t*)realloc(wi->pszMode, sizeof(wchar_t)*(mir_tstrlen(pszMode) + 1));
mir_tstrcpy(wi->pszMode, pszMode);
}
if (pszPassword) {
- wi->pszPassword = (TCHAR*)realloc(wi->pszPassword, sizeof(TCHAR)*(mir_tstrlen(pszPassword) + 1));
+ wi->pszPassword = (wchar_t*)realloc(wi->pszPassword, sizeof(wchar_t)*(mir_tstrlen(pszPassword) + 1));
mir_tstrcpy(wi->pszPassword, pszPassword);
}
if (pszTopic) {
- wi->pszTopic = (TCHAR*)realloc(wi->pszTopic, sizeof(TCHAR)*(mir_tstrlen(pszTopic) + 1));
+ wi->pszTopic = (wchar_t*)realloc(wi->pszTopic, sizeof(wchar_t)*(mir_tstrlen(pszTopic) + 1));
mir_tstrcpy(wi->pszTopic, pszTopic);
}
@@ -612,7 +612,7 @@ void CIrcProto::FindLocalIP(HANDLE hConn) // inspiration from jabber
void CIrcProto::DoUserhostWithReason(int type, CMString reason, bool bSendCommand, CMString userhostparams, ...)
{
- TCHAR temp[4096];
+ wchar_t temp[4096];
CMString S = L"";
switch (type) {
case 1:
diff --git a/protocols/IRCG/src/userinfo.cpp b/protocols/IRCG/src/userinfo.cpp
index dd557e25d1..6237ceaa31 100644
--- a/protocols/IRCG/src/userinfo.cpp
+++ b/protocols/IRCG/src/userinfo.cpp
@@ -35,10 +35,10 @@ struct UserDetailsDlgProcParam
MCONTACT hContact;
};
-#define STR_BASIC LPGEN("Faster! Searches the network for an exact match of the nickname only. The hostmask is optional and provides further security if used. Wildcards (? and *) are allowed.")
-#define STR_ADVANCED LPGEN("Slower! Searches the network for nicknames matching a wildcard string. The hostmask is mandatory and a minimum of 4 characters is necessary in the \"Nick\" field. Wildcards (? and *) are allowed.")
-#define STR_ERROR LPGEN("Settings could not be saved!\n\nThe \"Nick\" field must contain at least four characters including wildcards,\n and it must also match the default nickname for this contact.")
-#define STR_ERROR2 LPGEN("Settings could not be saved!\n\nA full hostmask must be set for this online detection mode to work.")
+const wchar_t *STR_BASIC = LPGENW("Faster! Searches the network for an exact match of the nickname only. The hostmask is optional and provides further security if used. Wildcards (? and *) are allowed.");
+const wchar_t *STR_ADVANCED = LPGENW("Slower! Searches the network for nicknames matching a wildcard string. The hostmask is mandatory and a minimum of 4 characters is necessary in the \"Nick\" field. Wildcards (? and *) are allowed.");
+const wchar_t *STR_ERROR = LPGENW("Settings could not be saved!\n\nThe \"Nick\" field must contain at least four characters including wildcards,\n and it must also match the default nickname for this contact.");
+const wchar_t *STR_ERROR2 = LPGENW("Settings could not be saved!\n\nA full hostmask must be set for this online detection mode to work.");
INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
@@ -63,14 +63,14 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM
EnableWindow(GetDlgItem(m_hwnd, IDC_WILDCARD), bAdvanced);
if (!bAdvanced) {
- SetDlgItemText(m_hwnd, IDC_DEFAULT, TranslateT(STR_BASIC));
+ SetDlgItemText(m_hwnd, IDC_DEFAULT, TranslateTS(STR_BASIC));
if (!p->ppro->getTString(p->hContact, "Default", &dbv)) {
SetDlgItemText(m_hwnd, IDC_WILDCARD, dbv.ptszVal);
db_free(&dbv);
}
}
else {
- SetDlgItemText(m_hwnd, IDC_DEFAULT, TranslateT(STR_ADVANCED));
+ SetDlgItemText(m_hwnd, IDC_DEFAULT, TranslateTS(STR_ADVANCED));
if (!p->ppro->getTString(p->hContact, "UWildcard", &dbv)) {
SetDlgItemText(m_hwnd, IDC_WILDCARD, dbv.ptszVal);
db_free(&dbv);
@@ -99,7 +99,7 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM
EnableWindow(GetDlgItem(m_hwnd, IDC_BUTTON2), true);
if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_BUTTON) {
- TCHAR temp[500];
+ wchar_t temp[500];
GetDlgItemText(m_hwnd, IDC_WILDCARD, temp, _countof(temp));
BYTE bAdvanced = IsDlgButtonChecked(m_hwnd, IDC_RADIO1) ? 0 : 1;
@@ -107,13 +107,13 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM
if (GetWindowTextLength(GetDlgItem(m_hwnd, IDC_WILDCARD)) == 0 ||
GetWindowTextLength(GetDlgItem(m_hwnd, IDC_USER)) == 0 ||
GetWindowTextLength(GetDlgItem(m_hwnd, IDC_HOST)) == 0) {
- MessageBox(NULL, TranslateT(STR_ERROR2), TranslateT("IRC error"), MB_OK | MB_ICONERROR);
+ MessageBox(NULL, TranslateTS(STR_ERROR2), TranslateT("IRC error"), MB_OK | MB_ICONERROR);
return FALSE;
}
DBVARIANT dbv;
if (!p->ppro->getTString(p->hContact, "Default", &dbv)) {
- CMString S = _T(STR_ERROR);
+ CMString S = STR_ERROR;
S += L" (";
S += dbv.ptszVal;
S += L")";
@@ -162,7 +162,7 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM
}
if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RADIO1) {
- SetDlgItemText(m_hwnd, IDC_DEFAULT, TranslateT(STR_BASIC));
+ SetDlgItemText(m_hwnd, IDC_DEFAULT, TranslateTS(STR_BASIC));
DBVARIANT dbv;
if (!p->ppro->getTString(p->hContact, "Default", &dbv)) {
@@ -174,7 +174,7 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM
if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RADIO2) {
DBVARIANT dbv;
- SetDlgItemText(m_hwnd, IDC_DEFAULT, TranslateT(STR_ADVANCED));
+ SetDlgItemText(m_hwnd, IDC_DEFAULT, TranslateTS(STR_ADVANCED));
if (!p->ppro->getTString(p->hContact, "UWildcard", &dbv)) {
SetDlgItemText(m_hwnd, IDC_WILDCARD, dbv.ptszVal);
db_free(&dbv);
diff --git a/protocols/IRCG/src/windows.cpp b/protocols/IRCG/src/windows.cpp
index e41020e7d1..de14672a0a 100644
--- a/protocols/IRCG/src/windows.cpp
+++ b/protocols/IRCG/src/windows.cpp
@@ -109,21 +109,21 @@ void CWhoisDlg::OnDestroy()
void CWhoisDlg::OnGo(CCtrlButton*)
{
- TCHAR szTemp[255];
+ wchar_t szTemp[255];
m_InfoNick.GetText(szTemp, _countof(szTemp));
m_proto->PostIrcMessage(L"/WHOIS %s %s", szTemp, szTemp);
}
void CWhoisDlg::OnQuery(CCtrlButton*)
{
- TCHAR szTemp[255];
+ wchar_t szTemp[255];
m_InfoNick.GetText(szTemp, _countof(szTemp));
m_proto->PostIrcMessage(L"/QUERY %s", szTemp);
}
void CWhoisDlg::OnPing(CCtrlButton*)
{
- TCHAR szTemp[255];
+ wchar_t szTemp[255];
m_InfoNick.GetText(szTemp, _countof(szTemp));
m_Reply.SetText(TranslateT("Please wait..."));
m_proto->PostIrcMessage(L"/PRIVMSG %s \001PING %u\001", szTemp, time(0));
@@ -131,7 +131,7 @@ void CWhoisDlg::OnPing(CCtrlButton*)
void CWhoisDlg::OnUserInfo(CCtrlButton*)
{
- TCHAR szTemp[255];
+ wchar_t szTemp[255];
m_InfoNick.GetText(szTemp, _countof(szTemp));
m_Reply.SetText(TranslateT("Please wait..."));
m_proto->PostIrcMessage(L"/PRIVMSG %s \001USERINFO\001", szTemp);
@@ -139,7 +139,7 @@ void CWhoisDlg::OnUserInfo(CCtrlButton*)
void CWhoisDlg::OnTime(CCtrlButton*)
{
- TCHAR szTemp[255];
+ wchar_t szTemp[255];
m_InfoNick.GetText(szTemp, _countof(szTemp));
m_Reply.SetText(TranslateT("Please wait..."));
m_proto->PostIrcMessage(L"/PRIVMSG %s \001TIME\001", szTemp);
@@ -147,7 +147,7 @@ void CWhoisDlg::OnTime(CCtrlButton*)
void CWhoisDlg::OnVersion(CCtrlButton*)
{
- TCHAR szTemp[255];
+ wchar_t szTemp[255];
m_InfoNick.GetText(szTemp, _countof(szTemp));
m_Reply.SetText(TranslateT("Please wait..."));
m_proto->PostIrcMessage(L"/PRIVMSG %s \001VERSION\001", szTemp);
@@ -228,7 +228,7 @@ void CNickDlg::OnDestroy()
void CNickDlg::OnOk(CCtrlButton*)
{
- TCHAR szTemp[255];
+ wchar_t szTemp[255];
m_Enick.GetText(szTemp, _countof(szTemp));
m_proto->PostIrcMessage(L"/NICK %s", szTemp);
@@ -269,7 +269,7 @@ void CListDlg::OnInitDialog()
SystemParametersInfo(SPI_GETWORKAREA, 0, &screen, 0);
LVCOLUMN lvC;
int COLUMNS_SIZES[4] = { 200, 50, 50, 2000 };
- TCHAR szBuffer[32];
+ wchar_t szBuffer[32];
lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
lvC.fmt = LVCFMT_LEFT;
@@ -302,8 +302,8 @@ INT_PTR CListDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
::KillTimer(m_hwnd, m_timer); m_timer = 0;
// Retrieve the input text
- TCHAR strFilterText[255];
- TCHAR newTitle[255];
+ wchar_t strFilterText[255];
+ wchar_t newTitle[255];
m_filter.GetText(strFilterText, _countof(strFilterText));
if (strFilterText[0]) {
@@ -316,7 +316,7 @@ INT_PTR CListDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
m_list2.DeleteAllItems();
LVITEM lvm;
- TCHAR text[255];
+ wchar_t text[255];
lvm.pszText = text; // Set buffer for texts
lvm.cchTextMax = _countof(text);
lvm.mask = LVIF_TEXT;
@@ -326,12 +326,12 @@ INT_PTR CListDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
m_list.GetItem(&lvm);
// Match the text?
- TCHAR* t = _tcsstr(lvm.pszText, strFilterText);
+ wchar_t* t = wcsstr(lvm.pszText, strFilterText);
if (t == NULL) { // If no, then Check if in the topics
m_list.GetItem(&lvm);
// Match the text?
- t = _tcsstr(lvm.pszText, strFilterText);
+ t = wcsstr(lvm.pszText, strFilterText);
}
if (t) {
@@ -416,8 +416,8 @@ static int CALLBACK ListViewSort(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSo
if (!param->pList->GetHwnd())
return 0;
- TCHAR temp1[512];
- TCHAR temp2[512];
+ wchar_t temp1[512];
+ wchar_t temp2[512];
LVITEM lvm;
lvm.mask = LVIF_TEXT;
lvm.iItem = lParam1;
@@ -435,7 +435,7 @@ static int CALLBACK ListViewSort(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSo
return (*temp1 == 0) ? 1 : -1;
}
- return (_ttoi(temp1) < _ttoi(temp2)) ? 1 : -1;
+ return (_wtoi(temp1) < _wtoi(temp2)) ? 1 : -1;
}
int CListDlg::Resizer(UTILRESIZECONTROL *urc)
@@ -463,7 +463,7 @@ void CListDlg::List_OnColumnClick(CCtrlListView::TEventInfo *ev)
void CListDlg::OnJoin(CCtrlButton*)
{
- TCHAR szTemp[255];
+ wchar_t szTemp[255];
m_filter.GetText(szTemp, _countof(szTemp));
if (szTemp[0])
@@ -523,7 +523,7 @@ void CJoinDlg::OnDestroy()
void CJoinDlg::OnOk(CCtrlButton*)
{
- TCHAR szTemp[255];
+ wchar_t szTemp[255];
GetDlgItemText(m_hwnd, IDC_ENICK, szTemp, _countof(szTemp));
if (m_proto->IsChannel(szTemp))
m_proto->PostIrcMessage(L"/JOIN %s", szTemp);
@@ -631,7 +631,7 @@ void CQuickDlg::OnOk(CCtrlButton*)
m_proto->m_iSSL = pData->m_iSSL;
}
- TCHAR windowname[20];
+ wchar_t windowname[20];
GetWindowText(m_hwnd, windowname, _countof(windowname));
if (mir_tstrcmpi(windowname, L"Miranda IRC") == 0) {
m_proto->m_serverComboSelection = m_serverCombo.GetCurSel() - 1;
@@ -727,22 +727,22 @@ void CQuestionDlg::OnOk(CCtrlButton*)
{
int i = GetWindowTextLength(GetDlgItem(m_hwnd, IDC_EDIT));
if (i > 0) {
- TCHAR* l = new TCHAR[i + 2];
+ wchar_t* l = new wchar_t[i + 2];
GetDlgItemText(m_hwnd, IDC_EDIT, l, i + 1);
int j = GetWindowTextLength(GetDlgItem(m_hwnd, IDC_HIDDENEDIT));
- TCHAR *m = new TCHAR[j + 2];
+ wchar_t *m = new wchar_t[j + 2];
GetDlgItemText(m_hwnd, IDC_HIDDENEDIT, m, j + 1);
- TCHAR *text = _tcsstr(m, L"%question");
- TCHAR *p1 = text;
- TCHAR *p2 = NULL;
+ wchar_t *text = wcsstr(m, L"%question");
+ wchar_t *p1 = text;
+ wchar_t *p2 = NULL;
if (p1) {
p1 += 9;
if (*p1 == '=' && p1[1] == '\"') {
p1 += 2;
for (int k = 0; k < 3; k++) {
- p2 = _tcschr(p1, '\"');
+ p2 = wcschr(p1, '\"');
if (p2) {
p2++;
if (k == 2 || (*p2 != ',' || (*p2 == ',' && p2[1] != '\"')))
@@ -756,7 +756,7 @@ void CQuestionDlg::OnOk(CCtrlButton*)
else *p1 = '\0';
}
- CMString S(_T('\0'), j + 2);
+ CMString S('\0', j + 2);
GetDlgItemText(m_hwnd, IDC_HIDDENEDIT, S.GetBuffer(), j + 1);
S.Replace(text, l);
m_proto->PostIrcMessageWnd(NULL, NULL, S);
@@ -907,10 +907,10 @@ void CManagerDlg::OnClose()
}
}
- TCHAR window[256];
+ wchar_t window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, _countof(window));
CMString S = L"";
- TCHAR temp[1000];
+ wchar_t temp[1000];
for (int i = 0; i < 5; i++) {
if (m_topic.SendMsg(CB_GETLBTEXT, i, (LPARAM)temp) != LB_ERR) {
CMString S1 = temp;
@@ -939,8 +939,8 @@ void CManagerDlg::OnDestroy()
void CManagerDlg::OnAdd(CCtrlButton*)
{
- TCHAR temp[100];
- TCHAR mode[3];
+ wchar_t temp[100];
+ wchar_t mode[3];
if (m_radio1.GetState()) {
mir_tstrcpy(mode, L"+b");
mir_tstrncpy(temp, TranslateT("Add ban"), 100);
@@ -964,8 +964,8 @@ void CManagerDlg::OnAdd(CCtrlButton*)
SetDlgItemText(addban_hWnd, IDC_CAPTION, temp);
SetDlgItemText(addban_hWnd, IDC_TEXT, TranslateT("Please enter the hostmask (nick!user@host)"));
- TCHAR temp2[450];
- TCHAR window[256];
+ wchar_t temp2[450];
+ wchar_t window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, _countof(window));
mir_sntprintf(temp2, L"/MODE %s %s %s", window, mode, L"%question");
SetDlgItemText(addban_hWnd, IDC_HIDDENEDIT, temp2);
@@ -977,12 +977,12 @@ void CManagerDlg::OnEdit(CCtrlButton*)
if (BST_UNCHECKED == IsDlgButtonChecked(m_hwnd, IDC_NOTOP)) {
int i = m_list.GetCurSel();
if (i != LB_ERR) {
- TCHAR* m = m_list.GetItemText(i);
+ wchar_t* m = m_list.GetItemText(i);
CMString user = GetWord(m, 0);
mir_free(m);
- TCHAR temp[100];
- TCHAR mode[3];
+ wchar_t temp[100];
+ wchar_t mode[3];
if (m_radio1.GetState()) {
mir_tstrcpy(mode, L"b");
mir_tstrncpy(temp, TranslateT("Edit ban"), 100);
@@ -1007,8 +1007,8 @@ void CManagerDlg::OnEdit(CCtrlButton*)
m_edit.Disable();
m_remove.Disable();
- TCHAR temp2[450];
- TCHAR window[256];
+ wchar_t temp2[450];
+ wchar_t window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, _countof(window));
mir_sntprintf(temp2, L"/MODE %s -%s %s%s/MODE %s +%s %s", window, mode, user.c_str(), L"%newl", window, mode, L"%question");
SetDlgItemText(addban_hWnd, IDC_HIDDENEDIT, temp2);
@@ -1025,8 +1025,8 @@ void CManagerDlg::OnRemove(CCtrlButton*)
m_edit.Disable();
m_remove.Disable();
- TCHAR temp[100], mode[3];
- TCHAR* m = m_list.GetItemText(i, temp, _countof(temp));
+ wchar_t temp[100], mode[3];
+ wchar_t* m = m_list.GetItemText(i, temp, _countof(temp));
CMString user = GetWord(m, 0);
if (m_radio1.GetState()) {
@@ -1042,7 +1042,7 @@ void CManagerDlg::OnRemove(CCtrlButton*)
mir_tstrncpy(temp, TranslateT("Remove exception?"), 100);
}
- TCHAR window[256];
+ wchar_t window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, _countof(window));
if (MessageBox(m_hwnd, user.c_str(), temp, MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2) == IDYES) {
m_proto->PostIrcMessage(L"/MODE %s %s %s", window, mode, user.c_str());
@@ -1077,57 +1077,57 @@ void CManagerDlg::OnChangeTopic(CCtrlData*)
void CManagerDlg::OnApplyModes(CCtrlButton*)
{
- TCHAR window[256];
+ wchar_t window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, _countof(window));
CHANNELINFO *wi = (CHANNELINFO *)m_proto->DoEvent(GC_EVENT_GETITEMDATA, window, NULL, NULL, NULL, NULL, NULL, FALSE, FALSE, 0);
if (wi) {
- TCHAR toadd[10]; *toadd = '\0';
- TCHAR toremove[10]; *toremove = '\0';
+ wchar_t toadd[10]; *toadd = '\0';
+ wchar_t toremove[10]; *toremove = '\0';
CMString appendixadd = L"";
CMString appendixremove = L"";
- if (wi->pszMode && _tcschr(wi->pszMode, 't')) {
+ if (wi->pszMode && wcschr(wi->pszMode, 't')) {
if (!m_check1.GetState())
mir_tstrcat(toremove, L"t");
}
else if (m_check1.GetState())
mir_tstrcat(toadd, L"t");
- if (wi->pszMode && _tcschr(wi->pszMode, 'n')) {
+ if (wi->pszMode && wcschr(wi->pszMode, 'n')) {
if (!m_check2.GetState())
mir_tstrcat(toremove, L"n");
}
else if (m_check2.GetState())
mir_tstrcat(toadd, L"n");
- if (wi->pszMode && _tcschr(wi->pszMode, 'i')) {
+ if (wi->pszMode && wcschr(wi->pszMode, 'i')) {
if (!m_check3.GetState())
mir_tstrcat(toremove, L"i");
}
else if (m_check3.GetState())
mir_tstrcat(toadd, L"i");
- if (wi->pszMode && _tcschr(wi->pszMode, 'm')) {
+ if (wi->pszMode && wcschr(wi->pszMode, 'm')) {
if (!m_check4.GetState())
mir_tstrcat(toremove, L"m");
}
else if (m_check4.GetState())
mir_tstrcat(toadd, L"m");
- if (wi->pszMode && _tcschr(wi->pszMode, 'p')) {
+ if (wi->pszMode && wcschr(wi->pszMode, 'p')) {
if (!m_check7.GetState())
mir_tstrcat(toremove, L"p");
}
else if (m_check7.GetState())
mir_tstrcat(toadd, L"p");
- if (wi->pszMode && _tcschr(wi->pszMode, 's')) {
+ if (wi->pszMode && wcschr(wi->pszMode, 's')) {
if (!m_check8.GetState())
mir_tstrcat(toremove, L"s");
}
else if (m_check8.GetState())
mir_tstrcat(toadd, L"s");
- if (wi->pszMode && _tcschr(wi->pszMode, 'c')) {
+ if (wi->pszMode && wcschr(wi->pszMode, 'c')) {
if (!m_check9.GetState())
mir_tstrcat(toremove, L"c");
}
@@ -1136,13 +1136,13 @@ void CManagerDlg::OnApplyModes(CCtrlButton*)
CMString Key = L"";
CMString Limit = L"";
- if (wi->pszMode && wi->pszPassword && _tcschr(wi->pszMode, 'k')) {
+ if (wi->pszMode && wi->pszPassword && wcschr(wi->pszMode, 'k')) {
if (!m_check5.GetState()) {
mir_tstrcat(toremove, L"k");
appendixremove += L" " + CMString(wi->pszPassword);
}
else if (GetWindowTextLength(m_key.GetHwnd())) {
- TCHAR temp[400];
+ wchar_t temp[400];
m_key.GetText(temp, 14);
if (Key != temp) {
@@ -1157,16 +1157,16 @@ void CManagerDlg::OnApplyModes(CCtrlButton*)
mir_tstrcat(toadd, L"k");
appendixadd += L" ";
- TCHAR temp[400];
+ wchar_t temp[400];
m_key.GetText(temp, _countof(temp));
appendixadd += temp;
}
- if (_tcschr(wi->pszMode, 'l')) {
+ if (wcschr(wi->pszMode, 'l')) {
if (!m_check6.GetState())
mir_tstrcat(toremove, L"l");
else if (GetWindowTextLength(GetDlgItem(m_hwnd, IDC_LIMIT))) {
- TCHAR temp[15];
+ wchar_t temp[15];
GetDlgItemText(m_hwnd, IDC_LIMIT, temp, _countof(temp));
if (wi->pszLimit && mir_tstrcmpi(wi->pszLimit, temp)) {
mir_tstrcat(toadd, L"l");
@@ -1178,13 +1178,13 @@ void CManagerDlg::OnApplyModes(CCtrlButton*)
mir_tstrcat(toadd, L"l");
appendixadd += L" ";
- TCHAR temp[15];
+ wchar_t temp[15];
m_limit.GetText(temp, _countof(temp));
appendixadd += temp;
}
if (mir_tstrlen(toadd) || mir_tstrlen(toremove)) {
- TCHAR temp[500];
+ wchar_t temp[500];
mir_tstrcpy(temp, L"/mode ");
mir_tstrcat(temp, window);
mir_tstrcat(temp, L" ");
@@ -1205,8 +1205,8 @@ void CManagerDlg::OnApplyModes(CCtrlButton*)
void CManagerDlg::OnApplyTopic(CCtrlButton*)
{
- TCHAR temp[470];
- TCHAR window[256];
+ wchar_t temp[470];
+ wchar_t window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, _countof(window));
m_topic.GetText(temp, _countof(temp));
m_proto->PostIrcMessage(L"/TOPIC %s %s", window, temp);
@@ -1242,10 +1242,10 @@ void CManagerDlg::OnRadio(CCtrlData*)
void CManagerDlg::ApplyQuestion()
{
- TCHAR window[256];
+ wchar_t window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, _countof(window));
- TCHAR mode[3];
+ wchar_t mode[3];
mir_tstrcpy(mode, L"+b");
if (m_radio2.GetState())
mir_tstrcpy(mode, L"+I");
@@ -1270,14 +1270,14 @@ void CManagerDlg::CloseQuestion()
}
}
-void CManagerDlg::InitManager(int mode, const TCHAR* window)
+void CManagerDlg::InitManager(int mode, const wchar_t* window)
{
SetDlgItemText(m_hwnd, IDC_CAPTION, window);
CHANNELINFO *wi = (CHANNELINFO *)m_proto->DoEvent(GC_EVENT_GETITEMDATA, window, NULL, NULL, NULL, NULL, NULL, FALSE, FALSE, 0);
if (wi) {
if (m_proto->IsConnected()) {
- TCHAR temp[1000];
+ wchar_t temp[1000];
mir_sntprintf(temp, L"Topic%s%s", window, m_proto->m_info.sNetwork.c_str());
char* p = mir_t2a(temp);
@@ -1306,7 +1306,7 @@ void CManagerDlg::InitManager(int mode, const TCHAR* window)
m_add.Enable();
bool add = false;
- TCHAR* p1 = wi->pszMode;
+ wchar_t* p1 = wi->pszMode;
if (p1) {
while (*p1 != '\0' && *p1 != ' ') {
if (*p1 == '+')
diff --git a/protocols/IcqOscarJ/src/cookies.h b/protocols/IcqOscarJ/src/cookies.h
index 843cc404ad..37f85c214c 100644
--- a/protocols/IcqOscarJ/src/cookies.h
+++ b/protocols/IcqOscarJ/src/cookies.h
@@ -109,7 +109,7 @@ struct cookie_avatar
size_t hashlen;
BYTE *hash;
size_t cbData;
- TCHAR *szFile;
+ wchar_t *szFile;
};
struct cookie_reverse_connect : public cookie_message_data
diff --git a/protocols/IcqOscarJ/src/db.cpp b/protocols/IcqOscarJ/src/db.cpp
index b241e970ec..8cc0736bc0 100644
--- a/protocols/IcqOscarJ/src/db.cpp
+++ b/protocols/IcqOscarJ/src/db.cpp
@@ -83,7 +83,7 @@ void ChangeInfoData::LoadSettingsFromDb(int keepChanged)
}
char buf[MAX_PATH];
- TCHAR tbuf[MAX_PATH];
+ wchar_t tbuf[MAX_PATH];
if (utf8_to_tchar_static(GetItemSettingText(i, buf, _countof(buf)), tbuf, _countof(tbuf)))
ListView_SetItemText(hwndList, i, 1, tbuf);
diff --git a/protocols/IcqOscarJ/src/dlgproc.cpp b/protocols/IcqOscarJ/src/dlgproc.cpp
index d6cb25f816..9a99841d22 100644
--- a/protocols/IcqOscarJ/src/dlgproc.cpp
+++ b/protocols/IcqOscarJ/src/dlgproc.cpp
@@ -201,7 +201,7 @@ INT_PTR CALLBACK ChangeInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
LV_ITEM lvi = { 0 };
lvi.mask = LVIF_PARAM | LVIF_TEXT;
for (lvi.iItem = 0; lvi.iItem < settingCount; lvi.iItem++) {
- TCHAR text[MAX_PATH];
+ wchar_t text[MAX_PATH];
lvi.lParam = lvi.iItem;
lvi.pszText = text;
utf8_to_tchar_static(setting[lvi.iItem].szDescription, text, _countof(text));
@@ -464,7 +464,7 @@ INT_PTR CALLBACK ChangeInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
dat->hUpload[i] = NULL;
for (done = 0, i = 0; i < _countof(dat->hUpload); i++)
done += dat->hUpload[i] == NULL;
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
mir_sntprintf(buf, TranslateT("Upload in progress...%d%%"), 100 * done / (_countof(dat->hUpload)));
SetDlgItemText(hwndDlg, IDC_UPLOADING, buf);
if (done < _countof(dat->hUpload)) break;
diff --git a/protocols/IcqOscarJ/src/editlist.cpp b/protocols/IcqOscarJ/src/editlist.cpp
index df0840385a..90b24c5daa 100644
--- a/protocols/IcqOscarJ/src/editlist.cpp
+++ b/protocols/IcqOscarJ/src/editlist.cpp
@@ -174,7 +174,7 @@ void ChangeInfoData::EndListEdit(int save)
if (sid.changed) {
char buf[MAX_PATH];
- TCHAR tbuf[MAX_PATH];
+ wchar_t tbuf[MAX_PATH];
if (utf8_to_tchar_static(ICQTranslateUtfStatic(pItem.text, buf, _countof(buf)), tbuf, _countof(buf)))
ListView_SetItemText(hwndList, iEditItem, 1, tbuf);
diff --git a/protocols/IcqOscarJ/src/editstring.cpp b/protocols/IcqOscarJ/src/editstring.cpp
index 94b41836ee..0db3f3db60 100644
--- a/protocols/IcqOscarJ/src/editstring.cpp
+++ b/protocols/IcqOscarJ/src/editstring.cpp
@@ -323,7 +323,7 @@ void ChangeInfoData::EndStringEdit(int save)
}
if (sid.changed) {
- TCHAR tbuf[MAX_PATH];
+ wchar_t tbuf[MAX_PATH];
GetWindowText(hwndEdit, tbuf, _countof(tbuf));
ListView_SetItemText(hwndList, iEditItem, 1, tbuf);
diff --git a/protocols/IcqOscarJ/src/fam_01service.cpp b/protocols/IcqOscarJ/src/fam_01service.cpp
index 25610a5bf7..faec561278 100644
--- a/protocols/IcqOscarJ/src/fam_01service.cpp
+++ b/protocols/IcqOscarJ/src/fam_01service.cpp
@@ -405,7 +405,7 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, size_t wBufferLength, snac_heade
if (m_bAvatarsEnabled && !info->bMyAvatarInited) { // signal the server after login
// this refreshes avatar state - it used to work automatically, but now it does not
if (getByte("ForceOurAvatar", 0)) { // keep our avatar
- TCHAR *file = GetOwnAvatarFileName();
+ wchar_t *file = GetOwnAvatarFileName();
SetMyAvatar(0, (LPARAM)file);
SAFE_FREE(&file);
}
diff --git a/protocols/IcqOscarJ/src/fam_03buddy.cpp b/protocols/IcqOscarJ/src/fam_03buddy.cpp
index 36b3abd116..4a86609b9e 100644
--- a/protocols/IcqOscarJ/src/fam_03buddy.cpp
+++ b/protocols/IcqOscarJ/src/fam_03buddy.cpp
@@ -692,7 +692,7 @@ void CIcqProto::parseStatusNote(DWORD dwUin, char *szUid, MCONTACT hContact, osc
if (getContactXStatus(hContact) != 0 || !CheckContactCapabilities(hContact, CAPF_STATUS_MESSAGES)) {
setStatusMsgVar(hContact, szStatusNote, false);
- TCHAR *tszNote = mir_utf8decodeT(szStatusNote);
+ wchar_t *tszNote = mir_utf8decodeT(szStatusNote);
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, NULL, (LPARAM)tszNote);
mir_free(tszNote);
}
diff --git a/protocols/IcqOscarJ/src/fam_04message.cpp b/protocols/IcqOscarJ/src/fam_04message.cpp
index da09e845dd..104c7c8652 100644
--- a/protocols/IcqOscarJ/src/fam_04message.cpp
+++ b/protocols/IcqOscarJ/src/fam_04message.cpp
@@ -948,8 +948,8 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, size_t wLen, DWORD dwUin, c
contacts[iContact] = (ICQSEARCHRESULT*)SAFE_MALLOC(sizeof(ICQSEARCHRESULT));
contacts[iContact]->hdr.cbSize = sizeof(ICQSEARCHRESULT);
contacts[iContact]->hdr.flags = PSR_TCHAR;
- contacts[iContact]->hdr.nick.t = null_strdup(L"");
- contacts[iContact]->hdr.id.t = ansi_to_tchar(szUid);
+ contacts[iContact]->hdr.nick.w = null_strdup(L"");
+ contacts[iContact]->hdr.id.w = ansi_to_tchar(szUid);
if (IsStringUIN(szUid)) { // icq contact
contacts[iContact]->uin = atoi(szUid);
@@ -976,8 +976,8 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, size_t wLen, DWORD dwUin, c
debugLogA("Malformed '%s' message", "contacts");
disposeChain(&chain);
for (int i = 0; i < iContact; i++) {
- SAFE_FREE(&contacts[i]->hdr.id.t);
- SAFE_FREE(&contacts[i]->hdr.nick.t);
+ SAFE_FREE(&contacts[i]->hdr.id.w);
+ SAFE_FREE(&contacts[i]->hdr.nick.w);
SAFE_FREE((void**)&contacts[i]);
}
SAFE_FREE((void**)&contacts);
@@ -1015,8 +1015,8 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, size_t wLen, DWORD dwUin, c
unpackTypedTLV(pBuffer, wNickLen, 0x01, &wNickTLV, &wNickTLVLen, (LPBYTE*)&pNick);
if (wNickTLV == 0x01) {
- SAFE_FREE(&contacts[iContact]->hdr.nick.t);
- contacts[iContact]->hdr.nick.t = utf8_to_tchar(pNick);
+ SAFE_FREE(&contacts[iContact]->hdr.nick.w);
+ contacts[iContact]->hdr.nick.w = utf8_to_tchar(pNick);
}
else
SAFE_FREE(&pNick);
@@ -1051,8 +1051,8 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, size_t wLen, DWORD dwUin, c
}
for (int i = 0; i < iContact; i++) {
- SAFE_FREE(&contacts[i]->hdr.id.t);
- SAFE_FREE(&contacts[i]->hdr.nick.t);
+ SAFE_FREE(&contacts[i]->hdr.id.w);
+ SAFE_FREE(&contacts[i]->hdr.nick.w);
SAFE_FREE((void**)&contacts[i]);
}
SAFE_FREE((void**)&contacts);
@@ -1692,8 +1692,8 @@ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp,
if (!mir_strlen(pszMsgField[1 + i * 2]))
valid = 0;
}
- isrList[i]->hdr.id.t = ansi_to_tchar(pszMsgField[1 + i * 2]);
- isrList[i]->hdr.nick.t = ansi_to_tchar(pszMsgField[2 + i * 2]);
+ isrList[i]->hdr.id.w = ansi_to_tchar(pszMsgField[1 + i * 2]);
+ isrList[i]->hdr.nick.w = ansi_to_tchar(pszMsgField[2 + i * 2]);
}
if (!valid)
@@ -1710,8 +1710,8 @@ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp,
}
for (int i = 0; i < nContacts; i++) {
- SAFE_FREE(&isrList[i]->hdr.id.t);
- SAFE_FREE(&isrList[i]->hdr.nick.t);
+ SAFE_FREE(&isrList[i]->hdr.id.w);
+ SAFE_FREE(&isrList[i]->hdr.nick.w);
SAFE_FREE((void**)&isrList[i]);
}
}
diff --git a/protocols/IcqOscarJ/src/fam_0alookup.cpp b/protocols/IcqOscarJ/src/fam_0alookup.cpp
index 49a18401a1..bb37764957 100644
--- a/protocols/IcqOscarJ/src/fam_0alookup.cpp
+++ b/protocols/IcqOscarJ/src/fam_0alookup.cpp
@@ -93,26 +93,26 @@ void CIcqProto::handleLookupEmailReply(BYTE* buf, size_t wLen, DWORD dwCookie)
sr.hdr.cbSize = sizeof(sr);
sr.hdr.flags = PSR_TCHAR;
- sr.hdr.email.t = ansi_to_tchar(pCookie->szObject);
+ sr.hdr.email.w = ansi_to_tchar(pCookie->szObject);
// Syntax check, read chain
if (wLen >= 4 && (pChain = readIntoTLVChain(&buf, wLen, 0))) {
for (WORD i = 1; TRUE; i++) { // collect the results
char *szUid = pChain->getString(0x01, i);
if (!szUid) break;
- sr.hdr.id.t = ansi_to_tchar(szUid);
- sr.hdr.nick.t = sr.hdr.id.t;
+ sr.hdr.id.w = ansi_to_tchar(szUid);
+ sr.hdr.nick.w = sr.hdr.id.w;
// broadcast the result
if (pCookie->dwMainId)
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)pCookie->dwMainId, (LPARAM)&sr);
else
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)dwCookie, (LPARAM)&sr);
- SAFE_FREE(&sr.hdr.id.t);
+ SAFE_FREE(&sr.hdr.id.w);
SAFE_FREE(&szUid);
}
disposeChain(&pChain);
}
- SAFE_FREE(&sr.hdr.email.t);
+ SAFE_FREE(&sr.hdr.email.w);
ReleaseLookupCookie(dwCookie, pCookie);
}
diff --git a/protocols/IcqOscarJ/src/fam_15icqserver.cpp b/protocols/IcqOscarJ/src/fam_15icqserver.cpp
index 654bfa7f2e..b3b5a981d8 100644
--- a/protocols/IcqOscarJ/src/fam_15icqserver.cpp
+++ b/protocols/IcqOscarJ/src/fam_15icqserver.cpp
@@ -340,7 +340,7 @@ void CIcqProto::parseSearchReplies(unsigned char *databuf, size_t wPacketLen, WO
wPacketLen -= 4;
sr.uin = dwUin;
_itoa(dwUin, szUin, 10);
- sr.hdr.id.t = (TCHAR*)szUin;
+ sr.hdr.id.w = (wchar_t*)szUin;
// Nick
if (wPacketLen < 2)
@@ -350,11 +350,11 @@ void CIcqProto::parseSearchReplies(unsigned char *databuf, size_t wPacketLen, WO
if (wLen > 0) {
if (wPacketLen < wLen || (databuf[wLen - 1] != 0))
break;
- sr.hdr.nick.t = (TCHAR*)databuf;
+ sr.hdr.nick.w = (wchar_t*)databuf;
databuf += wLen;
}
else {
- sr.hdr.nick.t = NULL;
+ sr.hdr.nick.w = NULL;
}
// First name
@@ -365,10 +365,10 @@ void CIcqProto::parseSearchReplies(unsigned char *databuf, size_t wPacketLen, WO
if (wLen > 0) {
if (wPacketLen < wLen || (databuf[wLen - 1] != 0))
break;
- sr.hdr.firstName.t = (TCHAR*)databuf;
+ sr.hdr.firstName.w = (wchar_t*)databuf;
databuf += wLen;
}
- else sr.hdr.firstName.t = NULL;
+ else sr.hdr.firstName.w = NULL;
// Last name
if (wPacketLen < 2)
@@ -378,10 +378,10 @@ void CIcqProto::parseSearchReplies(unsigned char *databuf, size_t wPacketLen, WO
if (wLen > 0) {
if (wPacketLen < wLen || (databuf[wLen - 1] != 0))
break;
- sr.hdr.lastName.t = (TCHAR*)databuf;
+ sr.hdr.lastName.w = (wchar_t*)databuf;
databuf += wLen;
}
- else sr.hdr.lastName.t = NULL;
+ else sr.hdr.lastName.w = NULL;
// E-mail name
if (wPacketLen < 2)
@@ -391,10 +391,10 @@ void CIcqProto::parseSearchReplies(unsigned char *databuf, size_t wPacketLen, WO
if (wLen > 0) {
if (wPacketLen < wLen || (databuf[wLen - 1] != 0))
break;
- sr.hdr.email.t = (TCHAR*)databuf;
+ sr.hdr.email.w = (wchar_t*)databuf;
databuf += wLen;
}
- else sr.hdr.email.t = NULL;
+ else sr.hdr.email.w = NULL;
// Authentication needed flag
if (wPacketLen < 1)
diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp
index 130f8796c7..3d03ed6f43 100644
--- a/protocols/IcqOscarJ/src/icq_avatar.cpp
+++ b/protocols/IcqOscarJ/src/icq_avatar.cpp
@@ -54,28 +54,28 @@ avatars_request::~avatars_request()
}
}
-TCHAR* CIcqProto::GetOwnAvatarFileName()
+wchar_t* CIcqProto::GetOwnAvatarFileName()
{
DBVARIANT dbvFile = {DBVT_DELETED};
if (getTString(NULL, "AvatarFile", &dbvFile))
return NULL;
- TCHAR tmp[MAX_PATH * 2];
+ wchar_t tmp[MAX_PATH * 2];
PathToAbsoluteT(dbvFile.ptszVal, tmp);
db_free(&dbvFile);
return null_strdup(tmp);
}
-void CIcqProto::GetFullAvatarFileName(int dwUin, const char *szUid, int dwFormat, TCHAR *pszDest, size_t cbLen)
+void CIcqProto::GetFullAvatarFileName(int dwUin, const char *szUid, int dwFormat, wchar_t *pszDest, size_t cbLen)
{
GetAvatarFileName(dwUin, szUid, pszDest, cbLen);
AddAvatarExt(dwFormat, pszDest);
}
-void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, TCHAR *pszDest, size_t cbLen)
+void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, wchar_t *pszDest, size_t cbLen)
{
- TCHAR szPath[MAX_PATH * 2];
+ wchar_t szPath[MAX_PATH * 2];
mir_sntprintf(szPath, L"%s\\%S\\", VARST(L"%miranda_avatarcache%"), m_szModuleName);
FOLDERSGETDATA fgd = { sizeof(fgd) };
@@ -91,18 +91,18 @@ void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, TCHAR *pszDest,
CreateDirectoryTreeT(szPath);
if (dwUin != 0)
- _ltot(dwUin, pszDest + tPathLen, 10);
+ _ltow(dwUin, pszDest + tPathLen, 10);
else if (szUid) {
- TCHAR* p = mir_a2t(szUid);
+ wchar_t* p = mir_a2t(szUid);
mir_tstrcpy(pszDest + tPathLen, p);
mir_free(p);
}
else {
- TCHAR szBuf[MAX_PATH];
+ wchar_t szBuf[MAX_PATH];
if (CallService(MS_DB_GETPROFILENAMET, MAX_PATH, (LPARAM)szBuf))
mir_tstrcpy(pszDest + tPathLen, L"avatar");
else {
- TCHAR *szLastDot = _tcsrchr(szBuf, '.');
+ wchar_t *szLastDot = wcsrchr(szBuf, '.');
if (szLastDot)
szLastDot[0] = '\0';
@@ -112,15 +112,15 @@ void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, TCHAR *pszDest,
}
}
-void AddAvatarExt(int dwFormat, TCHAR *pszDest)
+void AddAvatarExt(int dwFormat, wchar_t *pszDest)
{
- const TCHAR *ext = ProtoGetAvatarExtension(dwFormat);
+ const wchar_t *ext = ProtoGetAvatarExtension(dwFormat);
mir_tstrcat(pszDest, (*ext == 0) ? L".dat" : ext);
}
#define MD5_BLOCK_SIZE 1024*1024 /* use 1MB blocks */
-BYTE* calcMD5HashOfFile(const TCHAR *tszFile)
+BYTE* calcMD5HashOfFile(const wchar_t *tszFile)
{
BYTE *res = NULL;
@@ -244,11 +244,11 @@ void CIcqProto::handleAvatarOwnerHash(BYTE bFlags, BYTE *pData, size_t nDataLen)
setUserInfo();
{
// here we need to find a file, check its hash, if invalid get avatar from server
- TCHAR *file = GetOwnAvatarFileName();
+ wchar_t *file = GetOwnAvatarFileName();
if (!file) { // we have no avatar file, download from server
debugLogA("We have no avatar, requesting from server.");
- TCHAR szFile[MAX_PATH * 2 + 4];
+ wchar_t szFile[MAX_PATH * 2 + 4];
GetAvatarFileName(0, NULL, szFile, MAX_PATH * 2);
GetAvatarData(NULL, m_dwLocalUIN, NULL, pData, 0x14, szFile);
}
@@ -258,7 +258,7 @@ void CIcqProto::handleAvatarOwnerHash(BYTE bFlags, BYTE *pData, size_t nDataLen)
if (!hash) { // hash could not be calculated - probably missing file, get avatar from server
debugLogA("We have no avatar, requesting from server.");
- TCHAR szFile[MAX_PATH * 2 + 4];
+ wchar_t szFile[MAX_PATH * 2 + 4];
GetAvatarFileName(0, NULL, szFile, MAX_PATH * 2);
GetAvatarData(NULL, m_dwLocalUIN, NULL, pData, 0x14, szFile);
}
@@ -280,7 +280,7 @@ void CIcqProto::handleAvatarOwnerHash(BYTE bFlags, BYTE *pData, size_t nDataLen)
else { // get avatar from server
debugLogA("We have different avatar, requesting new from server.");
- TCHAR tszFile[MAX_PATH * 2 + 4];
+ wchar_t tszFile[MAX_PATH * 2 + 4];
GetAvatarFileName(0, NULL, tszFile, MAX_PATH * 2);
GetAvatarData(NULL, m_dwLocalUIN, NULL, pData, 0x14, tszFile);
}
@@ -295,7 +295,7 @@ void CIcqProto::handleAvatarOwnerHash(BYTE bFlags, BYTE *pData, size_t nDataLen)
case 0x81:
// request to re-upload avatar data
if (m_bSsiEnabled) { // we could not change serv-list if it is disabled...
- TCHAR *file = GetOwnAvatarFileName();
+ wchar_t *file = GetOwnAvatarFileName();
if (!file) { // we have no file to upload, remove hash from server
debugLogA("We do not have avatar, removing hash.");
SetMyAvatar(0, 0);
@@ -414,7 +414,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, MCONTACT hCont
if (avatarType != -1) { // check settings, should we request avatar immediatelly?
DBVARIANT dbv = { DBVT_DELETED };
- TCHAR tszAvatar[MAX_PATH * 2 + 4];
+ wchar_t tszAvatar[MAX_PATH * 2 + 4];
BYTE bAutoLoad = getByte("AvatarsAutoLoad", DEFAULT_LOAD_AVATARS);
if ((avatarType == AVATAR_HASH_STATIC || avatarType == AVATAR_HASH_MINI) && cbAvatarHash == 0x09 && !memcmp(pAvatarHash + 4, hashEmptyAvatar + 4, 0x05)) { // empty avatar - unlink image, clear hash
@@ -437,7 +437,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, MCONTACT hCont
int dwPaFormat = getByte(hContact, "AvatarType", PA_FORMAT_UNKNOWN);
GetFullAvatarFileName(dwUIN, szUID, dwPaFormat, tszAvatar, MAX_PATH * 2);
- if (_taccess(tszAvatar, 0) == 0) { // the file is there, link to contactphoto, save hash
+ if (_waccess(tszAvatar, 0) == 0) { // the file is there, link to contactphoto, save hash
debugLogA("%s has published Avatar. Image was found in the cache.", strUID(dwUIN, szUID));
setSettingBlob(hContact, "AvatarHash", pAvatarHash, cbAvatarHash);
@@ -470,7 +470,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, MCONTACT hCont
}
else {
GetFullAvatarFileName(dwUIN, szUID, dwPaFormat, tszAvatar, MAX_PATH * 2);
- if (_taccess(tszAvatar, 0) != 0) { // the file was lost, get it again
+ if (_waccess(tszAvatar, 0) != 0) { // the file was lost, get it again
debugLogA("%s has Avatar. Image is missing.", strUID(dwUIN, szUID));
bJob = 2;
}
@@ -523,7 +523,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, MCONTACT hCont
}
// request avatar data from server
-int CIcqProto::GetAvatarData(MCONTACT hContact, DWORD dwUin, const char *szUid, const BYTE *hash, size_t hashlen, const TCHAR *file)
+int CIcqProto::GetAvatarData(MCONTACT hContact, DWORD dwUin, const char *szUid, const BYTE *hash, size_t hashlen, const wchar_t *file)
{
uid_str szUidData;
char *pszUid = NULL;
@@ -725,7 +725,7 @@ void avatars_server_connection::shutdownConnection()
Netlib_Shutdown(hConnection);
}
-DWORD avatars_server_connection::sendGetAvatarRequest(MCONTACT hContact, DWORD dwUin, char *szUid, const BYTE *hash, size_t hashlen, const TCHAR *file)
+DWORD avatars_server_connection::sendGetAvatarRequest(MCONTACT hContact, DWORD dwUin, char *szUid, const BYTE *hash, size_t hashlen, const wchar_t *file)
{
int i;
DWORD dwNow = GetTickCount();
@@ -1209,22 +1209,22 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, size_t wBufferLen
if (aValid) {
ppro->debugLogA("Received user avatar, storing (%d bytes).", datalen);
- const TCHAR *ptszExt;
+ const wchar_t *ptszExt;
int dwPaFormat = ProtoGetBufferFormat(pBuffer, &ptszExt);
- TCHAR tszImageFile[MAX_PATH];
+ wchar_t tszImageFile[MAX_PATH];
mir_sntprintf(tszImageFile, L"%s%s", pCookieData->szFile, ptszExt);
ppro->setByte(pCookieData->hContact, "AvatarType", (BYTE)dwPaFormat);
ai.format = dwPaFormat; // set the format
mir_tstrncpy(ai.filename, tszImageFile, _countof(ai.filename));
- int out = _topen(tszImageFile, _O_BINARY | _O_CREAT | _O_TRUNC | _O_WRONLY, _S_IREAD | _S_IWRITE);
+ int out = _wopen(tszImageFile, _O_BINARY | _O_CREAT | _O_TRUNC | _O_WRONLY, _S_IREAD | _S_IWRITE);
if (out != -1) {
_write(out, pBuffer, (int)datalen);
_close(out);
if (!pCookieData->hContact) { // our avatar, set filename
- TCHAR tmp[MAX_PATH * 2];
+ wchar_t tmp[MAX_PATH * 2];
PathToRelativeT(tszImageFile, tmp);
ppro->setTString(NULL, "AvatarFile", tmp);
}
diff --git a/protocols/IcqOscarJ/src/icq_avatar.h b/protocols/IcqOscarJ/src/icq_avatar.h
index 5ba1e03c79..d0346b229b 100644
--- a/protocols/IcqOscarJ/src/icq_avatar.h
+++ b/protocols/IcqOscarJ/src/icq_avatar.h
@@ -84,7 +84,7 @@ public:
__inline BOOL isPending() { return !isLoggedIn; };
__inline BOOL isReady() { return isLoggedIn && isActive && !stopThread; };
- DWORD sendGetAvatarRequest(MCONTACT hContact, DWORD dwUin, char *szUid, const BYTE *hash, size_t hashlen, const TCHAR *file);
+ DWORD sendGetAvatarRequest(MCONTACT hContact, DWORD dwUin, char *szUid, const BYTE *hash, size_t hashlen, const wchar_t *file);
DWORD sendUploadAvatarRequest(MCONTACT hContact, WORD wRef, const BYTE *data, size_t datalen);
};
@@ -96,7 +96,7 @@ struct avatars_request : public MZeroedObject
uid_str szUid;
BYTE *hash;
size_t hashlen;
- TCHAR *szFile;
+ wchar_t *szFile;
BYTE *pData;
size_t cbData;
WORD wRef;
@@ -111,8 +111,8 @@ public:
#define ART_UPLOAD 2
#define ART_BLOCK 4
-void AddAvatarExt(int dwFormat, TCHAR *pszDest);
+void AddAvatarExt(int dwFormat, wchar_t *pszDest);
-BYTE* calcMD5HashOfFile(const TCHAR *szFile);
+BYTE* calcMD5HashOfFile(const wchar_t *szFile);
#endif /* __ICQ_AVATAR_H */
diff --git a/protocols/IcqOscarJ/src/icq_filerequests.cpp b/protocols/IcqOscarJ/src/icq_filerequests.cpp
index 6dd10110d6..e993445c08 100644
--- a/protocols/IcqOscarJ/src/icq_filerequests.cpp
+++ b/protocols/IcqOscarJ/src/icq_filerequests.cpp
@@ -152,18 +152,18 @@ void CIcqProto::handleFileRequest(PBYTE buf, DWORD dwUin, DWORD dwCookie, DWORD
ft->bEmptyDesc = bEmptyDesc;
// Send chain event
- TCHAR* ptszFileName = mir_utf8decodeT(pszFileName);
+ wchar_t* ptszFileName = mir_utf8decodeT(pszFileName);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
pre.fileCount = 1;
pre.timestamp = time(NULL);
- pre.descr.t = mir_utf8decodeT(pszDescription);
- pre.files.t = &ptszFileName;
+ pre.descr.w = mir_utf8decodeT(pszDescription);
+ pre.files.w = &ptszFileName;
pre.lParam = (LPARAM)ft;
ProtoChainRecvFile(hContact, &pre);
- mir_free(pre.descr.t);
+ mir_free(pre.descr.w);
mir_free(ptszFileName);
}
diff --git a/protocols/IcqOscarJ/src/icq_opts.cpp b/protocols/IcqOscarJ/src/icq_opts.cpp
index 36c1c1bfb0..a767d5987a 100644
--- a/protocols/IcqOscarJ/src/icq_opts.cpp
+++ b/protocols/IcqOscarJ/src/icq_opts.cpp
@@ -29,12 +29,12 @@
extern BOOL bPopupService;
-static const TCHAR* szLogLevelDescr[] = {
- LPGENT("Display all problems"),
- LPGENT("Display problems causing possible loss of data"),
- LPGENT("Display explanations for disconnection"),
- LPGENT("Display problems requiring user intervention"),
- LPGENT("Do not display any problems (not recommended)")
+static const wchar_t* szLogLevelDescr[] = {
+ LPGENW("Display all problems"),
+ LPGENW("Display problems causing possible loss of data"),
+ LPGENW("Display explanations for disconnection"),
+ LPGENW("Display problems requiring user intervention"),
+ LPGENW("Do not display any problems (not recommended)")
};
static void LoadDBCheckState(CIcqProto* ppro, HWND hwndDlg, int idCtrl, const char* szSetting, BYTE bDef)
@@ -511,27 +511,27 @@ int CIcqProto::OnOptionsInit(WPARAM wParam, LPARAM)
OPTIONSDIALOGPAGE odp = { 0 };
odp.position = -800000000;
odp.hInstance = hInst;
- odp.ptszGroup = LPGENT("Network");
+ odp.pwszGroup = LPGENW("Network");
odp.dwInitParam = LPARAM(this);
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.ptszTab = LPGENT("Account");
+ odp.pwszTab = LPGENW("Account");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ICQ);
odp.pfnDlgProc = DlgProcIcqOpts;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Contacts");
+ odp.pwszTab = LPGENW("Contacts");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ICQCONTACTS);
odp.pfnDlgProc = DlgProcIcqContactsOpts;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Features");
+ odp.pwszTab = LPGENW("Features");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ICQFEATURES);
odp.pfnDlgProc = DlgProcIcqFeaturesOpts;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Privacy");
+ odp.pwszTab = LPGENW("Privacy");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ICQPRIVACY);
odp.pfnDlgProc = DlgProcIcqPrivacyOpts;
Options_AddPage(wParam, &odp);
@@ -541,8 +541,8 @@ int CIcqProto::OnOptionsInit(WPARAM wParam, LPARAM)
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_POPUPS);
odp.groupPosition = 900000000;
odp.pfnDlgProc = DlgProcIcqPopupOpts;
- odp.ptszGroup = LPGENT("Popups");
- odp.ptszTab = NULL;
+ odp.pwszGroup = LPGENW("Popups");
+ odp.pwszTab = NULL;
Options_AddPage(wParam, &odp);
}
return 0;
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp
index 12694a3763..7843f50a10 100644
--- a/protocols/IcqOscarJ/src/icq_proto.cpp
+++ b/protocols/IcqOscarJ/src/icq_proto.cpp
@@ -70,7 +70,7 @@ static int CompareContactsCache(const icq_contacts_cache *p1, const icq_contacts
return mir_strcmpi(p1->szUid, p2->szUid);
}
-CIcqProto::CIcqProto(const char* aProtoName, const TCHAR* aUserName) :
+CIcqProto::CIcqProto(const char* aProtoName, const wchar_t* aUserName) :
PROTO<CIcqProto>(aProtoName, aUserName),
cookies(10, CompareCookies),
directConns(10, CompareConns),
@@ -157,7 +157,7 @@ CIcqProto::CIcqProto(const char* aProtoName, const TCHAR* aUserName) :
// Register netlib users
NETLIBUSER nlu = { 0 };
- TCHAR szBuffer[MAX_PATH + 64];
+ wchar_t szBuffer[MAX_PATH + 64];
mir_sntprintf(szBuffer, TranslateT("%s server connection"), m_tszUserName);
nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
@@ -292,17 +292,17 @@ MCONTACT CIcqProto::AddToList(int flags, PROTOSEARCHRESULT *psr)
// aim contact
if (isr->hdr.flags & PSR_UNICODE)
- unicode_to_ansi_static((WCHAR*)isr->hdr.id.t, szUid, MAX_PATH);
+ unicode_to_ansi_static((WCHAR*)isr->hdr.id.w, szUid, MAX_PATH);
else
- null_strcpy(szUid, (char*)isr->hdr.id.t, MAX_PATH);
+ null_strcpy(szUid, (char*)isr->hdr.id.w, MAX_PATH);
return (szUid[0] == 0) ? 0 : AddToListByUID(szUid, flags);
}
if (psr->flags & PSR_UNICODE)
- unicode_to_ansi_static((WCHAR*)psr->id.t, szUid, MAX_PATH);
+ unicode_to_ansi_static((WCHAR*)psr->id.w, szUid, MAX_PATH);
else
- null_strcpy(szUid, (char*)psr->id.t, MAX_PATH);
+ null_strcpy(szUid, (char*)psr->id.w, MAX_PATH);
if (szUid[0] == 0)
return 0;
@@ -400,7 +400,7 @@ int CIcqProto::Authorize(MEVENT hDbEvent)
////////////////////////////////////////////////////////////////////////////////////////
// PS_AuthDeny - handles the unsuccessful authorization
-int CIcqProto::AuthDeny(MEVENT hDbEvent, const TCHAR* szReason)
+int CIcqProto::AuthDeny(MEVENT hDbEvent, const wchar_t* szReason)
{
if (icqOnline() && hDbEvent) {
MCONTACT hContact = HContactFromAuthEvent(hDbEvent);
@@ -437,7 +437,7 @@ int __cdecl CIcqProto::AuthRecv(MCONTACT hContact, PROTORECVEVENT* pre)
////////////////////////////////////////////////////////////////////////////////////////
// PSS_AUTHREQUEST
-int __cdecl CIcqProto::AuthRequest(MCONTACT hContact, const TCHAR* szMessage)
+int __cdecl CIcqProto::AuthRequest(MCONTACT hContact, const wchar_t* szMessage)
{
if (!icqOnline())
return 1;
@@ -463,7 +463,7 @@ int __cdecl CIcqProto::AuthRequest(MCONTACT hContact, const TCHAR* szMessage)
////////////////////////////////////////////////////////////////////////////////////////
// PS_FileAllow - starts a file transfer
-HANDLE __cdecl CIcqProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath)
+HANDLE __cdecl CIcqProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath)
{
DWORD dwUin;
uid_str szUid;
@@ -533,7 +533,7 @@ int __cdecl CIcqProto::FileCancel(MCONTACT hContact, HANDLE hTransfer)
////////////////////////////////////////////////////////////////////////////////////////
// PS_FileDeny - denies a file transfer
-int __cdecl CIcqProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason)
+int __cdecl CIcqProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason)
{
int nReturnValue = 1;
basic_filetransfer *bft = (basic_filetransfer*)hTransfer;
@@ -573,7 +573,7 @@ int __cdecl CIcqProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR
////////////////////////////////////////////////////////////////////////////////////////
// PS_FileResume - processes file renaming etc
-int __cdecl CIcqProto::FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename)
+int __cdecl CIcqProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename)
{
if (icqOnline() && hTransfer) {
basic_filetransfer *ft = (basic_filetransfer *)hTransfer;
@@ -720,10 +720,10 @@ void CIcqProto::CheekySearchThread(void*)
if (cheekySearchUin) {
_itoa(cheekySearchUin, szUin, 10);
- isr.hdr.id.t = (TCHAR*)szUin;
+ isr.hdr.id.w = (wchar_t*)szUin;
}
else {
- isr.hdr.id.t = (TCHAR*)cheekySearchUid;
+ isr.hdr.id.w = (wchar_t*)cheekySearchUid;
}
isr.uin = cheekySearchUin;
@@ -733,7 +733,7 @@ void CIcqProto::CheekySearchThread(void*)
}
-HANDLE __cdecl CIcqProto::SearchBasic(const TCHAR *pszSearch)
+HANDLE __cdecl CIcqProto::SearchBasic(const wchar_t *pszSearch)
{
if (mir_wstrlen(pszSearch) == 0)
return 0;
@@ -791,7 +791,7 @@ HANDLE __cdecl CIcqProto::SearchBasic(const TCHAR *pszSearch)
////////////////////////////////////////////////////////////////////////////////////////
// SearchByEmail - searches the contact by its e-mail
-HANDLE __cdecl CIcqProto::SearchByEmail(const TCHAR *email)
+HANDLE __cdecl CIcqProto::SearchByEmail(const wchar_t *email)
{
if (email && icqOnline() && mir_wstrlen(email) > 0) {
char *szEmail = tchar_to_ansi(email);
@@ -814,7 +814,7 @@ HANDLE __cdecl CIcqProto::SearchByEmail(const TCHAR *email)
////////////////////////////////////////////////////////////////////////////////////////
// PS_SearchByName - searches the contact by its first or last name, or by a nickname
-HANDLE __cdecl CIcqProto::SearchByName(const TCHAR *nick, const TCHAR *firstName, const TCHAR *lastName)
+HANDLE __cdecl CIcqProto::SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName)
{
if (icqOnline()) {
if (nick || firstName || lastName) {
@@ -873,15 +873,15 @@ int __cdecl CIcqProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre)
DWORD flags = DBEF_UTF;
for (i = 0; i < pre->lParam; i++) {
- cbBlob += mir_strlen((char*)isrList[i]->hdr.nick.t) + 2; // both trailing zeros
+ cbBlob += mir_strlen((char*)isrList[i]->hdr.nick.w) + 2; // both trailing zeros
if (isrList[i]->uin)
cbBlob += getUINLen(isrList[i]->uin);
else
- cbBlob += mir_strlen((char*)isrList[i]->hdr.id.t);
+ cbBlob += mir_strlen((char*)isrList[i]->hdr.id.w);
}
PBYTE pBlob = (PBYTE)_alloca(cbBlob), pCurBlob;
for (i = 0, pCurBlob = pBlob; i < pre->lParam; i++) {
- mir_strcpy((char*)pCurBlob, (char*)isrList[i]->hdr.nick.t);
+ mir_strcpy((char*)pCurBlob, (char*)isrList[i]->hdr.nick.w);
pCurBlob += mir_strlen((char*)pCurBlob) + 1;
if (isrList[i]->uin) {
char szUin[UINMAXLEN];
@@ -889,7 +889,7 @@ int __cdecl CIcqProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre)
mir_strcpy((char*)pCurBlob, szUin);
}
else // aim contact
- mir_strcpy((char*)pCurBlob, (char*)isrList[i]->hdr.id.t);
+ mir_strcpy((char*)pCurBlob, (char*)isrList[i]->hdr.id.w);
pCurBlob += mir_strlen((char*)pCurBlob) + 1;
}
@@ -1157,7 +1157,7 @@ int __cdecl CIcqProto::SendContacts(MCONTACT hContact, int, int nContacts, MCONT
////////////////////////////////////////////////////////////////////////////////////////
// SendFile - sends a file
-HANDLE __cdecl CIcqProto::SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles)
+HANDLE __cdecl CIcqProto::SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles)
{
if (!icqOnline())
return 0;
@@ -1191,7 +1191,7 @@ HANDLE __cdecl CIcqProto::SendFile(MCONTACT hContact, const TCHAR* szDescription
for (i = 0; i < (int)ft->dwFileCount; i++) {
ft->pszFiles[i] = (ppszFiles[i]) ? tchar_to_utf8(ppszFiles[i]) : NULL;
- if (_tstat(ppszFiles[i], &statbuf))
+ if (_wstat(ppszFiles[i], &statbuf))
debugLogA("IcqSendFile() was passed invalid filename(s)");
else
ft->dwTotalSize += statbuf.st_size;
@@ -1644,7 +1644,7 @@ void __cdecl CIcqProto::GetAwayMsgThread(void *pStatusData)
setStatusMsgVar(pThreadData->hContact, pThreadData->szMessage, false);
- TCHAR *tszMsg = mir_utf8decodeT(pThreadData->szMessage);
+ wchar_t *tszMsg = mir_utf8decodeT(pThreadData->szMessage);
ProtoBroadcastAck(pThreadData->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, pThreadData->hProcess, (LPARAM)tszMsg);
mir_free(tszMsg);
@@ -1743,7 +1743,7 @@ int __cdecl CIcqProto::RecvAwayMsg(MCONTACT hContact, int, PROTORECVEVENT* evt)
{
setStatusMsgVar(hContact, evt->szMessage, false);
- TCHAR* pszMsg = mir_utf8decodeT(evt->szMessage);
+ wchar_t* pszMsg = mir_utf8decodeT(evt->szMessage);
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)evt->lParam, (LPARAM)pszMsg);
mir_free(pszMsg);
return 0;
@@ -1753,7 +1753,7 @@ int __cdecl CIcqProto::RecvAwayMsg(MCONTACT hContact, int, PROTORECVEVENT* evt)
////////////////////////////////////////////////////////////////////////////////////////
// PS_SetAwayMsg - sets the away status message
-int __cdecl CIcqProto::SetAwayMsg(int status, const TCHAR* msg)
+int __cdecl CIcqProto::SetAwayMsg(int status, const wchar_t* msg)
{
mir_cslock l(m_modeMsgsMutex);
diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h
index 97ca496006..3c5da05d35 100644
--- a/protocols/IcqOscarJ/src/icq_proto.h
+++ b/protocols/IcqOscarJ/src/icq_proto.h
@@ -47,7 +47,7 @@ struct userinfo
struct CIcqProto : public PROTO<CIcqProto>
{
- CIcqProto(const char*, const TCHAR*);
+ CIcqProto(const char*, const wchar_t*);
~CIcqProto();
//====================================================================================
@@ -58,21 +58,21 @@ struct CIcqProto : public PROTO<CIcqProto>
virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, MEVENT hDbEvent);
virtual int __cdecl Authorize(MEVENT hDbEvent);
- virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR *szReason);
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t *szReason);
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage);
+ virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t *szMessage);
- virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath);
+ virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath);
virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason);
- virtual int __cdecl FileResume( HANDLE hTransfer, int *action, const TCHAR **szFilename);
+ virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szReason);
+ virtual int __cdecl FileResume( HANDLE hTransfer, int *action, const wchar_t **szFilename);
virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
virtual int __cdecl GetInfo(MCONTACT hContact, int infoType);
- virtual HANDLE __cdecl SearchBasic(const TCHAR *id);
- virtual HANDLE __cdecl SearchByEmail(const TCHAR *email);
- virtual HANDLE __cdecl SearchByName(const TCHAR *nick, const TCHAR *firstName, const TCHAR *lastName);
+ virtual HANDLE __cdecl SearchBasic(const wchar_t *id);
+ virtual HANDLE __cdecl SearchByEmail(const wchar_t *email);
+ virtual HANDLE __cdecl SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName);
virtual HWND __cdecl SearchAdvanced(HWND owner);
virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
@@ -80,7 +80,7 @@ struct CIcqProto : public PROTO<CIcqProto>
virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*);
virtual int __cdecl SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList);
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles);
+ virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles);
virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char *msg);
virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char *url);
@@ -89,7 +89,7 @@ struct CIcqProto : public PROTO<CIcqProto>
virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT *evt);
- virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg);
+ virtual int __cdecl SetAwayMsg(int m_iStatus, const wchar_t *msg);
virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
@@ -392,12 +392,12 @@ struct CIcqProto : public PROTO<CIcqProto>
void handleAvatarOwnerHash(BYTE bFlags, BYTE *pData, size_t nDataLen);
void handleAvatarContactHash(DWORD dwUIN, char *szUID, MCONTACT hContact, BYTE *pHash, size_t nHashLen);
- TCHAR* GetOwnAvatarFileName();
- void GetFullAvatarFileName(int dwUin, const char *szUid, int dwFormat, TCHAR *pszDest, size_t cbLen);
- void GetAvatarFileName(int dwUin, const char *szUid, TCHAR *pszDest, size_t cbLen);
+ wchar_t* GetOwnAvatarFileName();
+ void GetFullAvatarFileName(int dwUin, const char *szUid, int dwFormat, wchar_t *pszDest, size_t cbLen);
+ void GetAvatarFileName(int dwUin, const char *szUid, wchar_t *pszDest, size_t cbLen);
int IsAvatarChanged(MCONTACT hContact, const BYTE *pHash, size_t nHashLen);
- int GetAvatarData(MCONTACT hContact, DWORD dwUin, const char *szUid, const BYTE *hash, size_t hashlen, const TCHAR *file);
+ int GetAvatarData(MCONTACT hContact, DWORD dwUin, const char *szUid, const BYTE *hash, size_t hashlen, const wchar_t *file);
int SetAvatarData(MCONTACT hContact, WORD wRef, const BYTE *data, size_t datalen);
void StartAvatarThread(HANDLE hConn, char* cookie, size_t cookieLen);
@@ -715,7 +715,7 @@ struct CIcqProto : public PROTO<CIcqProto>
void icq_sendRevokeAuthServ(DWORD dwUin, char *szUid);
void icq_sendGrantAuthServ(DWORD dwUin, const char *szUid, const char *szMsg);
void icq_sendAuthReqServ(DWORD dwUin, char* szUid, const char *szMsg);
- void icq_sendAuthResponseServ(DWORD dwUin, char* szUid,int auth,const TCHAR *szReason);
+ void icq_sendAuthResponseServ(DWORD dwUin, char* szUid,int auth,const wchar_t *szReason);
void icq_sendYouWereAddedServ(DWORD,DWORD);
DWORD sendDirectorySearchPacket(const BYTE *pSearchData, size_t wDataLen, WORD wPage, BOOL bOnlineUsersOnly);
@@ -823,11 +823,11 @@ struct CIcqProto : public PROTO<CIcqProto>
void handleRecvServMsgOFT(BYTE *buf, size_t wLen, DWORD dwUin, char *szUID, DWORD dwID1, DWORD dwID2, WORD wCommand);
void handleRecvServResponseOFT(BYTE *buf, size_t wLen, DWORD dwUin, char *szUID, void* ft);
- HANDLE oftInitTransfer(MCONTACT hContact, DWORD dwUin, char *szUid, const TCHAR **pszFiles, const TCHAR *szDescription);
- HANDLE oftFileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath);
- DWORD oftFileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason);
+ HANDLE oftInitTransfer(MCONTACT hContact, DWORD dwUin, char *szUid, const wchar_t **pszFiles, const wchar_t *szDescription);
+ HANDLE oftFileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath);
+ DWORD oftFileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szReason);
DWORD oftFileCancel(MCONTACT hContact, HANDLE hTransfer);
- void oftFileResume(oscar_filetransfer *ft, int action, const TCHAR *szFilename);
+ void oftFileResume(oscar_filetransfer *ft, int action, const wchar_t *szFilename);
void sendOscarPacket(oscar_connection *oc, icq_packet *packet);
void handleOFT2FramePacket(oscar_connection *oc, WORD datatype, BYTE *pBuffer, size_t wLen);
diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp
index 0769d7b69c..4c91d239ac 100644
--- a/protocols/IcqOscarJ/src/icq_servlist.cpp
+++ b/protocols/IcqOscarJ/src/icq_servlist.cpp
@@ -1377,11 +1377,11 @@ int CIcqProto::getCListGroupExists(const char *szGroup)
return 0;
size_t size = mir_strlen(szGroup) + 2;
- TCHAR *tszGroup = (TCHAR*)_alloca(size * sizeof(TCHAR));
+ wchar_t *tszGroup = (wchar_t*)_alloca(size * sizeof(wchar_t));
if (utf8_to_tchar_static(szGroup, tszGroup, size))
for (int i = 1; TRUE; i++) {
- TCHAR *tszGroupName = (TCHAR*)Clist_GroupGetName(i, NULL);
+ wchar_t *tszGroupName = (wchar_t*)Clist_GroupGetName(i, NULL);
if (!tszGroupName)
break;
diff --git a/protocols/IcqOscarJ/src/icq_uploadui.cpp b/protocols/IcqOscarJ/src/icq_uploadui.cpp
index fa1dbf5f52..b99b17b95e 100644
--- a/protocols/IcqOscarJ/src/icq_uploadui.cpp
+++ b/protocols/IcqOscarJ/src/icq_uploadui.cpp
@@ -826,7 +826,7 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg, UINT message, WPARAM wPa
CLCINFOITEM cii = { 0 };
cii.cbSize = sizeof(cii);
cii.flags = CLCIIF_GROUPFONT | CLCIIF_CHECKBOX;
- cii.pszText = TranslateT(LPGEN("** All contacts **"));
+ cii.pszText = TranslateT("** All contacts **");
hItemAll = (HANDLE)SendMessage(hClist, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
}
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp
index 3168d290ec..ecc192ac4d 100644
--- a/protocols/IcqOscarJ/src/icq_xstatus.cpp
+++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp
@@ -120,9 +120,9 @@ DWORD CIcqProto::requestXStatusDetails(MCONTACT hContact, BOOL bAllowDelay)
return -1; // delayed
}
-static HANDLE LoadXStatusIconLibrary(TCHAR *path, const TCHAR *sub)
+static HANDLE LoadXStatusIconLibrary(wchar_t *path, const wchar_t *sub)
{
- TCHAR* p = _tcsrchr(path, '\\');
+ wchar_t* p = wcsrchr(path, '\\');
HANDLE hLib;
mir_tstrcpy(p, sub);
@@ -137,9 +137,9 @@ static HANDLE LoadXStatusIconLibrary(TCHAR *path, const TCHAR *sub)
return hLib;
}
-static TCHAR* InitXStatusIconLibrary(TCHAR *buf, size_t buf_size)
+static wchar_t* InitXStatusIconLibrary(wchar_t *buf, size_t buf_size)
{
- TCHAR path[2 * MAX_PATH];
+ wchar_t path[2 * MAX_PATH];
HMODULE hXStatusIconsDLL;
// get miranda's exe path
@@ -851,12 +851,12 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus)
HGENMENU hRoot;
{
- TCHAR szItem[MAX_PATH + 64];
+ wchar_t szItem[MAX_PATH + 64];
mir_sntprintf(szItem, TranslateT("%s Custom Status"), m_tszUserName);
CMenuItem mi;
mi.root = pcli->pfnGetProtocolMenu(m_szModuleName);
- mi.name.t = szItem;
+ mi.name.w = szItem;
mi.position = 10001;
hRoot = Menu_AddStatusMenuItem(&mi, m_szModuleName);
}
@@ -889,12 +889,12 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus)
void InitXStatusIcons()
{
- TCHAR lib[2 * MAX_PATH] = { 0 };
+ wchar_t lib[2 * MAX_PATH] = { 0 };
SKINICONDESC sid = { 0 };
sid.section.a = "Protocols/" ICQ_PROTOCOL_NAME "/" LPGEN("Custom Status");
sid.flags = SIDF_PATH_TCHAR;
- sid.defaultFile.t = InitXStatusIconLibrary(lib, _countof(lib));
+ sid.defaultFile.w = InitXStatusIconLibrary(lib, _countof(lib));
for (int i = 0; i < XSTATUS_COUNT; i++) {
char szTemp[100];
diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp
index 268904a0a1..a2c40d3b83 100644
--- a/protocols/IcqOscarJ/src/icqosc_svcs.cpp
+++ b/protocols/IcqOscarJ/src/icqosc_svcs.cpp
@@ -66,7 +66,7 @@ static int LookupDatabaseSetting(const FieldNamesItem* table, int code, DBVARIAN
}
else if (type == DBVT_WCHAR) {
WCHAR* wtext = make_unicode_string(text);
- dbv->pwszVal = mir_wstrdup(TranslateW(wtext));
+ dbv->pwszVal = mir_wstrdup(TranslateTS(wtext));
dbv->type = DBVT_WCHAR;
SAFE_FREE((void**)&wtext);
}
@@ -348,7 +348,7 @@ INT_PTR CIcqProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
int dwPaFormat = getByte(pai->hContact, "AvatarType", PA_FORMAT_UNKNOWN);
if (dwPaFormat != PA_FORMAT_UNKNOWN) { // we know the format, test file
- TCHAR tszFile[MAX_PATH * 2 + 4];
+ wchar_t tszFile[MAX_PATH * 2 + 4];
GetFullAvatarFileName(dwUIN, szUID, dwPaFormat, tszFile, MAX_PATH * 2);
@@ -356,7 +356,7 @@ INT_PTR CIcqProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
pai->format = dwPaFormat;
if (!IsAvatarChanged(pai->hContact, dbv.pbVal, dbv.cpbVal)) { // hashes are the same
- if (_taccess(tszFile, 0) == 0) {
+ if (_waccess(tszFile, 0) == 0) {
db_free(&dbv);
return GAIR_SUCCESS; // we have found the avatar file, whoala
@@ -366,7 +366,7 @@ INT_PTR CIcqProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
if (IsAvatarChanged(pai->hContact, dbv.pbVal, dbv.cpbVal)) { // we didn't received the avatar before - this ensures we will not request avatar again and again
if ((wParam & GAIF_FORCE) != 0 && pai->hContact != 0) { // request avatar data
- TCHAR tszFile[MAX_PATH * 2 + 4];
+ wchar_t tszFile[MAX_PATH * 2 + 4];
GetAvatarFileName(dwUIN, szUID, tszFile, MAX_PATH * 2);
GetAvatarData(pai->hContact, dwUIN, szUID, dbv.pbVal, dbv.cpbVal, tszFile);
@@ -389,9 +389,9 @@ INT_PTR CIcqProto::GetMyAvatar(WPARAM wParam, LPARAM lParam)
if (!wParam) return -3;
- TCHAR *tszFile = GetOwnAvatarFileName();
- if (tszFile && !_taccess(tszFile, 0)) {
- _tcsncpy((TCHAR*)wParam, tszFile, (int)lParam);
+ wchar_t *tszFile = GetOwnAvatarFileName();
+ if (tszFile && !_waccess(tszFile, 0)) {
+ wcsncpy((wchar_t*)wParam, tszFile, (int)lParam);
SAFE_FREE(&tszFile);
return 0;
}
@@ -485,7 +485,7 @@ INT_PTR CIcqProto::SetMyAvatar(WPARAM, LPARAM lParam)
if (!m_bAvatarsEnabled || !m_bSsiEnabled)
return -2;
- TCHAR *tszFile = (TCHAR*)lParam;
+ wchar_t *tszFile = (wchar_t*)lParam;
if (tszFile) { // set file for avatar
int dwPaFormat = ::ProtoGetAvatarFileFormat(tszFile);
if (dwPaFormat != PA_FORMAT_XML) {
@@ -497,7 +497,7 @@ INT_PTR CIcqProto::SetMyAvatar(WPARAM, LPARAM lParam)
DeleteObject(avt);
}
- TCHAR tszMyFile[MAX_PATH + 1];
+ wchar_t tszMyFile[MAX_PATH + 1];
GetFullAvatarFileName(0, NULL, dwPaFormat, tszMyFile, MAX_PATH);
// if not in our storage, copy
@@ -522,7 +522,7 @@ INT_PTR CIcqProto::SetMyAvatar(WPARAM, LPARAM lParam)
if (setSettingBlob(NULL, "AvatarHash", ihash, 0x14))
debugLogA("Failed to save avatar hash.");
- TCHAR tmp[MAX_PATH];
+ wchar_t tmp[MAX_PATH];
PathToRelativeT(tszMyFile, tmp);
setTString(NULL, "AvatarFile", tmp);
SAFE_FREE((void**)&hash);
@@ -668,7 +668,7 @@ INT_PTR icq_getEventTextMissedMessage(WPARAM, LPARAM lParam)
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, pszText, (int)mir_strlen(pszText), pwszText, wchars);
- nRetVal = (INT_PTR)mir_wstrdup(TranslateW(pwszText));
+ nRetVal = (INT_PTR)mir_wstrdup(TranslateTS(pwszText));
}
else if (pEvent->datatype == DBVT_ASCIIZ)
nRetVal = (INT_PTR)mir_strdup(Translate(pszText));
diff --git a/protocols/IcqOscarJ/src/init.cpp b/protocols/IcqOscarJ/src/init.cpp
index 59794f946a..f45334019b 100644
--- a/protocols/IcqOscarJ/src/init.cpp
+++ b/protocols/IcqOscarJ/src/init.cpp
@@ -65,7 +65,7 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
/////////////////////////////////////////////////////////////////////////////////////////
-static PROTO_INTERFACE* icqProtoInit(const char* pszProtoName, const TCHAR* tszUserName)
+static PROTO_INTERFACE* icqProtoInit(const char* pszProtoName, const wchar_t* tszUserName)
{
CIcqProto *ppro = new CIcqProto(pszProtoName, tszUserName);
g_Instances.insert(ppro);
diff --git a/protocols/IcqOscarJ/src/log.cpp b/protocols/IcqOscarJ/src/log.cpp
index ee39798610..2556a1aa64 100644
--- a/protocols/IcqOscarJ/src/log.cpp
+++ b/protocols/IcqOscarJ/src/log.cpp
@@ -119,7 +119,7 @@ void CIcqProto::icq_LogUsingErrorCode(int level, DWORD dwError, const char *szMs
break;
default:
- TCHAR err[512];
+ wchar_t err[512];
if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwError, 0, err, _countof(err), NULL)) {
pszErrorMsg = make_utf8_string(err);
bNeedFree = TRUE;
diff --git a/protocols/IcqOscarJ/src/loginpassword.cpp b/protocols/IcqOscarJ/src/loginpassword.cpp
index 02cfbbd7eb..253bb1b843 100644
--- a/protocols/IcqOscarJ/src/loginpassword.cpp
+++ b/protocols/IcqOscarJ/src/loginpassword.cpp
@@ -40,7 +40,7 @@ INT_PTR CALLBACK LoginPasswdDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
{
DWORD dwUin = ppro->getContactUin(NULL);
- TCHAR pszUIN[MAX_PATH];
+ wchar_t pszUIN[MAX_PATH];
mir_sntprintf(pszUIN, TranslateT("Enter a password for UIN %u:"), dwUin);
SetDlgItemText(hwndDlg, IDC_INSTRUCTION, pszUIN);
diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
index 143a1e715e..be3dae1b0d 100644
--- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
+++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
@@ -497,18 +497,18 @@ void CIcqProto::handleRecvServMsgOFT(BYTE *buf, size_t wLen, DWORD dwUin, char *
mir_strcpy(szBlob + sizeof(DWORD), pszFileName);
mir_strcpy(szBlob + sizeof(DWORD) + mir_strlen(pszFileName) + 1, pszDescription);
- TCHAR* ptszFileName = mir_utf8decodeT(pszFileName);
+ wchar_t* ptszFileName = mir_utf8decodeT(pszFileName);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
pre.fileCount = 1;
pre.timestamp = time(NULL);
- pre.descr.t = mir_utf8decodeT(pszDescription);
- pre.files.t = &ptszFileName;
+ pre.descr.w = mir_utf8decodeT(pszDescription);
+ pre.files.w = &ptszFileName;
pre.lParam = (LPARAM)ft;
ProtoChainRecvFile(ft->hContact, &pre);
- mir_free(pre.descr.t);
+ mir_free(pre.descr.w);
mir_free(ptszFileName);
}
else if (wAckType == 2) { // First attempt failed, reverse requested
@@ -713,7 +713,7 @@ static char* oftGetFileContainer(oscar_filetransfer* oft, const char** files, in
}
-HANDLE CIcqProto::oftInitTransfer(MCONTACT hContact, DWORD dwUin, char* szUid, const TCHAR** files, const TCHAR* pszDesc)
+HANDLE CIcqProto::oftInitTransfer(MCONTACT hContact, DWORD dwUin, char* szUid, const wchar_t** files, const wchar_t* pszDesc)
{
int i, filesCount;
struct _stati64 statbuf;
@@ -728,7 +728,7 @@ HANDLE CIcqProto::oftInitTransfer(MCONTACT hContact, DWORD dwUin, char* szUid, c
for (filesCount = 0; files[filesCount]; filesCount++);
ft->files = (oft_file_record *)SAFE_MALLOC(sizeof(oft_file_record) * filesCount);
- ft->files_list = (char**)SAFE_MALLOC(sizeof(TCHAR *) * filesCount);
+ ft->files_list = (char**)SAFE_MALLOC(sizeof(wchar_t *) * filesCount);
ft->qwTotalSize = 0;
char **filesUtf = (char**)SAFE_MALLOC(sizeof(char *) * filesCount);
@@ -736,7 +736,7 @@ HANDLE CIcqProto::oftInitTransfer(MCONTACT hContact, DWORD dwUin, char* szUid, c
// Prepare files arrays
for (i = 0; i < filesCount; i++) {
- if (_tstati64(files[i], &statbuf))
+ if (_wstat64(files[i], &statbuf))
debugLogA("IcqSendFile() was passed invalid filename \"%s\"", files[i]);
else {
if (!(statbuf.st_mode & _S_IFDIR)) { // take only files
@@ -854,7 +854,7 @@ HANDLE CIcqProto::oftInitTransfer(MCONTACT hContact, DWORD dwUin, char* szUid, c
}
-HANDLE CIcqProto::oftFileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath)
+HANDLE CIcqProto::oftFileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath)
{
oscar_filetransfer *ft = (oscar_filetransfer*)hTransfer;
@@ -884,7 +884,7 @@ HANDLE CIcqProto::oftFileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR
return hTransfer; // Success
}
-DWORD CIcqProto::oftFileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR*)
+DWORD CIcqProto::oftFileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t*)
{
oscar_filetransfer *ft = (oscar_filetransfer*)hTransfer;
@@ -935,7 +935,7 @@ DWORD CIcqProto::oftFileCancel(MCONTACT hContact, HANDLE hTransfer)
return 0; // Success
}
-void CIcqProto::oftFileResume(oscar_filetransfer *ft, int action, const TCHAR *szFilename)
+void CIcqProto::oftFileResume(oscar_filetransfer *ft, int action, const wchar_t *szFilename)
{
int openFlags;
diff --git a/protocols/IcqOscarJ/src/stdpackets.cpp b/protocols/IcqOscarJ/src/stdpackets.cpp
index 108c482721..8a66eeb085 100644
--- a/protocols/IcqOscarJ/src/stdpackets.cpp
+++ b/protocols/IcqOscarJ/src/stdpackets.cpp
@@ -1547,7 +1547,7 @@ void CIcqProto::icq_sendAuthReqServ(DWORD dwUin, char *szUid, const char *szMsg)
sendServPacket(&packet);
}
-void CIcqProto::icq_sendAuthResponseServ(DWORD dwUin, char* szUid, int auth, const TCHAR *szReason)
+void CIcqProto::icq_sendAuthResponseServ(DWORD dwUin, char* szUid, int auth, const wchar_t *szReason)
{
BYTE nUinLen = getUIDLen(dwUin, szUid);
diff --git a/protocols/IcqOscarJ/src/userinfotab.cpp b/protocols/IcqOscarJ/src/userinfotab.cpp
index 75d2c8c054..207ff0fe32 100644
--- a/protocols/IcqOscarJ/src/userinfotab.cpp
+++ b/protocols/IcqOscarJ/src/userinfotab.cpp
@@ -273,14 +273,14 @@ int CIcqProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam)
odp.dwInitParam = LPARAM(this);
odp.pfnDlgProc = IcqDlgProc;
odp.position = -1900000000;
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_ICQ);
UserInfo_AddPage(wParam, &odp);
if (!lParam) {
- TCHAR buf[200];
+ wchar_t buf[200];
mir_sntprintf(buf, TranslateT("%s Details"), m_tszUserName);
- odp.ptszTitle = buf;
+ odp.pwszTitle = buf;
odp.position = -1899999999;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_CHANGEINFO);
diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp
index 85a3c36114..3e13e9efe1 100644
--- a/protocols/IcqOscarJ/src/utilities.cpp
+++ b/protocols/IcqOscarJ/src/utilities.cpp
@@ -570,7 +570,7 @@ char* NickFromHandleUtf(MCONTACT hContact)
if (hContact == INVALID_CONTACT_ID)
return ICQTranslateUtf(LPGEN("<invalid>"));
- return tchar_to_utf8((TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0));
+ return tchar_to_utf8((wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0));
}
char* strUID(DWORD dwUIN, char *pszUID)
@@ -1443,7 +1443,7 @@ char* __fastcall ICQTranslateUtf(const char *src)
{ // we can use unicode translate (0.5+)
WCHAR* usrc = make_unicode_string(src);
- szRes = make_utf8_string(TranslateW(usrc));
+ szRes = make_utf8_string(TranslateTS(usrc));
SAFE_FREE((void**)&usrc);
}
@@ -1455,7 +1455,7 @@ char* __fastcall ICQTranslateUtfStatic(const char *src, char *buf, size_t bufsiz
if (mir_strlen(src)) { // we can use unicode translate (0.5+)
WCHAR *usrc = make_unicode_string(src);
- make_utf8_string_static(TranslateW(usrc), buf, bufsize);
+ make_utf8_string_static(TranslateTS(usrc), buf, bufsize);
SAFE_FREE((void**)&usrc);
}
@@ -1541,7 +1541,7 @@ const char* ExtractFileName(const char *fullname)
}
-char* FileNameToUtf(const TCHAR *filename)
+char* FileNameToUtf(const wchar_t *filename)
{
WCHAR *usFileName = NULL;
int wchars = GetLongPathName(filename, usFileName, 0);
@@ -1555,10 +1555,10 @@ char* FileNameToUtf(const TCHAR *filename)
int FileAccessUtf(const char *path, int mode)
{
size_t size = mir_strlen(path) + 2;
- TCHAR *szPath = (TCHAR*)_alloca(size * sizeof(TCHAR));
+ wchar_t *szPath = (wchar_t*)_alloca(size * sizeof(wchar_t));
if (utf8_to_tchar_static(path, szPath, size))
- return _taccess(szPath, mode);
+ return _waccess(szPath, mode);
return -1;
}
@@ -1567,10 +1567,10 @@ int FileAccessUtf(const char *path, int mode)
int FileStatUtf(const char *path, struct _stati64 *buffer)
{
size_t size = mir_strlen(path) + 2;
- TCHAR *szPath = (TCHAR*)_alloca(size * sizeof(TCHAR));
+ wchar_t *szPath = (wchar_t*)_alloca(size * sizeof(wchar_t));
if (utf8_to_tchar_static(path, szPath, size))
- return _tstati64(szPath, buffer);
+ return _wstat64(szPath, buffer);
return -1;
}
@@ -1580,10 +1580,10 @@ int MakeDirUtf(const char *dir)
{
int wRes = -1;
size_t size = mir_strlen(dir) + 2;
- TCHAR *szDir = (TCHAR*)_alloca(size * sizeof(TCHAR));
+ wchar_t *szDir = (wchar_t*)_alloca(size * sizeof(wchar_t));
- if (utf8_to_tchar_static(dir, szDir, size)) { // _tmkdir can created only one dir at once
- wRes = _tmkdir(szDir);
+ if (utf8_to_tchar_static(dir, szDir, size)) { // _wmkdir can created only one dir at once
+ wRes = _wmkdir(szDir);
// check if dir not already existed - return success if yes
if (wRes == -1 && errno == 17 /* EEXIST */)
wRes = 0;
@@ -1595,7 +1595,7 @@ int MakeDirUtf(const char *dir)
*szLast = '\0';
if (!MakeDirUtf(dir))
- wRes = _tmkdir(szDir);
+ wRes = _wmkdir(szDir);
*szLast = cOld;
}
@@ -1609,10 +1609,10 @@ int MakeDirUtf(const char *dir)
int OpenFileUtf(const char *filename, int oflag, int pmode)
{
size_t size = mir_strlen(filename) + 2;
- TCHAR *szFile = (TCHAR*)_alloca(size * sizeof(TCHAR));
+ wchar_t *szFile = (wchar_t*)_alloca(size * sizeof(wchar_t));
if (utf8_to_tchar_static(filename, szFile, size))
- return _topen(szFile, oflag, pmode);
+ return _wopen(szFile, oflag, pmode);
return -1;
}
@@ -1636,7 +1636,7 @@ void SetWindowTextUcs(HWND hWnd, WCHAR *text)
char* GetWindowTextUtf(HWND hWnd)
{
int nLen = GetWindowTextLength(hWnd);
- TCHAR *szText = (TCHAR*)_alloca((nLen + 2) * sizeof(TCHAR));
+ wchar_t *szText = (wchar_t*)_alloca((nLen + 2) * sizeof(wchar_t));
GetWindowText(hWnd, szText, nLen + 1);
@@ -1653,7 +1653,7 @@ char* GetDlgItemTextUtf(HWND hwndDlg, int iItem)
void SetWindowTextUtf(HWND hWnd, const char *szText)
{
size_t size = mir_strlen(szText) + 2;
- TCHAR *tszText = (TCHAR*)_alloca(size * sizeof(TCHAR));
+ wchar_t *tszText = (wchar_t*)_alloca(size * sizeof(wchar_t));
if (utf8_to_tchar_static(szText, tszText, size))
SetWindowText(hWnd, tszText);
diff --git a/protocols/IcqOscarJ/src/utilities.h b/protocols/IcqOscarJ/src/utilities.h
index 783ff2fea7..119ebe79eb 100644
--- a/protocols/IcqOscarJ/src/utilities.h
+++ b/protocols/IcqOscarJ/src/utilities.h
@@ -108,7 +108,7 @@ WORD GetMyStatusFlags();
int IsValidRelativePath(const char *filename);
LPCSTR ExtractFileName(const char *fullname);
-char* FileNameToUtf(const TCHAR *filename);
+char* FileNameToUtf(const wchar_t *filename);
int FileAccessUtf(const char *path, int mode);
int FileStatUtf(const char *path, struct _stati64 *buffer);
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp
index 3c5f4e165a..75c4f3dfab 100644
--- a/protocols/JabberG/src/jabber.cpp
+++ b/protocols/JabberG/src/jabber.cpp
@@ -44,7 +44,7 @@ CHAT_MANAGER *pci;
int g_cbCountries;
CountryListEntry *g_countries;
-TCHAR szCoreVersion[100];
+wchar_t szCoreVersion[100];
PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
@@ -126,10 +126,10 @@ static int OnModulesLoaded(WPARAM, LPARAM)
// init fontservice for info frame
FontIDT fontid = { 0 };
fontid.cbSize = sizeof(fontid);
- _tcsncpy_s(fontid.group, LPGENT("Jabber"), _TRUNCATE);
+ wcsncpy_s(fontid.group, LPGENW("Jabber"), _TRUNCATE);
strncpy_s(fontid.dbSettingsGroup, GLOBAL_SETTING_MODULE, _TRUNCATE);
- _tcsncpy_s(fontid.backgroundGroup, L"Jabber", _TRUNCATE);
- _tcsncpy_s(fontid.backgroundName, L"Background", _TRUNCATE);
+ wcsncpy_s(fontid.backgroundGroup, L"Jabber", _TRUNCATE);
+ wcsncpy_s(fontid.backgroundName, L"Background", _TRUNCATE);
fontid.flags = FIDF_DEFAULTVALID;
fontid.deffontsettings.charset = DEFAULT_CHARSET;
@@ -138,22 +138,22 @@ static int OnModulesLoaded(WPARAM, LPARAM)
mir_tstrncpy(fontid.deffontsettings.szFace, L"MS Shell Dlg", _countof(fontid.deffontsettings.szFace));
fontid.deffontsettings.style = 0;
- _tcsncpy_s(fontid.name, LPGENT("Frame title"), _TRUNCATE);
+ wcsncpy_s(fontid.name, LPGENW("Frame title"), _TRUNCATE);
strncpy_s(fontid.prefix, "fntFrameTitle", _TRUNCATE);
fontid.deffontsettings.style = DBFONTF_BOLD;
FontRegisterT(&fontid);
- _tcsncpy_s(fontid.name, LPGENT("Frame text"), _TRUNCATE);
+ wcsncpy_s(fontid.name, LPGENW("Frame text"), _TRUNCATE);
strncpy_s(fontid.prefix, "fntFrameClock", _TRUNCATE);
fontid.deffontsettings.style = 0;
FontRegisterT(&fontid);
ColourIDT colourid = {0};
colourid.cbSize = sizeof(colourid);
- _tcsncpy_s(colourid.group, L"Jabber", _TRUNCATE);
+ wcsncpy_s(colourid.group, L"Jabber", _TRUNCATE);
strncpy_s(colourid.dbSettingsGroup, GLOBAL_SETTING_MODULE, _TRUNCATE);
- _tcsncpy_s(colourid.name, L"Background", _TRUNCATE);
+ wcsncpy_s(colourid.name, L"Background", _TRUNCATE);
strncpy_s(colourid.setting, "clFrameBack", _TRUNCATE);
colourid.defcolour = GetSysColor(COLOR_WINDOW);
ColourRegisterT(&colourid);
@@ -164,7 +164,7 @@ static int OnModulesLoaded(WPARAM, LPARAM)
///////////////////////////////////////////////////////////////////////////////
// OnLoad - initialize the plugin instance
-static CJabberProto* jabberProtoInit(const char* pszProtoName, const TCHAR *tszUserName)
+static CJabberProto* jabberProtoInit(const char* pszProtoName, const wchar_t *tszUserName)
{
CJabberProto *ppro = new CJabberProto(pszProtoName, tszUserName);
g_Instances.insert(ppro);
@@ -233,7 +233,7 @@ extern "C" int __declspec(dllexport) Unload(void)
DestroyHookableEvent(hDiscoInfoResult);
if (g_nTempFileId != 0) {
- TCHAR tszTempPath[MAX_PATH], tszFilePath[MAX_PATH];
+ wchar_t tszTempPath[MAX_PATH], tszFilePath[MAX_PATH];
GetTempPath(_countof(tszTempPath), tszTempPath);
mir_sntprintf(tszFilePath, L"%sjab*.tmp.*", tszTempPath);
diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp
index 045c72c092..ea2d3c6748 100644
--- a/protocols/JabberG/src/jabber_adhoc.cpp
+++ b/protocols/JabberG/src/jabber_adhoc.cpp
@@ -106,13 +106,13 @@ void CJabberProto::OnIqResult_CommandExecution(HXML iqNode, CJabberIqInfo *pInfo
SendMessage(GetWindowFromIq(pInfo), JAHM_PROCESSRESULT, (WPARAM)xmlCopyNode(iqNode), 0);
}
-void CJabberProto::AdHoc_RequestListOfCommands(TCHAR * szResponder, HWND hwndDlg)
+void CJabberProto::AdHoc_RequestListOfCommands(wchar_t * szResponder, HWND hwndDlg)
{
m_ThreadInfo->send(XmlNodeIq(AddIQ(&CJabberProto::OnIqResult_ListOfCommands, JABBER_IQ_TYPE_GET, szResponder, 0, -1, hwndDlg))
<< XQUERY(JABBER_FEAT_DISCO_ITEMS) << XATTR(L"node", JABBER_FEAT_COMMANDS));
}
-int CJabberProto::AdHoc_ExecuteCommand(HWND hwndDlg, TCHAR*, JabberAdHocData* dat)
+int CJabberProto::AdHoc_ExecuteCommand(HWND hwndDlg, wchar_t*, JabberAdHocData* dat)
{
for (int i = 1;; i++) {
HXML itemNode = XmlGetNthChild(dat->CommandsNode, L"item", i);
@@ -122,9 +122,9 @@ int CJabberProto::AdHoc_ExecuteCommand(HWND hwndDlg, TCHAR*, JabberAdHocData* da
if (BST_UNCHECKED == IsDlgButtonChecked(GetDlgItem(hwndDlg, IDC_FRAME), i))
continue;
- const TCHAR *node = XmlGetAttrValue(itemNode, L"node");
+ const wchar_t *node = XmlGetAttrValue(itemNode, L"node");
if (node) {
- const TCHAR *jid2 = XmlGetAttrValue(itemNode, L"jid");
+ const wchar_t *jid2 = XmlGetAttrValue(itemNode, L"jid");
m_ThreadInfo->send(
XmlNodeIq(AddIQ(&CJabberProto::OnIqResult_CommandExecution, JABBER_IQ_TYPE_SET, jid2, 0, -1, hwndDlg))
<< XCHILDNS(L"command", JABBER_FEAT_COMMANDS) << XATTR(L"node", node) << XATTR(L"action", L"execute"));
@@ -142,12 +142,12 @@ int CJabberProto::AdHoc_ExecuteCommand(HWND hwndDlg, TCHAR*, JabberAdHocData* da
int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, HXML iqNode, JabberAdHocData* dat)
{
int nodeIdx = 0;
- const TCHAR * type = XmlGetAttrValue(iqNode, L"type");
+ const wchar_t * type = XmlGetAttrValue(iqNode, L"type");
if (!type || !mir_tstrcmp(type, L"error")) {
// error occurred here
- TCHAR buff[255];
- const TCHAR *code = NULL;
- const TCHAR *description = NULL;
+ wchar_t buff[255];
+ const wchar_t *code = NULL;
+ const wchar_t *description = NULL;
HXML errorNode = XmlGetChild(iqNode, "error");
if (errorNode) {
@@ -165,8 +165,8 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, HXML iqNode, Jabbe
SetScrollPos(GetDlgItem(hwndDlg, IDC_VSCROLL), SB_CTL, 0, FALSE);
HXML queryNode = XmlGetChild(iqNode, "query");
if (queryNode) {
- const TCHAR *xmlns = XmlGetAttrValue(queryNode, L"xmlns");
- const TCHAR *node = XmlGetAttrValue(queryNode, L"node");
+ const wchar_t *xmlns = XmlGetAttrValue(queryNode, L"xmlns");
+ const wchar_t *node = XmlGetAttrValue(queryNode, L"node");
if (xmlns && node && !mir_tstrcmp(xmlns, JABBER_FEAT_DISCO_ITEMS) && !mir_tstrcmp(node, JABBER_FEAT_COMMANDS))
validResponse = TRUE;
}
@@ -179,7 +179,7 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, HXML iqNode, Jabbe
if (!itemNode)
break;
- const TCHAR *name = XmlGetAttrValue(itemNode, L"name");
+ const wchar_t *name = XmlGetAttrValue(itemNode, L"name");
if (!name) name = XmlGetAttrValue(itemNode, L"node");
ypos = AdHoc_AddCommandRadio(GetDlgItem(hwndDlg, IDC_FRAME), TranslateTS(name), nodeIdx, ypos, (nodeIdx == 1) ? 1 : 0);
dat->CurrentHeight = ypos;
@@ -211,7 +211,7 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA
dat->AdHocNode = xmlCopyNode(workNode);
- const TCHAR *type;
+ const wchar_t *type;
if ((type = XmlGetAttrValue(workNode, L"type")) == NULL) return TRUE;
if (!mir_tstrcmp(type, L"result")) {
// wParam = <iq/> node from responder as a result of command execution
@@ -219,7 +219,7 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA
if ((commandNode = XmlGetChild(dat->AdHocNode, L"command")) == NULL)
return TRUE;
- const TCHAR *status = XmlGetAttrValue(commandNode, L"status");
+ const wchar_t *status = XmlGetAttrValue(commandNode, L"status");
if (!status)
status = L"completed";
@@ -274,9 +274,9 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA
int toHide[] = { IDC_FRAME, IDC_FRAME_TEXT, IDC_VSCROLL, IDC_PREV, IDC_NEXT, IDC_COMPLETE, IDC_SUBMIT, 0};
sttShowControls(hwndDlg, FALSE, toHide);
- const TCHAR *code=NULL;
- const TCHAR *description=NULL;
- TCHAR buff[255];
+ const wchar_t *code=NULL;
+ const wchar_t *description=NULL;
+ wchar_t buff[255];
HXML errorNode = XmlGetChild(workNode , "error");
if (errorNode) {
code = XmlGetAttrValue(errorNode, L"code");
@@ -289,7 +289,7 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA
return TRUE;
}
-int CJabberProto::AdHoc_SubmitCommandForm(HWND hwndDlg, JabberAdHocData* dat, TCHAR* action)
+int CJabberProto::AdHoc_SubmitCommandForm(HWND hwndDlg, JabberAdHocData* dat, wchar_t* action)
{
HXML commandNode = XmlGetChild(dat->AdHocNode, "command");
HXML xNode = XmlGetChild(commandNode, "x");
@@ -299,11 +299,11 @@ int CJabberProto::AdHoc_SubmitCommandForm(HWND hwndDlg, JabberAdHocData* dat, TC
XmlNodeIq iq(AddIQ(&CJabberProto::OnIqResult_CommandExecution, JABBER_IQ_TYPE_SET, jid2, 0, -1, hwndDlg));
HXML command = iq << XCHILDNS(L"command", JABBER_FEAT_COMMANDS);
- const TCHAR *sessionId = XmlGetAttrValue(commandNode, L"sessionid");
+ const wchar_t *sessionId = XmlGetAttrValue(commandNode, L"sessionid");
if (sessionId)
command << XATTR(L"sessionid", sessionId);
- const TCHAR *node = XmlGetAttrValue(commandNode, L"node");
+ const wchar_t *node = XmlGetAttrValue(commandNode, L"node");
if (node)
command << XATTR(L"node", node);
@@ -322,7 +322,7 @@ int CJabberProto::AdHoc_SubmitCommandForm(HWND hwndDlg, JabberAdHocData* dat, TC
return TRUE;
}
-int CJabberProto::AdHoc_AddCommandRadio(HWND hFrame, TCHAR * labelStr, int id, int ypos, int value)
+int CJabberProto::AdHoc_AddCommandRadio(HWND hFrame, wchar_t * labelStr, int id, int ypos, int value)
{
RECT strRect = { 0 };
int verticalStep = 4;
@@ -384,7 +384,7 @@ static INT_PTR CALLBACK JabberAdHoc_CommandDlgProc(HWND hwndDlg, UINT msg, WPARA
if (!pStartupParams->m_szNode) {
dat->proto->AdHoc_RequestListOfCommands(pStartupParams->m_szJid, hwndDlg);
- TCHAR Caption[512];
+ wchar_t Caption[512];
mir_sntprintf(Caption, TranslateT("Jabber Ad-Hoc commands at %s"), dat->ResponderJID);
SetWindowText(hwndDlg, Caption);
}
@@ -397,7 +397,7 @@ static INT_PTR CALLBACK JabberAdHoc_CommandDlgProc(HWND hwndDlg, UINT msg, WPARA
EnableDlgItem(hwndDlg, IDC_SUBMIT, FALSE);
SetDlgItemText(hwndDlg, IDC_SUBMIT, TranslateT("OK"));
- TCHAR Caption[512];
+ wchar_t Caption[512];
mir_sntprintf(Caption, TranslateT("Sending Ad-Hoc command to %s"), dat->ResponderJID);
SetWindowText(hwndDlg, Caption);
}
@@ -517,8 +517,8 @@ int __cdecl CJabberProto::ContactMenuRunCommands(WPARAM hContact, LPARAM lParam)
if (hContact && szJid != NULL) {
JABBER_LIST_ITEM *item = NULL;
int selected = 0;
- TCHAR jid[JABBER_MAX_JID_LEN];
- _tcsncpy_s(jid, szJid, _TRUNCATE);
+ wchar_t jid[JABBER_MAX_JID_LEN];
+ wcsncpy_s(jid, szJid, _TRUNCATE);
{
mir_cslock lck(m_csLists);
item = ListGetItemPtr(LIST_ROSTER, jid);
diff --git a/protocols/JabberG/src/jabber_agent.cpp b/protocols/JabberG/src/jabber_agent.cpp
index f7c2b64a45..a09ad50983 100644
--- a/protocols/JabberG/src/jabber_agent.cpp
+++ b/protocols/JabberG/src/jabber_agent.cpp
@@ -52,10 +52,10 @@ public:
virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
{
if (msg == WM_JABBER_REGDLG_UPDATE) {
- if ((TCHAR*)lParam == NULL)
+ if ((wchar_t*)lParam == NULL)
SetDlgItemText(m_hwnd, IDC_REG_STATUS, TranslateT("No message"));
else
- SetDlgItemText(m_hwnd, IDC_REG_STATUS, (TCHAR*)lParam);
+ SetDlgItemText(m_hwnd, IDC_REG_STATUS, (wchar_t*)lParam);
SendDlgItemMessage(m_hwnd, IDC_PROGRESS_REG, PBM_SETPOS, wParam, 0);
@@ -82,12 +82,12 @@ class CAgentRegDlg : public CJabberDlgBase
int m_formHeight, m_frameHeight;
RECT m_frameRect;
HXML m_agentRegIqNode;
- TCHAR *m_jid;
+ wchar_t *m_jid;
CCtrlButton m_submit;
public:
- CAgentRegDlg(CJabberProto *_ppro, TCHAR *_jid) :
+ CAgentRegDlg(CJabberProto *_ppro, wchar_t *_jid) :
CJabberDlgBase(_ppro, IDD_FORM, false),
m_submit(this, IDC_SUBMIT),
m_jid(_jid),
@@ -226,14 +226,14 @@ public:
void OnSubmit(CCtrlButton*)
{
HXML queryNode, xNode;
- const TCHAR *from;
+ const wchar_t *from;
if (m_agentRegIqNode == NULL) return;
if ((from = XmlGetAttrValue(m_agentRegIqNode, L"from")) == NULL) return;
if ((queryNode = XmlGetChild(m_agentRegIqNode , "query")) == NULL) return;
HWND hFrame = GetDlgItem(m_hwnd, IDC_FRAME);
- TCHAR *str2 = (TCHAR*)alloca(sizeof(TCHAR) * 128);
+ wchar_t *str2 = (wchar_t*)alloca(sizeof(wchar_t) * 128);
int id = 0;
XmlNodeIq iq( m_proto->AddIQ(&CJabberProto::OnIqResultSetRegister, JABBER_IQ_TYPE_SET, from));
@@ -277,7 +277,7 @@ public:
}
};
-void CJabberProto::RegisterAgent(HWND /*hwndDlg*/, TCHAR* jid)
+void CJabberProto::RegisterAgent(HWND /*hwndDlg*/, wchar_t* jid)
{
(new CAgentRegDlg(this, jid))->Show();
}
diff --git a/protocols/JabberG/src/jabber_api.cpp b/protocols/JabberG/src/jabber_api.cpp
index 97850e9336..a144c1324d 100644
--- a/protocols/JabberG/src/jabber_api.cpp
+++ b/protocols/JabberG/src/jabber_api.cpp
@@ -64,7 +64,7 @@ LPTSTR CJabberProto::GetBestResourceName(LPCTSTR jid)
{
if (jid == NULL)
return NULL;
- LPCTSTR p = _tcschr(jid, '/');
+ LPCTSTR p = wcschr(jid, '/');
if (p == NULL) {
mir_cslock lck(m_csLists);
return mir_tstrdup(ListGetBestClientResourceNamePtr(jid));
@@ -240,7 +240,7 @@ int CJabberProto::RegisterFeature(LPCTSTR szFeature, LPCTSTR szDescription)
LPTSTR szExt = mir_tstrdup(szFeature);
LPTSTR pSrc, pDst;
for (pSrc = szExt, pDst = szExt; *pSrc; pSrc++)
- if (_tcschr(L"bcdfghjklmnpqrstvwxz0123456789", *pSrc))
+ if (wcschr(L"bcdfghjklmnpqrstvwxz0123456789", *pSrc))
*pDst++ = *pSrc;
*pDst = 0;
m_clientCapsManager.SetClientCaps(JABBER_CAPS_MIRANDA_NODE, szExt, jcb);
@@ -335,7 +335,7 @@ LPTSTR CJabberProto::GetResourceFeatures(LPCTSTR jid)
iLen += mir_tstrlen(m_lstJabberFeatCapPairsDynamic[i]->szFeature) + 1;
// allocate memory and fill it
- LPTSTR str = (LPTSTR)mir_alloc(iLen * sizeof(TCHAR));
+ LPTSTR str = (LPTSTR)mir_alloc(iLen * sizeof(wchar_t));
LPTSTR p = str;
for (i=0; g_JabberFeatCapPairs[i].szFeature; i++)
if (jcb & g_JabberFeatCapPairs[i].jcbCap) {
diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp
index 5d9d101ee6..d0718ab3ca 100644
--- a/protocols/JabberG/src/jabber_archive.cpp
+++ b/protocols/JabberG/src/jabber_archive.cpp
@@ -49,7 +49,7 @@ void CJabberProto::RetrieveMessageArchive(MCONTACT hContact, JABBER_LIST_ITEM *p
time_t tmLast = getDword(hContact, "LastCollection", 0);
if (tmLast) {
- TCHAR buf[40];
+ wchar_t buf[40];
list << XATTR(L"start", time2str(tmLast, buf, _countof(buf)));
}
m_ThreadInfo->send(iq);
@@ -57,7 +57,7 @@ void CJabberProto::RetrieveMessageArchive(MCONTACT hContact, JABBER_LIST_ITEM *p
void CJabberProto::OnIqResultGetCollectionList(HXML iqNode, CJabberIqInfo*)
{
- const TCHAR *to = XmlGetAttrValue(iqNode, L"to");
+ const wchar_t *to = XmlGetAttrValue(iqNode, L"to");
if (to == NULL || mir_tstrcmp(XmlGetAttrValue(iqNode, L"type"), L"result"))
return;
@@ -70,8 +70,8 @@ void CJabberProto::OnIqResultGetCollectionList(HXML iqNode, CJabberIqInfo*)
if (!itemNode)
break;
- const TCHAR* start = XmlGetAttrValue(itemNode, L"start");
- const TCHAR* with = XmlGetAttrValue(itemNode, L"with");
+ const wchar_t* start = XmlGetAttrValue(itemNode, L"start");
+ const wchar_t* with = XmlGetAttrValue(itemNode, L"with");
if (!start || !with)
continue;
@@ -228,8 +228,8 @@ void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*)
if (!chatNode || mir_tstrcmp(XmlGetAttrValue(chatNode, L"xmlns"), JABBER_FEAT_ARCHIVE))
return;
- const TCHAR* start = XmlGetAttrValue(chatNode, L"start");
- const TCHAR* with = XmlGetAttrValue(chatNode, L"with");
+ const wchar_t* start = XmlGetAttrValue(chatNode, L"start");
+ const wchar_t* with = XmlGetAttrValue(chatNode, L"with");
if (!start || !with)
return;
@@ -248,7 +248,7 @@ void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*)
break;
int from;
- const TCHAR *itemName = XmlGetName(itemNode);
+ const wchar_t *itemName = XmlGetName(itemNode);
if (!mir_tstrcmp(itemName, L"to"))
from = DBEF_SENT;
else if (!mir_tstrcmp(itemName, L"from"))
@@ -260,8 +260,8 @@ void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*)
if (!body)
continue;
- const TCHAR *tszBody = XmlGetText(body);
- const TCHAR *tszSecs = XmlGetAttrValue(itemNode, L"secs");
+ const wchar_t *tszBody = XmlGetText(body);
+ const wchar_t *tszSecs = XmlGetAttrValue(itemNode, L"secs");
if (!tszBody || !tszSecs)
continue;
@@ -273,7 +273,7 @@ void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*)
dbei.cbBlob = (DWORD)mir_strlen(szEventText)+1;
dbei.flags = DBEF_READ + DBEF_UTF + from;
dbei.pBlob = szEventText;
- dbei.timestamp = tmStart + _ttol(tszSecs);
+ dbei.timestamp = tmStart + _wtol(tszSecs);
if (!IsDuplicateEvent(hContact, dbei))
db_event_add(hContact, &dbei);
diff --git a/protocols/JabberG/src/jabber_bookmarks.cpp b/protocols/JabberG/src/jabber_bookmarks.cpp
index 362e300e89..f7915fe86b 100644
--- a/protocols/JabberG/src/jabber_bookmarks.cpp
+++ b/protocols/JabberG/src/jabber_bookmarks.cpp
@@ -36,7 +36,7 @@ static INT_PTR CALLBACK JabberAddBookmarkDlgProc(HWND hwndDlg, UINT msg, WPARAM
{
JabberAddBookmarkDlgParam* param = (JabberAddBookmarkDlgParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- TCHAR text[512];
+ wchar_t text[512];
JABBER_LIST_ITEM *item;
switch (msg) {
@@ -48,7 +48,7 @@ static INT_PTR CALLBACK JabberAddBookmarkDlgProc(HWND hwndDlg, UINT msg, WPARAM
TranslateDialogDefault(hwndDlg);
if (item = param->m_item) {
if (!mir_tstrcmp(item->type, L"conference")) {
- if (!_tcschr(item->jid, _T('@'))) { //no room name - consider it is transport
+ if (!wcschr(item->jid, '@')) { //no room name - consider it is transport
CheckDlgButton(hwndDlg, IDC_AGENT_RADIO, BST_CHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_NICK), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_PASSWORD), FALSE);
@@ -110,7 +110,7 @@ static INT_PTR CALLBACK JabberAddBookmarkDlgProc(HWND hwndDlg, UINT msg, WPARAM
case IDOK:
{
GetDlgItemText(hwndDlg, IDC_ROOM_JID, text, _countof(text));
- TCHAR *roomJID = NEWTSTR_ALLOCA(text);
+ wchar_t *roomJID = NEWWSTR_ALLOCA(text);
if (param->m_item)
param->ppro->ListRemove(LIST_BOOKMARK, param->m_item->jid);
@@ -207,7 +207,7 @@ private:
int iItem = m_lvBookmarks.GetNextItem(-1, LVNI_SELECTED);
if (iItem < 0) return;
- TCHAR *address = (TCHAR *)m_lvBookmarks.GetItemData(iItem);
+ wchar_t *address = (wchar_t *)m_lvBookmarks.GetItemData(iItem);
if (address == NULL) return;
JABBER_LIST_ITEM *item = m_proto->ListGetItemPtr(LIST_BOOKMARK, address);
@@ -226,7 +226,7 @@ private:
int iItem = m_lvBookmarks.GetNextItem(-1, LVNI_SELECTED);
if (iItem < 0) return;
- TCHAR *address = (TCHAR *)m_lvBookmarks.GetItemData(iItem);
+ wchar_t *address = (wchar_t *)m_lvBookmarks.GetItemData(iItem);
if (address == NULL) return;
JABBER_LIST_ITEM *item = m_proto->ListGetItemPtr(LIST_BOOKMARK, address);
@@ -323,7 +323,7 @@ void CJabberDlgBookmarks::OpenBookmark()
int iItem = m_lvBookmarks.GetNextItem(-1, LVNI_SELECTED);
if (iItem < 0) return;
- TCHAR *address = (TCHAR *)m_lvBookmarks.GetItemData(iItem);
+ wchar_t *address = (wchar_t *)m_lvBookmarks.GetItemData(iItem);
if (address == NULL) return;
JABBER_LIST_ITEM *item = m_proto->ListGetItemPtr(LIST_BOOKMARK, address);
@@ -333,12 +333,12 @@ void CJabberDlgBookmarks::OpenBookmark()
m_lvBookmarks.SetItemState(iItem, 0, LVIS_SELECTED); // Unselect the item
/* some hack for using bookmark to transport not under XEP-0048 */
- if (!_tcschr(item->jid, _T('@')))
+ if (!wcschr(item->jid, '@'))
//the room name is not provided let consider that it is transport and send request to registration
m_proto->RegisterAgent(NULL, item->jid);
else {
- TCHAR *room = NEWTSTR_ALLOCA(item->jid);
- TCHAR *server = _tcschr(room, _T('@'));
+ wchar_t *room = NEWWSTR_ALLOCA(item->jid);
+ wchar_t *server = wcschr(room, '@');
*(server++) = 0;
if (item->nick && *item->nick)
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp
index 8059f3a1bd..c889f7099f 100644
--- a/protocols/JabberG/src/jabber_byte.cpp
+++ b/protocols/JabberG/src/jabber_byte.cpp
@@ -60,13 +60,13 @@ void CJabberProto::IqResultProxyDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
HXML queryNode = XmlGetChild(iqNode , "query");
if (queryNode) {
- const TCHAR *queryXmlns = XmlGetAttrValue(queryNode, L"xmlns");
+ const wchar_t *queryXmlns = XmlGetAttrValue(queryNode, L"xmlns");
if (queryXmlns && !mir_tstrcmp(queryXmlns, JABBER_FEAT_BYTESTREAMS)) {
HXML streamHostNode = XmlGetChild(queryNode , "streamhost");
if (streamHostNode) {
- const TCHAR *streamJid = XmlGetAttrValue(streamHostNode, L"jid");
- const TCHAR *streamHost = XmlGetAttrValue(streamHostNode, L"host");
- const TCHAR *streamPort = XmlGetAttrValue(streamHostNode, L"port");
+ const wchar_t *streamJid = XmlGetAttrValue(streamHostNode, L"jid");
+ const wchar_t *streamHost = XmlGetAttrValue(streamHostNode, L"host");
+ const wchar_t *streamPort = XmlGetAttrValue(streamHostNode, L"port");
if (streamJid && streamHost && streamPort) {
jbt->szProxyHost = mir_tstrdup(streamHost);
jbt->szProxyJid = mir_tstrdup(streamJid);
@@ -83,7 +83,7 @@ void CJabberProto::IqResultProxyDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
void JabberByteSendConnection(HANDLE hConn, DWORD /*dwRemoteIP*/, void* extra)
{
CJabberProto *ppro = (CJabberProto*)extra;
- TCHAR szPort[8];
+ wchar_t szPort[8];
JABBER_BYTE_TRANSFER *jbt;
int recvResult, bytesParsed;
HANDLE hListen;
@@ -142,7 +142,7 @@ void JabberByteSendConnection(HANDLE hConn, DWORD /*dwRemoteIP*/, void* extra)
void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt)
{
- TCHAR szPort[8];
+ wchar_t szPort[8];
HANDLE hEvent = NULL;
CJabberIqInfo *pInfo = NULL;
int nIqId = 0;
@@ -299,11 +299,11 @@ void CJabberProto::ByteInitiateResult(HXML iqNode, CJabberIqInfo *pInfo)
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
HXML queryNode = XmlGetChild(iqNode , "query");
if (queryNode) {
- const TCHAR *queryXmlns = XmlGetAttrValue(queryNode, L"xmlns");
+ const wchar_t *queryXmlns = XmlGetAttrValue(queryNode, L"xmlns");
if (queryXmlns && !mir_tstrcmp(queryXmlns, JABBER_FEAT_BYTESTREAMS)) {
HXML streamHostNode = XmlGetChild(queryNode , "streamhost-used");
if (streamHostNode) {
- const TCHAR *streamJid = XmlGetAttrValue(streamHostNode, L"jid");
+ const wchar_t *streamJid = XmlGetAttrValue(streamHostNode, L"jid");
if (streamJid)
jbt->szStreamhostUsed = mir_tstrdup(streamJid);
} } } }
@@ -360,10 +360,10 @@ int CJabberProto::ByteSendParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, char* b
// 04-07 bnd.addr server bound address
// 08-09 bnd.port server bound port
if (datalen == 47 && *((DWORD*)buffer)==0x03000105 && buffer[4]==40 && *((WORD*)(buffer+45))==0) {
- TCHAR text[256];
+ wchar_t text[256];
- TCHAR *szInitiatorJid = JabberPrepareJid(jbt->srcJID);
- TCHAR *szTargetJid = JabberPrepareJid(jbt->dstJID);
+ wchar_t *szInitiatorJid = JabberPrepareJid(jbt->srcJID);
+ wchar_t *szTargetJid = JabberPrepareJid(jbt->dstJID);
mir_sntprintf(text, L"%s%s%s", jbt->sid, szInitiatorJid, szTargetJid);
mir_free(szInitiatorJid);
mir_free(szTargetJid);
@@ -406,7 +406,7 @@ void CJabberProto::IqResultStreamActivate(HXML iqNode, CJabberIqInfo*)
{
int id = JabberGetPacketID(iqNode);
- TCHAR listJid[JABBER_MAX_JID_LEN];
+ wchar_t listJid[JABBER_MAX_JID_LEN];
mir_sntprintf(listJid, L"ftproxy_%d", id);
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_FTIQID, listJid);
@@ -423,7 +423,7 @@ void CJabberProto::IqResultStreamActivate(HXML iqNode, CJabberIqInfo*)
void CJabberProto::ByteSendViaProxy(JABBER_BYTE_TRANSFER *jbt)
{
- TCHAR *szHost, *szPort;
+ wchar_t *szHost, *szPort;
WORD port;
HANDLE hConn;
char data[3];
@@ -444,7 +444,7 @@ void CJabberProto::ByteSendViaProxy(JABBER_BYTE_TRANSFER *jbt)
szPort = jbt->szProxyPort;
szHost = jbt->szProxyHost;
- port = (WORD)_ttoi(szPort);
+ port = (WORD)_wtoi(szPort);
replaceStrT(jbt->streamhostJID, jbt->szProxyJid);
NETLIBOPENCONNECTION nloc = { 0 };
@@ -509,10 +509,10 @@ int CJabberProto::ByteSendProxyParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, ch
*((DWORD*)data) = 0x03000105;
data[4] = 40;
- TCHAR text[256];
+ wchar_t text[256];
- TCHAR *szInitiatorJid = JabberPrepareJid(jbt->srcJID);
- TCHAR *szTargetJid = JabberPrepareJid(jbt->dstJID);
+ wchar_t *szInitiatorJid = JabberPrepareJid(jbt->srcJID);
+ wchar_t *szTargetJid = JabberPrepareJid(jbt->dstJID);
mir_sntprintf(text, L"%s%s%s", jbt->sid, szInitiatorJid, szTargetJid);
mir_free(szInitiatorJid);
mir_free(szTargetJid);
@@ -555,7 +555,7 @@ int CJabberProto::ByteSendProxyParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, ch
int iqId = SerialNext();
- TCHAR listJid[256];
+ wchar_t listJid[256];
mir_sntprintf(listJid, L"ftproxy_%d", iqId);
JABBER_LIST_ITEM *item = ListAdd(LIST_FTIQID, listJid);
@@ -587,7 +587,7 @@ int CJabberProto::ByteSendProxyParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, ch
void __cdecl CJabberProto::ByteReceiveThread(JABBER_BYTE_TRANSFER *jbt)
{
HXML iqNode, queryNode = NULL, n;
- const TCHAR *sid = NULL, *from = NULL, *to = NULL, *szId = NULL, *szHost, *szPort, *str;
+ const wchar_t *sid = NULL, *from = NULL, *to = NULL, *szId = NULL, *szHost, *szPort, *str;
int i;
WORD port;
HANDLE hConn;
@@ -623,7 +623,7 @@ void __cdecl CJabberProto::ByteReceiveThread(JABBER_BYTE_TRANSFER *jbt)
(szPort = XmlGetAttrValue(n, L"port")) != NULL &&
(str = XmlGetAttrValue(n, L"jid")) != NULL) {
- port = (WORD)_ttoi(szPort);
+ port = (WORD)_wtoi(szPort);
replaceStrT(jbt->streamhostJID, str);
debugLog(L"bytestream_recv connecting to %s:%d", szHost, port);
@@ -705,7 +705,7 @@ int CJabberProto::ByteReceiveParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, char
*((DWORD*)data) = 0x03000105;
data[4] = 40;
- TCHAR text[JABBER_MAX_JID_LEN * 2];
+ wchar_t text[JABBER_MAX_JID_LEN * 2];
{
ptrT szInitiatorJid(JabberPrepareJid(jbt->srcJID));
ptrT szTargetJid(JabberPrepareJid(jbt->dstJID));
diff --git a/protocols/JabberG/src/jabber_byte.h b/protocols/JabberG/src/jabber_byte.h
index 604f9702f9..3c705533f8 100644
--- a/protocols/JabberG/src/jabber_byte.h
+++ b/protocols/JabberG/src/jabber_byte.h
@@ -35,11 +35,11 @@ struct JABBER_BYTE_TRANSFER
{
~JABBER_BYTE_TRANSFER();
- TCHAR *sid;
- TCHAR *srcJID;
- TCHAR *dstJID;
- TCHAR *streamhostJID;
- TCHAR *iqId;
+ wchar_t *sid;
+ wchar_t *srcJID;
+ wchar_t *dstJID;
+ wchar_t *streamhostJID;
+ wchar_t *iqId;
JABBER_BYTE_STATE state;
HANDLE hConn;
HANDLE hEvent;
@@ -52,10 +52,10 @@ struct JABBER_BYTE_TRANSFER
// XEP-0065 proxy support
BOOL bProxyDiscovered;
HANDLE hProxyEvent;
- TCHAR *szProxyHost;
- TCHAR *szProxyPort;
- TCHAR *szProxyJid;
- TCHAR *szStreamhostUsed;
+ wchar_t *szProxyHost;
+ wchar_t *szProxyPort;
+ wchar_t *szProxyJid;
+ wchar_t *szStreamhostUsed;
BOOL bStreamActivated;
HANDLE hSendEvent;
};
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp
index eb859e524b..275e869901 100644
--- a/protocols/JabberG/src/jabber_caps.cpp
+++ b/protocols/JabberG/src/jabber_caps.cpp
@@ -29,52 +29,52 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "version.h"
const JabberFeatCapPair g_JabberFeatCapPairs[] = {
- { JABBER_FEAT_DISCO_INFO, JABBER_CAPS_DISCO_INFO, LPGENT("Supports Service Discovery info") },
- { JABBER_FEAT_DISCO_ITEMS, JABBER_CAPS_DISCO_ITEMS, LPGENT("Supports Service Discovery items list") },
- { JABBER_FEAT_ENTITY_CAPS, JABBER_CAPS_ENTITY_CAPS, LPGENT("Can inform about its Jabber capabilities") },
- { JABBER_FEAT_SI, JABBER_CAPS_SI, LPGENT("Supports stream initiation (e.g., for filetransfers)") },
- { JABBER_FEAT_SI_FT, JABBER_CAPS_SI_FT, LPGENT("Supports stream initiation for file transfers") },
- { JABBER_FEAT_BYTESTREAMS, JABBER_CAPS_BYTESTREAMS, LPGENT("Supports file transfers via SOCKS5 Bytestreams") },
- { JABBER_FEAT_IBB, JABBER_CAPS_IBB, LPGENT("Supports file transfers via In-Band Bytestreams") },
- { JABBER_FEAT_OOB, JABBER_CAPS_OOB, LPGENT("Supports file transfers via Out-of-Band Bytestreams") },
- { JABBER_FEAT_OOB2, JABBER_CAPS_OOB, LPGENT("Supports file transfers via Out-of-Band Bytestreams") },
- { JABBER_FEAT_COMMANDS, JABBER_CAPS_COMMANDS, LPGENT("Supports execution of Ad-Hoc commands") },
- { JABBER_FEAT_REGISTER, JABBER_CAPS_REGISTER, LPGENT("Supports in-band registration") },
- { JABBER_FEAT_MUC, JABBER_CAPS_MUC, LPGENT("Supports multi-user chat") },
- { JABBER_FEAT_CHATSTATES, JABBER_CAPS_CHATSTATES, LPGENT("Can report chat state in a chat session") },
- { JABBER_FEAT_LAST_ACTIVITY, JABBER_CAPS_LAST_ACTIVITY, LPGENT("Can report information about the last activity of the user") },
- { JABBER_FEAT_VERSION, JABBER_CAPS_VERSION, LPGENT("Can report own version information") },
- { JABBER_FEAT_ENTITY_TIME, JABBER_CAPS_ENTITY_TIME, LPGENT("Can report local time of the user") },
- { JABBER_FEAT_PING, JABBER_CAPS_PING, LPGENT("Can send and receive ping requests") },
- { JABBER_FEAT_DATA_FORMS, JABBER_CAPS_DATA_FORMS, LPGENT("Supports data forms") },
- { JABBER_FEAT_MESSAGE_EVENTS, JABBER_CAPS_MESSAGE_EVENTS, LPGENT("Can request and respond to events relating to the delivery, display, and composition of messages") },
- { JABBER_FEAT_VCARD_TEMP, JABBER_CAPS_VCARD_TEMP, LPGENT("Supports vCard") },
- { JABBER_FEAT_AVATAR, JABBER_CAPS_AVATAR, LPGENT("Supports iq-based avatars") },
- { JABBER_FEAT_XHTML, JABBER_CAPS_XHTML, LPGENT("Supports XHTML formatting of chat messages") },
- { JABBER_FEAT_AGENTS, JABBER_CAPS_AGENTS, LPGENT("Supports Jabber Browsing") },
- { JABBER_FEAT_BROWSE, JABBER_CAPS_BROWSE, LPGENT("Supports Jabber Browsing") },
- { JABBER_FEAT_FEATURE_NEG, JABBER_CAPS_FEATURE_NEG, LPGENT("Can negotiate options for specific features") },
- { JABBER_FEAT_AMP, JABBER_CAPS_AMP, LPGENT("Can request advanced processing of message stanzas") },
- { JABBER_FEAT_USER_MOOD, JABBER_CAPS_USER_MOOD, LPGENT("Can report information about user moods") },
- { JABBER_FEAT_USER_MOOD_NOTIFY, JABBER_CAPS_USER_MOOD_NOTIFY, LPGENT("Receives information about user moods") },
- { JABBER_FEAT_PUBSUB, JABBER_CAPS_PUBSUB, LPGENT("Supports generic publish-subscribe functionality") },
- { JABBER_FEAT_SECUREIM, JABBER_CAPS_SECUREIM, LPGENT("Supports SecureIM plugin for Miranda NG") },
- { JABBER_FEAT_MIROTR, JABBER_CAPS_MIROTR, LPGENT("Supports OTR (Off-the-Record Messaging)") },
- { JABBER_FEAT_NEWGPG, JABBER_CAPS_NEWGPG, LPGENT("Supports New_GPG plugin for Miranda NG") },
- { JABBER_FEAT_PRIVACY_LISTS, JABBER_CAPS_PRIVACY_LISTS, LPGENT("Blocks packets from other users/group chats using Privacy lists") },
- { JABBER_FEAT_MESSAGE_RECEIPTS, JABBER_CAPS_MESSAGE_RECEIPTS, LPGENT("Supports Message Receipts") },
- { JABBER_FEAT_USER_TUNE, JABBER_CAPS_USER_TUNE, LPGENT("Can report information about the music to which a user is listening") },
- { JABBER_FEAT_USER_TUNE_NOTIFY, JABBER_CAPS_USER_TUNE_NOTIFY, LPGENT("Receives information about the music to which a user is listening") },
- { JABBER_FEAT_PRIVATE_STORAGE, JABBER_CAPS_PRIVATE_STORAGE, LPGENT("Supports private XML Storage (for bookmarks and other)") },
- { JABBER_FEAT_ATTENTION, JABBER_CAPS_ATTENTION, LPGENT("Supports attention requests ('nudge')") },
- { JABBER_FEAT_ARCHIVE_AUTO, JABBER_CAPS_ARCHIVE_AUTO, LPGENT("Supports chat history retrieving") },
- { JABBER_FEAT_ARCHIVE_MANAGE, JABBER_CAPS_ARCHIVE_MANAGE, LPGENT("Supports chat history management") },
- { JABBER_FEAT_USER_ACTIVITY, JABBER_CAPS_USER_ACTIVITY, LPGENT("Can report information about user activity") },
- { JABBER_FEAT_USER_ACTIVITY_NOTIFY, JABBER_CAPS_USER_ACTIVITY_NOTIFY, LPGENT("Receives information about user activity") },
- { JABBER_FEAT_MIRANDA_NOTES, JABBER_CAPS_MIRANDA_NOTES, LPGENT("Supports Miranda NG notes extension") },
- { JABBER_FEAT_JINGLE, JABBER_CAPS_JINGLE, LPGENT("Supports Jingle") },
- { JABBER_FEAT_ROSTER_EXCHANGE, JABBER_CAPS_ROSTER_EXCHANGE, LPGENT("Supports Roster Exchange") },
- { JABBER_FEAT_DIRECT_MUC_INVITE, JABBER_CAPS_DIRECT_MUC_INVITE, LPGENT("Supports direct chat invitations (XEP-0249)") },
+ { JABBER_FEAT_DISCO_INFO, JABBER_CAPS_DISCO_INFO, LPGENW("Supports Service Discovery info") },
+ { JABBER_FEAT_DISCO_ITEMS, JABBER_CAPS_DISCO_ITEMS, LPGENW("Supports Service Discovery items list") },
+ { JABBER_FEAT_ENTITY_CAPS, JABBER_CAPS_ENTITY_CAPS, LPGENW("Can inform about its Jabber capabilities") },
+ { JABBER_FEAT_SI, JABBER_CAPS_SI, LPGENW("Supports stream initiation (e.g., for filetransfers)") },
+ { JABBER_FEAT_SI_FT, JABBER_CAPS_SI_FT, LPGENW("Supports stream initiation for file transfers") },
+ { JABBER_FEAT_BYTESTREAMS, JABBER_CAPS_BYTESTREAMS, LPGENW("Supports file transfers via SOCKS5 Bytestreams") },
+ { JABBER_FEAT_IBB, JABBER_CAPS_IBB, LPGENW("Supports file transfers via In-Band Bytestreams") },
+ { JABBER_FEAT_OOB, JABBER_CAPS_OOB, LPGENW("Supports file transfers via Out-of-Band Bytestreams") },
+ { JABBER_FEAT_OOB2, JABBER_CAPS_OOB, LPGENW("Supports file transfers via Out-of-Band Bytestreams") },
+ { JABBER_FEAT_COMMANDS, JABBER_CAPS_COMMANDS, LPGENW("Supports execution of Ad-Hoc commands") },
+ { JABBER_FEAT_REGISTER, JABBER_CAPS_REGISTER, LPGENW("Supports in-band registration") },
+ { JABBER_FEAT_MUC, JABBER_CAPS_MUC, LPGENW("Supports multi-user chat") },
+ { JABBER_FEAT_CHATSTATES, JABBER_CAPS_CHATSTATES, LPGENW("Can report chat state in a chat session") },
+ { JABBER_FEAT_LAST_ACTIVITY, JABBER_CAPS_LAST_ACTIVITY, LPGENW("Can report information about the last activity of the user") },
+ { JABBER_FEAT_VERSION, JABBER_CAPS_VERSION, LPGENW("Can report own version information") },
+ { JABBER_FEAT_ENTITY_TIME, JABBER_CAPS_ENTITY_TIME, LPGENW("Can report local time of the user") },
+ { JABBER_FEAT_PING, JABBER_CAPS_PING, LPGENW("Can send and receive ping requests") },
+ { JABBER_FEAT_DATA_FORMS, JABBER_CAPS_DATA_FORMS, LPGENW("Supports data forms") },
+ { JABBER_FEAT_MESSAGE_EVENTS, JABBER_CAPS_MESSAGE_EVENTS, LPGENW("Can request and respond to events relating to the delivery, display, and composition of messages") },
+ { JABBER_FEAT_VCARD_TEMP, JABBER_CAPS_VCARD_TEMP, LPGENW("Supports vCard") },
+ { JABBER_FEAT_AVATAR, JABBER_CAPS_AVATAR, LPGENW("Supports iq-based avatars") },
+ { JABBER_FEAT_XHTML, JABBER_CAPS_XHTML, LPGENW("Supports XHTML formatting of chat messages") },
+ { JABBER_FEAT_AGENTS, JABBER_CAPS_AGENTS, LPGENW("Supports Jabber Browsing") },
+ { JABBER_FEAT_BROWSE, JABBER_CAPS_BROWSE, LPGENW("Supports Jabber Browsing") },
+ { JABBER_FEAT_FEATURE_NEG, JABBER_CAPS_FEATURE_NEG, LPGENW("Can negotiate options for specific features") },
+ { JABBER_FEAT_AMP, JABBER_CAPS_AMP, LPGENW("Can request advanced processing of message stanzas") },
+ { JABBER_FEAT_USER_MOOD, JABBER_CAPS_USER_MOOD, LPGENW("Can report information about user moods") },
+ { JABBER_FEAT_USER_MOOD_NOTIFY, JABBER_CAPS_USER_MOOD_NOTIFY, LPGENW("Receives information about user moods") },
+ { JABBER_FEAT_PUBSUB, JABBER_CAPS_PUBSUB, LPGENW("Supports generic publish-subscribe functionality") },
+ { JABBER_FEAT_SECUREIM, JABBER_CAPS_SECUREIM, LPGENW("Supports SecureIM plugin for Miranda NG") },
+ { JABBER_FEAT_MIROTR, JABBER_CAPS_MIROTR, LPGENW("Supports OTR (Off-the-Record Messaging)") },
+ { JABBER_FEAT_NEWGPG, JABBER_CAPS_NEWGPG, LPGENW("Supports New_GPG plugin for Miranda NG") },
+ { JABBER_FEAT_PRIVACY_LISTS, JABBER_CAPS_PRIVACY_LISTS, LPGENW("Blocks packets from other users/group chats using Privacy lists") },
+ { JABBER_FEAT_MESSAGE_RECEIPTS, JABBER_CAPS_MESSAGE_RECEIPTS, LPGENW("Supports Message Receipts") },
+ { JABBER_FEAT_USER_TUNE, JABBER_CAPS_USER_TUNE, LPGENW("Can report information about the music to which a user is listening") },
+ { JABBER_FEAT_USER_TUNE_NOTIFY, JABBER_CAPS_USER_TUNE_NOTIFY, LPGENW("Receives information about the music to which a user is listening") },
+ { JABBER_FEAT_PRIVATE_STORAGE, JABBER_CAPS_PRIVATE_STORAGE, LPGENW("Supports private XML Storage (for bookmarks and other)") },
+ { JABBER_FEAT_ATTENTION, JABBER_CAPS_ATTENTION, LPGENW("Supports attention requests ('nudge')") },
+ { JABBER_FEAT_ARCHIVE_AUTO, JABBER_CAPS_ARCHIVE_AUTO, LPGENW("Supports chat history retrieving") },
+ { JABBER_FEAT_ARCHIVE_MANAGE, JABBER_CAPS_ARCHIVE_MANAGE, LPGENW("Supports chat history management") },
+ { JABBER_FEAT_USER_ACTIVITY, JABBER_CAPS_USER_ACTIVITY, LPGENW("Can report information about user activity") },
+ { JABBER_FEAT_USER_ACTIVITY_NOTIFY, JABBER_CAPS_USER_ACTIVITY_NOTIFY, LPGENW("Receives information about user activity") },
+ { JABBER_FEAT_MIRANDA_NOTES, JABBER_CAPS_MIRANDA_NOTES, LPGENW("Supports Miranda NG notes extension") },
+ { JABBER_FEAT_JINGLE, JABBER_CAPS_JINGLE, LPGENW("Supports Jingle") },
+ { JABBER_FEAT_ROSTER_EXCHANGE, JABBER_CAPS_ROSTER_EXCHANGE, LPGENW("Supports Roster Exchange") },
+ { JABBER_FEAT_DIRECT_MUC_INVITE, JABBER_CAPS_DIRECT_MUC_INVITE, LPGENW("Supports direct chat invitations (XEP-0249)") },
{ NULL }
};
@@ -110,9 +110,9 @@ void CJabberProto::OnIqResultCapsDiscoInfoSI(HXML, CJabberIqInfo *pInfo)
// XEP-0232 support
HXML xform;
for (int i = 1; (xform = XmlGetNthChild(query, L"x", i)) != NULL; i++) {
- TCHAR *szFormTypeValue = XPath(xform, L"field[@var='FORM_TYPE']/value");
+ wchar_t *szFormTypeValue = XPath(xform, L"field[@var='FORM_TYPE']/value");
if (szFormTypeValue && !mir_tstrcmp(szFormTypeValue, L"urn:xmpp:dataforms:softwareinfo")) {
- TCHAR *szTmp = XPath(xform, L"field[@var='os']/value");
+ wchar_t *szTmp = XPath(xform, L"field[@var='os']/value");
if (szTmp)
r->m_tszOs = mir_tstrdup(szTmp);
szTmp = XPath(xform, L"field[@var='os_version']/value");
@@ -143,7 +143,7 @@ void CJabberProto::OnIqResultCapsDiscoInfo(HXML, CJabberIqInfo *pInfo)
JabberCapsBits jcbCaps = 0;
HXML feature;
for (int i = 1; (feature = XmlGetNthChild(query, L"feature", i)) != NULL; i++) {
- const TCHAR *featureName = XmlGetAttrValue(feature, L"var");
+ const wchar_t *featureName = XmlGetAttrValue(feature, L"var");
if (!featureName)
continue;
@@ -177,12 +177,12 @@ void CJabberProto::OnIqResultCapsDiscoInfo(HXML, CJabberIqInfo *pInfo)
}
}
-JabberCapsBits CJabberProto::GetTotalJidCapabilites(const TCHAR *jid)
+JabberCapsBits CJabberProto::GetTotalJidCapabilites(const wchar_t *jid)
{
if (jid == NULL)
return JABBER_RESOURCE_CAPS_NONE;
- TCHAR szBareJid[JABBER_MAX_JID_LEN];
+ wchar_t szBareJid[JABBER_MAX_JID_LEN];
JabberStripJid(jid, szBareJid, _countof(szBareJid));
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, szBareJid);
@@ -200,7 +200,7 @@ JabberCapsBits CJabberProto::GetTotalJidCapabilites(const TCHAR *jid)
if (item) {
for (int i = 0; i < item->arResources.getCount(); i++) {
- TCHAR szFullJid[JABBER_MAX_JID_LEN];
+ wchar_t szFullJid[JABBER_MAX_JID_LEN];
mir_sntprintf(szFullJid, L"%s/%s", szBareJid, item->arResources[i]->m_tszResourceName);
JabberCapsBits jcb = GetResourceCapabilites(szFullJid, FALSE);
if (!(jcb & JABBER_RESOURCE_CAPS_ERROR))
@@ -210,13 +210,13 @@ JabberCapsBits CJabberProto::GetTotalJidCapabilites(const TCHAR *jid)
return jcbToReturn;
}
-JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appendBestResource)
+JabberCapsBits CJabberProto::GetResourceCapabilites(const wchar_t *jid, BOOL appendBestResource)
{
- TCHAR fullJid[JABBER_MAX_JID_LEN];
+ wchar_t fullJid[JABBER_MAX_JID_LEN];
if (appendBestResource)
GetClientJID(jid, fullJid, _countof(fullJid));
else
- _tcsncpy_s(fullJid, jid, _TRUNCATE);
+ wcsncpy_s(fullJid, jid, _TRUNCATE);
pResourceStatus r(ResourceInfoFromJID(fullJid));
if (r == NULL)
@@ -239,7 +239,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen
m_clientCapsManager.SetClientCaps(r->m_tszCapsNode, r->m_tszCapsVer, JABBER_RESOURCE_CAPS_IN_PROGRESS, pInfo->GetIqId());
r->m_dwDiscoInfoRequestTime = pInfo->GetRequestTime();
- TCHAR queryNode[512];
+ wchar_t queryNode[512];
mir_sntprintf(queryNode, L"%s#%s", r->m_tszCapsNode, r->m_tszCapsVer);
m_ThreadInfo->send(XmlNodeIq(pInfo) << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(L"node", queryNode));
@@ -251,9 +251,9 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen
jcbCaps |= jcbMainCaps;
if (jcbMainCaps != JABBER_RESOURCE_CAPS_TIMEOUT && r->m_tszCapsExt) {
- TCHAR *caps = mir_tstrdup(r->m_tszCapsExt);
+ wchar_t *caps = mir_tstrdup(r->m_tszCapsExt);
- TCHAR *token = _tcstok(caps, L" ");
+ wchar_t *token = wcstok(caps, L" ");
while (token) {
switch (jcbExtCaps = m_clientCapsManager.GetClientCaps(r->m_tszCapsNode, token)) {
case JABBER_RESOURCE_CAPS_ERROR:
@@ -282,7 +282,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen
jcbCaps |= jcbExtCaps;
}
- token = _tcstok(NULL, L" ");
+ token = wcstok(NULL, L" ");
}
mir_free(caps);
@@ -388,7 +388,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen
/////////////////////////////////////////////////////////////////////////////////////////
// CJabberClientPartialCaps class
-CJabberClientPartialCaps::CJabberClientPartialCaps(const TCHAR *szVer)
+CJabberClientPartialCaps::CJabberClientPartialCaps(const wchar_t *szVer)
{
m_szVer = mir_tstrdup(szVer);
m_jcbCaps = JABBER_RESOURCE_CAPS_UNINIT;
@@ -430,7 +430,7 @@ JabberCapsBits CJabberClientPartialCaps::GetCaps()
return m_jcbCaps;
}
-CJabberClientPartialCaps* CJabberClientCaps::FindByVersion(const TCHAR *szVer)
+CJabberClientPartialCaps* CJabberClientCaps::FindByVersion(const wchar_t *szVer)
{
if (!m_pCaps || !szVer)
return NULL;
@@ -461,7 +461,7 @@ CJabberClientPartialCaps* CJabberClientCaps::FindById(int nIqId)
/////////////////////////////////////////////////////////////////////////////////////////
// CJabberClientCaps class
-CJabberClientCaps::CJabberClientCaps(const TCHAR *szNode)
+CJabberClientCaps::CJabberClientCaps(const wchar_t *szNode)
{
m_szNode = mir_tstrdup(szNode);
m_pCaps = NULL;
@@ -483,13 +483,13 @@ CJabberClientCaps* CJabberClientCaps::SetNext(CJabberClientCaps *pClient)
return pRetVal;
}
-JabberCapsBits CJabberClientCaps::GetPartialCaps(TCHAR *szVer)
+JabberCapsBits CJabberClientCaps::GetPartialCaps(wchar_t *szVer)
{
CJabberClientPartialCaps *pCaps = FindByVersion(szVer);
return (pCaps) ? pCaps->GetCaps() : JABBER_RESOURCE_CAPS_UNINIT;
}
-BOOL CJabberClientCaps::SetPartialCaps(const TCHAR *szVer, JabberCapsBits jcbCaps, int nIqId /*= -1*/)
+BOOL CJabberClientCaps::SetPartialCaps(const wchar_t *szVer, JabberCapsBits jcbCaps, int nIqId /*= -1*/)
{
CJabberClientPartialCaps *pCaps = FindByVersion(szVer);
if (!pCaps) {
@@ -529,7 +529,7 @@ CJabberClientCapsManager::~CJabberClientCapsManager()
delete m_pClients;
}
-CJabberClientCaps * CJabberClientCapsManager::FindClient(const TCHAR *szNode)
+CJabberClientCaps * CJabberClientCapsManager::FindClient(const wchar_t *szNode)
{
if (!m_pClients || !szNode)
return NULL;
@@ -552,7 +552,7 @@ void CJabberClientCapsManager::AddDefaultCaps()
SetClientCaps(JABBER_CAPS_MIRANDA_NODE, g_JabberFeatCapPairsExt[i].szFeature, g_JabberFeatCapPairsExt[i].jcbCap);
}
-JabberCapsBits CJabberClientCapsManager::GetClientCaps(TCHAR *szNode, TCHAR *szVer)
+JabberCapsBits CJabberClientCapsManager::GetClientCaps(wchar_t *szNode, wchar_t *szVer)
{
mir_cslockfull lck(m_cs);
CJabberClientCaps *pClient = FindClient(szNode);
@@ -567,7 +567,7 @@ JabberCapsBits CJabberClientCapsManager::GetClientCaps(TCHAR *szNode, TCHAR *szV
return jcbCaps;
}
-BOOL CJabberClientCapsManager::SetClientCaps(const TCHAR *szNode, const TCHAR *szVer, JabberCapsBits jcbCaps, int nIqId /*= -1*/)
+BOOL CJabberClientCapsManager::SetClientCaps(const wchar_t *szNode, const wchar_t *szVer, JabberCapsBits jcbCaps, int nIqId /*= -1*/)
{
mir_cslockfull lck(m_cs);
CJabberClientCaps *pClient = FindClient(szNode);
@@ -604,7 +604,7 @@ BOOL CJabberClientCapsManager::SetClientCaps(int nIqId, JabberCapsBits jcbCaps)
return bOk;
}
-BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, const TCHAR *szNode)
+BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, const wchar_t *szNode)
{
int i;
JabberCapsBits jcb = 0;
@@ -614,7 +614,7 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, con
if (!g_JabberFeatCapPairsExt[i].Valid())
continue;
- TCHAR szExtCap[ 512 ];
+ wchar_t szExtCap[ 512 ];
mir_sntprintf(szExtCap, L"%s#%s", JABBER_CAPS_MIRANDA_NODE, g_JabberFeatCapPairsExt[i].szFeature);
if (!mir_tstrcmp(szNode, szExtCap)) {
jcb = g_JabberFeatCapPairsExt[i].jcbCap;
@@ -624,7 +624,7 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, con
// check features registered through IJabberNetInterface::RegisterFeature() and IJabberNetInterface::AddFeatures()
for (i=0; i < ppro->m_lstJabberFeatCapPairsDynamic.getCount(); i++) {
- TCHAR szExtCap[ 512 ];
+ wchar_t szExtCap[ 512 ];
mir_sntprintf(szExtCap, L"%s#%s", JABBER_CAPS_MIRANDA_NODE, ppro->m_lstJabberFeatCapPairsDynamic[i]->szExt);
if (!mir_tstrcmp(szNode, szExtCap)) {
jcb = ppro->m_lstJabberFeatCapPairsDynamic[i]->jcbCap;
@@ -663,16 +663,16 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, con
query << XCHILD(L"feature") << XATTR(L"var", ppro->m_lstJabberFeatCapPairsDynamic[i]->szFeature);
if (ppro->m_options.AllowVersionRequests && !szNode) {
- TCHAR szOsBuffer[256] = {0};
- TCHAR *os = szOsBuffer;
+ wchar_t szOsBuffer[256] = {0};
+ wchar_t *os = szOsBuffer;
if (ppro->m_options.ShowOSVersion) {
if (!GetOSDisplayString(szOsBuffer, _countof(szOsBuffer)))
mir_tstrncpy(szOsBuffer, L"", _countof(szOsBuffer));
else {
- TCHAR *szOsWindows = L"Microsoft Windows";
+ wchar_t *szOsWindows = L"Microsoft Windows";
size_t nOsWindowsLength = mir_tstrlen(szOsWindows);
- if (!_tcsnicmp(szOsBuffer, szOsWindows, nOsWindowsLength))
+ if (!wcsnicmp(szOsBuffer, szOsWindows, nOsWindowsLength))
os += nOsWindowsLength + 1;
}
}
diff --git a/protocols/JabberG/src/jabber_caps.h b/protocols/JabberG/src/jabber_caps.h
index d9ed0422c4..b4b9e78ec2 100644
--- a/protocols/JabberG/src/jabber_caps.h
+++ b/protocols/JabberG/src/jabber_caps.h
@@ -207,14 +207,14 @@ class CJabberClientPartialCaps
{
protected:
- TCHAR *m_szVer;
+ wchar_t *m_szVer;
JabberCapsBits m_jcbCaps;
CJabberClientPartialCaps *m_pNext;
int m_nIqId;
DWORD m_dwRequestTime;
public:
- CJabberClientPartialCaps(const TCHAR *szVer);
+ CJabberClientPartialCaps(const wchar_t *szVer);
~CJabberClientPartialCaps();
CJabberClientPartialCaps* SetNext(CJabberClientPartialCaps *pCaps);
@@ -225,7 +225,7 @@ public:
void SetCaps(JabberCapsBits jcbCaps, int nIqId = -1);
JabberCapsBits GetCaps();
- __inline TCHAR* GetVersion()
+ __inline wchar_t* GetVersion()
{ return m_szVer;
}
@@ -238,16 +238,16 @@ class CJabberClientCaps
{
protected:
- TCHAR *m_szNode;
+ wchar_t *m_szNode;
CJabberClientPartialCaps *m_pCaps;
CJabberClientCaps *m_pNext;
protected:
- CJabberClientPartialCaps* FindByVersion(const TCHAR *szVer);
+ CJabberClientPartialCaps* FindByVersion(const wchar_t *szVer);
CJabberClientPartialCaps* FindById(int nIqId);
public:
- CJabberClientCaps(const TCHAR *szNode);
+ CJabberClientCaps(const wchar_t *szNode);
~CJabberClientCaps();
CJabberClientCaps* SetNext(CJabberClientCaps *pClient);
@@ -255,11 +255,11 @@ public:
{ return m_pNext;
}
- JabberCapsBits GetPartialCaps(TCHAR *szVer);
- BOOL SetPartialCaps(const TCHAR *szVer, JabberCapsBits jcbCaps, int nIqId = -1);
+ JabberCapsBits GetPartialCaps(wchar_t *szVer);
+ BOOL SetPartialCaps(const wchar_t *szVer, JabberCapsBits jcbCaps, int nIqId = -1);
BOOL SetPartialCaps(int nIqId, JabberCapsBits jcbCaps);
- __inline TCHAR* GetNode()
+ __inline wchar_t* GetNode()
{ return m_szNode;
}
};
@@ -273,7 +273,7 @@ protected:
CJabberProto *ppro;
protected:
- CJabberClientCaps *FindClient(const TCHAR *szNode);
+ CJabberClientCaps *FindClient(const wchar_t *szNode);
public:
CJabberClientCapsManager(CJabberProto *proto);
@@ -281,11 +281,11 @@ public:
void AddDefaultCaps();
- JabberCapsBits GetClientCaps(TCHAR *szNode, TCHAR *szVer);
- BOOL SetClientCaps(const TCHAR *szNode, const TCHAR *szVer, JabberCapsBits jcbCaps, int nIqId = -1);
+ JabberCapsBits GetClientCaps(wchar_t *szNode, wchar_t *szVer);
+ BOOL SetClientCaps(const wchar_t *szNode, const wchar_t *szVer, JabberCapsBits jcbCaps, int nIqId = -1);
BOOL SetClientCaps(int nIqId, JabberCapsBits jcbCaps);
- BOOL HandleInfoRequest(HXML iqNode, CJabberIqInfo *pInfo, const TCHAR *szNode);
+ BOOL HandleInfoRequest(HXML iqNode, CJabberIqInfo *pInfo, const wchar_t *szNode);
};
struct JabberFeatCapPair
@@ -308,10 +308,10 @@ struct JabberFeatCapPairExt
struct JabberFeatCapPairDynamic
{
- TCHAR *szExt;
- TCHAR *szFeature;
+ wchar_t *szExt;
+ wchar_t *szFeature;
JabberCapsBits jcbCap;
- TCHAR *szDescription;
+ wchar_t *szDescription;
};
extern const JabberFeatCapPair g_JabberFeatCapPairs[];
diff --git a/protocols/JabberG/src/jabber_captcha.cpp b/protocols/JabberG/src/jabber_captcha.cpp
index 53edb29bbf..159b9c15a0 100644
--- a/protocols/JabberG/src/jabber_captcha.cpp
+++ b/protocols/JabberG/src/jabber_captcha.cpp
@@ -35,7 +35,7 @@ struct CAPTCHA_FORM_PARAMS
LPCTSTR hint;
HBITMAP bmp;
int w,h;
- TCHAR Result[MAX_PATH];
+ wchar_t Result[MAX_PATH];
};
INT_PTR CALLBACK JabberCaptchaFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -165,7 +165,7 @@ bool CJabberProto::ProcessCaptcha(HXML node, HXML parentNode, ThreadData *info)
return true;
}
-void CJabberProto::sendCaptchaResult(TCHAR* buf, ThreadData *info, LPCTSTR from, LPCTSTR challenge, LPCTSTR fromjid, LPCTSTR sid)
+void CJabberProto::sendCaptchaResult(wchar_t* buf, ThreadData *info, LPCTSTR from, LPCTSTR challenge, LPCTSTR fromjid, LPCTSTR sid)
{
XmlNodeIq iq(L"set", SerialNext());
HXML query= iq <<XATTR(L"to", from) << XCHILD(L"captcha") << XATTR(L"xmlns", L"urn:xmpp:captcha") << XCHILD (L"x") << XATTR(L"xmlns", JABBER_FEAT_DATA_FORMS) << XATTR(L"type", L"submit");
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index 40cdb9168c..c260b23348 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -57,11 +57,11 @@ struct TRoleOrAffiliationInfo
{
int value;
int id;
- TCHAR *title_en;
+ wchar_t *title_en;
int min_role;
int min_affiliation;
- TCHAR *title;
+ wchar_t *title;
BOOL check(JABBER_RESOURCE_STATUS *me, JABBER_RESOURCE_STATUS *him)
{
@@ -80,23 +80,23 @@ struct TRoleOrAffiliationInfo
static TRoleOrAffiliationInfo sttAffiliationItems[] =
{
- { AFFILIATION_NONE, IDM_SET_NONE, LPGENT("None"), ROLE_NONE, AFFILIATION_ADMIN },
- { AFFILIATION_MEMBER, IDM_SET_MEMBER, LPGENT("Member"), ROLE_NONE, AFFILIATION_ADMIN },
- { AFFILIATION_ADMIN, IDM_SET_ADMIN, LPGENT("Admin"), ROLE_NONE, AFFILIATION_OWNER },
- { AFFILIATION_OWNER, IDM_SET_OWNER, LPGENT("Owner"), ROLE_NONE, AFFILIATION_OWNER },
+ { AFFILIATION_NONE, IDM_SET_NONE, LPGENW("None"), ROLE_NONE, AFFILIATION_ADMIN },
+ { AFFILIATION_MEMBER, IDM_SET_MEMBER, LPGENW("Member"), ROLE_NONE, AFFILIATION_ADMIN },
+ { AFFILIATION_ADMIN, IDM_SET_ADMIN, LPGENW("Admin"), ROLE_NONE, AFFILIATION_OWNER },
+ { AFFILIATION_OWNER, IDM_SET_OWNER, LPGENW("Owner"), ROLE_NONE, AFFILIATION_OWNER },
};
static TRoleOrAffiliationInfo sttRoleItems[] =
{
- { ROLE_VISITOR, IDM_SET_VISITOR, LPGENT("Visitor"), ROLE_MODERATOR, AFFILIATION_NONE },
- { ROLE_PARTICIPANT, IDM_SET_PARTICIPANT, LPGENT("Participant"), ROLE_MODERATOR, AFFILIATION_NONE },
- { ROLE_MODERATOR, IDM_SET_MODERATOR, LPGENT("Moderator"), ROLE_MODERATOR, AFFILIATION_ADMIN },
+ { ROLE_VISITOR, IDM_SET_VISITOR, LPGENW("Visitor"), ROLE_MODERATOR, AFFILIATION_NONE },
+ { ROLE_PARTICIPANT, IDM_SET_PARTICIPANT, LPGENW("Participant"), ROLE_MODERATOR, AFFILIATION_NONE },
+ { ROLE_MODERATOR, IDM_SET_MODERATOR, LPGENW("Moderator"), ROLE_MODERATOR, AFFILIATION_ADMIN },
};
/////////////////////////////////////////////////////////////////////////////////////////
// JabberGcInit - initializes the new chat
-static const TCHAR *sttStatuses[] = { LPGENT("Visitors"), LPGENT("Participants"), LPGENT("Moderators"), LPGENT("Owners") };
+static const wchar_t *sttStatuses[] = { LPGENW("Visitors"), LPGENW("Participants"), LPGENW("Moderators"), LPGENW("Owners") };
int JabberGcGetStatus(JABBER_GC_AFFILIATION a, JABBER_GC_ROLE r)
{
@@ -194,7 +194,7 @@ void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, pResourceStatus
case INFO_STATUS:
if (m_options.GcLogStatuses) {
- TCHAR *ptszDescr = pcli->pfnGetStatusModeDescription(user->m_iStatus, 0);
+ wchar_t *ptszDescr = pcli->pfnGetStatusModeDescription(user->m_iStatus, 0);
if (user->m_tszStatusMessage)
buf.Format(TranslateT("User %s changed status to %s with message: %s"),
user->m_tszResourceName, ptszDescr, user->m_tszStatusMessage);
@@ -210,7 +210,7 @@ void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, pResourceStatus
case INFO_AFFILIATION:
if (m_options.GcLogAffiliations) {
- TCHAR *name = NULL;
+ wchar_t *name = NULL;
switch (user->m_affiliation) {
case AFFILIATION_NONE: name = TranslateT("None"); break;
case AFFILIATION_MEMBER: name = TranslateT("Member"); break;
@@ -225,7 +225,7 @@ void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, pResourceStatus
case INFO_ROLE:
if (m_options.GcLogRoles) {
- TCHAR *name = NULL;
+ wchar_t *name = NULL;
switch (user->m_role) {
case ROLE_NONE: name = TranslateT("None"); break;
case ROLE_VISITOR: name = TranslateT("Visitor"); break;
@@ -253,11 +253,11 @@ void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, pResourceStatus
}
}
-void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const TCHAR *resource, const TCHAR *nick, const TCHAR *jid, int action, HXML reason, int nStatusCode)
+void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const wchar_t *resource, const wchar_t *nick, const wchar_t *jid, int action, HXML reason, int nStatusCode)
{
int statusToSet = 0;
- const TCHAR *szReason = XmlGetText(reason);
+ const wchar_t *szReason = XmlGetText(reason);
if (szReason == NULL) {
if (nStatusCode == 322)
szReason = TranslateT("because room is now members-only");
@@ -328,12 +328,12 @@ void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const TCHAR *
void CJabberProto::GcQuit(JABBER_LIST_ITEM *item, int code, HXML reason)
{
- TCHAR *szMessage = NULL;
+ wchar_t *szMessage = NULL;
if (code != 307 && code != 301) {
ptrT tszMessage(getTStringA("GcMsgQuit"));
if (tszMessage != NULL)
- szMessage = NEWTSTR_ALLOCA(tszMessage);
+ szMessage = NEWWSTR_ALLOCA(tszMessage);
else
szMessage = TranslateTS(JABBER_GC_MSG_QUIT);
}
@@ -352,7 +352,7 @@ void CJabberProto::GcQuit(JABBER_LIST_ITEM *item, int code, HXML reason)
item->bChatActive = false;
if (m_bJabberOnline) {
- TCHAR szPresenceTo[JABBER_MAX_JID_LEN];
+ wchar_t szPresenceTo[JABBER_MAX_JID_LEN];
mir_sntprintf(szPresenceTo, L"%s/%s", item->jid, item->nick);
m_ThreadInfo->send(
@@ -402,30 +402,30 @@ static void sttShowGcMenuItems(GCMENUITEMS *items, DWORD *ids, int type)
static gc_item sttLogListItems[] =
{
- { LPGENT("Change &nickname"), IDM_NICK, MENU_ITEM },
- { LPGENT("&Invite a user"), IDM_INVITE, MENU_ITEM },
+ { LPGENW("Change &nickname"), IDM_NICK, MENU_ITEM },
+ { LPGENW("&Invite a user"), IDM_INVITE, MENU_ITEM },
{ NULL, 0, MENU_SEPARATOR },
- { LPGENT("&Roles"), IDM_ROLE, MENU_NEWPOPUP },
- { LPGENT("&Participant list"), IDM_LST_PARTICIPANT, MENU_POPUPITEM },
- { LPGENT("&Moderator list"), IDM_LST_MODERATOR, MENU_POPUPITEM },
+ { LPGENW("&Roles"), IDM_ROLE, MENU_NEWPOPUP },
+ { LPGENW("&Participant list"), IDM_LST_PARTICIPANT, MENU_POPUPITEM },
+ { LPGENW("&Moderator list"), IDM_LST_MODERATOR, MENU_POPUPITEM },
- { LPGENT("&Affiliations"), IDM_AFFLTN, MENU_NEWPOPUP },
- { LPGENT("&Member list"), IDM_LST_MEMBER, MENU_POPUPITEM },
- { LPGENT("&Admin list"), IDM_LST_ADMIN, MENU_POPUPITEM },
- { LPGENT("&Owner list"), IDM_LST_OWNER, MENU_POPUPITEM },
+ { LPGENW("&Affiliations"), IDM_AFFLTN, MENU_NEWPOPUP },
+ { LPGENW("&Member list"), IDM_LST_MEMBER, MENU_POPUPITEM },
+ { LPGENW("&Admin list"), IDM_LST_ADMIN, MENU_POPUPITEM },
+ { LPGENW("&Owner list"), IDM_LST_OWNER, MENU_POPUPITEM },
{ NULL, 0, MENU_POPUPSEPARATOR },
- { LPGENT("Outcast list (&ban)"), IDM_LST_BAN, MENU_POPUPITEM },
+ { LPGENW("Outcast list (&ban)"), IDM_LST_BAN, MENU_POPUPITEM },
- { LPGENT("&Room options"), 0, MENU_NEWPOPUP },
- { LPGENT("View/change &topic"), IDM_TOPIC, MENU_POPUPITEM },
- { LPGENT("Add to &bookmarks"), IDM_BOOKMARKS, MENU_POPUPITEM },
- { LPGENT("&Configure..."), IDM_CONFIG, MENU_POPUPITEM },
- { LPGENT("&Destroy room"), IDM_DESTROY, MENU_POPUPITEM },
+ { LPGENW("&Room options"), 0, MENU_NEWPOPUP },
+ { LPGENW("View/change &topic"), IDM_TOPIC, MENU_POPUPITEM },
+ { LPGENW("Add to &bookmarks"), IDM_BOOKMARKS, MENU_POPUPITEM },
+ { LPGENW("&Configure..."), IDM_CONFIG, MENU_POPUPITEM },
+ { LPGENW("&Destroy room"), IDM_DESTROY, MENU_POPUPITEM },
{ NULL, 0, MENU_SEPARATOR },
- { LPGENT("Lin&ks"), 0, MENU_NEWPOPUP },
+ { LPGENW("Lin&ks"), 0, MENU_NEWPOPUP },
{ NULL, IDM_LINK0, 0 },
{ NULL, IDM_LINK1, 0 },
{ NULL, IDM_LINK2, 0 },
@@ -437,33 +437,33 @@ static gc_item sttLogListItems[] =
{ NULL, IDM_LINK8, 0 },
{ NULL, IDM_LINK9, 0 },
- { LPGENT("Copy room &JID"), IDM_CPY_RJID, MENU_ITEM },
- { LPGENT("Copy room topic"), IDM_CPY_TOPIC, MENU_ITEM },
+ { LPGENW("Copy room &JID"), IDM_CPY_RJID, MENU_ITEM },
+ { LPGENW("Copy room topic"), IDM_CPY_TOPIC, MENU_ITEM },
{ NULL, 0, MENU_SEPARATOR },
- { LPGENT("&Send presence"), 0, MENU_NEWPOPUP },
- { LPGENT("Online"), IDM_PRESENCE_ONLINE, MENU_POPUPITEM },
- { LPGENT("Away"), IDM_PRESENCE_AWAY, MENU_POPUPITEM },
- { LPGENT("Not available"), IDM_PRESENCE_NA, MENU_POPUPITEM },
- { LPGENT("Do not disturb"), IDM_PRESENCE_DND, MENU_POPUPITEM },
- { LPGENT("Free for chat"), IDM_PRESENCE_FREE4CHAT, MENU_POPUPITEM },
+ { LPGENW("&Send presence"), 0, MENU_NEWPOPUP },
+ { LPGENW("Online"), IDM_PRESENCE_ONLINE, MENU_POPUPITEM },
+ { LPGENW("Away"), IDM_PRESENCE_AWAY, MENU_POPUPITEM },
+ { LPGENW("Not available"), IDM_PRESENCE_NA, MENU_POPUPITEM },
+ { LPGENW("Do not disturb"), IDM_PRESENCE_DND, MENU_POPUPITEM },
+ { LPGENW("Free for chat"), IDM_PRESENCE_FREE4CHAT, MENU_POPUPITEM },
- { LPGENT("&Leave chat session"), IDM_LEAVE, MENU_ITEM }
+ { LPGENW("&Leave chat session"), IDM_LEAVE, MENU_ITEM }
};
-static TCHAR sttRJidBuf[JABBER_MAX_JID_LEN] = { 0 };
+static wchar_t sttRJidBuf[JABBER_MAX_JID_LEN] = { 0 };
static gc_item sttListItems[] =
{
- { LPGENT("&Slap"), IDM_SLAP, MENU_ITEM }, // 0
- { LPGENT("&User details"), IDM_VCARD, MENU_ITEM }, // 1
- { LPGENT("Member &info"), IDM_INFO, MENU_ITEM }, // 2
+ { LPGENW("&Slap"), IDM_SLAP, MENU_ITEM }, // 0
+ { LPGENW("&User details"), IDM_VCARD, MENU_ITEM }, // 1
+ { LPGENW("Member &info"), IDM_INFO, MENU_ITEM }, // 2
{ sttRJidBuf, 0, MENU_NEWPOPUP }, // 3 -> accessed explicitly by index!!!
- { LPGENT("User &details"), IDM_RJID_VCARD, MENU_POPUPITEM },
- { LPGENT("&Add to roster"), IDM_RJID_ADD, MENU_POPUPITEM },
- { LPGENT("&Copy to clipboard"), IDM_RJID_COPY, MENU_POPUPITEM },
+ { LPGENW("User &details"), IDM_RJID_VCARD, MENU_POPUPITEM },
+ { LPGENW("&Add to roster"), IDM_RJID_ADD, MENU_POPUPITEM },
+ { LPGENW("&Copy to clipboard"), IDM_RJID_COPY, MENU_POPUPITEM },
- { LPGENT("Invite to room"), 0, MENU_NEWPOPUP },
+ { LPGENW("Invite to room"), 0, MENU_NEWPOPUP },
{ NULL, IDM_LINK0, 0 },
{ NULL, IDM_LINK1, 0 },
{ NULL, IDM_LINK2, 0 },
@@ -477,24 +477,24 @@ static gc_item sttListItems[] =
{ NULL, 0, MENU_SEPARATOR },
- { LPGENT("Set &role"), IDM_ROLE, MENU_NEWPOPUP },
- { LPGENT("&Visitor"), IDM_SET_VISITOR, MENU_POPUPITEM },
- { LPGENT("&Participant"), IDM_SET_PARTICIPANT, MENU_POPUPITEM },
- { LPGENT("&Moderator"), IDM_SET_MODERATOR, MENU_POPUPITEM },
+ { LPGENW("Set &role"), IDM_ROLE, MENU_NEWPOPUP },
+ { LPGENW("&Visitor"), IDM_SET_VISITOR, MENU_POPUPITEM },
+ { LPGENW("&Participant"), IDM_SET_PARTICIPANT, MENU_POPUPITEM },
+ { LPGENW("&Moderator"), IDM_SET_MODERATOR, MENU_POPUPITEM },
- { LPGENT("Set &affiliation"), IDM_AFFLTN, MENU_NEWPOPUP },
- { LPGENT("&None"), IDM_SET_NONE, MENU_POPUPITEM },
- { LPGENT("&Member"), IDM_SET_MEMBER, MENU_POPUPITEM },
- { LPGENT("&Admin"), IDM_SET_ADMIN, MENU_POPUPITEM },
- { LPGENT("&Owner"), IDM_SET_OWNER, MENU_POPUPITEM },
+ { LPGENW("Set &affiliation"), IDM_AFFLTN, MENU_NEWPOPUP },
+ { LPGENW("&None"), IDM_SET_NONE, MENU_POPUPITEM },
+ { LPGENW("&Member"), IDM_SET_MEMBER, MENU_POPUPITEM },
+ { LPGENW("&Admin"), IDM_SET_ADMIN, MENU_POPUPITEM },
+ { LPGENW("&Owner"), IDM_SET_OWNER, MENU_POPUPITEM },
{ NULL, 0, MENU_POPUPSEPARATOR },
- { LPGENT("Outcast (&ban)"), IDM_SET_BAN, MENU_POPUPITEM },
+ { LPGENW("Outcast (&ban)"), IDM_SET_BAN, MENU_POPUPITEM },
- { LPGENT("&Kick"), IDM_KICK, MENU_ITEM },
+ { LPGENW("&Kick"), IDM_KICK, MENU_ITEM },
{ NULL, 0, MENU_SEPARATOR },
- { LPGENT("Copy &nickname"), IDM_CPY_NICK, MENU_ITEM },
- { LPGENT("Copy real &JID"), IDM_CPY_RJID, MENU_ITEM },
- { LPGENT("Copy in-room JID"), IDM_CPY_INROOMJID, MENU_ITEM }
+ { LPGENW("Copy &nickname"), IDM_CPY_NICK, MENU_ITEM },
+ { LPGENW("Copy real &JID"), IDM_CPY_RJID, MENU_ITEM },
+ { LPGENW("Copy in-room JID"), IDM_CPY_INROOMJID, MENU_ITEM }
};
int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam)
@@ -520,7 +520,7 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam)
}
if (gcmi->Type == MENU_ON_LOG) {
- static TCHAR url_buf[1024] = { 0 };
+ static wchar_t url_buf[1024] = { 0 };
gcmi->nItems = _countof(sttLogListItems);
gcmi->Item = sttLogListItems;
@@ -532,16 +532,16 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam)
sttSetupGcMenuItem(gcmi, 0, FALSE);
int idx = IDM_LINK0;
- TCHAR *ptszStatusMsg = item->getTemp()->m_tszStatusMessage;
+ wchar_t *ptszStatusMsg = item->getTemp()->m_tszStatusMessage;
if (ptszStatusMsg && *ptszStatusMsg) {
- TCHAR *bufPtr = url_buf;
- for (TCHAR *p = _tcsstr(ptszStatusMsg, L"http"); p && *p; p = _tcsstr(p + 1, L"http")) {
- if (!_tcsncmp(p, L"http://", 7) || !_tcsncmp(p, L"https://", 8)) {
+ wchar_t *bufPtr = url_buf;
+ for (wchar_t *p = wcsstr(ptszStatusMsg, L"http"); p && *p; p = wcsstr(p + 1, L"http")) {
+ if (!wcsncmp(p, L"http://", 7) || !wcsncmp(p, L"https://", 8)) {
mir_tstrncpy(bufPtr, p, _countof(url_buf) - (bufPtr - url_buf));
gc_item *pItem = sttFindGcMenuItem(gcmi, idx);
pItem->pszDesc = bufPtr;
pItem->uType = MENU_POPUPITEM;
- for (; *bufPtr && !_istspace(*bufPtr); ++bufPtr);
+ for (; *bufPtr && !iswspace(*bufPtr); ++bufPtr);
*bufPtr++ = 0;
if (++idx > IDM_LINK9)
@@ -603,7 +603,7 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam)
if (him->m_tszRealJid && *him->m_tszRealJid) {
mir_sntprintf(sttRJidBuf, TranslateT("Real &JID: %s"), him->m_tszRealJid);
- if (TCHAR *tmp = _tcschr(sttRJidBuf, _T('/'))) *tmp = 0;
+ if (wchar_t *tmp = wcschr(sttRJidBuf, '/')) *tmp = 0;
if (MCONTACT hContact = HContactFromJID(him->m_tszRealJid)) {
gcmi->Item[3].uType = MENU_HMENU;
@@ -653,11 +653,11 @@ class CGroupchatInviteDlg : public CJabberDlgBase
struct JabberGcLogInviteDlgJidData
{
int hItem;
- TCHAR jid[JABBER_MAX_JID_LEN];
+ wchar_t jid[JABBER_MAX_JID_LEN];
};
LIST<JabberGcLogInviteDlgJidData> m_newJids;
- TCHAR *m_room;
+ wchar_t *m_room;
CCtrlButton m_btnInvite;
CCtrlEdit m_txtNewJid;
@@ -688,7 +688,7 @@ class CGroupchatInviteDlg : public CJabberDlgBase
m_clc.SetTextColor(i, GetSysColor(COLOR_WINDOWTEXT));
}
- void InviteUser(TCHAR *pUser, TCHAR *text)
+ void InviteUser(wchar_t *pUser, wchar_t *text)
{
XmlNode msg(L"message");
HXML invite = msg << XATTR(L"to", m_room) << XATTRID(m_proto->SerialNext())
@@ -701,7 +701,7 @@ class CGroupchatInviteDlg : public CJabberDlgBase
}
public:
- CGroupchatInviteDlg(CJabberProto *ppro, const TCHAR *room) :
+ CGroupchatInviteDlg(CJabberProto *ppro, const wchar_t *room) :
CSuper(ppro, IDD_GROUPCHAT_INVITE, NULL),
m_newJids(1),
m_btnInvite(this, IDC_INVITE),
@@ -741,7 +741,7 @@ public:
void OnCommand_AddJid(CCtrlButton*)
{
- TCHAR buf[JABBER_MAX_JID_LEN];
+ wchar_t buf[JABBER_MAX_JID_LEN];
m_txtNewJid.GetText(buf, _countof(buf));
m_txtNewJid.SetTextA("");
@@ -805,17 +805,17 @@ public:
/////////////////////////////////////////////////////////////////////////////////////////
// Context menu processing
-void CJabberProto::AdminSet(const TCHAR *to, const TCHAR *ns, const TCHAR *szItem, const TCHAR *itemVal, const TCHAR *var, const TCHAR *varVal)
+void CJabberProto::AdminSet(const wchar_t *to, const wchar_t *ns, const wchar_t *szItem, const wchar_t *itemVal, const wchar_t *var, const wchar_t *varVal)
{
m_ThreadInfo->send(XmlNodeIq(L"set", SerialNext(), to) << XQUERY(ns) << XCHILD(L"item") << XATTR(szItem, itemVal) << XATTR(var, varVal));
}
-void CJabberProto::AdminSetReason(const TCHAR *to, const TCHAR *ns, const TCHAR *szItem, const TCHAR *itemVal, const TCHAR *var, const TCHAR *varVal, const TCHAR *rsn)
+void CJabberProto::AdminSetReason(const wchar_t *to, const wchar_t *ns, const wchar_t *szItem, const wchar_t *itemVal, const wchar_t *var, const wchar_t *varVal, const wchar_t *rsn)
{
m_ThreadInfo->send(XmlNodeIq(L"set", SerialNext(), to) << XQUERY(ns) << XCHILD(L"item") << XATTR(szItem, itemVal) << XATTR(var, varVal) << XCHILD(L"reason", rsn));
}
-void CJabberProto::AdminGet(const TCHAR *to, const TCHAR *ns, const TCHAR *var, const TCHAR *varVal, JABBER_IQ_HANDLER foo)
+void CJabberProto::AdminGet(const wchar_t *to, const wchar_t *ns, const wchar_t *var, const wchar_t *varVal, JABBER_IQ_HANDLER foo)
{
m_ThreadInfo->send(XmlNodeIq(AddIQ(foo, JABBER_IQ_TYPE_GET, to))
<< XQUERY(ns) << XCHILD(L"item") << XATTR(var, varVal));
@@ -859,7 +859,7 @@ static INT_PTR CALLBACK sttUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
SendDlgItemMessage(hwndDlg, IDC_ICO_STATUS, STM_SETICON, (WPARAM)Skin_LoadProtoIcon(dat->ppro->m_szModuleName, dat->him->m_iStatus), 0);
- TCHAR buf[256];
+ wchar_t buf[256];
mir_sntprintf(buf, TranslateT("%s from\n%s"), dat->him->m_tszResourceName, dat->item->jid);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, buf);
@@ -913,7 +913,7 @@ static INT_PTR CALLBACK sttUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
if (dat->him->m_affiliation == value)
break;
- TCHAR szBareJid[JABBER_MAX_JID_LEN];
+ wchar_t szBareJid[JABBER_MAX_JID_LEN];
JabberStripJid(dat->him->m_tszRealJid, szBareJid, _countof(szBareJid));
switch (value) {
@@ -1014,9 +1014,9 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
if (szMessage == NULL)
szMessage = mir_tstrdup(TranslateTS(JABBER_GC_MSG_SLAP));
- TCHAR buf[256];
+ wchar_t buf[256];
// do not use snprintf to avoid possible problems with % symbol
- if (TCHAR *p = _tcsstr(szMessage, L"%s")) {
+ if (wchar_t *p = wcsstr(szMessage, L"%s")) {
*p = 0;
mir_sntprintf(buf, L"%s%s%s", szMessage, him->m_tszResourceName, p + 2);
}
@@ -1060,7 +1060,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
dwLastBanKickTime = GetTickCount();
szBuffer.Format(L"%s: ", me->m_tszResourceName);
szTitle.Format(TranslateT("Reason to kick %s"), him->m_tszResourceName);
- TCHAR *resourceName_copy = mir_tstrdup(him->m_tszResourceName); // copy resource name to prevent possible crash if user list rebuilds
+ wchar_t *resourceName_copy = mir_tstrdup(him->m_tszResourceName); // copy resource name to prevent possible crash if user list rebuilds
if (ppro->EnterString(szBuffer, szTitle, ESF_MULTILINE, "gcReason_"))
ppro->m_ThreadInfo->send(
XmlNodeIq(L"set", ppro->SerialNext(), item->jid) << XQUERY(JABBER_FEAT_MUC_ADMIN)
@@ -1090,7 +1090,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
case IDM_SET_NONE:
if (him->m_affiliation != AFFILIATION_NONE) {
if (him->m_tszRealJid) {
- TCHAR szBareJid[JABBER_MAX_JID_LEN];
+ wchar_t szBareJid[JABBER_MAX_JID_LEN];
JabberStripJid(him->m_tszRealJid, szBareJid, _countof(szBareJid));
ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, L"jid", szBareJid, L"affiliation", L"none");
}
@@ -1101,7 +1101,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
case IDM_SET_MEMBER:
if (him->m_affiliation != AFFILIATION_MEMBER) {
if (him->m_tszRealJid) {
- TCHAR szBareJid[JABBER_MAX_JID_LEN];
+ wchar_t szBareJid[JABBER_MAX_JID_LEN];
JabberStripJid(him->m_tszRealJid, szBareJid, _countof(szBareJid));
ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, L"jid", szBareJid, L"affiliation", L"member");
}
@@ -1112,7 +1112,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
case IDM_SET_ADMIN:
if (him->m_affiliation != AFFILIATION_ADMIN) {
if (him->m_tszRealJid) {
- TCHAR szBareJid[JABBER_MAX_JID_LEN];
+ wchar_t szBareJid[JABBER_MAX_JID_LEN];
JabberStripJid(him->m_tszRealJid, szBareJid, _countof(szBareJid));
ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, L"jid", szBareJid, L"affiliation", L"admin");
}
@@ -1123,7 +1123,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
case IDM_SET_OWNER:
if (him->m_affiliation != AFFILIATION_OWNER) {
if (him->m_tszRealJid) {
- TCHAR szBareJid[JABBER_MAX_JID_LEN];
+ wchar_t szBareJid[JABBER_MAX_JID_LEN];
JabberStripJid(him->m_tszRealJid, szBareJid, _countof(szBareJid));
ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, L"jid", szBareJid, L"affiliation", L"owner");
}
@@ -1134,7 +1134,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
case IDM_SET_BAN:
if ((GetTickCount() - dwLastBanKickTime) > BAN_KICK_INTERVAL) {
if (him->m_tszRealJid && *him->m_tszRealJid) {
- TCHAR szVictimBareJid[JABBER_MAX_JID_LEN];
+ wchar_t szVictimBareJid[JABBER_MAX_JID_LEN];
JabberStripJid(him->m_tszRealJid, szVictimBareJid, _countof(szVictimBareJid));
szBuffer.Format(L"%s: ", me->m_tszResourceName);
@@ -1153,9 +1153,9 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
case IDM_LINK0: case IDM_LINK1: case IDM_LINK2: case IDM_LINK3: case IDM_LINK4:
case IDM_LINK5: case IDM_LINK6: case IDM_LINK7: case IDM_LINK8: case IDM_LINK9:
if ((GetTickCount() - dwLastBanKickTime) > BAN_KICK_INTERVAL) {
- TCHAR *resourceName_copy = NEWTSTR_ALLOCA(him->m_tszResourceName); // copy resource name to prevent possible crash if user list rebuilds
+ wchar_t *resourceName_copy = NEWWSTR_ALLOCA(him->m_tszResourceName); // copy resource name to prevent possible crash if user list rebuilds
- TCHAR *szInviteTo = 0;
+ wchar_t *szInviteTo = 0;
int idx = gch->dwData - IDM_LINK0;
LISTFOREACH(i, ppro, LIST_CHATROOM)
{
@@ -1201,8 +1201,8 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
case IDM_RJID_VCARD:
if (him->m_tszRealJid && *him->m_tszRealJid) {
- TCHAR *jid = NEWTSTR_ALLOCA(him->m_tszRealJid);
- if (TCHAR *tmp = _tcschr(jid, _T('/')))
+ wchar_t *jid = NEWWSTR_ALLOCA(him->m_tszRealJid);
+ if (wchar_t *tmp = wcschr(jid, '/'))
*tmp = 0;
MCONTACT hContact = ppro->AddToListByJID(jid, PALF_TEMPORARY);
@@ -1218,10 +1218,10 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
psr.flags = PSR_TCHAR;
- psr.id.t = NEWTSTR_ALLOCA(him->m_tszRealJid);
- if (TCHAR *tmp = _tcschr(psr.id.t, _T('/')))
+ psr.id.w = NEWWSTR_ALLOCA(him->m_tszRealJid);
+ if (wchar_t *tmp = wcschr(psr.id.w, '/'))
*tmp = 0;
- psr.nick.t = psr.id.t;
+ psr.nick.w = psr.id.w;
ADDCONTACTSTRUCT acs = { 0 };
acs.handleType = HANDLE_SEARCHRESULT;
@@ -1278,7 +1278,7 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g
szBuffer = item->nick;
if (ppro->EnterString(szBuffer, szTitle, ESF_COMBO, "gcNick_")) {
if (ppro->ListGetItemPtr(LIST_CHATROOM, gch->pDest->ptszID) != NULL) {
- TCHAR text[1024];
+ wchar_t text[1024];
mir_sntprintf(text, L"%s/%s", gch->pDest->ptszID, szBuffer);
ppro->SendPresenceTo(ppro->m_iStatus == ID_STATUS_INVISIBLE ? ID_STATUS_ONLINE : ppro->m_iStatus, text, NULL);
}
@@ -1333,7 +1333,7 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g
case IDM_LINK5: case IDM_LINK6: case IDM_LINK7: case IDM_LINK8: case IDM_LINK9:
{
int idx = IDM_LINK0;
- for (TCHAR *p = _tcsstr(item->getTemp()->m_tszStatusMessage, L"http://"); p && *p; p = _tcsstr(p + 1, L"http://")) {
+ for (wchar_t *p = wcsstr(item->getTemp()->m_tszStatusMessage, L"http://"); p && *p; p = wcsstr(p + 1, L"http://")) {
if (idx == gch->dwData) {
char *bufPtr, *url = mir_t2a(p);
for (bufPtr = url; *bufPtr && !isspace(*bufPtr); ++bufPtr);
@@ -1361,9 +1361,9 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g
/////////////////////////////////////////////////////////////////////////////////////////
// Sends a private message to a chat user
-static void sttSendPrivateMessage(CJabberProto *ppro, JABBER_LIST_ITEM *item, const TCHAR *nick)
+static void sttSendPrivateMessage(CJabberProto *ppro, JABBER_LIST_ITEM *item, const wchar_t *nick)
{
- TCHAR szFullJid[JABBER_MAX_JID_LEN];
+ wchar_t szFullJid[JABBER_MAX_JID_LEN];
mir_sntprintf(szFullJid, L"%s/%s", item->jid, nick);
MCONTACT hContact = ppro->DBCreateContact(szFullJid, NULL, true, false);
if (hContact != NULL) {
@@ -1400,10 +1400,10 @@ int CJabberProto::JabberGcEventHook(WPARAM, LPARAM lParam)
rtrimt(gch->ptszText);
if (m_bJabberOnline) {
- TCHAR tszID[100];
+ wchar_t tszID[100];
int64_t id = (_time64(0) << 16) + (GetTickCount() & 0xFFFF);
- TCHAR *buf = NEWTSTR_ALLOCA(gch->ptszText);
+ wchar_t *buf = NEWWSTR_ALLOCA(gch->ptszText);
UnEscapeChatTags(buf);
m_ThreadInfo->send(
XmlNode(L"message") << XATTR(L"id", _i64tot(id, tszID, 36)) << XATTR(L"to", item->jid) << XATTR(L"type", L"groupchat")
@@ -1436,20 +1436,20 @@ int CJabberProto::JabberGcEventHook(WPARAM, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////////////
-void CJabberProto::AddMucListItem(JABBER_MUC_JIDLIST_INFO* jidListInfo, const TCHAR* str, const TCHAR* rsn)
+void CJabberProto::AddMucListItem(JABBER_MUC_JIDLIST_INFO* jidListInfo, const wchar_t* str, const wchar_t* rsn)
{
- const TCHAR *field = (jidListInfo->type == MUC_BANLIST || _tcschr(str, '@')) ? L"jid" : L"nick";
- TCHAR *roomJid = jidListInfo->roomJid;
+ const wchar_t *field = (jidListInfo->type == MUC_BANLIST || wcschr(str, '@')) ? L"jid" : L"nick";
+ wchar_t *roomJid = jidListInfo->roomJid;
if (jidListInfo->type == MUC_BANLIST) {
AdminSetReason(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, L"affiliation", L"outcast", rsn);
AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, L"affiliation", L"outcast", &CJabberProto::OnIqResultMucGetBanList);
}
}
-void CJabberProto::AddMucListItem(JABBER_MUC_JIDLIST_INFO* jidListInfo, const TCHAR* str)
+void CJabberProto::AddMucListItem(JABBER_MUC_JIDLIST_INFO* jidListInfo, const wchar_t* str)
{
- const TCHAR *field = (jidListInfo->type == MUC_BANLIST || _tcschr(str, '@')) ? L"jid" : L"nick";
- TCHAR *roomJid = jidListInfo->roomJid;
+ const wchar_t *field = (jidListInfo->type == MUC_BANLIST || wcschr(str, '@')) ? L"jid" : L"nick";
+ wchar_t *roomJid = jidListInfo->roomJid;
switch (jidListInfo->type) {
case MUC_VOICELIST:
@@ -1479,9 +1479,9 @@ void CJabberProto::AddMucListItem(JABBER_MUC_JIDLIST_INFO* jidListInfo, const TC
}
}
-void CJabberProto::DeleteMucListItem(JABBER_MUC_JIDLIST_INFO *jidListInfo, const TCHAR *jid)
+void CJabberProto::DeleteMucListItem(JABBER_MUC_JIDLIST_INFO *jidListInfo, const wchar_t *jid)
{
- TCHAR *roomJid = jidListInfo->roomJid;
+ wchar_t *roomJid = jidListInfo->roomJid;
switch (jidListInfo->type) {
case MUC_VOICELIST: // change role to visitor (from participant)
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp
index 2d1250eb88..3070d0b223 100644
--- a/protocols/JabberG/src/jabber_console.cpp
+++ b/protocols/JabberG/src/jabber_console.cpp
@@ -123,7 +123,7 @@ bool CJabberProto::FilterXml(HXML node, DWORD flags)
mir_cslock lck(m_filterInfo.csPatternLock);
- const TCHAR *attrValue;
+ const wchar_t *attrValue;
switch (m_filterInfo.type) {
case TFilterInfo::T_JID:
attrValue = XmlGetAttrValue(node, (flags & JCPF_OUT) ? L"to" : L"from");
@@ -202,18 +202,18 @@ static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent)
if (flags&JCPF_OUT) sttAppendBufRaw(buf, "\\highlight4 ");
sttAppendBufRaw(buf, "<");
sttAppendBufRaw(buf, RTF_BEGINTAGNAME);
- sttAppendBufW(buf, (TCHAR*)XmlGetName(node));
+ sttAppendBufW(buf, (wchar_t*)XmlGetName(node));
sttAppendBufRaw(buf, RTF_ENDTAGNAME);
for (int i = 0; i < XmlGetAttrCount(node); i++) {
- TCHAR *attr = (TCHAR*)xmlGetAttrName(node, i);
+ wchar_t *attr = (wchar_t*)xmlGetAttrName(node, i);
sttAppendBufRaw(buf, " ");
sttAppendBufRaw(buf, RTF_BEGINATTRNAME);
sttAppendBufW(buf, attr);
sttAppendBufRaw(buf, RTF_ENDATTRNAME);
sttAppendBufRaw(buf, "=\"");
sttAppendBufRaw(buf, RTF_BEGINATTRVAL);
- sttAppendBufT(buf, (TCHAR*)XmlGetAttr(node, i));
+ sttAppendBufT(buf, (wchar_t*)XmlGetAttr(node, i));
sttAppendBufRaw(buf, "\"");
sttAppendBufRaw(buf, RTF_ENDATTRVAL);
}
@@ -274,7 +274,7 @@ static void sttJabberConsoleRebuildStrings(CJabberProto *ppro, HWND hwndCombo)
JABBER_LIST_ITEM *item = NULL;
int len = GetWindowTextLength(hwndCombo) + 1;
- TCHAR *buf = (TCHAR *)_alloca(len * sizeof(TCHAR));
+ wchar_t *buf = (wchar_t *)_alloca(len * sizeof(wchar_t));
GetWindowText(hwndCombo, buf, len);
SendMessage(hwndCombo, CB_RESETCONTENT, 0, 0);
@@ -300,7 +300,7 @@ static void sttJabberConsoleRebuildStrings(CJabberProto *ppro, HWND hwndCombo)
struct
{
int type;
- TCHAR *title;
+ wchar_t *title;
char *icon;
}
static filter_modes[] =
@@ -501,7 +501,7 @@ INT_PTR CJabberDlgConsole::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
MessageBox(m_hwnd, TranslateT("Can't send data while you are offline."), TranslateT("Jabber Error"), MB_ICONSTOP | MB_OK);
else {
int length = GetWindowTextLength(GetDlgItem(m_hwnd, IDC_CONSOLEIN)) + 1;
- TCHAR *textToSend = (TCHAR *)mir_alloc(length * sizeof(TCHAR));
+ wchar_t *textToSend = (wchar_t *)mir_alloc(length * sizeof(wchar_t));
GetDlgItemText(m_hwnd, IDC_CONSOLEIN, textToSend, length);
int bytesProcessed = 0;
@@ -550,7 +550,7 @@ INT_PTR CJabberDlgConsole::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
mir_cslock lck(m_proto->m_filterInfo.csPatternLock);
if (len > _countof(m_proto->m_filterInfo.pattern)) {
- TCHAR *buf = (TCHAR *)_alloca(len * sizeof(TCHAR));
+ wchar_t *buf = (wchar_t *)_alloca(len * sizeof(wchar_t));
SendDlgItemMessage(m_hwnd, IDC_CB_FILTER, CB_GETLBTEXT, idx, (LPARAM)buf);
mir_tstrncpy(m_proto->m_filterInfo.pattern, buf, _countof(m_proto->m_filterInfo.pattern));
}
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp
index 7d49935abc..e93545ca06 100644
--- a/protocols/JabberG/src/jabber_disco.cpp
+++ b/protocols/JabberG/src/jabber_disco.cpp
@@ -54,9 +54,9 @@ enum { SD_OVERLAY_NONE, SD_OVERLAY_FAIL, SD_OVERLAY_PROGRESS, SD_OVERLAY_REGISTE
static struct
{
- TCHAR *feature;
- TCHAR *category;
- TCHAR *type;
+ wchar_t *feature;
+ wchar_t *category;
+ wchar_t *type;
char *iconName;
int iconIndex;
int listIndex;
@@ -194,7 +194,7 @@ void CJabberProto::OnIqResultServiceDiscoveryInfo(HXML iqNode, CJabberIqInfo *pI
else {
if (pInfo->GetIqType() == JABBER_IQ_TYPE_ERROR) {
HXML errorNode = XmlGetChild(iqNode, "error");
- TCHAR *str = JabberErrorMsg(errorNode);
+ wchar_t *str = JabberErrorMsg(errorNode);
pNode->SetInfoRequestErrorText(str);
mir_free(str);
}
@@ -234,7 +234,7 @@ void CJabberProto::OnIqResultServiceDiscoveryItems(HXML iqNode, CJabberIqInfo *p
else {
if (pInfo->GetIqType() == JABBER_IQ_TYPE_ERROR) {
HXML errorNode = XmlGetChild(iqNode, "error");
- TCHAR *str = JabberErrorMsg(errorNode);
+ wchar_t *str = JabberErrorMsg(errorNode);
pNode->SetItemsRequestErrorText(str);
mir_free(str);
}
@@ -262,7 +262,7 @@ void CJabberProto::OnIqResultServiceDiscoveryRootInfo(HXML iqNode, CJabberIqInfo
if (query) {
HXML feature;
for (int i = 1; (feature = XmlGetNthChild(query, L"feature", i)) != NULL; i++) {
- if (!mir_tstrcmp(XmlGetAttrValue(feature, L"var"), (TCHAR *)pInfo->m_pUserData)) {
+ if (!mir_tstrcmp(XmlGetAttrValue(feature, L"var"), (wchar_t *)pInfo->m_pUserData)) {
CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(pInfo->GetReceiver(), XmlGetAttrValue(iqNode, L"node"), NULL);
SendBothRequests(pNode, NULL);
break;
@@ -287,8 +287,8 @@ void CJabberProto::OnIqResultServiceDiscoveryRootItems(HXML iqNode, CJabberIqInf
if (query) {
HXML item;
for (int i = 1; (item = XmlGetNthChild(query, L"item", i)) != NULL; i++) {
- const TCHAR *szJid = XmlGetAttrValue(item, L"jid");
- const TCHAR *szNode = XmlGetAttrValue(item, L"node");
+ const wchar_t *szJid = XmlGetAttrValue(item, L"jid");
+ const wchar_t *szNode = XmlGetAttrValue(item, L"node");
CJabberIqInfo *pNewInfo = AddIQ(&CJabberProto::OnIqResultServiceDiscoveryRootInfo, JABBER_IQ_TYPE_GET, szJid);
pNewInfo->m_pUserData = pInfo->m_pUserData;
pNewInfo->SetTimeout(30000);
@@ -384,8 +384,8 @@ BOOL CJabberProto::SendBothRequests(CJabberSDNode *pNode, HXML parent)
void CJabberProto::PerformBrowse(HWND hwndDlg)
{
- TCHAR szJid[JABBER_MAX_JID_LEN];
- TCHAR szNode[512];
+ wchar_t szJid[JABBER_MAX_JID_LEN];
+ wchar_t szNode[512];
if (!GetDlgItemText(hwndDlg, IDC_COMBO_JID, szJid, _countof(szJid)))
szJid[0] = 0;
if (!GetDlgItemText(hwndDlg, IDC_COMBO_NODE, szNode, _countof(szNode)))
@@ -408,7 +408,7 @@ void CJabberProto::PerformBrowse(HWND hwndDlg)
LISTFOREACH(i, this, LIST_ROSTER)
{
if ((item = ListGetItemPtrFromIndex(i)) != NULL) {
- if (_tcschr(item->jid, '@') == NULL && _tcschr(item->jid, '/') == NULL && item->subscription != SUB_NONE) {
+ if (wcschr(item->jid, '@') == NULL && wcschr(item->jid, '/') == NULL && item->subscription != SUB_NONE) {
MCONTACT hContact = HContactFromJID(item->jid);
if (hContact != NULL)
setByte(hContact, "IsTransport", TRUE);
@@ -424,7 +424,7 @@ void CJabberProto::PerformBrowse(HWND hwndDlg)
}
else if (!mir_tstrcmp(szJid, _T(SD_FAKEJID_CONFERENCES))) {
sttBrowseMode = SD_BROWSE_CONFERENCES;
- TCHAR *szServerJid = mir_a2t(m_ThreadInfo->conn.server);
+ wchar_t *szServerJid = mir_a2t(m_ThreadInfo->conn.server);
CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultServiceDiscoveryRootItems, JABBER_IQ_TYPE_GET, szServerJid);
pInfo->m_pUserData = (void*)JABBER_FEAT_MUC;
pInfo->SetTimeout(30000);
@@ -435,7 +435,7 @@ void CJabberProto::PerformBrowse(HWND hwndDlg)
}
else if (!mir_tstrcmp(szJid, _T(SD_FAKEJID_AGENTS))) {
sttBrowseMode = SD_BROWSE_AGENTS;
- TCHAR *szServerJid = mir_a2t(m_ThreadInfo->conn.server);
+ wchar_t *szServerJid = mir_a2t(m_ThreadInfo->conn.server);
CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultServiceDiscoveryRootItems, JABBER_IQ_TYPE_GET, szServerJid);
pInfo->m_pUserData = (void*)L"jabber:iq:gateway";
pInfo->SetTimeout(30000);
@@ -577,7 +577,7 @@ class CJabberDlgDiscovery : public CJabberDlgBase
typedef CJabberDlgBase CSuper;
public:
- CJabberDlgDiscovery(CJabberProto *proto, TCHAR *jid);
+ CJabberDlgDiscovery(CJabberProto *proto, wchar_t *jid);
protected:
void OnInitDialog();
@@ -587,7 +587,7 @@ protected:
int Resizer(UTILRESIZECONTROL *urc);
private:
- TCHAR *m_jid;
+ wchar_t *m_jid;
bool m_focusEditAfterBrowse;
CCtrlMButton m_btnViewAsTree;
@@ -607,7 +607,7 @@ private:
void lstDiscoTree_OnFilter(CCtrlFilterListView *);
};
-CJabberDlgDiscovery::CJabberDlgDiscovery(CJabberProto *proto, TCHAR *jid) :
+CJabberDlgDiscovery::CJabberDlgDiscovery(CJabberProto *proto, wchar_t *jid) :
CJabberDlgBase(proto, IDD_SERVICE_DISCOVERY, NULL),
m_jid(jid),
m_btnViewAsTree(this, IDC_BTN_VIEWTREE, proto->LoadIconEx("sd_view_tree"), "View as tree"),
@@ -1139,7 +1139,7 @@ INT_PTR CJabberDlgDiscovery::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
}
// extern references to used functions:
-void SearchAddToRecent(TCHAR* szAddr, HWND hwndDialog = NULL);
+void SearchAddToRecent(wchar_t* szAddr, HWND hwndDialog = NULL);
void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM hItem, POINT pt)
{
@@ -1172,36 +1172,36 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
struct
{
- TCHAR *feature;
- TCHAR *title;
+ wchar_t *feature;
+ wchar_t *title;
int action;
DWORD flags;
}
static items[] =
{
- { NULL, LPGENT("Contact Menu..."), SD_ACT_USERMENU, SD_FLG_NONODE},
- { NULL, LPGENT("View vCard"), SD_ACT_VCARD, SD_FLG_NONODE},
- { JABBER_FEAT_MUC, LPGENT("Join chatroom"), SD_ACT_JOIN, SD_FLG_NORESOURCE},
+ { NULL, LPGENW("Contact Menu..."), SD_ACT_USERMENU, SD_FLG_NONODE},
+ { NULL, LPGENW("View vCard"), SD_ACT_VCARD, SD_FLG_NONODE},
+ { JABBER_FEAT_MUC, LPGENW("Join chatroom"), SD_ACT_JOIN, SD_FLG_NORESOURCE},
{0},
- { NULL, LPGENT("Refresh Info"), SD_ACT_REFRESH},
- { NULL, LPGENT("Refresh Children"), SD_ACT_REFRESHCHILDREN},
+ { NULL, LPGENW("Refresh Info"), SD_ACT_REFRESH},
+ { NULL, LPGENW("Refresh Children"), SD_ACT_REFRESHCHILDREN},
{0},
- { NULL, LPGENT("Add to favorites"), SD_ACT_FAVORITE},
- { NULL, LPGENT("Add to roster"), SD_ACT_ROSTER, SD_FLG_NONODE | SD_FLG_NOTONROSTER},
- { JABBER_FEAT_MUC, LPGENT("Bookmark chatroom"), SD_ACT_BOOKMARK, SD_FLG_NORESOURCE | SD_FLG_HASUSER},
- { L"jabber:iq:search", LPGENT("Add search directory"), SD_ACT_ADDDIRECTORY},
- { JABBER_FEAT_BYTESTREAMS, LPGENT("Use this proxy"), SD_ACT_PROXY},
+ { NULL, LPGENW("Add to favorites"), SD_ACT_FAVORITE},
+ { NULL, LPGENW("Add to roster"), SD_ACT_ROSTER, SD_FLG_NONODE | SD_FLG_NOTONROSTER},
+ { JABBER_FEAT_MUC, LPGENW("Bookmark chatroom"), SD_ACT_BOOKMARK, SD_FLG_NORESOURCE | SD_FLG_HASUSER},
+ { L"jabber:iq:search", LPGENW("Add search directory"), SD_ACT_ADDDIRECTORY},
+ { JABBER_FEAT_BYTESTREAMS, LPGENW("Use this proxy"), SD_ACT_PROXY},
{0},
- { JABBER_FEAT_REGISTER, LPGENT("Register"), SD_ACT_REGISTER},
- { L"jabber:iq:gateway", LPGENT("Unregister"), SD_ACT_UNREGISTER, SD_FLG_ONROSTER | SD_FLG_SUBSCRIBED},
- { JABBER_FEAT_COMMANDS, LPGENT("Commands..."), SD_ACT_ADHOC},
+ { JABBER_FEAT_REGISTER, LPGENW("Register"), SD_ACT_REGISTER},
+ { L"jabber:iq:gateway", LPGENW("Unregister"), SD_ACT_UNREGISTER, SD_FLG_ONROSTER | SD_FLG_SUBSCRIBED},
+ { JABBER_FEAT_COMMANDS, LPGENW("Commands..."), SD_ACT_ADHOC},
{0},
- { L"jabber:iq:gateway", LPGENT("Logon"), SD_ACT_LOGON, SD_FLG_ONROSTER | SD_FLG_SUBSCRIBED | SD_FLG_ONLINE},
- { L"jabber:iq:gateway", LPGENT("Logoff"), SD_ACT_LOGOFF, SD_FLG_ONROSTER | SD_FLG_SUBSCRIBED | SD_FLG_NOTONLINE},
+ { L"jabber:iq:gateway", LPGENW("Logon"), SD_ACT_LOGON, SD_FLG_ONROSTER | SD_FLG_SUBSCRIBED | SD_FLG_ONLINE},
+ { L"jabber:iq:gateway", LPGENW("Logoff"), SD_ACT_LOGOFF, SD_FLG_ONROSTER | SD_FLG_SUBSCRIBED | SD_FLG_NOTONLINE},
{0},
- { NULL, LPGENT("Copy JID"), SD_ACT_COPYJID},
- { NULL, LPGENT("Copy node name"), SD_ACT_COPYNODE},
- { NULL, LPGENT("Copy node information"), SD_ACT_COPYINFO},
+ { NULL, LPGENW("Copy JID"), SD_ACT_COPYJID},
+ { NULL, LPGENW("Copy node name"), SD_ACT_COPYNODE},
+ { NULL, LPGENW("Copy node information"), SD_ACT_COPYINFO},
};
HMENU hMenu = CreatePopupMenu();
@@ -1224,9 +1224,9 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
continue;
if ((items[i].flags & SD_FLG_NOTONLINE) && rosterItem && (rosterItem->getTemp()->m_iStatus == ID_STATUS_OFFLINE))
continue;
- if ((items[i].flags & SD_FLG_NORESOURCE) && _tcschr(pNode->GetJid(), _T('/')))
+ if ((items[i].flags & SD_FLG_NORESOURCE) && wcschr(pNode->GetJid(), '/'))
continue;
- if ((items[i].flags & SD_FLG_HASUSER) && !_tcschr(pNode->GetJid(), _T('@')))
+ if ((items[i].flags & SD_FLG_HASUSER) && !wcschr(pNode->GetJid(), '@'))
continue;
}
@@ -1330,7 +1330,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
case SD_ACT_COPYINFO:
{
- TCHAR buf[8192];
+ wchar_t buf[8192];
pNode->GetTooltipText(buf, _countof(buf));
JabberCopyText(m_pDlgServiceDiscovery->GetHwnd(), buf);
}
@@ -1407,7 +1407,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
case SD_ACT_VCARD:
{
- TCHAR *jid = pNode->GetJid();
+ wchar_t *jid = pNode->GetJid();
MCONTACT hContact = HContactFromJID(pNode->GetJid());
if (!hContact)
hContact = AddToListByJID(jid, PALF_TEMPORARY);
@@ -1453,7 +1453,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
}
}
-void CJabberProto::LaunchServiceDiscovery(TCHAR *jid)
+void CJabberProto::LaunchServiceDiscovery(wchar_t *jid)
{
if (m_pDlgServiceDiscovery) {
SetForegroundWindow(m_pDlgServiceDiscovery->GetHwnd());
diff --git a/protocols/JabberG/src/jabber_disco.h b/protocols/JabberG/src/jabber_disco.h
index 9c327a60f4..486d4c7289 100644
--- a/protocols/JabberG/src/jabber_disco.h
+++ b/protocols/JabberG/src/jabber_disco.h
@@ -36,12 +36,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
class CJabberSDIdentity
{
protected:
- TCHAR *m_szCategory;
- TCHAR *m_szType;
- TCHAR *m_szName;
+ wchar_t *m_szCategory;
+ wchar_t *m_szType;
+ wchar_t *m_szName;
CJabberSDIdentity *m_pNext;
public:
- CJabberSDIdentity(const TCHAR *szCategory, const TCHAR *szType, const TCHAR *szName)
+ CJabberSDIdentity(const wchar_t *szCategory, const wchar_t *szType, const wchar_t *szName)
{
m_szCategory = mir_tstrdup(szCategory);
m_szType = mir_tstrdup(szType);
@@ -56,15 +56,15 @@ public:
if (m_pNext)
delete m_pNext;
}
- TCHAR *GetCategory()
+ wchar_t *GetCategory()
{
return m_szCategory;
}
- TCHAR *GetType()
+ wchar_t *GetType()
{
return m_szType;
}
- TCHAR *GetName()
+ wchar_t *GetName()
{
return m_szName;
}
@@ -84,10 +84,10 @@ class CJabberSDFeature;
class CJabberSDFeature
{
protected:
- TCHAR *m_szVar;
+ wchar_t *m_szVar;
CJabberSDFeature *m_pNext;
public:
- CJabberSDFeature(const TCHAR *szVar)
+ CJabberSDFeature(const wchar_t *szVar)
{
m_szVar = szVar ? mir_tstrdup(szVar) : NULL;
m_pNext = NULL;
@@ -98,7 +98,7 @@ public:
if (m_pNext)
delete m_pNext;
}
- TCHAR *GetVar()
+ wchar_t *GetVar()
{
return m_szVar;
}
@@ -117,9 +117,9 @@ public:
class CJabberSDNode
{
protected:
- TCHAR *m_szJid;
- TCHAR *m_szNode;
- TCHAR *m_szName;
+ wchar_t *m_szJid;
+ wchar_t *m_szNode;
+ wchar_t *m_szName;
CJabberSDIdentity *m_pIdentities;
CJabberSDFeature *m_pFeatures;
CJabberSDNode *m_pNext;
@@ -129,10 +129,10 @@ protected:
int m_nInfoRequestId;
int m_nItemsRequestId;
HTREELISTITEM m_hTreeItem;
- TCHAR *m_szInfoError;
- TCHAR *m_szItemsError;
+ wchar_t *m_szInfoError;
+ wchar_t *m_szItemsError;
public:
- CJabberSDNode(const TCHAR *szJid = NULL, const TCHAR *szNode = NULL, const TCHAR *szName = NULL)
+ CJabberSDNode(const wchar_t *szJid = NULL, const wchar_t *szNode = NULL, const wchar_t *szName = NULL)
{
m_szJid = mir_tstrdup(szJid);
m_szNode = mir_tstrdup(szNode);
@@ -227,25 +227,25 @@ public:
{
return m_nItemsRequestId;
}
- BOOL SetJid(TCHAR *szJid)
+ BOOL SetJid(wchar_t *szJid)
{
replaceStrT(m_szJid, szJid);
return TRUE;
}
- TCHAR *GetJid()
+ wchar_t *GetJid()
{
return m_szJid;
}
- BOOL SetNode(TCHAR *szNode)
+ BOOL SetNode(wchar_t *szNode)
{
replaceStrT(m_szNode, szNode);
return TRUE;
}
- TCHAR *GetNode()
+ wchar_t *GetNode()
{
return m_szNode;
}
- TCHAR *GetName()
+ wchar_t *GetName()
{
return m_szName;
}
@@ -291,7 +291,7 @@ public:
}
return NULL;
}
- BOOL AddFeature(const TCHAR *szFeature)
+ BOOL AddFeature(const wchar_t *szFeature)
{
if (!szFeature)
return FALSE;
@@ -305,7 +305,7 @@ public:
return TRUE;
}
- BOOL AddIdentity(const TCHAR *szCategory, const TCHAR *szType, const TCHAR *szName)
+ BOOL AddIdentity(const wchar_t *szCategory, const wchar_t *szType, const wchar_t *szName)
{
if (!szCategory || !szType)
return FALSE;
@@ -319,7 +319,7 @@ public:
return TRUE;
}
- BOOL AddChildNode(const TCHAR *szJid, const TCHAR *szNode, const TCHAR *szName)
+ BOOL AddChildNode(const wchar_t *szJid, const wchar_t *szNode, const wchar_t *szName)
{
if (!szJid)
return FALSE;
@@ -333,19 +333,19 @@ public:
return TRUE;
}
- BOOL SetItemsRequestErrorText(TCHAR *szError)
+ BOOL SetItemsRequestErrorText(wchar_t *szError)
{
replaceStrT(m_szItemsError, szError);
return TRUE;
}
- BOOL SetInfoRequestErrorText(TCHAR *szError)
+ BOOL SetInfoRequestErrorText(wchar_t *szError)
{
replaceStrT(m_szInfoError, szError);
return TRUE;
}
- BOOL GetTooltipText(TCHAR *szText, int nMaxLength)
+ BOOL GetTooltipText(wchar_t *szText, int nMaxLength)
{
CMString tszTmp;
@@ -388,7 +388,7 @@ public:
tszTmp.AppendFormat(L"\r\n%s: %s\r\n", TranslateT("Items request error"), m_szItemsError);
tszTmp.TrimRight();
- _tcsncpy_s(szText, nMaxLength, tszTmp, _TRUNCATE);
+ wcsncpy_s(szText, nMaxLength, tszTmp, _TRUNCATE);
return TRUE;
}
};
@@ -423,7 +423,7 @@ public:
return m_pPrimaryNodes;
}
- CJabberSDNode* AddPrimaryNode(const TCHAR *szJid, const TCHAR *szNode, const TCHAR *szName)
+ CJabberSDNode* AddPrimaryNode(const wchar_t *szJid, const wchar_t *szNode, const wchar_t *szName)
{
if (!szJid)
return NULL;
diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp
index b78c31f4c0..24580a5207 100644
--- a/protocols/JabberG/src/jabber_events.cpp
+++ b/protocols/JabberG/src/jabber_events.cpp
@@ -41,10 +41,10 @@ int CJabberProto::OnContactDeleted(WPARAM hContact, LPARAM)
return 0;
if (ListGetItemPtr(LIST_ROSTER, jid)) {
- if (!_tcschr(jid, _T('@'))) {
- TCHAR szStrippedJid[JABBER_MAX_JID_LEN];
+ if (!wcschr(jid, '@')) {
+ wchar_t szStrippedJid[JABBER_MAX_JID_LEN];
JabberStripJid(m_ThreadInfo->fullJID, szStrippedJid, _countof(szStrippedJid));
- TCHAR *szDog = _tcschr(szStrippedJid, _T('@'));
+ wchar_t *szDog = wcschr(szStrippedJid, '@');
if (szDog && mir_tstrcmpi(szDog + 1, jid))
m_ThreadInfo->send(XmlNodeIq(L"set", SerialNext(), jid) << XQUERY(JABBER_FEAT_REGISTER) << XCHILD(L"remove"));
}
@@ -59,7 +59,7 @@ int CJabberProto::OnContactDeleted(WPARAM hContact, LPARAM)
/////////////////////////////////////////////////////////////////////////////////////////
// JabberDbSettingChanged - process database changes
-static TCHAR* sttSettingToTchar(DBCONTACTWRITESETTING *cws)
+static wchar_t* sttSettingToTchar(DBCONTACTWRITESETTING *cws)
{
switch (cws->value.type) {
case DBVT_ASCIIZ:
@@ -95,7 +95,7 @@ void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING *cws, MCONTACT hC
}
}
else {
- TCHAR *p = sttSettingToTchar(cws);
+ wchar_t *p = sttSettingToTchar(cws);
if (cws->value.pszVal != NULL && mir_tstrcmp(p, item->group)) {
debugLog(L"Group set to %s", p);
if (p)
@@ -112,7 +112,7 @@ void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING *cws, MCONTACT
return;
if (cws->value.type == DBVT_DELETED) {
- TCHAR *nick = pcli->pfnGetContactDisplayName(hContact, GCDNF_NOMYHANDLE);
+ wchar_t *nick = pcli->pfnGetContactDisplayName(hContact, GCDNF_NOMYHANDLE);
AddContactToRoster(item->jid, nick, item->group);
mir_free(nick);
return;
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp
index aef5167c73..a3e2c0776f 100644
--- a/protocols/JabberG/src/jabber_file.cpp
+++ b/protocols/JabberG/src/jabber_file.cpp
@@ -113,8 +113,8 @@ int CJabberProto::FileReceiveParse(filetransfer *ft, char* buffer, int datalen)
}
else { // FT_INITIALIZING
if (str[0] == '\0') {
- TCHAR *s;
- if ((s = _tcsrchr(ft->httpPath, '/')) != NULL)
+ wchar_t *s;
+ if ((s = wcsrchr(ft->httpPath, '/')) != NULL)
s++;
else
s = ft->httpPath;
@@ -178,7 +178,7 @@ void JabberFileServerConnection(JABBER_SOCKET hConnection, DWORD /*dwRemoteIP*/,
NETLIBCONNINFO connInfo = { sizeof(connInfo) };
CallService(MS_NETLIB_GETCONNECTIONINFO, (WPARAM)hConnection, (LPARAM)&connInfo);
- TCHAR szPort[10];
+ wchar_t szPort[10];
mir_sntprintf(szPort, L"%d", connInfo.wPort);
ppro->debugLogA("File server incoming connection accepted: %s", connInfo.szIpPort);
@@ -259,12 +259,12 @@ void __cdecl CJabberProto::FileServerThread(filetransfer *ft)
HANDLE hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
ft->hFileEvent = hEvent;
- TCHAR szPort[20];
+ wchar_t szPort[20];
mir_sntprintf(szPort, L"%d", nlb.wPort);
JABBER_LIST_ITEM *item = ListAdd(LIST_FILE, szPort);
item->ft = ft;
- TCHAR *ptszResource = ListGetBestClientResourceNamePtr(ft->jid);
+ wchar_t *ptszResource = ListGetBestClientResourceNamePtr(ft->jid);
if (ptszResource != NULL) {
ft->state = FT_CONNECTING;
for (int i = 0; i < ft->std.totalFiles && ft->state != FT_ERROR && ft->state != FT_DENIED; i++) {
@@ -273,8 +273,8 @@ void __cdecl CJabberProto::FileServerThread(filetransfer *ft)
if (ft->httpPath) mir_free(ft->httpPath);
ft->httpPath = NULL;
- TCHAR *p;
- if ((p = _tcschr(ft->std.ptszFiles[i], '\\')) != NULL)
+ wchar_t *p;
+ if ((p = wcschr(ft->std.ptszFiles[i], '\\')) != NULL)
p++;
else
p = ft->std.ptszFiles[i];
@@ -293,7 +293,7 @@ void __cdecl CJabberProto::FileServerThread(filetransfer *ft)
mir_snprintf(szAddr, "http://%s:%d/%s", myAddr, nlb.wPort, pFileName);
size_t len = mir_tstrlen(ptszResource) + mir_tstrlen(ft->jid) + 2;
- TCHAR *fulljid = (TCHAR *)alloca(sizeof(TCHAR) * len);
+ wchar_t *fulljid = (wchar_t *)alloca(sizeof(wchar_t) * len);
mir_sntprintf(fulljid, len, L"%s/%s", ft->jid, ptszResource);
XmlNodeIq iq(L"set", ft->szId, fulljid);
@@ -380,7 +380,7 @@ int CJabberProto::FileSendParse(JABBER_SOCKET s, filetransfer *ft, char* buffer,
num += 2;
currentFile = ft->std.currentFileNumber;
- TCHAR *t = _tcsrchr(ft->std.ptszFiles[currentFile], '\\');
+ wchar_t *t = wcsrchr(ft->std.ptszFiles[currentFile], '\\');
if (t != NULL)
t++;
else
@@ -395,8 +395,8 @@ int CJabberProto::FileSendParse(JABBER_SOCKET s, filetransfer *ft, char* buffer,
break;
}
debugLog(L"Sending [%s]", ft->std.ptszFiles[currentFile]);
- _tstati64(ft->std.ptszFiles[currentFile], &statbuf); // file size in statbuf.st_size
- if ((fileId = _topen(ft->std.ptszFiles[currentFile], _O_BINARY | _O_RDONLY)) < 0) {
+ _wstat64(ft->std.ptszFiles[currentFile], &statbuf); // file size in statbuf.st_size
+ if ((fileId = _wopen(ft->std.ptszFiles[currentFile], _O_BINARY | _O_RDONLY)) < 0) {
debugLogA("File cannot be opened");
ft->state = FT_ERROR;
mir_free(ft->httpPath);
@@ -500,7 +500,7 @@ int filetransfer::create()
if (fileId != -1)
return fileId;
- TCHAR filefull[MAX_PATH];
+ wchar_t filefull[MAX_PATH];
mir_sntprintf(filefull, L"%s\\%s", std.tszWorkingDir, std.tszCurrentFile);
replaceStrT(std.tszCurrentFile, filefull);
@@ -513,7 +513,7 @@ int filetransfer::create()
if (fileId == -1) {
ppro->debugLog(L"Saving to [%s]", std.tszCurrentFile);
- fileId = _topen(std.tszCurrentFile, _O_BINARY | _O_CREAT | _O_TRUNC | _O_WRONLY, _S_IREAD | _S_IWRITE);
+ fileId = _wopen(std.tszCurrentFile, _O_BINARY | _O_CREAT | _O_TRUNC | _O_WRONLY, _S_IREAD | _S_IWRITE);
}
if (fileId == -1)
diff --git a/protocols/JabberG/src/jabber_filterlist.cpp b/protocols/JabberG/src/jabber_filterlist.cpp
index f03bf49ee1..1f86f9705f 100644
--- a/protocols/JabberG/src/jabber_filterlist.cpp
+++ b/protocols/JabberG/src/jabber_filterlist.cpp
@@ -35,7 +35,7 @@ struct CFilterData : public MZeroedObject
HFONT m_hfntNormal;
HFONT m_hfntEmpty;
COLORREF m_clGray;
- TCHAR *m_filterText;
+ wchar_t *m_filterText;
RECT m_rcButtonClear;
RECT m_rcEditBox;
@@ -69,7 +69,7 @@ CCtrlFilterListView::~CCtrlFilterListView()
delete fdat;
}
-TCHAR *CCtrlFilterListView::GetFilterText()
+wchar_t *CCtrlFilterListView::GetFilterText()
{
return fdat->m_filterText;
}
@@ -100,7 +100,7 @@ static LRESULT CALLBACK sttEditBoxSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
if (length == 1)
fdat->m_filterText = 0;
else {
- fdat->m_filterText = (TCHAR *)mir_alloc(sizeof(TCHAR) * length);
+ fdat->m_filterText = (wchar_t *)mir_alloc(sizeof(wchar_t) * length);
GetWindowText(hwnd, fdat->m_filterText, length);
}
@@ -127,9 +127,9 @@ static LRESULT CALLBACK sttEditBoxSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
return CallWindowProc(fdat->m_oldWndProc, hwnd, msg, wParam, lParam);
}
-void CCtrlFilterListView::FilterHighlight(TCHAR *str)
+void CCtrlFilterListView::FilterHighlight(wchar_t *str)
{
- TCHAR buf[256];
+ wchar_t buf[256];
int count = GetItemCount();
for (int i=0; i < count; i++) {
bool found = false;
@@ -139,7 +139,7 @@ void CCtrlFilterListView::FilterHighlight(TCHAR *str)
if (!*buf)
break;
- if (_tcsstr(buf, str)) {
+ if (wcsstr(buf, str)) {
found = true;
break;
}
@@ -165,12 +165,12 @@ LRESULT CCtrlFilterListView::CustomWndProc(UINT msg, WPARAM wParam, LPARAM lPara
case 1:
if (m_trackFilter && fdat->m_hwndEditBox) {
- TCHAR *str = 0;
+ wchar_t *str = 0;
int length = GetWindowTextLength(fdat->m_hwndEditBox) + 1;
if (length == 1)
str = 0;
else {
- str = (TCHAR *)mir_alloc(sizeof(TCHAR) * length);
+ str = (wchar_t *)mir_alloc(sizeof(wchar_t) * length);
GetWindowText(fdat->m_hwndEditBox, str, length);
}
FilterHighlight(str);
diff --git a/protocols/JabberG/src/jabber_form.cpp b/protocols/JabberG/src/jabber_form.cpp
index 6965e989da..a74abfae40 100644
--- a/protocols/JabberG/src/jabber_form.cpp
+++ b/protocols/JabberG/src/jabber_form.cpp
@@ -73,7 +73,7 @@ void JabberFormCenterContent(HWND hwndStatic)
if ((style & SS_RIGHT) && !(style & WS_TABSTOP)) {
RECT calcRect = rc;
int len = GetWindowTextLength(hWndChild);
- TCHAR *text = (TCHAR*)_alloca(sizeof(TCHAR)*(len + 1));
+ wchar_t *text = (wchar_t*)_alloca(sizeof(wchar_t)*(len + 1));
GetWindowText(hWndChild, text, len + 1);
HDC hdc = GetDC(hWndChild);
HFONT hfntSave = (HFONT)SelectObject(hdc, (HFONT)SendMessage(hWndChild, WM_GETFONT, 0, 0));
@@ -106,25 +106,25 @@ void JabberFormCenterContent(HWND hwndStatic)
}
}
-void JabberFormSetInstruction(HWND hwndForm, const TCHAR *text)
+void JabberFormSetInstruction(HWND hwndForm, const wchar_t *text)
{
if (!text) text = L"";
size_t len = mir_tstrlen(text);
size_t fixedLen = len;
for (int i = 1; i < len; i++)
- if ((text[i - 1] == _T('\n')) && (text[i] != _T('\r')))
+ if ((text[i - 1] == '\n') && (text[i] != '\r'))
++fixedLen;
- TCHAR *fixedText = NULL;
+ wchar_t *fixedText = NULL;
if (fixedLen != len) {
- fixedText = (TCHAR *)mir_alloc(sizeof(TCHAR) * (fixedLen + 1));
- TCHAR *p = fixedText;
+ fixedText = (wchar_t *)mir_alloc(sizeof(wchar_t) * (fixedLen + 1));
+ wchar_t *p = fixedText;
for (int i = 0; i < len; i++) {
*p = text[i];
- if (i && (text[i] == _T('\n')) && (text[i] != _T('\r'))) {
- *p++ = _T('\r');
- *p = _T('\n');
+ if (i && (text[i] == '\n') && (text[i] != '\r')) {
+ *p++ = '\r';
+ *p = '\n';
}
++p;
}
@@ -142,7 +142,7 @@ void JabberFormSetInstruction(HWND hwndForm, const TCHAR *text)
SetRect(&rcText, 0, 0, rcText.right - rcText.left, 0);
HDC hdcEdit = GetDC(GetDlgItem(hwndForm, IDC_INSTRUCTION));
HFONT hfntSave = (HFONT)SelectObject(hdcEdit, (HFONT)SendDlgItemMessage(hwndForm, IDC_INSTRUCTION, WM_GETFONT, 0, 0));
- DrawTextEx(hdcEdit, (TCHAR *)text, (int)mir_tstrlen(text), &rcText, DT_CALCRECT | DT_EDITCONTROL | DT_TOP | DT_WORDBREAK, NULL);
+ DrawTextEx(hdcEdit, (wchar_t *)text, (int)mir_tstrlen(text), &rcText, DT_CALCRECT | DT_EDITCONTROL | DT_TOP | DT_WORDBREAK, NULL);
SelectObject(hdcEdit, hfntSave);
ReleaseDC(GetDlgItem(hwndForm, IDC_INSTRUCTION), hdcEdit);
@@ -203,7 +203,7 @@ void JabberFormSetInstruction(HWND hwndForm, const TCHAR *text)
if (fixedText) mir_free(fixedText);
}
-static TJabberFormControlType JabberFormTypeNameToId(const TCHAR *type)
+static TJabberFormControlType JabberFormTypeNameToId(const wchar_t *type)
{
if (!mir_tstrcmp(type, L"text-private"))
return JFORM_CTYPE_TEXT_PRIVATE;
@@ -223,7 +223,7 @@ static TJabberFormControlType JabberFormTypeNameToId(const TCHAR *type)
return JFORM_CTYPE_TEXT_SINGLE;
}
-void JabberFormLayoutSingleControl(TJabberFormControlInfo *item, TJabberFormLayoutInfo *layout_info, const TCHAR *labelStr, const TCHAR *valueStr)
+void JabberFormLayoutSingleControl(TJabberFormControlInfo *item, TJabberFormLayoutInfo *layout_info, const wchar_t *labelStr, const wchar_t *valueStr)
{
RECT rcLabel = { 0 }, rcCtrl = { 0 };
if (item->hLabel) {
@@ -286,7 +286,7 @@ void JabberFormLayoutSingleControl(TJabberFormControlInfo *item, TJabberFormLayo
CreateWindow(L"static", labelStr, WS_CHILD|WS_VISIBLE|SS_CENTERIMAGE, \
0, 0, 0, 0, hwndStatic, (HMENU)-1, hInst, NULL)
-TJabberFormControlInfo *JabberFormAppendControl(HWND hwndStatic, TJabberFormLayoutInfo *layout_info, TJabberFormControlType type, const TCHAR *labelStr, const TCHAR *valueStr)
+TJabberFormControlInfo *JabberFormAppendControl(HWND hwndStatic, TJabberFormLayoutInfo *layout_info, TJabberFormControlType type, const wchar_t *labelStr, const wchar_t *valueStr)
{
TJabberFormControlList *controls = (TJabberFormControlList *)GetWindowLongPtr(hwndStatic, GWLP_USERDATA);
if (!controls) {
@@ -376,7 +376,7 @@ TJabberFormControlInfo *JabberFormAppendControl(HWND hwndStatic, TJabberFormLayo
return item;
}
-static void JabberFormAddListItem(TJabberFormControlInfo *item, const TCHAR *text, bool selected)
+static void JabberFormAddListItem(TJabberFormControlInfo *item, const wchar_t *text, bool selected)
{
DWORD dwIndex;
switch (item->type) {
@@ -436,8 +436,8 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp
HXML v, vs;
- const TCHAR *label, *typeName, *varStr, *str, *valueText;
- TCHAR *labelStr, *valueStr;
+ const wchar_t *label, *typeName, *varStr, *str, *valueText;
+ wchar_t *labelStr, *valueStr;
RECT frameRect;
if (xNode == NULL || XmlGetName(xNode) == NULL || mir_tstrcmp(XmlGetName(xNode), L"x") || hwndStatic == NULL)
@@ -487,7 +487,7 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp
if (XmlGetName(v) && !mir_tstrcmp(XmlGetName(v), L"value") && XmlGetText(v))
size += mir_tstrlen(XmlGetText(v)) + 2;
}
- valueStr = (TCHAR*)mir_alloc(sizeof(TCHAR)*size);
+ valueStr = (wchar_t*)mir_alloc(sizeof(wchar_t)*size);
valueStr[0] = '\0';
for (int j = 0;; j++) {
v = XmlGetChild(n, j);
@@ -576,8 +576,8 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
HWND hFrame, hCtrl;
HXML n, v, o;
int id, j, k, len;
- const TCHAR *varName, *type, *fieldStr, *labelText, *str2;
- TCHAR *p, *q, *str;
+ const wchar_t *varName, *type, *fieldStr, *labelText, *str2;
+ wchar_t *p, *q, *str;
if (xNode == NULL || XmlGetName(xNode) == NULL || mir_tstrcmp(XmlGetName(xNode), L"x") || hwndStatic == NULL)
return NULL;
@@ -604,11 +604,11 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
if (!mir_tstrcmp(type, L"text-multi") || !mir_tstrcmp(type, L"jid-multi")) {
len = GetWindowTextLength(GetDlgItem(hFrame, id));
- str = (TCHAR*)mir_alloc(sizeof(TCHAR)*(len + 1));
+ str = (wchar_t*)mir_alloc(sizeof(wchar_t)*(len + 1));
GetDlgItemText(hFrame, id, str, len + 1);
p = str;
while (p != NULL) {
- if ((q = _tcsstr(p, L"\r\n")) != NULL)
+ if ((q = wcsstr(p, L"\r\n")) != NULL)
*q = '\0';
field << XCHILD(L"value", p);
p = q ? q + 2 : NULL;
@@ -617,14 +617,14 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
id++;
}
else if (!mir_tstrcmp(type, L"boolean")) {
- TCHAR buf[10];
- _itot(IsDlgButtonChecked(hFrame, id) == BST_CHECKED ? 1 : 0, buf, 10);
+ wchar_t buf[10];
+ _itow(IsDlgButtonChecked(hFrame, id) == BST_CHECKED ? 1 : 0, buf, 10);
field << XCHILD(L"value", buf);
id++;
}
else if (!mir_tstrcmp(type, L"list-single")) {
len = GetWindowTextLength(GetDlgItem(hFrame, id));
- str = (TCHAR*)mir_alloc(sizeof(TCHAR)*(len + 1));
+ str = (wchar_t*)mir_alloc(sizeof(wchar_t)*(len + 1));
GetDlgItemText(hFrame, id, str, len + 1);
v = NULL;
for (j = 0;; j++) {
@@ -654,7 +654,7 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
if (SendMessage(hCtrl, LB_GETSEL, j, 0) > 0) {
// an entry is selected
len = SendMessage(hCtrl, LB_GETTEXTLEN, j, 0);
- if ((str = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR))) != NULL) {
+ if ((str = (wchar_t*)mir_alloc((len + 1)*sizeof(wchar_t))) != NULL) {
SendMessage(hCtrl, LB_GETTEXT, j, (LPARAM)str);
for (k = 0;; k++) {
o = XmlGetChild(n, k);
@@ -684,7 +684,7 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
}
else { // everything else is considered "text-single" or "text-private"
len = GetWindowTextLength(GetDlgItem(hFrame, id));
- str = (TCHAR*)mir_alloc(sizeof(TCHAR)*(len + 1));
+ str = (wchar_t*)mir_alloc(sizeof(wchar_t)*(len + 1));
GetDlgItemText(hFrame, id, str, len + 1);
field << XCHILD(L"value", str);
mir_free(str);
@@ -701,7 +701,7 @@ struct JABBER_FORM_INFO
CJabberProto *ppro;
HXML xNode;
- TCHAR defTitle[128]; // Default title if no <title/> in xNode
+ wchar_t defTitle[128]; // Default title if no <title/> in xNode
RECT frameRect; // Clipping region of the frame to scroll
int frameHeight; // Height of the frame (can be eliminated, redundant to frameRect)
int formHeight; // Actual height of the form
@@ -854,14 +854,14 @@ static VOID CALLBACK JabberFormCreateDialogApcProc(void* param)
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_FORM), NULL, JabberFormDlgProc, (LPARAM)param);
}
-void CJabberProto::FormCreateDialog(HXML xNode, TCHAR* defTitle, JABBER_FORM_SUBMIT_FUNC pfnSubmit, void *userdata)
+void CJabberProto::FormCreateDialog(HXML xNode, wchar_t* defTitle, JABBER_FORM_SUBMIT_FUNC pfnSubmit, void *userdata)
{
JABBER_FORM_INFO *jfi = new JABBER_FORM_INFO;
memset(jfi, 0, sizeof(JABBER_FORM_INFO));
jfi->ppro = this;
jfi->xNode = xmlCopyNode(xNode);
if (defTitle)
- _tcsncpy_s(jfi->defTitle, defTitle, _TRUNCATE);
+ wcsncpy_s(jfi->defTitle, defTitle, _TRUNCATE);
jfi->pfnSubmit = pfnSubmit;
jfi->userdata = userdata;
diff --git a/protocols/JabberG/src/jabber_frame.cpp b/protocols/JabberG/src/jabber_frame.cpp
index 86faff30b5..c41f958c7b 100644
--- a/protocols/JabberG/src/jabber_frame.cpp
+++ b/protocols/JabberG/src/jabber_frame.cpp
@@ -34,7 +34,7 @@ class CJabberInfoFrameItem : public MZeroedObject
public:
char *m_pszName;
HANDLE m_hIcolibIcon;
- TCHAR *m_pszText;
+ wchar_t *m_pszText;
LPARAM m_pUserData;
bool m_bCompact;
bool m_bShow;
@@ -56,7 +56,7 @@ public:
mir_free(m_pszText);
}
- void SetInfo(HANDLE hIcolibIcon, TCHAR *pszText)
+ void SetInfo(HANDLE hIcolibIcon, wchar_t *pszText)
{
mir_free(m_pszText);
m_pszText = pszText ? mir_tstrdup(pszText) : NULL;
@@ -242,21 +242,21 @@ void CJabberInfoFrame::ReloadFonts()
FontIDT fontid = {0};
fontid.cbSize = sizeof(fontid);
- _tcsncpy_s(fontid.group, L"Jabber", _TRUNCATE);
- _tcsncpy_s(fontid.name, L"Frame title", _TRUNCATE);
+ wcsncpy_s(fontid.group, L"Jabber", _TRUNCATE);
+ wcsncpy_s(fontid.name, L"Frame title", _TRUNCATE);
m_clTitle = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lfFont);
DeleteObject(m_hfntTitle);
m_hfntTitle = CreateFontIndirect(&lfFont);
- _tcsncpy_s(fontid.name, L"Frame text", _TRUNCATE);
+ wcsncpy_s(fontid.name, L"Frame text", _TRUNCATE);
m_clText = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lfFont);
DeleteObject(m_hfntText);
m_hfntText = CreateFontIndirect(&lfFont);
ColourIDT colourid = {0};
colourid.cbSize = sizeof(colourid);
- _tcsncpy_s(colourid.group, L"Jabber", _TRUNCATE);
- _tcsncpy_s(colourid.name, L"Background", _TRUNCATE);
+ wcsncpy_s(colourid.group, L"Jabber", _TRUNCATE);
+ wcsncpy_s(colourid.name, L"Background", _TRUNCATE);
m_clBack = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, 0);
UpdateSize();
@@ -295,7 +295,7 @@ void CJabberInfoFrame::RemoveTooltip(int id)
SendMessage(m_hwndToolTip, TTM_DELTOOLW, 0, (LPARAM)&ti);
}
-void CJabberInfoFrame::SetToolTip(int id, RECT *rc, TCHAR *pszText)
+void CJabberInfoFrame::SetToolTip(int id, RECT *rc, wchar_t *pszText)
{
TOOLINFO ti = {0};
ti.cbSize = sizeof(TOOLINFO);
@@ -459,7 +459,7 @@ void CJabberInfoFrame::SetInfoItemCallback(char *pszName, void (CJabberProto::*o
pItem->m_onEvent = onEvent;
}
-void CJabberInfoFrame::UpdateInfoItem(char *pszName, HANDLE hIcolibIcon, TCHAR *pszText)
+void CJabberInfoFrame::UpdateInfoItem(char *pszName, HANDLE hIcolibIcon, wchar_t *pszText)
{
if (CJabberInfoFrameItem *pItem = m_pItems.find((CJabberInfoFrameItem*)&pszName))
pItem->SetInfo(hIcolibIcon, pszText);
diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp
index 0666d4d96c..a7142148d4 100644
--- a/protocols/JabberG/src/jabber_ft.cpp
+++ b/protocols/JabberG/src/jabber_ft.cpp
@@ -75,12 +75,12 @@ void CJabberProto::FtCancel(filetransfer *ft)
///////////////// File sending using stream initiation /////////////////////////
-void CJabberProto::FtInitiate(TCHAR* jid, filetransfer *ft)
+void CJabberProto::FtInitiate(wchar_t* jid, filetransfer *ft)
{
- TCHAR *rs;
- TCHAR *filename, *p;
+ wchar_t *rs;
+ wchar_t *filename, *p;
int i;
- TCHAR sid[9];
+ wchar_t sid[9];
if (jid == NULL || ft == NULL || !m_bJabberOnline || (rs = ListGetBestClientResourceNamePtr(jid)) == NULL) {
if (ft) {
@@ -96,10 +96,10 @@ void CJabberProto::FtInitiate(TCHAR* jid, filetransfer *ft)
if (ft->sid != NULL) mir_free(ft->sid);
ft->sid = mir_tstrdup(sid);
filename = ft->std.ptszFiles[ft->std.currentFileNumber];
- if ((p = _tcsrchr(filename, '\\')) != NULL)
+ if ((p = wcsrchr(filename, '\\')) != NULL)
filename = p + 1;
- TCHAR tszJid[512];
+ wchar_t tszJid[512];
mir_sntprintf(tszJid, L"%s/%s", jid, rs);
XmlNodeIq iq(AddIQ(&CJabberProto::OnFtSiResult, JABBER_IQ_TYPE_SET, tszJid, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_TO, -1, ft));
@@ -188,8 +188,8 @@ BOOL CJabberProto::FtSend(HANDLE hConn, filetransfer *ft)
int numRead;
debugLog(L"Sending [%s]", ft->std.ptszFiles[ft->std.currentFileNumber]);
- _tstati64(ft->std.ptszFiles[ft->std.currentFileNumber], &statbuf); // file size in statbuf.st_size
- if ((fd = _topen(ft->std.ptszFiles[ft->std.currentFileNumber], _O_BINARY | _O_RDONLY)) < 0) {
+ _wstat64(ft->std.ptszFiles[ft->std.currentFileNumber], &statbuf); // file size in statbuf.st_size
+ if ((fd = _wopen(ft->std.ptszFiles[ft->std.currentFileNumber], _O_BINARY | _O_RDONLY)) < 0) {
debugLog(L"File cannot be opened");
return FALSE;
}
@@ -220,9 +220,9 @@ BOOL CJabberProto::FtIbbSend(int blocksize, filetransfer *ft)
debugLog(L"Sending [%s]", ft->std.ptszFiles[ft->std.currentFileNumber]);
struct _stati64 statbuf;
- _tstati64(ft->std.ptszFiles[ft->std.currentFileNumber], &statbuf); // file size in statbuf.st_size
+ _wstat64(ft->std.ptszFiles[ft->std.currentFileNumber], &statbuf); // file size in statbuf.st_size
- int fd = _topen(ft->std.ptszFiles[ft->std.currentFileNumber], _O_BINARY | _O_RDONLY);
+ int fd = _wopen(ft->std.ptszFiles[ft->std.currentFileNumber], _O_BINARY | _O_RDONLY);
if (fd < 0) {
debugLogA("File cannot be opened");
return FALSE;
@@ -300,7 +300,7 @@ void CJabberProto::FtSendFinal(BOOL success, filetransfer *ft)
void CJabberProto::FtHandleSiRequest(HXML iqNode)
{
- const TCHAR *from, *sid, *str, *szId, *filename;
+ const wchar_t *from, *sid, *str, *szId, *filename;
HXML siNode, fileNode, featureNode, xNode, fieldNode, n;
int i;
unsigned __int64 filesize;
@@ -317,7 +317,7 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode)
(filename = XmlGetAttrValue(fileNode, L"name")) != NULL &&
(str = XmlGetAttrValue(fileNode, L"size")) != NULL) {
- filesize = _ttoi64(str);
+ filesize = _wtoi64(str);
if ((featureNode = XmlGetChildByTag(siNode, "feature", "xmlns", JABBER_FEAT_FEATURE_NEG)) != NULL &&
(xNode = XmlGetChildByTag(featureNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS)) != NULL &&
(fieldNode = XmlGetChildByTag(xNode, "field", "var", L"stream-method")) != NULL) {
@@ -378,10 +378,10 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode)
pre.dwFlags = PRFF_TCHAR;
pre.fileCount = 1;
pre.timestamp = time(NULL);
- pre.files.t = (TCHAR**)&filename;
+ pre.files.w = (wchar_t**)&filename;
pre.lParam = (LPARAM)ft;
if ((n = XmlGetChild(fileNode, "desc")) != NULL)
- pre.descr.t = (TCHAR*)XmlGetText(n);
+ pre.descr.w = (wchar_t*)XmlGetText(n);
ProtoChainRecvFile(ft->std.hContact, &pre);
return;
@@ -446,7 +446,7 @@ BOOL CJabberProto::FtHandleBytestreamRequest(HXML iqNode, CJabberIqInfo *pInfo)
{
HXML queryNode = pInfo->GetChildNode();
- const TCHAR *sid;
+ const wchar_t *sid;
JABBER_LIST_ITEM *item;
if ((sid = XmlGetAttrValue(queryNode, L"sid")) != NULL && (item = ListGetItemPtr(LIST_FTRECV, sid)) != NULL) {
@@ -471,15 +471,15 @@ BOOL CJabberProto::FtHandleIbbRequest(HXML iqNode, BOOL bOpen)
{
if (iqNode == NULL) return FALSE;
- const TCHAR *id = XmlGetAttrValue(iqNode, L"id");
- const TCHAR *from = XmlGetAttrValue(iqNode, L"from");
- const TCHAR *to = XmlGetAttrValue(iqNode, L"to");
+ const wchar_t *id = XmlGetAttrValue(iqNode, L"id");
+ const wchar_t *from = XmlGetAttrValue(iqNode, L"from");
+ const wchar_t *to = XmlGetAttrValue(iqNode, L"to");
if (!id || !from || !to) return FALSE;
HXML ibbNode = XmlGetChildByTag(iqNode, bOpen ? "open" : "close", "xmlns", JABBER_FEAT_IBB);
if (!ibbNode) return FALSE;
- const TCHAR *sid = XmlGetAttrValue(ibbNode, L"sid");
+ const wchar_t *sid = XmlGetAttrValue(ibbNode, L"sid");
if (!sid) return FALSE;
// already closed?
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index 6394f8a022..9188846f5e 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -40,12 +40,12 @@ struct JabberGcRecentInfo
{
ppro = proto;
}
- JabberGcRecentInfo(CJabberProto *proto, const TCHAR *room, const TCHAR *server, const TCHAR *nick = NULL, const TCHAR *password = NULL)
+ JabberGcRecentInfo(CJabberProto *proto, const wchar_t *room, const wchar_t *server, const wchar_t *nick = NULL, const wchar_t *password = NULL)
{
ppro = proto;
fillData(room, server, nick, password);
}
- JabberGcRecentInfo(CJabberProto *proto, const TCHAR *jid)
+ JabberGcRecentInfo(CJabberProto *proto, const wchar_t *jid)
{
ppro = proto;
fillData(jid);
@@ -65,7 +65,7 @@ struct JabberGcRecentInfo
m_room = m_server = m_nick = m_password = NULL;
}
- BOOL equals(const TCHAR *room, const TCHAR *server, const TCHAR *nick = NULL, const TCHAR *password = NULL)
+ BOOL equals(const wchar_t *room, const wchar_t *server, const wchar_t *nick = NULL, const wchar_t *password = NULL)
{
return
null_strequals(m_room, room) &&
@@ -74,7 +74,7 @@ struct JabberGcRecentInfo
null_strequals(m_password, password);
}
- BOOL equalsnp(const TCHAR *room, const TCHAR *server, const TCHAR *nick = NULL)
+ BOOL equalsnp(const wchar_t *room, const wchar_t *server, const wchar_t *nick = NULL)
{
return
null_strequals(m_room, room) &&
@@ -90,7 +90,7 @@ struct JabberGcRecentInfo
SetDlgItemText(hwndDlg, IDC_PASSWORD, m_password ? m_password : L"");
}
- void fillData(const TCHAR *room, const TCHAR *server, const TCHAR *nick = NULL, const TCHAR *password = NULL)
+ void fillData(const wchar_t *room, const wchar_t *server, const wchar_t *nick = NULL, const wchar_t *password = NULL)
{
m_room = mir_tstrdup(room);
m_server = mir_tstrdup(server);
@@ -98,14 +98,14 @@ struct JabberGcRecentInfo
m_password = mir_tstrdup(password);
}
- void fillData(const TCHAR *jid)
+ void fillData(const wchar_t *jid)
{
- TCHAR *room, *server, *nick = NULL;
- room = NEWTSTR_ALLOCA(jid);
- server = _tcschr(room, _T('@'));
+ wchar_t *room, *server, *nick = NULL;
+ room = NEWWSTR_ALLOCA(jid);
+ server = wcschr(room, '@');
if (server) {
*server++ = 0;
- nick = _tcschr(server, _T('/'));
+ nick = wcschr(server, '/');
if (nick) *nick++ = 0;
}
else {
@@ -164,7 +164,7 @@ struct JabberGcRecentInfo
}
private:
- BOOL null_strequals(const TCHAR *str1, const TCHAR *str2)
+ BOOL null_strequals(const wchar_t *str1, const wchar_t *str2)
{
if (!str1 && !str2) return TRUE;
if (!str1 && str2 && !*str2) return TRUE;
@@ -197,7 +197,7 @@ INT_PTR __cdecl CJabberProto::OnJoinChat(WPARAM hContact, LPARAM)
ptrT password(getTStringA(hContact, "Password"));
if (getWord(hContact, "Status", 0) != ID_STATUS_ONLINE) {
- TCHAR *p = _tcschr(jid, '@');
+ wchar_t *p = wcschr(jid, '@');
if (p != NULL) {
*p++ = 0;
GroupchatJoinRoom(p, jid, nick, password);
@@ -220,7 +220,7 @@ INT_PTR __cdecl CJabberProto::OnLeaveChat(WPARAM hContact, LPARAM)
return 0;
}
-void CJabberProto::GroupchatJoinRoom(const TCHAR *server, const TCHAR *room, const TCHAR *nick, const TCHAR *password, bool autojoin)
+void CJabberProto::GroupchatJoinRoom(const wchar_t *server, const wchar_t *room, const wchar_t *nick, const wchar_t *password, bool autojoin)
{
JabberGcRecentInfo info(this);
@@ -245,7 +245,7 @@ void CJabberProto::GroupchatJoinRoom(const TCHAR *server, const TCHAR *room, con
info.saveRecent(0);
}
- TCHAR text[JABBER_MAX_JID_LEN + 1];
+ wchar_t text[JABBER_MAX_JID_LEN + 1];
mir_sntprintf(text, L"%s@%s/%s", room, server, nick);
JABBER_LIST_ITEM *item = ListAdd(LIST_CHATROOM, text);
@@ -270,10 +270,10 @@ struct RoomInfo
{
enum Overlay { ROOM_WAIT, ROOM_FAIL, ROOM_BOOKMARK, ROOM_DEFAULT };
Overlay overlay;
- TCHAR *line1, *line2;
+ wchar_t *line1, *line2;
};
-static int sttRoomListAppend(HWND hwndList, RoomInfo::Overlay overlay, const TCHAR *line1, const TCHAR *line2, const TCHAR *name)
+static int sttRoomListAppend(HWND hwndList, RoomInfo::Overlay overlay, const wchar_t *line1, const wchar_t *line2, const wchar_t *name)
{
RoomInfo *info = (RoomInfo *)mir_alloc(sizeof(RoomInfo));
info->overlay = overlay;
@@ -307,10 +307,10 @@ void CJabberProto::OnIqResultDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
bool found = false;
HXML item;
for (int i = 1; item = XmlGetNthChild(query, L"item", i); i++) {
- const TCHAR *jid = XmlGetAttrValue(item, L"jid");
- TCHAR *name = NEWTSTR_ALLOCA(jid);
+ const wchar_t *jid = XmlGetAttrValue(item, L"jid");
+ wchar_t *name = NEWWSTR_ALLOCA(jid);
if (name) {
- if (TCHAR *p = _tcschr(name, _T('@')))
+ if (wchar_t *p = wcschr(name, '@'))
*p = 0;
}
else name = L"";
@@ -333,7 +333,7 @@ void CJabberProto::OnIqResultDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
}
else if (pInfo->GetIqType() == JABBER_IQ_TYPE_ERROR) {
HXML errorNode = XmlGetChild(iqNode, "error");
- TCHAR *str = JabberErrorMsg(errorNode);
+ wchar_t *str = JabberErrorMsg(errorNode);
sttRoomListAppend(hwndList, RoomInfo::ROOM_FAIL,
TranslateT("Jabber Error"),
str,
@@ -386,11 +386,11 @@ class CJabberDlgGcJoin : public CJabberDlgBase
CCtrlButton btnOk;
public:
- CJabberDlgGcJoin(CJabberProto *proto, TCHAR *jid);
+ CJabberDlgGcJoin(CJabberProto *proto, wchar_t *jid);
~CJabberDlgGcJoin();
protected:
- TCHAR *m_jid;
+ wchar_t *m_jid;
void OnInitDialog();
void OnDestroy();
@@ -400,7 +400,7 @@ protected:
INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
};
-CJabberDlgGcJoin::CJabberDlgGcJoin(CJabberProto *proto, TCHAR *jid) :
+CJabberDlgGcJoin::CJabberDlgGcJoin(CJabberProto *proto, wchar_t *jid) :
CSuper(proto, IDD_GROUPCHAT_JOIN, NULL),
btnOk(this, IDOK),
m_jid(mir_tstrdup(jid))
@@ -426,8 +426,8 @@ void CJabberDlgGcJoin::OnInitDialog()
HANDLE hData = GetClipboardData(CF_UNICODETEXT);
if (hData) {
- TCHAR *buf = (TCHAR *)GlobalLock(hData);
- if (buf && _tcschr(buf, _T('@')) && !_tcschr(buf, _T(' ')))
+ wchar_t *buf = (wchar_t *)GlobalLock(hData);
+ if (buf && wcschr(buf, '@') && !wcschr(buf, ' '))
pInfo = new JabberGcRecentInfo(m_proto, buf);
GlobalUnlock(hData);
}
@@ -466,7 +466,7 @@ void CJabberDlgGcJoin::OnInitDialog()
int i;
for (i = 0; i < 5; i++) {
- TCHAR jid[JABBER_MAX_JID_LEN];
+ wchar_t jid[JABBER_MAX_JID_LEN];
JabberGcRecentInfo info(m_proto);
if (!info.loadRecent(i))
break;
@@ -490,20 +490,20 @@ void CJabberDlgGcJoin::OnDestroy()
void CJabberDlgGcJoin::OnBtnOk(CCtrlButton*)
{
- TCHAR text[128];
+ wchar_t text[128];
GetDlgItemText(m_hwnd, IDC_SERVER, text, _countof(text));
- TCHAR *server = NEWTSTR_ALLOCA(text), *room;
+ wchar_t *server = NEWWSTR_ALLOCA(text), *room;
m_proto->ComboAddRecentString(m_hwnd, IDC_SERVER, "joinWnd_rcSvr", server);
GetDlgItemText(m_hwnd, IDC_ROOM, text, _countof(text));
- room = NEWTSTR_ALLOCA(text);
+ room = NEWWSTR_ALLOCA(text);
GetDlgItemText(m_hwnd, IDC_NICK, text, _countof(text));
- TCHAR *nick = NEWTSTR_ALLOCA(text);
+ wchar_t *nick = NEWWSTR_ALLOCA(text);
GetDlgItemText(m_hwnd, IDC_PASSWORD, text, _countof(text));
- TCHAR *password = NEWTSTR_ALLOCA(text);
+ wchar_t *password = NEWWSTR_ALLOCA(text);
m_proto->GroupchatJoinRoom(server, room, nick, password);
}
@@ -620,7 +620,7 @@ INT_PTR CJabberDlgGcJoin::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
SendDlgItemMessage(m_hwnd, IDC_ROOM, CB_RESETCONTENT, 0, 0);
int len = GetWindowTextLength(GetDlgItem(m_hwnd, IDC_SERVER)) + 1;
- TCHAR *server = (TCHAR*)_alloca(len * sizeof(TCHAR));
+ wchar_t *server = (wchar_t*)_alloca(len * sizeof(wchar_t));
GetDlgItemText(m_hwnd, IDC_SERVER, server, len);
if (*server) {
@@ -669,9 +669,9 @@ INT_PTR CJabberDlgGcJoin::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
m_proto->OnMenuHandleBookmarks(0, 0);
else if (res) {
JABBER_LIST_ITEM *item = (JABBER_LIST_ITEM *)res;
- TCHAR *room = NEWTSTR_ALLOCA(item->jid);
+ wchar_t *room = NEWWSTR_ALLOCA(item->jid);
if (room) {
- TCHAR *server = _tcschr(room, _T('@'));
+ wchar_t *server = wcschr(room, '@');
if (server) {
*server++ = 0;
@@ -711,7 +711,7 @@ INT_PTR CJabberDlgGcJoin::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
return CSuper::DlgProc(msg, wParam, lParam);
}
-void CJabberProto::GroupchatJoinRoomByJid(HWND, TCHAR *jid)
+void CJabberProto::GroupchatJoinRoomByJid(HWND, wchar_t *jid)
{
if (m_pDlgJabberJoinGroupchat)
SetForegroundWindow(m_pDlgJabberJoinGroupchat->GetHwnd());
@@ -726,7 +726,7 @@ void CJabberProto::GroupchatJoinRoomByJid(HWND, TCHAR *jid)
struct JabberGroupchatChangeNicknameParam
{
- JabberGroupchatChangeNicknameParam(CJabberProto* ppro_, const TCHAR *jid_) :
+ JabberGroupchatChangeNicknameParam(CJabberProto* ppro_, const wchar_t *jid_) :
ppro(ppro_),
jid(mir_tstrdup(jid_))
{}
@@ -736,7 +736,7 @@ struct JabberGroupchatChangeNicknameParam
}
CJabberProto *ppro;
- TCHAR *jid;
+ wchar_t *jid;
};
static VOID CALLBACK JabberGroupchatChangeNickname(void* arg)
@@ -767,17 +767,17 @@ static int sttGetStatusCode(HXML node)
if (statusNode == NULL)
return -1;
- const TCHAR *statusCode = XmlGetAttrValue(statusNode, L"code");
+ const wchar_t *statusCode = XmlGetAttrValue(statusNode, L"code");
if (statusCode == NULL)
return -1;
- return _ttol(statusCode);
+ return _wtol(statusCode);
}
-void CJabberProto::RenameParticipantNick(JABBER_LIST_ITEM *item, const TCHAR *oldNick, HXML itemNode)
+void CJabberProto::RenameParticipantNick(JABBER_LIST_ITEM *item, const wchar_t *oldNick, HXML itemNode)
{
- const TCHAR *jid = XmlGetAttrValue(itemNode, L"jid");
- const TCHAR *newNick = XmlGetAttrValue(itemNode, L"nick");
+ const wchar_t *jid = XmlGetAttrValue(itemNode, L"jid");
+ const wchar_t *newNick = XmlGetAttrValue(itemNode, L"nick");
if (newNick == NULL)
return;
@@ -813,12 +813,12 @@ void CJabberProto::RenameParticipantNick(JABBER_LIST_ITEM *item, const TCHAR *ol
void CJabberProto::GroupchatProcessPresence(HXML node)
{
- const TCHAR *from;
+ const wchar_t *from;
if (!node || !XmlGetName(node) || mir_tstrcmp(XmlGetName(node), L"presence")) return;
if ((from = XmlGetAttrValue(node, L"from")) == NULL) return;
- const TCHAR *resource = _tcschr(from, '/');
+ const wchar_t *resource = wcschr(from, '/');
if (resource == NULL || *++resource == '\0')
return;
@@ -829,8 +829,8 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
pResourceStatus r(item->findResource(resource));
HXML nNode = XmlGetChildByTag(node, "nick", "xmlns", JABBER_FEAT_NICK);
- const TCHAR *cnick = XmlGetText(nNode);
- const TCHAR *nick = cnick ? cnick : (r && r->m_tszNick ? r->m_tszNick : resource);
+ const wchar_t *cnick = XmlGetText(nNode);
+ const wchar_t *nick = cnick ? cnick : (r && r->m_tszNick ? r->m_tszNick : resource);
// process custom nick change
if (cnick && r && r->m_tszNick && mir_tstrcmp(cnick, r->m_tszNick))
@@ -839,7 +839,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
HXML xNode = XmlGetChildByTag(node, "x", "xmlns", JABBER_FEAT_MUC_USER);
HXML itemNode = XmlGetChild(xNode, "item");
- const TCHAR *type = XmlGetAttrValue(node, L"type");
+ const wchar_t *type = XmlGetAttrValue(node, L"type");
// entering room or a usual room presence
if (type == NULL || !mir_tstrcmp(type, L"available")) {
@@ -863,7 +863,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
char priority = 0;
if (LPCTSTR ptszPriority = XmlGetText(XmlGetChild(node, "priority")))
- priority = (char)_ttoi(ptszPriority);
+ priority = (char)_wtoi(ptszPriority);
bool bStatusChanged = false, bRoomCreated = false, bAffiliationChanged = false, bRoleChanged = false;
int newRes = ListAddResource(LIST_CHATROOM, from, status, str, priority, cnick) ? GC_EVENT_JOIN : 0;
@@ -947,7 +947,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
// leaving room
else if (!mir_tstrcmp(type, L"unavailable")) {
- const TCHAR *str = 0;
+ const wchar_t *str = 0;
if (xNode != NULL && item->nick != NULL) {
HXML reasonNode = XmlGetChild(itemNode, "reason");
str = XmlGetAttrValue(itemNode, L"jid");
@@ -1003,7 +1003,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
ptrT newNick(getTStringA("GcAltNick"));
if (++item->iChatState == 1 && newNick != NULL && newNick[0] != 0) {
replaceStrT(item->nick, newNick);
- TCHAR text[1024] = { 0 };
+ wchar_t text[1024] = { 0 };
mir_sntprintf(text, L"%s/%s", item->jid, newNick);
SendPresenceTo(m_iStatus, text, NULL);
}
@@ -1024,7 +1024,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
void CJabberProto::GroupchatProcessMessage(HXML node)
{
HXML n, m;
- const TCHAR *from, *type, *p, *nick, *resource;
+ const wchar_t *from, *type, *p, *nick, *resource;
JABBER_LIST_ITEM *item;
CMString imgLink;
@@ -1038,9 +1038,9 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
GCDEST gcd = { m_szModuleName, item->jid, 0 };
- const TCHAR *msgText = NULL;
+ const wchar_t *msgText = NULL;
- resource = _tcschr(from, '/');
+ resource = wcschr(from, '/');
if (resource != NULL && *++resource == '\0')
resource = NULL;
@@ -1052,15 +1052,15 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
gcd.iType = GC_EVENT_TOPIC;
if (resource == NULL && (m = XmlGetChild(node, "body")) != NULL) {
- const TCHAR *tmpnick = XmlGetText(m);
+ const wchar_t *tmpnick = XmlGetText(m);
if (tmpnick == NULL || *tmpnick == 0)
return;
- const TCHAR *tmptr = _tcsstr(tmpnick, L"has set the subject to:"); //ejabberd
+ const wchar_t *tmptr = wcsstr(tmpnick, L"has set the subject to:"); //ejabberd
if (tmptr == NULL)
- tmptr = _tcsstr(tmpnick, TranslateT("has set the subject to:")); //ejabberd
+ tmptr = wcsstr(tmpnick, TranslateT("has set the subject to:")); //ejabberd
if (tmptr != NULL && *tmptr != 0) {
- *(TCHAR*)(--tmptr) = 0;
+ *(wchar_t*)(--tmptr) = 0;
resource = tmpnick;
}
}
@@ -1079,7 +1079,7 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
if (resource == NULL)
gcd.iType = GC_EVENT_INFORMATION;
- else if (_tcsncmp(msgText, L"/me ", 4) == 0 && mir_tstrlen(msgText) > 4) {
+ else if (wcsncmp(msgText, L"/me ", 4) == 0 && mir_tstrlen(msgText) > 4) {
msgText += 4;
gcd.iType = GC_EVENT_ACTION;
}
@@ -1144,7 +1144,7 @@ class CGroupchatInviteAcceptDlg : public CJabberDlgBase
CMString m_roomJid, m_from, m_reason, m_password;
public:
- CGroupchatInviteAcceptDlg(CJabberProto *ppro, const TCHAR *roomJid, const TCHAR *from, const TCHAR *reason, const TCHAR *password) :
+ CGroupchatInviteAcceptDlg(CJabberProto *ppro, const wchar_t *roomJid, const wchar_t *from, const wchar_t *reason, const wchar_t *password) :
CSuper(ppro, IDD_GROUPCHAT_INVITE_ACCEPT, NULL),
m_roomJid(roomJid), m_from(from), m_reason(reason), m_password(password),
m_accept(this, IDC_ACCEPT)
@@ -1156,7 +1156,7 @@ public:
{
CSuper::OnInitDialog();
- TCHAR buf[256];
+ wchar_t buf[256];
mir_sntprintf(buf, TranslateT("Group chat invitation to\n%s"), m_roomJid);
SetDlgItemText(m_hwnd, IDC_HEADERBAR, buf);
@@ -1171,7 +1171,7 @@ public:
void OnCommand_Accept(CCtrlButton*)
{
- TCHAR text[128];
+ wchar_t text[128];
GetDlgItemText(m_hwnd, IDC_NICK, text, _countof(text));
m_proto->AcceptGroupchatInvite(m_roomJid, text, m_password);
EndDialog(m_hwnd, 0);
@@ -1184,7 +1184,7 @@ static void __stdcall sttShowDialog(void *pArg)
pDlg->Show();
}
-void CJabberProto::GroupchatProcessInvite(const TCHAR *roomJid, const TCHAR *from, const TCHAR *reason, const TCHAR *password)
+void CJabberProto::GroupchatProcessInvite(const wchar_t *roomJid, const wchar_t *from, const wchar_t *reason, const wchar_t *password)
{
if (roomJid == NULL)
return;
@@ -1203,11 +1203,11 @@ void CJabberProto::GroupchatProcessInvite(const TCHAR *roomJid, const TCHAR *fro
else CallFunctionAsync(sttShowDialog, new CGroupchatInviteAcceptDlg(this, roomJid, from, reason, password));
}
-void CJabberProto::AcceptGroupchatInvite(const TCHAR *roomJid, const TCHAR *reason, const TCHAR *password)
+void CJabberProto::AcceptGroupchatInvite(const wchar_t *roomJid, const wchar_t *reason, const wchar_t *password)
{
- TCHAR room[256], *server, *p;
- _tcsncpy_s(room, roomJid, _TRUNCATE);
- p = _tcstok(room, L"@");
- server = _tcstok(NULL, L"@");
+ wchar_t room[256], *server, *p;
+ wcsncpy_s(room, roomJid, _TRUNCATE);
+ p = wcstok(room, L"@");
+ server = wcstok(NULL, L"@");
GroupchatJoinRoom(server, p, reason, password);
}
diff --git a/protocols/JabberG/src/jabber_ibb.cpp b/protocols/JabberG/src/jabber_ibb.cpp
index bec32266dd..f15b3f4776 100644
--- a/protocols/JabberG/src/jabber_ibb.cpp
+++ b/protocols/JabberG/src/jabber_ibb.cpp
@@ -52,8 +52,8 @@ BOOL CJabberProto::OnFtHandleIbbIq(HXML iqNode, CJabberIqInfo *pInfo)
FtHandleIbbRequest(iqNode, FALSE);
else if (!mir_tstrcmp(pInfo->GetChildNodeName(), L"data")) {
BOOL bOk = FALSE;
- const TCHAR *sid = XmlGetAttrValue(pInfo->GetChildNode(), L"sid");
- const TCHAR *seq = XmlGetAttrValue(pInfo->GetChildNode(), L"seq");
+ const wchar_t *sid = XmlGetAttrValue(pInfo->GetChildNode(), L"sid");
+ const wchar_t *seq = XmlGetAttrValue(pInfo->GetChildNode(), L"seq");
if (sid && seq && XmlGetText(pInfo->GetChildNode()))
bOk = OnIbbRecvdData(XmlGetText(pInfo->GetChildNode()), sid, seq);
@@ -164,12 +164,12 @@ void __cdecl CJabberProto::IbbReceiveThread(JABBER_IBB_TRANSFER *jibb)
JabberIbbFreeJibb(jibb);
}
-BOOL CJabberProto::OnIbbRecvdData(const TCHAR *data, const TCHAR *sid, const TCHAR *seq)
+BOOL CJabberProto::OnIbbRecvdData(const wchar_t *data, const wchar_t *sid, const wchar_t *seq)
{
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_FTRECV, sid);
if (item == NULL) return FALSE;
- WORD wSeq = (WORD)_ttoi(seq);
+ WORD wSeq = (WORD)_wtoi(seq);
if (wSeq != item->jibb->wPacketId) {
if (item->jibb->hEvent)
SetEvent(item->jibb->hEvent);
diff --git a/protocols/JabberG/src/jabber_ibb.h b/protocols/JabberG/src/jabber_ibb.h
index 097c14083a..803eff2bbc 100644
--- a/protocols/JabberG/src/jabber_ibb.h
+++ b/protocols/JabberG/src/jabber_ibb.h
@@ -29,9 +29,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
typedef enum { JIBB_INIT, JIBB_CONNECT, JIBB_SENDING, JIBB_RECVING, JIBB_DONE, JIBB_ERROR } JABBER_IBB_STATE;
typedef struct {
- TCHAR *sid;
- TCHAR *srcJID;
- TCHAR *dstJID;
+ wchar_t *sid;
+ wchar_t *srcJID;
+ wchar_t *dstJID;
unsigned __int64 dwTransferredSize;
JABBER_IBB_STATE state;
HANDLE hEvent;
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp
index f3739cdece..6d85d38886 100644
--- a/protocols/JabberG/src/jabber_icolib.cpp
+++ b/protocols/JabberG/src/jabber_icolib.cpp
@@ -41,7 +41,7 @@ HIMAGELIST hAdvancedStatusIcon = NULL;
struct CTransportProtoTableItem
{
- TCHAR *mask;
+ wchar_t *mask;
char* proto;
};
@@ -110,7 +110,7 @@ CIconPool::~CIconPool()
{
}
-void CIconPool::RegisterIcon(const char *name, TCHAR *filename, int iconid, TCHAR *szSection, TCHAR *szDescription)
+void CIconPool::RegisterIcon(const char *name, wchar_t *filename, int iconid, wchar_t *szSection, wchar_t *szDescription)
{
char szSettingName[128];
mir_snprintf(szSettingName, "jabber_%s", name);
@@ -120,10 +120,10 @@ void CIconPool::RegisterIcon(const char *name, TCHAR *filename, int iconid, TCHA
item->m_szIcolibName = mir_strdup(szSettingName);
SKINICONDESC sid = { 0 };
- sid.defaultFile.t = filename;
+ sid.defaultFile.w = filename;
sid.pszName = szSettingName;
- sid.section.t = szSection;
- sid.description.t = szDescription;
+ sid.section.w = szSection;
+ sid.description.w = szDescription;
sid.flags = SIDF_ALL_TCHAR;
sid.iDefaultIndex = iconid;
item->m_hIcolibItem = IcoLib_AddIcon(&sid);
@@ -194,14 +194,14 @@ HICON CJabberProto::LoadIconEx(const char* name, bool big)
/////////////////////////////////////////////////////////////////////////////////////////
// internal functions
-static inline TCHAR qtoupper(TCHAR c)
+static inline wchar_t qtoupper(wchar_t c)
{
return (c >= 'a' && c <= 'z') ? c - 'a' + 'A' : c;
}
-static BOOL WildComparei(const TCHAR *name, const TCHAR *mask)
+static BOOL WildComparei(const wchar_t *name, const wchar_t *mask)
{
- const TCHAR *last = '\0';
+ const wchar_t *last = '\0';
for (;; mask++, name++) {
if (*mask != '?' && qtoupper(*mask) != qtoupper(*name))
break;
@@ -226,7 +226,7 @@ static BOOL WildComparei(const TCHAR *name, const TCHAR *mask)
}
}
-static BOOL MatchMask(const TCHAR *name, const TCHAR *mask)
+static BOOL MatchMask(const wchar_t *name, const wchar_t *mask)
{
if (!mask || !name)
return mask == name;
@@ -234,7 +234,7 @@ static BOOL MatchMask(const TCHAR *name, const TCHAR *mask)
if (*mask != '|')
return WildComparei(name, mask);
- TCHAR *temp = NEWTSTR_ALLOCA(mask);
+ wchar_t *temp = NEWWSTR_ALLOCA(mask);
for (int e = 1; mask[e] != '\0'; e++) {
int s = e;
while (mask[e] != '\0' && mask[e] != '|')
@@ -270,7 +270,7 @@ static HICON ExtractIconFromPath(const char *path, BOOL * needFree)
return hIcon;
}
-static HICON LoadTransportIcon(char *filename, int i, char *IconName, TCHAR *SectName, TCHAR *Description, int internalidx, BOOL *needFree)
+static HICON LoadTransportIcon(char *filename, int i, char *IconName, wchar_t *SectName, wchar_t *Description, int internalidx, BOOL *needFree)
{
char szPath[MAX_PATH], szMyPath[MAX_PATH], szFullPath[MAX_PATH], *str;
BOOL has_proto_icon = FALSE;
@@ -287,9 +287,9 @@ static HICON LoadTransportIcon(char *filename, int i, char *IconName, TCHAR *Sec
if (IconName != NULL && SectName != NULL) {
SKINICONDESC sid = { 0 };
sid.hDefaultIcon = (has_proto_icon) ? NULL : Skin_LoadProtoIcon(0, -internalidx);
- sid.section.t = SectName;
+ sid.section.w = SectName;
sid.pszName = IconName;
- sid.description.t = Description;
+ sid.description.w = Description;
sid.defaultFile.a = szMyPath;
sid.iDefaultIndex = i;
sid.flags = SIDF_TCHAR;
@@ -302,12 +302,12 @@ int CJabberProto::LoadAdvancedIcons(int iID)
{
char *proto = TransportProtoTable[iID].proto;
char defFile[MAX_PATH] = { 0 };
- TCHAR Group[255];
+ wchar_t Group[255];
char Uname[255];
int first = -1;
HICON empty = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- mir_sntprintf(Group, LPGENT("Status icons")L"/%s/%S %s", m_tszUserName, proto, TranslateT("transport"));
+ mir_sntprintf(Group, LPGENW("Status icons")L"/%s/%S %s", m_tszUserName, proto, TranslateT("transport"));
mir_snprintf(defFile, "proto_%s.dll", proto);
if (!hAdvancedStatusIcon)
hAdvancedStatusIcon = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
@@ -316,7 +316,7 @@ int CJabberProto::LoadAdvancedIcons(int iID)
for (int i = 0; i < ID_STATUS_ONTHEPHONE - ID_STATUS_OFFLINE; i++) {
BOOL needFree;
int n = skinStatusToJabberStatus[i];
- TCHAR *descr = pcli->pfnGetStatusModeDescription(n + ID_STATUS_OFFLINE, 0);
+ wchar_t *descr = pcli->pfnGetStatusModeDescription(n + ID_STATUS_OFFLINE, 0);
mir_snprintf(Uname, "%s_Transport_%s_%d", m_szModuleName, proto, n);
HICON hicon = LoadTransportIcon(defFile, -skinIconStatusToResourceId[i], Uname, Group, descr, -(n + ID_STATUS_OFFLINE), &needFree);
int index = (m_transportProtoTableStartIndex[iID] == -1) ? -1 : m_transportProtoTableStartIndex[iID] + n;
@@ -332,7 +332,7 @@ int CJabberProto::LoadAdvancedIcons(int iID)
return 0;
}
-int CJabberProto::GetTransportProtoID(TCHAR* TransportDomain)
+int CJabberProto::GetTransportProtoID(wchar_t* TransportDomain)
{
for (int i = 0; i < _countof(TransportProtoTable); i++)
if (MatchMask(TransportDomain, TransportProtoTable[i].mask))
@@ -404,22 +404,22 @@ INT_PTR __cdecl CJabberProto::JGetAdvancedStatusIcon(WPARAM hContact, LPARAM)
/////////////////////////////////////////////////////////////////////////////////////////
// Transport check functions
-BOOL CJabberProto::DBCheckIsTransportedContact(const TCHAR *jid, MCONTACT hContact)
+BOOL CJabberProto::DBCheckIsTransportedContact(const wchar_t *jid, MCONTACT hContact)
{
// check if transport is already set
if (!jid || !hContact)
return FALSE;
// strip domain part from jid
- TCHAR *domain = _tcschr((TCHAR*)jid, '@');
+ wchar_t *domain = wcschr((wchar_t*)jid, '@');
BOOL isAgent = (domain == NULL) ? TRUE : FALSE;
BOOL isTransported = FALSE;
if (domain != NULL)
- domain = NEWTSTR_ALLOCA(domain + 1);
+ domain = NEWWSTR_ALLOCA(domain + 1);
else
- domain = NEWTSTR_ALLOCA(jid);
+ domain = NEWWSTR_ALLOCA(jid);
- TCHAR *resourcepos = _tcschr(domain, '/');
+ wchar_t *resourcepos = wcschr(domain, '/');
if (resourcepos != NULL)
*resourcepos = '\0';
diff --git a/protocols/JabberG/src/jabber_icolib.h b/protocols/JabberG/src/jabber_icolib.h
index a512a71677..e91d393eb0 100644
--- a/protocols/JabberG/src/jabber_icolib.h
+++ b/protocols/JabberG/src/jabber_icolib.h
@@ -35,7 +35,7 @@ public:
CIconPool();
~CIconPool();
- void RegisterIcon(const char *name, TCHAR *filename, int iconid, TCHAR *szSection, TCHAR *szDescription);
+ void RegisterIcon(const char *name, wchar_t *filename, int iconid, wchar_t *szSection, wchar_t *szDescription);
HANDLE GetIcolibHandle(const char *name);
char *GetIcolibName(const char *name);
diff --git a/protocols/JabberG/src/jabber_iq.cpp b/protocols/JabberG/src/jabber_iq.cpp
index ca7020a25e..60040145af 100644
--- a/protocols/JabberG/src/jabber_iq.cpp
+++ b/protocols/JabberG/src/jabber_iq.cpp
@@ -201,7 +201,7 @@ void CJabberIqManager::ExpireAll()
ExpireInfo(pInfo);
}
-CJabberIqInfo* CJabberIqManager::AddHandler(JABBER_IQ_HANDLER pHandler, int nIqType, const TCHAR *szReceiver, DWORD dwParamsToParse, int nIqId, void *pUserData, int iPriority)
+CJabberIqInfo* CJabberIqManager::AddHandler(JABBER_IQ_HANDLER pHandler, int nIqType, const wchar_t *szReceiver, DWORD dwParamsToParse, int nIqId, void *pUserData, int iPriority)
{
CJabberIqInfo *pInfo = new CJabberIqInfo();
pInfo->m_pHandler = pHandler;
@@ -243,7 +243,7 @@ bool CJabberIqManager::HandleIq(int nIqId, HXML pNode)
if (nIqId == -1 || pNode == NULL)
return false;
- const TCHAR *szType = XmlGetAttrValue(pNode, L"type");
+ const wchar_t *szType = XmlGetAttrValue(pNode, L"type");
if (!szType)
return false;
@@ -266,21 +266,21 @@ bool CJabberIqManager::HandleIq(int nIqId, HXML pNode)
pInfo->m_pChildNode = XmlGetChild(pNode , 0);
if (pInfo->m_pChildNode && (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_CHILD_TAG_NAME))
- pInfo->m_szChildTagName = (TCHAR*)XmlGetName(pInfo->m_pChildNode);
+ pInfo->m_szChildTagName = (wchar_t*)XmlGetName(pInfo->m_pChildNode);
if (pInfo->m_pChildNode && (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_CHILD_TAG_XMLNS))
- pInfo->m_szChildTagXmlns = (TCHAR*)XmlGetAttrValue(pNode, L"xmlns");
+ pInfo->m_szChildTagXmlns = (wchar_t*)XmlGetAttrValue(pNode, L"xmlns");
}
if (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_TO)
- pInfo->m_szTo = (TCHAR*)XmlGetAttrValue(pNode, L"to");
+ pInfo->m_szTo = (wchar_t*)XmlGetAttrValue(pNode, L"to");
if (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_FROM)
- pInfo->m_szFrom = (TCHAR*)XmlGetAttrValue(pNode, L"from");
+ pInfo->m_szFrom = (wchar_t*)XmlGetAttrValue(pNode, L"from");
if (pInfo->m_szFrom && (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_HCONTACT))
pInfo->m_hContact = ppro->HContactFromJID(pInfo->m_szFrom);
if (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_ID_STR)
- pInfo->m_szId = (TCHAR*)XmlGetAttrValue(pNode, L"id");
+ pInfo->m_szId = (wchar_t*)XmlGetAttrValue(pNode, L"id");
(ppro->*(pInfo->m_pHandler))(pNode, pInfo);
delete pInfo;
@@ -294,7 +294,7 @@ bool CJabberIqManager::HandleIqPermanent(HXML pNode)
for (int i = 0; i < m_arHandlers.getCount(); i++) {
CJabberIqPermanentInfo &pInfo = m_arHandlers[i];
// have to get all data here, in the loop, because there's always possibility that previous handler modified it
- const TCHAR *szType = XmlGetAttrValue(pNode, L"type");
+ const wchar_t *szType = XmlGetAttrValue(pNode, L"type");
if (!szType)
return FALSE;
@@ -314,24 +314,24 @@ bool CJabberIqManager::HandleIqPermanent(HXML pNode)
if (!pFirstChild || !XmlGetName(pFirstChild))
return FALSE;
- const TCHAR *szTagName = XmlGetName(pFirstChild);
- const TCHAR *szXmlns = XmlGetAttrValue(pFirstChild, L"xmlns");
+ const wchar_t *szTagName = XmlGetName(pFirstChild);
+ const wchar_t *szXmlns = XmlGetAttrValue(pFirstChild, L"xmlns");
if ((!pInfo.m_szXmlns || (szXmlns && !mir_tstrcmp(pInfo.m_szXmlns, szXmlns))) &&
(!pInfo.m_szTag || !mir_tstrcmp(pInfo.m_szTag, szTagName)))
{
// node suits handler criteria, call the handler
iqInfo.m_pChildNode = pFirstChild;
- iqInfo.m_szChildTagName = (TCHAR*)szTagName;
- iqInfo.m_szChildTagXmlns = (TCHAR*)szXmlns;
- iqInfo.m_szId = (TCHAR*)XmlGetAttrValue(pNode, L"id");
+ iqInfo.m_szChildTagName = (wchar_t*)szTagName;
+ iqInfo.m_szChildTagXmlns = (wchar_t*)szXmlns;
+ iqInfo.m_szId = (wchar_t*)XmlGetAttrValue(pNode, L"id");
iqInfo.m_pUserData = pInfo.m_pUserData;
if (pInfo.m_dwParamsToParse & JABBER_IQ_PARSE_TO)
- iqInfo.m_szTo = (TCHAR*)XmlGetAttrValue(pNode, L"to");
+ iqInfo.m_szTo = (wchar_t*)XmlGetAttrValue(pNode, L"to");
if (pInfo.m_dwParamsToParse & JABBER_IQ_PARSE_FROM)
- iqInfo.m_szFrom = (TCHAR*)XmlGetAttrValue(pNode, L"from");
+ iqInfo.m_szFrom = (wchar_t*)XmlGetAttrValue(pNode, L"from");
if ((pInfo.m_dwParamsToParse & JABBER_IQ_PARSE_HCONTACT) && (iqInfo.m_szFrom))
iqInfo.m_hContact = ppro->HContactFromJID(iqInfo.m_szFrom);
@@ -406,9 +406,9 @@ CJabberIqPermanentInfo* CJabberIqManager::AddPermanentHandler(
JABBER_PERMANENT_IQ_HANDLER pHandler,
int nIqTypes,
DWORD dwParamsToParse,
- const TCHAR *szXmlns,
+ const wchar_t *szXmlns,
BOOL bAllowPartialNs,
- const TCHAR *szTag,
+ const wchar_t *szTag,
void *pUserData,
IQ_USER_DATA_FREE_FUNC pUserDataFree,
int iPriority)
diff --git a/protocols/JabberG/src/jabber_iq.h b/protocols/JabberG/src/jabber_iq.h
index a985701c30..6d5b75d68a 100644
--- a/protocols/JabberG/src/jabber_iq.h
+++ b/protocols/JabberG/src/jabber_iq.h
@@ -59,19 +59,19 @@ protected:
DWORD m_dwParamsToParse;
DWORD m_dwRequestTime;
DWORD m_dwTimeout;
- TCHAR *m_szReceiver;
+ wchar_t *m_szReceiver;
int m_iPriority;
public:
void *m_pUserData;
int m_nIqType;
- TCHAR *m_szFrom;
- TCHAR *m_szChildTagXmlns;
- TCHAR *m_szChildTagName;
+ wchar_t *m_szFrom;
+ wchar_t *m_szChildTagXmlns;
+ wchar_t *m_szChildTagName;
HXML m_pChildNode;
MCONTACT m_hContact;
- TCHAR *m_szTo;
- TCHAR *m_szId;
+ wchar_t *m_szTo;
+ wchar_t *m_szId;
public:
__forceinline CJabberIqInfo()
@@ -81,7 +81,7 @@ public:
{ mir_free(m_szReceiver);
}
- __forceinline void SetReceiver(const TCHAR *szReceiver) { replaceStrT(m_szReceiver, szReceiver); }
+ __forceinline void SetReceiver(const wchar_t *szReceiver) { replaceStrT(m_szReceiver, szReceiver); }
__forceinline void SetParamsToParse(DWORD dwParamsToParse) { m_dwParamsToParse = dwParamsToParse; }
__forceinline void SetTimeout(DWORD dwTimeout) { m_dwTimeout = dwTimeout; }
@@ -89,13 +89,13 @@ public:
__forceinline DWORD GetRequestTime() const { return m_dwRequestTime; }
__forceinline int GetIqType() const { return m_nIqType; }
__forceinline void* GetUserData() const { return m_pUserData; }
- __forceinline TCHAR* GetFrom() const { return m_szFrom; }
- __forceinline TCHAR* GetTo() const { return m_szTo; }
- __forceinline TCHAR* GetIdStr() const { return m_szId; }
+ __forceinline wchar_t* GetFrom() const { return m_szFrom; }
+ __forceinline wchar_t* GetTo() const { return m_szTo; }
+ __forceinline wchar_t* GetIdStr() const { return m_szId; }
__forceinline MCONTACT GetHContact() const { return m_hContact; }
__forceinline HXML GetChildNode() const { return m_pChildNode; }
- __forceinline TCHAR* GetChildNodeName() const { return m_szChildTagName; }
- __forceinline TCHAR* GetReceiver() const { return m_szReceiver; }
+ __forceinline wchar_t* GetChildNodeName() const { return m_szChildTagName; }
+ __forceinline wchar_t* GetReceiver() const { return m_szReceiver; }
__forceinline int GetPriority() const { return m_iPriority; }
char* GetCharIqType()
@@ -117,8 +117,8 @@ class CJabberIqPermanentInfo : public MZeroedObject
JABBER_PERMANENT_IQ_HANDLER m_pHandler;
DWORD m_dwParamsToParse;
int m_nIqTypes;
- TCHAR *m_szXmlns;
- TCHAR *m_szTag;
+ wchar_t *m_szXmlns;
+ wchar_t *m_szTag;
BOOL m_bAllowPartialNs;
void *m_pUserData;
IQ_USER_DATA_FREE_FUNC m_pUserDataFree;
@@ -165,8 +165,8 @@ public:
void Shutdown();
// fucking params, maybe just return CJabberIqRequestInfo pointer ?
- CJabberIqInfo* AddHandler(JABBER_IQ_HANDLER pHandler, int nIqType, const TCHAR *szReceiver, DWORD dwParamsToParse, int nIqId, void *pUserData, int iPriority);
- CJabberIqPermanentInfo* AddPermanentHandler(JABBER_PERMANENT_IQ_HANDLER pHandler, int nIqTypes, DWORD dwParamsToParse, const TCHAR *szXmlns, BOOL bAllowPartialNs, const TCHAR *szTag, void *pUserData = NULL, IQ_USER_DATA_FREE_FUNC pUserDataFree = NULL, int iPriority = JH_PRIORITY_DEFAULT);
+ CJabberIqInfo* AddHandler(JABBER_IQ_HANDLER pHandler, int nIqType, const wchar_t *szReceiver, DWORD dwParamsToParse, int nIqId, void *pUserData, int iPriority);
+ CJabberIqPermanentInfo* AddPermanentHandler(JABBER_PERMANENT_IQ_HANDLER pHandler, int nIqTypes, DWORD dwParamsToParse, const wchar_t *szXmlns, BOOL bAllowPartialNs, const wchar_t *szTag, void *pUserData = NULL, IQ_USER_DATA_FREE_FUNC pUserDataFree = NULL, int iPriority = JH_PRIORITY_DEFAULT);
// returns TRUE when pInfo found, or FALSE otherwise
bool DeletePermanentHandler(CJabberIqPermanentInfo *pInfo);
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp
index a8f4f31e8f..9a87819646 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -42,7 +42,7 @@ BOOL CJabberProto::OnIqRequestVersion(HXML, CJabberIqInfo *pInfo)
query << XCHILD(L"version", szCoreVersion);
if (m_options.ShowOSVersion) {
- TCHAR os[256] = { 0 };
+ wchar_t os[256] = { 0 };
if (!GetOSDisplayString(os, _countof(os)))
mir_tstrncpy(os, L"Microsoft Windows", _countof(os));
query << XCHILD(L"os", os);
@@ -98,8 +98,8 @@ int GetGMTOffset(void)
// entity time (XEP-0202) support
BOOL CJabberProto::OnIqRequestTime(HXML, CJabberIqInfo *pInfo)
{
- TCHAR stime[100];
- TCHAR szTZ[10];
+ wchar_t stime[100];
+ wchar_t szTZ[10];
TimeZone_PrintDateTime(UTC_TIME_HANDLE, L"I", stime, _countof(stime), 0);
@@ -120,7 +120,7 @@ BOOL CJabberProto::OnIqProcessIqOldTime(HXML, CJabberIqInfo *pInfo)
{
struct tm *gmt;
time_t ltime;
- TCHAR stime[100], *dtime;
+ wchar_t stime[100], *dtime;
_tzset();
time(&ltime);
@@ -128,7 +128,7 @@ BOOL CJabberProto::OnIqProcessIqOldTime(HXML, CJabberIqInfo *pInfo)
mir_sntprintf(stime, L"%.4i%.2i%.2iT%.2i:%.2i:%.2i",
gmt->tm_year + 1900, gmt->tm_mon + 1,
gmt->tm_mday, gmt->tm_hour, gmt->tm_min, gmt->tm_sec);
- dtime = _tctime(&ltime);
+ dtime = _wctime(&ltime);
dtime[24] = 0;
XmlNodeIq iq(L"result", pInfo);
@@ -151,7 +151,7 @@ BOOL CJabberProto::OnIqRequestAvatar(HXML, CJabberIqInfo *pInfo)
if (pictureType == PA_FORMAT_UNKNOWN)
return TRUE;
- TCHAR *szMimeType;
+ wchar_t *szMimeType;
switch (pictureType) {
case PA_FORMAT_JPEG: szMimeType = L"image/jpeg"; break;
case PA_FORMAT_GIF: szMimeType = L"image/gif"; break;
@@ -160,10 +160,10 @@ BOOL CJabberProto::OnIqRequestAvatar(HXML, CJabberIqInfo *pInfo)
default: return TRUE;
}
- TCHAR szFileName[MAX_PATH];
+ wchar_t szFileName[MAX_PATH];
GetAvatarFileName(NULL, szFileName, _countof(szFileName));
- FILE* in = _tfopen(szFileName, L"rb");
+ FILE* in = _wfopen(szFileName, L"rb");
if (in == NULL)
return TRUE;
@@ -184,7 +184,7 @@ BOOL CJabberProto::OnIqRequestAvatar(HXML, CJabberIqInfo *pInfo)
BOOL CJabberProto::OnSiRequest(HXML node, CJabberIqInfo *pInfo)
{
- const TCHAR *szProfile = XmlGetAttrValue(pInfo->GetChildNode(), L"profile");
+ const wchar_t *szProfile = XmlGetAttrValue(pInfo->GetChildNode(), L"profile");
if (szProfile && !mir_tstrcmp(szProfile, JABBER_FEAT_SI_FT))
FtHandleSiRequest(node);
@@ -204,20 +204,20 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo)
// RFC 3921 #7.2 Business Rules
if (pInfo->GetFrom()) {
- TCHAR *szFrom = JabberPrepareJid(pInfo->GetFrom());
+ wchar_t *szFrom = JabberPrepareJid(pInfo->GetFrom());
if (!szFrom)
return TRUE;
- TCHAR *szTo = JabberPrepareJid(m_ThreadInfo->fullJID);
+ wchar_t *szTo = JabberPrepareJid(m_ThreadInfo->fullJID);
if (!szTo) {
mir_free(szFrom);
return TRUE;
}
- TCHAR *pDelimiter = _tcschr(szFrom, _T('/'));
+ wchar_t *pDelimiter = wcschr(szFrom, '/');
if (pDelimiter) *pDelimiter = 0;
- pDelimiter = _tcschr(szTo, _T('/'));
+ pDelimiter = wcschr(szTo, '/');
if (pDelimiter) *pDelimiter = 0;
BOOL bRetVal = mir_tstrcmp(szFrom, szTo) == 0;
@@ -232,7 +232,7 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo)
}
}
- const TCHAR *jid, *str;
+ const wchar_t *jid, *str;
debugLogA("<iq/> Got roster push, query has %d children", XmlGetChildCount(queryNode));
for (int i = 0;; i++) {
@@ -249,7 +249,7 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo)
// we will not add new account when subscription=remove
if (!mir_tstrcmp(str, L"to") || !mir_tstrcmp(str, L"both") || !mir_tstrcmp(str, L"from") || !mir_tstrcmp(str, L"none")) {
- const TCHAR *name = XmlGetAttrValue(itemNode, L"name");
+ const wchar_t *name = XmlGetAttrValue(itemNode, L"name");
ptrT nick((name != NULL) ? mir_tstrdup(name) : JabberNickFromJID(jid));
if (nick != NULL) {
MCONTACT hContact = HContactFromJID(jid, false);
@@ -343,16 +343,16 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo)
ft->httpPath = NULL;
// Parse the URL
- TCHAR *str = (TCHAR*)XmlGetText(n); // URL of the file to get
- if (!_tcsnicmp(str, L"http://", 7)) {
- TCHAR *p = str + 7, *q;
- if ((q = _tcschr(p, '/')) != NULL) {
- TCHAR text[1024];
+ wchar_t *str = (wchar_t*)XmlGetText(n); // URL of the file to get
+ if (!wcsnicmp(str, L"http://", 7)) {
+ wchar_t *p = str + 7, *q;
+ if ((q = wcschr(p, '/')) != NULL) {
+ wchar_t text[1024];
if (q - p < _countof(text)) {
- _tcsncpy_s(text, p, q - p);
+ wcsncpy_s(text, p, q - p);
text[q - p] = '\0';
- if ((p = _tcschr(text, ':')) != NULL) {
- ft->httpPort = (WORD)_ttoi(p + 1);
+ if ((p = wcschr(text, ':')) != NULL) {
+ ft->httpPort = (WORD)_wtoi(p + 1);
*p = '\0';
}
ft->httpHostName = mir_t2a(text);
@@ -364,15 +364,15 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo)
ft->szId = JabberId2string(pInfo->GetIqId());
if (ft->httpHostName && ft->httpPath) {
- TCHAR *desc = NULL;
+ wchar_t *desc = NULL;
debugLogA("Host=%s Port=%d Path=%s", ft->httpHostName, ft->httpPort, ft->httpPath);
if ((n = XmlGetChild(pInfo->GetChildNode(), "desc")) != NULL)
- desc = (TCHAR*)XmlGetText(n);
+ desc = (wchar_t*)XmlGetText(n);
- TCHAR *str2;
+ wchar_t *str2;
debugLog(L"description = %s", desc);
- if ((str2 = _tcsrchr(ft->httpPath, '/')) != NULL)
+ if ((str2 = wcsrchr(ft->httpPath, '/')) != NULL)
str2++;
else
str2 = ft->httpPath;
@@ -382,8 +382,8 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo)
PROTORECVFILET pre;
pre.dwFlags = PRFF_TCHAR;
pre.timestamp = time(NULL);
- pre.descr.t = desc;
- pre.files.t = &str2;
+ pre.descr.w = desc;
+ pre.files.w = &str2;
pre.fileCount = 1;
pre.lParam = (LPARAM)ft;
ProtoChainRecvFile(ft->std.hContact, &pre);
@@ -404,7 +404,7 @@ BOOL CJabberProto::OnHandleDiscoInfoRequest(HXML iqNode, CJabberIqInfo *pInfo)
if (!pInfo->GetChildNode())
return TRUE;
- const TCHAR *szNode = XmlGetAttrValue(pInfo->GetChildNode(), L"node");
+ const wchar_t *szNode = XmlGetAttrValue(pInfo->GetChildNode(), L"node");
// caps hack
if (m_clientCapsManager.HandleInfoRequest(iqNode, pInfo, szNode))
return TRUE;
@@ -427,7 +427,7 @@ BOOL CJabberProto::OnHandleDiscoItemsRequest(HXML iqNode, CJabberIqInfo *pInfo)
return TRUE;
// ad-hoc commands check:
- const TCHAR *szNode = XmlGetAttrValue(pInfo->GetChildNode(), L"node");
+ const wchar_t *szNode = XmlGetAttrValue(pInfo->GetChildNode(), L"node");
if (szNode && m_adhocManager.HandleItemsRequest(iqNode, pInfo, szNode))
return TRUE;
@@ -473,9 +473,9 @@ BOOL CJabberProto::OnIqHttpAuth(HXML node, CJabberIqInfo *pInfo)
if (!pConfirm)
return TRUE;
- const TCHAR *szId = XmlGetAttrValue(pConfirm, L"id");
- const TCHAR *szMethod = XmlGetAttrValue(pConfirm, L"method");
- const TCHAR *szUrl = XmlGetAttrValue(pConfirm, L"url");
+ const wchar_t *szId = XmlGetAttrValue(pConfirm, L"id");
+ const wchar_t *szMethod = XmlGetAttrValue(pConfirm, L"method");
+ const wchar_t *szUrl = XmlGetAttrValue(pConfirm, L"url");
if (!szId || !szMethod || !szUrl)
return TRUE;
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index 61fe3f353d..de177c797d 100644
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -34,7 +34,7 @@ void CJabberProto::OnIqResultServerDiscoInfo(HXML iqNode, CJabberIqInfo*)
if (iqNode == NULL)
return;
- const TCHAR *type = XmlGetAttrValue(iqNode, L"type");
+ const wchar_t *type = XmlGetAttrValue(iqNode, L"type");
if (mir_tstrcmp(type, L"result"))
return;
@@ -63,7 +63,7 @@ void CJabberProto::OnIqResultServerDiscoInfo(HXML iqNode, CJabberIqInfo*)
if (m_ThreadInfo) {
HXML feature;
for (int i = 1; (feature = XmlGetNthChild(query, L"feature", i)) != NULL; i++) {
- const TCHAR *featureName = XmlGetAttrValue(feature, L"var");
+ const wchar_t *featureName = XmlGetAttrValue(feature, L"var");
if (!featureName)
continue;
@@ -81,7 +81,7 @@ void CJabberProto::OnIqResultServerDiscoInfo(HXML iqNode, CJabberIqInfo*)
void CJabberProto::OnIqResultNestedRosterGroups(HXML iqNode, CJabberIqInfo *pInfo)
{
- const TCHAR *szGroupDelimeter = NULL;
+ const wchar_t *szGroupDelimeter = NULL;
bool bPrivateStorageSupport = false;
if (iqNode && pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
@@ -102,7 +102,7 @@ void CJabberProto::OnIqResultNestedRosterGroups(HXML iqNode, CJabberIqInfo *pInf
<< XCHILD(L"roster", L"\\") << XATTR(L"xmlns", JABBER_FEAT_NESTED_ROSTER_GROUPS));
// roster request
- TCHAR *szUserData = mir_tstrdup(szGroupDelimeter ? szGroupDelimeter : L"\\");
+ wchar_t *szUserData = mir_tstrdup(szGroupDelimeter ? szGroupDelimeter : L"\\");
m_ThreadInfo->send(
XmlNodeIq( AddIQ(&CJabberProto::OnIqResultGetRoster, JABBER_IQ_TYPE_GET, NULL, 0, -1, (void*)szUserData))
<< XCHILDNS(L"query", JABBER_FEAT_IQ_ROSTER));
@@ -141,11 +141,11 @@ void CJabberProto::OnProcessLoginRq(ThreadData *info, DWORD rq)
for (int j=0; j < ll.getCount(); j++) {
JABBER_LIST_ITEM *item = ll[j];
- TCHAR room[256], text[128];
- _tcsncpy_s(text, item->jid, _TRUNCATE);
- _tcsncpy_s(room, text, _TRUNCATE);
- TCHAR *p = _tcstok(room, L"@");
- TCHAR *server = _tcstok(NULL, L"@");
+ wchar_t room[256], text[128];
+ wcsncpy_s(text, item->jid, _TRUNCATE);
+ wcsncpy_s(room, text, _TRUNCATE);
+ wchar_t *p = wcstok(room, L"@");
+ wchar_t *server = wcstok(NULL, L"@");
if (item->nick && item->nick[0])
GroupchatJoinRoom(server, p, item->nick, item->password, true);
else {
@@ -215,7 +215,7 @@ void CJabberProto::OnIqResultGetAuth(HXML iqNode, CJabberIqInfo*)
debugLogA("<iq/> iqIdGetAuth");
HXML queryNode;
- const TCHAR *type;
+ const wchar_t *type;
if ((type = XmlGetAttrValue(iqNode, L"type")) == NULL) return;
if ((queryNode = XmlGetChild(iqNode, "query")) == NULL) return;
@@ -246,7 +246,7 @@ void CJabberProto::OnIqResultGetAuth(HXML iqNode, CJabberIqInfo*)
else if (!mir_tstrcmp(type, L"error")) {
m_ThreadInfo->send("</stream:stream>");
- TCHAR text[128];
+ wchar_t text[128];
mir_sntprintf(text, TranslateT("Authentication failed for %s."), m_ThreadInfo->conn.username);
MsgPopup(NULL, text, TranslateT("Jabber Authentication"));
JLoginFailed(LOGINERR_WRONGPASSWORD);
@@ -256,7 +256,7 @@ void CJabberProto::OnIqResultGetAuth(HXML iqNode, CJabberIqInfo*)
void CJabberProto::OnIqResultSetAuth(HXML iqNode, CJabberIqInfo*)
{
- const TCHAR *type;
+ const wchar_t *type;
// RECVED: authentication result
// ACTION: if successfully logged in, continue by requesting roster list and set my initial status
@@ -272,7 +272,7 @@ void CJabberProto::OnIqResultSetAuth(HXML iqNode, CJabberIqInfo*)
}
// What to do if password error? etc...
else if (!mir_tstrcmp(type, L"error")) {
- TCHAR text[128];
+ wchar_t text[128];
m_ThreadInfo->send("</stream:stream>");
mir_sntprintf(text, TranslateT("Authentication failed for %s."), m_ThreadInfo->conn.username);
@@ -289,11 +289,11 @@ void CJabberProto::OnIqResultBind(HXML iqNode, CJabberIqInfo *pInfo)
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
LPCTSTR szJid = XPathT(iqNode, "bind[@xmlns='urn:ietf:params:xml:ns:xmpp-bind']/jid");
if (szJid) {
- if (!_tcsncmp(m_ThreadInfo->fullJID, szJid, _countof(m_ThreadInfo->fullJID)))
+ if (!wcsncmp(m_ThreadInfo->fullJID, szJid, _countof(m_ThreadInfo->fullJID)))
debugLog(L"Result Bind: %s confirmed ", m_ThreadInfo->fullJID);
else {
debugLog(L"Result Bind: %s changed to %s", m_ThreadInfo->fullJID, szJid);
- _tcsncpy_s(m_ThreadInfo->fullJID, szJid, _TRUNCATE);
+ wcsncpy_s(m_ThreadInfo->fullJID, szJid, _TRUNCATE);
}
}
if (m_ThreadInfo->bIsSessionAvailable)
@@ -322,8 +322,8 @@ void CJabberProto::GroupchatJoinByHContact(MCONTACT hContact, bool autojoin)
if (roomjid == NULL)
return;
- TCHAR *room = roomjid;
- TCHAR *server = _tcschr(roomjid, '@');
+ wchar_t *room = roomjid;
+ wchar_t *server = wcschr(roomjid, '@');
if (!server)
return;
@@ -345,7 +345,7 @@ void CJabberProto::GroupchatJoinByHContact(MCONTACT hContact, bool autojoin)
void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
{
debugLogA("<iq/> iqIdGetRoster");
- TCHAR *szGroupDelimeter = (TCHAR *)pInfo->GetUserData();
+ wchar_t *szGroupDelimeter = (wchar_t *)pInfo->GetUserData();
if (pInfo->GetIqType() != JABBER_IQ_TYPE_RESULT) {
mir_free(szGroupDelimeter);
return;
@@ -380,7 +380,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
if (mir_tstrcmp(XmlGetName(itemNode), L"item"))
continue;
- const TCHAR *str = XmlGetAttrValue(itemNode, L"subscription");
+ const wchar_t *str = XmlGetAttrValue(itemNode, L"subscription");
JABBER_SUBSCRIPTION sub;
if (str == NULL) sub = SUB_NONE;
@@ -389,14 +389,14 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
else if (!mir_tstrcmp(str, L"from")) sub = SUB_FROM;
else sub = SUB_NONE;
- const TCHAR *jid = XmlGetAttrValue(itemNode, L"jid");
+ const wchar_t *jid = XmlGetAttrValue(itemNode, L"jid");
if (jid == NULL)
continue;
- if (_tcschr(jid, '@') == NULL)
+ if (wcschr(jid, '@') == NULL)
bIsTransport = true;
- const TCHAR *name = XmlGetAttrValue(itemNode, L"name");
- TCHAR *nick = (name != NULL) ? mir_tstrdup(name) : JabberNickFromJID(jid);
+ const wchar_t *name = XmlGetAttrValue(itemNode, L"name");
+ wchar_t *nick = (name != NULL) ? mir_tstrdup(name) : JabberNickFromJID(jid);
if (nick == NULL)
continue;
@@ -414,10 +414,10 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
// check group delimiters:
if (item->group && szGroupDelimeter) {
- while (TCHAR *szPos = _tcsstr(item->group, szGroupDelimeter)) {
+ while (wchar_t *szPos = wcsstr(item->group, szGroupDelimeter)) {
*szPos = 0;
szPos += mir_tstrlen(szGroupDelimeter);
- TCHAR *szNewGroup = (TCHAR *)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(item->group) + mir_tstrlen(szPos) + 2));
+ wchar_t *szNewGroup = (wchar_t *)mir_alloc(sizeof(wchar_t) * (mir_tstrlen(item->group) + mir_tstrlen(szPos) + 2));
mir_tstrcpy(szNewGroup, item->group);
mir_tstrcat(szNewGroup, L"\\");
mir_tstrcat(szNewGroup, szPos);
@@ -443,9 +443,9 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
gcw.iType = GCW_CHATROOM;
gcw.pszModule = m_szModuleName;
gcw.ptszID = jid;
- gcw.ptszName = NEWTSTR_ALLOCA(jid);
+ gcw.ptszName = NEWWSTR_ALLOCA(jid);
- TCHAR *p = (TCHAR*)_tcschr(gcw.ptszName, '@');
+ wchar_t *p = (wchar_t*)wcschr(gcw.ptszName, '@');
if (p)
*p = 0;
@@ -478,7 +478,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
setByte(hContact, "IsTransport", false);
}
- const TCHAR *imagepath = XmlGetAttrValue(itemNode, L"vz:img");
+ const wchar_t *imagepath = XmlGetAttrValue(itemNode, L"vz:img");
if (imagepath)
httpavatars->insert(new JABBER_HTTP_AVATARS(imagepath, hContact));
}
@@ -529,7 +529,7 @@ void CJabberProto::OnIqResultGetRegister(HXML iqNode, CJabberIqInfo*)
debugLogA("<iq/> iqIdGetRegister");
HXML queryNode;
- const TCHAR *type;
+ const wchar_t *type;
if ((type = XmlGetAttrValue(iqNode, L"type")) == NULL) return;
if ((queryNode = XmlGetChild(iqNode, "query")) == NULL) return;
@@ -540,7 +540,7 @@ void CJabberProto::OnIqResultGetRegister(HXML iqNode, CJabberIqInfo*)
else if (!mir_tstrcmp(type, L"error")) {
if (m_hwndAgentRegInput) {
HXML errorNode = XmlGetChild(iqNode, "error");
- TCHAR *str = JabberErrorMsg(errorNode);
+ wchar_t *str = JabberErrorMsg(errorNode);
SendMessage(m_hwndAgentRegInput, WM_JABBER_REGINPUT_ACTIVATE, 0 /*error*/, (LPARAM)str);
mir_free(str);
}
@@ -553,7 +553,7 @@ void CJabberProto::OnIqResultSetRegister(HXML iqNode, CJabberIqInfo*)
// ACTION: notify of successful agent registration
debugLogA("<iq/> iqIdSetRegister");
- const TCHAR *type, *from;
+ const wchar_t *type, *from;
if ((type = XmlGetAttrValue(iqNode, L"type")) == NULL) return;
if ((from = XmlGetAttrValue(iqNode, L"from")) == NULL) return;
@@ -568,7 +568,7 @@ void CJabberProto::OnIqResultSetRegister(HXML iqNode, CJabberIqInfo*)
else if (!mir_tstrcmp(type, L"error")) {
if (m_hwndRegProgress) {
HXML errorNode = XmlGetChild(iqNode, "error");
- TCHAR *str = JabberErrorMsg(errorNode);
+ wchar_t *str = JabberErrorMsg(errorNode);
SendMessage(m_hwndRegProgress, WM_JABBER_REGDLG_UPDATE, 100, (LPARAM)str);
mir_free(str);
}
@@ -594,11 +594,11 @@ void CJabberProto::OnIqResultGetVcardPhoto(HXML n, MCONTACT hContact, bool &hasP
if (buffer == NULL)
return;
- const TCHAR *szPicType = JabberGetPictureType(n, buffer);
+ const wchar_t *szPicType = JabberGetPictureType(n, buffer);
if (szPicType == NULL)
return;
- TCHAR szAvatarFileName[MAX_PATH];
+ wchar_t szAvatarFileName[MAX_PATH];
GetAvatarFileName(hContact, szAvatarFileName, _countof(szAvatarFileName));
debugLog(L"Picture file name set to %s", szAvatarFileName);
@@ -644,19 +644,19 @@ void CJabberProto::OnIqResultGetVcardPhoto(HXML n, MCONTACT hContact, bool &hasP
DeleteFile(szAvatarFileName);
}
-static TCHAR* sttGetText(HXML node, char* tag)
+static wchar_t* sttGetText(HXML node, char* tag)
{
HXML n = XmlGetChild(node, tag);
if (n == NULL)
return NULL;
- return (TCHAR*)XmlGetText(n);
+ return (wchar_t*)XmlGetText(n);
}
void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
{
HXML vCardNode, m, n, o;
- const TCHAR *type, *jid;
+ const wchar_t *type, *jid;
MCONTACT hContact;
DBVARIANT dbv;
@@ -673,11 +673,11 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
psr.flags = PSR_TCHAR;
- psr.nick.t = sttGetText(vCardNode, "NICKNAME");
- psr.firstName.t = sttGetText(vCardNode, "FN");
- psr.lastName.t = L"";
- psr.email.t = sttGetText(vCardNode, "EMAIL");
- psr.id.t = NEWTSTR_ALLOCA(jid);
+ psr.nick.w = sttGetText(vCardNode, "NICKNAME");
+ psr.firstName.w = sttGetText(vCardNode, "FN");
+ psr.lastName.w = L"";
+ psr.email.w = sttGetText(vCardNode, "EMAIL");
+ psr.id.w = NEWWSTR_ALLOCA(jid);
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&psr);
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
@@ -689,7 +689,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
}
size_t len = mir_tstrlen(m_szJabberJID);
- if (!_tcsnicmp(jid, m_szJabberJID, len) && (jid[len] == '/' || jid[len] == '\0')) {
+ if (!wcsnicmp(jid, m_szJabberJID, len) && (jid[len] == '/' || jid[len] == '\0')) {
hContact = NULL;
debugLogA("Vcard for myself");
}
@@ -783,7 +783,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
// Birthday
if (!hasBday && XmlGetText(n) != NULL) {
if (hContact != NULL) {
- if (_stscanf(XmlGetText(n), L"%d-%d-%d", &nYear, &nMonth, &nDay) == 3) {
+ if (swscanf(XmlGetText(n), L"%d-%d-%d", &nYear, &nMonth, &nDay) == 3) {
hasBday = true;
setWord(hContact, "BirthYear", (WORD)nYear);
setByte(hContact, "BirthMonth", (BYTE)nMonth);
@@ -822,7 +822,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
else if (!mir_tstrcmp(XmlGetName(n), L"ADR")) {
if (!hasHome && XmlGetChild(n, "HOME") != NULL) {
// Home address
- TCHAR text[128];
+ wchar_t text[128];
hasHome = true;
if ((m = XmlGetChild(n, "STREET")) != NULL && XmlGetText(m) != NULL) {
hasHomeStreet = true;
@@ -832,7 +832,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
else if ((o = XmlGetChild(n, "EXTADD")) != NULL && XmlGetText(o) != NULL)
mir_sntprintf(text, L"%s\r\n%s", XmlGetText(m), XmlGetText(o));
else
- _tcsncpy_s(text, XmlGetText(m), _TRUNCATE);
+ wcsncpy_s(text, XmlGetText(m), _TRUNCATE);
text[_countof(text) - 1] = '\0';
setTString(hContact, "Street", text);
}
@@ -871,7 +871,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
// Work address
hasWork = true;
if ((m = XmlGetChild(n, "STREET")) != NULL && XmlGetText(m) != NULL) {
- TCHAR text[128];
+ wchar_t text[128];
hasWorkStreet = true;
if (hContact != NULL) {
if ((o = XmlGetChild(n, "EXTADR")) != NULL && XmlGetText(o) != NULL)
@@ -879,7 +879,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
else if ((o = XmlGetChild(n, "EXTADD")) != NULL && XmlGetText(o) != NULL)
mir_sntprintf(text, L"%s\r\n%s", XmlGetText(m), XmlGetText(o));
else
- _tcsncpy_s(text, XmlGetText(m), _TRUNCATE);
+ wcsncpy_s(text, XmlGetText(m), _TRUNCATE);
text[_countof(text) - 1] = '\0';
setTString(hContact, "CompanyStreet", text);
}
@@ -1132,7 +1132,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
}
if (id == m_ThreadInfo->resolveID) {
- const TCHAR *p = _tcschr(jid, '@');
+ const wchar_t *p = wcschr(jid, '@');
ResolveTransportNicks((p != NULL) ? p + 1 : jid);
}
else {
@@ -1152,7 +1152,7 @@ void CJabberProto::OnIqResultSetVcard(HXML iqNode, CJabberIqInfo*)
void CJabberProto::OnIqResultSetSearch(HXML iqNode, CJabberIqInfo*)
{
HXML queryNode, n;
- const TCHAR *type, *jid;
+ const wchar_t *type, *jid;
int id;
debugLogA("<iq/> iqIdGetSearch");
@@ -1172,24 +1172,24 @@ void CJabberProto::OnIqResultSetSearch(HXML iqNode, CJabberIqInfo*)
if (!mir_tstrcmp(XmlGetName(itemNode), L"item")) {
if ((jid = XmlGetAttrValue(itemNode, L"jid")) != NULL) {
- psr.id.t = (TCHAR*)jid;
+ psr.id.w = (wchar_t*)jid;
debugLog(L"Result jid = %s", jid);
if ((n = XmlGetChild(itemNode, "nick")) != NULL && XmlGetText(n) != NULL)
- psr.nick.t = (TCHAR*)XmlGetText(n);
+ psr.nick.w = (wchar_t*)XmlGetText(n);
else
- psr.nick.t = L"";
+ psr.nick.w = L"";
if ((n = XmlGetChild(itemNode, "first")) != NULL && XmlGetText(n) != NULL)
- psr.firstName.t = (TCHAR*)XmlGetText(n);
+ psr.firstName.w = (wchar_t*)XmlGetText(n);
else
- psr.firstName.t = L"";
+ psr.firstName.w = L"";
if ((n = XmlGetChild(itemNode, "last")) != NULL && XmlGetText(n) != NULL)
- psr.lastName.t = (TCHAR*)XmlGetText(n);
+ psr.lastName.w = (wchar_t*)XmlGetText(n);
else
- psr.lastName.t = L"";
+ psr.lastName.w = L"";
if ((n = XmlGetChild(itemNode, "email")) != NULL && XmlGetText(n) != NULL)
- psr.email.t = (TCHAR*)XmlGetText(n);
+ psr.email.w = (wchar_t*)XmlGetText(n);
else
- psr.email.t = L"";
+ psr.email.w = L"";
psr.flags = PSR_TCHAR;
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&psr);
}
@@ -1207,7 +1207,7 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*)
HXML queryNode;
debugLogA("<iq/> iqIdGetExtSearch");
- const TCHAR *type = XmlGetAttrValue(iqNode, L"type");
+ const wchar_t *type = XmlGetAttrValue(iqNode, L"type");
if (type == NULL)
return;
@@ -1237,7 +1237,7 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*)
if (mir_tstrcmp(XmlGetName(fieldNode), L"field"))
continue;
- const TCHAR *fieldName = XmlGetAttrValue(fieldNode, L"var");
+ const wchar_t *fieldName = XmlGetAttrValue(fieldNode, L"var");
if (fieldName == NULL)
continue;
@@ -1246,19 +1246,19 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*)
continue;
if (!mir_tstrcmp(fieldName, L"jid")) {
- psr.id.t = (TCHAR*)XmlGetText(n);
- debugLog(L"Result jid = %s", psr.id.t);
+ psr.id.w = (wchar_t*)XmlGetText(n);
+ debugLog(L"Result jid = %s", psr.id.w);
}
else if (!mir_tstrcmp(fieldName, L"nickname"))
- psr.nick.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : L"";
+ psr.nick.w = (XmlGetText(n) != NULL) ? (wchar_t*)XmlGetText(n) : L"";
else if (!mir_tstrcmp(fieldName, L"fn"))
- psr.firstName.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : L"";
+ psr.firstName.w = (XmlGetText(n) != NULL) ? (wchar_t*)XmlGetText(n) : L"";
else if (!mir_tstrcmp(fieldName, L"given"))
- psr.firstName.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : L"";
+ psr.firstName.w = (XmlGetText(n) != NULL) ? (wchar_t*)XmlGetText(n) : L"";
else if (!mir_tstrcmp(fieldName, L"family"))
- psr.lastName.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : L"";
+ psr.lastName.w = (XmlGetText(n) != NULL) ? (wchar_t*)XmlGetText(n) : L"";
else if (!mir_tstrcmp(fieldName, L"email"))
- psr.email.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : L"";
+ psr.email.w = (XmlGetText(n) != NULL) ? (wchar_t*)XmlGetText(n) : L"";
}
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&psr);
@@ -1274,12 +1274,12 @@ void CJabberProto::OnIqResultSetPassword(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> iqIdSetPassword");
- const TCHAR *type = XmlGetAttrValue(iqNode, L"type");
+ const wchar_t *type = XmlGetAttrValue(iqNode, L"type");
if (type == NULL)
return;
if (!mir_tstrcmp(type, L"result")) {
- _tcsncpy_s(m_ThreadInfo->conn.password, m_ThreadInfo->tszNewPassword, _TRUNCATE);
+ wcsncpy_s(m_ThreadInfo->conn.password, m_ThreadInfo->tszNewPassword, _TRUNCATE);
MessageBox(NULL, TranslateT("Password is successfully changed. Don't forget to update your password in the Jabber protocol option."), TranslateT("Change Password"), MB_OK | MB_ICONINFORMATION | MB_SETFOREGROUND);
}
else if (!mir_tstrcmp(type, L"error"))
@@ -1290,7 +1290,7 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> OnIqResultGetVCardAvatar");
- const TCHAR *from = XmlGetAttrValue(iqNode, L"from");
+ const wchar_t *from = XmlGetAttrValue(iqNode, L"from");
if (from == NULL)
return;
@@ -1298,7 +1298,7 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo*)
if (hContact == NULL)
return;
- const TCHAR *type;
+ const wchar_t *type;
if ((type = XmlGetAttrValue(iqNode, L"type")) == NULL) return;
if (mir_tstrcmp(type, L"result")) return;
@@ -1316,7 +1316,7 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo*)
return;
}
- const TCHAR *mimeType = XmlGetText(XmlGetChild(vCard, "TYPE"));
+ const wchar_t *mimeType = XmlGetText(XmlGetChild(vCard, "TYPE"));
HXML n = XmlGetChild(vCard, "BINVAL");
if (n == NULL)
return;
@@ -1327,11 +1327,11 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo*)
void CJabberProto::OnIqResultGetClientAvatar(HXML iqNode, CJabberIqInfo*)
{
- const TCHAR *type;
+ const wchar_t *type;
debugLogA("<iq/> iqIdResultGetClientAvatar");
- const TCHAR *from = XmlGetAttrValue(iqNode, L"from");
+ const wchar_t *from = XmlGetAttrValue(iqNode, L"from");
if (from == NULL)
return;
MCONTACT hContact = HContactFromJID(from);
@@ -1342,7 +1342,7 @@ void CJabberProto::OnIqResultGetClientAvatar(HXML iqNode, CJabberIqInfo*)
if ((type = XmlGetAttrValue(iqNode, L"type")) != NULL && !mir_tstrcmp(type, L"result")) {
HXML queryNode = XmlGetChild(iqNode, "query");
if (queryNode != NULL) {
- const TCHAR *xmlns = XmlGetAttrValue(queryNode, L"xmlns");
+ const wchar_t *xmlns = XmlGetAttrValue(queryNode, L"xmlns");
if (!mir_tstrcmp(xmlns, JABBER_FEAT_AVATAR))
n = XmlGetChild(queryNode, "data");
}
@@ -1353,9 +1353,9 @@ void CJabberProto::OnIqResultGetClientAvatar(HXML iqNode, CJabberIqInfo*)
return;
}
- TCHAR szJid[JABBER_MAX_JID_LEN];
+ wchar_t szJid[JABBER_MAX_JID_LEN];
mir_tstrncpy(szJid, from, _countof(szJid));
- TCHAR *res = _tcschr(szJid, _T('/'));
+ wchar_t *res = wcschr(szJid, '/');
if (res != NULL)
*res = 0;
@@ -1369,7 +1369,7 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> iqIdResultGetServerAvatar");
- const TCHAR *from = XmlGetAttrValue(iqNode, L"from");
+ const wchar_t *from = XmlGetAttrValue(iqNode, L"from");
if (from == NULL)
return;
@@ -1378,11 +1378,11 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo*)
return;
HXML n = NULL;
- const TCHAR *type = XmlGetAttrValue(iqNode, L"type");
+ const wchar_t *type = XmlGetAttrValue(iqNode, L"type");
if (!mir_tstrcmp(type, L"result")) {
HXML queryNode = XmlGetChild(iqNode, "query");
if (queryNode != NULL) {
- const TCHAR *xmlns = XmlGetAttrValue(queryNode, L"xmlns");
+ const wchar_t *xmlns = XmlGetAttrValue(queryNode, L"xmlns");
if (!mir_tstrcmp(xmlns, JABBER_FEAT_SERVER_AVATAR))
n = XmlGetChild(queryNode, "data");
}
@@ -1393,9 +1393,9 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo*)
return;
}
- TCHAR szJid[JABBER_MAX_JID_LEN];
+ wchar_t szJid[JABBER_MAX_JID_LEN];
mir_tstrncpy(szJid, from, _countof(szJid));
- TCHAR *res = _tcschr(szJid, _T('/'));
+ wchar_t *res = wcschr(szJid, '/');
if (res != NULL)
*res = 0;
@@ -1405,7 +1405,7 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo*)
}
-void CJabberProto::OnIqResultGotAvatar(MCONTACT hContact, HXML n, const TCHAR *mimeType)
+void CJabberProto::OnIqResultGotAvatar(MCONTACT hContact, HXML n, const wchar_t *mimeType)
{
unsigned resultLen;
ptrA body((char*)mir_base64_decode(_T2A(XmlGetText(n)), &resultLen));
@@ -1431,7 +1431,7 @@ LBL_ErrFormat:
ai.format = pictureType;
ai.hContact = hContact;
- TCHAR tszFileName[MAX_PATH];
+ wchar_t tszFileName[MAX_PATH];
if (getByte(hContact, "AvatarType", PA_FORMAT_UNKNOWN) != (unsigned char)pictureType) {
GetAvatarFileName(hContact, tszFileName, _countof(tszFileName));
DeleteFile(tszFileName);
@@ -1446,9 +1446,9 @@ LBL_ErrFormat:
mir_sha1_finish(&sha, digest);
GetAvatarFileName(hContact, tszFileName, _countof(tszFileName));
- _tcsncpy_s(ai.filename, tszFileName, _TRUNCATE);
+ wcsncpy_s(ai.filename, tszFileName, _TRUNCATE);
- FILE *out = _tfopen(tszFileName, L"wb");
+ FILE *out = _wfopen(tszFileName, L"wb");
if (out != NULL) {
fwrite(body, resultLen, 1, out);
fclose(out);
@@ -1469,11 +1469,11 @@ void CJabberProto::OnIqResultDiscoBookmarks(HXML iqNode, CJabberIqInfo*)
// RECVED: list of bookmarks
// ACTION: refresh bookmarks dialog
debugLogA("<iq/> iqIdGetBookmarks");
- const TCHAR *type = XmlGetAttrValue(iqNode, L"type");
+ const wchar_t *type = XmlGetAttrValue(iqNode, L"type");
if (type == NULL)
return;
- const TCHAR *jid;
+ const wchar_t *jid;
if (!mir_tstrcmp(type, L"result")) {
if (m_ThreadInfo && !(m_ThreadInfo->jabberServerCaps & JABBER_CAPS_PRIVATE_STORAGE)) {
m_ThreadInfo->jabberServerCaps |= JABBER_CAPS_PRIVATE_STORAGE;
@@ -1494,7 +1494,7 @@ void CJabberProto::OnIqResultDiscoBookmarks(HXML iqNode, CJabberIqInfo*)
item->nick = mir_tstrdup(XPathT(itemNode, "nick"));
item->password = mir_tstrdup(XPathT(itemNode, "password"));
- const TCHAR *autoJ = XmlGetAttrValue(itemNode, L"autojoin");
+ const wchar_t *autoJ = XmlGetAttrValue(itemNode, L"autojoin");
if (autoJ != NULL)
item->bAutoJoin = !mir_tstrcmp(autoJ, L"true") || !mir_tstrcmp(autoJ, L"1");
}
@@ -1559,7 +1559,7 @@ void CJabberProto::OnIqResultSetBookmarks(HXML iqNode, CJabberIqInfo*)
debugLogA("<iq/> iqIdSetBookmarks");
- const TCHAR *type = XmlGetAttrValue(iqNode, L"type");
+ const wchar_t *type = XmlGetAttrValue(iqNode, L"type");
if (type == NULL)
return;
@@ -1568,7 +1568,7 @@ void CJabberProto::OnIqResultSetBookmarks(HXML iqNode, CJabberIqInfo*)
}
else if (!mir_tstrcmp(type, L"error")) {
HXML errorNode = XmlGetChild(iqNode, "error");
- TCHAR *str = JabberErrorMsg(errorNode);
+ wchar_t *str = JabberErrorMsg(errorNode);
MessageBox(NULL, str, TranslateT("Jabber Bookmarks Error"), MB_OK | MB_SETFOREGROUND);
mir_free(str);
UI_SAFE_NOTIFY(m_pDlgBookmarks, WM_JABBER_ACTIVATE);
@@ -1586,7 +1586,7 @@ void CJabberProto::OnIqResultLastActivity(HXML iqNode, CJabberIqInfo *pInfo)
if (pInfo->m_nIqType == JABBER_IQ_TYPE_RESULT) {
LPCTSTR szSeconds = XPathT(iqNode, "query[@xmlns='jabber:iq:last']/@seconds");
if (szSeconds) {
- int nSeconds = _ttoi(szSeconds);
+ int nSeconds = _wtoi(szSeconds);
if (nSeconds > 0)
lastActivity = time(0) - nSeconds;
}
@@ -1610,9 +1610,9 @@ void CJabberProto::OnIqResultEntityTime(HXML pIqNode, CJabberIqInfo *pInfo)
if (pInfo->m_nIqType == JABBER_IQ_TYPE_RESULT) {
LPCTSTR szTzo = XPathFmt(pIqNode, L"time[@xmlns='%s']/tzo", JABBER_FEAT_ENTITY_TIME);
if (szTzo && szTzo[0]) {
- LPCTSTR szMin = _tcschr(szTzo, ':');
- int nTz = _ttoi(szTzo) * -2;
- nTz += (nTz < 0 ? -1 : 1) * (szMin ? _ttoi(szMin + 1) / 30 : 0);
+ LPCTSTR szMin = wcschr(szTzo, ':');
+ int nTz = _wtoi(szTzo) * -2;
+ nTz += (nTz < 0 ? -1 : 1) * (szMin ? _wtoi(szMin + 1) / 30 : 0);
TIME_ZONE_INFORMATION tzinfo;
if (GetTimeZoneInformation(&tzinfo) == TIME_ZONE_ID_DAYLIGHT)
diff --git a/protocols/JabberG/src/jabber_iqid_muc.cpp b/protocols/JabberG/src/jabber_iqid_muc.cpp
index 576080d884..1795ccbcfb 100644
--- a/protocols/JabberG/src/jabber_iqid_muc.cpp
+++ b/protocols/JabberG/src/jabber_iqid_muc.cpp
@@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void CJabberProto::SetMucConfig(HXML node, void *from)
{
if (m_ThreadInfo && from) {
- XmlNodeIq iq(L"set", SerialNext(), (TCHAR*)from);
+ XmlNodeIq iq(L"set", SerialNext(), (wchar_t*)from);
HXML query = iq << XQUERY(JABBER_FEAT_MUC_OWNER);
XmlAddChild(query, node);
m_ThreadInfo->send(iq);
@@ -68,10 +68,10 @@ void CJabberProto::OnIqResultGetMuc(HXML iqNode, CJabberIqInfo*)
static void sttFillJidList(HWND hwndDlg)
{
- TCHAR *filter = NULL;
+ wchar_t *filter = NULL;
if (GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_FILTER), GWLP_USERDATA)) {
int filterLength = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_FILTER)) + 1;
- filter = (TCHAR *)_alloca(filterLength * sizeof(TCHAR));
+ filter = (wchar_t *)_alloca(filterLength * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_FILTER, filter, filterLength);
}
@@ -95,7 +95,7 @@ static void sttFillJidList(HWND hwndDlg)
ListView_DeleteAllItems(hwndList);
// Populate displayed list from iqNode
- TCHAR tszItemText[JABBER_MAX_JID_LEN + 256];
+ wchar_t tszItemText[JABBER_MAX_JID_LEN + 256];
HXML iqNode = jidListInfo->iqNode;
if (iqNode != NULL) {
LPCTSTR from = XmlGetAttrValue(iqNode, L"from");
@@ -112,7 +112,7 @@ static void sttFillJidList(HWND hwndDlg)
LPCTSTR jid = XmlGetAttrValue(itemNode, L"jid");
if (jid != NULL) {
- lvi.pszText = (TCHAR*)jid;
+ lvi.pszText = (wchar_t*)jid;
if (jidListInfo->type == MUC_BANLIST) {
LPCTSTR reason = XmlGetText(XmlGetChild(itemNode, L"reason"));
if (reason != NULL) {
@@ -180,7 +180,7 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w
{
JABBER_MUC_JIDLIST_INFO *dat = (JABBER_MUC_JIDLIST_INFO*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST);
- TCHAR title[256];
+ wchar_t title[256];
switch (msg) {
case WM_INITDIALOG:
@@ -244,7 +244,7 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w
dat->roomJid = mir_tstrdup(from);
HXML queryNode = XmlGetChild(iqNode, L"query");
if (queryNode != NULL) {
- TCHAR *localFrom = mir_tstrdup(from);
+ wchar_t *localFrom = mir_tstrdup(from);
mir_sntprintf(title, TranslateT("%s, %d items (%s)"),
(dat->type == MUC_VOICELIST) ? TranslateT("Voice List") :
(dat->type == MUC_MEMBERLIST) ? TranslateT("Member List") :
@@ -301,7 +301,7 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w
NMLISTVIEW *nm = (NMLISTVIEW *)lParam;
LVITEM lvi;
LVHITTESTINFO hti;
- TCHAR text[128];
+ wchar_t text[128];
if (nm->iSubItem < 1)
break;
@@ -343,11 +343,11 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w
}
else {
//delete
- TCHAR msgText[128];
+ wchar_t msgText[128];
mir_sntprintf(msgText, TranslateT("Removing %s?"), text);
if (MessageBox(hwndDlg, msgText, dat->type2str(), MB_YESNO | MB_SETFOREGROUND) == IDYES) {
- dat->ppro->DeleteMucListItem(dat, (TCHAR*)lvi.lParam);
+ dat->ppro->DeleteMucListItem(dat, (wchar_t*)lvi.lParam);
mir_free((void *)lvi.lParam);
ListView_DeleteItem(nm->hdr.hwndFrom, hti.iItem);
}
@@ -542,7 +542,7 @@ JABBER_MUC_JIDLIST_INFO::~JABBER_MUC_JIDLIST_INFO()
mir_free(roomJid);
}
-TCHAR* JABBER_MUC_JIDLIST_INFO::type2str() const
+wchar_t* JABBER_MUC_JIDLIST_INFO::type2str() const
{
switch (type) {
case MUC_VOICELIST: return TranslateT("Voice List");
diff --git a/protocols/JabberG/src/jabber_libstr.cpp b/protocols/JabberG/src/jabber_libstr.cpp
index 3b85b3e4c0..24b13f8478 100644
--- a/protocols/JabberG/src/jabber_libstr.cpp
+++ b/protocols/JabberG/src/jabber_libstr.cpp
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-int lstrcmp_null(const TCHAR *s1, const TCHAR *s2)
+int lstrcmp_null(const wchar_t *s1, const wchar_t *s2)
{
if (!s1 && !s2) return 0;
if (!s1) return -1;
diff --git a/protocols/JabberG/src/jabber_list.cpp b/protocols/JabberG/src/jabber_list.cpp
index b12aeef4d4..434bdd1028 100644
--- a/protocols/JabberG/src/jabber_list.cpp
+++ b/protocols/JabberG/src/jabber_list.cpp
@@ -115,7 +115,7 @@ void CJabberProto::ListWipe(void)
/////////////////////////////////////////////////////////////////////////////////////////
// Adding & removing items
-JABBER_LIST_ITEM* CJabberProto::ListAdd(JABBER_LIST list, const TCHAR *jid, MCONTACT hContact)
+JABBER_LIST_ITEM* CJabberProto::ListAdd(JABBER_LIST list, const wchar_t *jid, MCONTACT hContact)
{
bool bUseResource = false;
mir_cslockfull lck(m_csLists);
@@ -127,15 +127,15 @@ JABBER_LIST_ITEM* CJabberProto::ListAdd(JABBER_LIST list, const TCHAR *jid, MCON
return item;
}
- TCHAR *s = mir_tstrdup(jid);
- TCHAR *q = NULL;
+ wchar_t *s = mir_tstrdup(jid);
+ wchar_t *q = NULL;
// strip resource name if any
//fyr
if (!((list == LIST_ROSTER) && ListGetItemPtr(LIST_CHATROOM, jid))) { // but only if it is not chat room contact
if (list != LIST_VCARD_TEMP) {
- TCHAR *p;
- if ((p = _tcschr(s, '@')) != NULL)
- if ((q = _tcschr(p, '/')) != NULL)
+ wchar_t *p;
+ if ((p = wcschr(s, '@')) != NULL)
+ if ((q = wcschr(p, '/')) != NULL)
*q = '\0';
}
}
@@ -163,7 +163,7 @@ JABBER_LIST_ITEM* CJabberProto::ListAdd(JABBER_LIST list, const TCHAR *jid, MCON
return item;
}
-void CJabberProto::ListRemove(JABBER_LIST list, const TCHAR *jid)
+void CJabberProto::ListRemove(JABBER_LIST list, const wchar_t *jid)
{
mir_cslock lck(m_csLists);
JABBER_LIST_ITEM *LI = ListGetItemPtr(list, jid);
@@ -192,14 +192,14 @@ void CJabberProto::ListRemoveByIndex(int index)
/////////////////////////////////////////////////////////////////////////////////////////
// Getting & finding items
-JABBER_LIST_ITEM* CJabberProto::ListGetItemPtr(JABBER_LIST list, const TCHAR *jid)
+JABBER_LIST_ITEM* CJabberProto::ListGetItemPtr(JABBER_LIST list, const wchar_t *jid)
{
if (jid == NULL)
return NULL;
JABBER_LIST_ITEM *tmp = (JABBER_LIST_ITEM*)_alloca(sizeof(JABBER_LIST_ITEM));
tmp->list = list;
- tmp->jid = (TCHAR*)jid;
+ tmp->jid = (wchar_t*)jid;
tmp->bUseResource = false;
mir_cslock lck(m_csLists);
@@ -237,7 +237,7 @@ int CJabberProto::ListFindNext(JABBER_LIST list, int fromOffset)
/////////////////////////////////////////////////////////////////////////////////////////
// Resource related code
-pResourceStatus JABBER_LIST_ITEM::findResource(const TCHAR *resourceName) const
+pResourceStatus JABBER_LIST_ITEM::findResource(const wchar_t *resourceName) const
{
if (arResources.getCount() == 0 || resourceName == NULL || *resourceName == 0)
return NULL;
@@ -251,19 +251,19 @@ pResourceStatus JABBER_LIST_ITEM::findResource(const TCHAR *resourceName) const
return NULL;
}
-pResourceStatus CJabberProto::ListFindResource(JABBER_LIST list, const TCHAR *jid)
+pResourceStatus CJabberProto::ListFindResource(JABBER_LIST list, const wchar_t *jid)
{
mir_cslock lck(m_csLists);
JABBER_LIST_ITEM *LI = ListGetItemPtr(list, jid);
if (LI == NULL)
return NULL;
- const TCHAR *p = _tcschr(jid, '@');
- const TCHAR *q = _tcschr((p == NULL) ? jid : p, '/');
+ const wchar_t *p = wcschr(jid, '@');
+ const wchar_t *q = wcschr((p == NULL) ? jid : p, '/');
return (q == NULL) ? NULL : LI->findResource(q + 1);
}
-bool CJabberProto::ListAddResource(JABBER_LIST list, const TCHAR *jid, int status, const TCHAR *statusMessage, char priority, const TCHAR *nick)
+bool CJabberProto::ListAddResource(JABBER_LIST list, const wchar_t *jid, int status, const wchar_t *statusMessage, char priority, const wchar_t *nick)
{
mir_cslockfull lck(m_csLists);
JABBER_LIST_ITEM *LI = ListGetItemPtr(list, jid);
@@ -272,10 +272,10 @@ bool CJabberProto::ListAddResource(JABBER_LIST list, const TCHAR *jid, int statu
bool bIsNewResource = false;
- const TCHAR *p = _tcschr(jid, '@');
- const TCHAR *q = _tcschr((p == NULL) ? jid : p, '/');
+ const wchar_t *p = wcschr(jid, '@');
+ const wchar_t *q = wcschr((p == NULL) ? jid : p, '/');
if (q) {
- const TCHAR *resource = q + 1;
+ const wchar_t *resource = q + 1;
if (*resource == 0)
return 0;
@@ -312,15 +312,15 @@ bool CJabberProto::ListAddResource(JABBER_LIST list, const TCHAR *jid, int statu
return bIsNewResource;
}
-void CJabberProto::ListRemoveResource(JABBER_LIST list, const TCHAR *jid)
+void CJabberProto::ListRemoveResource(JABBER_LIST list, const wchar_t *jid)
{
mir_cslockfull lck(m_csLists);
JABBER_LIST_ITEM *LI = ListGetItemPtr(list, jid);
if (LI == NULL)
return;
- const TCHAR *p = _tcschr(jid, '@');
- const TCHAR *q = _tcschr((p == NULL) ? jid : p, '/');
+ const wchar_t *p = wcschr(jid, '@');
+ const wchar_t *q = wcschr((p == NULL) ? jid : p, '/');
if (q == NULL)
return;
@@ -382,7 +382,7 @@ JABBER_RESOURCE_STATUS* JABBER_LIST_ITEM::getTemp()
return m_pItemResource;
}
-TCHAR* CJabberProto::ListGetBestClientResourceNamePtr(const TCHAR *jid)
+wchar_t* CJabberProto::ListGetBestClientResourceNamePtr(const wchar_t *jid)
{
mir_cslock lck(m_csLists);
JABBER_LIST_ITEM *LI = ListGetItemPtr(LIST_ROSTER, jid);
@@ -394,7 +394,7 @@ TCHAR* CJabberProto::ListGetBestClientResourceNamePtr(const TCHAR *jid)
return r->m_tszResourceName;
int status = ID_STATUS_OFFLINE;
- TCHAR *res = NULL;
+ wchar_t *res = NULL;
for (int i = 0; i < LI->arResources.getCount(); i++) {
r = LI->arResources[i];
bool foundBetter = false;
diff --git a/protocols/JabberG/src/jabber_list.h b/protocols/JabberG/src/jabber_list.h
index 6537179c50..29f145422c 100644
--- a/protocols/JabberG/src/jabber_list.h
+++ b/protocols/JabberG/src/jabber_list.h
@@ -150,14 +150,14 @@ struct JABBER_LIST_ITEM : public MZeroedObject
~JABBER_LIST_ITEM();
JABBER_LIST list;
- TCHAR* jid;
+ wchar_t* jid;
MCONTACT hContact;
// LIST_ROSTER
// jid = jid of the contact
- TCHAR* nick;
+ wchar_t* nick;
- pResourceStatus findResource(const TCHAR *resourceName) const;
+ pResourceStatus findResource(const wchar_t *resourceName) const;
pResourceStatus getBestResource() const;
JABBER_RESOURCE_MODE resourceMode;
LIST<JABBER_RESOURCE_STATUS> arResources; // array of resources
@@ -168,18 +168,18 @@ struct JABBER_LIST_ITEM : public MZeroedObject
*getTemp(); // allocates m_pItemResource if needed
JABBER_SUBSCRIPTION subscription;
- TCHAR* group;
- TCHAR* photoFileName;
- TCHAR* messageEventIdStr;
+ wchar_t* group;
+ wchar_t* photoFileName;
+ wchar_t* messageEventIdStr;
// LIST_AGENT
// jid = jid of the agent
- TCHAR* name;
- TCHAR* service;
+ wchar_t* name;
+ wchar_t* service;
// LIST_ROOM
// jid = room JID
- TCHAR* type; // room type
+ wchar_t* type; // room type
// LIST_CHATROOM
// jid = room JID
@@ -206,7 +206,7 @@ struct JABBER_LIST_ITEM : public MZeroedObject
//LIST_BOOKMARK
// jid = room JID
- TCHAR* password; // password for room
+ wchar_t* password; // password for room
bool bAutoJoin;
bool bUseResource;
@@ -220,7 +220,7 @@ struct JABBER_HTTP_AVATARS
char * Url;
MCONTACT hContact;
- JABBER_HTTP_AVATARS(const TCHAR *tUrl, MCONTACT thContact)
+ JABBER_HTTP_AVATARS(const wchar_t *tUrl, MCONTACT thContact)
: Url(mir_t2a(tUrl)), hContact(thContact) {}
~JABBER_HTTP_AVATARS() { mir_free(Url); }
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index c82c57eedd..3df1e3989d 100644
--- a/protocols/JabberG/src/jabber_menu.cpp
+++ b/protocols/JabberG/src/jabber_menu.cpp
@@ -309,7 +309,7 @@ void g_MenuInit(void)
char buf[] = "Jabber/DirectPresenceX";
buf[_countof(buf) - 2] = '0' + i;
mi.pszService = buf;
- mi.name.t = pcli->pfnGetStatusModeDescription(PresenceModeArray[i].mode, 0);
+ mi.name.w = pcli->pfnGetStatusModeDescription(PresenceModeArray[i].mode, 0);
mi.position = -1999901000;
mi.hIcolibItem = Skin_LoadIcon(PresenceModeArray[i].icon);
g_hMenuDirectPresence[i + 1] = Menu_AddContactMenuItem(&mi);
@@ -376,7 +376,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
if ((bIsChatRoom == GCW_CHATROOM) || bIsChatRoom == 0) {
if (ptrT(getTStringA(hContact, bIsChatRoom ? (char*)"ChatRoomID" : (char*)"jid")) != NULL) {
Menu_ShowItem(g_hMenuConvert, TRUE);
- Menu_ModifyItem(g_hMenuConvert, bIsChatRoom ? LPGENT("&Convert to Contact") : LPGENT("&Convert to Chat Room"));
+ Menu_ModifyItem(g_hMenuConvert, bIsChatRoom ? LPGENW("&Convert to Contact") : LPGENW("&Convert to Chat Room"));
}
}
@@ -701,10 +701,10 @@ void CJabberProto::MenuInit()
mi.flags = CMIF_UNMOVABLE | CMIF_HIDDEN;
m_hMenuPriorityRoot = Menu_AddProtoMenuItem(&mi);
- TCHAR szName[128];
+ wchar_t szName[128];
char srvFce[MAX_PATH + 64];
mi.pszService = srvFce;
- mi.name.t = szName;
+ mi.name.w = szName;
mi.position = 2000040000;
mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.root = m_hMenuPriorityRoot;
@@ -770,7 +770,7 @@ void CJabberProto::UpdatePriorityMenu(int priority)
if (!m_hMenuPriorityRoot || (m_priorityMenuValSet && priority == m_priorityMenuVal))
return;
- TCHAR szName[128];
+ wchar_t szName[128];
mir_sntprintf(szName, TranslateT("Resource priority [%d]"), (int)priority);
Menu_ModifyItem(m_hMenuPriorityRoot, szName);
@@ -788,7 +788,7 @@ void CJabberProto::GlobalMenuInit()
CMenuItem mi;
mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.position = iChooserMenuPos++;
- mi.name.t = m_tszUserName;
+ mi.name.w = m_tszUserName;
m_hChooseMenuItem = Menu_AddItem(hChooserMenu, &mi, this);
//////////////////////////////////////////////////////////////////////////////////////
@@ -805,19 +805,19 @@ void CJabberProto::GlobalMenuInit()
hkd.dwFlags = HKD_TCHAR;
mir_strcpy(tDest, "/Groupchat");
- hkd.ptszDescription = LPGENT("Join conference");
+ hkd.ptszDescription = LPGENW("Join conference");
Hotkey_Register(&hkd);
mir_strcpy(tDest, "/Bookmarks");
- hkd.ptszDescription = LPGENT("Open bookmarks");
+ hkd.ptszDescription = LPGENW("Open bookmarks");
Hotkey_Register(&hkd);
mir_strcpy(tDest, "/PrivacyLists");
- hkd.ptszDescription = LPGENT("Privacy lists");
+ hkd.ptszDescription = LPGENW("Privacy lists");
Hotkey_Register(&hkd);
mir_strcpy(tDest, "/ServiceDiscovery");
- hkd.ptszDescription = LPGENT("Service discovery");
+ hkd.ptszDescription = LPGENW("Service discovery");
Hotkey_Register(&hkd);
}
@@ -965,7 +965,7 @@ int CJabberProto::OnProcessSrmmEvent(WPARAM, LPARAM lParam)
if (!bSupportTyping || !m_bJabberOnline)
return 0;
- TCHAR jid[JABBER_MAX_JID_LEN];
+ wchar_t jid[JABBER_MAX_JID_LEN];
if (GetClientJID(event->hContact, jid, _countof(jid))) {
pResourceStatus r(ResourceInfoFromJID(jid));
if (r && r->m_bMessageSessionActive) {
@@ -996,7 +996,7 @@ int CJabberProto::OnProcessSrmmIconClick(WPARAM hContact, LPARAM lParam)
return 0;
HMENU hMenu = CreatePopupMenu();
- TCHAR buf[256];
+ wchar_t buf[256];
mir_sntprintf(buf, TranslateT("Last active (%s)"),
LI->m_pLastSeenResource ? LI->m_pLastSeenResource->m_tszResourceName : TranslateT("No activity yet, use server's choice"));
@@ -1072,7 +1072,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleDirectPresence(WPARAM hContact, LPARAM
if (!m_bJabberOnline || !hContact)
return 0;
- TCHAR *jid, text[1024];
+ wchar_t *jid, text[1024];
ptrT tszJid(getTStringA(hContact, "jid"));
if (tszJid == NULL) {
ptrT roomid(getTStringA(hContact, "ChatRoomID"));
diff --git a/protocols/JabberG/src/jabber_message_handlers.cpp b/protocols/JabberG/src/jabber_message_handlers.cpp
index dc7e7f6026..cb17a7fa13 100644
--- a/protocols/JabberG/src/jabber_message_handlers.cpp
+++ b/protocols/JabberG/src/jabber_message_handlers.cpp
@@ -34,14 +34,14 @@ BOOL CJabberProto::OnMessageError(HXML node, ThreadData*, CJabberMessageInfo* pI
if (item == NULL)
item = ListGetItemPtr(LIST_CHATROOM, pInfo->GetFrom());
if (item != NULL) { // yes, it is
- TCHAR *szErrText = JabberErrorMsg(pInfo->GetChildNode());
+ wchar_t *szErrText = JabberErrorMsg(pInfo->GetChildNode());
if (id != -1) {
char *errText = mir_t2a(szErrText);
ProtoBroadcastAck(pInfo->GetHContact(), ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)id, (LPARAM)errText);
mir_free(errText);
}
else {
- TCHAR buf[512];
+ wchar_t buf[512];
HXML bodyNode = XmlGetChild(node, "body");
if (bodyNode)
mir_sntprintf(buf, L"%s:\n%s\n%s", pInfo->GetFrom(), XmlGetText(bodyNode), szErrText);
@@ -58,8 +58,8 @@ BOOL CJabberProto::OnMessageError(HXML node, ThreadData*, CJabberMessageInfo* pI
BOOL CJabberProto::OnMessageIbb(HXML, ThreadData*, CJabberMessageInfo* pInfo)
{
BOOL bOk = FALSE;
- const TCHAR *sid = XmlGetAttrValue(pInfo->GetChildNode(), L"sid");
- const TCHAR *seq = XmlGetAttrValue(pInfo->GetChildNode(), L"seq");
+ const wchar_t *sid = XmlGetAttrValue(pInfo->GetChildNode(), L"sid");
+ const wchar_t *seq = XmlGetAttrValue(pInfo->GetChildNode(), L"seq");
if (sid && seq && XmlGetText(pInfo->GetChildNode()))
bOk = OnIbbRecvdData(XmlGetText(pInfo->GetChildNode()), sid, seq);
@@ -80,8 +80,8 @@ BOOL CJabberProto::OnMessageGroupchat(HXML node, ThreadData*, CJabberMessageInfo
// got message from unknown conference... let's leave it :)
else {
-// TCHAR *conference = NEWTSTR_ALLOCA(from);
-// if (TCHAR *s = _tcschr(conference, _T('/'))) *s = 0;
+// wchar_t *conference = NEWWSTR_ALLOCA(from);
+// if (wchar_t *s = wcschr(conference, '/')) *s = 0;
// XmlNode p("presence"); XmlAddAttr(p, "to", conference); XmlAddAttr(p, "type", "unavailable");
// info->send(p);
}
diff --git a/protocols/JabberG/src/jabber_message_manager.cpp b/protocols/JabberG/src/jabber_message_manager.cpp
index 47a683a23e..c6253582ae 100644
--- a/protocols/JabberG/src/jabber_message_manager.cpp
+++ b/protocols/JabberG/src/jabber_message_manager.cpp
@@ -115,9 +115,9 @@ CJabberMessagePermanentInfo* CJabberMessageManager::AddPermanentHandler(
JABBER_PERMANENT_MESSAGE_HANDLER pHandler,
int nMessageTypes,
DWORD dwParamsToParse,
- const TCHAR *szXmlns,
+ const wchar_t *szXmlns,
BOOL bAllowPartialNs,
- const TCHAR *szTag,
+ const wchar_t *szTag,
void *pUserData,
MESSAGE_USER_DATA_FREE_FUNC pUserDataFree,
int iPriority)
diff --git a/protocols/JabberG/src/jabber_message_manager.h b/protocols/JabberG/src/jabber_message_manager.h
index 17d5e3ded6..48db4c2c83 100644
--- a/protocols/JabberG/src/jabber_message_manager.h
+++ b/protocols/JabberG/src/jabber_message_manager.h
@@ -125,7 +125,7 @@ public:
CJabberMessageManager(CJabberProto *proto);
~CJabberMessageManager();
- CJabberMessagePermanentInfo* AddPermanentHandler(JABBER_PERMANENT_MESSAGE_HANDLER pHandler, int nMessageTypes, DWORD dwParamsToParse, const TCHAR *szXmlns, BOOL bAllowPartialNs, const TCHAR *szTag, void *pUserData = NULL, MESSAGE_USER_DATA_FREE_FUNC pUserDataFree = NULL, int iPriority = JH_PRIORITY_DEFAULT);
+ CJabberMessagePermanentInfo* AddPermanentHandler(JABBER_PERMANENT_MESSAGE_HANDLER pHandler, int nMessageTypes, DWORD dwParamsToParse, const wchar_t *szXmlns, BOOL bAllowPartialNs, const wchar_t *szTag, void *pUserData = NULL, MESSAGE_USER_DATA_FREE_FUNC pUserDataFree = NULL, int iPriority = JH_PRIORITY_DEFAULT);
bool DeletePermanentHandler(CJabberMessagePermanentInfo *pInfo);
bool HandleMessagePermanent(HXML node, ThreadData *pThreadData);
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index de15d1102b..36d7eda517 100644
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
///////////////////////////////////////////////////////////////////////////////
// JabberAddContactToRoster() - adds a contact to the roster
-void CJabberProto::AddContactToRoster(const TCHAR *jid, const TCHAR *nick, const TCHAR *grpName)
+void CJabberProto::AddContactToRoster(const wchar_t *jid, const wchar_t *nick, const wchar_t *grpName)
{
XmlNodeIq iq(L"set", SerialNext());
HXML query = iq << XQUERY(JABBER_FEAT_IQ_ROSTER)
@@ -53,7 +53,7 @@ void JabberChatDllError()
///////////////////////////////////////////////////////////////////////////////
// JabberDBAddAuthRequest()
-void CJabberProto::DBAddAuthRequest(const TCHAR *jid, const TCHAR *nick)
+void CJabberProto::DBAddAuthRequest(const wchar_t *jid, const wchar_t *nick)
{
MCONTACT hContact = DBCreateContact(jid, nick, true, true);
delSetting(hContact, "Hidden");
@@ -85,7 +85,7 @@ void CJabberProto::DBAddAuthRequest(const TCHAR *jid, const TCHAR *nick)
///////////////////////////////////////////////////////////////////////////////
// JabberDBCreateContact()
-MCONTACT CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, bool temporary, bool stripResource)
+MCONTACT CJabberProto::DBCreateContact(const wchar_t *jid, const wchar_t *nick, bool temporary, bool stripResource)
{
if (jid == NULL || jid[0] == '\0')
return NULL;
@@ -95,11 +95,11 @@ MCONTACT CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, bool
return hContact;
// strip resource if present
- TCHAR szJid[JABBER_MAX_JID_LEN];
+ wchar_t szJid[JABBER_MAX_JID_LEN];
if (stripResource)
JabberStripJid(jid, szJid, _countof(szJid));
else
- _tcsncpy_s(szJid, jid, _TRUNCATE);
+ wcsncpy_s(szJid, jid, _TRUNCATE);
MCONTACT hNewContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
Proto_AddToContact(hNewContact, m_szModuleName);
@@ -112,7 +112,7 @@ MCONTACT CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, bool
SendGetVcard(szJid);
if (JABBER_LIST_ITEM *pItem = ListAdd(LIST_ROSTER, jid, hNewContact))
- pItem->bUseResource = _tcschr(szJid, '/') != 0;
+ pItem->bUseResource = wcschr(szJid, '/') != 0;
debugLog(L"Create Jabber contact jid=%s, nick=%s", szJid, nick);
DBCheckIsTransportedContact(szJid, hNewContact);
@@ -154,7 +154,7 @@ BOOL CJabberProto::AddDbPresenceEvent(MCONTACT hContact, BYTE btEventType)
///////////////////////////////////////////////////////////////////////////////
// JabberGetAvatarFileName() - gets a file name for the avatar image
-void CJabberProto::GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen)
+void CJabberProto::GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen)
{
int tPathLen = mir_sntprintf(pszDest, cbLen, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
@@ -164,7 +164,7 @@ void CJabberProto::GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t c
pszDest[tPathLen++] = '\\';
- const TCHAR* szFileType = ProtoGetAvatarExtension(getByte(hContact, "AvatarType", PA_FORMAT_PNG));
+ const wchar_t* szFileType = ProtoGetAvatarExtension(getByte(hContact, "AvatarType", PA_FORMAT_PNG));
if (hContact != NULL) {
char str[256];
@@ -192,7 +192,7 @@ void CJabberProto::GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t c
///////////////////////////////////////////////////////////////////////////////
// JabberResolveTransportNicks - massive vcard update
-void CJabberProto::ResolveTransportNicks(const TCHAR *jid)
+void CJabberProto::ResolveTransportNicks(const wchar_t *jid)
{
// Set all contacts to offline
MCONTACT hContact = m_ThreadInfo->resolveContact;
@@ -206,7 +206,7 @@ void CJabberProto::ResolveTransportNicks(const TCHAR *jid)
ptrT dbJid(getTStringA(hContact, "jid")); if (dbJid == NULL) continue;
ptrT dbNick(getTStringA(hContact, "Nick")); if (dbNick == NULL) continue;
- TCHAR *p = _tcschr(dbJid, '@');
+ wchar_t *p = wcschr(dbJid, '@');
if (p == NULL)
continue;
@@ -264,9 +264,9 @@ void CJabberProto::SetServerStatus(int iNewStatus)
// Process a string, and double all % characters, according to chat.dll's restrictions
// Returns a pointer to the new string (old one is not freed)
-TCHAR* UnEscapeChatTags(TCHAR* str_in)
+wchar_t* UnEscapeChatTags(wchar_t* str_in)
{
- TCHAR *s = str_in, *d = str_in;
+ wchar_t *s = str_in, *d = str_in;
while (*s) {
if (*s == '%' && s[1] == '%')
s++;
@@ -281,8 +281,8 @@ TCHAR* UnEscapeChatTags(TCHAR* str_in)
struct
{
- TCHAR *node;
- TCHAR *name;
+ wchar_t *node;
+ wchar_t *name;
}
static sttCapsNodeToName_Map[] =
{
@@ -321,7 +321,7 @@ void CJabberProto::FormatMirVer(pResourceStatus &resource, CMString &res)
// jabber:iq:version info requested and exists?
if (resource->m_dwVersionRequestTime && resource->m_tszSoftware) {
debugLog(L"JabberUpdateMirVer: for iq:version rc %s: %s", resource->m_tszResourceName, resource->m_tszSoftware);
- if (!resource->m_tszSoftwareVersion || _tcsstr(resource->m_tszSoftware, resource->m_tszSoftwareVersion))
+ if (!resource->m_tszSoftwareVersion || wcsstr(resource->m_tszSoftware, resource->m_tszSoftwareVersion))
res = resource->m_tszSoftware;
else
res.Format(L"%s %s", resource->m_tszSoftware, resource->m_tszSoftwareVersion);
@@ -340,7 +340,7 @@ void CJabberProto::FormatMirVer(pResourceStatus &resource, CMString &res)
// search through known software list
for (i = 0; i < _countof(sttCapsNodeToName_Map); i++)
- if (_tcsstr(resource->m_tszCapsNode, sttCapsNodeToName_Map[i].node)) {
+ if (wcsstr(resource->m_tszCapsNode, sttCapsNodeToName_Map[i].node)) {
res.Format(L"%s %s", sttCapsNodeToName_Map[i].name, resource->m_tszCapsVer);
break;
}
@@ -351,23 +351,23 @@ void CJabberProto::FormatMirVer(pResourceStatus &resource, CMString &res)
}
// attach additional info for fingerprint plguin
- if (resource->m_tszCapsExt && _tcsstr(resource->m_tszCapsExt, JABBER_EXT_PLATFORMX86) && !_tcsstr(res, L"x86"))
+ if (resource->m_tszCapsExt && wcsstr(resource->m_tszCapsExt, JABBER_EXT_PLATFORMX86) && !wcsstr(res, L"x86"))
res.Append(L" x86");
- if (resource->m_tszCapsExt && _tcsstr(resource->m_tszCapsExt, JABBER_EXT_PLATFORMX64) && !_tcsstr(res, L"x64"))
+ if (resource->m_tszCapsExt && wcsstr(resource->m_tszCapsExt, JABBER_EXT_PLATFORMX64) && !wcsstr(res, L"x64"))
res.Append(L" x64");
- if (resource->m_tszCapsExt && _tcsstr(resource->m_tszCapsExt, JABBER_EXT_SECUREIM) && !_tcsstr(res, L"(SecureIM)"))
+ if (resource->m_tszCapsExt && wcsstr(resource->m_tszCapsExt, JABBER_EXT_SECUREIM) && !wcsstr(res, L"(SecureIM)"))
res.Append(L" (SecureIM)");
- if (resource->m_tszCapsExt && _tcsstr(resource->m_tszCapsExt, JABBER_EXT_MIROTR) && !_tcsstr(res, L"(MirOTR)"))
+ if (resource->m_tszCapsExt && wcsstr(resource->m_tszCapsExt, JABBER_EXT_MIROTR) && !wcsstr(res, L"(MirOTR)"))
res.Append(L" (MirOTR)");
- if (resource->m_tszCapsExt && _tcsstr(resource->m_tszCapsExt, JABBER_EXT_NEWGPG) && !_tcsstr(res, L"(New_GPG)"))
+ if (resource->m_tszCapsExt && wcsstr(resource->m_tszCapsExt, JABBER_EXT_NEWGPG) && !wcsstr(res, L"(New_GPG)"))
res.Append(L" (New_GPG)");
- if (resource->m_tszResourceName && !_tcsstr(res, resource->m_tszResourceName))
- if (_tcsstr(res, L"Miranda IM") || _tcsstr(res, L"Miranda NG") || m_options.ShowForeignResourceInMirVer)
+ if (resource->m_tszResourceName && !wcsstr(res, resource->m_tszResourceName))
+ if (wcsstr(res, L"Miranda IM") || wcsstr(res, L"Miranda NG") || m_options.ShowForeignResourceInMirVer)
res.AppendFormat(L" [%s]", resource->m_tszResourceName);
}
@@ -383,8 +383,8 @@ void CJabberProto::UpdateMirVer(MCONTACT hContact, pResourceStatus &resource)
if (jid == NULL)
return;
- TCHAR szFullJid[JABBER_MAX_JID_LEN];
- if (resource->m_tszResourceName && !_tcschr(jid, '/'))
+ wchar_t szFullJid[JABBER_MAX_JID_LEN];
+ if (resource->m_tszResourceName && !wcschr(jid, '/'))
mir_sntprintf(szFullJid, L"%s/%s", jid, resource->m_tszResourceName);
else
mir_tstrncpy(szFullJid, jid, _countof(szFullJid));
@@ -437,7 +437,7 @@ void CJabberProto::SetContactOfflineStatus(MCONTACT hContact)
void CJabberProto::InitPopups(void)
{
- TCHAR desc[256];
+ wchar_t desc[256];
mir_sntprintf(desc, L"%s %s", m_tszUserName, TranslateT("Errors"));
char name[256];
@@ -456,14 +456,14 @@ void CJabberProto::InitPopups(void)
IcoLib_ReleaseIcon(ppc.hIcon);
}
-void CJabberProto::MsgPopup(MCONTACT hContact, const TCHAR *szMsg, const TCHAR *szTitle)
+void CJabberProto::MsgPopup(MCONTACT hContact, const wchar_t *szMsg, const wchar_t *szTitle)
{
if (ServiceExists(MS_POPUP_ADDPOPUPCLASS)) {
char name[256];
POPUPDATACLASS ppd = { sizeof(ppd) };
- ppd.ptszTitle = szTitle;
- ppd.ptszText = szMsg;
+ ppd.pwszTitle = szTitle;
+ ppd.pwszText = szMsg;
ppd.pszClassName = name;
ppd.hContact = hContact;
mir_snprintf(name, "%s_%s", m_szModuleName, "Error");
@@ -499,11 +499,11 @@ CMString CJabberProto::ExtractImage(HXML node)
image.Replace(L"%2F", L"/");
image.Replace(L"%3D", L"=");
- TCHAR tszTempPath[MAX_PATH], tszTempFile[MAX_PATH];
+ wchar_t tszTempPath[MAX_PATH], tszTempFile[MAX_PATH];
GetTempPath(_countof(tszTempPath), tszTempPath);
GetTempFileName(tszTempPath, L"jab", InterlockedIncrement(&g_nTempFileId), tszTempFile);
- _tcsncat_s(tszTempFile, L".", 1);
- _tcsncat_s(tszTempFile, ext, ext.GetLength());
+ wcsncat_s(tszTempFile, L".", 1);
+ wcsncat_s(tszTempFile, ext, ext.GetLength());
HANDLE h = CreateFile(tszTempFile, GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_ALWAYS,
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp
index aa46e14e58..3c2aa50911 100644
--- a/protocols/JabberG/src/jabber_notes.cpp
+++ b/protocols/JabberG/src/jabber_notes.cpp
@@ -31,15 +31,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "jabber_privacy.h"
#include "jabber_notes.h"
-static TCHAR* StrTrimCopy(TCHAR *str)
+static wchar_t* StrTrimCopy(wchar_t *str)
{
if (!str) return 0;
- while (*str && _istspace(*str)) ++str;
+ while (*str && iswspace(*str)) ++str;
if (!*str) return mir_tstrdup(str);
- TCHAR *res = mir_tstrdup(str);
- for (TCHAR *p = res + mir_tstrlen(res) - 1; p >= res; --p) {
- if (_istspace(*p))
+ wchar_t *res = mir_tstrdup(str);
+ for (wchar_t *p = res + mir_tstrlen(res) - 1; p >= res; --p) {
+ if (iswspace(*p))
*p = 0;
else
break;
@@ -53,7 +53,7 @@ CNoteItem::CNoteItem()
m_szTitle = m_szFrom = m_szText = m_szTags = m_szTagsStr = NULL;
}
-CNoteItem::CNoteItem(HXML hXml, TCHAR *szFrom)
+CNoteItem::CNoteItem(HXML hXml, wchar_t *szFrom)
{
m_szTitle = m_szFrom = m_szText = m_szTags = m_szTagsStr = NULL;
SetData(
@@ -72,7 +72,7 @@ CNoteItem::~CNoteItem()
mir_free(m_szTagsStr);
}
-void CNoteItem::SetData(TCHAR *title, TCHAR *from, TCHAR *text, TCHAR *tags)
+void CNoteItem::SetData(wchar_t *title, wchar_t *from, wchar_t *text, wchar_t *tags)
{
mir_free(m_szTitle);
mir_free(m_szFrom);
@@ -84,15 +84,15 @@ void CNoteItem::SetData(TCHAR *title, TCHAR *from, TCHAR *text, TCHAR *tags)
m_szText = JabberStrFixLines(text);
m_szFrom = StrTrimCopy(from);
- const TCHAR *szTags = tags;
- TCHAR *p = m_szTags = (TCHAR *)mir_alloc((mir_tstrlen(szTags) + 2 /*for double zero*/) * sizeof(TCHAR));
- TCHAR *q = m_szTagsStr = (TCHAR *)mir_alloc((mir_tstrlen(szTags) + 1) * sizeof(TCHAR));
+ const wchar_t *szTags = tags;
+ wchar_t *p = m_szTags = (wchar_t *)mir_alloc((mir_tstrlen(szTags) + 2 /*for double zero*/) * sizeof(wchar_t));
+ wchar_t *q = m_szTagsStr = (wchar_t *)mir_alloc((mir_tstrlen(szTags) + 1) * sizeof(wchar_t));
for (; szTags && *szTags; ++szTags) {
- if (_istspace(*szTags))
+ if (iswspace(*szTags))
continue;
- if (*szTags == _T(',')) {
- *q++ = _T(',');
+ if (*szTags == ',') {
+ *q++ = ',';
*p++ = 0;
continue;
}
@@ -103,12 +103,12 @@ void CNoteItem::SetData(TCHAR *title, TCHAR *from, TCHAR *text, TCHAR *tags)
q[0] = p[0] = p[1] = 0;
}
-bool CNoteItem::HasTag(const TCHAR *szTag)
+bool CNoteItem::HasTag(const wchar_t *szTag)
{
if (!szTag || !*szTag)
return true;
- for (TCHAR *p = m_szTags; p && *p; p = p + mir_tstrlen(p) + 1)
+ for (wchar_t *p = m_szTags; p && *p; p = p + mir_tstrlen(p) + 1)
if (!mir_tstrcmp(p, szTag))
return true;
@@ -126,7 +126,7 @@ int CNoteItem::cmp(const CNoteItem *p1, const CNoteItem *p2)
return 0;
}
-void CNoteList::AddNote(HXML hXml, TCHAR *szFrom)
+void CNoteList::AddNote(HXML hXml, wchar_t *szFrom)
{
m_bIsModified = true;
insert(new CNoteItem(hXml, szFrom));
@@ -187,10 +187,10 @@ private:
void btnOk_OnClick(CCtrlButton *)
{
- TCHAR *szTitle = m_txtTitle.GetText();
- TCHAR *szText = m_txtText.GetText();
- TCHAR *szTags = m_txtTags.GetText();
- TCHAR *szFrom = mir_tstrdup(m_pNote->GetFrom());
+ wchar_t *szTitle = m_txtTitle.GetText();
+ wchar_t *szText = m_txtText.GetText();
+ wchar_t *szTags = m_txtTags.GetText();
+ wchar_t *szFrom = mir_tstrdup(m_pNote->GetFrom());
m_pNote->SetData(szTitle, szFrom, szText, szTags);
mir_free(szTitle);
mir_free(szText);
@@ -297,7 +297,7 @@ public:
m_hfntBold = hfntBold;
}
- int AddString(TCHAR *text, LPARAM data = 0)
+ int AddString(wchar_t *text, LPARAM data = 0)
{
m_adding = true;
int idx = CCtrlListBox::AddString(text, data);
@@ -374,7 +374,7 @@ public:
rc.top += DrawText(hdc, pNote->GetTitle(), -1, &rc, DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
SelectObject(hdc, m_hfntNormal);
if (pNote->GetFrom()) {
- TCHAR buf[256];
+ wchar_t buf[256];
mir_sntprintf(buf, TranslateT("From: %s"), pNote->GetFrom());
rc.top += DrawText(hdc, buf, -1, &rc, DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
@@ -409,7 +409,7 @@ public:
lps->itemHeight += rcTmp.bottom;
SelectObject(hdc, m_hfntNormal);
if (pNote->GetFrom()) {
- TCHAR buf[256];
+ wchar_t buf[256];
mir_sntprintf(buf, TranslateT("From: %s"), pNote->GetFrom());
rcTmp = rc;
DrawText(hdc, buf, -1, &rcTmp, DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS | DT_CALCRECT);
@@ -466,24 +466,24 @@ private:
m_btnRemove.Enable(m_lstNotes.GetCurSel() != LB_ERR);
}
- void InsertTag(HTREEITEM htiRoot, const TCHAR *tag, bool bSelect)
+ void InsertTag(HTREEITEM htiRoot, const wchar_t *tag, bool bSelect)
{
TVINSERTSTRUCT tvi = { 0 };
tvi.hParent = htiRoot;
tvi.hInsertAfter = TVI_LAST;
tvi.itemex.mask = TVIF_TEXT | TVIF_PARAM;
- tvi.itemex.pszText = (TCHAR *)tag;
+ tvi.itemex.pszText = (wchar_t *)tag;
tvi.itemex.lParam = (LPARAM)mir_tstrdup(tag);
HTREEITEM hti = m_tvFilter.InsertItem(&tvi);
if (bSelect) m_tvFilter.SelectItem(hti);
}
- void PopulateTags(HTREEITEM htiRoot, TCHAR *szActiveTag)
+ void PopulateTags(HTREEITEM htiRoot, wchar_t *szActiveTag)
{
- LIST<TCHAR> tagSet(5, _tcscmp);
+ LIST<wchar_t> tagSet(5, _tcscmp);
for (int i = 0; i < m_proto->m_notes.getCount(); i++) {
- TCHAR *tags = m_proto->m_notes[i].GetTags();
- for (TCHAR *tag = tags; tag && *tag; tag = tag + mir_tstrlen(tag) + 1)
+ wchar_t *tags = m_proto->m_notes[i].GetTags();
+ for (wchar_t *tag = tags; tag && *tag; tag = tag + mir_tstrlen(tag) + 1)
if (!tagSet.find(tag))
tagSet.insert(tag);
}
@@ -505,7 +505,7 @@ private:
tvi.mask = TVIF_HANDLE | TVIF_PARAM;
tvi.hItem = m_tvFilter.GetSelection();
m_tvFilter.GetItem(&tvi);
- TCHAR *szActiveTag = mir_tstrdup((TCHAR *)tvi.lParam);
+ wchar_t *szActiveTag = mir_tstrdup((wchar_t *)tvi.lParam);
m_tvFilter.DeleteAllItems();
@@ -521,11 +521,11 @@ private:
void InsertItem(CNoteItem &item)
{
- m_lstNotes.AddString((TCHAR *)item.GetTitle(), (LPARAM)&item);
+ m_lstNotes.AddString((wchar_t *)item.GetTitle(), (LPARAM)&item);
EnableControls();
}
- void ListItems(const TCHAR *tag)
+ void ListItems(const wchar_t *tag)
{
m_lstNotes.ResetContent();
for (int i = 0; i < m_proto->m_notes.getCount(); i++)
@@ -587,14 +587,14 @@ private:
void tvFilter_OnDeleteItem(CCtrlTreeView::TEventInfo *e)
{
- TCHAR *szText = (TCHAR *)e->nmtv->itemOld.lParam;
+ wchar_t *szText = (wchar_t *)e->nmtv->itemOld.lParam;
mir_free(szText);
EnableControls();
}
void tvFilter_OnSelChanged(CCtrlTreeView::TEventInfo *e)
{
- TCHAR *szText = (TCHAR *)e->nmtv->itemNew.lParam;
+ wchar_t *szText = (wchar_t *)e->nmtv->itemNew.lParam;
ListItems(szText);
EnableControls();
}
@@ -726,7 +726,7 @@ void CJabberProto::ProcessOutgoingNote(CNoteItem *pNote, bool ok)
return;
}
- TCHAR buf[1024];
+ wchar_t buf[1024];
mir_sntprintf(buf, L"Incoming note: %s\n\n%s\nTags: %s",
pNote->GetTitle(), pNote->GetText(), pNote->GetTagsStr());
@@ -759,13 +759,13 @@ void CJabberProto::ProcessOutgoingNote(CNoteItem *pNote, bool ok)
delete pNote;
}
-bool CJabberProto::OnIncomingNote(const TCHAR *szFrom, HXML hXml)
+bool CJabberProto::OnIncomingNote(const wchar_t *szFrom, HXML hXml)
{
if (!m_options.AcceptNotes)
return false;
if (!szFrom || !hXml) return true;
- CNoteItem *pItem = new CNoteItem(hXml, (TCHAR *)szFrom);
+ CNoteItem *pItem = new CNoteItem(hXml, (wchar_t *)szFrom);
if (!pItem->IsNotEmpty()) {
delete pItem;
return true;
diff --git a/protocols/JabberG/src/jabber_notes.h b/protocols/JabberG/src/jabber_notes.h
index f8541d4aef..8c55e7ad0b 100644
--- a/protocols/JabberG/src/jabber_notes.h
+++ b/protocols/JabberG/src/jabber_notes.h
@@ -30,26 +30,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
class CNoteItem
{
private:
- TCHAR *m_szTitle;
- TCHAR *m_szFrom;
- TCHAR *m_szText;
- TCHAR *m_szTags;
- TCHAR *m_szTagsStr;
+ wchar_t *m_szTitle;
+ wchar_t *m_szFrom;
+ wchar_t *m_szText;
+ wchar_t *m_szTags;
+ wchar_t *m_szTagsStr;
public:
CNoteItem();
- CNoteItem(HXML hXml, TCHAR *szFrom = 0);
+ CNoteItem(HXML hXml, wchar_t *szFrom = 0);
~CNoteItem();
- void SetData(TCHAR *title, TCHAR *from, TCHAR *text, TCHAR *tags);
+ void SetData(wchar_t *title, wchar_t *from, wchar_t *text, wchar_t *tags);
- TCHAR *GetTitle() const { return m_szTitle; }
- TCHAR *GetFrom() const { return m_szFrom; }
- TCHAR *GetText() const { return m_szText; }
- TCHAR *GetTags() const { return m_szTags; }
- TCHAR *GetTagsStr() const { return m_szTagsStr; }
+ wchar_t *GetTitle() const { return m_szTitle; }
+ wchar_t *GetFrom() const { return m_szFrom; }
+ wchar_t *GetText() const { return m_szText; }
+ wchar_t *GetTags() const { return m_szTags; }
+ wchar_t *GetTagsStr() const { return m_szTagsStr; }
- bool HasTag(const TCHAR *szTag);
+ bool HasTag(const wchar_t *szTag);
bool IsNotEmpty()
{
@@ -76,7 +76,7 @@ public:
OBJLIST<CNoteItem>::remove(p);
}
- void AddNote(HXML hXml, TCHAR *szFrom = 0);
+ void AddNote(HXML hXml, wchar_t *szFrom = 0);
void LoadXml(HXML hXml);
void SaveXml(HXML hXmlParent);
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp
index 9c165d1ce8..828b0a9648 100644
--- a/protocols/JabberG/src/jabber_opt.cpp
+++ b/protocols/JabberG/src/jabber_opt.cpp
@@ -35,192 +35,192 @@ static BOOL(WINAPI *pfnEnableThemeDialogTexture)(HANDLE, DWORD) = 0;
#define STR_FORMAT L"%s %s@%S:%d?"
-struct { TCHAR *szCode; TCHAR *szDescription; } g_LanguageCodes[] = {
- { L"aa", LPGENT("Afar") },
- { L"ab", LPGENT("Abkhazian") },
- { L"af", LPGENT("Afrikaans") },
- { L"ak", LPGENT("Akan") },
- { L"sq", LPGENT("Albanian") },
- { L"am", LPGENT("Amharic") },
- { L"ar", LPGENT("Arabic") },
- { L"an", LPGENT("Aragonese") },
- { L"hy", LPGENT("Armenian") },
- { L"as", LPGENT("Assamese") },
- { L"av", LPGENT("Avaric") },
- { L"ae", LPGENT("Avestan") },
- { L"ay", LPGENT("Aymara") },
- { L"az", LPGENT("Azerbaijani") },
- { L"ba", LPGENT("Bashkir") },
- { L"bm", LPGENT("Bambara") },
- { L"eu", LPGENT("Basque") },
- { L"be", LPGENT("Belarusian") },
- { L"bn", LPGENT("Bengali") },
- { L"bh", LPGENT("Bihari") },
- { L"bi", LPGENT("Bislama") },
- { L"bs", LPGENT("Bosnian") },
- { L"br", LPGENT("Breton") },
- { L"bg", LPGENT("Bulgarian") },
- { L"my", LPGENT("Burmese") },
- { L"ca", LPGENT("Catalan; Valencian") },
- { L"ch", LPGENT("Chamorro") },
- { L"ce", LPGENT("Chechen") },
- { L"zh", LPGENT("Chinese") },
- { L"cu", LPGENT("Church Slavic; Old Slavonic") },
- { L"cv", LPGENT("Chuvash") },
- { L"kw", LPGENT("Cornish") },
- { L"co", LPGENT("Corsican") },
- { L"cr", LPGENT("Cree") },
- { L"cs", LPGENT("Czech") },
- { L"da", LPGENT("Danish") },
- { L"dv", LPGENT("Divehi; Dhivehi; Maldivian") },
- { L"nl", LPGENT("Dutch; Flemish") },
- { L"dz", LPGENT("Dzongkha") },
- { L"en", LPGENT("English") },
- { L"eo", LPGENT("Esperanto") },
- { L"et", LPGENT("Estonian") },
- { L"ee", LPGENT("Ewe") },
- { L"fo", LPGENT("Faroese") },
- { L"fj", LPGENT("Fijian") },
- { L"fi", LPGENT("Finnish") },
- { L"fr", LPGENT("French") },
- { L"fy", LPGENT("Western Frisian") },
- { L"ff", LPGENT("Fulah") },
- { L"ka", LPGENT("Georgian") },
- { L"de", LPGENT("German") },
- { L"gd", LPGENT("Gaelic; Scottish Gaelic") },
- { L"ga", LPGENT("Irish") },
- { L"gl", LPGENT("Galician") },
- { L"gv", LPGENT("Manx") },
- { L"el", LPGENT("Greek, Modern (1453-)") },
- { L"gn", LPGENT("Guarani") },
- { L"gu", LPGENT("Gujarati") },
- { L"ht", LPGENT("Haitian; Haitian Creole") },
- { L"ha", LPGENT("Hausa") },
- { L"he", LPGENT("Hebrew") },
- { L"hz", LPGENT("Herero") },
- { L"hi", LPGENT("Hindi") },
- { L"ho", LPGENT("Hiri Motu") },
- { L"hu", LPGENT("Hungarian") },
- { L"ig", LPGENT("Igbo") },
- { L"is", LPGENT("Icelandic") },
- { L"io", LPGENT("Ido") },
- { L"ii", LPGENT("Sichuan Yi") },
- { L"iu", LPGENT("Inuktitut") },
- { L"ie", LPGENT("Interlingue") },
- { L"ia", LPGENT("Interlingua (International Auxiliary Language Association)") },
- { L"id", LPGENT("Indonesian") },
- { L"ik", LPGENT("Inupiaq") },
- { L"it", LPGENT("Italian") },
- { L"jv", LPGENT("Javanese") },
- { L"ja", LPGENT("Japanese") },
- { L"kl", LPGENT("Kalaallisut; Greenlandic") },
- { L"kn", LPGENT("Kannada") },
- { L"ks", LPGENT("Kashmiri") },
- { L"kr", LPGENT("Kanuri") },
- { L"kk", LPGENT("Kazakh") },
- { L"km", LPGENT("Central Khmer") },
- { L"ki", LPGENT("Kikuyu; Gikuyu") },
- { L"rw", LPGENT("Kinyarwanda") },
- { L"ky", LPGENT("Kirghiz; Kyrgyz") },
- { L"kv", LPGENT("Komi") },
- { L"kg", LPGENT("Kongo") },
- { L"ko", LPGENT("Korean") },
- { L"kj", LPGENT("Kuanyama; Kwanyama") },
- { L"ku", LPGENT("Kurdish") },
- { L"lo", LPGENT("Lao") },
- { L"la", LPGENT("Latin") },
- { L"lv", LPGENT("Latvian") },
- { L"li", LPGENT("Limburgan; Limburger; Limburgish") },
- { L"ln", LPGENT("Lingala") },
- { L"lt", LPGENT("Lithuanian") },
- { L"lb", LPGENT("Luxembourgish; Letzeburgesch") },
- { L"lu", LPGENT("Luba-Katanga") },
- { L"lg", LPGENT("Ganda") },
- { L"mk", LPGENT("Macedonian") },
- { L"mh", LPGENT("Marshallese") },
- { L"ml", LPGENT("Malayalam") },
- { L"mi", LPGENT("Maori") },
- { L"mr", LPGENT("Marathi") },
- { L"ms", LPGENT("Malay") },
- { L"mg", LPGENT("Malagasy") },
- { L"mt", LPGENT("Maltese") },
- { L"mo", LPGENT("Moldavian") },
- { L"mn", LPGENT("Mongolian") },
- { L"na", LPGENT("Nauru") },
- { L"nv", LPGENT("Navajo; Navaho") },
- { L"nr", LPGENT("Ndebele, South; South Ndebele") },
- { L"nd", LPGENT("Ndebele, North; North Ndebele") },
- { L"ng", LPGENT("Ndonga") },
- { L"ne", LPGENT("Nepali") },
- { L"nn", LPGENT("Norwegian Nynorsk; Nynorsk, Norwegian") },
- { L"nb", LPGENT("Bokmaal, Norwegian; Norwegian Bokmaal") },
- { L"no", LPGENT("Norwegian") },
- { L"ny", LPGENT("Chichewa; Chewa; Nyanja") },
- { L"oc", LPGENT("Occitan (post 1500); Provencal") },
- { L"oj", LPGENT("Ojibwa") },
- { L"or", LPGENT("Oriya") },
- { L"om", LPGENT("Oromo") },
- { L"os", LPGENT("Ossetian; Ossetic") },
- { L"pa", LPGENT("Panjabi; Punjabi") },
- { L"fa", LPGENT("Persian") },
- { L"pi", LPGENT("Pali") },
- { L"pl", LPGENT("Polish") },
- { L"pt", LPGENT("Portuguese") },
- { L"ps", LPGENT("Pushto") },
- { L"qu", LPGENT("Quechua") },
- { L"rm", LPGENT("Romansh") },
- { L"ro", LPGENT("Romanian") },
- { L"rn", LPGENT("Rundi") },
- { L"ru", LPGENT("Russian") },
- { L"sg", LPGENT("Sango") },
- { L"sa", LPGENT("Sanskrit") },
- { L"sr", LPGENT("Serbian") },
- { L"hr", LPGENT("Croatian") },
- { L"si", LPGENT("Sinhala; Sinhalese") },
- { L"sk", LPGENT("Slovak") },
- { L"sl", LPGENT("Slovenian") },
- { L"se", LPGENT("Northern Sami") },
- { L"sm", LPGENT("Samoan") },
- { L"sn", LPGENT("Shona") },
- { L"sd", LPGENT("Sindhi") },
- { L"so", LPGENT("Somali") },
- { L"st", LPGENT("Sotho, Southern") },
- { L"es", LPGENT("Spanish; Castilian") },
- { L"sc", LPGENT("Sardinian") },
- { L"ss", LPGENT("Swati") },
- { L"su", LPGENT("Sundanese") },
- { L"sw", LPGENT("Swahili") },
- { L"sv", LPGENT("Swedish") },
- { L"ty", LPGENT("Tahitian") },
- { L"ta", LPGENT("Tamil") },
- { L"tt", LPGENT("Tatar") },
- { L"te", LPGENT("Telugu") },
- { L"tg", LPGENT("Tajik") },
- { L"tl", LPGENT("Tagalog") },
- { L"th", LPGENT("Thai") },
- { L"bo", LPGENT("Tibetan") },
- { L"ti", LPGENT("Tigrinya") },
- { L"to", LPGENT("Tonga (Tonga Islands)") },
- { L"tn", LPGENT("Tswana") },
- { L"ts", LPGENT("Tsonga") },
- { L"tk", LPGENT("Turkmen") },
- { L"tr", LPGENT("Turkish") },
- { L"tw", LPGENT("Twi") },
- { L"ug", LPGENT("Uighur; Uyghur") },
- { L"uk", LPGENT("Ukrainian") },
- { L"ur", LPGENT("Urdu") },
- { L"uz", LPGENT("Uzbek") },
- { L"ve", LPGENT("Venda") },
- { L"vi", LPGENT("Vietnamese") },
- { L"vo", LPGENT("Volapuk") },
- { L"cy", LPGENT("Welsh") },
- { L"wa", LPGENT("Walloon") },
- { L"wo", LPGENT("Wolof") },
- { L"xh", LPGENT("Xhosa") },
- { L"yi", LPGENT("Yiddish") },
- { L"yo", LPGENT("Yoruba") },
- { L"za", LPGENT("Zhuang; Chuang") },
- { L"zu", LPGENT("Zulu") },
+struct { wchar_t *szCode; wchar_t *szDescription; } g_LanguageCodes[] = {
+ { L"aa", LPGENW("Afar") },
+ { L"ab", LPGENW("Abkhazian") },
+ { L"af", LPGENW("Afrikaans") },
+ { L"ak", LPGENW("Akan") },
+ { L"sq", LPGENW("Albanian") },
+ { L"am", LPGENW("Amharic") },
+ { L"ar", LPGENW("Arabic") },
+ { L"an", LPGENW("Aragonese") },
+ { L"hy", LPGENW("Armenian") },
+ { L"as", LPGENW("Assamese") },
+ { L"av", LPGENW("Avaric") },
+ { L"ae", LPGENW("Avestan") },
+ { L"ay", LPGENW("Aymara") },
+ { L"az", LPGENW("Azerbaijani") },
+ { L"ba", LPGENW("Bashkir") },
+ { L"bm", LPGENW("Bambara") },
+ { L"eu", LPGENW("Basque") },
+ { L"be", LPGENW("Belarusian") },
+ { L"bn", LPGENW("Bengali") },
+ { L"bh", LPGENW("Bihari") },
+ { L"bi", LPGENW("Bislama") },
+ { L"bs", LPGENW("Bosnian") },
+ { L"br", LPGENW("Breton") },
+ { L"bg", LPGENW("Bulgarian") },
+ { L"my", LPGENW("Burmese") },
+ { L"ca", LPGENW("Catalan; Valencian") },
+ { L"ch", LPGENW("Chamorro") },
+ { L"ce", LPGENW("Chechen") },
+ { L"zh", LPGENW("Chinese") },
+ { L"cu", LPGENW("Church Slavic; Old Slavonic") },
+ { L"cv", LPGENW("Chuvash") },
+ { L"kw", LPGENW("Cornish") },
+ { L"co", LPGENW("Corsican") },
+ { L"cr", LPGENW("Cree") },
+ { L"cs", LPGENW("Czech") },
+ { L"da", LPGENW("Danish") },
+ { L"dv", LPGENW("Divehi; Dhivehi; Maldivian") },
+ { L"nl", LPGENW("Dutch; Flemish") },
+ { L"dz", LPGENW("Dzongkha") },
+ { L"en", LPGENW("English") },
+ { L"eo", LPGENW("Esperanto") },
+ { L"et", LPGENW("Estonian") },
+ { L"ee", LPGENW("Ewe") },
+ { L"fo", LPGENW("Faroese") },
+ { L"fj", LPGENW("Fijian") },
+ { L"fi", LPGENW("Finnish") },
+ { L"fr", LPGENW("French") },
+ { L"fy", LPGENW("Western Frisian") },
+ { L"ff", LPGENW("Fulah") },
+ { L"ka", LPGENW("Georgian") },
+ { L"de", LPGENW("German") },
+ { L"gd", LPGENW("Gaelic; Scottish Gaelic") },
+ { L"ga", LPGENW("Irish") },
+ { L"gl", LPGENW("Galician") },
+ { L"gv", LPGENW("Manx") },
+ { L"el", LPGENW("Greek, Modern (1453-)") },
+ { L"gn", LPGENW("Guarani") },
+ { L"gu", LPGENW("Gujarati") },
+ { L"ht", LPGENW("Haitian; Haitian Creole") },
+ { L"ha", LPGENW("Hausa") },
+ { L"he", LPGENW("Hebrew") },
+ { L"hz", LPGENW("Herero") },
+ { L"hi", LPGENW("Hindi") },
+ { L"ho", LPGENW("Hiri Motu") },
+ { L"hu", LPGENW("Hungarian") },
+ { L"ig", LPGENW("Igbo") },
+ { L"is", LPGENW("Icelandic") },
+ { L"io", LPGENW("Ido") },
+ { L"ii", LPGENW("Sichuan Yi") },
+ { L"iu", LPGENW("Inuktitut") },
+ { L"ie", LPGENW("Interlingue") },
+ { L"ia", LPGENW("Interlingua (International Auxiliary Language Association)") },
+ { L"id", LPGENW("Indonesian") },
+ { L"ik", LPGENW("Inupiaq") },
+ { L"it", LPGENW("Italian") },
+ { L"jv", LPGENW("Javanese") },
+ { L"ja", LPGENW("Japanese") },
+ { L"kl", LPGENW("Kalaallisut; Greenlandic") },
+ { L"kn", LPGENW("Kannada") },
+ { L"ks", LPGENW("Kashmiri") },
+ { L"kr", LPGENW("Kanuri") },
+ { L"kk", LPGENW("Kazakh") },
+ { L"km", LPGENW("Central Khmer") },
+ { L"ki", LPGENW("Kikuyu; Gikuyu") },
+ { L"rw", LPGENW("Kinyarwanda") },
+ { L"ky", LPGENW("Kirghiz; Kyrgyz") },
+ { L"kv", LPGENW("Komi") },
+ { L"kg", LPGENW("Kongo") },
+ { L"ko", LPGENW("Korean") },
+ { L"kj", LPGENW("Kuanyama; Kwanyama") },
+ { L"ku", LPGENW("Kurdish") },
+ { L"lo", LPGENW("Lao") },
+ { L"la", LPGENW("Latin") },
+ { L"lv", LPGENW("Latvian") },
+ { L"li", LPGENW("Limburgan; Limburger; Limburgish") },
+ { L"ln", LPGENW("Lingala") },
+ { L"lt", LPGENW("Lithuanian") },
+ { L"lb", LPGENW("Luxembourgish; Letzeburgesch") },
+ { L"lu", LPGENW("Luba-Katanga") },
+ { L"lg", LPGENW("Ganda") },
+ { L"mk", LPGENW("Macedonian") },
+ { L"mh", LPGENW("Marshallese") },
+ { L"ml", LPGENW("Malayalam") },
+ { L"mi", LPGENW("Maori") },
+ { L"mr", LPGENW("Marathi") },
+ { L"ms", LPGENW("Malay") },
+ { L"mg", LPGENW("Malagasy") },
+ { L"mt", LPGENW("Maltese") },
+ { L"mo", LPGENW("Moldavian") },
+ { L"mn", LPGENW("Mongolian") },
+ { L"na", LPGENW("Nauru") },
+ { L"nv", LPGENW("Navajo; Navaho") },
+ { L"nr", LPGENW("Ndebele, South; South Ndebele") },
+ { L"nd", LPGENW("Ndebele, North; North Ndebele") },
+ { L"ng", LPGENW("Ndonga") },
+ { L"ne", LPGENW("Nepali") },
+ { L"nn", LPGENW("Norwegian Nynorsk; Nynorsk, Norwegian") },
+ { L"nb", LPGENW("Bokmaal, Norwegian; Norwegian Bokmaal") },
+ { L"no", LPGENW("Norwegian") },
+ { L"ny", LPGENW("Chichewa; Chewa; Nyanja") },
+ { L"oc", LPGENW("Occitan (post 1500); Provencal") },
+ { L"oj", LPGENW("Ojibwa") },
+ { L"or", LPGENW("Oriya") },
+ { L"om", LPGENW("Oromo") },
+ { L"os", LPGENW("Ossetian; Ossetic") },
+ { L"pa", LPGENW("Panjabi; Punjabi") },
+ { L"fa", LPGENW("Persian") },
+ { L"pi", LPGENW("Pali") },
+ { L"pl", LPGENW("Polish") },
+ { L"pt", LPGENW("Portuguese") },
+ { L"ps", LPGENW("Pushto") },
+ { L"qu", LPGENW("Quechua") },
+ { L"rm", LPGENW("Romansh") },
+ { L"ro", LPGENW("Romanian") },
+ { L"rn", LPGENW("Rundi") },
+ { L"ru", LPGENW("Russian") },
+ { L"sg", LPGENW("Sango") },
+ { L"sa", LPGENW("Sanskrit") },
+ { L"sr", LPGENW("Serbian") },
+ { L"hr", LPGENW("Croatian") },
+ { L"si", LPGENW("Sinhala; Sinhalese") },
+ { L"sk", LPGENW("Slovak") },
+ { L"sl", LPGENW("Slovenian") },
+ { L"se", LPGENW("Northern Sami") },
+ { L"sm", LPGENW("Samoan") },
+ { L"sn", LPGENW("Shona") },
+ { L"sd", LPGENW("Sindhi") },
+ { L"so", LPGENW("Somali") },
+ { L"st", LPGENW("Sotho, Southern") },
+ { L"es", LPGENW("Spanish; Castilian") },
+ { L"sc", LPGENW("Sardinian") },
+ { L"ss", LPGENW("Swati") },
+ { L"su", LPGENW("Sundanese") },
+ { L"sw", LPGENW("Swahili") },
+ { L"sv", LPGENW("Swedish") },
+ { L"ty", LPGENW("Tahitian") },
+ { L"ta", LPGENW("Tamil") },
+ { L"tt", LPGENW("Tatar") },
+ { L"te", LPGENW("Telugu") },
+ { L"tg", LPGENW("Tajik") },
+ { L"tl", LPGENW("Tagalog") },
+ { L"th", LPGENW("Thai") },
+ { L"bo", LPGENW("Tibetan") },
+ { L"ti", LPGENW("Tigrinya") },
+ { L"to", LPGENW("Tonga (Tonga Islands)") },
+ { L"tn", LPGENW("Tswana") },
+ { L"ts", LPGENW("Tsonga") },
+ { L"tk", LPGENW("Turkmen") },
+ { L"tr", LPGENW("Turkish") },
+ { L"tw", LPGENW("Twi") },
+ { L"ug", LPGENW("Uighur; Uyghur") },
+ { L"uk", LPGENW("Ukrainian") },
+ { L"ur", LPGENW("Urdu") },
+ { L"uz", LPGENW("Uzbek") },
+ { L"ve", LPGENW("Venda") },
+ { L"vi", LPGENW("Vietnamese") },
+ { L"vo", LPGENW("Volapuk") },
+ { L"cy", LPGENW("Welsh") },
+ { L"wa", LPGENW("Walloon") },
+ { L"wo", LPGENW("Wolof") },
+ { L"xh", LPGENW("Xhosa") },
+ { L"yi", LPGENW("Yiddish") },
+ { L"yo", LPGENW("Yoruba") },
+ { L"za", LPGENW("Zhuang; Chuang") },
+ { L"zu", LPGENW("Zulu") },
{ NULL, NULL }
};
@@ -242,7 +242,7 @@ public:
protected:
void OnInitDialog()
{
- TCHAR text[256];
+ wchar_t text[256];
mir_sntprintf(text, STR_FORMAT, TranslateT("Register"), m_regInfo->username, m_regInfo->server, m_regInfo->port);
SetDlgItemText(m_hwnd, IDC_REG_STATUS, text);
}
@@ -251,10 +251,10 @@ protected:
{
switch (msg) {
case WM_JABBER_REGDLG_UPDATE: // wParam=progress (0-100), lparam=status string
- if ((TCHAR*)lParam == NULL)
+ if ((wchar_t*)lParam == NULL)
SetDlgItemText(m_hwnd, IDC_REG_STATUS, TranslateT("No message"));
else
- SetDlgItemText(m_hwnd, IDC_REG_STATUS, (TCHAR*)lParam);
+ SetDlgItemText(m_hwnd, IDC_REG_STATUS, (wchar_t*)lParam);
SendDlgItemMessage(m_hwnd, IDC_PROGRESS_REG, PBM_SETPOS, wParam, 0);
if (wParam >= 100)
@@ -425,7 +425,7 @@ protected:
SendDlgItemMessage(m_hwnd, IDC_PRIORITY_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(127, -128));
- TCHAR *passw = m_proto->getTStringA(NULL, "Password");
+ wchar_t *passw = m_proto->getTStringA(NULL, "Password");
if (passw) {
m_txtPassword.SetText(passw);
mir_free(passw);
@@ -434,12 +434,12 @@ protected:
m_cbServer.AddString(TranslateT("Loading..."));
// fill predefined resources
- TCHAR *szResources[] = { L"Home", L"Work", L"Office", L"Miranda" };
+ wchar_t *szResources[] = { L"Home", L"Work", L"Office", L"Miranda" };
for (int i = 0; i < _countof(szResources); i++)
m_cbResource.AddString(szResources[i]);
// append computer name to the resource list
- TCHAR szCompName[MAX_COMPUTERNAME_LENGTH + 1];
+ wchar_t szCompName[MAX_COMPUTERNAME_LENGTH + 1];
DWORD dwCompNameLength = MAX_COMPUTERNAME_LENGTH;
if (GetComputerName(szCompName, &dwCompNameLength))
m_cbResource.AddString(szCompName);
@@ -489,7 +489,7 @@ protected:
int index = m_cbLocale.GetCurSel();
if (index >= 0) {
- TCHAR *szLanguageCode = (TCHAR *)m_cbLocale.GetItemData(index);
+ wchar_t *szLanguageCode = (wchar_t *)m_cbLocale.GetItemData(index);
if (szLanguageCode) {
m_proto->setTString("XmlLang", szLanguageCode);
@@ -615,7 +615,7 @@ private:
m_cbResource.Enable(chk->GetState() != BST_CHECKED);
if (chk->GetState() == BST_CHECKED) {
- TCHAR szCompName[MAX_COMPUTERNAME_LENGTH + 1];
+ wchar_t szCompName[MAX_COMPUTERNAME_LENGTH + 1];
DWORD dwCompNameLength = MAX_COMPUTERNAME_LENGTH;
if (GetComputerName(szCompName, &dwCompNameLength))
m_cbResource.SetText(szCompName);
@@ -686,7 +686,7 @@ private:
{
m_gotservers = node != NULL;
- TCHAR *server = m_cbServer.GetText();
+ wchar_t *server = m_cbServer.GetText();
bool bDropdown = m_cbServer.GetDroppedState();
if (bDropdown) m_cbServer.ShowDropdown(false);
@@ -698,7 +698,7 @@ private:
break;
if (!mir_tstrcmp(XmlGetName(n), L"item"))
- if (const TCHAR *jid = XmlGetAttrValue(n, L"jid"))
+ if (const wchar_t *jid = XmlGetAttrValue(n, L"jid"))
if (m_cbServer.FindString(jid, -1, true) == CB_ERR)
m_cbServer.AddString(jid);
}
@@ -729,7 +729,7 @@ private:
NETLIBHTTPREQUEST *result = (NETLIBHTTPREQUEST *)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)wnd->GetProto()->m_hNetlibUser, (LPARAM)&request);
if (result) {
if (result->resultCode == 200 && result->dataLength && result->pData) {
- TCHAR *buf = mir_a2t(result->pData);
+ wchar_t *buf = mir_a2t(result->pData);
XmlNode node(buf, NULL, NULL);
if (node) {
HXML queryNode = XmlGetChild(node, L"query");
@@ -783,34 +783,34 @@ public:
m_chkDirectManual.OnChange = Callback(this, &CDlgOptAdvanced::chkDirect_OnChange);
m_chkProxy.OnChange = Callback(this, &CDlgOptAdvanced::chkProxy_OnChange);
- m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Send messages slower, but with full acknowledgment"), m_proto->m_options.MsgAck);
- m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Enable avatars"), m_proto->m_options.EnableAvatars);
- m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Log chat state changes"), m_proto->m_options.LogChatstates);
- m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Log presence subscription state changes"), m_proto->m_options.LogPresence);
- m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Log presence errors"), m_proto->m_options.LogPresenceErrors);
- m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Enable user moods receiving"), m_proto->m_options.EnableUserMood);
- m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Enable user tunes receiving"), m_proto->m_options.EnableUserTune);
- m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Enable user activity receiving"), m_proto->m_options.EnableUserActivity);
- m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Receive notes"), m_proto->m_options.AcceptNotes);
- m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Automatically save received notes"), m_proto->m_options.AutosaveNotes);
- m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Enable server-side history"), m_proto->m_options.EnableMsgArchive);
-
- m_otvOptions.AddOption(LPGENT("Server options") L"/" LPGENT("Disable SASL authentication (for old servers)"), m_proto->m_options.Disable3920auth);
- m_otvOptions.AddOption(LPGENT("Server options") L"/" LPGENT("Enable stream compression (if possible)"), m_proto->m_options.EnableZlib);
-
- m_otvOptions.AddOption(LPGENT("Other") L"/" LPGENT("Enable remote controlling (from another resource of same JID only)"), m_proto->m_options.EnableRemoteControl);
- m_otvOptions.AddOption(LPGENT("Other") L"/" LPGENT("Show transport agents on contact list"), m_proto->m_options.ShowTransport);
- m_otvOptions.AddOption(LPGENT("Other") L"/" LPGENT("Automatically add contact when accept authorization"), m_proto->m_options.AutoAdd);
- m_otvOptions.AddOption(LPGENT("Other") L"/" LPGENT("Automatically accept authorization requests"), m_proto->m_options.AutoAcceptAuthorization);
- m_otvOptions.AddOption(LPGENT("Other") L"/" LPGENT("Fix incorrect timestamps in incoming messages"), m_proto->m_options.FixIncorrectTimestamps);
- m_otvOptions.AddOption(LPGENT("Other") L"/" LPGENT("Disable frame"), m_proto->m_options.DisableFrame);
- m_otvOptions.AddOption(LPGENT("Other") L"/" LPGENT("Enable XMPP link processing (requires AssocMgr)"), m_proto->m_options.ProcessXMPPLinks);
- m_otvOptions.AddOption(LPGENT("Other") L"/" LPGENT("Keep contacts assigned to local groups (ignore roster group)"), m_proto->m_options.IgnoreRosterGroups);
-
- m_otvOptions.AddOption(LPGENT("Security") L"/" LPGENT("Allow servers to request version (XEP-0092)"), m_proto->m_options.AllowVersionRequests);
- m_otvOptions.AddOption(LPGENT("Security") L"/" LPGENT("Show information about operating system in version replies"), m_proto->m_options.ShowOSVersion);
- m_otvOptions.AddOption(LPGENT("Security") L"/" LPGENT("Accept only in band incoming filetransfers (don't disclose own IP)"), m_proto->m_options.BsOnlyIBB);
- m_otvOptions.AddOption(LPGENT("Security") L"/" LPGENT("Accept HTTP Authentication requests (XEP-0070)"), m_proto->m_options.AcceptHttpAuth);
+ m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Send messages slower, but with full acknowledgment"), m_proto->m_options.MsgAck);
+ m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Enable avatars"), m_proto->m_options.EnableAvatars);
+ m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Log chat state changes"), m_proto->m_options.LogChatstates);
+ m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Log presence subscription state changes"), m_proto->m_options.LogPresence);
+ m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Log presence errors"), m_proto->m_options.LogPresenceErrors);
+ m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Enable user moods receiving"), m_proto->m_options.EnableUserMood);
+ m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Enable user tunes receiving"), m_proto->m_options.EnableUserTune);
+ m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Enable user activity receiving"), m_proto->m_options.EnableUserActivity);
+ m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Receive notes"), m_proto->m_options.AcceptNotes);
+ m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Automatically save received notes"), m_proto->m_options.AutosaveNotes);
+ m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Enable server-side history"), m_proto->m_options.EnableMsgArchive);
+
+ m_otvOptions.AddOption(LPGENW("Server options") L"/" LPGENW("Disable SASL authentication (for old servers)"), m_proto->m_options.Disable3920auth);
+ m_otvOptions.AddOption(LPGENW("Server options") L"/" LPGENW("Enable stream compression (if possible)"), m_proto->m_options.EnableZlib);
+
+ m_otvOptions.AddOption(LPGENW("Other") L"/" LPGENW("Enable remote controlling (from another resource of same JID only)"), m_proto->m_options.EnableRemoteControl);
+ m_otvOptions.AddOption(LPGENW("Other") L"/" LPGENW("Show transport agents on contact list"), m_proto->m_options.ShowTransport);
+ m_otvOptions.AddOption(LPGENW("Other") L"/" LPGENW("Automatically add contact when accept authorization"), m_proto->m_options.AutoAdd);
+ m_otvOptions.AddOption(LPGENW("Other") L"/" LPGENW("Automatically accept authorization requests"), m_proto->m_options.AutoAcceptAuthorization);
+ m_otvOptions.AddOption(LPGENW("Other") L"/" LPGENW("Fix incorrect timestamps in incoming messages"), m_proto->m_options.FixIncorrectTimestamps);
+ m_otvOptions.AddOption(LPGENW("Other") L"/" LPGENW("Disable frame"), m_proto->m_options.DisableFrame);
+ m_otvOptions.AddOption(LPGENW("Other") L"/" LPGENW("Enable XMPP link processing (requires AssocMgr)"), m_proto->m_options.ProcessXMPPLinks);
+ m_otvOptions.AddOption(LPGENW("Other") L"/" LPGENW("Keep contacts assigned to local groups (ignore roster group)"), m_proto->m_options.IgnoreRosterGroups);
+
+ m_otvOptions.AddOption(LPGENW("Security") L"/" LPGENW("Allow servers to request version (XEP-0092)"), m_proto->m_options.AllowVersionRequests);
+ m_otvOptions.AddOption(LPGENW("Security") L"/" LPGENW("Show information about operating system in version replies"), m_proto->m_options.ShowOSVersion);
+ m_otvOptions.AddOption(LPGENW("Security") L"/" LPGENW("Accept only in band incoming filetransfers (don't disclose own IP)"), m_proto->m_options.BsOnlyIBB);
+ m_otvOptions.AddOption(LPGENW("Security") L"/" LPGENW("Accept HTTP Authentication requests (XEP-0070)"), m_proto->m_options.AcceptHttpAuth);
}
void OnInitDialog()
@@ -833,7 +833,7 @@ public:
{
JABBER_LIST_ITEM *item = m_proto->ListGetItemPtrFromIndex(index);
if (item != NULL) {
- if (_tcschr(item->jid, '@') == NULL) {
+ if (wcschr(item->jid, '@') == NULL) {
MCONTACT hContact = m_proto->HContactFromJID(item->jid);
if (hContact != NULL) {
if (bChecked) {
@@ -900,17 +900,17 @@ public:
CreateLink(m_txtSlap, "GcMsgSlap", TranslateTS(JABBER_GC_MSG_SLAP));
CreateLink(m_txtQuit, "GcMsgQuit", TranslateTS(JABBER_GC_MSG_QUIT));
- m_otvOptions.AddOption(LPGENT("General") L"/" LPGENT("Autoaccept multiuser chat invitations"), m_proto->m_options.AutoAcceptMUC);
- m_otvOptions.AddOption(LPGENT("General") L"/" LPGENT("Automatically join bookmarks on login"), m_proto->m_options.AutoJoinBookmarks);
- m_otvOptions.AddOption(LPGENT("General") L"/" LPGENT("Automatically join conferences on login"), m_proto->m_options.AutoJoinConferences);
- m_otvOptions.AddOption(LPGENT("General") L"/" LPGENT("Hide conference windows at startup"), m_proto->m_options.AutoJoinHidden);
- m_otvOptions.AddOption(LPGENT("General") L"/" LPGENT("Do not show multiuser chat invitations"), m_proto->m_options.IgnoreMUCInvites);
- m_otvOptions.AddOption(LPGENT("Log events") L"/" LPGENT("Ban notifications"), m_proto->m_options.GcLogBans);
- m_otvOptions.AddOption(LPGENT("Log events") L"/" LPGENT("Room configuration changes"), m_proto->m_options.GcLogConfig);
- m_otvOptions.AddOption(LPGENT("Log events") L"/" LPGENT("Affiliation changes"), m_proto->m_options.GcLogAffiliations);
- m_otvOptions.AddOption(LPGENT("Log events") L"/" LPGENT("Role changes"), m_proto->m_options.GcLogRoles);
- m_otvOptions.AddOption(LPGENT("Log events") L"/" LPGENT("Status changes"), m_proto->m_options.GcLogStatuses);
- m_otvOptions.AddOption(LPGENT("Log events") L"/" LPGENT("Don't notify history messages"), m_proto->m_options.GcLogChatHistory);
+ m_otvOptions.AddOption(LPGENW("General") L"/" LPGENW("Autoaccept multiuser chat invitations"), m_proto->m_options.AutoAcceptMUC);
+ m_otvOptions.AddOption(LPGENW("General") L"/" LPGENW("Automatically join bookmarks on login"), m_proto->m_options.AutoJoinBookmarks);
+ m_otvOptions.AddOption(LPGENW("General") L"/" LPGENW("Automatically join conferences on login"), m_proto->m_options.AutoJoinConferences);
+ m_otvOptions.AddOption(LPGENW("General") L"/" LPGENW("Hide conference windows at startup"), m_proto->m_options.AutoJoinHidden);
+ m_otvOptions.AddOption(LPGENW("General") L"/" LPGENW("Do not show multiuser chat invitations"), m_proto->m_options.IgnoreMUCInvites);
+ m_otvOptions.AddOption(LPGENW("Log events") L"/" LPGENW("Ban notifications"), m_proto->m_options.GcLogBans);
+ m_otvOptions.AddOption(LPGENW("Log events") L"/" LPGENW("Room configuration changes"), m_proto->m_options.GcLogConfig);
+ m_otvOptions.AddOption(LPGENW("Log events") L"/" LPGENW("Affiliation changes"), m_proto->m_options.GcLogAffiliations);
+ m_otvOptions.AddOption(LPGENW("Log events") L"/" LPGENW("Role changes"), m_proto->m_options.GcLogRoles);
+ m_otvOptions.AddOption(LPGENW("Log events") L"/" LPGENW("Status changes"), m_proto->m_options.GcLogStatuses);
+ m_otvOptions.AddOption(LPGENW("Log events") L"/" LPGENW("Don't notify history messages"), m_proto->m_options.GcLogChatHistory);
}
};
@@ -936,12 +936,12 @@ struct ROSTEREDITDAT
int subindex;
};
-static int _RosterInsertListItem(HWND hList, const TCHAR * jid, const TCHAR * nick, const TCHAR * group, const TCHAR * subscr, BOOL bChecked)
+static int _RosterInsertListItem(HWND hList, const wchar_t * jid, const wchar_t * nick, const wchar_t * group, const wchar_t * subscr, BOOL bChecked)
{
LVITEM item = { 0 };
item.mask = LVIF_TEXT | LVIF_STATE;
item.iItem = ListView_GetItemCount(hList);
- item.pszText = (TCHAR*)jid;
+ item.pszText = (wchar_t*)jid;
int index = ListView_InsertItem(hList, &item);
if (index < 0)
@@ -949,9 +949,9 @@ static int _RosterInsertListItem(HWND hList, const TCHAR * jid, const TCHAR * ni
ListView_SetCheckState(hList, index, bChecked);
- ListView_SetItemText(hList, index, 0, (TCHAR*)jid);
- ListView_SetItemText(hList, index, 1, (TCHAR*)nick);
- ListView_SetItemText(hList, index, 2, (TCHAR*)group);
+ ListView_SetItemText(hList, index, 0, (wchar_t*)jid);
+ ListView_SetItemText(hList, index, 1, (wchar_t*)nick);
+ ListView_SetItemText(hList, index, 2, (wchar_t*)group);
ListView_SetItemText(hList, index, 3, TranslateTS(subscr));
return index;
}
@@ -1004,13 +1004,13 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*)
if (item == NULL)
break;
- const TCHAR *jid = XmlGetAttrValue(item, L"jid");
+ const wchar_t *jid = XmlGetAttrValue(item, L"jid");
if (jid == NULL)
continue;
- const TCHAR *name = XmlGetAttrValue(item, L"name");
- const TCHAR *subscription = XmlGetAttrValue(item, L"subscription");
- const TCHAR *group = XmlGetText(XmlGetChild(item, "group"));
+ const wchar_t *name = XmlGetAttrValue(item, L"name");
+ const wchar_t *subscription = XmlGetAttrValue(item, L"subscription");
+ const wchar_t *group = XmlGetText(XmlGetChild(item, "group"));
_RosterInsertListItem(hList, jid, name, group, subscription, TRUE);
}
@@ -1023,9 +1023,9 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*)
LVFINDINFO lvfi = { 0 };
lvfi.flags = LVFI_STRING;
lvfi.psz = tszJid;
- TCHAR *p = _tcschr(tszJid, _T('@'));
+ wchar_t *p = wcschr(tszJid, '@');
if (p) {
- p = _tcschr(tszJid, _T('/'));
+ p = wcschr(tszJid, '/');
if (p) *p = 0;
}
if (ListView_FindItem(hList, -1, &lvfi) == -1) {
@@ -1055,10 +1055,10 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*)
int itemCount = 0;
int ListItemCount = ListView_GetItemCount(hList);
for (int index = 0; index < ListItemCount; index++) {
- TCHAR jid[JABBER_MAX_JID_LEN] = L"";
- TCHAR name[260] = L"";
- TCHAR group[260] = L"";
- TCHAR subscr[260] = L"";
+ wchar_t jid[JABBER_MAX_JID_LEN] = L"";
+ wchar_t name[260] = L"";
+ wchar_t group[260] = L"";
+ wchar_t subscr[260] = L"";
ListView_GetItemText(hList, index, 0, jid, _countof(jid));
ListView_GetItemText(hList, index, 1, name, _countof(name));
ListView_GetItemText(hList, index, 2, group, _countof(group));
@@ -1073,7 +1073,7 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*)
else if (!bRemove) {
BOOL bPushed = itemRoster ? TRUE : FALSE;
if (!bPushed) {
- const TCHAR *rosterName = XmlGetAttrValue(itemRoster, L"name");
+ const wchar_t *rosterName = XmlGetAttrValue(itemRoster, L"name");
if ((rosterName != NULL || name[0] != 0) && mir_tstrcmpi(rosterName, name))
bPushed = TRUE;
if (!bPushed) {
@@ -1082,7 +1082,7 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*)
bPushed = TRUE;
}
if (!bPushed) {
- const TCHAR *rosterGroup = XmlGetText(XmlGetChild(itemRoster, "group"));
+ const wchar_t *rosterGroup = XmlGetText(XmlGetChild(itemRoster, "group"));
if ((rosterGroup != NULL || group[0] != 0) && mir_tstrcmpi(rosterGroup, group))
bPushed = TRUE;
}
@@ -1127,7 +1127,7 @@ static void _RosterItemEditEnd(HWND hEditor, ROSTEREDITDAT * edat, BOOL bCancel)
{
if (!bCancel) {
int len = GetWindowTextLength(hEditor) + 1;
- TCHAR *buff = (TCHAR*)mir_alloc(len*sizeof(TCHAR));
+ wchar_t *buff = (wchar_t*)mir_alloc(len*sizeof(wchar_t));
if (buff) {
GetWindowText(hEditor, buff, len);
ListView_SetItemText(edat->hList, edat->index, edat->subindex, buff);
@@ -1176,9 +1176,9 @@ static LRESULT CALLBACK _RosterItemNewEditProc(HWND hEditor, UINT msg, WPARAM wP
void CJabberProto::_RosterExportToFile(HWND hwndDlg)
{
- TCHAR filename[MAX_PATH] = { 0 };
+ wchar_t filename[MAX_PATH] = { 0 };
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
mir_sntprintf(filter, L"%s (*.xml)%c*.xml%c%c", TranslateT("XML for MS Excel (UTF-8 encoded)"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
@@ -1209,10 +1209,10 @@ void CJabberProto::_RosterExportToFile(HWND hwndDlg)
<< XCHILD(L"Table");
for (int index = 0; index < ListItemCount; index++) {
- TCHAR jid[JABBER_MAX_JID_LEN] = L"";
- TCHAR name[260] = L"";
- TCHAR group[260] = L"";
- TCHAR subscr[260] = L"";
+ wchar_t jid[JABBER_MAX_JID_LEN] = L"";
+ wchar_t name[260] = L"";
+ wchar_t group[260] = L"";
+ wchar_t subscr[260] = L"";
ListView_GetItemText(hList, index, 0, jid, _countof(jid));
ListView_GetItemText(hList, index, 1, name, _countof(name));
ListView_GetItemText(hList, index, 2, group, _countof(group));
@@ -1230,7 +1230,7 @@ void CJabberProto::_RosterExportToFile(HWND hwndDlg)
char header[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<?mso-application progid=\"Excel.Sheet\"?>\n";
fwrite(header, 1, sizeof(header) - 1 /* for zero terminator */, fp);
- TCHAR *xtmp = xmlToString(root, NULL);
+ wchar_t *xtmp = xmlToString(root, NULL);
fputs(T2Utf(xtmp), fp);
xmlFree(xtmp);
fclose(fp);
@@ -1268,7 +1268,7 @@ void CJabberProto::_RosterImportFromFile(HWND hwndDlg)
fclose(fp);
_RosterListClear(hwndDlg);
- TCHAR *newBuf = mir_utf8decodeT(buffer);
+ wchar_t *newBuf = mir_utf8decodeT(buffer);
mir_free(buffer);
int nBytesProcessed = 0;
@@ -1288,10 +1288,10 @@ void CJabberProto::_RosterImportFromFile(HWND hwndDlg)
break;
BOOL bAdd = FALSE;
- const TCHAR *jid = NULL;
- const TCHAR *name = NULL;
- const TCHAR *group = NULL;
- const TCHAR *subscr = NULL;
+ const wchar_t *jid = NULL;
+ const wchar_t *name = NULL;
+ const wchar_t *group = NULL;
+ const wchar_t *subscr = NULL;
HXML Cell = XmlGetNthChild(Row, L"Cell", 1);
HXML Data = (Cell) ? XmlGetChild(Cell, "Data") : XmlNode();
if (Data) {
@@ -1347,7 +1347,7 @@ static LRESULT CALLBACK _RosterNewListProc(HWND hList, UINT msg, WPARAM wParam,
ListView_SubItemHitTest(hList, &lvhti);
if (lvhti.flags&LVHT_ONITEM && lvhti.iSubItem != 0) {
RECT rc;
- TCHAR buff[260];
+ wchar_t buff[260];
ListView_GetSubItemRect(hList, lvhti.iItem, lvhti.iSubItem, LVIR_BOUNDS, &rc);
ListView_GetItemText(hList, lvhti.iItem, lvhti.iSubItem, buff, _countof(buff));
HWND hEditor = CreateWindow(TEXT("EDIT"), buff, WS_CHILD | ES_AUTOHSCROLL, rc.left + 3, rc.top + 2, rc.right - rc.left - 3, rc.bottom - rc.top - 3, hList, NULL, hInst, NULL);
@@ -1490,19 +1490,19 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleRosterControl(WPARAM, LPARAM)
int CJabberProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.ptszGroup = LPGENT("Network");
- odp.ptszTitle = m_tszUserName;
+ odp.pwszGroup = LPGENW("Network");
+ odp.pwszTitle = m_tszUserName;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.ptszTab = LPGENT("Account");
+ odp.pwszTab = LPGENW("Account");
odp.pDialog = new CDlgOptAccount(this);
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Conferences");
+ odp.pwszTab = LPGENW("Conferences");
odp.pDialog = new CDlgOptGc(this);
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Advanced");
+ odp.pwszTab = LPGENW("Advanced");
odp.pDialog = new CDlgOptAdvanced(this);
Options_AddPage(wParam, &odp);
return 0;
@@ -1569,7 +1569,7 @@ protected:
m_gotservers = false;
- TCHAR *passw = m_proto->getTStringA(NULL, "Password");
+ wchar_t *passw = m_proto->getTStringA(NULL, "Password");
if (passw) {
m_txtPassword.SetText(passw);
mir_free(passw);
@@ -1578,12 +1578,12 @@ protected:
m_cbServer.AddString(TranslateT("Loading..."));
// fill predefined resources
- TCHAR *szResources[] = { L"Home", L"Work", L"Office", L"Miranda" };
+ wchar_t *szResources[] = { L"Home", L"Work", L"Office", L"Miranda" };
for (int i = 0; i < _countof(szResources); i++)
m_cbResource.AddString(szResources[i]);
// append computer name to the resource list
- TCHAR szCompName[MAX_COMPUTERNAME_LENGTH + 1];
+ wchar_t szCompName[MAX_COMPUTERNAME_LENGTH + 1];
DWORD dwCompNameLength = MAX_COMPUTERNAME_LENGTH;
if (GetComputerName(szCompName, &dwCompNameLength))
m_cbResource.AddString(szCompName);
@@ -1704,7 +1704,7 @@ protected:
m_proto->m_savedPassword = NULL;
BOOL bUseHostnameAsResource = FALSE;
- TCHAR szCompName[MAX_COMPUTERNAME_LENGTH + 1], szResource[MAX_COMPUTERNAME_LENGTH + 1];
+ wchar_t szCompName[MAX_COMPUTERNAME_LENGTH + 1], szResource[MAX_COMPUTERNAME_LENGTH + 1];
DWORD dwCompNameLength = MAX_COMPUTERNAME_LENGTH;
if (GetComputerName(szCompName, &dwCompNameLength)) {
m_cbResource.GetText(szResource, _countof(szResource));
@@ -1714,7 +1714,7 @@ protected:
m_proto->m_options.HostNameAsResource = bUseHostnameAsResource;
if (m_chkSavePassword.GetState() == BST_CHECKED) {
- TCHAR *text = m_txtPassword.GetText();
+ wchar_t *text = m_txtPassword.GetText();
m_proto->setTString("Password", text);
mir_free(text);
}
@@ -2160,7 +2160,7 @@ void CJabberDlgAccMgrUI::RefreshServers(HXML node)
{
m_gotservers = node != NULL;
- TCHAR *server = m_cbServer.GetText();
+ wchar_t *server = m_cbServer.GetText();
bool bDropdown = m_cbServer.GetDroppedState();
if (bDropdown) m_cbServer.ShowDropdown(false);
@@ -2172,7 +2172,7 @@ void CJabberDlgAccMgrUI::RefreshServers(HXML node)
break;
if (!mir_tstrcmp(XmlGetName(n), L"item"))
- if (const TCHAR *jid = XmlGetAttrValue(n, L"jid"))
+ if (const wchar_t *jid = XmlGetAttrValue(n, L"jid"))
if (m_cbServer.FindString(jid, -1, true) == CB_ERR)
m_cbServer.AddString(jid);
}
@@ -2199,7 +2199,7 @@ void CJabberDlgAccMgrUI::QueryServerListThread(void *arg)
NETLIBHTTPREQUEST *result = (NETLIBHTTPREQUEST *)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)wnd->GetProto()->m_hNetlibUser, (LPARAM)&request);
if (result && IsWindow(hwnd)) {
if ((result->resultCode == 200) && result->dataLength && result->pData) {
- TCHAR *ptszText = mir_a2t(result->pData);
+ wchar_t *ptszText = mir_a2t(result->pData);
XmlNode node(ptszText, NULL, NULL);
if (node) {
HXML queryNode = XmlGetChild(node, L"query");
diff --git a/protocols/JabberG/src/jabber_opttree.cpp b/protocols/JabberG/src/jabber_opttree.cpp
index bf3e791698..e1b800afa2 100644
--- a/protocols/JabberG/src/jabber_opttree.cpp
+++ b/protocols/JabberG/src/jabber_opttree.cpp
@@ -41,7 +41,7 @@ CCtrlTreeOpts::~CCtrlTreeOpts()
delete m_options[i];
}
-void CCtrlTreeOpts::AddOption(TCHAR *szOption, CMOption<BYTE> &option)
+void CCtrlTreeOpts::AddOption(wchar_t *szOption, CMOption<BYTE> &option)
{
m_options.insert(new COptionsItem(szOption, option), m_options.getCount());
}
@@ -90,7 +90,7 @@ void CCtrlTreeOpts::OnInit()
{
CCtrlTreeView::OnInit();
- TCHAR itemName[1024];
+ wchar_t itemName[1024];
HIMAGELIST hImgLst;
SelectItem(NULL);
@@ -108,7 +108,7 @@ void CCtrlTreeOpts::OnInit()
/* build options tree. based on code from IcoLib */
for (int i = 0; i < m_options.getCount(); i++) {
- TCHAR *sectionName;
+ wchar_t *sectionName;
int sectionLevel = 0;
HTREEITEM hSection = NULL;
@@ -117,10 +117,10 @@ void CCtrlTreeOpts::OnInit()
while (sectionName) {
// allow multi-level tree
- TCHAR *pItemName = sectionName;
+ wchar_t *pItemName = sectionName;
HTREEITEM hItem;
- if (sectionName = _tcschr(sectionName, '/')) {
+ if (sectionName = wcschr(sectionName, '/')) {
// one level deeper
*sectionName = 0;
sectionName++;
@@ -225,7 +225,7 @@ void CCtrlTreeOpts::ProcessItemClick(HTREEITEM hti)
SetItem(&tvi);
}
-CCtrlTreeOpts::COptionsItem::COptionsItem(TCHAR *szOption, CMOption<BYTE> &option) :
+CCtrlTreeOpts::COptionsItem::COptionsItem(wchar_t *szOption, CMOption<BYTE> &option) :
m_option(&option), m_groupId(OPTTREE_CHECK), m_hItem(NULL)
{
m_szOptionName = mir_tstrdup(szOption);
diff --git a/protocols/JabberG/src/jabber_opttree.h b/protocols/JabberG/src/jabber_opttree.h
index 5949b8acc5..66e33b4a3d 100644
--- a/protocols/JabberG/src/jabber_opttree.h
+++ b/protocols/JabberG/src/jabber_opttree.h
@@ -37,7 +37,7 @@ public:
CCtrlTreeOpts(CDlgBase* dlg, int ctrlId);
~CCtrlTreeOpts();
- void AddOption(TCHAR *szOption, CMOption<BYTE> &option);
+ void AddOption(wchar_t *szOption, CMOption<BYTE> &option);
BOOL OnNotify(int idCtrl, NMHDR *pnmh);
void OnDestroy();
@@ -47,14 +47,14 @@ public:
protected:
struct COptionsItem
{
- TCHAR *m_szOptionName;
+ wchar_t *m_szOptionName;
int m_groupId;
CMOption<BYTE> *m_option;
HTREEITEM m_hItem;
- COptionsItem(TCHAR *szOption, CMOption<BYTE> &option);
+ COptionsItem(wchar_t *szOption, CMOption<BYTE> &option);
~COptionsItem();
};
diff --git a/protocols/JabberG/src/jabber_password.cpp b/protocols/JabberG/src/jabber_password.cpp
index f81d00a074..54d1b74bdd 100644
--- a/protocols/JabberG/src/jabber_password.cpp
+++ b/protocols/JabberG/src/jabber_password.cpp
@@ -49,7 +49,7 @@ static INT_PTR CALLBACK JabberChangePasswordDlgProc(HWND hwndDlg, UINT msg, WPAR
Window_SetIcon_IcoLib(hwndDlg, g_GetIconHandle(IDI_KEYS));
TranslateDialogDefault(hwndDlg);
if (ppro->m_bJabberOnline && ppro->m_ThreadInfo != NULL) {
- TCHAR text[1024];
+ wchar_t text[1024];
mir_sntprintf(text, TranslateT("Set New Password for %s@%S"), ppro->m_ThreadInfo->conn.username, ppro->m_ThreadInfo->conn.server);
SetWindowText(hwndDlg, text);
}
@@ -58,7 +58,7 @@ static INT_PTR CALLBACK JabberChangePasswordDlgProc(HWND hwndDlg, UINT msg, WPAR
switch (LOWORD(wParam)) {
case IDOK:
if (ppro->m_bJabberOnline && ppro->m_ThreadInfo != NULL) {
- TCHAR newPasswd[512], text[512];
+ wchar_t newPasswd[512], text[512];
GetDlgItemText(hwndDlg, IDC_NEWPASSWD, newPasswd, _countof(newPasswd));
GetDlgItemText(hwndDlg, IDC_NEWPASSWD2, text, _countof(text));
if (mir_tstrcmp(newPasswd, text)) {
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp
index 4e0fac80ed..ba3df4a5b0 100644
--- a/protocols/JabberG/src/jabber_privacy.cpp
+++ b/protocols/JabberG/src/jabber_privacy.cpp
@@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "jabber_iq.h"
#include "jabber_privacy.h"
-#define JABBER_PL_BUSY_MSG LPGEN("Sending request, please wait...")
+const wchar_t JABBER_PL_BUSY_MSG[] = LPGENW("Sending request, please wait...");
BOOL CJabberProto::OnIqRequestPrivacyLists(HXML, CJabberIqInfo *pInfo)
{
@@ -56,7 +56,7 @@ void CJabberProto::OnIqResultPrivacyListModify(HXML, CJabberIqInfo *pInfo)
InterlockedDecrement(&pParam->m_dwCount);
if (!pParam->m_dwCount) {
- TCHAR szText[ 512 ];
+ wchar_t szText[ 512 ];
if (!pParam->m_bAllOk)
mir_sntprintf(szText, TranslateT("Error occurred while applying changes"));
else
@@ -73,7 +73,7 @@ void CJabberProto::OnIqResultPrivacyList(HXML iqNode, CJabberIqInfo*)
if (iqNode == NULL)
return;
- const TCHAR *type = XmlGetAttrValue(iqNode, L"type");
+ const wchar_t *type = XmlGetAttrValue(iqNode, L"type");
if (type == NULL)
return;
@@ -86,7 +86,7 @@ void CJabberProto::OnIqResultPrivacyList(HXML iqNode, CJabberIqInfo*)
HXML list = XmlGetChild(query, "list");
if (list == NULL)
return;
- TCHAR *szListName = (TCHAR*)XmlGetAttrValue(list, L"name");
+ wchar_t *szListName = (wchar_t*)XmlGetAttrValue(list, L"name");
if (!szListName)
return;
@@ -101,7 +101,7 @@ void CJabberProto::OnIqResultPrivacyList(HXML iqNode, CJabberIqInfo*)
HXML item;
for (int i = 1; (item = XmlGetNthChild(list, L"item", i)) != NULL; i++) {
- const TCHAR *itemType = XmlGetAttrValue(item, L"type");
+ const wchar_t *itemType = XmlGetAttrValue(item, L"type");
PrivacyListRuleType nItemType = Else;
if (itemType) {
if (!mir_tstrcmpi(itemType, L"jid"))
@@ -112,17 +112,17 @@ void CJabberProto::OnIqResultPrivacyList(HXML iqNode, CJabberIqInfo*)
nItemType = Subscription;
}
- const TCHAR *itemValue = XmlGetAttrValue(item, L"value");
+ const wchar_t *itemValue = XmlGetAttrValue(item, L"value");
- const TCHAR *itemAction = XmlGetAttrValue(item, L"action");
+ const wchar_t *itemAction = XmlGetAttrValue(item, L"action");
BOOL bAllow = TRUE;
if (itemAction && !mir_tstrcmpi(itemAction, L"deny"))
bAllow = FALSE;
- const TCHAR *itemOrder = XmlGetAttrValue(item, L"order");
+ const wchar_t *itemOrder = XmlGetAttrValue(item, L"order");
DWORD dwOrder = 0;
if (itemOrder)
- dwOrder = _ttoi(itemOrder);
+ dwOrder = _wtoi(itemOrder);
DWORD dwPackets = 0;
if (XmlGetChild(item , "message"))
@@ -179,7 +179,7 @@ void CJabberProto::OnIqResultPrivacyListActive(HXML iqNode, CJabberIqInfo *pInfo
if (iqNode == NULL)
return;
- const TCHAR *type = XmlGetAttrValue(iqNode, L"type");
+ const wchar_t *type = XmlGetAttrValue(iqNode, L"type");
if (type == NULL)
return;
@@ -214,11 +214,11 @@ void CJabberProto::OnIqResultPrivacyListDefault(HXML iqNode, CJabberIqInfo *pInf
if (iqNode == NULL)
return;
- const TCHAR *type = XmlGetAttrValue(iqNode, L"type");
+ const wchar_t *type = XmlGetAttrValue(iqNode, L"type");
if (type == NULL)
return;
- TCHAR szText[ 512 ];
+ wchar_t szText[ 512 ];
szText[0] = 0;
{
mir_cslock lck(m_privacyListManager.m_cs);
@@ -262,9 +262,9 @@ void CJabberProto::OnIqResultPrivacyLists(HXML iqNode, CJabberIqInfo *pInfo)
if (list == NULL)
break;
- const TCHAR *listName = XmlGetAttrValue(list, L"name");
+ const wchar_t *listName = XmlGetAttrValue(list, L"name");
if (listName) {
- m_privacyListManager.AddList((TCHAR*)listName);
+ m_privacyListManager.AddList((wchar_t*)listName);
// Query contents only if list editior is visible!
if (m_pDlgPrivacyLists)
@@ -274,7 +274,7 @@ void CJabberProto::OnIqResultPrivacyLists(HXML iqNode, CJabberIqInfo *pInfo)
}
}
- const TCHAR *szName = NULL;
+ const wchar_t *szName = NULL;
HXML node = XmlGetChild(query , "active");
if (node)
szName = XmlGetAttrValue(node, L"name");
@@ -298,7 +298,7 @@ class CJabberDlgPrivacyAddList: public CJabberDlgBase
typedef CJabberDlgBase CSuper;
public:
- TCHAR szLine[512];
+ wchar_t szLine[512];
CJabberDlgPrivacyAddList(CJabberProto *proto, HWND hwndParent):
CJabberDlgBase(proto, IDD_PRIVACY_ADD_LIST, false),
@@ -367,7 +367,7 @@ public:
SendDlgItemMessage(m_hwnd, IDC_ICO_PRESENCEIN, STM_SETICON, (WPARAM)m_proto->LoadIconEx("pl_prin_allow"), 0);
SendDlgItemMessage(m_hwnd, IDC_ICO_PRESENCEOUT, STM_SETICON, (WPARAM)m_proto->LoadIconEx("pl_prout_allow"), 0);
- TCHAR *szTypes[] = { L"JID", L"Group", L"Subscription", L"Any" };
+ wchar_t *szTypes[] = { L"JID", L"Group", L"Subscription", L"Any" };
int i, nTypes[] = { Jid, Group, Subscription, Else };
for (i=0; i < _countof(szTypes); i++) {
LRESULT nItem = SendDlgItemMessage(m_hwnd, IDC_COMBO_TYPE, CB_ADDSTRING, 0, (LPARAM)TranslateTS(szTypes[i]));
@@ -377,7 +377,7 @@ public:
}
SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_RESETCONTENT, 0, 0);
- TCHAR *szSubscriptions[] = { L"none", L"from", L"to", L"both" };
+ wchar_t *szSubscriptions[] = { L"none", L"from", L"to", L"both" };
for (i=0; i < _countof(szSubscriptions); i++) {
LRESULT nItem = SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_ADDSTRING, 0, (LPARAM)TranslateTS(szSubscriptions[i]));
SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_SETITEMDATA, nItem, (LPARAM)szSubscriptions[i]);
@@ -452,7 +452,7 @@ public:
SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUES, CB_RESETCONTENT, 0, 0);
{
- TCHAR *grpName;
+ wchar_t *grpName;
for (int i=1; (grpName = Clist_GroupGetName(i, NULL)) != NULL; i++)
SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUES, CB_ADDSTRING, 0, (LPARAM)grpName);
}
@@ -496,7 +496,7 @@ public:
case Jid:
case Group:
{
- TCHAR szText[ 512 ];
+ wchar_t szText[ 512 ];
GetDlgItemText(m_hwnd, IDC_COMBO_VALUES, szText, _countof(szText));
m_pRule->SetValue(szText);
}
@@ -505,7 +505,7 @@ public:
case Subscription:
nCurSel = SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_GETCURSEL, 0, 0);
if (nCurSel != CB_ERR)
- m_pRule->SetValue((TCHAR*)SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_GETITEMDATA, nCurSel, 0));
+ m_pRule->SetValue((wchar_t*)SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_GETITEMDATA, nCurSel, 0));
else
m_pRule->SetValue(L"none");
break;
@@ -606,7 +606,7 @@ protected:
void OnCommand_Close(HWND hwndCtrl, WORD idCtrl, WORD idCode);
void ShowAdvancedList(CPrivacyList *pList);
- void DrawNextRulePart(HDC hdc, COLORREF color, const TCHAR *text, RECT *rc);
+ void DrawNextRulePart(HDC hdc, COLORREF color, const wchar_t *text, RECT *rc);
void DrawRuleAction(HDC hdc, COLORREF clLine1, COLORREF clLine2, CPrivacyListRule *pRule, RECT *rc);
void DrawRulesList(LPDRAWITEMSTRUCT lpdis);
void DrawLists(LPDRAWITEMSTRUCT lpdis);
@@ -615,7 +615,7 @@ protected:
void CListFilter(HWND hwndList);
void CListResetIcons(HWND hwndList, HANDLE hItem, bool hide=false);
void CListSetupIcons(HWND hwndList, HANDLE hItem, int iSlot, DWORD dwProcess, BOOL bAction);
- HANDLE CListAddContact(HWND hwndList, TCHAR *jid);
+ HANDLE CListAddContact(HWND hwndList, wchar_t *jid);
void CListApplyList(HWND hwndList, CPrivacyList *pList = NULL);
DWORD CListGetPackets(HWND hwndList, HANDLE hItem, bool bAction);
void CListBuildList(HWND hwndList, CPrivacyList *pList);
@@ -631,7 +631,7 @@ protected:
struct TJidData
{
HANDLE hItem;
- TCHAR *jid;
+ wchar_t *jid;
static int cmp(const TJidData *p1, const TJidData *p2) { return mir_tstrcmp(p1->jid, p2->jid); }
};
@@ -657,7 +657,7 @@ protected:
}
}
- void addJid(HANDLE hItem, TCHAR *jid)
+ void addJid(HANDLE hItem, wchar_t *jid)
{
TJidData *data = (TJidData *)mir_alloc(sizeof(TJidData));
data->hItem = hItem;
@@ -665,7 +665,7 @@ protected:
newJids.insert(data);
}
- HANDLE findJid(TCHAR *jid)
+ HANDLE findJid(wchar_t *jid)
{
TJidData data = {0};
data.jid = jid;
@@ -866,10 +866,10 @@ void CJabberDlgPrivacyLists::OnDestroy()
void CJabberDlgPrivacyLists::OnProtoRefresh(WPARAM, LPARAM)
{
LRESULT sel = SendDlgItemMessage(m_hwnd, IDC_LB_LISTS, LB_GETCURSEL, 0, 0);
- TCHAR *szCurrentSelectedList = NULL;
+ wchar_t *szCurrentSelectedList = NULL;
if (sel != LB_ERR) {
LRESULT len = SendDlgItemMessage(m_hwnd, IDC_LB_LISTS, LB_GETTEXTLEN, sel, 0) + 1;
- szCurrentSelectedList = (TCHAR *)mir_alloc(len * sizeof(TCHAR));
+ szCurrentSelectedList = (wchar_t *)mir_alloc(len * sizeof(wchar_t));
SendDlgItemMessage(m_hwnd, IDC_LB_LISTS, LB_GETTEXT, sel, (LPARAM)szCurrentSelectedList);
}
@@ -924,16 +924,16 @@ BOOL CJabberDlgPrivacyLists::OnWmMeasureItem(UINT, WPARAM, LPARAM lParam)
struct
{
- TCHAR *textEng;
+ wchar_t *textEng;
char *icon;
- TCHAR *text;
+ wchar_t *text;
}
static drawItems[] =
{
- { LPGENT("Message"), "pl_msg_allow" },
- { LPGENT("Presence (in)"), "pl_prin_allow" },
- { LPGENT("Presence (out)"), "pl_prout_allow" },
- { LPGENT("Query"), "pl_iq_allow" }
+ { LPGENW("Message"), "pl_msg_allow" },
+ { LPGENW("Presence (in)"), "pl_prin_allow" },
+ { LPGENW("Presence (out)"), "pl_prout_allow" },
+ { LPGENW("Query"), "pl_iq_allow" }
};
BOOL CJabberDlgPrivacyLists::OnWmDrawItem(UINT, WPARAM, LPARAM lParam)
@@ -988,7 +988,7 @@ void CJabberDlgPrivacyLists::ShowAdvancedList(CPrivacyList *pList)
CPrivacyListRule* pRule = pList->GetFirstRule();
while (pRule) {
bListEmpty = FALSE;
- TCHAR szTypeValue[ 512 ];
+ wchar_t szTypeValue[ 512 ];
switch (pRule->GetType()) {
case Jid:
mir_sntprintf(szTypeValue, L"If Jabber ID is '%s' then", pRule->GetValue());
@@ -1004,7 +1004,7 @@ void CJabberDlgPrivacyLists::ShowAdvancedList(CPrivacyList *pList)
break;
}
- TCHAR szPackets[ 512 ];
+ wchar_t szPackets[ 512 ];
szPackets[ 0 ] = '\0';
DWORD dwPackets = pRule->GetPackets();
@@ -1032,7 +1032,7 @@ void CJabberDlgPrivacyLists::ShowAdvancedList(CPrivacyList *pList)
}
}
- TCHAR szListItem[ 512 ];
+ wchar_t szListItem[ 512 ];
mir_sntprintf(szListItem, L"%s %s %s", szTypeValue, pRule->GetAction() ? L"allow" : L"deny", szPackets);
LRESULT nItemId = SendDlgItemMessage(m_hwnd, IDC_PL_RULES_LIST, LB_ADDSTRING, 0, (LPARAM)szListItem);
@@ -1050,7 +1050,7 @@ void CJabberDlgPrivacyLists::ShowAdvancedList(CPrivacyList *pList)
PostMessage(m_hwnd, WM_COMMAND, MAKEWPARAM(IDC_PL_RULES_LIST, LBN_SELCHANGE), 0);
}
-void CJabberDlgPrivacyLists::DrawNextRulePart(HDC hdc, COLORREF color, const TCHAR *text, RECT *rc)
+void CJabberDlgPrivacyLists::DrawNextRulePart(HDC hdc, COLORREF color, const wchar_t *text, RECT *rc)
{
SetTextColor(hdc, color);
DrawText(hdc, text, -1, rc, DT_LEFT|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER|DT_WORD_ELLIPSIS);
@@ -1134,7 +1134,7 @@ void CJabberDlgPrivacyLists::DrawRulesList(LPDRAWITEMSTRUCT lpdis)
rc.left += 25;
int len = SendDlgItemMessage(m_hwnd, lpdis->CtlID, LB_GETTEXTLEN, lpdis->itemID, 0) + 1;
- TCHAR *str = (TCHAR *)_alloca(len * sizeof(TCHAR));
+ wchar_t *str = (wchar_t *)_alloca(len * sizeof(wchar_t));
SendDlgItemMessage(m_hwnd, lpdis->CtlID, LB_GETTEXT, lpdis->itemID, (LPARAM)str);
DrawNextRulePart(lpdis->hDC, clLine1, str, &rc);
}
@@ -1158,7 +1158,7 @@ void CJabberDlgPrivacyLists::DrawRulesList(LPDRAWITEMSTRUCT lpdis)
DrawNextRulePart(lpdis->hDC, clLine2, TranslateT("'"), &rc);
if (MCONTACT hContact = m_proto->HContactFromJID(pRule->GetValue())) {
- TCHAR *szName = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *szName = pcli->pfnGetContactDisplayName(hContact, 0);
if (szName) {
DrawNextRulePart(lpdis->hDC, clLine2, TranslateT(" (nickname: "), &rc);
DrawNextRulePart(lpdis->hDC, clLine1, szName, &rc);
@@ -1228,10 +1228,10 @@ void CJabberDlgPrivacyLists::DrawLists(LPDRAWITEMSTRUCT lpdis)
SetBkMode(lpdis->hDC, TRANSPARENT);
- TCHAR *szDefault, *szActive;
+ wchar_t *szDefault, *szActive;
{ mir_cslock lck(m_proto->m_privacyListManager.m_cs);
- szDefault = NEWTSTR_ALLOCA(m_proto->m_privacyListManager.GetDefaultListName());
- szActive = NEWTSTR_ALLOCA(m_proto->m_privacyListManager.GetActiveListName());
+ szDefault = NEWWSTR_ALLOCA(m_proto->m_privacyListManager.GetDefaultListName());
+ szActive = NEWWSTR_ALLOCA(m_proto->m_privacyListManager.GetActiveListName());
}
RECT rc;
@@ -1240,7 +1240,7 @@ void CJabberDlgPrivacyLists::DrawLists(LPDRAWITEMSTRUCT lpdis)
bool bActive = false;
bool bDefault = false;
- TCHAR *szName;
+ wchar_t *szName;
if (!pList) {
if (!szActive) bActive = true;
@@ -1324,7 +1324,7 @@ void CJabberDlgPrivacyLists::CListSetupIcons(HWND, HANDLE hItem, int iSlot, DWOR
m_clcClist.SetExtraImage(hItem, iSlot, iSlot*2 + (bAction?1:2));
}
-HANDLE CJabberDlgPrivacyLists::CListAddContact(HWND hwndList, TCHAR *jid)
+HANDLE CJabberDlgPrivacyLists::CListAddContact(HWND hwndList, wchar_t *jid)
{
MCONTACT hContact = m_proto->HContactFromJID(jid);
if (hContact)
@@ -1445,7 +1445,7 @@ void CJabberDlgPrivacyLists::CListBuildList(HWND hwndList, CPrivacyList *pList)
DWORD dwPackets = 0;
HANDLE hItem;
- TCHAR *szJid = NULL;
+ wchar_t *szJid = NULL;
pList->RemoveAllRules();
@@ -1474,7 +1474,7 @@ void CJabberDlgPrivacyLists::CListBuildList(HWND hwndList, CPrivacyList *pList)
}
// group handles start with 1 (0 is "root")
- TCHAR *grpName;
+ wchar_t *grpName;
for (MGROUP iGroup = 1; (grpName = Clist_GroupGetName(iGroup, NULL)) != NULL; iGroup++) {
hItem = m_clcClist.FindGroup(iGroup);
if (dwPackets = CListGetPackets(hwndList, hItem, true))
@@ -1635,7 +1635,7 @@ void CJabberDlgPrivacyLists::btnAdvanced_OnClick(CCtrlButton *)
void CJabberDlgPrivacyLists::btnAddJid_OnClick(CCtrlButton *)
{
int len = GetWindowTextLength(GetDlgItem(m_hwnd, IDC_NEWJID))+1;
- TCHAR *buf = (TCHAR *)_alloca(sizeof(TCHAR) * len);
+ wchar_t *buf = (wchar_t *)_alloca(sizeof(wchar_t) * len);
GetDlgItemText(m_hwnd, IDC_NEWJID, buf, len);
SetDlgItemText(m_hwnd, IDC_NEWJID, L"");
CListAddContact(GetDlgItem(m_hwnd, IDC_CLIST), buf);
@@ -1663,7 +1663,7 @@ void CJabberDlgPrivacyLists::btnActivate_OnClick(CCtrlButton *)
active << XATTR(L"name", pList->GetListName());
lck.unlock();
- SetStatusText(TranslateT(JABBER_PL_BUSY_MSG));
+ SetStatusText(TranslateTS(JABBER_PL_BUSY_MSG));
m_proto->m_ThreadInfo->send(iq);
}
@@ -1690,7 +1690,7 @@ void CJabberDlgPrivacyLists::btnSetDefault_OnClick(CCtrlButton *)
XmlAddAttr(defaultTag, L"name", pList->GetListName());
lck.unlock();
- SetStatusText(TranslateT(JABBER_PL_BUSY_MSG));
+ SetStatusText(TranslateTS(JABBER_PL_BUSY_MSG));
m_proto->m_ThreadInfo->send(iq);
}
@@ -1869,7 +1869,7 @@ void CJabberDlgPrivacyLists::btnRemoveList_OnClick(CCtrlButton *)
CPrivacyList *pList = GetSelectedList(m_hwnd);
if (pList) {
- TCHAR *szListName = pList->GetListName();
+ wchar_t *szListName = pList->GetListName();
if ((m_proto->m_privacyListManager.GetActiveListName() && !mir_tstrcmp(szListName, m_proto->m_privacyListManager.GetActiveListName())) ||
(m_proto->m_privacyListManager.GetDefaultListName() && !mir_tstrcmp(szListName, m_proto->m_privacyListManager.GetDefaultListName())))
{
@@ -1958,7 +1958,7 @@ void CJabberDlgPrivacyLists::btnApply_OnClick(CCtrlButton *)
pList = pList->GetNext();
} }
- SetStatusText(TranslateT(JABBER_PL_BUSY_MSG));
+ SetStatusText(TranslateTS(JABBER_PL_BUSY_MSG));
PostMessage(m_hwnd, WM_JABBER_REFRESH, 0, 0);
}
@@ -2103,7 +2103,7 @@ void CJabberProto::BuildPrivacyMenu()
mi.position = 3000040000;
mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR;
mi.hIcolibItem = GetIconHandle(IDI_PRIVACY_LISTS);
- mi.name.t = LPGENT("List Editor...");
+ mi.name.w = LPGENW("List Editor...");
mi.root = m_hPrivacyMenuRoot;
Menu_AddProtoMenuItem(&mi, m_szModuleName);
}
@@ -2134,7 +2134,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld)
}
mi.position++;
mi.hIcolibItem = Skin_GetIconHandle(m_privacyListManager.GetActiveListName() ? SKINICON_OTHER_SMALLDOT : SKINICON_OTHER_EMPTYBLOB);
- mi.name.t = LPGENT("<none>");
+ mi.name.w = LPGENW("<none>");
m_hPrivacyMenuItems.insert(Menu_AddProtoMenuItem(&mi, m_szModuleName));
for (CPrivacyList *pList = m_privacyListManager.GetFirstList(); pList; pList = pList->GetNext()) {
@@ -2149,7 +2149,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld)
mi.position++;
mi.hIcolibItem = Skin_GetIconHandle(
mir_tstrcmp(m_privacyListManager.GetActiveListName(), pList->GetListName()) ? SKINICON_OTHER_SMALLDOT : SKINICON_OTHER_EMPTYBLOB);
- mi.name.t = pList->GetListName();
+ mi.name.w = pList->GetListName();
m_hPrivacyMenuItems.insert(Menu_AddProtoMenuItem(&mi, m_szModuleName));
}
}
diff --git a/protocols/JabberG/src/jabber_privacy.h b/protocols/JabberG/src/jabber_privacy.h
index 6f48cebd11..67b8ce7e33 100644
--- a/protocols/JabberG/src/jabber_privacy.h
+++ b/protocols/JabberG/src/jabber_privacy.h
@@ -58,7 +58,7 @@ class CPrivacyListRule
protected:
friend class CPrivacyList;
public:
- CPrivacyListRule(CJabberProto *ppro, PrivacyListRuleType type = Else, const TCHAR *szValue = L"", BOOL bAction = TRUE, DWORD dwOrder = 90, DWORD dwPackets = 0)
+ CPrivacyListRule(CJabberProto *ppro, PrivacyListRuleType type = Else, const wchar_t *szValue = L"", BOOL bAction = TRUE, DWORD dwOrder = 90, DWORD dwPackets = 0)
{
m_proto = ppro;
m_szValue = mir_tstrdup(szValue);
@@ -103,11 +103,11 @@ public:
m_nType = type;
return TRUE;
}
- __inline TCHAR* GetValue()
+ __inline wchar_t* GetValue()
{
return m_szValue;
}
- __inline BOOL SetValue(TCHAR *szValue)
+ __inline BOOL SetValue(wchar_t *szValue)
{
replaceStrT(m_szValue, szValue);
return TRUE;
@@ -133,7 +133,7 @@ public:
CJabberProto* m_proto;
protected:
PrivacyListRuleType m_nType;
- TCHAR *m_szValue;
+ wchar_t *m_szValue;
BOOL m_bAction;
DWORD m_dwOrder;
DWORD m_dwPackets;
@@ -145,7 +145,7 @@ class CPrivacyList
{
protected:
CPrivacyListRule *m_pRules;
- TCHAR *m_szListName;
+ wchar_t *m_szListName;
CPrivacyList *m_pNext;
BOOL m_bLoaded;
BOOL m_bModified;
@@ -153,7 +153,7 @@ protected:
public:
CJabberProto* m_proto;
- CPrivacyList(CJabberProto *ppro, TCHAR *szListName)
+ CPrivacyList(CJabberProto *ppro, wchar_t *szListName)
{
m_proto = ppro;
m_szListName = mir_tstrdup(szListName);
@@ -177,7 +177,7 @@ public:
m_pRules = NULL;
return TRUE;
}
- __inline TCHAR* GetListName()
+ __inline wchar_t* GetListName()
{
return m_szListName;
}
@@ -195,7 +195,7 @@ public:
m_pNext = pNext;
return pRetVal;
}
- BOOL AddRule(PrivacyListRuleType type, const TCHAR *szValue, BOOL bAction, DWORD dwOrder, DWORD dwPackets)
+ BOOL AddRule(PrivacyListRuleType type, const wchar_t *szValue, BOOL bAction, DWORD dwOrder, DWORD dwPackets)
{
CPrivacyListRule *pRule = new CPrivacyListRule(m_proto, type, szValue, bAction, dwOrder, dwPackets);
if (!pRule)
@@ -319,8 +319,8 @@ public:
class CPrivacyListManager
{
protected:
- TCHAR *m_szActiveListName;
- TCHAR *m_szDefaultListName;
+ wchar_t *m_szActiveListName;
+ wchar_t *m_szDefaultListName;
CPrivacyList *m_pLists;
BOOL m_bModified;
@@ -342,19 +342,19 @@ public:
mir_free(m_szDefaultListName);
RemoveAllLists();
};
- void SetActiveListName(const TCHAR *szListName)
+ void SetActiveListName(const wchar_t *szListName)
{
replaceStrT(m_szActiveListName, szListName);
}
- void SetDefaultListName(const TCHAR *szListName)
+ void SetDefaultListName(const wchar_t *szListName)
{
replaceStrT(m_szDefaultListName, szListName);
}
- TCHAR* GetDefaultListName()
+ wchar_t* GetDefaultListName()
{
return m_szDefaultListName;
}
- TCHAR* GetActiveListName()
+ wchar_t* GetActiveListName()
{
return m_szActiveListName;
}
@@ -365,7 +365,7 @@ public:
m_pLists = NULL;
return TRUE;
}
- CPrivacyList* FindList(const TCHAR *szListName)
+ CPrivacyList* FindList(const wchar_t *szListName)
{
CPrivacyList *pList = m_pLists;
while (pList) {
@@ -379,7 +379,7 @@ public:
{
return m_pLists;
}
- BOOL AddList(TCHAR *szListName)
+ BOOL AddList(wchar_t *szListName)
{
if (FindList(szListName))
return FALSE;
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 96bbe0c424..2f847dd408 100755
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#pragma warning(disable:4355)
-static int compareTransports(const TCHAR *p1, const TCHAR *p2)
+static int compareTransports(const wchar_t *p1, const wchar_t *p2)
{
return mir_tstrcmpi(p1, p2);
}
@@ -46,13 +46,13 @@ static int compareListItems(const JABBER_LIST_ITEM *p1, const JABBER_LIST_ITEM *
|| (p1->list == LIST_BOOKMARK) || (p1->list == LIST_VCARD_TEMP))
return mir_tstrcmpi(p1->jid, p2->jid);
- TCHAR szp1[JABBER_MAX_JID_LEN], szp2[JABBER_MAX_JID_LEN];
+ wchar_t szp1[JABBER_MAX_JID_LEN], szp2[JABBER_MAX_JID_LEN];
JabberStripJid(p1->jid, szp1, _countof(szp1));
JabberStripJid(p2->jid, szp2, _countof(szp2));
return mir_tstrcmpi(szp1, szp2);
}
-CJabberProto::CJabberProto(const char *aProtoName, const TCHAR *aUserName) :
+CJabberProto::CJabberProto(const char *aProtoName, const wchar_t *aUserName) :
PROTO<CJabberProto>(aProtoName, aUserName),
m_options(this),
m_lstTransports(50, compareTransports),
@@ -246,7 +246,7 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM)
if (jid == NULL)
continue;
- TCHAR *resourcepos = _tcschr(jid, '/');
+ wchar_t *resourcepos = wcschr(jid, '/');
if (resourcepos != NULL)
*resourcepos = '\0';
@@ -295,7 +295,7 @@ int __cdecl CJabberProto::OnPreShutdown(WPARAM, LPARAM)
////////////////////////////////////////////////////////////////////////////////////////
// JabberAddToList - adds a contact to the contact list
-MCONTACT CJabberProto::AddToListByJID(const TCHAR *newJid, DWORD flags)
+MCONTACT CJabberProto::AddToListByJID(const wchar_t *newJid, DWORD flags)
{
debugLog(L"AddToListByJID jid = %s", newJid);
@@ -308,10 +308,10 @@ MCONTACT CJabberProto::AddToListByJID(const TCHAR *newJid, DWORD flags)
MCONTACT CJabberProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
{
- if (psr->cbSize != sizeof(PROTOSEARCHRESULT) && psr->id.t == NULL)
+ if (psr->cbSize != sizeof(PROTOSEARCHRESULT) && psr->id.w == NULL)
return NULL;
- return AddToListByJID(psr->id.t, flags);
+ return AddToListByJID(psr->id.w, flags);
}
MCONTACT __cdecl CJabberProto::AddToListByEvent(int flags, int /*iContact*/, MEVENT hDbEvent)
@@ -340,7 +340,7 @@ MCONTACT __cdecl CJabberProto::AddToListByEvent(int flags, int /*iContact*/, MEV
char *lastName = firstName + mir_strlen(firstName) + 1;
char *jid = lastName + mir_strlen(lastName) + 1;
- TCHAR *newJid = (dbei.flags & DBEF_UTF) ? mir_utf8decodeT(jid) : mir_a2t(jid);
+ wchar_t *newJid = (dbei.flags & DBEF_UTF) ? mir_utf8decodeT(jid) : mir_a2t(jid);
MCONTACT hContact = (MCONTACT)AddToListByJID(newJid, flags);
mir_free(newJid);
return hContact;
@@ -373,7 +373,7 @@ int CJabberProto::Authorize(MEVENT hDbEvent)
debugLog(L"Send 'authorization allowed' to %s", jid);
- TCHAR *newJid = (dbei.flags & DBEF_UTF) ? mir_utf8decodeT(jid) : mir_a2t(jid);
+ wchar_t *newJid = (dbei.flags & DBEF_UTF) ? mir_utf8decodeT(jid) : mir_a2t(jid);
m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", newJid) << XATTR(L"type", L"subscribed"));
@@ -398,7 +398,7 @@ int CJabberProto::Authorize(MEVENT hDbEvent)
////////////////////////////////////////////////////////////////////////////////////////
// JabberAuthDeny - handles the unsuccessful authorization
-int CJabberProto::AuthDeny(MEVENT hDbEvent, const TCHAR*)
+int CJabberProto::AuthDeny(MEVENT hDbEvent, const wchar_t*)
{
if (!m_bJabberOnline)
return 1;
@@ -437,7 +437,7 @@ int CJabberProto::AuthDeny(MEVENT hDbEvent, const TCHAR*)
////////////////////////////////////////////////////////////////////////////////////////
// JabberFileAllow - starts a file transfer
-HANDLE __cdecl CJabberProto::FileAllow(MCONTACT /*hContact*/, HANDLE hTransfer, const TCHAR *szPath)
+HANDLE __cdecl CJabberProto::FileAllow(MCONTACT /*hContact*/, HANDLE hTransfer, const wchar_t *szPath)
{
if (!m_bJabberOnline)
return 0;
@@ -493,7 +493,7 @@ int __cdecl CJabberProto::FileCancel(MCONTACT, HANDLE hTransfer)
////////////////////////////////////////////////////////////////////////////////////////
// JabberFileDeny - denies a file transfer
-int __cdecl CJabberProto::FileDeny(MCONTACT, HANDLE hTransfer, const TCHAR *)
+int __cdecl CJabberProto::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t *)
{
if (!m_bJabberOnline)
return 1;
@@ -521,7 +521,7 @@ int __cdecl CJabberProto::FileDeny(MCONTACT, HANDLE hTransfer, const TCHAR *)
////////////////////////////////////////////////////////////////////////////////////////
// JabberFileResume - processes file renaming etc
-int __cdecl CJabberProto::FileResume(HANDLE hTransfer, int *action, const TCHAR **szFilename)
+int __cdecl CJabberProto::FileResume(HANDLE hTransfer, int *action, const wchar_t **szFilename)
{
filetransfer *ft = (filetransfer*)hTransfer;
if (!m_bJabberOnline || ft == NULL)
@@ -553,7 +553,7 @@ DWORD_PTR __cdecl CJabberProto::GetCaps(int type, MCONTACT hContact)
case PFLAG_UNIQUEIDSETTING:
return (DWORD_PTR)"jid";
case PFLAG_MAXCONTACTSPERPACKET:
- TCHAR szClientJid[JABBER_MAX_JID_LEN];
+ wchar_t szClientJid[JABBER_MAX_JID_LEN];
if (GetClientJID(hContact, szClientJid, _countof(szClientJid))) {
JabberCapsBits jcb = GetResourceCapabilites(szClientJid, TRUE);
return ((~jcb & JABBER_CAPS_ROSTER_EXCHANGE) ? 0 : 50);
@@ -570,7 +570,7 @@ int __cdecl CJabberProto::GetInfo(MCONTACT hContact, int /*infoType*/)
if (!m_bJabberOnline || isChatRoom(hContact))
return 1;
- TCHAR jid[JABBER_MAX_JID_LEN], szBareJid[JABBER_MAX_JID_LEN];
+ wchar_t jid[JABBER_MAX_JID_LEN], szBareJid[JABBER_MAX_JID_LEN];
if (!GetClientJID(hContact, jid, _countof(jid)))
return 1;
@@ -609,7 +609,7 @@ int __cdecl CJabberProto::GetInfo(MCONTACT hContact, int /*infoType*/)
if (item->arResources.getCount()) {
for (int i = 0; i < item->arResources.getCount(); i++) {
pResourceStatus r(item->arResources[i]);
- TCHAR tmp[JABBER_MAX_JID_LEN];
+ wchar_t tmp[JABBER_MAX_JID_LEN];
mir_sntprintf(tmp, L"%s/%s", szBareJid, r->m_tszResourceName);
if (r->m_jcbCachedCaps & JABBER_CAPS_DISCO_INFO) {
@@ -649,7 +649,7 @@ int __cdecl CJabberProto::GetInfo(MCONTACT hContact, int /*infoType*/)
struct JABBER_SEARCH_BASIC
{
int hSearch;
- TCHAR jid[128];
+ wchar_t jid[128];
};
void __cdecl CJabberProto::BasicSearchThread(JABBER_SEARCH_BASIC *jsb)
@@ -660,17 +660,17 @@ void __cdecl CJabberProto::BasicSearchThread(JABBER_SEARCH_BASIC *jsb)
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
psr.flags = PSR_TCHAR;
- psr.nick.t = jsb->jid;
- psr.firstName.t = L"";
- psr.lastName.t = L"";
- psr.id.t = jsb->jid;
+ psr.nick.w = jsb->jid;
+ psr.firstName.w = L"";
+ psr.lastName.w = L"";
+ psr.id.w = jsb->jid;
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)jsb->hSearch, (LPARAM)&psr);
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)jsb->hSearch, 0);
mir_free(jsb);
}
-HANDLE __cdecl CJabberProto::SearchBasic(const TCHAR *szJid)
+HANDLE __cdecl CJabberProto::SearchBasic(const wchar_t *szJid)
{
debugLog(L"JabberBasicSearch called with lParam = '%s'", szJid);
@@ -678,12 +678,12 @@ HANDLE __cdecl CJabberProto::SearchBasic(const TCHAR *szJid)
if (!m_bJabberOnline || (jsb = (JABBER_SEARCH_BASIC*)mir_alloc(sizeof(JABBER_SEARCH_BASIC))) == NULL)
return 0;
- if (_tcschr(szJid, '@') == NULL) {
- TCHAR *szServer = mir_a2t(m_ThreadInfo->conn.server);
- const TCHAR *p = _tcsstr(szJid, szServer);
+ if (wcschr(szJid, '@') == NULL) {
+ wchar_t *szServer = mir_a2t(m_ThreadInfo->conn.server);
+ const wchar_t *p = wcsstr(szJid, szServer);
if (p == NULL) {
bool numericjid = true;
- for (const TCHAR *i = szJid; *i && numericjid; i++)
+ for (const wchar_t *i = szJid; *i && numericjid; i++)
numericjid = (*i >= '0') && (*i <= '9');
mir_free(szServer);
@@ -696,10 +696,10 @@ HANDLE __cdecl CJabberProto::SearchBasic(const TCHAR *szJid)
}
mir_sntprintf(jsb->jid, L"%s@%s", szJid, szServer);
}
- else _tcsncpy_s(jsb->jid, szJid, _TRUNCATE);
+ else wcsncpy_s(jsb->jid, szJid, _TRUNCATE);
mir_free(szServer);
}
- else _tcsncpy_s(jsb->jid, szJid, _TRUNCATE);
+ else wcsncpy_s(jsb->jid, szJid, _TRUNCATE);
debugLog(L"Adding '%s' without validation", jsb->jid);
jsb->hSearch = SerialNext();
@@ -710,7 +710,7 @@ HANDLE __cdecl CJabberProto::SearchBasic(const TCHAR *szJid)
////////////////////////////////////////////////////////////////////////////////////////
// SearchByEmail - searches the contact by its e-mail
-HANDLE __cdecl CJabberProto::SearchByEmail(const TCHAR *email)
+HANDLE __cdecl CJabberProto::SearchByEmail(const wchar_t *email)
{
if (!m_bJabberOnline || email == NULL)
return 0;
@@ -726,7 +726,7 @@ HANDLE __cdecl CJabberProto::SearchByEmail(const TCHAR *email)
////////////////////////////////////////////////////////////////////////////////////////
// JabberSearchByName - searches the contact by its first or last name, or by a nickname
-HANDLE __cdecl CJabberProto::SearchByName(const TCHAR *nick, const TCHAR *firstName, const TCHAR *lastName)
+HANDLE __cdecl CJabberProto::SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName)
{
if (!m_bJabberOnline)
return NULL;
@@ -790,7 +790,7 @@ int __cdecl CJabberProto::SendContacts(MCONTACT hContact, int, int nContacts, MC
if (!m_bJabberOnline)
return 0;
- TCHAR szClientJid[JABBER_MAX_JID_LEN];
+ wchar_t szClientJid[JABBER_MAX_JID_LEN];
if (!GetClientJID(hContact, szClientJid, _countof(szClientJid)))
return 0;
@@ -815,7 +815,7 @@ int __cdecl CJabberProto::SendContacts(MCONTACT hContact, int, int nContacts, MC
////////////////////////////////////////////////////////////////////////////////////////
// SendFile - sends a file
-HANDLE __cdecl CJabberProto::SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR** ppszFiles)
+HANDLE __cdecl CJabberProto::SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t** ppszFiles)
{
if (!m_bJabberOnline) return 0;
@@ -867,12 +867,12 @@ HANDLE __cdecl CJabberProto::SendFile(MCONTACT hContact, const TCHAR *szDescript
while (ppszFiles[ft->std.totalFiles] != NULL)
ft->std.totalFiles++;
- ft->std.ptszFiles = (TCHAR**)mir_calloc(sizeof(TCHAR*)* ft->std.totalFiles);
+ ft->std.ptszFiles = (wchar_t**)mir_calloc(sizeof(wchar_t*)* ft->std.totalFiles);
ft->fileSize = (unsigned __int64*)mir_calloc(sizeof(unsigned __int64)* ft->std.totalFiles);
int i, j;
for (i = j = 0; i < ft->std.totalFiles; i++) {
- if (_tstati64(ppszFiles[i], &statbuf))
+ if (_wstat64(ppszFiles[i], &statbuf))
debugLog(L"'%s' is an invalid filename", ppszFiles[i]);
else {
ft->std.ptszFiles[j] = mir_tstrdup(ppszFiles[i]);
@@ -928,7 +928,7 @@ static char PGP_EPILOG[] = "\r\n-----END PGP MESSAGE-----\r\n";
int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int, const char* pszSrc)
{
- TCHAR szClientJid[JABBER_MAX_JID_LEN];
+ wchar_t szClientJid[JABBER_MAX_JID_LEN];
if (!m_bJabberOnline || !GetClientJID(hContact, szClientJid, _countof(szClientJid))) {
TFakeAckParams *param = new TFakeAckParams(hContact, Translate("Protocol is offline or no JID"));
ForkThread(&CJabberProto::SendMessageAckThread, param);
@@ -947,13 +947,13 @@ int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int, const char* pszSrc)
}
else isEncrypted = 0;
- TCHAR *msg;
+ wchar_t *msg;
mir_utf8decode(NEWSTR_ALLOCA(pszSrc), &msg);
if (msg == NULL)
return 0;
- TCHAR *msgType;
- if (ListGetItemPtr(LIST_CHATROOM, szClientJid) && _tcschr(szClientJid, '/') == NULL)
+ wchar_t *msgType;
+ if (ListGetItemPtr(LIST_CHATROOM, szClientJid) && wcschr(szClientJid, '/') == NULL)
msgType = L"groupchat";
else
msgType = L"chat";
@@ -1119,7 +1119,7 @@ void __cdecl CJabberProto::GetAwayMsgThread(void *param)
}
}
- TCHAR *str = (TCHAR*)alloca(sizeof(TCHAR)*(len + 1));
+ wchar_t *str = (wchar_t*)alloca(sizeof(wchar_t)*(len + 1));
str[0] = str[len] = '\0';
for (int i = 0; i < item->arResources.getCount(); i++) {
JABBER_RESOURCE_STATUS *r = item->arResources[i];
@@ -1138,7 +1138,7 @@ void __cdecl CJabberProto::GetAwayMsgThread(void *param)
return;
}
- TCHAR *tszStatusMsg = item->getTemp()->m_tszStatusMessage;
+ wchar_t *tszStatusMsg = item->getTemp()->m_tszStatusMessage;
if (tszStatusMsg != NULL) {
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)tszStatusMsg);
return;
@@ -1160,11 +1160,11 @@ HANDLE __cdecl CJabberProto::GetAwayMsg(MCONTACT hContact)
////////////////////////////////////////////////////////////////////////////////////////
// JabberSetAwayMsg - sets the away status message
-int __cdecl CJabberProto::SetAwayMsg(int status, const TCHAR *msg)
+int __cdecl CJabberProto::SetAwayMsg(int status, const wchar_t *msg)
{
debugLog(L"SetAwayMsg called, wParam=%d lParam=%s", status, msg);
- TCHAR **szMsg;
+ wchar_t **szMsg;
mir_cslockfull lck(m_csModeMsgMutex);
switch (status) {
@@ -1217,7 +1217,7 @@ int __cdecl CJabberProto::UserIsTyping(MCONTACT hContact, int type)
{
if (!m_bJabberOnline) return 0;
- TCHAR szClientJid[JABBER_MAX_JID_LEN];
+ wchar_t szClientJid[JABBER_MAX_JID_LEN];
if (!GetClientJID(hContact, szClientJid, _countof(szClientJid)))
return 0;
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h
index a594a451a4..d1ee6abe76 100644
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -42,7 +42,7 @@ struct CJabberProto;
enum TJabberGcLogInfoType { INFO_BAN, INFO_STATUS, INFO_CONFIG, INFO_AFFILIATION, INFO_ROLE };
-typedef UNIQUE_MAP<TCHAR,TCharKeyCmp> U_TCHAR_MAP;
+typedef UNIQUE_MAP<wchar_t,TCharKeyCmp> U_TCHAR_MAP;
#define JABBER_DEFAULT_RECENT_COUNT 10
@@ -62,12 +62,12 @@ struct TFilterInfo
volatile Type type;
mir_cs csPatternLock;
- TCHAR pattern[256];
+ wchar_t pattern[256];
};
struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
{
- CJabberProto(const char*, const TCHAR*);
+ CJabberProto(const char*, const wchar_t*);
~CJabberProto();
//====================================================================================
@@ -78,33 +78,33 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent);
virtual int __cdecl Authorize(MEVENT hDbEvent);
- virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR *szReason);
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t *szReason);
- virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath);
+ virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath);
virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason);
- virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename);
+ virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szReason);
+ virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename);
virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
virtual int __cdecl GetInfo(MCONTACT hContact, int infoType);
- virtual HANDLE __cdecl SearchBasic(const TCHAR *id);
- virtual HANDLE __cdecl SearchByEmail(const TCHAR *email);
- virtual HANDLE __cdecl SearchByName(const TCHAR *nick, const TCHAR *firstName, const TCHAR *lastName);
+ virtual HANDLE __cdecl SearchBasic(const wchar_t *id);
+ virtual HANDLE __cdecl SearchByEmail(const wchar_t *email);
+ virtual HANDLE __cdecl SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName);
virtual HWND __cdecl SearchAdvanced(HWND owner);
virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*);
virtual int __cdecl SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList);
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles);
+ virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles);
virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char *msg);
virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode);
virtual int __cdecl SetStatus(int iNewStatus);
virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
- virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg);
+ virtual int __cdecl SetAwayMsg(int m_iStatus, const wchar_t *msg);
virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
@@ -144,12 +144,12 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
HANDLE m_hThreadHandle;
- TCHAR *m_szJabberJID;
+ wchar_t *m_szJabberJID;
int m_nJabberSearchID;
time_t m_tmJabberLoggedInTime;
time_t m_tmJabberIdleStartTime;
UINT m_nJabberCodePage;
- TCHAR *m_tszSelectedLang;
+ wchar_t *m_tszSelectedLang;
mir_cs m_csModeMsgMutex;
JABBER_MODEMSGS m_modeMsgs;
@@ -183,7 +183,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
HANDLE m_hEventXStatusChanged;
// Transports list
- LIST<TCHAR> m_lstTransports;
+ LIST<wchar_t> m_lstTransports;
CJabberIqManager m_iqManager;
CJabberMessageManager m_messageManager;
@@ -261,10 +261,10 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void OnIqResult_ListOfCommands(HXML iqNode, CJabberIqInfo*);
void OnIqResult_CommandExecution(HXML iqNode, CJabberIqInfo*);
- void AdHoc_RequestListOfCommands(TCHAR * szResponder, HWND hwndDlg);
- int AdHoc_ExecuteCommand(HWND hwndDlg, TCHAR * jid, struct JabberAdHocData* dat);
- int AdHoc_SubmitCommandForm(HWND hwndDlg, JabberAdHocData * dat, TCHAR* action);
- int AdHoc_AddCommandRadio(HWND hFrame, TCHAR * labelStr, int id, int ypos, int value);
+ void AdHoc_RequestListOfCommands(wchar_t * szResponder, HWND hwndDlg);
+ int AdHoc_ExecuteCommand(HWND hwndDlg, wchar_t * jid, struct JabberAdHocData* dat);
+ int AdHoc_SubmitCommandForm(HWND hwndDlg, JabberAdHocData * dat, wchar_t* action);
+ int AdHoc_AddCommandRadio(HWND hFrame, wchar_t * labelStr, int id, int ypos, int value);
int AdHoc_OnJAHMCommandListResult(HWND hwndDlg, HXML iqNode, JabberAdHocData* dat);
int AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberAdHocData* dat);
@@ -289,7 +289,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void CJabberProto::ProcessIncomingNote(CNoteItem *pNote, bool ok);
void CJabberProto::ProcessOutgoingNote(CNoteItem *pNote, bool ok);
- bool CJabberProto::OnIncomingNote(const TCHAR *szFrom, HXML hXml);
+ bool CJabberProto::OnIncomingNote(const wchar_t *szFrom, HXML hXml);
INT_PTR __cdecl CJabberProto::OnMenuSendNote(WPARAM, LPARAM);
INT_PTR __cdecl CJabberProto::OnMenuHandleNotes(WPARAM, LPARAM);
@@ -310,31 +310,31 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
//---- jabber_caps.cpp ---------------------------------------------------------------
- JabberCapsBits GetTotalJidCapabilites(const TCHAR *jid);
- JabberCapsBits GetResourceCapabilites(const TCHAR *jid, BOOL appendBestResource);
+ JabberCapsBits GetTotalJidCapabilites(const wchar_t *jid);
+ JabberCapsBits GetResourceCapabilites(const wchar_t *jid, BOOL appendBestResource);
//---- jabber_captcha.cpp ------------------------------------------------------------
- void sendCaptchaResult(TCHAR* buf, ThreadData *info, LPCTSTR from, LPCTSTR challenge, LPCTSTR fromjid, LPCTSTR sid);
+ void sendCaptchaResult(wchar_t* buf, ThreadData *info, LPCTSTR from, LPCTSTR challenge, LPCTSTR fromjid, LPCTSTR sid);
void sendCaptchaError(ThreadData *info, LPCTSTR from, LPCTSTR to, LPCTSTR challenge);
//---- jabber_chat.cpp ---------------------------------------------------------------
int GcInit(JABBER_LIST_ITEM *item);
- void GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const TCHAR *resource, const TCHAR *nick, const TCHAR *jid, int action, HXML reason, int nStatusCode = -1);
+ void GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const wchar_t *resource, const wchar_t *nick, const wchar_t *jid, int action, HXML reason, int nStatusCode = -1);
void GcLogShowInformation(JABBER_LIST_ITEM *item, pResourceStatus &user, TJabberGcLogInfoType type);
void GcQuit(JABBER_LIST_ITEM* jid, int code, HXML reason);
void FilterList(HWND hwndList);
void ResetListOptions(HWND hwndList);
- void InviteUser(TCHAR *room, TCHAR *pUser, TCHAR *text);
+ void InviteUser(wchar_t *room, wchar_t *pUser, wchar_t *text);
- void AdminSet(const TCHAR *to, const TCHAR *ns, const TCHAR *szItem, const TCHAR *itemVal, const TCHAR *var, const TCHAR *varVal);
- void AdminGet(const TCHAR *to, const TCHAR *ns, const TCHAR *var, const TCHAR *varVal, JABBER_IQ_HANDLER foo);
- void AdminSetReason(const TCHAR *to, const TCHAR *ns, const TCHAR *szItem, const TCHAR *itemVal, const TCHAR *var, const TCHAR *varVal, const TCHAR *rsn);
- void AddMucListItem(JABBER_MUC_JIDLIST_INFO* jidListInfo, const TCHAR* str);
- void AddMucListItem(JABBER_MUC_JIDLIST_INFO* jidListInfo, const TCHAR* str, const TCHAR* rsn);
- void DeleteMucListItem(JABBER_MUC_JIDLIST_INFO* jidListInfo, const TCHAR* jid);
+ void AdminSet(const wchar_t *to, const wchar_t *ns, const wchar_t *szItem, const wchar_t *itemVal, const wchar_t *var, const wchar_t *varVal);
+ void AdminGet(const wchar_t *to, const wchar_t *ns, const wchar_t *var, const wchar_t *varVal, JABBER_IQ_HANDLER foo);
+ void AdminSetReason(const wchar_t *to, const wchar_t *ns, const wchar_t *szItem, const wchar_t *itemVal, const wchar_t *var, const wchar_t *varVal, const wchar_t *rsn);
+ void AddMucListItem(JABBER_MUC_JIDLIST_INFO* jidListInfo, const wchar_t* str);
+ void AddMucListItem(JABBER_MUC_JIDLIST_INFO* jidListInfo, const wchar_t* str, const wchar_t* rsn);
+ void DeleteMucListItem(JABBER_MUC_JIDLIST_INFO* jidListInfo, const wchar_t* jid);
//---- jabber_console.cpp ------------------------------------------------------------
@@ -349,7 +349,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
//---- jabber_disco.cpp --------------------------------------------------------------
- void LaunchServiceDiscovery(TCHAR *jid);
+ void LaunchServiceDiscovery(wchar_t *jid);
INT_PTR __cdecl OnMenuHandleServiceDiscovery(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl OnMenuHandleServiceDiscoveryMyTransports(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl OnMenuHandleServiceDiscoveryTransports(WPARAM wParam, LPARAM lParam);
@@ -368,12 +368,12 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
BOOL SyncTree(HTREELISTITEM hIndex, CJabberSDNode *pNode);
void ServiceDiscoveryShowMenu(CJabberSDNode *node, HTREELISTITEM hItem, POINT pt);
- int SetupServiceDiscoveryDlg(TCHAR* jid);
+ int SetupServiceDiscoveryDlg(wchar_t* jid);
void OnIqResultCapsDiscoInfo(HXML iqNode, CJabberIqInfo *pInfo);
void OnIqResultCapsDiscoInfoSI(HXML iqNode, CJabberIqInfo *pInfo);
- void RegisterAgent(HWND hwndDlg, TCHAR* jid);
+ void RegisterAgent(HWND hwndDlg, wchar_t* jid);
//---- jabber_file.cpp ---------------------------------------------------------------
@@ -382,14 +382,14 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void UpdateChatUserStatus(wchar_t* chat_jid, wchar_t* jid, wchar_t* nick, int role, int affil, int status, BOOL update_nick);
- void GroupchatJoinRoomByJid(HWND hwndParent, TCHAR *jid);
+ void GroupchatJoinRoomByJid(HWND hwndParent, wchar_t *jid);
- void RenameParticipantNick(JABBER_LIST_ITEM *item, const TCHAR *oldNick, HXML itemNode);
- void AcceptGroupchatInvite(const TCHAR *roomJid, const TCHAR *reason, const TCHAR *password);
+ void RenameParticipantNick(JABBER_LIST_ITEM *item, const wchar_t *oldNick, HXML itemNode);
+ void AcceptGroupchatInvite(const wchar_t *roomJid, const wchar_t *reason, const wchar_t *password);
//---- jabber_form.c -----------------------------------------------------------------
- void FormCreateDialog(HXML xNode, TCHAR* defTitle, JABBER_FORM_SUBMIT_FUNC pfnSubmit, void *userdata);
+ void FormCreateDialog(HXML xNode, wchar_t* defTitle, JABBER_FORM_SUBMIT_FUNC pfnSubmit, void *userdata);
//---- jabber_ft.c -------------------------------------------------------------------
@@ -397,7 +397,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void __cdecl FileServerThread(filetransfer *ft);
void FtCancel(filetransfer *ft);
- void FtInitiate(TCHAR* jid, filetransfer *ft);
+ void FtInitiate(wchar_t* jid, filetransfer *ft);
void FtHandleSiRequest(HXML iqNode);
void FtAcceptSiRequest(filetransfer *ft);
void FtAcceptIbbRequest(filetransfer *ft);
@@ -415,7 +415,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void GroupchatProcessPresence(HXML node);
void GroupchatProcessMessage(HXML node);
void GroupchatProcessInvite(LPCTSTR roomJid, LPCTSTR from, LPCTSTR reason, LPCTSTR password);
- void GroupchatJoinDlg(TCHAR* roomJid);
+ void GroupchatJoinDlg(wchar_t* roomJid);
void OnIqResultDiscovery(HXML iqNode, CJabberIqInfo *pInfo);
//---- jabber_icolib.cpp -------------------------------------------------------------
@@ -426,15 +426,15 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
HANDLE GetIconHandle(int iconId);
HICON LoadIconEx(const char* name, bool big = false);
int LoadAdvancedIcons(int iID);
- int GetTransportProtoID(TCHAR* TransportDomain);
+ int GetTransportProtoID(wchar_t* TransportDomain);
int GetTransportStatusIconIndex(int iID, int Status);
- BOOL DBCheckIsTransportedContact(const TCHAR *jid, MCONTACT hContact);
+ BOOL DBCheckIsTransportedContact(const wchar_t *jid, MCONTACT hContact);
void CheckAllContactsAreTransported(void);
INT_PTR __cdecl JGetAdvancedStatusIcon(WPARAM wParam, LPARAM lParam);
//---- jabber_iq.c -------------------------------------------------------------------
- __forceinline CJabberIqInfo* AddIQ(JABBER_IQ_HANDLER pHandler, int nIqType = JABBER_IQ_TYPE_GET, const TCHAR *szReceiver = NULL, DWORD dwParamsToParse = 0, int nIqId = -1, void *pUserData = NULL, int iPriority = JH_PRIORITY_DEFAULT)
+ __forceinline CJabberIqInfo* AddIQ(JABBER_IQ_HANDLER pHandler, int nIqType = JABBER_IQ_TYPE_GET, const wchar_t *szReceiver = NULL, DWORD dwParamsToParse = 0, int nIqId = -1, void *pUserData = NULL, int iPriority = JH_PRIORITY_DEFAULT)
{
return m_iqManager.AddHandler(pHandler, nIqType, szReceiver, dwParamsToParse, nIqId, pUserData, iPriority);
}
@@ -449,7 +449,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo *pInfo);
void OnIqResultGetClientAvatar(HXML iqNode, CJabberIqInfo *pInfo);
void OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo *pInfo);
- void OnIqResultGotAvatar(MCONTACT hContact, HXML n, const TCHAR *mimeType);
+ void OnIqResultGotAvatar(MCONTACT hContact, HXML n, const wchar_t *mimeType);
void OnIqResultGetMuc(HXML iqNode, CJabberIqInfo *pInfo);
void OnIqResultGetRegister(HXML iqNode, CJabberIqInfo *pInfo);
void OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo);
@@ -494,7 +494,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void OnIbbInitiateResult(HXML iqNode, CJabberIqInfo *pInfo);
void OnIbbCloseResult(HXML iqNode, CJabberIqInfo *pInfo);
BOOL OnFtHandleIbbIq(HXML iqNode, CJabberIqInfo *pInfo);
- BOOL OnIbbRecvdData(const TCHAR *data, const TCHAR *sid, const TCHAR *seq);
+ BOOL OnIbbRecvdData(const wchar_t *data, const wchar_t *sid, const wchar_t *seq);
void OnFtSiResult(HXML iqNode, CJabberIqInfo *pInfo);
BOOL FtIbbSend(int blocksize, filetransfer *ft);
@@ -516,23 +516,23 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
//---- jabber_list.cpp ---------------------------------------------------------------
- JABBER_LIST_ITEM* ListAdd(JABBER_LIST list, const TCHAR *jid, MCONTACT hContact = 0);
- JABBER_LIST_ITEM* ListGetItemPtr(JABBER_LIST list, const TCHAR *jid);
+ JABBER_LIST_ITEM* ListAdd(JABBER_LIST list, const wchar_t *jid, MCONTACT hContact = 0);
+ JABBER_LIST_ITEM* ListGetItemPtr(JABBER_LIST list, const wchar_t *jid);
JABBER_LIST_ITEM* ListGetItemPtrFromIndex(int index);
void ListInit(void);
void ListWipe(void);
- void ListRemove(JABBER_LIST list, const TCHAR *jid);
+ void ListRemove(JABBER_LIST list, const wchar_t *jid);
void ListRemoveList(JABBER_LIST list);
void ListRemoveByIndex(int index);
int ListFindNext(JABBER_LIST list, int fromOffset);
- pResourceStatus ListFindResource(JABBER_LIST list, const TCHAR *jid);
+ pResourceStatus ListFindResource(JABBER_LIST list, const wchar_t *jid);
- bool ListAddResource(JABBER_LIST list, const TCHAR *jid, int status, const TCHAR *statusMessage, char priority = 0, const TCHAR *nick = NULL);
- void ListRemoveResource(JABBER_LIST list, const TCHAR *jid);
- TCHAR* ListGetBestClientResourceNamePtr(const TCHAR *jid);
+ bool ListAddResource(JABBER_LIST list, const wchar_t *jid, int status, const wchar_t *statusMessage, char priority = 0, const wchar_t *nick = NULL);
+ void ListRemoveResource(JABBER_LIST list, const wchar_t *jid);
+ wchar_t* ListGetBestClientResourceNamePtr(const wchar_t *jid);
void SetMucConfig(HXML node, void *from);
void OnIqResultMucGetJidList(HXML iqNode, JABBER_MUC_JIDLIST_TYPE listType);
@@ -575,12 +575,12 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
INT_PTR __cdecl OnGetEventTextChatStates(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl OnGetEventTextPresence(WPARAM wParam, LPARAM lParam);
- void AddContactToRoster(const TCHAR *jid, const TCHAR *nick, const TCHAR *grpName);
- void DBAddAuthRequest(const TCHAR *jid, const TCHAR *nick);
+ void AddContactToRoster(const wchar_t *jid, const wchar_t *nick, const wchar_t *grpName);
+ void DBAddAuthRequest(const wchar_t *jid, const wchar_t *nick);
BOOL AddDbPresenceEvent(MCONTACT hContact, BYTE btEventType);
- MCONTACT DBCreateContact(const TCHAR *jid, const TCHAR *nick, bool temporary, bool stripResource);
- void GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen);
- void ResolveTransportNicks(const TCHAR *jid);
+ MCONTACT DBCreateContact(const wchar_t *jid, const wchar_t *nick, bool temporary, bool stripResource);
+ void GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen);
+ void ResolveTransportNicks(const wchar_t *jid);
void SetServerStatus(int iNewStatus);
void FormatMirVer(pResourceStatus &resource, CMString&);
void UpdateMirVer(JABBER_LIST_ITEM *item);
@@ -588,7 +588,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void UpdateSubscriptionInfo(MCONTACT hContact, JABBER_LIST_ITEM *item);
void SetContactOfflineStatus(MCONTACT hContact);
void InitPopups(void);
- void MsgPopup(MCONTACT hContact, const TCHAR *szMsg, const TCHAR *szTitle);
+ void MsgPopup(MCONTACT hContact, const wchar_t *szMsg, const wchar_t *szTitle);
CMString ExtractImage(HXML node);
//---- jabber_opt.cpp ----------------------------------------------------------------
@@ -627,7 +627,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void __cdecl GetAwayMsgThread(void* hContact);
void __cdecl SendMessageAckThread(void* hContact);
- MCONTACT AddToListByJID(const TCHAR *newJid, DWORD flags);
+ MCONTACT AddToListByJID(const wchar_t *newJid, DWORD flags);
void InfoFrame_OnSetup(CJabberInfoFrame_Event *evt);
void InfoFrame_OnTransport(CJabberInfoFrame_Event *evt);
@@ -642,8 +642,8 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo *pInfo);
void OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo *pInfo);
int SearchRenewFields(HWND hwndDlg, JabberSearchData * dat);
- void SearchDeleteFromRecent(const TCHAR *szAddr, bool deleteLastFromDB);
- void SearchAddToRecent(const TCHAR *szAddr, HWND hwndDialog = NULL);
+ void SearchDeleteFromRecent(const wchar_t *szAddr, bool deleteLastFromDB);
+ void SearchAddToRecent(const wchar_t *szAddr, HWND hwndDialog = NULL);
//---- jabber_std.cpp ----------------------------------------------
void JLoginFailed(int errorCode);
@@ -687,7 +687,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
bool isKerberosAvailable;
bool isAuthAvailable;
bool isSessionAvailable;
- TCHAR *m_gssapiHostName;
+ wchar_t *m_gssapiHostName;
} AUTHMECHS;
AUTHMECHS m_AuthMechs;
@@ -708,8 +708,8 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void OnProcessStreamOpening(HXML node, ThreadData *info);
void OnProcessProtocol(HXML node, ThreadData *info);
- void UpdateJidDbSettings(const TCHAR *jid);
- MCONTACT CreateTemporaryContact(const TCHAR *szJid, JABBER_LIST_ITEM* chatItem);
+ void UpdateJidDbSettings(const wchar_t *jid);
+ MCONTACT CreateTemporaryContact(const wchar_t *szJid, JABBER_LIST_ITEM* chatItem);
void PerformRegistration(ThreadData *info);
void PerformIqAuth(ThreadData *info);
@@ -728,12 +728,12 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
bool ProcessCaptcha(HXML node, HXML parentNode, ThreadData *info);
//---- jabber_util.c -----------------------------------------------------------------
- pResourceStatus ResourceInfoFromJID(const TCHAR *jid);
+ pResourceStatus ResourceInfoFromJID(const wchar_t *jid);
- MCONTACT HContactFromJID(const TCHAR *jid, bool bStripResource = true);
- MCONTACT ChatRoomHContactFromJID(const TCHAR *jid);
+ MCONTACT HContactFromJID(const wchar_t *jid, bool bStripResource = true);
+ MCONTACT ChatRoomHContactFromJID(const wchar_t *jid);
void SendVisibleInvisiblePresence(BOOL invisible);
- void SendPresenceTo(int status, const TCHAR* to, HXML extra, const TCHAR *msg = NULL);
+ void SendPresenceTo(int status, const wchar_t* to, HXML extra, const wchar_t *msg = NULL);
void SendPresence(int m_iStatus, bool bSendToAll);
void StringAppend(char* *str, int *sizeAlloced, const char* fmt, ...);
@@ -741,11 +741,11 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void InitInfoFrame(void);
// returns buf or NULL on error
- TCHAR* GetClientJID(MCONTACT hContact, TCHAR *dest, size_t destLen);
- TCHAR* GetClientJID(const TCHAR *jid, TCHAR *dest, size_t destLen);
+ wchar_t* GetClientJID(MCONTACT hContact, wchar_t *dest, size_t destLen);
+ wchar_t* GetClientJID(const wchar_t *jid, wchar_t *dest, size_t destLen);
void ComboLoadRecentStrings(HWND hwndDlg, UINT idcCombo, char *param, int recentCount=JABBER_DEFAULT_RECENT_COUNT);
- void ComboAddRecentString(HWND hwndDlg, UINT idcCombo, char *param, const TCHAR *string, int recentCount=JABBER_DEFAULT_RECENT_COUNT);
+ void ComboAddRecentString(HWND hwndDlg, UINT idcCombo, char *param, const wchar_t *string, int recentCount=JABBER_DEFAULT_RECENT_COUNT);
BOOL EnterString(CMString &result, LPCTSTR caption, int type, char *windowName=NULL, int recentCount=JABBER_DEFAULT_RECENT_COUNT, int timeout=0);
bool IsMyOwnJID(LPCTSTR szJID);
@@ -755,12 +755,12 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
int m_vCardUpdates;
bool m_bPhotoChanged;
- TCHAR m_szPhotoFileName[MAX_PATH];
+ wchar_t m_szPhotoFileName[MAX_PATH];
void OnUserInfoInit_VCard(WPARAM, LPARAM);
- int SendGetVcard(const TCHAR *jid);
+ int SendGetVcard(const wchar_t *jid);
void AppendVcardFromDB(HXML n, char* tag, char* key);
- void SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName);
+ void SetServerVcard(BOOL bPhotoChanged, wchar_t* szPhotoFileName);
void SaveVcardToDB(HWND hwndPage, int iPage);
//---- jabber_ws.c -------------------------------------------------
@@ -793,11 +793,11 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void RegisterAdvStatusSlot(const char *pszSlot);
void ResetAdvStatus(MCONTACT hContact, const char *pszSlot);
- void WriteAdvStatus(MCONTACT hContact, const char *pszSlot, const TCHAR *pszMode, const char *pszIcon, const TCHAR *pszTitle, const TCHAR *pszText);
+ void WriteAdvStatus(MCONTACT hContact, const char *pszSlot, const wchar_t *pszMode, const char *pszIcon, const wchar_t *pszTitle, const wchar_t *pszText);
char* ReadAdvStatusA(MCONTACT hContact, const char *pszSlot, const char *pszValue);
- TCHAR* ReadAdvStatusT(MCONTACT hContact, const char *pszSlot, const char *pszValue);
+ wchar_t* ReadAdvStatusT(MCONTACT hContact, const char *pszSlot, const char *pszValue);
- BOOL SendPepTune(TCHAR* szArtist, TCHAR* szLength, TCHAR* szSource, TCHAR* szTitle, TCHAR* szTrack, TCHAR* szUri);
+ BOOL SendPepTune(wchar_t* szArtist, wchar_t* szLength, wchar_t* szSource, wchar_t* szTitle, wchar_t* szTrack, wchar_t* szUri);
void XStatusInit(void);
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp
index c851f55959..c4bd0161b9 100644
--- a/protocols/JabberG/src/jabber_rc.cpp
+++ b/protocols/JabberG/src/jabber_rc.cpp
@@ -58,15 +58,15 @@ BOOL CJabberProto::HandleAdhocCommandRequest(HXML iqNode, CJabberIqInfo *pInfo)
return TRUE;
}
- const TCHAR *szNode = XmlGetAttrValue(pInfo->GetChildNode(), L"node");
+ const wchar_t *szNode = XmlGetAttrValue(pInfo->GetChildNode(), L"node");
if (!szNode)
return TRUE;
- m_adhocManager.HandleCommandRequest(iqNode, pInfo, (TCHAR*)szNode);
+ m_adhocManager.HandleCommandRequest(iqNode, pInfo, (wchar_t*)szNode);
return TRUE;
}
-BOOL CJabberAdhocManager::HandleItemsRequest(HXML, CJabberIqInfo *pInfo, const TCHAR *szNode)
+BOOL CJabberAdhocManager::HandleItemsRequest(HXML, CJabberIqInfo *pInfo, const wchar_t *szNode)
{
if (!szNode || !m_pProto->m_options.EnableRemoteControl || !m_pProto->IsRcRequestAllowedByACL(pInfo))
return FALSE;
@@ -79,7 +79,7 @@ BOOL CJabberAdhocManager::HandleItemsRequest(HXML, CJabberIqInfo *pInfo, const T
CJabberAdhocNode* pNode = GetFirstNode();
while (pNode) {
- TCHAR *szJid = pNode->GetJid();
+ wchar_t *szJid = pNode->GetJid();
if (!szJid)
szJid = m_pProto->m_ThreadInfo->fullJID;
@@ -96,7 +96,7 @@ BOOL CJabberAdhocManager::HandleItemsRequest(HXML, CJabberIqInfo *pInfo, const T
return FALSE;
}
-BOOL CJabberAdhocManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, const TCHAR *szNode)
+BOOL CJabberAdhocManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, const wchar_t *szNode)
{
if (!szNode || !m_pProto->m_options.EnableRemoteControl || !m_pProto->IsRcRequestAllowedByACL(pInfo))
return FALSE;
@@ -135,7 +135,7 @@ BOOL CJabberAdhocManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, const TC
return TRUE;
}
-BOOL CJabberAdhocManager::HandleCommandRequest(HXML iqNode, CJabberIqInfo *pInfo, const TCHAR *szNode)
+BOOL CJabberAdhocManager::HandleCommandRequest(HXML iqNode, CJabberIqInfo *pInfo, const wchar_t *szNode)
{
// ATTN: ACL and db settings checked in calling function
@@ -154,7 +154,7 @@ BOOL CJabberAdhocManager::HandleCommandRequest(HXML iqNode, CJabberIqInfo *pInfo
return FALSE;
}
- const TCHAR *szSessionId = XmlGetAttrValue(commandNode, L"sessionid");
+ const wchar_t *szSessionId = XmlGetAttrValue(commandNode, L"sessionid");
CJabberAdhocSession* pSession = NULL;
if (szSessionId) {
@@ -309,7 +309,7 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc
fieldNode << XCHILD(L"option") << XATTR(L"label", TranslateT("Offline")) << XCHILD(L"value", L"offline");
// priority
- TCHAR szPriority[ 256 ];
+ wchar_t szPriority[ 256 ];
mir_sntprintf(szPriority, L"%d", (int)getDword("Priority", 5));
xNode << XCHILD(L"field") << XATTR(L"label", TranslateT("Priority")) << XATTR(L"type", L"text-single")
<< XATTR(L"var", L"status-priority") << XCHILD(L"value", szPriority);
@@ -322,7 +322,7 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc
fieldNode = xNode << XCHILD(L"field") << XATTR(L"label", TranslateT("Change global status"))
<< XATTR(L"type", L"boolean") << XATTR(L"var", L"status-global");
- ptrT tszStatusMsg((TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGT, status, 0));
+ ptrT tszStatusMsg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, status, 0));
if (tszStatusMsg)
fieldNode << XCHILD(L"value", tszStatusMsg);
@@ -361,12 +361,12 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc
fieldNode = XmlGetChildByTag(xNode, "field", "var", L"status-priority");
if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
if (ptszValue = XmlGetText(valueNode))
- priority = _ttoi(ptszValue);
+ priority = _wtoi(ptszValue);
if (priority >= -128 && priority <= 127)
setDword("Priority", priority);
- const TCHAR *szStatusMessage = NULL;
+ const wchar_t *szStatusMessage = NULL;
fieldNode = XmlGetChildByTag(xNode, "field", "var", L"status-message");
if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
szStatusMessage = XmlGetText(valueNode);
@@ -379,7 +379,7 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc
fieldNode = XmlGetChildByTag(xNode, "field", "var", L"status-global");
if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value"))) {
- if ((ptszValue = XmlGetText(valueNode)) != NULL && _ttoi(ptszValue))
+ if ((ptszValue = XmlGetText(valueNode)) != NULL && _wtoi(ptszValue))
CallService(MS_CLIST_SETSTATUSMODE, status, NULL);
else
CallProtoService(m_szModuleName, PS_SETSTATUS, status, NULL);
@@ -413,7 +413,7 @@ int CJabberProto::AdhocOptionsHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
<< XATTR(L"value", JABBER_FEAT_RC);
// Automatically Accept File Transfers
- TCHAR szTmpBuff[ 1024 ];
+ wchar_t szTmpBuff[ 1024 ];
mir_sntprintf(szTmpBuff, L"%d", db_get_b(NULL, "SRFile", "AutoAccept", 0));
xNode << XCHILD(L"field") << XATTR(L"label", TranslateT("Automatically Accept File Transfers"))
<< XATTR(L"type", L"boolean") << XATTR(L"var", L"auto-files") << XCHILD(L"value", szTmpBuff);
@@ -442,18 +442,18 @@ int CJabberProto::AdhocOptionsHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
HXML fieldNode = XmlGetChildByTag(xNode, "field", "var", L"auto-files"), valueNode;
if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
if (XmlGetText(valueNode))
- db_set_b(NULL, "SRFile", "AutoAccept", (BYTE)_ttoi(XmlGetText(valueNode)));
+ db_set_b(NULL, "SRFile", "AutoAccept", (BYTE)_wtoi(XmlGetText(valueNode)));
// Use sounds
fieldNode = XmlGetChildByTag(xNode, "field", "var", L"sounds");
if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
if (XmlGetText(valueNode))
- db_set_b(NULL, "Skin", "UseSound", (BYTE)_ttoi(XmlGetText(valueNode)));
+ db_set_b(NULL, "Skin", "UseSound", (BYTE)_wtoi(XmlGetText(valueNode)));
// Disable remote controlling
fieldNode = XmlGetChildByTag(xNode, "field", "var", L"enable-rc");
if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
- if (XmlGetText(valueNode) && _ttoi(XmlGetText(valueNode)))
+ if (XmlGetText(valueNode) && _wtoi(XmlGetText(valueNode)))
m_options.EnableRemoteControl = 0;
return JABBER_ADHOC_HANDLER_STATUS_COMPLETED;
@@ -477,7 +477,7 @@ int CJabberProto::RcGetUnreadEventsCount()
dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob + 1);
int nGetTextResult = db_event_get(hDbEvent, &dbei);
if (!nGetTextResult && dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_READ) && !(dbei.flags & DBEF_SENT)) {
- TCHAR *szEventText = DbGetEventTextT(&dbei, CP_ACP);
+ wchar_t *szEventText = DbGetEventTextT(&dbei, CP_ACP);
if (szEventText) {
nEventsSent++;
mir_free(szEventText);
@@ -491,7 +491,7 @@ int CJabberProto::RcGetUnreadEventsCount()
int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSession* pSession)
{
- TCHAR szMsg[ 1024 ];
+ wchar_t szMsg[ 1024 ];
if (pSession->GetStage() == 0) {
int nUnreadEvents = RcGetUnreadEventsCount();
if (!nUnreadEvents) {
@@ -544,7 +544,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
// remove clist events
HXML fieldNode = XmlGetChildByTag(xNode,"field", "var", L"remove-clist-events"), valueNode;
if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
- if (XmlGetText(valueNode) && !_ttoi(XmlGetText(valueNode)))
+ if (XmlGetText(valueNode) && !_wtoi(XmlGetText(valueNode)))
bRemoveCListEvents = FALSE;
m_options.RcMarkMessagesAsRead = bRemoveCListEvents ? 1 : 0;
@@ -578,21 +578,21 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
<< XCHILD(L"body", szEventText);
HXML addressesNode = msg << XCHILDNS(L"addresses", JABBER_FEAT_EXT_ADDRESSING);
- TCHAR szOFrom[JABBER_MAX_JID_LEN];
+ wchar_t szOFrom[JABBER_MAX_JID_LEN];
size_t cbBlob = mir_strlen((LPSTR)dbei.pBlob)+1;
if (cbBlob < dbei.cbBlob) { // rest of message contains a sender's resource
ptrT szOResource( mir_utf8decodeT((LPSTR)dbei.pBlob + cbBlob+1));
mir_sntprintf(szOFrom, L"%s/%s", tszJid, szOResource);
} else
- _tcsncpy_s(szOFrom, tszJid, _TRUNCATE);
+ wcsncpy_s(szOFrom, tszJid, _TRUNCATE);
addressesNode << XCHILD(L"address") << XATTR(L"type", L"ofrom") << XATTR(L"jid", szOFrom);
addressesNode << XCHILD(L"address") << XATTR(L"type", L"oto") << XATTR(L"jid", m_ThreadInfo->fullJID);
time_t ltime = (time_t)dbei.timestamp;
struct tm *gmt = gmtime(&ltime);
- TCHAR stime[512];
+ wchar_t stime[512];
mir_sntprintf(stime, L"%.4i-%.2i-%.2iT%.2i:%.2i:%.2iZ", gmt->tm_year + 1900, gmt->tm_mon + 1, gmt->tm_mday,
gmt->tm_hour, gmt->tm_min, gmt->tm_sec);
msg << XCHILDNS(L"delay", L"urn:xmpp:delay") << XATTR(L"stamp", stime);
@@ -625,7 +625,7 @@ int CJabberProto::AdhocLockWSHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSes
{
BOOL bOk = LockWorkStation();
- TCHAR szMsg[ 1024 ];
+ wchar_t szMsg[ 1024 ];
if (bOk)
mir_sntprintf(szMsg, TranslateT("Workstation successfully locked"));
else
@@ -683,7 +683,7 @@ int CJabberProto::AdhocQuitMirandaHandler(HXML, CJabberIqInfo *pInfo, CJabberAdh
// I Agree checkbox
fieldNode = XmlGetChildByTag(xNode,"field", "var", L"allow-shutdown");
if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
- if (XmlGetText(valueNode) && _ttoi(XmlGetText(valueNode)))
+ if (XmlGetText(valueNode) && _wtoi(XmlGetText(valueNode)))
CallFunctionAsync(JabberQuitMirandaIMThread, 0);
return JABBER_ADHOC_HANDLER_STATUS_COMPLETED;
@@ -708,7 +708,7 @@ int CJabberProto::AdhocLeaveGroupchatsHandler(HXML, CJabberIqInfo *pInfo, CJabbe
}
if (!nChatsCount) {
- TCHAR szMsg[ 1024 ];
+ wchar_t szMsg[ 1024 ];
mir_sntprintf(szMsg, TranslateT("There is no group chats to leave"));
m_ThreadInfo->send(
diff --git a/protocols/JabberG/src/jabber_rc.h b/protocols/JabberG/src/jabber_rc.h
index 73fa177f71..aa5306e381 100644
--- a/protocols/JabberG/src/jabber_rc.h
+++ b/protocols/JabberG/src/jabber_rc.h
@@ -102,14 +102,14 @@ class CJabberAdhocNode;
class CJabberAdhocNode
{
protected:
- TCHAR *m_szJid;
- TCHAR *m_szNode;
- TCHAR *m_szName;
+ wchar_t *m_szJid;
+ wchar_t *m_szNode;
+ wchar_t *m_szName;
CJabberAdhocNode* m_pNext;
JABBER_ADHOC_HANDLER m_pHandler;
CJabberProto *m_pProto;
public:
- CJabberAdhocNode(CJabberProto* pProto, TCHAR* szJid, TCHAR* szNode, TCHAR* szName, JABBER_ADHOC_HANDLER pHandler)
+ CJabberAdhocNode(CJabberProto* pProto, wchar_t* szJid, wchar_t* szNode, wchar_t* szName, JABBER_ADHOC_HANDLER pHandler)
{
memset(this, 0, sizeof(CJabberAdhocNode));
replaceStrT(m_szJid, szJid);
@@ -137,15 +137,15 @@ public:
m_pNext = pNext;
return pRetVal;
}
- TCHAR* GetJid()
+ wchar_t* GetJid()
{
return m_szJid;
}
- TCHAR* GetNode()
+ wchar_t* GetNode()
{
return m_szNode;
}
- TCHAR* GetName()
+ wchar_t* GetName()
{
return m_szName;
}
@@ -165,7 +165,7 @@ protected:
CJabberAdhocSession* m_pSessions;
mir_cs m_cs;
- CJabberAdhocSession* FindSession(const TCHAR *szSession)
+ CJabberAdhocSession* FindSession(const wchar_t *szSession)
{
CJabberAdhocSession* pSession = m_pSessions;
while (pSession) {
@@ -188,7 +188,7 @@ protected:
return pSession;
}
- CJabberAdhocNode* FindNode(const TCHAR *szNode)
+ CJabberAdhocNode* FindNode(const wchar_t *szNode)
{
CJabberAdhocNode* pNode = m_pNodes;
while (pNode) {
@@ -264,7 +264,7 @@ public:
}
BOOL FillDefaultNodes();
- BOOL AddNode(TCHAR* szJid, TCHAR* szNode, TCHAR* szName, JABBER_ADHOC_HANDLER pHandler)
+ BOOL AddNode(wchar_t* szJid, wchar_t* szNode, wchar_t* szName, JABBER_ADHOC_HANDLER pHandler)
{
CJabberAdhocNode* pNode = new CJabberAdhocNode(m_pProto, szJid, szNode, szName, pHandler);
if (!pNode)
@@ -287,9 +287,9 @@ public:
return m_pNodes;
}
- BOOL HandleItemsRequest(HXML iqNode, CJabberIqInfo *pInfo, const TCHAR *szNode);
- BOOL HandleInfoRequest(HXML iqNode, CJabberIqInfo *pInfo, const TCHAR *szNode);
- BOOL HandleCommandRequest(HXML iqNode, CJabberIqInfo *pInfo, const TCHAR *szNode);
+ BOOL HandleItemsRequest(HXML iqNode, CJabberIqInfo *pInfo, const wchar_t *szNode);
+ BOOL HandleInfoRequest(HXML iqNode, CJabberIqInfo *pInfo, const wchar_t *szNode);
+ BOOL HandleCommandRequest(HXML iqNode, CJabberIqInfo *pInfo, const wchar_t *szNode);
BOOL ExpireSessions()
{
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp
index 3c033d178c..c1d3795688 100644
--- a/protocols/JabberG/src/jabber_search.cpp
+++ b/protocols/JabberG/src/jabber_search.cpp
@@ -122,8 +122,8 @@ static int JabberSearchAddField(HWND hwndDlg, Data* FieldDat)
dat->pJSInf = (JabberSearchFieldsInfo*)realloc(dat->pJSInf, sizeof(JabberSearchFieldsInfo)*(dat->nJSInfCount + 1));
dat->pJSInf[dat->nJSInfCount].hwndCaptionItem = hwndLabel;
dat->pJSInf[dat->nJSInfCount].hwndValueItem = hwndVar;
- dat->pJSInf[dat->nJSInfCount].szFieldCaption = _tcsdup(FieldDat->Label);
- dat->pJSInf[dat->nJSInfCount].szFieldName = _tcsdup(FieldDat->Var);
+ dat->pJSInf[dat->nJSInfCount].szFieldCaption = wcsdup(FieldDat->Label);
+ dat->pJSInf[dat->nJSInfCount].szFieldName = wcsdup(FieldDat->Var);
dat->nJSInfCount++;
}
return CornerY + Order * 40 + 14 + 20;
@@ -177,16 +177,16 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*)
}
}
- const TCHAR *szFrom = XmlGetAttrValue(iqNode, L"from");
+ const wchar_t *szFrom = XmlGetAttrValue(iqNode, L"from");
if (szFrom)
SearchAddToRecent(szFrom, searchHandleDlg);
PostMessage(searchHandleDlg, WM_USER + 10, 0, 0);
ShowWindow(searchHandleDlg, SW_SHOW);
}
else if (!mir_tstrcmp(type, L"error")) {
- const TCHAR *code = NULL;
- const TCHAR *description = NULL;
- TCHAR buff[255];
+ const wchar_t *code = NULL;
+ const wchar_t *description = NULL;
+ wchar_t buff[255];
HXML errorNode = XmlGetChild(iqNode, "error");
if (errorNode) {
code = XmlGetAttrValue(errorNode, L"code");
@@ -203,12 +203,12 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*)
// The pmFields is the pointer to map of <field Name, field Label> Not unical but ordered
// This can help to made result parser routines more simple
-static TCHAR *nickfields[] = { L"nick", L"nickname", L"fullname", L"name", L"given", L"first", L"jid", NULL };
+static wchar_t *nickfields[] = { L"nick", L"nickname", L"fullname", L"name", L"given", L"first", L"jid", NULL };
void CJabberProto::SearchReturnResults(HANDLE id, void * pvUsersInfo, U_TCHAR_MAP * pmAllFields)
{
- LIST<TCHAR> ListOfNonEmptyFields(20, (LIST<TCHAR>::FTSortFunc)TCharKeyCmp);
- LIST<TCHAR> ListOfFields(20);
+ LIST<wchar_t> ListOfNonEmptyFields(20, (LIST<wchar_t>::FTSortFunc)TCharKeyCmp);
+ LIST<wchar_t> ListOfFields(20);
LIST<void>* plUsersInfo = (LIST<void>*)pvUsersInfo;
int i, nUsersFound = plUsersInfo->getCount();
@@ -217,7 +217,7 @@ void CJabberProto::SearchReturnResults(HANDLE id, void * pvUsersInfo, U_TCHAR_M
U_TCHAR_MAP* pmUserData = (U_TCHAR_MAP*)plUsersInfo->operator [](i);
int nUserFields = pmUserData->getCount();
for (int j = 0; j < nUserFields; j++) {
- TCHAR *var = pmUserData->getKeyName(j);
+ wchar_t *var = pmUserData->getKeyName(j);
if (var && ListOfNonEmptyFields.getIndex(var) < 0)
ListOfNonEmptyFields.insert(var);
}
@@ -226,7 +226,7 @@ void CJabberProto::SearchReturnResults(HANDLE id, void * pvUsersInfo, U_TCHAR_M
// now fill the ListOfFields but order is from pmAllFields
int nAllCount = pmAllFields->getCount();
for (i = 0; i < nAllCount; i++) {
- TCHAR *var = pmAllFields->getUnOrderedKeyName(i);
+ wchar_t *var = pmAllFields->getUnOrderedKeyName(i);
if (var && ListOfNonEmptyFields.getIndex(var) < 0)
continue;
ListOfFields.insert(var);
@@ -237,12 +237,12 @@ void CJabberProto::SearchReturnResults(HANDLE id, void * pvUsersInfo, U_TCHAR_M
CUSTOMSEARCHRESULTS Results = { 0 };
Results.nSize = sizeof(Results);
- Results.pszFields = (TCHAR**)mir_alloc(sizeof(TCHAR*)*nFieldCount);
+ Results.pszFields = (wchar_t**)mir_alloc(sizeof(wchar_t*)*nFieldCount);
Results.nFieldCount = nFieldCount;
/* Sending Columns Titles */
for (i = 0; i < nFieldCount; i++) {
- TCHAR *var = ListOfFields[i];
+ wchar_t *var = ListOfFields[i];
if (var)
Results.pszFields[i] = pmAllFields->operator [](var);
}
@@ -254,44 +254,44 @@ void CJabberProto::SearchReturnResults(HANDLE id, void * pvUsersInfo, U_TCHAR_M
Results.psr.cbSize = sizeof(Results.psr); // sending user data
for (i = 0; i < nUsersFound; i++) {
- TCHAR buff[200];
+ wchar_t buff[200];
buff[0] = 0;
U_TCHAR_MAP *pmUserData = (U_TCHAR_MAP *)plUsersInfo->operator [](i);
for (int j = 0; j < nFieldCount; j++) {
- TCHAR *var = ListOfFields[j];
- TCHAR *value = pmUserData->operator [](var);
- Results.pszFields[j] = value ? value : (TCHAR *)L" ";
+ wchar_t *var = ListOfFields[j];
+ wchar_t *value = pmUserData->operator [](var);
+ Results.pszFields[j] = value ? value : (wchar_t *)L" ";
if (!mir_tstrcmpi(var, L"jid") && value)
- Results.psr.id.t = value;
+ Results.psr.id.w = value;
}
- TCHAR *nick = NULL;
+ wchar_t *nick = NULL;
for (int k = 0; k < _countof(nickfields) && !nick; k++)
nick = pmUserData->operator [](nickfields[k]);
if (nick) {
- if (mir_tstrcmpi(nick, Results.psr.id.t))
- mir_sntprintf(buff, L"%s (%s)", nick, Results.psr.id.t);
+ if (mir_tstrcmpi(nick, Results.psr.id.w))
+ mir_sntprintf(buff, L"%s (%s)", nick, Results.psr.id.w);
else
- _tcsncpy_s(buff, nick, _TRUNCATE);
+ wcsncpy_s(buff, nick, _TRUNCATE);
nick = buff;
}
- Results.psr.nick.t = nick;
+ Results.psr.nick.w = nick;
Results.psr.flags = PSR_TCHAR;
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SEARCHRESULT, id, (LPARAM)&Results);
- Results.psr.nick.t = NULL;
+ Results.psr.nick.w = NULL;
}
mir_free(Results.pszFields);
}
-void DestroyKey(TCHAR* key)
+void DestroyKey(wchar_t* key)
{
mir_free(key);
}
-TCHAR* CopyKey(TCHAR* key)
+wchar_t* CopyKey(wchar_t* key)
{
return mir_tstrdup(key);
}
@@ -301,7 +301,7 @@ TCHAR* CopyKey(TCHAR* key)
void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*)
{
- const TCHAR *type;
+ const wchar_t *type;
int id;
U_TCHAR_MAP mColumnsNames(10);
@@ -321,9 +321,9 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*)
if (reportNode) {
int i = 1;
while (HXML fieldNode = XmlGetNthChild(reportNode, L"field", i++)) {
- TCHAR *var = (TCHAR*)XmlGetAttrValue(fieldNode, L"var");
+ wchar_t *var = (wchar_t*)XmlGetAttrValue(fieldNode, L"var");
if (var) {
- TCHAR *Label = (TCHAR*)XmlGetAttrValue(fieldNode, L"label");
+ wchar_t *Label = (wchar_t*)XmlGetAttrValue(fieldNode, L"label");
mColumnsNames.insert(var, (Label != NULL) ? Label : var);
}
}
@@ -335,8 +335,8 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*)
U_TCHAR_MAP *pUserColumn = new U_TCHAR_MAP(10);
int j = 1;
while (HXML fieldNode = XmlGetNthChild(itemNode, L"field", j++)) {
- if (TCHAR* var = (TCHAR*)XmlGetAttrValue(fieldNode, L"var")) {
- if (TCHAR* Text = (TCHAR*)XmlGetText(XmlGetChild(fieldNode, L"value"))) {
+ if (wchar_t* var = (wchar_t*)XmlGetAttrValue(fieldNode, L"var")) {
+ if (wchar_t* Text = (wchar_t*)XmlGetText(XmlGetChild(fieldNode, L"value"))) {
if (!mColumnsNames[var])
mColumnsNames.insert(var, var);
pUserColumn->insert(var, Text);
@@ -353,8 +353,8 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*)
while (HXML itemNode = XmlGetNthChild(queryNode, L"item", i++)) {
U_TCHAR_MAP *pUserColumn = new U_TCHAR_MAP(10);
- TCHAR *jid = (TCHAR*)XmlGetAttrValue(itemNode, L"jid");
- TCHAR *keyReturned;
+ wchar_t *jid = (wchar_t*)XmlGetAttrValue(itemNode, L"jid");
+ wchar_t *keyReturned;
mColumnsNames.insertCopyKey(L"jid", L"jid", &keyReturned, CopyKey, DestroyKey);
mColumnsNames.insert(L"jid", keyReturned);
pUserColumn->insertCopyKey(L"jid", jid, NULL, CopyKey, DestroyKey);
@@ -364,13 +364,13 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*)
if (!child)
break;
- const TCHAR *szColumnName = XmlGetName(child);
+ const wchar_t *szColumnName = XmlGetName(child);
if (szColumnName) {
LPCTSTR ptszChild = XmlGetText(child);
if (ptszChild && *ptszChild) {
- mColumnsNames.insertCopyKey((TCHAR*)szColumnName, L"", &keyReturned, CopyKey, DestroyKey);
- mColumnsNames.insert((TCHAR*)szColumnName, keyReturned);
- pUserColumn->insertCopyKey((TCHAR*)szColumnName, (TCHAR*)ptszChild, NULL, CopyKey, DestroyKey);
+ mColumnsNames.insertCopyKey((wchar_t*)szColumnName, L"", &keyReturned, CopyKey, DestroyKey);
+ mColumnsNames.insert((wchar_t*)szColumnName, keyReturned);
+ pUserColumn->insertCopyKey((wchar_t*)szColumnName, (wchar_t*)ptszChild, NULL, CopyKey, DestroyKey);
}
}
}
@@ -380,9 +380,9 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*)
}
}
else if (!mir_tstrcmp(type, L"error")) {
- const TCHAR *code = NULL;
- const TCHAR *description = NULL;
- TCHAR buff[255];
+ const wchar_t *code = NULL;
+ const wchar_t *description = NULL;
+ wchar_t buff[255];
HXML errorNode = XmlGetChild(iqNode, "error");
if (errorNode) {
code = XmlGetAttrValue(errorNode, L"code");
@@ -459,7 +459,7 @@ static void JabberSearchRefreshFrameScroll(HWND hwndDlg, JabberSearchData *dat)
int CJabberProto::SearchRenewFields(HWND hwndDlg, JabberSearchData *dat)
{
- TCHAR szServerName[100];
+ wchar_t szServerName[100];
EnableWindow(GetDlgItem(hwndDlg, IDC_GO), FALSE);
GetDlgItemText(hwndDlg, IDC_SERVER, szServerName, _countof(szServerName));
dat->CurrentHeight = 0;
@@ -481,14 +481,14 @@ int CJabberProto::SearchRenewFields(HWND hwndDlg, JabberSearchData *dat)
return pInfo->GetIqId();
}
-static void JabberSearchAddUrlToRecentCombo(HWND hwndDlg, const TCHAR *szAddr)
+static void JabberSearchAddUrlToRecentCombo(HWND hwndDlg, const wchar_t *szAddr)
{
int lResult = SendDlgItemMessage(hwndDlg, IDC_SERVER, (UINT)CB_FINDSTRING, 0, (LPARAM)szAddr);
if (lResult == -1)
SendDlgItemMessage(hwndDlg, IDC_SERVER, CB_ADDSTRING, 0, (LPARAM)szAddr);
}
-void CJabberProto::SearchDeleteFromRecent(const TCHAR *szAddr, bool deleteLastFromDB)
+void CJabberProto::SearchDeleteFromRecent(const wchar_t *szAddr, bool deleteLastFromDB)
{
// search in recent
for (int i = 0; i < 10; i++) {
@@ -517,7 +517,7 @@ void CJabberProto::SearchDeleteFromRecent(const TCHAR *szAddr, bool deleteLastFr
}
}
-void CJabberProto::SearchAddToRecent(const TCHAR *szAddr, HWND hwndDialog)
+void CJabberProto::SearchAddToRecent(const wchar_t *szAddr, HWND hwndDialog)
{
char key[30];
SearchDeleteFromRecent(szAddr, true);
@@ -556,7 +556,7 @@ static INT_PTR CALLBACK JabberSearchAdvancedDlgProc(HWND hwndDlg, UINT msg, WPAR
//TO DO: Add Transports here
int i, transpCount = dat->ppro->m_lstTransports.getCount();
for (i = 0; i < transpCount; i++) {
- TCHAR *szTransp = dat->ppro->m_lstTransports[i];
+ wchar_t *szTransp = dat->ppro->m_lstTransports[i];
if (szTransp)
JabberSearchAddUrlToRecentCombo(hwndDlg, szTransp);
}
@@ -742,7 +742,7 @@ HWND __cdecl CJabberProto::SearchAdvanced(HWND hwndDlg)
BOOL fRequestNotEmpty = FALSE;
// get server name
- TCHAR szServerName[100];
+ wchar_t szServerName[100];
GetDlgItemText(hwndDlg, IDC_SERVER, szServerName, _countof(szServerName));
// formating query
@@ -763,7 +763,7 @@ HWND __cdecl CJabberProto::SearchAdvanced(HWND hwndDlg)
}
else { //and Simple fields: XEP-0055 Example 3
for (int i = 0; i < dat->nJSInfCount; i++) {
- TCHAR szFieldValue[100];
+ wchar_t szFieldValue[100];
GetWindowText(dat->pJSInf[i].hwndValueItem, szFieldValue, _countof(szFieldValue));
if (szFieldValue[0] != 0) {
XmlAddChild(query, dat->pJSInf[i].szFieldName, szFieldValue);
diff --git a/protocols/JabberG/src/jabber_search.h b/protocols/JabberG/src/jabber_search.h
index ef96830e7b..cf3f053728 100644
--- a/protocols/JabberG/src/jabber_search.h
+++ b/protocols/JabberG/src/jabber_search.h
@@ -28,8 +28,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
typedef struct _tagJabberSearchFieldsInfo
{
- TCHAR * szFieldName;
- TCHAR * szFieldCaption;
+ wchar_t * szFieldName;
+ wchar_t * szFieldCaption;
HWND hwndCaptionItem;
HWND hwndValueItem;
} JabberSearchFieldsInfo;
@@ -51,9 +51,9 @@ typedef struct _tagJabberSearchData
typedef struct tag_Data
{
- TCHAR *Label;
- TCHAR * Var;
- TCHAR * defValue;
+ wchar_t *Label;
+ wchar_t * Var;
+ wchar_t * defValue;
BOOL bHidden;
BOOL bReadOnly;
int Order;
@@ -69,8 +69,8 @@ static void JabberIqResultGetSearchFields(HXML iqNode, void *userdata);
static void JabberSearchFreeData(HWND hwndDlg, JabberSearchData * dat);
static void JabberSearchRefreshFrameScroll(HWND hwndDlg, JabberSearchData * dat);
static INT_PTR CALLBACK JabberSearchAdvancedDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-static void JabberSearchDeleteFromRecent(TCHAR * szAddr,BOOL deleteLastFromDB);
-void SearchAddToRecent(TCHAR * szAddr, HWND hwnd);
+static void JabberSearchDeleteFromRecent(wchar_t * szAddr,BOOL deleteLastFromDB);
+void SearchAddToRecent(wchar_t * szAddr, HWND hwnd);
// Implementation of MAP class (the list
template <typename _KEYTYPE , int (*COMPARATOR)(_KEYTYPE*, _KEYTYPE*) >
@@ -84,7 +84,7 @@ public:
private:
typedef struct _tagRECORD
{
- _tagRECORD(_KEYTYPE * key, TCHAR * value=NULL) { _key=key; _value=value; _order=0; _destroyKeyProc=NULL; }
+ _tagRECORD(_KEYTYPE * key, wchar_t * value=NULL) { _key=key; _value=value; _order=0; _destroyKeyProc=NULL; }
~_tagRECORD()
{
if (_key && _destroyKeyProc)
@@ -93,7 +93,7 @@ private:
_destroyKeyProc=NULL;
}
_KEYTYPE *_key;
- TCHAR * _value;
+ wchar_t * _value;
int _order;
DESTROYKEYPROC _destroyKeyProc;
} _RECORD;
@@ -148,7 +148,7 @@ public:
while (record=_Records[i++]) delete record;
}
- int insert(_KEYTYPE* Key, TCHAR *Value)
+ int insert(_KEYTYPE* Key, wchar_t *Value)
{
_RECORD * rec= new _RECORD(Key,Value);
int index=_Records.getIndex(rec);
@@ -168,7 +168,7 @@ public:
}
return index;
}
- int insertCopyKey(_KEYTYPE* Key, TCHAR *Value, _KEYTYPE** _KeyReturn, COPYKEYPROC CopyProc, DESTROYKEYPROC DestroyProc)
+ int insertCopyKey(_KEYTYPE* Key, wchar_t *Value, _KEYTYPE** _KeyReturn, COPYKEYPROC CopyProc, DESTROYKEYPROC DestroyProc)
{
_RECORD * rec= new _RECORD(Key,Value);
int index=_Records.getIndex(rec);
@@ -198,7 +198,7 @@ public:
}
return index;
}
- inline TCHAR* operator[](_KEYTYPE* _KEY) const
+ inline wchar_t* operator[](_KEYTYPE* _KEY) const
{
_RECORD rec(_KEY);
int index=_Records.getIndex(&rec);
@@ -213,7 +213,7 @@ public:
else
return NULL;
}
- inline TCHAR* operator[](int index) const
+ inline wchar_t* operator[](int index) const
{
_RECORD * rv=_Records[index];
if (rv) return rv->_value;
@@ -225,7 +225,7 @@ public:
if (rv) return rv->_key;
else return NULL;
}
- inline TCHAR * getUnOrdered(int index)
+ inline wchar_t * getUnOrdered(int index)
{
_RECORD * rec=_getUnorderedRec(index);
if (rec) return rec->_value;
@@ -260,7 +260,7 @@ public:
}
};
-inline int TCharKeyCmp(TCHAR* a, TCHAR* b)
+inline int TCharKeyCmp(wchar_t* a, wchar_t* b)
{
return (int)(mir_tstrcmpi(a,b));
}
diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp
index 1308ba8a40..447e15edd1 100644
--- a/protocols/JabberG/src/jabber_secur.cpp
+++ b/protocols/JabberG/src/jabber_secur.cpp
@@ -28,13 +28,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/////////////////////////////////////////////////////////////////////////////////////////
// ntlm auth - LanServer based authorization
-TNtlmAuth::TNtlmAuth(ThreadData *info, const char* mechanism, const TCHAR *hostname) :
+TNtlmAuth::TNtlmAuth(ThreadData *info, const char* mechanism, const wchar_t *hostname) :
TJabberAuth(info)
{
szName = mechanism;
szHostName = hostname;
- const TCHAR *szProvider;
+ const wchar_t *szProvider;
if (!mir_strcmp(mechanism, "GSS-SPNEGO"))
szProvider = L"Negotiate";
else if (!mir_strcmp(mechanism, "GSSAPI"))
@@ -48,7 +48,7 @@ LBL_Invalid:
return;
}
- TCHAR szSpn[1024] = L"";
+ wchar_t szSpn[1024] = L"";
if (mir_strcmp(mechanism, "NTLM"))
if (!getSpn(szSpn, _countof(szSpn)) && !mir_strcmp(mechanism, "GSSAPI"))
goto LBL_Invalid;
@@ -63,9 +63,9 @@ TNtlmAuth::~TNtlmAuth()
Netlib_DestroySecurityProvider(NULL, hProvider);
}
-bool TNtlmAuth::getSpn(TCHAR* szSpn, size_t dwSpnLen)
+bool TNtlmAuth::getSpn(wchar_t* szSpn, size_t dwSpnLen)
{
- TCHAR szFullUserName[128] = L"";
+ wchar_t szFullUserName[128] = L"";
ULONG szFullUserNameLen = _countof(szFullUserName);
if (!GetUserNameEx(NameDnsDomain, szFullUserName, &szFullUserNameLen)) {
szFullUserName[0] = 0;
@@ -73,12 +73,12 @@ bool TNtlmAuth::getSpn(TCHAR* szSpn, size_t dwSpnLen)
GetUserNameEx(NameSamCompatible, szFullUserName, &szFullUserNameLen);
}
- TCHAR *name = _tcsrchr(szFullUserName, '\\');
+ wchar_t *name = wcsrchr(szFullUserName, '\\');
if (name) *name = 0;
else return false;
if (szHostName && szHostName[0]) {
- TCHAR *szFullUserNameU = _tcsupr(mir_tstrdup(szFullUserName));
+ wchar_t *szFullUserNameU = wcsupr(mir_tstrdup(szFullUserName));
mir_sntprintf(szSpn, dwSpnLen, L"xmpp/%s/%s@%s", szHostName, szFullUserName, szFullUserNameU);
mir_free(szFullUserNameU);
}
@@ -90,8 +90,8 @@ bool TNtlmAuth::getSpn(TCHAR* szSpn, size_t dwSpnLen)
if (host && host->h_name)
connectHost = host->h_name;
- TCHAR *connectHostT = mir_a2t(connectHost);
- mir_sntprintf(szSpn, dwSpnLen, L"xmpp/%s@%s", connectHostT, _tcsupr(szFullUserName));
+ wchar_t *connectHostT = mir_a2t(connectHost);
+ mir_sntprintf(szSpn, dwSpnLen, L"xmpp/%s@%s", connectHostT, wcsupr(szFullUserName));
mir_free(connectHostT);
}
@@ -111,7 +111,7 @@ char* TNtlmAuth::getInitialRequest()
return Netlib_NtlmCreateResponse2(hProvider, "", NULL, NULL, &complete);
}
-char* TNtlmAuth::getChallenge(const TCHAR *challenge)
+char* TNtlmAuth::getChallenge(const wchar_t *challenge)
{
if (!hProvider)
return NULL;
@@ -137,7 +137,7 @@ TMD5Auth::~TMD5Auth()
{
}
-char* TMD5Auth::getChallenge(const TCHAR *challenge)
+char* TMD5Auth::getChallenge(const wchar_t *challenge)
{
if (iCallCount > 0)
return NULL;
@@ -238,7 +238,7 @@ void TScramAuth::Hi(BYTE* res, char* passw, size_t passwLen, char* salt, size_t
}
}
-char* TScramAuth::getChallenge(const TCHAR *challenge)
+char* TScramAuth::getChallenge(const wchar_t *challenge)
{
unsigned chlLen, saltLen = 0;
ptrA snonce, salt;
@@ -315,7 +315,7 @@ char* TScramAuth::getInitialRequest()
return mir_base64_encode((PBYTE)buf, cbLen);
}
-bool TScramAuth::validateLogin(const TCHAR *challenge)
+bool TScramAuth::validateLogin(const wchar_t *challenge)
{
unsigned chlLen;
ptrA chl((char*)mir_base64_decode(_T2A(challenge), &chlLen));
@@ -370,12 +370,12 @@ char* TJabberAuth::getInitialRequest()
return NULL;
}
-char* TJabberAuth::getChallenge(const TCHAR*)
+char* TJabberAuth::getChallenge(const wchar_t*)
{
return NULL;
}
-bool TJabberAuth::validateLogin(const TCHAR*)
+bool TJabberAuth::validateLogin(const wchar_t*)
{
return true;
}
diff --git a/protocols/JabberG/src/jabber_secur.h b/protocols/JabberG/src/jabber_secur.h
index 90a3535c6a..f0099560d4 100644
--- a/protocols/JabberG/src/jabber_secur.h
+++ b/protocols/JabberG/src/jabber_secur.h
@@ -37,8 +37,8 @@ public:
virtual ~TJabberAuth();
virtual char* getInitialRequest();
- virtual char* getChallenge(const TCHAR *challenge);
- virtual bool validateLogin(const TCHAR *challenge);
+ virtual char* getChallenge(const wchar_t *challenge);
+ virtual bool validateLogin(const wchar_t *challenge);
inline const char* getName() const
{ return szName;
@@ -75,7 +75,7 @@ public:
TMD5Auth(ThreadData*);
virtual ~TMD5Auth();
- virtual char* getChallenge(const TCHAR *challenge);
+ virtual char* getChallenge(const wchar_t *challenge);
};
class TScramAuth : public TJabberAuth
@@ -88,8 +88,8 @@ public:
virtual ~TScramAuth();
virtual char* getInitialRequest();
- virtual char* getChallenge(const TCHAR *challenge);
- virtual bool validateLogin(const TCHAR *challenge);
+ virtual char* getChallenge(const wchar_t *challenge);
+ virtual bool validateLogin(const wchar_t *challenge);
void Hi(BYTE* res , char* passw, size_t passwLen, char* salt, size_t saltLen, int ind);
};
@@ -101,13 +101,13 @@ class TNtlmAuth : public TJabberAuth
typedef TJabberAuth CSuper;
HANDLE hProvider;
- const TCHAR *szHostName;
+ const wchar_t *szHostName;
public:
- TNtlmAuth(ThreadData*, const char* mechanism, const TCHAR *hostname = NULL);
+ TNtlmAuth(ThreadData*, const char* mechanism, const wchar_t *hostname = NULL);
virtual ~TNtlmAuth();
virtual char* getInitialRequest();
- virtual char* getChallenge(const TCHAR *challenge);
+ virtual char* getChallenge(const wchar_t *challenge);
- bool getSpn(TCHAR* szSpn, size_t dwSpnLen);
+ bool getSpn(wchar_t* szSpn, size_t dwSpnLen);
};
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp
index bfdee3d9c7..521d4eaa08 100644
--- a/protocols/JabberG/src/jabber_svc.cpp
+++ b/protocols/JabberG/src/jabber_svc.cpp
@@ -38,7 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
INT_PTR __cdecl CJabberProto::GetMyAwayMsg(WPARAM wParam, LPARAM lParam)
{
- TCHAR *szStatus = NULL;
+ wchar_t *szStatus = NULL;
mir_cslock lck(m_csModeMsgMutex);
switch (wParam ? (int)wParam : m_iStatus) {
@@ -74,7 +74,7 @@ INT_PTR __cdecl CJabberProto::GetMyAwayMsg(WPARAM wParam, LPARAM lParam)
INT_PTR __cdecl CJabberProto::JabberGetAvatar(WPARAM wParam, LPARAM lParam)
{
- TCHAR *buf = (TCHAR*)wParam;
+ wchar_t *buf = (wchar_t*)wParam;
int size = (int)lParam;
if (buf == NULL || size <= 0)
@@ -129,13 +129,13 @@ INT_PTR __cdecl CJabberProto::JabberGetAvatarInfo(WPARAM wParam, LPARAM lParam)
return GAIR_NOAVATAR;
}
- TCHAR tszFileName[MAX_PATH];
+ wchar_t tszFileName[MAX_PATH];
GetAvatarFileName(pai->hContact, tszFileName, _countof(tszFileName));
- _tcsncpy_s(pai->filename, tszFileName, _TRUNCATE);
+ wcsncpy_s(pai->filename, tszFileName, _TRUNCATE);
pai->format = (pai->hContact == NULL) ? PA_FORMAT_PNG : getByte(pai->hContact, "AvatarType", 0);
- if (::_taccess(pai->filename, 0) == 0) {
+ if (::_waccess(pai->filename, 0) == 0) {
ptrA szSavedHash( getStringA(pai->hContact, "AvatarSaved"));
if (szSavedHash != NULL && !mir_strcmp(szSavedHash, szHashValue)) {
debugLogA("Avatar is Ok: %s == %s", szSavedHash, szHashValue);
@@ -150,13 +150,13 @@ INT_PTR __cdecl CJabberProto::JabberGetAvatarInfo(WPARAM wParam, LPARAM lParam)
if (item != NULL) {
BOOL isXVcard = getByte(pai->hContact, "AvatarXVcard", 0);
- TCHAR szJid[JABBER_MAX_JID_LEN]; szJid[0] = 0;
+ wchar_t szJid[JABBER_MAX_JID_LEN]; szJid[0] = 0;
if (item->arResources.getCount() != NULL && !isXVcard)
- if (TCHAR *bestResName = ListGetBestClientResourceNamePtr(tszJid))
+ if (wchar_t *bestResName = ListGetBestClientResourceNamePtr(tszJid))
mir_sntprintf(szJid, L"%s/%s", tszJid, bestResName);
if (szJid[0] == 0)
- _tcsncpy_s(szJid, tszJid, _TRUNCATE);
+ wcsncpy_s(szJid, tszJid, _TRUNCATE);
debugLog(L"Rereading %s for %s", isXVcard ? JABBER_FEAT_VCARD_TEMP : JABBER_FEAT_AVATAR, szJid);
@@ -250,7 +250,7 @@ INT_PTR __cdecl CJabberProto::OnGetEventTextPresence(WPARAM, LPARAM lParam)
INT_PTR __cdecl CJabberProto::JabberSetAvatar(WPARAM, LPARAM lParam)
{
- TCHAR *tszFileName = (TCHAR*)lParam;
+ wchar_t *tszFileName = (wchar_t*)lParam;
if (m_bJabberOnline) {
SetServerVcard(TRUE, tszFileName);
@@ -258,7 +258,7 @@ INT_PTR __cdecl CJabberProto::JabberSetAvatar(WPARAM, LPARAM lParam)
}
else if (tszFileName == NULL || tszFileName[0] == 0) {
// Remove avatar
- TCHAR tFileName[ MAX_PATH ];
+ wchar_t tFileName[ MAX_PATH ];
GetAvatarFileName(NULL, tFileName, MAX_PATH);
DeleteFile(tFileName);
@@ -266,7 +266,7 @@ INT_PTR __cdecl CJabberProto::JabberSetAvatar(WPARAM, LPARAM lParam)
delSetting("AvatarHash");
}
else {
- int fileIn = _topen(tszFileName, O_RDWR | O_BINARY, S_IREAD | S_IWRITE);
+ int fileIn = _wopen(tszFileName, O_RDWR | O_BINARY, S_IREAD | S_IWRITE);
if (fileIn == -1) {
mir_free(tszFileName);
return 1;
@@ -289,7 +289,7 @@ INT_PTR __cdecl CJabberProto::JabberSetAvatar(WPARAM, LPARAM lParam)
mir_sha1_append(&sha1ctx, (BYTE*)pResult, dwPngSize);
mir_sha1_finish(&sha1ctx, digest);
- TCHAR tFileName[MAX_PATH];
+ wchar_t tFileName[MAX_PATH];
GetAvatarFileName(NULL, tFileName, MAX_PATH);
DeleteFile(tFileName);
@@ -299,7 +299,7 @@ INT_PTR __cdecl CJabberProto::JabberSetAvatar(WPARAM, LPARAM lParam)
m_options.AvatarType = ProtoGetBufferFormat(pResult);
GetAvatarFileName(NULL, tFileName, MAX_PATH);
- FILE *out = _tfopen(tFileName, L"wb");
+ FILE *out = _wfopen(tFileName, L"wb");
if (out != NULL) {
fwrite(pResult, dwPngSize, 1, out);
fclose(out);
@@ -317,7 +317,7 @@ INT_PTR __cdecl CJabberProto::JabberSetAvatar(WPARAM, LPARAM lParam)
INT_PTR __cdecl CJabberProto::JabberSetNickname(WPARAM wParam, LPARAM lParam)
{
- TCHAR *nickname = (wParam & SMNN_UNICODE) ? mir_u2t((WCHAR*)lParam) : mir_a2t((char*)lParam);
+ wchar_t *nickname = (wParam & SMNN_UNICODE) ? mir_u2t((WCHAR*)lParam) : mir_a2t((char*)lParam);
setTString("Nick", nickname);
SetServerVcard(FALSE, L"");
@@ -335,10 +335,10 @@ INT_PTR __cdecl CJabberProto::ServiceSendXML(WPARAM, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
// "/GCGetToolTipText" - gets tooltip text
-static const TCHAR *JabberEnum2AffilationStr[] = { LPGENT("None"), LPGENT("Outcast"), LPGENT("Member"), LPGENT("Admin"), LPGENT("Owner") },
- *JabberEnum2RoleStr[] = { LPGENT("None"), LPGENT("Visitor"), LPGENT("Participant"), LPGENT("Moderator") };
+static const wchar_t *JabberEnum2AffilationStr[] = { LPGENW("None"), LPGENW("Outcast"), LPGENW("Member"), LPGENW("Admin"), LPGENW("Owner") },
+ *JabberEnum2RoleStr[] = { LPGENW("None"), LPGENW("Visitor"), LPGENW("Participant"), LPGENW("Moderator") };
-static void appendString(bool bIsTipper, const TCHAR *tszTitle, const TCHAR *tszValue, CMString &out)
+static void appendString(bool bIsTipper, const wchar_t *tszTitle, const wchar_t *tszValue, CMString &out)
{
if (!out.IsEmpty())
out.Append(bIsTipper ? L"\n" : L"\r\n");
@@ -346,7 +346,7 @@ static void appendString(bool bIsTipper, const TCHAR *tszTitle, const TCHAR *tsz
if (bIsTipper)
out.AppendFormat(L"<b>%s</b>\t%s", TranslateTS(tszTitle), tszValue);
else {
- TCHAR *p = TranslateTS(tszTitle);
+ wchar_t *p = TranslateTS(tszTitle);
out.AppendFormat(L"%s%s\t%s", p, mir_tstrlen(p) <= 7 ? L"\t" : L"", tszValue);
}
}
@@ -356,11 +356,11 @@ INT_PTR __cdecl CJabberProto::JabberGCGetToolTipText(WPARAM wParam, LPARAM lPara
if (!wParam || !lParam)
return 0; //room global tooltip not supported yet
- JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_CHATROOM, (TCHAR*)wParam);
+ JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_CHATROOM, (wchar_t*)wParam);
if (item == NULL)
return 0; //no room found
- pResourceStatus info( item->findResource((TCHAR*)lParam));
+ pResourceStatus info( item->findResource((wchar_t*)lParam));
if (info == NULL)
return 0; //no info found
@@ -375,28 +375,28 @@ INT_PTR __cdecl CJabberProto::JabberGCGetToolTipText(WPARAM wParam, LPARAM lPara
//JID:
CMString outBuf;
- if (_tcschr(info->m_tszResourceName, _T('@')) != NULL)
- appendString(bIsTipper, LPGENT("JID:"), info->m_tszResourceName, outBuf);
+ if (wcschr(info->m_tszResourceName, '@') != NULL)
+ appendString(bIsTipper, LPGENW("JID:"), info->m_tszResourceName, outBuf);
else if (lParam) //or simple nick
- appendString(bIsTipper, LPGENT("Nick:"), (TCHAR*)lParam, outBuf);
+ appendString(bIsTipper, LPGENW("Nick:"), (wchar_t*)lParam, outBuf);
// status
if (info->m_iStatus >= ID_STATUS_OFFLINE && info->m_iStatus <= ID_STATUS_IDLE )
- appendString(bIsTipper, LPGENT("Status:"), pcli->pfnGetStatusModeDescription(info->m_iStatus, 0), outBuf);
+ appendString(bIsTipper, LPGENW("Status:"), pcli->pfnGetStatusModeDescription(info->m_iStatus, 0), outBuf);
// status text
if (info->m_tszStatusMessage)
- appendString(bIsTipper, LPGENT("Status message:"), info->m_tszStatusMessage, outBuf);
+ appendString(bIsTipper, LPGENW("Status message:"), info->m_tszStatusMessage, outBuf);
// Role
- appendString(bIsTipper, LPGENT("Role:"), TranslateTS(JabberEnum2RoleStr[info->m_role]), outBuf);
+ appendString(bIsTipper, LPGENW("Role:"), TranslateTS(JabberEnum2RoleStr[info->m_role]), outBuf);
// Affiliation
- appendString(bIsTipper, LPGENT("Affiliation:"), TranslateTS(JabberEnum2AffilationStr[info->m_affiliation]), outBuf);
+ appendString(bIsTipper, LPGENW("Affiliation:"), TranslateTS(JabberEnum2AffilationStr[info->m_affiliation]), outBuf);
// real jid
if (info->m_tszRealJid)
- appendString(bIsTipper, LPGENT("Real JID:"), info->m_tszRealJid, outBuf);
+ appendString(bIsTipper, LPGENW("Real JID:"), info->m_tszRealJid, outBuf);
return (outBuf.IsEmpty() ? NULL : (INT_PTR)mir_tstrdup(outBuf));
}
@@ -404,32 +404,32 @@ INT_PTR __cdecl CJabberProto::JabberGCGetToolTipText(WPARAM wParam, LPARAM lPara
// File Association Manager plugin support
INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam)
{
- TCHAR *arg = (TCHAR *)lParam;
+ wchar_t *arg = (wchar_t *)lParam;
if (arg == NULL)
return 1;
// skip leading prefix
- TCHAR szUri[ 1024 ];
- _tcsncpy_s(szUri, arg, _TRUNCATE);
- TCHAR *szJid = _tcschr(szUri, _T(':'));
+ wchar_t szUri[ 1024 ];
+ wcsncpy_s(szUri, arg, _TRUNCATE);
+ wchar_t *szJid = wcschr(szUri, ':');
if (szJid == NULL)
return 1;
// skip //
- for (++szJid; *szJid == _T('/'); ++szJid);
+ for (++szJid; *szJid == '/'; ++szJid);
// empty jid?
if (!*szJid)
return 1;
// command code
- TCHAR *szCommand = szJid;
- szCommand = _tcschr(szCommand, _T('?'));
+ wchar_t *szCommand = szJid;
+ szCommand = wcschr(szCommand, '?');
if (szCommand)
*(szCommand++) = 0;
// parameters
- TCHAR *szSecondParam = szCommand ? _tcschr(szCommand, _T(';')) : NULL;
+ wchar_t *szSecondParam = szCommand ? wcschr(szCommand, ';') : NULL;
if (szSecondParam)
*(szSecondParam++) = 0;
@@ -439,7 +439,7 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam)
if (!ServiceExists(MS_MSG_SENDMESSAGEW))
return 1;
- TCHAR *szMsgBody = NULL;
+ wchar_t *szMsgBody = NULL;
MCONTACT hContact = HContactFromJID(szJid, false);
if (hContact == NULL)
hContact = DBCreateContact(szJid, szJid, true, true);
@@ -447,10 +447,10 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam)
return 1;
if (szSecondParam) { //there are parameters to message
- szMsgBody = _tcsstr(szSecondParam, L"body=");
+ szMsgBody = wcsstr(szSecondParam, L"body=");
if (szMsgBody) {
szMsgBody += 5;
- TCHAR *szDelim = _tcschr(szMsgBody, _T(';'));
+ wchar_t *szDelim = wcschr(szMsgBody, ';');
if (szDelim)
szDelim = 0;
JabberHttpUrlDecode(szMsgBody);
@@ -466,8 +466,8 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam)
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
psr.flags = PSR_TCHAR;
- psr.nick.t = szJid;
- psr.id.t = szJid;
+ psr.nick.w = szJid;
+ psr.id.w = szJid;
ADDCONTACTSTRUCT acs;
acs.handleType = HANDLE_SEARCHRESULT;
@@ -493,7 +493,7 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam)
// ad-hoc commands
if (!mir_tstrcmpi(szCommand, L"command")) {
if (szSecondParam) {
- if (!_tcsnicmp(szSecondParam, L"node=", 5)) {
+ if (!wcsnicmp(szSecondParam, L"node=", 5)) {
szSecondParam += 5;
if (!*szSecondParam)
szSecondParam = NULL;
@@ -529,12 +529,12 @@ INT_PTR __cdecl CJabberProto::JabberSendNudge(WPARAM hContact, LPARAM)
if (jid == NULL)
return 0;
- TCHAR tszJid[JABBER_MAX_JID_LEN];
- TCHAR *szResource = ListGetBestClientResourceNamePtr(jid);
+ wchar_t tszJid[JABBER_MAX_JID_LEN];
+ wchar_t *szResource = ListGetBestClientResourceNamePtr(jid);
if (szResource)
mir_sntprintf(tszJid, L"%s/%s", jid, szResource);
else
- _tcsncpy_s(tszJid, jid, _TRUNCATE);
+ wcsncpy_s(tszJid, jid, _TRUNCATE);
m_ThreadInfo->send(
XmlNode(L"message") << XATTR(L"type", L"headline") << XATTR(L"to", tszJid)
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index 328ada850e..074476651f 100755
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -60,9 +60,9 @@ struct JabberPasswordDlgParam
BOOL saveOnlinePassword;
WORD dlgResult;
- TCHAR onlinePassword[128];
+ wchar_t onlinePassword[128];
HANDLE hEventPasswdDlg;
- TCHAR *ptszJid;
+ wchar_t *ptszJid;
};
static INT_PTR CALLBACK JabberPasswordDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -76,7 +76,7 @@ static INT_PTR CALLBACK JabberPasswordDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
param = (JabberPasswordDlgParam*)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
- TCHAR text[512];
+ wchar_t text[512];
mir_sntprintf(text, TranslateT("Enter password for %s"), param->ptszJid);
SetDlgItemText(hwndDlg, IDC_JID, text);
@@ -246,7 +246,7 @@ void CJabberProto::ServerThread(JABBER_CONN_DATA *pParam)
m_ThreadInfo = &info;
if ((tszValue = getTStringA("LoginName")) != NULL)
- _tcsncpy_s(info.conn.username, tszValue, _TRUNCATE);
+ wcsncpy_s(info.conn.username, tszValue, _TRUNCATE);
if (*rtrimt(info.conn.username) == '\0') {
DWORD dwSize = _countof(info.conn.username);
@@ -283,20 +283,20 @@ LBL_FatalError:
}
else {
if ((tszValue = getTStringA("Resource")) != NULL)
- _tcsncpy_s(info.resource, tszValue, _TRUNCATE);
+ wcsncpy_s(info.resource, tszValue, _TRUNCATE);
else
mir_tstrcpy(info.resource, L"Miranda");
}
- TCHAR jidStr[512];
+ wchar_t jidStr[512];
mir_sntprintf(jidStr, L"%s@%S/%s", info.conn.username, info.conn.server, info.resource);
- _tcsncpy_s(info.fullJID, jidStr, _TRUNCATE);
+ wcsncpy_s(info.fullJID, jidStr, _TRUNCATE);
if (m_options.UseDomainLogin) // in the case of NTLM auth we have no need in password
info.conn.password[0] = 0;
else if (!m_options.SavePassword) { // we have to enter a password manually. have we done it before?
if (m_savedPassword != NULL)
- _tcsncpy_s(info.conn.password, m_savedPassword, _TRUNCATE);
+ wcsncpy_s(info.conn.password, m_savedPassword, _TRUNCATE);
else {
mir_sntprintf(jidStr, L"%s@%S", info.conn.username, info.conn.server);
@@ -315,7 +315,7 @@ LBL_FatalError:
}
m_savedPassword = (param.saveOnlinePassword) ? mir_tstrdup(param.onlinePassword) : NULL;
- _tcsncpy_s(info.conn.password, param.onlinePassword, _TRUNCATE);
+ wcsncpy_s(info.conn.password, param.onlinePassword, _TRUNCATE);
}
}
else {
@@ -325,7 +325,7 @@ LBL_FatalError:
debugLogA("Thread ended, password is not configured");
goto LBL_FatalError;
}
- _tcsncpy_s(info.conn.password, tszPassw, _TRUNCATE);
+ wcsncpy_s(info.conn.password, tszPassw, _TRUNCATE);
}
}
else {
@@ -391,7 +391,7 @@ LBL_FatalError:
if (m_iDesiredStatus != ID_STATUS_OFFLINE || info.bIsReg) {
if (!info.bIsReg) {
size_t len = mir_tstrlen(info.conn.username) + mir_strlen(info.conn.server) + 1;
- m_szJabberJID = (TCHAR*)mir_alloc(sizeof(TCHAR)*(len + 1));
+ m_szJabberJID = (wchar_t*)mir_alloc(sizeof(wchar_t)*(len + 1));
mir_sntprintf(m_szJabberJID, len + 1, L"%s@%S", info.conn.username, info.conn.server);
m_bSendKeepAlive = m_options.KeepAlive != 0;
setTString("jid", m_szJabberJID); // store jid in database
@@ -400,7 +400,7 @@ LBL_FatalError:
}
xmlStreamInitializeNow(&info);
- const TCHAR *tag = L"stream:stream";
+ const wchar_t *tag = L"stream:stream";
debugLogA("Entering main recv loop");
int datalen = 0;
@@ -573,7 +573,7 @@ void CJabberProto::OnProcessStreamOpening(HXML node, ThreadData *info)
return;
if (!info->bIsReg) {
- const TCHAR *sid = XmlGetAttrValue(node, L"id");
+ const wchar_t *sid = XmlGetAttrValue(node, L"id");
if (sid != NULL)
info->szStreamId = mir_t2a(sid);
}
@@ -653,7 +653,7 @@ void CJabberProto::PerformAuthentication(ThreadData *info)
return;
}
- TCHAR text[1024];
+ wchar_t text[1024];
mir_sntprintf(text, TranslateT("Authentication failed for %s@%S."), info->conn.username, info->conn.server);
MsgPopup(NULL, text, TranslateT("Jabber Authentication"));
JLoginFailed(LOGINERR_WRONGPASSWORD);
@@ -731,7 +731,7 @@ void CJabberProto::OnProcessFeatures(HXML node, ThreadData *info)
else if (!mir_tstrcmp(ptszMechanism, L"GSSAPI")) m_AuthMechs.isKerberosAvailable = true;
}
else if (!mir_tstrcmp(XmlGetName(c), L"hostname")) {
- const TCHAR *mech = XmlGetAttrValue(c, L"mechanism");
+ const wchar_t *mech = XmlGetAttrValue(c, L"mechanism");
if (mech && mir_tstrcmpi(mech, L"GSSAPI") == 0) {
m_AuthMechs.m_gssapiHostName = mir_tstrdup(XmlGetText(c));
}
@@ -770,7 +770,7 @@ void CJabberProto::OnProcessFeatures(HXML node, ThreadData *info)
void CJabberProto::OnProcessFailure(HXML node, ThreadData *info)
{
- const TCHAR *type;
+ const wchar_t *type;
//failure xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\"
if ((type = XmlGetAttrValue(node, L"xmlns")) == NULL) return;
if (!mir_tstrcmp(type, L"urn:ietf:params:xml:ns:xmpp-sasl")) {
@@ -780,7 +780,7 @@ void CJabberProto::OnProcessFailure(HXML node, ThreadData *info)
void CJabberProto::OnProcessError(HXML node, ThreadData *info)
{
- TCHAR *buff;
+ wchar_t *buff;
int i;
int pos;
bool skipMsg = false;
@@ -789,15 +789,15 @@ void CJabberProto::OnProcessError(HXML node, ThreadData *info)
if (!XmlGetChild(node, 0))
return;
- buff = (TCHAR *)mir_alloc(1024 * sizeof(TCHAR));
+ buff = (wchar_t *)mir_alloc(1024 * sizeof(wchar_t));
pos = 0;
for (i = 0;; i++) {
HXML n = XmlGetChild(node, i);
if (!n)
break;
- const TCHAR *name = XmlGetName(n);
- const TCHAR *desc = XmlGetText(n);
+ const wchar_t *name = XmlGetName(n);
+ const wchar_t *desc = XmlGetText(n);
if (desc)
pos += mir_sntprintf(buff + pos, 1024 - pos, L"%s: %s\r\n", name, desc);
else
@@ -816,7 +816,7 @@ void CJabberProto::OnProcessError(HXML node, ThreadData *info)
void CJabberProto::OnProcessSuccess(HXML node, ThreadData *info)
{
- const TCHAR *type;
+ const wchar_t *type;
// int iqId;
// RECVED: <success ...
// ACTION: if successfully logged in, continue by requesting roster list and set my initial status
@@ -894,7 +894,7 @@ void CJabberProto::OnProcessProtocol(HXML node, ThreadData *info)
void CJabberProto::OnProcessProceed(HXML node, ThreadData *info)
{
- const TCHAR *type;
+ const wchar_t *type;
if ((type = XmlGetAttrValue(node, L"xmlns")) != NULL && !mir_tstrcmp(type, L"error"))
return;
@@ -922,7 +922,7 @@ void CJabberProto::OnProcessCompressed(HXML node, ThreadData *info)
{
debugLogA("Compression confirmed");
- const TCHAR *type = XmlGetAttrValue(node, L"xmlns");
+ const wchar_t *type = XmlGetAttrValue(node, L"xmlns");
if (type != NULL && !mir_tstrcmp(type, L"error"))
return;
if (mir_tstrcmp(type, L"http://jabber.org/protocol/compress"))
@@ -938,7 +938,7 @@ void CJabberProto::OnProcessCompressed(HXML node, ThreadData *info)
void CJabberProto::OnProcessPubsubEvent(HXML node)
{
- const TCHAR *from = XmlGetAttrValue(node, L"from");
+ const wchar_t *from = XmlGetAttrValue(node, L"from");
if (!from)
return;
@@ -964,16 +964,16 @@ void CJabberProto::OnProcessPubsubEvent(HXML node)
if (!tuneNode)
return;
- const TCHAR *szArtist = XPathT(tuneNode, "artist");
- const TCHAR *szLength = XPathT(tuneNode, "length");
- const TCHAR *szSource = XPathT(tuneNode, "source");
- const TCHAR *szTitle = XPathT(tuneNode, "title");
- const TCHAR *szTrack = XPathT(tuneNode, "track");
+ const wchar_t *szArtist = XPathT(tuneNode, "artist");
+ const wchar_t *szLength = XPathT(tuneNode, "length");
+ const wchar_t *szSource = XPathT(tuneNode, "source");
+ const wchar_t *szTitle = XPathT(tuneNode, "title");
+ const wchar_t *szTrack = XPathT(tuneNode, "track");
- TCHAR szLengthInTime[32];
+ wchar_t szLengthInTime[32];
szLengthInTime[0] = 0;
if (szLength) {
- int nLength = _ttoi(szLength);
+ int nLength = _wtoi(szLength);
mir_sntprintf(szLengthInTime, L"%02d:%02d:%02d", nLength / 3600, (nLength / 60) % 60, nLength % 60);
}
@@ -1003,12 +1003,12 @@ DWORD JabberGetLastContactMessageTime(MCONTACT hContact)
return dwTime;
}
-MCONTACT CJabberProto::CreateTemporaryContact(const TCHAR *szJid, JABBER_LIST_ITEM* chatItem)
+MCONTACT CJabberProto::CreateTemporaryContact(const wchar_t *szJid, JABBER_LIST_ITEM* chatItem)
{
if (chatItem == NULL)
return DBCreateContact(szJid, ptrT(JabberNickFromJID(szJid)), true, true);
- const TCHAR *p = _tcschr(szJid, '/');
+ const wchar_t *p = wcschr(szJid, '/');
if (p != NULL && p[1] != '\0')
p++;
else
@@ -1058,7 +1058,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
return;
}
- const TCHAR *szMessage = NULL;
+ const wchar_t *szMessage = NULL;
HXML bodyNode = XmlGetChildByTag(node, "body", "xml:lang", m_tszSelectedLang);
if (bodyNode == NULL)
bodyNode = XmlGetChild(node, "body");
@@ -1068,7 +1068,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
LPCTSTR ptszSubject = XmlGetText(XmlGetChild(node, "subject"));
if (ptszSubject && *ptszSubject) {
size_t cbLen = (szMessage ? mir_tstrlen(szMessage) : 0) + mir_tstrlen(ptszSubject) + 128;
- TCHAR *szTmp = (TCHAR *)alloca(sizeof(TCHAR) * cbLen);
+ wchar_t *szTmp = (wchar_t *)alloca(sizeof(wchar_t) * cbLen);
szTmp[0] = 0;
if (szMessage)
mir_tstrcat(szTmp, L"Subject: ");
@@ -1083,10 +1083,10 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
if (szMessage && (n = XmlGetChildByTag(node, "addresses", "xmlns", JABBER_FEAT_EXT_ADDRESSING))) {
HXML addressNode = XmlGetChildByTag(n, "address", "type", L"ofrom");
if (addressNode) {
- const TCHAR *szJid = XmlGetAttrValue(addressNode, L"jid");
+ const wchar_t *szJid = XmlGetAttrValue(addressNode, L"jid");
if (szJid) {
size_t cbLen = mir_tstrlen(szMessage) + 1000;
- TCHAR *p = (TCHAR*)alloca(sizeof(TCHAR) * cbLen);
+ wchar_t *p = (wchar_t*)alloca(sizeof(wchar_t) * cbLen);
mir_sntprintf(p, cbLen, TranslateT("Message redirected from: %s\r\n%s"), from, szMessage);
szMessage = p;
from = szJid;
@@ -1103,10 +1103,10 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
time_t msgTime = 0;
bool isChatRoomInvitation = false;
- const TCHAR *inviteRoomJid = NULL;
- const TCHAR *inviteFromJid = NULL;
- const TCHAR *inviteReason = NULL;
- const TCHAR *invitePassword = NULL;
+ const wchar_t *inviteRoomJid = NULL;
+ const wchar_t *inviteFromJid = NULL;
+ const wchar_t *inviteReason = NULL;
+ const wchar_t *invitePassword = NULL;
bool isDelivered = false;
// check chatstates availability
@@ -1161,9 +1161,9 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
}
if ((n = XmlGetChildByTag(node, "confirm", "xmlns", JABBER_FEAT_HTTP_AUTH)) && m_options.AcceptHttpAuth) {
- const TCHAR *szId = XmlGetAttrValue(n, L"id");
- const TCHAR *szMethod = XmlGetAttrValue(n, L"method");
- const TCHAR *szUrl = XmlGetAttrValue(n, L"url");
+ const wchar_t *szId = XmlGetAttrValue(n, L"id");
+ const wchar_t *szMethod = XmlGetAttrValue(n, L"method");
+ const wchar_t *szUrl = XmlGetAttrValue(n, L"url");
if (!szId || !szMethod || !szUrl)
return;
@@ -1190,7 +1190,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
if ((xNode = XmlGetNthChild(node, L"x", i + 1)) == NULL)
continue;
- const TCHAR *ptszXmlns = XmlGetAttrValue(xNode, L"xmlns");
+ const wchar_t *ptszXmlns = XmlGetAttrValue(xNode, L"xmlns");
if (ptszXmlns == NULL)
continue;
@@ -1205,29 +1205,29 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
//XEP-0027 is not strict enough, different clients have different implementations
//additional validation is required
- TCHAR *prolog = L"-----BEGIN PGP MESSAGE-----";
- TCHAR *prolog_newline = L"\r\n\r\n";
- TCHAR *epilog = L"\r\n-----END PGP MESSAGE-----\r\n";
+ wchar_t *prolog = L"-----BEGIN PGP MESSAGE-----";
+ wchar_t *prolog_newline = L"\r\n\r\n";
+ wchar_t *epilog = L"\r\n-----END PGP MESSAGE-----\r\n";
size_t len = 0;
- TCHAR *tempstring = nullptr;
- if(!_tcsstr(ptszText, prolog))
+ wchar_t *tempstring = nullptr;
+ if(!wcsstr(ptszText, prolog))
{
len = mir_tstrlen(prolog) + mir_tstrlen(prolog_newline) + mir_tstrlen(ptszText) + mir_tstrlen(epilog) + 3;
- tempstring = (TCHAR*)_alloca(sizeof(TCHAR)*len);
+ tempstring = (wchar_t*)_alloca(sizeof(wchar_t)*len);
mir_sntprintf(tempstring, len, L"%s%s%s%s", prolog, prolog_newline, ptszText, epilog);
}
else
{
len = mir_tstrlen(ptszText) + 3;
- tempstring = (TCHAR*)_alloca(sizeof(TCHAR)*len);
+ tempstring = (wchar_t*)_alloca(sizeof(wchar_t)*len);
mir_sntprintf(tempstring, len, L"%s", ptszText);
}
szMessage = tempstring;
}
else if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_DELAY) && msgTime == 0) {
- const TCHAR *ptszTimeStamp = XmlGetAttrValue(xNode, L"stamp");
+ const wchar_t *ptszTimeStamp = XmlGetAttrValue(xNode, L"stamp");
if (ptszTimeStamp != NULL)
msgTime = JabberIsoToUnixTime(ptszTimeStamp);
}
@@ -1246,8 +1246,8 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
if (XmlGetChild(xNode, "delivered") != NULL || XmlGetChild(xNode, "offline") != NULL) {
int id = -1;
if (idNode != NULL && XmlGetText(idNode) != NULL)
- if (!_tcsncmp(XmlGetText(idNode), _T(JABBER_IQID), mir_strlen(JABBER_IQID)))
- id = _ttoi((XmlGetText(idNode)) + mir_strlen(JABBER_IQID));
+ if (!wcsncmp(XmlGetText(idNode), _T(JABBER_IQID), mir_strlen(JABBER_IQID)))
+ id = _wtoi((XmlGetText(idNode)) + mir_strlen(JABBER_IQID));
if (id != -1)
ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)id, 0);
@@ -1283,7 +1283,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
LPCTSTR ptszUrl = XmlGetText(XmlGetChild(xNode, "url"));
if (ptszUrl != NULL && *ptszUrl) {
size_t cbLen = (szMessage ? mir_tstrlen(szMessage) : 0) + mir_tstrlen(ptszUrl) + 32;
- TCHAR *szTmp = (TCHAR *)alloca(sizeof(TCHAR)* cbLen);
+ wchar_t *szTmp = (wchar_t *)alloca(sizeof(wchar_t)* cbLen);
mir_tstrcpy(szTmp, ptszUrl);
if (szMessage) {
mir_tstrcat(szTmp, L"\r\n");
@@ -1306,18 +1306,18 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
}
else if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_ROSTER_EXCHANGE) &&
item != NULL && (item->subscription == SUB_BOTH || item->subscription == SUB_TO)) {
- TCHAR chkJID[JABBER_MAX_JID_LEN] = L"@";
+ wchar_t chkJID[JABBER_MAX_JID_LEN] = L"@";
JabberStripJid(from, chkJID + 1, _countof(chkJID) - 1);
for (int j = 1;; j++) {
HXML iNode = XmlGetNthChild(xNode, L"item", j);
if (iNode == NULL)
break;
- const TCHAR *action = XmlGetAttrValue(iNode, L"action");
- const TCHAR *jid = XmlGetAttrValue(iNode, L"jid");
- const TCHAR *nick = XmlGetAttrValue(iNode, L"name");
- const TCHAR *group = XmlGetText(XmlGetChild(iNode, L"group"));
- if (action && jid && _tcsstr(jid, chkJID)) {
+ const wchar_t *action = XmlGetAttrValue(iNode, L"action");
+ const wchar_t *jid = XmlGetAttrValue(iNode, L"jid");
+ const wchar_t *nick = XmlGetAttrValue(iNode, L"name");
+ const wchar_t *group = XmlGetText(XmlGetChild(iNode, L"group"));
+ if (action && jid && wcsstr(jid, chkJID)) {
if (!mir_tstrcmp(action, L"add")) {
MCONTACT cc = DBCreateContact(jid, nick, false, false);
if (group)
@@ -1403,7 +1403,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
// XEP-0115: Entity Capabilities
void CJabberProto::OnProcessPresenceCapabilites(HXML node)
{
- const TCHAR *from = XmlGetAttrValue(node, L"from");
+ const wchar_t *from = XmlGetAttrValue(node, L"from");
if (from == NULL)
return;
@@ -1418,9 +1418,9 @@ void CJabberProto::OnProcessPresenceCapabilites(HXML node)
if ((n = XmlGetChildByTag(node, "c", "xmlns", JABBER_FEAT_ENTITY_CAPS)) != NULL ||
(n = XmlGetChild(node, "c")) != NULL)
{
- const TCHAR *szNode = XmlGetAttrValue(n, L"node");
- const TCHAR *szVer = XmlGetAttrValue(n, L"ver");
- const TCHAR *szExt = XmlGetAttrValue(n, L"ext");
+ const wchar_t *szNode = XmlGetAttrValue(n, L"node");
+ const wchar_t *szVer = XmlGetAttrValue(n, L"ver");
+ const wchar_t *szExt = XmlGetAttrValue(n, L"ext");
if (szNode && szVer) {
r->m_tszCapsNode = mir_tstrdup(szNode);
r->m_tszCapsVer = mir_tstrdup(szVer);
@@ -1435,7 +1435,7 @@ void CJabberProto::OnProcessPresenceCapabilites(HXML node)
// JabberCapsBits jcbCaps = GetResourceCapabilites(from, TRUE);
}
-void CJabberProto::UpdateJidDbSettings(const TCHAR *jid)
+void CJabberProto::UpdateJidDbSettings(const wchar_t *jid)
{
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid);
if (item == NULL) return;
@@ -1446,7 +1446,7 @@ void CJabberProto::UpdateJidDbSettings(const TCHAR *jid)
int status = ID_STATUS_OFFLINE;
if (!item->arResources.getCount()) {
// set offline only if jid has resources
- if (_tcschr(jid, '/') == NULL)
+ if (wcschr(jid, '/') == NULL)
status = item->getTemp()->m_iStatus;
if (item->getTemp()->m_tszStatusMessage)
db_set_ts(hContact, "CList", "StatusMsg", item->getTemp()->m_tszStatusMessage);
@@ -1481,7 +1481,7 @@ void CJabberProto::UpdateJidDbSettings(const TCHAR *jid)
}
else delSetting(hContact, DBSETTING_DISPLAY_UID);
- if (_tcschr(jid, '@') != NULL || m_options.ShowTransport == TRUE)
+ if (wcschr(jid, '@') != NULL || m_options.ShowTransport == TRUE)
if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != status)
setWord(hContact, "Status", (WORD)status);
@@ -1514,9 +1514,9 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
MCONTACT hContact;
bool bSelfPresence = false;
- TCHAR szBareFrom[JABBER_MAX_JID_LEN];
+ wchar_t szBareFrom[JABBER_MAX_JID_LEN];
JabberStripJid(from, szBareFrom, _countof(szBareFrom));
- TCHAR szBareOurJid[JABBER_MAX_JID_LEN];
+ wchar_t szBareOurJid[JABBER_MAX_JID_LEN];
JabberStripJid(info->fullJID, szBareOurJid, _countof(szBareOurJid));
if (!mir_tstrcmpi(szBareFrom, szBareOurJid))
@@ -1552,7 +1552,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
char priority = 0;
if (LPCTSTR ptszPriority = XmlGetText(XmlGetChild(node, "priority")))
- priority = (char)_ttoi(ptszPriority);
+ priority = (char)_wtoi(ptszPriority);
ListAddResource(LIST_ROSTER, from, status, XmlGetText(XmlGetChild(node, "status")), priority);
@@ -1561,7 +1561,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
UpdateJidDbSettings(from);
- if (_tcschr(from, '@') == NULL) {
+ if (wcschr(from, '@') == NULL) {
UI_SAFE_NOTIFY(m_pDlgServiceDiscovery, WM_JABBER_TRANSPORT_REFRESH);
}
debugLog(L"%s (%s) online, set contact status to %s", nick, from, pcli->pfnGetStatusModeDescription(status, 0));
@@ -1643,7 +1643,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
UpdateJidDbSettings(from);
- if (_tcschr(from, '@') == NULL)
+ if (wcschr(from, '@') == NULL)
UI_SAFE_NOTIFY(m_pDlgServiceDiscovery, WM_JABBER_TRANSPORT_REFRESH);
DBCheckIsTransportedContact(from, hContact);
@@ -1665,7 +1665,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
}
// automatically send authorization allowed to agent/transport
- if (_tcschr(from, '@') == NULL || m_options.AutoAcceptAuthorization) {
+ if (wcschr(from, '@') == NULL || m_options.AutoAcceptAuthorization) {
ListAdd(LIST_ROSTER, from, hContact);
info->send(XmlNode(L"presence") << XATTR(L"to", from) << XATTR(L"type", L"subscribed"));
@@ -1710,7 +1710,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
if (item->subscription == SUB_FROM) item->subscription = SUB_BOTH;
else if (item->subscription == SUB_NONE) {
item->subscription = SUB_TO;
- if (_tcschr(from, '@') == NULL) {
+ if (wcschr(from, '@') == NULL) {
UI_SAFE_NOTIFY(m_pDlgServiceDiscovery, WM_JABBER_TRANSPORT_REFRESH);
}
}
@@ -1799,7 +1799,7 @@ BOOL CJabberProto::OnProcessJingle(HXML node)
void CJabberProto::OnProcessIq(HXML node)
{
HXML queryNode;
- const TCHAR *type, *xmlns;
+ const wchar_t *type, *xmlns;
if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), L"iq")) return;
if ((type = XmlGetAttrValue(node, L"type")) == NULL) return;
@@ -1823,8 +1823,8 @@ void CJabberProto::OnProcessIq(HXML node)
// RECVED: <iq type='error'> ...
if (!mir_tstrcmp(type, L"error")) {
- TCHAR tszBuf[20];
- _itot(id, tszBuf, 10);
+ wchar_t tszBuf[20];
+ _itow(id, tszBuf, 10);
debugLogA("XXX on entry");
// Check for file transfer deny by comparing idStr with ft->iqId
@@ -1856,9 +1856,9 @@ ThreadData *m_regInfo;
void CJabberProto::SetRegConfig(HXML node, void *from)
{
if (m_regInfo && from) {
- TCHAR text[MAX_PATH];
+ wchar_t text[MAX_PATH];
mir_sntprintf(text, L"%s@%S", m_regInfo->conn.username, m_regInfo->conn.server);
- XmlNodeIq iq(L"set", SerialNext(), (TCHAR*)from);
+ XmlNodeIq iq(L"set", SerialNext(), (wchar_t*)from);
iq << XATTR(L"from", text);
HXML query = iq << XQUERY(JABBER_FEAT_REGISTER);
XmlAddChild(query, node);
@@ -1918,7 +1918,7 @@ void CJabberProto::OnProcessRegIq(HXML node, ThreadData *info)
}
else if (!mir_tstrcmp(type, L"error")) {
- TCHAR *str = JabberErrorMsg(XmlGetChild(node, "error"));
+ wchar_t *str = JabberErrorMsg(XmlGetChild(node, "error"));
SendMessage(info->conn.reg_hwndDlg, WM_JABBER_REGDLG_UPDATE, 100, (LPARAM)str);
mir_free(str);
info->reg_done = TRUE;
@@ -2025,11 +2025,11 @@ int ThreadData::send(HXML node)
proto->OnConsoleProcessXml(node, JCPF_OUT);
- TCHAR *str = xmlToString(node, NULL);
+ wchar_t *str = xmlToString(node, NULL);
// strip forbidden control characters from outgoing XML stream
- TCHAR *q = str;
- for (TCHAR *p = str; *p; ++p) {
+ wchar_t *q = str;
+ for (wchar_t *p = str; *p; ++p) {
WCHAR c = *p;
if (c < 32 && c != '\t' && c != '\n' && c != '\r')
diff --git a/protocols/JabberG/src/jabber_treelist.cpp b/protocols/JabberG/src/jabber_treelist.cpp
index 33d0acf232..c3d2bdb878 100644
--- a/protocols/JabberG/src/jabber_treelist.cpp
+++ b/protocols/JabberG/src/jabber_treelist.cpp
@@ -41,7 +41,7 @@ struct TTreeList_ItemInfo
struct TTreeList_ItemInfo *parent;
int iIcon, iOverlay;
- LIST<TCHAR> text;
+ LIST<wchar_t> text;
LPARAM data;
LIST<TTreeList_ItemInfo> subItems;
@@ -61,7 +61,7 @@ struct TTreeList_ItemInfo
struct TTreeList_Data
{
int mode, sortMode;
- TCHAR *filter;
+ wchar_t *filter;
HTREELISTITEM hItemSelected;
TTreeList_ItemInfo *root;
@@ -178,7 +178,7 @@ void TreeList_SetSortMode(HWND hwnd, int col, BOOL descending)
TreeList_Update(hwnd);
}
-void TreeList_SetFilter(HWND hwnd, TCHAR *filter)
+void TreeList_SetFilter(HWND hwnd, wchar_t *filter)
{
TTreeList_Data *data = (TTreeList_Data *)sttTreeList_GeWindowData(hwnd);
if (data->filter) mir_free(data->filter);
@@ -199,7 +199,7 @@ HTREELISTITEM TreeList_GetActiveItem(HWND hwnd)
return (HTREELISTITEM)lvi.lParam;
}
-HTREELISTITEM TreeList_AddItem(HWND hwnd, HTREELISTITEM hParent, TCHAR *text, LPARAM nodeDdata)
+HTREELISTITEM TreeList_AddItem(HWND hwnd, HTREELISTITEM hParent, wchar_t *text, LPARAM nodeDdata)
{
TTreeList_Data *data = (TTreeList_Data *)sttTreeList_GeWindowData(hwnd);
if (!hParent) hParent = data->root;
@@ -239,7 +239,7 @@ void TreeList_MakeFakeParent(HTREELISTITEM hItem, BOOL flag)
hItem->flags |= TLIF_MODIFIED;
}
-void TreeList_AppendColumn(HTREELISTITEM hItem, TCHAR *text)
+void TreeList_AppendColumn(HTREELISTITEM hItem, wchar_t *text)
{
hItem->text.insert(mir_tstrdup(text));
hItem->flags |= TLIF_MODIFIED;
@@ -509,7 +509,7 @@ static void sttTreeList_FilterItems(HTREELISTITEM hItem, LPARAM data)
{
int i = 0;
for (i=0; i < hItem->text.getCount(); i++)
- if (JabberStrIStr(hItem->text[i], (TCHAR *)data))
+ if (JabberStrIStr(hItem->text[i], (wchar_t *)data))
break;
if (i < hItem->text.getCount()) {
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp
index a4f11912b4..6b0907a7b3 100644
--- a/protocols/JabberG/src/jabber_userinfo.cpp
+++ b/protocols/JabberG/src/jabber_userinfo.cpp
@@ -37,28 +37,28 @@ struct UserInfoStringBuf
{
enum { STRINGBUF_INCREMENT = 1024 };
- TCHAR *buf;
+ wchar_t *buf;
size_t size, offset;
UserInfoStringBuf() { buf = 0; size = 0; offset = 0; }
~UserInfoStringBuf() { mir_free(buf); }
- void append(TCHAR *str) {
+ void append(wchar_t *str) {
if (!str) return;
size_t length = mir_tstrlen(str);
if (size - offset < length + 1) {
size += (length + STRINGBUF_INCREMENT);
- buf = (TCHAR *)mir_realloc(buf, size * sizeof(TCHAR));
+ buf = (wchar_t *)mir_realloc(buf, size * sizeof(wchar_t));
}
mir_tstrcpy(buf + offset, str);
offset += length;
}
- TCHAR* allocate(int length) {
+ wchar_t* allocate(int length) {
if (size - offset < length) {
size += (length + STRINGBUF_INCREMENT);
- buf = (TCHAR *)mir_realloc(buf, size * sizeof(TCHAR));
+ buf = (wchar_t *)mir_realloc(buf, size * sizeof(wchar_t));
}
return buf + offset;
}
@@ -168,11 +168,11 @@ void sttCleanupInfo(HWND hwndTree, int stage)
}
}
-static HTREEITEM sttFillInfoLine(HWND hwndTree, HTREEITEM htiRoot, HICON hIcon, TCHAR *title, TCHAR *value, LPARAM id=INFOLINE_BAD_ID, bool expand=false)
+static HTREEITEM sttFillInfoLine(HWND hwndTree, HTREEITEM htiRoot, HICON hIcon, wchar_t *title, wchar_t *value, LPARAM id=INFOLINE_BAD_ID, bool expand=false)
{
HTREEITEM hti = sttFindInfoLine(hwndTree, htiRoot, id);
- TCHAR buf[256];
+ wchar_t buf[256];
if (title)
mir_sntprintf(buf, L"%s: %s", title, value);
else
@@ -210,7 +210,7 @@ static HTREEITEM sttFillInfoLine(HWND hwndTree, HTREEITEM htiRoot, HICON hIcon,
static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM htiRoot, JABBER_LIST_ITEM *item, int resource)
{
- TCHAR buf[256];
+ wchar_t buf[256];
HTREEITEM htiResource = htiRoot;
pResourceStatus r = resource ? item->arResources[resource-1] : item->getTemp();
@@ -250,13 +250,13 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti
sttInfoLineId(resource, INFOLINE_SYSTEM));
// Resource priority
- TCHAR szPriority[128];
+ wchar_t szPriority[128];
mir_sntprintf(szPriority, L"%d", (int)r->m_iPriority);
sttFillInfoLine(hwndTree, htiResource, NULL, TranslateT("Resource priority"), szPriority, sttInfoLineId(resource, INFOLINE_PRIORITY));
// Idle
if (r->m_dwIdleStartTime > 0) {
- mir_tstrncpy(buf, _tctime(&r->m_dwIdleStartTime), _countof(buf));
+ mir_tstrncpy(buf, _wctime(&r->m_dwIdleStartTime), _countof(buf));
size_t len = mir_tstrlen(buf);
if (len > 0)
buf[len-1] = 0;
@@ -277,21 +277,21 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti
int i;
for (i=0; g_JabberFeatCapPairs[i].szFeature; i++)
if (jcb & g_JabberFeatCapPairs[i].jcbCap) {
- TCHAR szDescription[ 1024 ];
+ wchar_t szDescription[ 1024 ];
if (g_JabberFeatCapPairs[i].tszDescription)
mir_sntprintf(szDescription, L"%s (%s)", TranslateTS(g_JabberFeatCapPairs[i].tszDescription), g_JabberFeatCapPairs[i].szFeature);
else
- _tcsncpy_s(szDescription, g_JabberFeatCapPairs[i].szFeature, _TRUNCATE);
+ wcsncpy_s(szDescription, g_JabberFeatCapPairs[i].szFeature, _TRUNCATE);
sttFillInfoLine(hwndTree, htiCaps, NULL, NULL, szDescription, sttInfoLineId(resource, INFOLINE_CAPS, i));
}
for (int j = 0; j < ppro->m_lstJabberFeatCapPairsDynamic.getCount(); j++, i++)
if (jcb & ppro->m_lstJabberFeatCapPairsDynamic[j]->jcbCap) {
- TCHAR szDescription[ 1024 ];
+ wchar_t szDescription[ 1024 ];
if (ppro->m_lstJabberFeatCapPairsDynamic[j]->szDescription)
mir_sntprintf(szDescription, L"%s (%s)", TranslateTS(ppro->m_lstJabberFeatCapPairsDynamic[j]->szDescription), ppro->m_lstJabberFeatCapPairsDynamic[j]->szFeature);
else
- _tcsncpy_s(szDescription, ppro->m_lstJabberFeatCapPairsDynamic[j]->szFeature, _TRUNCATE);
+ wcsncpy_s(szDescription, ppro->m_lstJabberFeatCapPairsDynamic[j]->szFeature, _TRUNCATE);
sttFillInfoLine(hwndTree, htiCaps, NULL, NULL, szDescription, sttInfoLineId(resource, INFOLINE_CAPS, i));
}
}
@@ -311,18 +311,18 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti
sttFillInfoLine(hwndTree, htiSoftwareInfo, NULL, TranslateT("Miranda core version"), r->m_tszXMirandaCoreVersion, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++));
}
-static void sttFillAdvStatusInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM htiRoot, DWORD dwInfoLine, MCONTACT hContact, TCHAR *szTitle, char *pszSlot)
+static void sttFillAdvStatusInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM htiRoot, DWORD dwInfoLine, MCONTACT hContact, wchar_t *szTitle, char *pszSlot)
{
char *szAdvStatusIcon = ppro->ReadAdvStatusA(hContact, pszSlot, ADVSTATUS_VAL_ICON);
- TCHAR *szAdvStatusTitle = ppro->ReadAdvStatusT(hContact, pszSlot, ADVSTATUS_VAL_TITLE);
- TCHAR *szAdvStatusText = ppro->ReadAdvStatusT(hContact, pszSlot, ADVSTATUS_VAL_TEXT);
+ wchar_t *szAdvStatusTitle = ppro->ReadAdvStatusT(hContact, pszSlot, ADVSTATUS_VAL_TITLE);
+ wchar_t *szAdvStatusText = ppro->ReadAdvStatusT(hContact, pszSlot, ADVSTATUS_VAL_TEXT);
if (szAdvStatusIcon && szAdvStatusTitle && *szAdvStatusTitle) {
- TCHAR szText[2048];
+ wchar_t szText[2048];
if (szAdvStatusText && *szAdvStatusText)
mir_sntprintf(szText, L"%s (%s)", TranslateTS(szAdvStatusTitle), szAdvStatusText);
else
- _tcsncpy_s(szText, TranslateTS(szAdvStatusTitle), _TRUNCATE);
+ wcsncpy_s(szText, TranslateTS(szAdvStatusTitle), _TRUNCATE);
sttFillInfoLine(hwndTree, htiRoot, IcoLib_GetIcon(szAdvStatusIcon), szTitle, szText, dwInfoLine);
}
@@ -338,7 +338,7 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM
sttCleanupInfo(hwndTree, 0);
HTREEITEM htiRoot = sttFillInfoLine(hwndTree, NULL, ppro->LoadIconEx("main"), L"JID", item->jid, sttInfoLineId(0, INFOLINE_NAME), true);
- TCHAR buf[256];
+ wchar_t buf[256];
if (MCONTACT hContact = ppro->HContactFromJID(item->jid)) {
sttFillAdvStatusInfo(ppro, hwndTree, htiRoot, sttInfoLineId(0, INFOLINE_MOOD), hContact, TranslateT("Mood"), ADVSTATUS_MOOD);
@@ -365,7 +365,7 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM
// logoff
JABBER_RESOURCE_STATUS *r = item->getTemp();
if (r->m_dwIdleStartTime > 0) {
- mir_tstrncpy(buf, _tctime(&r->m_dwIdleStartTime), _countof(buf));
+ mir_tstrncpy(buf, _wctime(&r->m_dwIdleStartTime), _countof(buf));
size_t len = mir_tstrlen(buf);
if (len > 0)
buf[len-1] = 0;
@@ -376,7 +376,7 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM
mir_tstrncpy(buf, TranslateT("<not specified>"), _countof(buf));
sttFillInfoLine(hwndTree, htiRoot, NULL,
- (item->jid && _tcschr(item->jid, _T('@'))) ? TranslateT("Last logoff time") : TranslateT("Uptime"), buf,
+ (item->jid && wcschr(item->jid, '@')) ? TranslateT("Last logoff time") : TranslateT("Uptime"), buf,
sttInfoLineId(0, INFOLINE_LOGOFF));
sttFillInfoLine(hwndTree, htiRoot, NULL, TranslateT("Logoff message"),
@@ -396,7 +396,7 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM
for (int i=0; i < item->arResources.getCount(); i++)
sttFillResourceInfo(ppro, hwndTree, htiRoot, item, i+1);
}
- else if (!_tcschr(item->jid, _T('@')) || (r->m_iStatus != ID_STATUS_OFFLINE))
+ else if (!wcschr(item->jid, '@') || (r->m_iStatus != ID_STATUS_OFFLINE))
sttFillResourceInfo(ppro, hwndTree, htiRoot, item, 0);
sttCleanupInfo(hwndTree, 1);
@@ -532,14 +532,14 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
JabberCopyText(hwndDlg, buf.buf);
}
else if (nReturnCmd == 2) {
- TCHAR szBuffer[1024];
+ wchar_t szBuffer[1024];
TVITEMEX tvi = { 0 };
tvi.mask = TVIF_HANDLE | TVIF_TEXT | TVIF_STATE;
tvi.hItem = hItem;
tvi.cchTextMax = _countof(szBuffer);
tvi.pszText = szBuffer;
if (TreeView_GetItem(hwndTree, &tvi)) {
- if (TCHAR *str = _tcsstr(szBuffer, L": "))
+ if (wchar_t *str = wcsstr(szBuffer, L": "))
JabberCopyText(hwndDlg, str + 2);
else
JabberCopyText(hwndDlg, szBuffer);
@@ -664,7 +664,7 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_SAVE:
- static TCHAR szFilter[512];
+ static wchar_t szFilter[512];
ptrT jid(photoInfo->ppro->getTStringA(photoInfo->hContact, "jid"));
if (jid == NULL)
@@ -692,7 +692,7 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP
mir_sntprintf(szFilter, L"%s (*.*)%c*.*", TranslateT("Unknown format"), 0);
}
- TCHAR szFileName[MAX_PATH]; szFileName[0] = '\0';
+ wchar_t szFileName[MAX_PATH]; szFileName[0] = '\0';
OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwndDlg;
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index e4da6b2df3..610790fe63 100644
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -34,7 +34,7 @@ int CJabberProto::SerialNext(void)
///////////////////////////////////////////////////////////////////////////////
// JabberChatRoomHContactFromJID - looks for the char room MCONTACT with required JID
-MCONTACT CJabberProto::ChatRoomHContactFromJID(const TCHAR *jid)
+MCONTACT CJabberProto::ChatRoomHContactFromJID(const wchar_t *jid)
{
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_CHATROOM, jid);
if (item != NULL && item->hContact)
@@ -46,7 +46,7 @@ MCONTACT CJabberProto::ChatRoomHContactFromJID(const TCHAR *jid)
///////////////////////////////////////////////////////////////////////////////
// JabberHContactFromJID - looks for the MCONTACT with required JID
-MCONTACT CJabberProto::HContactFromJID(const TCHAR *jid, bool bStripResource)
+MCONTACT CJabberProto::HContactFromJID(const wchar_t *jid, bool bStripResource)
{
if (jid == NULL)
return NULL;
@@ -56,7 +56,7 @@ MCONTACT CJabberProto::HContactFromJID(const TCHAR *jid, bool bStripResource)
return item->hContact;
if (bStripResource) {
- TCHAR szJid[JABBER_MAX_JID_LEN];
+ wchar_t szJid[JABBER_MAX_JID_LEN];
JabberStripJid(jid, szJid, _countof(szJid));
item = ListGetItemPtr(LIST_ROSTER, szJid);
if (item != NULL && item->hContact)
@@ -66,19 +66,19 @@ MCONTACT CJabberProto::HContactFromJID(const TCHAR *jid, bool bStripResource)
return NULL;
}
-TCHAR* __stdcall JabberNickFromJID(const TCHAR *jid)
+wchar_t* __stdcall JabberNickFromJID(const wchar_t *jid)
{
if (jid == NULL)
return mir_tstrdup(L"");
- const TCHAR *p = _tcschr(jid, '@');
+ const wchar_t *p = wcschr(jid, '@');
if (p == NULL)
- p = _tcschr(jid, '/');
+ p = wcschr(jid, '/');
return (p != NULL) ? mir_tstrndup(jid, p - jid) : mir_tstrdup(jid);
}
-pResourceStatus CJabberProto::ResourceInfoFromJID(const TCHAR *jid)
+pResourceStatus CJabberProto::ResourceInfoFromJID(const wchar_t *jid)
{
if (jid == NULL)
return NULL;
@@ -89,22 +89,22 @@ pResourceStatus CJabberProto::ResourceInfoFromJID(const TCHAR *jid)
if (item == NULL)
return NULL;
- const TCHAR *p = _tcschr(jid, '/');
+ const wchar_t *p = wcschr(jid, '/');
if (p == NULL)
return item->getTemp();
return item->findResource(p + 1);
}
-TCHAR* JabberPrepareJid(LPCTSTR jid)
+wchar_t* JabberPrepareJid(LPCTSTR jid)
{
if (jid == NULL) return NULL;
- TCHAR *szNewJid = mir_tstrdup(jid);
+ wchar_t *szNewJid = mir_tstrdup(jid);
if (!szNewJid) return NULL;
- TCHAR *pDelimiter = _tcschr(szNewJid, _T('/'));
+ wchar_t *pDelimiter = wcschr(szNewJid, '/');
if (pDelimiter) *pDelimiter = 0;
CharLower(szNewJid);
- if (pDelimiter) *pDelimiter = _T('/');
+ if (pDelimiter) *pDelimiter = '/';
return szNewJid;
}
@@ -142,46 +142,46 @@ char* __stdcall JabberSha1(const char *str, JabberShaStrBuf buf)
return buf;
}
-TCHAR* __stdcall JabberStrFixLines(const TCHAR *str)
+wchar_t* __stdcall JabberStrFixLines(const wchar_t *str)
{
if (str == NULL)
return NULL;
- const TCHAR *p;
+ const wchar_t *p;
int add = 0;
bool prev_r = false;
bool prev_n = false;
for (p = str; p && *p; ++p)
- if (*p == _T('\r') || *p == _T('\n'))
+ if (*p == '\r' || *p == '\n')
++add;
- TCHAR *buf = (TCHAR *)mir_alloc((mir_tstrlen(str) + add + 1) * sizeof(TCHAR));
- TCHAR *res = buf;
+ wchar_t *buf = (wchar_t *)mir_alloc((mir_tstrlen(str) + add + 1) * sizeof(wchar_t));
+ wchar_t *res = buf;
for (p = str; p && *p; ++p) {
- if (*p == _T('\n') && !prev_r)
- *res++ = _T('\r');
- if (*p != _T('\r') && *p != _T('\n') && prev_r)
- *res++ = _T('\n');
+ if (*p == '\n' && !prev_r)
+ *res++ = '\r';
+ if (*p != '\r' && *p != '\n' && prev_r)
+ *res++ = '\n';
*res++ = *p;
- prev_r = *p == _T('\r');
- prev_n = *p == _T('\n');
+ prev_r = *p == '\r';
+ prev_n = *p == '\n';
}
*res = 0;
return buf;
}
-void __stdcall JabberHttpUrlDecode(TCHAR *str)
+void __stdcall JabberHttpUrlDecode(wchar_t *str)
{
- TCHAR *p, *q;
+ wchar_t *p, *q;
unsigned int code;
if (str == NULL) return;
- for (p = q = (TCHAR*)str; *p != '\0'; p++, q++) {
+ for (p = q = (wchar_t*)str; *p != '\0'; p++, q++) {
if (*p == '%' && *(p + 1) != '\0' && isxdigit(*(p + 1)) && *(p + 2) != '\0' && isxdigit(*(p + 2))) {
- _stscanf((TCHAR*)p + 1, L"%2x", &code);
+ swscanf((wchar_t*)p + 1, L"%2x", &code);
*q = (unsigned char)code;
p += 2;
}
@@ -222,29 +222,29 @@ int __stdcall JabberCombineStatus(int status1, int status2)
struct tagErrorCodeToStr
{
int code;
- TCHAR *str;
+ wchar_t *str;
}
static JabberErrorCodeToStrMapping[] = {
- { JABBER_ERROR_REDIRECT, LPGENT("Redirect") },
- { JABBER_ERROR_BAD_REQUEST, LPGENT("Bad request") },
- { JABBER_ERROR_UNAUTHORIZED, LPGENT("Unauthorized") },
- { JABBER_ERROR_PAYMENT_REQUIRED, LPGENT("Payment required") },
- { JABBER_ERROR_FORBIDDEN, LPGENT("Forbidden") },
- { JABBER_ERROR_NOT_FOUND, LPGENT("Not found") },
- { JABBER_ERROR_NOT_ALLOWED, LPGENT("Not allowed") },
- { JABBER_ERROR_NOT_ACCEPTABLE, LPGENT("Not acceptable") },
- { JABBER_ERROR_REGISTRATION_REQUIRED, LPGENT("Registration required") },
- { JABBER_ERROR_REQUEST_TIMEOUT, LPGENT("Request timeout") },
- { JABBER_ERROR_CONFLICT, LPGENT("Conflict") },
- { JABBER_ERROR_INTERNAL_SERVER_ERROR, LPGENT("Internal server error") },
- { JABBER_ERROR_NOT_IMPLEMENTED, LPGENT("Not implemented") },
- { JABBER_ERROR_REMOTE_SERVER_ERROR, LPGENT("Remote server error") },
- { JABBER_ERROR_SERVICE_UNAVAILABLE, LPGENT("Service unavailable") },
- { JABBER_ERROR_REMOTE_SERVER_TIMEOUT, LPGENT("Remote server timeout") },
- { -1, LPGENT("Unknown error") }
+ { JABBER_ERROR_REDIRECT, LPGENW("Redirect") },
+ { JABBER_ERROR_BAD_REQUEST, LPGENW("Bad request") },
+ { JABBER_ERROR_UNAUTHORIZED, LPGENW("Unauthorized") },
+ { JABBER_ERROR_PAYMENT_REQUIRED, LPGENW("Payment required") },
+ { JABBER_ERROR_FORBIDDEN, LPGENW("Forbidden") },
+ { JABBER_ERROR_NOT_FOUND, LPGENW("Not found") },
+ { JABBER_ERROR_NOT_ALLOWED, LPGENW("Not allowed") },
+ { JABBER_ERROR_NOT_ACCEPTABLE, LPGENW("Not acceptable") },
+ { JABBER_ERROR_REGISTRATION_REQUIRED, LPGENW("Registration required") },
+ { JABBER_ERROR_REQUEST_TIMEOUT, LPGENW("Request timeout") },
+ { JABBER_ERROR_CONFLICT, LPGENW("Conflict") },
+ { JABBER_ERROR_INTERNAL_SERVER_ERROR, LPGENW("Internal server error") },
+ { JABBER_ERROR_NOT_IMPLEMENTED, LPGENW("Not implemented") },
+ { JABBER_ERROR_REMOTE_SERVER_ERROR, LPGENW("Remote server error") },
+ { JABBER_ERROR_SERVICE_UNAVAILABLE, LPGENW("Service unavailable") },
+ { JABBER_ERROR_REMOTE_SERVER_TIMEOUT, LPGENW("Remote server timeout") },
+ { -1, LPGENW("Unknown error") }
};
-TCHAR* __stdcall JabberErrorStr(int errorCode)
+wchar_t* __stdcall JabberErrorStr(int errorCode)
{
int i;
@@ -252,9 +252,9 @@ TCHAR* __stdcall JabberErrorStr(int errorCode)
return JabberErrorCodeToStrMapping[i].str;
}
-TCHAR* __stdcall JabberErrorMsg(HXML errorNode, int* pErrorCode)
+wchar_t* __stdcall JabberErrorMsg(HXML errorNode, int* pErrorCode)
{
- TCHAR *errorStr = (TCHAR*)mir_alloc(256 * sizeof(TCHAR));
+ wchar_t *errorStr = (wchar_t*)mir_alloc(256 * sizeof(wchar_t));
if (errorNode == NULL) {
if (pErrorCode)
*pErrorCode = -1;
@@ -263,9 +263,9 @@ TCHAR* __stdcall JabberErrorMsg(HXML errorNode, int* pErrorCode)
}
int errorCode = -1;
- const TCHAR *str = XmlGetAttrValue(errorNode, L"code");
+ const wchar_t *str = XmlGetAttrValue(errorNode, L"code");
if (str != NULL)
- errorCode = _ttoi(str);
+ errorCode = _wtoi(str);
str = XmlGetText(errorNode);
if (str == NULL)
@@ -274,7 +274,7 @@ TCHAR* __stdcall JabberErrorMsg(HXML errorNode, int* pErrorCode)
for (int i = 0;; i++) {
HXML c = XmlGetChild(errorNode, i);
if (c == NULL) break;
- const TCHAR *attr = XmlGetAttrValue(c, L"xmlns");
+ const wchar_t *attr = XmlGetAttrValue(c, L"xmlns");
if (attr && !mir_tstrcmp(attr, L"urn:ietf:params:xml:ns:xmpp-stanzas")) {
str = XmlGetName(c);
break;
@@ -314,15 +314,15 @@ void CJabberProto::SendVisibleInvisiblePresence(BOOL invisible)
}
}
-time_t __stdcall JabberIsoToUnixTime(const TCHAR *stamp)
+time_t __stdcall JabberIsoToUnixTime(const wchar_t *stamp)
{
- TCHAR date[9];
+ wchar_t date[9];
int i, y;
if (stamp == NULL)
return 0;
- const TCHAR *p = stamp;
+ const wchar_t *p = stamp;
// Get the date part
for (i = 0; *p != '\0' && i < 8 && isdigit(*p); p++, i++)
@@ -354,7 +354,7 @@ time_t __stdcall JabberIsoToUnixTime(const TCHAR *stamp)
for (; *p != '\0' && !isdigit(*p); p++);
// Parse time
- if (_stscanf(p, L"%d:%d:%d", &timestamp.tm_hour, &timestamp.tm_min, &timestamp.tm_sec) != 3)
+ if (swscanf(p, L"%d:%d:%d", &timestamp.tm_hour, &timestamp.tm_min, &timestamp.tm_sec) != 3)
return (time_t)0;
timestamp.tm_isdst = 0; // DST is already present in _timezone below
@@ -365,7 +365,7 @@ time_t __stdcall JabberIsoToUnixTime(const TCHAR *stamp)
return (t >= 0) ? t : 0;
}
-void CJabberProto::SendPresenceTo(int status, const TCHAR* to, HXML extra, const TCHAR *msg)
+void CJabberProto::SendPresenceTo(int status, const wchar_t* to, HXML extra, const wchar_t *msg)
{
if (!m_bJabberOnline) return;
@@ -373,8 +373,8 @@ void CJabberProto::SendPresenceTo(int status, const TCHAR* to, HXML extra, const
int iPriority = getDword("Priority", 0);
UpdatePriorityMenu(iPriority);
- TCHAR szPriority[40];
- _itot(iPriority, szPriority, 10);
+ wchar_t szPriority[40];
+ _itow(iPriority, szPriority, 10);
XmlNode p(L"presence"); p << XCHILD(L"priority", szPriority);
if (to != NULL)
@@ -387,7 +387,7 @@ void CJabberProto::SendPresenceTo(int status, const TCHAR* to, HXML extra, const
HXML c = p << XCHILDNS(L"c", JABBER_FEAT_ENTITY_CAPS) << XATTR(L"node", JABBER_CAPS_MIRANDA_NODE)
<< XATTR(L"ver", szCoreVersion);
- LIST<TCHAR> arrExtCaps(5);
+ LIST<wchar_t> arrExtCaps(5);
if (bSecureIM)
arrExtCaps.insert(JABBER_EXT_SECUREIM);
@@ -492,7 +492,7 @@ void CJabberProto::SendPresence(int status, bool bSendToAll)
{
JABBER_LIST_ITEM *item = ListGetItemPtrFromIndex(i);
if (item != NULL && item->nick != NULL) {
- TCHAR text[1024];
+ wchar_t text[1024];
mir_sntprintf(text, L"%s/%s", item->jid, item->nick);
SendPresenceTo(status == ID_STATUS_INVISIBLE ? ID_STATUS_ONLINE : status, text, NULL);
}
@@ -505,17 +505,17 @@ void CJabberProto::SendPresence(int status, bool bSendToAll)
int __stdcall JabberGetPacketID(HXML n)
{
- const TCHAR *str = XmlGetAttrValue(n, L"id");
+ const wchar_t *str = XmlGetAttrValue(n, L"id");
if (str)
- if (!_tcsncmp(str, _T(JABBER_IQID), _countof(JABBER_IQID) - 1))
- return _ttoi(str + _countof(JABBER_IQID) - 1);
+ if (!wcsncmp(str, _T(JABBER_IQID), _countof(JABBER_IQID) - 1))
+ return _wtoi(str + _countof(JABBER_IQID) - 1);
return -1;
}
-TCHAR* __stdcall JabberId2string(int id)
+wchar_t* __stdcall JabberId2string(int id)
{
- TCHAR text[100];
+ wchar_t text[100];
mir_sntprintf(text, _T(JABBER_IQID) L"%d", id);
return mir_tstrdup(text);
}
@@ -523,7 +523,7 @@ TCHAR* __stdcall JabberId2string(int id)
///////////////////////////////////////////////////////////////////////////////
// JabberGetClientJID - adds a resource postfix to a JID
-TCHAR* CJabberProto::GetClientJID(MCONTACT hContact, TCHAR *dest, size_t destLen)
+wchar_t* CJabberProto::GetClientJID(MCONTACT hContact, wchar_t *dest, size_t destLen)
{
if (hContact == NULL)
return NULL;
@@ -532,13 +532,13 @@ TCHAR* CJabberProto::GetClientJID(MCONTACT hContact, TCHAR *dest, size_t destLen
return GetClientJID(jid, dest, destLen);
}
-TCHAR* CJabberProto::GetClientJID(const TCHAR *jid, TCHAR *dest, size_t destLen)
+wchar_t* CJabberProto::GetClientJID(const wchar_t *jid, wchar_t *dest, size_t destLen)
{
if (jid == NULL)
return NULL;
- _tcsncpy_s(dest, destLen, jid, _TRUNCATE);
- TCHAR *p = _tcschr(dest, '/');
+ wcsncpy_s(dest, destLen, jid, _TRUNCATE);
+ wchar_t *p = wcschr(dest, '/');
mir_cslock lck(m_csLists);
JABBER_LIST_ITEM *LI = ListGetItemPtr(LIST_ROSTER, jid);
@@ -561,14 +561,14 @@ TCHAR* CJabberProto::GetClientJID(const TCHAR *jid, TCHAR *dest, size_t destLen)
///////////////////////////////////////////////////////////////////////////////
// JabberStripJid - strips a resource postfix from a JID
-TCHAR* __stdcall JabberStripJid(const TCHAR *jid, TCHAR *dest, size_t destLen)
+wchar_t* __stdcall JabberStripJid(const wchar_t *jid, wchar_t *dest, size_t destLen)
{
if (jid == NULL)
*dest = 0;
else {
- _tcsncpy_s(dest, destLen, jid, _TRUNCATE);
+ wcsncpy_s(dest, destLen, jid, _TRUNCATE);
- TCHAR *p = _tcschr(dest, '/');
+ wchar_t *p = wcschr(dest, '/');
if (p != NULL)
*p = 0;
}
@@ -667,7 +667,7 @@ void CJabberProto::ComboLoadRecentStrings(HWND hwndDlg, UINT idcCombo, char *par
SendDlgItemMessage(hwndDlg, idcCombo, CB_ADDSTRING, 0, (LPARAM)L"");
}
-void CJabberProto::ComboAddRecentString(HWND hwndDlg, UINT idcCombo, char *param, const TCHAR *string, int recentCount)
+void CJabberProto::ComboAddRecentString(HWND hwndDlg, UINT idcCombo, char *param, const wchar_t *string, int recentCount)
{
if (!string || !*string)
return;
@@ -728,7 +728,7 @@ static VOID CALLBACK sttRebuildInfoFrameApcProc(void* param)
LISTFOREACH(i, ppro, LIST_ROSTER)
{
if ((item = ppro->ListGetItemPtrFromIndex(i)) != NULL) {
- if (_tcschr(item->jid, '@') == NULL && _tcschr(item->jid, '/') == NULL && item->subscription != SUB_NONE) {
+ if (wcschr(item->jid, '@') == NULL && wcschr(item->jid, '/') == NULL && item->subscription != SUB_NONE) {
MCONTACT hContact = ppro->HContactFromJID(item->jid);
if (hContact == NULL) continue;
@@ -736,7 +736,7 @@ static VOID CALLBACK sttRebuildInfoFrameApcProc(void* param)
char *jid_copy = mir_t2a(item->jid);
mir_snprintf(name, "$/Transports/%s", jid_copy);
ppro->m_pInfoFrame->CreateInfoItem(name, true, hContact);
- ppro->m_pInfoFrame->UpdateInfoItem(name, ppro->GetIconHandle(IDI_TRANSPORTL), (TCHAR *)item->jid);
+ ppro->m_pInfoFrame->UpdateInfoItem(name, ppro->GetIconHandle(IDI_TRANSPORTL), (wchar_t *)item->jid);
ppro->m_pInfoFrame->SetInfoItemCallback(name, &CJabberProto::InfoFrame_OnTransport);
mir_free(jid_copy);
}
@@ -755,7 +755,7 @@ void CJabberProto::RebuildInfoFrame()
////////////////////////////////////////////////////////////////////////
// time2str & str2time
-TCHAR* time2str(time_t _time, TCHAR *buf, size_t bufLen)
+wchar_t* time2str(time_t _time, wchar_t *buf, size_t bufLen)
{
struct tm* T = gmtime(&_time);
mir_sntprintf(buf, bufLen, L"%04d-%02d-%02dT%02d:%02d:%02dZ",
@@ -763,12 +763,12 @@ TCHAR* time2str(time_t _time, TCHAR *buf, size_t bufLen)
return buf;
}
-time_t str2time(const TCHAR *buf)
+time_t str2time(const wchar_t *buf)
{
struct tm T = { 0 };
- if (_stscanf(buf, L"%04d-%02d-%02dT%02d:%02d:%02dZ", &T.tm_year, &T.tm_mon, &T.tm_mday, &T.tm_hour, &T.tm_min, &T.tm_sec) != 6) {
+ if (swscanf(buf, L"%04d-%02d-%02dT%02d:%02d:%02dZ", &T.tm_year, &T.tm_mon, &T.tm_mday, &T.tm_hour, &T.tm_min, &T.tm_sec) != 6) {
int boo;
- if (_stscanf(buf, L"%04d-%02d-%02dT%02d:%02d:%02d.%dZ", &T.tm_year, &T.tm_mon, &T.tm_mday, &T.tm_hour, &T.tm_min, &T.tm_sec, &boo) != 7)
+ if (swscanf(buf, L"%04d-%02d-%02dT%02d:%02d:%02d.%dZ", &T.tm_year, &T.tm_mon, &T.tm_mday, &T.tm_hour, &T.tm_min, &T.tm_sec, &boo) != 7)
return 0;
}
@@ -778,30 +778,30 @@ time_t str2time(const TCHAR *buf)
}
////////////////////////////////////////////////////////////////////////
-// case-insensitive _tcsstr
-const TCHAR *JabberStrIStr(const TCHAR *str, const TCHAR *substr)
+// case-insensitive wcsstr
+const wchar_t *JabberStrIStr(const wchar_t *str, const wchar_t *substr)
{
- TCHAR *str_up = NEWTSTR_ALLOCA(str);
- TCHAR *substr_up = NEWTSTR_ALLOCA(substr);
+ wchar_t *str_up = NEWWSTR_ALLOCA(str);
+ wchar_t *substr_up = NEWWSTR_ALLOCA(substr);
CharUpperBuff(str_up, (DWORD)mir_tstrlen(str_up));
CharUpperBuff(substr_up, (DWORD)mir_tstrlen(substr_up));
- TCHAR *p = _tcsstr(str_up, substr_up);
+ wchar_t *p = wcsstr(str_up, substr_up);
return p ? (str + (p - str_up)) : NULL;
}
////////////////////////////////////////////////////////////////////////
// clipboard processing
-void JabberCopyText(HWND hwnd, const TCHAR *text)
+void JabberCopyText(HWND hwnd, const wchar_t *text)
{
if (!hwnd || !text) return;
if (OpenClipboard(hwnd)) {
EmptyClipboard();
- HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(mir_tstrlen(text) + 1));
- TCHAR *s = (TCHAR *)GlobalLock(hMem);
+ HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, sizeof(wchar_t)*(mir_tstrlen(text) + 1));
+ wchar_t *s = (wchar_t *)GlobalLock(hMem);
mir_tstrcpy(s, text);
GlobalUnlock(hMem);
SetClipboardData(CF_UNICODETEXT, hMem);
@@ -812,7 +812,7 @@ void JabberCopyText(HWND hwnd, const TCHAR *text)
BOOL CJabberProto::EnterString(CMString &result, LPCTSTR caption, int type, char *windowName, int recentCount, int timeout)
{
if (caption == NULL) {
- caption = NEWTSTR_ALLOCA(result.GetString());
+ caption = NEWWSTR_ALLOCA(result.GetString());
result.Empty();
}
@@ -841,15 +841,15 @@ bool JabberReadXep203delay(HXML node, time_t &msgTime)
if (n == NULL)
return false;
- const TCHAR *ptszTimeStamp = XmlGetAttrValue(n, L"stamp");
+ const wchar_t *ptszTimeStamp = XmlGetAttrValue(n, L"stamp");
if (ptszTimeStamp == NULL)
return false;
// skip '-' chars
- TCHAR *szStamp = NEWTSTR_ALLOCA(ptszTimeStamp);
+ wchar_t *szStamp = NEWWSTR_ALLOCA(ptszTimeStamp);
int si = 0, sj = 0;
while (true) {
- if (szStamp[si] == _T('-'))
+ if (szStamp[si] == '-')
si++;
else if (!(szStamp[sj++] = szStamp[si++]))
break;
@@ -871,11 +871,11 @@ bool CJabberProto::IsMyOwnJID(LPCTSTR szJID)
if (szTo == NULL)
return false;
- TCHAR *pDelimiter = _tcschr(szFrom, _T('/'));
+ wchar_t *pDelimiter = wcschr(szFrom, '/');
if (pDelimiter)
*pDelimiter = 0;
- pDelimiter = _tcschr(szTo, _T('/'));
+ pDelimiter = wcschr(szTo, '/');
if (pDelimiter)
*pDelimiter = 0;
@@ -907,7 +907,7 @@ void __cdecl CJabberProto::LoadHttpAvatars(void* param)
ai.hContact = avs[i].hContact;
if (getByte(ai.hContact, "AvatarType", PA_FORMAT_UNKNOWN) != (unsigned char)pictureType) {
- TCHAR tszFileName[MAX_PATH];
+ wchar_t tszFileName[MAX_PATH];
GetAvatarFileName(ai.hContact, tszFileName, _countof(tszFileName));
DeleteFile(tszFileName);
}
@@ -924,10 +924,10 @@ void __cdecl CJabberProto::LoadHttpAvatars(void* param)
ptrA cmpsha(getStringA(ai.hContact, "AvatarSaved"));
if (cmpsha == NULL || strnicmp(cmpsha, buffer, sizeof(buffer))) {
- TCHAR tszFileName[MAX_PATH];
+ wchar_t tszFileName[MAX_PATH];
GetAvatarFileName(ai.hContact, tszFileName, _countof(tszFileName));
- _tcsncpy_s(ai.filename, tszFileName, _TRUNCATE);
- FILE* out = _tfopen(tszFileName, L"wb");
+ wcsncpy_s(ai.filename, tszFileName, _TRUNCATE);
+ FILE* out = _wfopen(tszFileName, L"wb");
if (out != NULL) {
fwrite(res->pData, res->dataLength, 1, out);
fclose(out);
diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp
index ad0f752bb2..6d1ae5d239 100644
--- a/protocols/JabberG/src/jabber_vcard.cpp
+++ b/protocols/JabberG/src/jabber_vcard.cpp
@@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/////////////////////////////////////////////////////////////////////////////////////////
-int CJabberProto::SendGetVcard(const TCHAR *jid)
+int CJabberProto::SendGetVcard(const wchar_t *jid)
{
if (!m_bJabberOnline) return 0;
@@ -126,7 +126,7 @@ static INT_PTR CALLBACK HomeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
TranslateDialogDefault(hwndDlg);
for (int i = 0; i < g_cbCountries; i++) {
if (g_countries[i].id != 0xFFFF && g_countries[i].id != 0) {
- TCHAR *country = mir_a2t(g_countries[i].szName);
+ wchar_t *country = mir_a2t(g_countries[i].szName);
SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_ADDSTRING, 0, (LPARAM)TranslateTS(country));
mir_free(country);
}
@@ -190,7 +190,7 @@ static INT_PTR CALLBACK WorkDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
TranslateDialogDefault(hwndDlg);
for (int i = 0; i < g_cbCountries; i++) {
if (g_countries[i].id != 0xFFFF && g_countries[i].id != 0) {
- TCHAR *country = mir_a2t(g_countries[i].szName);
+ wchar_t *country = mir_a2t(g_countries[i].szName);
SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_ADDSTRING, 0, (LPARAM)TranslateTS(country));
mir_free(country);
}
@@ -257,7 +257,7 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
{
const unsigned long iPageId = 3;
- TCHAR szAvatarFileName[MAX_PATH], szTempPath[MAX_PATH], szTempFileName[MAX_PATH];
+ wchar_t szAvatarFileName[MAX_PATH], szTempPath[MAX_PATH], szTempFileName[MAX_PATH];
PhotoDlgProcData* dat = (PhotoDlgProcData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
@@ -289,7 +289,7 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
}
EnableWindow(GetDlgItem(hwndDlg, IDC_DELETE), FALSE);
dat->ppro->GetAvatarFileName(NULL, szAvatarFileName, _countof(szAvatarFileName));
- if (_taccess(szAvatarFileName, 0) == 0) {
+ if (_waccess(szAvatarFileName, 0) == 0) {
if (GetTempPath(_countof(szTempPath), szTempPath) <= 0)
mir_tstrcpy(szTempPath, L".\\");
if (GetTempFileName(szTempPath, L"jab", 0, szTempFileName) > 0) {
@@ -333,7 +333,7 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
break;
case IDC_LOAD:
- TCHAR szFilter[512], szFileName[MAX_PATH];
+ wchar_t szFilter[512], szFileName[MAX_PATH];
Bitmap_GetFilter(szFilter, _countof(szFilter));
OPENFILENAME ofn = { 0 };
@@ -350,7 +350,7 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
HBITMAP hNewBitmap;
dat->ppro->debugLog(L"File selected is %s", szFileName);
- if (_tstat(szFileName, &st) < 0 || st.st_size > 40 * 1024) {
+ if (_wstat(szFileName, &st) < 0 || st.st_size > 40 * 1024) {
MessageBox(hwndDlg, TranslateT("Only JPG, GIF, and BMP image files smaller than 40 KB are supported."), TranslateT("Jabber vCard"), MB_OK | MB_SETFOREGROUND);
break;
}
@@ -578,7 +578,7 @@ static INT_PTR CALLBACK EditEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
}
- TCHAR text[128];
+ wchar_t text[128];
GetDlgItemText(hwndDlg, IDC_EMAIL, text, _countof(text));
mir_snprintf(idstr, "e-mail%d", dat->id);
dat->ppro->setTString(idstr, text);
@@ -719,7 +719,7 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP
{
int i;
char idstr[33];
- TCHAR number[20];
+ wchar_t number[20];
//e-mails
ListView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_EMAILS));
@@ -916,7 +916,7 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP
void CJabberProto::SaveVcardToDB(HWND hwndPage, int iPage)
{
- TCHAR text[2048];
+ wchar_t text[2048];
// Page 0: Personal
switch (iPage) {
@@ -958,7 +958,7 @@ void CJabberProto::SaveVcardToDB(HWND hwndPage, int iPage)
setTString("ZIP", text);
{
int i = SendDlgItemMessage(hwndPage, IDC_COUNTRY, CB_GETCURSEL, 0, 0);
- TCHAR *country = mir_a2t((i) ? g_countries[i + 2].szName : g_countries[1].szName);
+ wchar_t *country = mir_a2t((i) ? g_countries[i + 2].szName : g_countries[1].szName);
setTString("Country", country);
mir_free(country);
}
@@ -984,7 +984,7 @@ void CJabberProto::SaveVcardToDB(HWND hwndPage, int iPage)
setTString("CompanyZIP", text);
{
int i = SendDlgItemMessage(hwndPage, IDC_COUNTRY, CB_GETCURSEL, 0, 0);
- TCHAR *country = mir_a2t((i) ? g_countries[i + 2].szName : g_countries[1].szName);
+ wchar_t *country = mir_a2t((i) ? g_countries[i + 2].szName : g_countries[1].szName);
setTString("CompanyCountry", country);
mir_free(country);
}
@@ -1010,7 +1010,7 @@ void CJabberProto::AppendVcardFromDB(HXML n, char *tag, char *key)
n << XCHILD(_A2T(tag), tszValue);
}
-void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName)
+void CJabberProto::SetServerVcard(BOOL bPhotoChanged, wchar_t* szPhotoFileName)
{
if (!m_bJabberOnline) return;
@@ -1104,7 +1104,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName)
if (nFlag & JABBER_VCTEL_PCS) n << XCHILD(L"PCS");
}
- TCHAR szAvatarName[MAX_PATH], *szFileName;
+ wchar_t szAvatarName[MAX_PATH], *szFileName;
GetAvatarFileName(NULL, szAvatarName, _countof(szAvatarName));
if (bPhotoChanged)
szFileName = szPhotoFileName;
@@ -1123,7 +1123,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName)
debugLog(L"Saving picture from %s", szFileName);
struct _stat st;
- if (_tstat(szFileName, &st) >= 0) {
+ if (_wstat(szFileName, &st) >= 0) {
// Note the FILE_SHARE_READ attribute so that the CopyFile can succeed
HANDLE hFile = CreateFile(szFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
@@ -1134,7 +1134,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName)
ptrA str(mir_base64_encode((PBYTE)(LPSTR)buffer, nRead));
if (str != NULL) {
n = v << XCHILD(L"PHOTO");
- TCHAR *szFileType;
+ wchar_t *szFileType;
switch (ProtoGetBufferFormat(buffer)) {
case PA_FORMAT_PNG: szFileType = L"image/png"; break;
case PA_FORMAT_GIF: szFileType = L"image/gif"; break;
@@ -1188,36 +1188,36 @@ void CJabberProto::OnUserInfoInit_VCard(WPARAM wParam, LPARAM)
odp.hInstance = hInst;
odp.dwInitParam = (LPARAM)this;
odp.flags = ODPF_TCHAR | ODPF_USERINFOTAB | ODPF_DONTTRANSLATE;
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
odp.pfnDlgProc = PersonalDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_VCARD_PERSONAL);
- odp.ptszTab = LPGENT("General");
+ odp.pwszTab = LPGENW("General");
UserInfo_AddPage(wParam, &odp);
odp.pfnDlgProc = ContactDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_VCARD_CONTACT);
- odp.ptszTab = LPGENT("Contacts");
+ odp.pwszTab = LPGENW("Contacts");
UserInfo_AddPage(wParam, &odp);
odp.pfnDlgProc = HomeDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_VCARD_HOME);
- odp.ptszTab = LPGENT("Home");
+ odp.pwszTab = LPGENW("Home");
UserInfo_AddPage(wParam, &odp);
odp.pfnDlgProc = WorkDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_VCARD_WORK);
- odp.ptszTab = LPGENT("Work");
+ odp.pwszTab = LPGENW("Work");
UserInfo_AddPage(wParam, &odp);
odp.pfnDlgProc = PhotoDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_VCARD_PHOTO);
- odp.ptszTab = LPGENT("Photo");
+ odp.pwszTab = LPGENW("Photo");
UserInfo_AddPage(wParam, &odp);
odp.pfnDlgProc = NoteDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_VCARD_NOTE);
- odp.ptszTab = LPGENT("Note");
+ odp.pwszTab = LPGENW("Note");
UserInfo_AddPage(wParam, &odp);
SendGetVcard(m_szJabberJID);
diff --git a/protocols/JabberG/src/jabber_ws.cpp b/protocols/JabberG/src/jabber_ws.cpp
index 17460ea992..201b1fbbd4 100644
--- a/protocols/JabberG/src/jabber_ws.cpp
+++ b/protocols/JabberG/src/jabber_ws.cpp
@@ -28,7 +28,7 @@ BOOL CJabberProto::WsInit(void)
{
m_lastTicks = ::GetTickCount();
- TCHAR name[128];
+ wchar_t name[128];
mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = { sizeof(nlu) };
diff --git a/protocols/JabberG/src/jabber_xml.cpp b/protocols/JabberG/src/jabber_xml.cpp
index f4626e8921..32b1b6194e 100644
--- a/protocols/JabberG/src/jabber_xml.cpp
+++ b/protocols/JabberG/src/jabber_xml.cpp
@@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/////////////////////////////////////////////////////////////////////////////////////////
// XmlNodeIq class members
-XmlNodeIq::XmlNodeIq(const TCHAR *type, int id, LPCTSTR to) :
+XmlNodeIq::XmlNodeIq(const wchar_t *type, int id, LPCTSTR to) :
XmlNode(L"iq")
{
if (type != NULL) *this << XATTR(L"type", type);
@@ -41,7 +41,7 @@ XmlNodeIq::XmlNodeIq(const TCHAR *type, int id, LPCTSTR to) :
if (id != -1 ) *this << XATTRID(id);
}
-XmlNodeIq::XmlNodeIq(const TCHAR *type, LPCTSTR idStr, LPCTSTR to) :
+XmlNodeIq::XmlNodeIq(const wchar_t *type, LPCTSTR idStr, LPCTSTR to) :
XmlNode(L"iq")
{
if (type != NULL) *this << XATTR(L"type", type );
@@ -49,13 +49,13 @@ XmlNodeIq::XmlNodeIq(const TCHAR *type, LPCTSTR idStr, LPCTSTR to) :
if (idStr != NULL) *this << XATTR(L"id", idStr);
}
-XmlNodeIq::XmlNodeIq(const TCHAR *type, HXML node, LPCTSTR to) :
+XmlNodeIq::XmlNodeIq(const wchar_t *type, HXML node, LPCTSTR to) :
XmlNode(L"iq")
{
if (type != NULL) *this << XATTR(L"type", type );
if (to != NULL) *this << XATTR(L"to", to );
if (node != NULL) {
- const TCHAR *iqId = XmlGetAttrValue(*this, L"id");
+ const wchar_t *iqId = XmlGetAttrValue(*this, L"id");
if (iqId != NULL) *this << XATTR(L"id", iqId);
}
}
@@ -70,7 +70,7 @@ XmlNodeIq::XmlNodeIq(CJabberIqInfo *pInfo) :
}
}
-XmlNodeIq::XmlNodeIq(const TCHAR *type, CJabberIqInfo *pInfo) :
+XmlNodeIq::XmlNodeIq(const wchar_t *type, CJabberIqInfo *pInfo) :
XmlNode(L"iq")
{
if (type != NULL) *this << XATTR(L"type", type);
@@ -145,7 +145,7 @@ void __fastcall XmlAddAttr(HXML hXml, LPCTSTR pszName, int value)
void __fastcall XmlAddAttr(HXML hXml, LPCTSTR pszName, unsigned __int64 value)
{
- TCHAR buf[60];
+ wchar_t buf[60];
_ui64tot(value, buf, 10);
xmlAddAttr(hXml, T2UTF(pszName), T2UTF(buf));
@@ -153,7 +153,7 @@ void __fastcall XmlAddAttr(HXML hXml, LPCTSTR pszName, unsigned __int64 value)
void __fastcall XmlAddAttrID(HXML hXml, int id)
{
- TCHAR text[100];
+ wchar_t text[100];
mir_sntprintf(text, _T(JABBER_IQID) L"%d", id);
XmlAddAttr(hXml, L"id", text);
}
@@ -194,8 +194,8 @@ HXML __fastcall XmlAddChild(HXML hXml, LPCTSTR name, LPCTSTR value)
HXML __fastcall XmlAddChild(HXML hXml, LPCTSTR name, int value)
{
- TCHAR buf[40];
- _itot(value, buf, 10);
+ wchar_t buf[40];
+ _itow(value, buf, 10);
return xmlAddChild(hXml, T2UTF(name), buf);
}
@@ -280,20 +280,20 @@ void XPath::ProcessPath(LookupInfo &info, bool bCreate)
{
if (!info.nodeName) return;
- TCHAR *nodeName = (TCHAR *)alloca(sizeof(TCHAR) * (info.nodeName.length+1));
+ wchar_t *nodeName = (wchar_t *)alloca(sizeof(wchar_t) * (info.nodeName.length+1));
mir_tstrncpy(nodeName, info.nodeName.p, info.nodeName.length+1);
if (info.attrName && info.attrValue) {
- TCHAR *attrName = (TCHAR *)alloca(sizeof(TCHAR)* (info.attrName.length + 1));
+ wchar_t *attrName = (wchar_t *)alloca(sizeof(wchar_t)* (info.attrName.length + 1));
mir_tstrncpy(attrName, info.attrName.p, info.attrName.length + 1);
- TCHAR *attrValue = (TCHAR *)alloca(sizeof(TCHAR)* (info.attrValue.length + 1));
+ wchar_t *attrValue = (wchar_t *)alloca(sizeof(wchar_t)* (info.attrValue.length + 1));
mir_tstrncpy(attrValue, info.attrValue.p, info.attrValue.length + 1);
HXML hXml = XmlGetChildByTag(m_hXml, nodeName, attrName, attrValue);
m_hXml = (hXml || !bCreate) ? hXml : (m_hXml << XCHILD(nodeName) << XATTR(attrName, attrValue));
}
else if (info.nodeIndex) {
- int idx = _ttoi(info.nodeIndex.p);
+ int idx = _wtoi(info.nodeIndex.p);
m_hXml = mir_tstrcmp(nodeName, L"*") ? XmlGetNthChild(m_hXml, nodeName, idx) : XmlGetChild(m_hXml, idx - 1);
}
else {
@@ -322,11 +322,11 @@ XPath::PathType XPath::LookupImpl(bool bCreate)
case 0:
state = S_FINAL_ERROR;
break;
- case _T('@'):
+ case '@':
info.attrName.Begin(p + 1);
state = S_ATTR_STEP;
break;
- case _T('/'):
+ case '/':
break;
default:
info.nodeName.Begin(p);
@@ -352,11 +352,11 @@ XPath::PathType XPath::LookupImpl(bool bCreate)
info.nodeName.End(p);
state = S_FINAL_NODESET;
break;
- case _T('['):
+ case '[':
info.nodeName.End(p);
state = S_NODE_OPENBRACKET;
break;
- case _T('/'):
+ case '/':
info.nodeName.End(p);
state = S_START;
break;
@@ -370,12 +370,12 @@ XPath::PathType XPath::LookupImpl(bool bCreate)
case 0:
state = S_FINAL_ERROR;
break;
- case _T('@'):
+ case '@':
info.attrName.Begin(p + 1);
state = S_NODE_ATTRNAME;
break;
- case _T('0'): case _T('1'): case _T('2'): case _T('3'): case _T('4'):
- case _T('5'): case _T('6'): case _T('7'): case _T('8'): case _T('9'):
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
info.nodeIndex.Begin(p);
state = S_NODE_INDEX;
break;
@@ -390,12 +390,12 @@ XPath::PathType XPath::LookupImpl(bool bCreate)
case 0:
state = S_FINAL_ERROR;
break;
- case _T(']'):
+ case ']':
info.nodeIndex.End(p);
state = S_NODE_CLOSEBRACKET;
break;
- case _T('0'): case _T('1'): case _T('2'): case _T('3'): case _T('4'):
- case _T('5'): case _T('6'): case _T('7'): case _T('8'): case _T('9'):
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
break;
default:
state = S_FINAL_ERROR;
@@ -408,7 +408,7 @@ XPath::PathType XPath::LookupImpl(bool bCreate)
case 0:
state = S_FINAL_ERROR;
break;
- case _T('='):
+ case '=':
info.attrName.End(p);
state = S_NODE_ATTREQUALS;
break;
@@ -422,7 +422,7 @@ XPath::PathType XPath::LookupImpl(bool bCreate)
case 0:
state = S_FINAL_ERROR;
break;
- case _T('\''):
+ case '\'':
info.attrValue.Begin(p + 1);
state = S_NODE_ATTRVALUE;
break;
@@ -437,7 +437,7 @@ XPath::PathType XPath::LookupImpl(bool bCreate)
case 0:
state = S_FINAL_ERROR;
break;
- case _T('\''):
+ case '\'':
info.attrValue.End(p);
state = S_NODE_ATTRCLOSEVALUE;
break;
@@ -451,7 +451,7 @@ XPath::PathType XPath::LookupImpl(bool bCreate)
case 0:
state = S_FINAL_ERROR;
break;
- case _T(']'):
+ case ']':
state = S_NODE_CLOSEBRACKET;
break;
default:
@@ -465,7 +465,7 @@ XPath::PathType XPath::LookupImpl(bool bCreate)
case 0:
state = S_FINAL_NODE;
break;
- case _T('/'):
+ case '/':
state = S_START;
break;
default:
diff --git a/protocols/JabberG/src/jabber_xml.h b/protocols/JabberG/src/jabber_xml.h
index 685336b35c..739ba708db 100644
--- a/protocols/JabberG/src/jabber_xml.h
+++ b/protocols/JabberG/src/jabber_xml.h
@@ -83,13 +83,13 @@ class CJabberIqInfo;
struct XmlNodeIq : public XmlNode
{
- XmlNodeIq(const TCHAR *type, int id = -1, const TCHAR *to = NULL);
- XmlNodeIq(const TCHAR *type, const TCHAR *idStr, const TCHAR *to);
- XmlNodeIq(const TCHAR *type, HXML node, const TCHAR *to);
+ XmlNodeIq(const wchar_t *type, int id = -1, const wchar_t *to = NULL);
+ XmlNodeIq(const wchar_t *type, const wchar_t *idStr, const wchar_t *to);
+ XmlNodeIq(const wchar_t *type, HXML node, const wchar_t *to);
// new request
XmlNodeIq(CJabberIqInfo *pInfo);
// answer to request
- XmlNodeIq(const TCHAR *type, CJabberIqInfo *pInfo);
+ XmlNodeIq(const wchar_t *type, CJabberIqInfo *pInfo);
};
typedef void (*JABBER_XML_CALLBACK)(HXML, void*);
@@ -224,7 +224,7 @@ HXML __fastcall operator<<(HXML node, const XQUERY& child);
class XPath
{
public:
- __forceinline XPath(HXML hXml, TCHAR *path):
+ __forceinline XPath(HXML hXml, wchar_t *path):
m_type(T_UNKNOWN),
m_hXml(hXml),
m_szPath(path),
@@ -245,22 +245,22 @@ public:
{
switch (Lookup())
{
- case T_ATTRIBUTE: return (TCHAR *)XmlGetAttrValue(m_hXml, m_szParam);
- case T_NODE: return (TCHAR *)XmlGetText(m_hXml);
- case T_NODESET: return (TCHAR *)XmlGetText(XmlGetNthChild(m_hXml, m_szParam, 1));
+ case T_ATTRIBUTE: return (wchar_t *)XmlGetAttrValue(m_hXml, m_szParam);
+ case T_NODE: return (wchar_t *)XmlGetText(m_hXml);
+ case T_NODESET: return (wchar_t *)XmlGetText(XmlGetNthChild(m_hXml, m_szParam, 1));
}
return NULL;
}
operator int()
{
- if (TCHAR *s = *this) return _ttoi(s);
+ if (wchar_t *s = *this) return _wtoi(s);
return 0;
}
- __forceinline bool operator== (TCHAR *str)
+ __forceinline bool operator== (wchar_t *str)
{
return !mir_tstrcmp((LPCTSTR)*this, str);
}
- __forceinline bool operator!= (TCHAR *str)
+ __forceinline bool operator!= (wchar_t *str)
{
return mir_tstrcmp((LPCTSTR)*this, str) ? true : false;
}
@@ -280,8 +280,8 @@ public:
}
void operator= (int value)
{
- TCHAR buf[16];
- _itot(value, buf, 10);
+ wchar_t buf[16];
+ _itow(value, buf, 10);
*this = buf;
}
@@ -322,11 +322,11 @@ private:
struct LookupString
{
- void Begin(const TCHAR *p_) { p = p_; }
- void End(const TCHAR *p_) { length = p_ - p; }
+ void Begin(const wchar_t *p_) { p = p_; }
+ void End(const wchar_t *p_) { length = p_ - p; }
operator bool() { return p ? true : false; }
- const TCHAR *p;
+ const wchar_t *p;
int length;
};
@@ -353,7 +353,7 @@ class XPathFmt: public XPath
{
public:
enum { BUFSIZE = 512 };
- XPathFmt(HXML hXml, TCHAR *path, ...): XPath(hXml, m_buf)
+ XPathFmt(HXML hXml, wchar_t *path, ...): XPath(hXml, m_buf)
{
*m_buf = 0;
@@ -378,7 +378,7 @@ public:
}
private:
- TCHAR m_buf[BUFSIZE];
+ wchar_t m_buf[BUFSIZE];
};
#endif
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp
index e9bacc1e5d..4e0b3b521b 100644
--- a/protocols/JabberG/src/jabber_xstatus.cpp
+++ b/protocols/JabberG/src/jabber_xstatus.cpp
@@ -67,7 +67,7 @@ void CJabberDlgPepBase::OnInitDialog()
SetTimer(m_hwnd, 1, 1000, NULL);
- TCHAR buf[128];
+ wchar_t buf[128];
mir_sntprintf(buf, TranslateT("OK (%d)"), m_time);
m_btnOk.SetText(buf);
}
@@ -88,7 +88,7 @@ INT_PTR CJabberDlgPepBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
switch (msg) {
case WM_TIMER:
if (wParam == 1) {
- TCHAR buf[128];
+ wchar_t buf[128];
mir_sntprintf(buf, TranslateT("OK (%d)"), --m_time);
m_btnOk.SetText(buf);
@@ -119,14 +119,14 @@ class CJabberDlgPepSimple: public CJabberDlgPepBase
{
typedef CJabberDlgPepBase CSuper;
public:
- CJabberDlgPepSimple(CJabberProto *proto, TCHAR *title);
+ CJabberDlgPepSimple(CJabberProto *proto, wchar_t *title);
~CJabberDlgPepSimple();
bool OkClicked() { return m_bOkClicked; }
- void AddStatusMode(LPARAM id, char *name, HICON hIcon, TCHAR *title, bool subitem = false);
- void SetActiveStatus(LPARAM id, TCHAR *text);
+ void AddStatusMode(LPARAM id, char *name, HICON hIcon, wchar_t *title, bool subitem = false);
+ void SetActiveStatus(LPARAM id, wchar_t *text);
LPARAM GetStatusMode();
- TCHAR *GetStatusText();
+ wchar_t *GetStatusText();
protected:
CCtrlCombo m_cbModes;
@@ -151,30 +151,30 @@ private:
LPARAM m_id;
char *m_name;
HICON m_hIcon;
- TCHAR *m_title;
+ wchar_t *m_title;
bool m_subitem;
- CStatusMode(LPARAM id, char *name, HICON hIcon, TCHAR *title, bool subitem): m_id(id), m_name(name), m_hIcon(hIcon), m_title(title), m_subitem(subitem) {}
+ CStatusMode(LPARAM id, char *name, HICON hIcon, wchar_t *title, bool subitem): m_id(id), m_name(name), m_hIcon(hIcon), m_title(title), m_subitem(subitem) {}
~CStatusMode() { IcoLib_ReleaseIcon(m_hIcon); }
};
OBJLIST<CStatusMode> m_modes;
- TCHAR *m_text;
- TCHAR *m_title;
+ wchar_t *m_text;
+ wchar_t *m_title;
int m_time;
int m_prevSelected;
int m_selected;
bool m_bOkClicked;
LPARAM m_active;
- TCHAR *m_activeText;
+ wchar_t *m_activeText;
void btnOk_OnClick(CCtrlButton *btn);
void global_OnChange(CCtrlData *);
void cbModes_OnChange(CCtrlData *);
};
-CJabberDlgPepSimple::CJabberDlgPepSimple(CJabberProto *proto, TCHAR *title):
+CJabberDlgPepSimple::CJabberDlgPepSimple(CJabberProto *proto, wchar_t *title):
CJabberDlgPepBase(proto, IDD_PEP_SIMPLE),
m_cbModes(this, IDC_CB_MODES),
m_txtDescription(this, IDC_TXT_DESCRIPTION),
@@ -199,12 +199,12 @@ CJabberDlgPepSimple::~CJabberDlgPepSimple()
mir_free(m_text);
}
-void CJabberDlgPepSimple::AddStatusMode(LPARAM id, char *name, HICON hIcon, TCHAR *title, bool subitem)
+void CJabberDlgPepSimple::AddStatusMode(LPARAM id, char *name, HICON hIcon, wchar_t *title, bool subitem)
{
m_modes.insert(new CStatusMode(id, name, hIcon, title, subitem));
}
-void CJabberDlgPepSimple::SetActiveStatus(LPARAM id, TCHAR *text)
+void CJabberDlgPepSimple::SetActiveStatus(LPARAM id, wchar_t *text)
{
m_active = id;
m_activeText = text;
@@ -215,7 +215,7 @@ LPARAM CJabberDlgPepSimple::GetStatusMode()
return m_modes[m_selected].m_id;
}
-TCHAR *CJabberDlgPepSimple::GetStatusText()
+wchar_t *CJabberDlgPepSimple::GetStatusText()
{
return m_text;
}
@@ -275,7 +275,7 @@ void CJabberDlgPepSimple::cbModes_OnChange(CCtrlData *)
char szSetting[128];
if ((m_prevSelected >= 0) && (m_modes[m_cbModes.GetItemData(m_prevSelected)].m_id >= 0)) {
- TCHAR *txt = m_txtDescription.GetText();
+ wchar_t *txt = m_txtDescription.GetText();
mir_snprintf(szSetting, "PepMsg_%s", m_modes[m_cbModes.GetItemData(m_prevSelected)].m_name);
m_proto->setTString(szSetting, txt);
mir_free(txt);
@@ -337,7 +337,7 @@ BOOL CJabberDlgPepSimple::OnWmDrawItem(UINT, WPARAM, LPARAM lParam)
}
if (!mode->m_subitem || (lpdis->itemState & ODS_COMBOBOXEDIT)) {
- TCHAR text[128];
+ wchar_t text[128];
if (mode->m_subitem) {
for (int i = lpdis->itemData; i >= 0; --i)
if (!m_modes[i].m_subitem) {
@@ -351,7 +351,7 @@ BOOL CJabberDlgPepSimple::OnWmDrawItem(UINT, WPARAM, LPARAM lParam)
TextOut(lpdis->hDC, lpdis->rcItem.left + 23, (lpdis->rcItem.top + lpdis->rcItem.bottom - tm.tmHeight) / 2, text, (int)mir_tstrlen(text));
}
else {
- TCHAR text[128];
+ wchar_t text[128];
mir_sntprintf(text, L"...%s", mode->m_title);
DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 23, (lpdis->rcItem.top + lpdis->rcItem.bottom - 16) / 2, mode->m_hIcon, 16, 16, 0, NULL, DI_NORMAL);
TextOut(lpdis->hDC, lpdis->rcItem.left + 44, (lpdis->rcItem.top + lpdis->rcItem.bottom - tm.tmHeight) / 2, text, (int)mir_tstrlen(text));
@@ -371,7 +371,7 @@ BOOL CJabberDlgPepSimple::OnWmGetMinMaxInfo(UINT, WPARAM, LPARAM lParam)
///////////////////////////////////////////////////////////////////////////////
// CPepService base class
-CPepService::CPepService(CJabberProto *proto, char *name, TCHAR *node):
+CPepService::CPepService(CJabberProto *proto, char *name, wchar_t *node):
m_proto(proto),
m_name(name),
m_node(node),
@@ -398,8 +398,8 @@ void CPepService::Publish()
void CPepService::Retract()
{
- TCHAR *tempName = mir_a2t(m_name);
- _tcslwr(tempName);
+ wchar_t *tempName = mir_a2t(m_name);
+ wcslwr(tempName);
m_proto->m_ThreadInfo->send(
XmlNodeIq(L"set", m_proto->SerialNext())
@@ -425,7 +425,7 @@ void CPepService::ForceRepublishOnLogin()
///////////////////////////////////////////////////////////////////////////////
// CPepGuiService base class
-CPepGuiService::CPepGuiService(CJabberProto *proto, char *name, TCHAR *node):
+CPepGuiService::CPepGuiService(CJabberProto *proto, char *name, wchar_t *node):
CPepService(proto, name, node),
m_bGuiOpen(false),
m_hIcolibItem(NULL),
@@ -471,7 +471,7 @@ void CPepGuiService::RebuildMenu()
mi.position = 200010;
mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR | CMIF_HIDDEN;
mi.hIcolibItem = m_hIcolibItem;
- mi.name.t = m_szText ? m_szText : LPGENT("<advanced status slot>");
+ mi.name.w = m_szText ? m_szText : LPGENW("<advanced status slot>");
m_hMenuItem = Menu_AddProtoMenuItem(&mi, m_proto->m_szModuleName);
}
@@ -486,7 +486,7 @@ bool CPepGuiService::LaunchSetGui(BYTE bQuiet)
return true;
}
-void CPepGuiService::UpdateMenuItem(HANDLE hIcolibIcon, TCHAR *text)
+void CPepGuiService::UpdateMenuItem(HANDLE hIcolibIcon, wchar_t *text)
{
m_hIcolibItem = hIcolibIcon;
replaceStrT(m_szText, text);
@@ -506,96 +506,96 @@ int CPepGuiService::OnMenuItemClick(WPARAM, LPARAM)
struct
{
- TCHAR *szName;
+ wchar_t *szName;
char* szTag;
}
static g_arrMoods[] =
{
- { LPGENT("None"), NULL },
- { LPGENT("Afraid"), "afraid" },
- { LPGENT("Amazed"), "amazed" },
- { LPGENT("Amorous"), "amorous" },
- { LPGENT("Angry"), "angry" },
- { LPGENT("Annoyed"), "annoyed" },
- { LPGENT("Anxious"), "anxious" },
- { LPGENT("Aroused"), "aroused" },
- { LPGENT("Ashamed"), "ashamed" },
- { LPGENT("Bored"), "bored" },
- { LPGENT("Brave"), "brave" },
- { LPGENT("Calm"), "calm" },
- { LPGENT("Cautious"), "cautious" },
- { LPGENT("Cold"), "cold" },
- { LPGENT("Confident"), "confident" },
- { LPGENT("Confused"), "confused" },
- { LPGENT("Contemplative"),"contemplative" },
- { LPGENT("Contented"), "contented" },
- { LPGENT("Cranky"), "cranky" },
- { LPGENT("Crazy"), "crazy" },
- { LPGENT("Creative"), "creative" },
- { LPGENT("Curious"), "curious" },
- { LPGENT("Dejected"), "dejected" },
- { LPGENT("Depressed"), "depressed" },
- { LPGENT("Disappointed"), "disappointed" },
- { LPGENT("Disgusted"), "disgusted" },
- { LPGENT("Dismayed"), "dismayed" },
- { LPGENT("Distracted"), "distracted" },
- { LPGENT("Embarrassed"), "embarrassed" },
- { LPGENT("Envious"), "envious" },
- { LPGENT("Excited"), "excited" },
- { LPGENT("Flirtatious"), "flirtatious" },
- { LPGENT("Frustrated"), "frustrated" },
- { LPGENT("Grateful"), "grateful" },
- { LPGENT("Grieving"), "grieving" },
- { LPGENT("Grumpy"), "grumpy" },
- { LPGENT("Guilty"), "guilty" },
- { LPGENT("Happy"), "happy" },
- { LPGENT("Hopeful"), "hopeful" },
- { LPGENT("Hot"), "hot" },
- { LPGENT("Humbled"), "humbled" },
- { LPGENT("Humiliated"), "humiliated" },
- { LPGENT("Hungry"), "hungry" },
- { LPGENT("Hurt"), "hurt" },
- { LPGENT("Impressed"), "impressed" },
- { LPGENT("In awe"), "in_awe" },
- { LPGENT("In love"), "in_love" },
- { LPGENT("Indignant"), "indignant" },
- { LPGENT("Interested"), "interested" },
- { LPGENT("Intoxicated"), "intoxicated" },
- { LPGENT("Invincible"), "invincible" },
- { LPGENT("Jealous"), "jealous" },
- { LPGENT("Lonely"), "lonely" },
- { LPGENT("Lost"), "lost" },
- { LPGENT("Lucky"), "lucky" },
- { LPGENT("Mean"), "mean" },
- { LPGENT("Moody"), "moody" },
- { LPGENT("Nervous"), "nervous" },
- { LPGENT("Neutral"), "neutral" },
- { LPGENT("Offended"), "offended" },
- { LPGENT("Outraged"), "outraged" },
- { LPGENT("Playful"), "playful" },
- { LPGENT("Proud"), "proud" },
- { LPGENT("Relaxed"), "relaxed" },
- { LPGENT("Relieved"), "relieved" },
- { LPGENT("Remorseful"), "remorseful" },
- { LPGENT("Restless"), "restless" },
- { LPGENT("Sad"), "sad" },
- { LPGENT("Sarcastic"), "sarcastic" },
- { LPGENT("Satisfied"), "satisfied" },
- { LPGENT("Serious"), "serious" },
- { LPGENT("Shocked"), "shocked" },
- { LPGENT("Shy"), "shy" },
- { LPGENT("Sick"), "sick" },
- { LPGENT("Sleepy"), "sleepy" },
- { LPGENT("Spontaneous"), "spontaneous" },
- { LPGENT("Stressed"), "stressed" },
- { LPGENT("Strong"), "strong" },
- { LPGENT("Surprised"), "surprised" },
- { LPGENT("Thankful"), "thankful" },
- { LPGENT("Thirsty"), "thirsty" },
- { LPGENT("Tired"), "tired" },
- { LPGENT("Undefined"), "undefined" },
- { LPGENT("Weak"), "weak" },
- { LPGENT("Worried"), "worried" },
+ { LPGENW("None"), NULL },
+ { LPGENW("Afraid"), "afraid" },
+ { LPGENW("Amazed"), "amazed" },
+ { LPGENW("Amorous"), "amorous" },
+ { LPGENW("Angry"), "angry" },
+ { LPGENW("Annoyed"), "annoyed" },
+ { LPGENW("Anxious"), "anxious" },
+ { LPGENW("Aroused"), "aroused" },
+ { LPGENW("Ashamed"), "ashamed" },
+ { LPGENW("Bored"), "bored" },
+ { LPGENW("Brave"), "brave" },
+ { LPGENW("Calm"), "calm" },
+ { LPGENW("Cautious"), "cautious" },
+ { LPGENW("Cold"), "cold" },
+ { LPGENW("Confident"), "confident" },
+ { LPGENW("Confused"), "confused" },
+ { LPGENW("Contemplative"),"contemplative" },
+ { LPGENW("Contented"), "contented" },
+ { LPGENW("Cranky"), "cranky" },
+ { LPGENW("Crazy"), "crazy" },
+ { LPGENW("Creative"), "creative" },
+ { LPGENW("Curious"), "curious" },
+ { LPGENW("Dejected"), "dejected" },
+ { LPGENW("Depressed"), "depressed" },
+ { LPGENW("Disappointed"), "disappointed" },
+ { LPGENW("Disgusted"), "disgusted" },
+ { LPGENW("Dismayed"), "dismayed" },
+ { LPGENW("Distracted"), "distracted" },
+ { LPGENW("Embarrassed"), "embarrassed" },
+ { LPGENW("Envious"), "envious" },
+ { LPGENW("Excited"), "excited" },
+ { LPGENW("Flirtatious"), "flirtatious" },
+ { LPGENW("Frustrated"), "frustrated" },
+ { LPGENW("Grateful"), "grateful" },
+ { LPGENW("Grieving"), "grieving" },
+ { LPGENW("Grumpy"), "grumpy" },
+ { LPGENW("Guilty"), "guilty" },
+ { LPGENW("Happy"), "happy" },
+ { LPGENW("Hopeful"), "hopeful" },
+ { LPGENW("Hot"), "hot" },
+ { LPGENW("Humbled"), "humbled" },
+ { LPGENW("Humiliated"), "humiliated" },
+ { LPGENW("Hungry"), "hungry" },
+ { LPGENW("Hurt"), "hurt" },
+ { LPGENW("Impressed"), "impressed" },
+ { LPGENW("In awe"), "in_awe" },
+ { LPGENW("In love"), "in_love" },
+ { LPGENW("Indignant"), "indignant" },
+ { LPGENW("Interested"), "interested" },
+ { LPGENW("Intoxicated"), "intoxicated" },
+ { LPGENW("Invincible"), "invincible" },
+ { LPGENW("Jealous"), "jealous" },
+ { LPGENW("Lonely"), "lonely" },
+ { LPGENW("Lost"), "lost" },
+ { LPGENW("Lucky"), "lucky" },
+ { LPGENW("Mean"), "mean" },
+ { LPGENW("Moody"), "moody" },
+ { LPGENW("Nervous"), "nervous" },
+ { LPGENW("Neutral"), "neutral" },
+ { LPGENW("Offended"), "offended" },
+ { LPGENW("Outraged"), "outraged" },
+ { LPGENW("Playful"), "playful" },
+ { LPGENW("Proud"), "proud" },
+ { LPGENW("Relaxed"), "relaxed" },
+ { LPGENW("Relieved"), "relieved" },
+ { LPGENW("Remorseful"), "remorseful" },
+ { LPGENW("Restless"), "restless" },
+ { LPGENW("Sad"), "sad" },
+ { LPGENW("Sarcastic"), "sarcastic" },
+ { LPGENW("Satisfied"), "satisfied" },
+ { LPGENW("Serious"), "serious" },
+ { LPGENW("Shocked"), "shocked" },
+ { LPGENW("Shy"), "shy" },
+ { LPGENW("Sick"), "sick" },
+ { LPGENW("Sleepy"), "sleepy" },
+ { LPGENW("Spontaneous"), "spontaneous" },
+ { LPGENW("Stressed"), "stressed" },
+ { LPGENW("Strong"), "strong" },
+ { LPGENW("Surprised"), "surprised" },
+ { LPGENW("Thankful"), "thankful" },
+ { LPGENW("Thirsty"), "thirsty" },
+ { LPGENW("Tired"), "tired" },
+ { LPGENW("Undefined"), "undefined" },
+ { LPGENW("Weak"), "weak" },
+ { LPGENW("Worried"), "worried" },
};
CPepMood::CPepMood(CJabberProto *proto) :
@@ -603,7 +603,7 @@ CPepMood::CPepMood(CJabberProto *proto) :
m_text(NULL),
m_mode(-1)
{
- UpdateMenuItem(Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT), LPGENT("Set mood..."));
+ UpdateMenuItem(Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT), LPGENW("Set mood..."));
}
CPepMood::~CPepMood()
@@ -611,7 +611,7 @@ CPepMood::~CPepMood()
mir_free(m_text);
}
-void CPepMood::ProcessItems(const TCHAR *from, HXML itemsNode)
+void CPepMood::ProcessItems(const wchar_t *from, HXML itemsNode)
{
MCONTACT hContact = NULL, hSelfContact = NULL;
if (!m_proto->IsMyOwnJID(from)) {
@@ -638,7 +638,7 @@ void CPepMood::ProcessItems(const TCHAR *from, HXML itemsNode)
moodType = XmlGetName(n);
}
- TCHAR *fixedText = JabberStrFixLines(moodText);
+ wchar_t *fixedText = JabberStrFixLines(moodText);
if (hSelfContact)
SetMood(hSelfContact, moodType, fixedText);
SetMood(hContact, moodType, fixedText);
@@ -668,7 +668,7 @@ void CPepMood::SetExtraIcon(MCONTACT hContact, char *szMood)
ExtraIcon_SetIcon(hExtraMood, hContact, szMood == NULL ? NULL : g_MoodIcons.GetIcolibHandle(szMood));
}
-void CPepMood::SetMood(MCONTACT hContact, const TCHAR *szMood, const TCHAR *szText)
+void CPepMood::SetMood(MCONTACT hContact, const wchar_t *szMood, const wchar_t *szText)
{
int mood = -1;
if (szMood) {
@@ -691,7 +691,7 @@ void CPepMood::SetMood(MCONTACT hContact, const TCHAR *szMood, const TCHAR *szTe
replaceStrT(m_text, szText);
HANDLE hIcon;
- TCHAR title[128];
+ wchar_t title[128];
if (mood >= 0) {
mir_sntprintf(title, TranslateT("Mood: %s"), TranslateTS(g_arrMoods[mood].szName));
hIcon = g_MoodIcons.GetIcolibHandle(g_arrMoods[mood].szTag);
@@ -745,7 +745,7 @@ void CPepMood::ShowSetDialog(BYTE bQuiet)
}
HANDLE hIcon;
- TCHAR *ptszTitle;
+ wchar_t *ptszTitle;
if (m_mode >= 0) {
Publish();
hIcon = g_MoodIcons.GetIcolibHandle(g_arrMoods[m_mode].szTag); ptszTitle = TranslateTS(g_arrMoods[m_mode].szName);
@@ -769,89 +769,89 @@ struct
{
char *szFirst;
char *szSecond;
- TCHAR *szTitle;
+ wchar_t *szTitle;
int iconid;
}
static g_arrActivities[] =
{
- { "doing_chores", NULL, LPGENT("Doing chores"), ACTIVITY_ICON(0, 0) },
- { NULL, "buying_groceries", LPGENT("buying groceries"), ACTIVITY_ICON(0, 1) },
- { NULL, "cleaning", LPGENT("cleaning"), ACTIVITY_ICON(0, 2) },
- { NULL, "cooking", LPGENT("cooking"), ACTIVITY_ICON(0, 3) },
- { NULL, "doing_maintenance", LPGENT("doing maintenance"), ACTIVITY_ICON(0, 4) },
- { NULL, "doing_the_dishes", LPGENT("doing the dishes"), ACTIVITY_ICON(0, 5) },
- { NULL, "doing_the_laundry", LPGENT("doing the laundry"), ACTIVITY_ICON(0, 6) },
- { NULL, "gardening", LPGENT("gardening"), ACTIVITY_ICON(0, 7) },
- { NULL, "running_an_errand", LPGENT("running an errand"), ACTIVITY_ICON(0, 8) },
- { NULL, "walking_the_dog", LPGENT("walking the dog"), ACTIVITY_ICON(0, 9) },
- { "drinking", NULL, LPGENT("Drinking"), ACTIVITY_ICON(1, 0) },
- { NULL, "having_a_beer", LPGENT("having a beer"), ACTIVITY_ICON(1, 1) },
- { NULL, "having_coffee", LPGENT("having coffee"), ACTIVITY_ICON(1, 2) },
- { NULL, "having_tea", LPGENT("having tea"), ACTIVITY_ICON(1, 3) },
- { "eating", NULL, LPGENT("Eating"), ACTIVITY_ICON(2, 0) },
- { NULL, "having_a_snack", LPGENT("having a snack"), ACTIVITY_ICON(2, 1) },
- { NULL, "having_breakfast", LPGENT("having breakfast"), ACTIVITY_ICON(2, 2) },
- { NULL, "having_dinner", LPGENT("having dinner"), ACTIVITY_ICON(2, 3) },
- { NULL, "having_lunch", LPGENT("having lunch"), ACTIVITY_ICON(2, 4) },
- { "exercising", NULL, LPGENT("Exercising"), ACTIVITY_ICON(3, 0) },
- { NULL, "cycling", LPGENT("cycling"), ACTIVITY_ICON(3, 1) },
- { NULL, "dancing", LPGENT("dancing"), ACTIVITY_ICON(3, 2) },
- { NULL, "hiking", LPGENT("hiking"), ACTIVITY_ICON(3, 3) },
- { NULL, "jogging", LPGENT("jogging"), ACTIVITY_ICON(3, 4) },
- { NULL, "playing_sports", LPGENT("playing sports"), ACTIVITY_ICON(3, 5) },
- { NULL, "running", LPGENT("running"), ACTIVITY_ICON(3, 6) },
- { NULL, "skiing", LPGENT("skiing"), ACTIVITY_ICON(3, 7) },
- { NULL, "swimming", LPGENT("swimming"), ACTIVITY_ICON(3, 8) },
- { NULL, "working_out", LPGENT("working out"), ACTIVITY_ICON(3, 9) },
- { "grooming", NULL, LPGENT("Grooming"), ACTIVITY_ICON(4, 0) },
- { NULL, "at_the_spa", LPGENT("at the spa"), ACTIVITY_ICON(4, 1) },
- { NULL, "brushing_teeth", LPGENT("brushing teeth"), ACTIVITY_ICON(4, 2) },
- { NULL, "getting_a_haircut", LPGENT("getting a haircut"), ACTIVITY_ICON(4, 3) },
- { NULL, "shaving", LPGENT("shaving"), ACTIVITY_ICON(4, 4) },
- { NULL, "taking_a_bath", LPGENT("taking a bath"), ACTIVITY_ICON(4, 5) },
- { NULL, "taking_a_shower", LPGENT("taking a shower"), ACTIVITY_ICON(4, 6) },
- { "having_appointment", NULL, LPGENT("Having appointment"), ACTIVITY_ICON(5, 0) },
- { "inactive", NULL, LPGENT("Inactive"), ACTIVITY_ICON(6, 0) },
- { NULL, "day_off", LPGENT("day off"), ACTIVITY_ICON(6, 1) },
- { NULL, "hanging_out", LPGENT("hanging out"), ACTIVITY_ICON(6, 2) },
- { NULL, "hiding", LPGENT("hiding"), ACTIVITY_ICON(6, 3) },
- { NULL, "on_vacation", LPGENT("on vacation"), ACTIVITY_ICON(6, 4) },
- { NULL, "praying", LPGENT("praying"), ACTIVITY_ICON(6, 5) },
- { NULL, "scheduled_holiday", LPGENT("scheduled holiday"), ACTIVITY_ICON(6, 6) },
- { NULL, "sleeping", LPGENT("sleeping"), ACTIVITY_ICON(6, 7) },
- { NULL, "thinking", LPGENT("thinking"), ACTIVITY_ICON(6, 8) },
- { "relaxing", NULL, LPGENT("Relaxing"), ACTIVITY_ICON(7, 0) },
- { NULL, "fishing", LPGENT("fishing"), ACTIVITY_ICON(7, 1) },
- { NULL, "gaming", LPGENT("gaming"), ACTIVITY_ICON(7, 2) },
- { NULL, "going_out", LPGENT("going out"), ACTIVITY_ICON(7, 3) },
- { NULL, "partying", LPGENT("partying"), ACTIVITY_ICON(7, 4) },
- { NULL, "reading", LPGENT("reading"), ACTIVITY_ICON(7, 5) },
- { NULL, "rehearsing", LPGENT("rehearsing"), ACTIVITY_ICON(7, 6) },
- { NULL, "shopping", LPGENT("shopping"), ACTIVITY_ICON(7, 7) },
- { NULL, "smoking", LPGENT("smoking"), ACTIVITY_ICON(7, 8) },
- { NULL, "socializing", LPGENT("socializing"), ACTIVITY_ICON(7, 9) },
- { NULL, "sunbathing", LPGENT("sunbathing"), ACTIVITY_ICON(7, 10) },
- { NULL, "watching_tv", LPGENT("watching TV"), ACTIVITY_ICON(7, 11) },
- { NULL, "watching_a_movie", LPGENT("watching a movie"), ACTIVITY_ICON(7, 12) },
- { "talking", NULL, LPGENT("Talking"), ACTIVITY_ICON(8, 0) },
- { NULL, "in_real_life", LPGENT("in real life"), ACTIVITY_ICON(8, 1) },
- { NULL, "on_the_phone", LPGENT("on the phone"), ACTIVITY_ICON(8, 2) },
- { NULL, "on_video_phone", LPGENT("on video phone"), ACTIVITY_ICON(8, 3) },
- { "traveling", NULL, LPGENT("Traveling"), ACTIVITY_ICON(9, 0) },
- { NULL, "commuting", LPGENT("commuting"), ACTIVITY_ICON(9, 1) },
- { NULL, "cycling", LPGENT("cycling"), ACTIVITY_ICON(9, 2) },
- { NULL, "driving", LPGENT("driving"), ACTIVITY_ICON(9, 3) },
- { NULL, "in_a_car", LPGENT("in a car"), ACTIVITY_ICON(9, 4) },
- { NULL, "on_a_bus", LPGENT("on a bus"), ACTIVITY_ICON(9, 5) },
- { NULL, "on_a_plane", LPGENT("on a plane"), ACTIVITY_ICON(9, 6) },
- { NULL, "on_a_train", LPGENT("on a train"), ACTIVITY_ICON(9, 7) },
- { NULL, "on_a_trip", LPGENT("on a trip"), ACTIVITY_ICON(9, 8) },
- { NULL, "walking", LPGENT("walking"), ACTIVITY_ICON(9, 9) },
- { "working", NULL, LPGENT("Working"), ACTIVITY_ICON(10, 0) },
- { NULL, "coding", LPGENT("coding"), ACTIVITY_ICON(10, 1) },
- { NULL, "in_a_meeting", LPGENT("in a meeting"), ACTIVITY_ICON(10, 2) },
- { NULL, "studying", LPGENT("studying"), ACTIVITY_ICON(10, 3) },
- { NULL, "writing", LPGENT("writing"), ACTIVITY_ICON(10, 4) },
+ { "doing_chores", NULL, LPGENW("Doing chores"), ACTIVITY_ICON(0, 0) },
+ { NULL, "buying_groceries", LPGENW("buying groceries"), ACTIVITY_ICON(0, 1) },
+ { NULL, "cleaning", LPGENW("cleaning"), ACTIVITY_ICON(0, 2) },
+ { NULL, "cooking", LPGENW("cooking"), ACTIVITY_ICON(0, 3) },
+ { NULL, "doing_maintenance", LPGENW("doing maintenance"), ACTIVITY_ICON(0, 4) },
+ { NULL, "doing_the_dishes", LPGENW("doing the dishes"), ACTIVITY_ICON(0, 5) },
+ { NULL, "doing_the_laundry", LPGENW("doing the laundry"), ACTIVITY_ICON(0, 6) },
+ { NULL, "gardening", LPGENW("gardening"), ACTIVITY_ICON(0, 7) },
+ { NULL, "running_an_errand", LPGENW("running an errand"), ACTIVITY_ICON(0, 8) },
+ { NULL, "walking_the_dog", LPGENW("walking the dog"), ACTIVITY_ICON(0, 9) },
+ { "drinking", NULL, LPGENW("Drinking"), ACTIVITY_ICON(1, 0) },
+ { NULL, "having_a_beer", LPGENW("having a beer"), ACTIVITY_ICON(1, 1) },
+ { NULL, "having_coffee", LPGENW("having coffee"), ACTIVITY_ICON(1, 2) },
+ { NULL, "having_tea", LPGENW("having tea"), ACTIVITY_ICON(1, 3) },
+ { "eating", NULL, LPGENW("Eating"), ACTIVITY_ICON(2, 0) },
+ { NULL, "having_a_snack", LPGENW("having a snack"), ACTIVITY_ICON(2, 1) },
+ { NULL, "having_breakfast", LPGENW("having breakfast"), ACTIVITY_ICON(2, 2) },
+ { NULL, "having_dinner", LPGENW("having dinner"), ACTIVITY_ICON(2, 3) },
+ { NULL, "having_lunch", LPGENW("having lunch"), ACTIVITY_ICON(2, 4) },
+ { "exercising", NULL, LPGENW("Exercising"), ACTIVITY_ICON(3, 0) },
+ { NULL, "cycling", LPGENW("cycling"), ACTIVITY_ICON(3, 1) },
+ { NULL, "dancing", LPGENW("dancing"), ACTIVITY_ICON(3, 2) },
+ { NULL, "hiking", LPGENW("hiking"), ACTIVITY_ICON(3, 3) },
+ { NULL, "jogging", LPGENW("jogging"), ACTIVITY_ICON(3, 4) },
+ { NULL, "playing_sports", LPGENW("playing sports"), ACTIVITY_ICON(3, 5) },
+ { NULL, "running", LPGENW("running"), ACTIVITY_ICON(3, 6) },
+ { NULL, "skiing", LPGENW("skiing"), ACTIVITY_ICON(3, 7) },
+ { NULL, "swimming", LPGENW("swimming"), ACTIVITY_ICON(3, 8) },
+ { NULL, "working_out", LPGENW("working out"), ACTIVITY_ICON(3, 9) },
+ { "grooming", NULL, LPGENW("Grooming"), ACTIVITY_ICON(4, 0) },
+ { NULL, "at_the_spa", LPGENW("at the spa"), ACTIVITY_ICON(4, 1) },
+ { NULL, "brushing_teeth", LPGENW("brushing teeth"), ACTIVITY_ICON(4, 2) },
+ { NULL, "getting_a_haircut", LPGENW("getting a haircut"), ACTIVITY_ICON(4, 3) },
+ { NULL, "shaving", LPGENW("shaving"), ACTIVITY_ICON(4, 4) },
+ { NULL, "taking_a_bath", LPGENW("taking a bath"), ACTIVITY_ICON(4, 5) },
+ { NULL, "taking_a_shower", LPGENW("taking a shower"), ACTIVITY_ICON(4, 6) },
+ { "having_appointment", NULL, LPGENW("Having appointment"), ACTIVITY_ICON(5, 0) },
+ { "inactive", NULL, LPGENW("Inactive"), ACTIVITY_ICON(6, 0) },
+ { NULL, "day_off", LPGENW("day off"), ACTIVITY_ICON(6, 1) },
+ { NULL, "hanging_out", LPGENW("hanging out"), ACTIVITY_ICON(6, 2) },
+ { NULL, "hiding", LPGENW("hiding"), ACTIVITY_ICON(6, 3) },
+ { NULL, "on_vacation", LPGENW("on vacation"), ACTIVITY_ICON(6, 4) },
+ { NULL, "praying", LPGENW("praying"), ACTIVITY_ICON(6, 5) },
+ { NULL, "scheduled_holiday", LPGENW("scheduled holiday"), ACTIVITY_ICON(6, 6) },
+ { NULL, "sleeping", LPGENW("sleeping"), ACTIVITY_ICON(6, 7) },
+ { NULL, "thinking", LPGENW("thinking"), ACTIVITY_ICON(6, 8) },
+ { "relaxing", NULL, LPGENW("Relaxing"), ACTIVITY_ICON(7, 0) },
+ { NULL, "fishing", LPGENW("fishing"), ACTIVITY_ICON(7, 1) },
+ { NULL, "gaming", LPGENW("gaming"), ACTIVITY_ICON(7, 2) },
+ { NULL, "going_out", LPGENW("going out"), ACTIVITY_ICON(7, 3) },
+ { NULL, "partying", LPGENW("partying"), ACTIVITY_ICON(7, 4) },
+ { NULL, "reading", LPGENW("reading"), ACTIVITY_ICON(7, 5) },
+ { NULL, "rehearsing", LPGENW("rehearsing"), ACTIVITY_ICON(7, 6) },
+ { NULL, "shopping", LPGENW("shopping"), ACTIVITY_ICON(7, 7) },
+ { NULL, "smoking", LPGENW("smoking"), ACTIVITY_ICON(7, 8) },
+ { NULL, "socializing", LPGENW("socializing"), ACTIVITY_ICON(7, 9) },
+ { NULL, "sunbathing", LPGENW("sunbathing"), ACTIVITY_ICON(7, 10) },
+ { NULL, "watching_tv", LPGENW("watching TV"), ACTIVITY_ICON(7, 11) },
+ { NULL, "watching_a_movie", LPGENW("watching a movie"), ACTIVITY_ICON(7, 12) },
+ { "talking", NULL, LPGENW("Talking"), ACTIVITY_ICON(8, 0) },
+ { NULL, "in_real_life", LPGENW("in real life"), ACTIVITY_ICON(8, 1) },
+ { NULL, "on_the_phone", LPGENW("on the phone"), ACTIVITY_ICON(8, 2) },
+ { NULL, "on_video_phone", LPGENW("on video phone"), ACTIVITY_ICON(8, 3) },
+ { "traveling", NULL, LPGENW("Traveling"), ACTIVITY_ICON(9, 0) },
+ { NULL, "commuting", LPGENW("commuting"), ACTIVITY_ICON(9, 1) },
+ { NULL, "cycling", LPGENW("cycling"), ACTIVITY_ICON(9, 2) },
+ { NULL, "driving", LPGENW("driving"), ACTIVITY_ICON(9, 3) },
+ { NULL, "in_a_car", LPGENW("in a car"), ACTIVITY_ICON(9, 4) },
+ { NULL, "on_a_bus", LPGENW("on a bus"), ACTIVITY_ICON(9, 5) },
+ { NULL, "on_a_plane", LPGENW("on a plane"), ACTIVITY_ICON(9, 6) },
+ { NULL, "on_a_train", LPGENW("on a train"), ACTIVITY_ICON(9, 7) },
+ { NULL, "on_a_trip", LPGENW("on a trip"), ACTIVITY_ICON(9, 8) },
+ { NULL, "walking", LPGENW("walking"), ACTIVITY_ICON(9, 9) },
+ { "working", NULL, LPGENW("Working"), ACTIVITY_ICON(10, 0) },
+ { NULL, "coding", LPGENW("coding"), ACTIVITY_ICON(10, 1) },
+ { NULL, "in_a_meeting", LPGENW("in a meeting"), ACTIVITY_ICON(10, 2) },
+ { NULL, "studying", LPGENW("studying"), ACTIVITY_ICON(10, 3) },
+ { NULL, "writing", LPGENW("writing"), ACTIVITY_ICON(10, 4) },
{ NULL, NULL, NULL } // the end, don't delete this
};
@@ -945,7 +945,7 @@ char *ActivityGetSecond(int id)
return (id >= 0) ? g_arrActivities[id].szSecond : NULL;
}
-TCHAR *ActivityGetFirstTitle(int id)
+wchar_t *ActivityGetFirstTitle(int id)
{
if (id >= _countof(g_arrActivities) - 1)
return NULL;
@@ -959,15 +959,15 @@ TCHAR *ActivityGetFirstTitle(int id)
return NULL;
}
-TCHAR *ActivityGetSecondTitle(int id)
+wchar_t *ActivityGetSecondTitle(int id)
{
return ((id >= 0) && g_arrActivities[id].szSecond) ? g_arrActivities[id].szTitle : NULL;
}
-void ActivityBuildTitle(int id, TCHAR *buf, int size)
+void ActivityBuildTitle(int id, wchar_t *buf, int size)
{
- TCHAR *szFirst = ActivityGetFirstTitle(id);
- TCHAR *szSecond = ActivityGetSecondTitle(id);
+ wchar_t *szFirst = ActivityGetFirstTitle(id);
+ wchar_t *szSecond = ActivityGetSecondTitle(id);
if (szFirst) {
if (szSecond)
@@ -983,7 +983,7 @@ CPepActivity::CPepActivity(CJabberProto *proto):
m_text(NULL),
m_mode(-1)
{
- UpdateMenuItem(Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT), LPGENT("Set activity..."));
+ UpdateMenuItem(Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT), LPGENW("Set activity..."));
}
CPepActivity::~CPepActivity()
@@ -991,7 +991,7 @@ CPepActivity::~CPepActivity()
mir_free(m_text);
}
-void CPepActivity::ProcessItems(const TCHAR *from, HXML itemsNode)
+void CPepActivity::ProcessItems(const wchar_t *from, HXML itemsNode)
{
MCONTACT hContact = NULL, hSelfContact = NULL;
if (!m_proto->IsMyOwnJID(from)) {
@@ -1025,7 +1025,7 @@ void CPepActivity::ProcessItems(const TCHAR *from, HXML itemsNode)
}
}
- TCHAR *fixedText = JabberStrFixLines(szText);
+ wchar_t *fixedText = JabberStrFixLines(szText);
if (hSelfContact)
SetActivity(hSelfContact, szFirstNode, szSecondNode, fixedText);
SetActivity(hContact, szFirstNode, szSecondNode, fixedText);
@@ -1071,7 +1071,7 @@ void CPepActivity::SetActivity(MCONTACT hContact, LPCTSTR szFirst, LPCTSTR szSec
return;
}
- TCHAR activityTitle[128];
+ wchar_t activityTitle[128];
ActivityBuildTitle(activity, activityTitle, _countof(activityTitle));
if (!hContact) {
@@ -1079,7 +1079,7 @@ void CPepActivity::SetActivity(MCONTACT hContact, LPCTSTR szFirst, LPCTSTR szSec
replaceStrT(m_text, szText);
HANDLE hIcon;
- TCHAR title[128];
+ wchar_t title[128];
if (activity >= 0) {
mir_sntprintf(title, TranslateT("Activity: %s"), activityTitle);
@@ -1097,7 +1097,7 @@ void CPepActivity::SetActivity(MCONTACT hContact, LPCTSTR szFirst, LPCTSTR szSec
else SetExtraIcon(hContact, activity < 0 ? NULL : returnActivity(activity));
if (activity >= 0) {
- TCHAR *p = mir_a2t(ActivityGetId(activity));
+ wchar_t *p = mir_a2t(ActivityGetId(activity));
m_proto->WriteAdvStatus(hContact, ADVSTATUS_ACTIVITY, p, g_ActivityIcons.GetIcolibName(returnActivity(activity)), activityTitle, szText);
mir_free(p);
}
@@ -1127,7 +1127,7 @@ void CPepActivity::ShowSetDialog(BYTE)
}
else {
Retract();
- UpdateMenuItem(Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT), LPGENT("Set activity..."));
+ UpdateMenuItem(Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT), LPGENW("Set activity..."));
if (m_proto->m_pInfoFrame)
m_proto->m_pInfoFrame->UpdateInfoItem("$/PEP/activity", Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT), TranslateT("Set activity..."));
}
@@ -1169,7 +1169,7 @@ INT_PTR __cdecl CJabberProto::OnGetXStatusIcon(WPARAM wParam, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
// SendPepMood - sends mood
-BOOL CJabberProto::SendPepTune(TCHAR* szArtist, TCHAR* szLength, TCHAR* szSource, TCHAR* szTitle, TCHAR* szTrack, TCHAR* szUri)
+BOOL CJabberProto::SendPepTune(wchar_t* szArtist, wchar_t* szLength, wchar_t* szSource, wchar_t* szTitle, wchar_t* szTrack, wchar_t* szUri)
{
if (!m_bJabberOnline || !m_bPepSupported)
return FALSE;
@@ -1200,21 +1200,21 @@ void CJabberProto::SetContactTune(MCONTACT hContact, LPCTSTR szArtist, LPCTSTR s
return;
}
- TCHAR *szListeningTo;
+ wchar_t *szListeningTo;
if (ServiceExists(MS_LISTENINGTO_GETPARSEDTEXT)) {
LISTENINGTOINFO li;
memset(&li, 0, sizeof(li));
li.cbSize = sizeof(li);
li.dwFlags = LTI_TCHAR;
- li.ptszArtist = (TCHAR*)szArtist;
- li.ptszLength = (TCHAR*)szLength;
- li.ptszAlbum = (TCHAR*)szSource;
- li.ptszTitle = (TCHAR*)szTitle;
- li.ptszTrack = (TCHAR*)szTrack;
- szListeningTo = (TCHAR*)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)L"%title% - %artist%", (LPARAM)&li);
+ li.ptszArtist = (wchar_t*)szArtist;
+ li.ptszLength = (wchar_t*)szLength;
+ li.ptszAlbum = (wchar_t*)szSource;
+ li.ptszTitle = (wchar_t*)szTitle;
+ li.ptszTrack = (wchar_t*)szTrack;
+ szListeningTo = (wchar_t*)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)L"%title% - %artist%", (LPARAM)&li);
}
else {
- szListeningTo = (TCHAR*)mir_alloc(2048 * sizeof(TCHAR));
+ szListeningTo = (wchar_t*)mir_alloc(2048 * sizeof(wchar_t));
mir_sntprintf(szListeningTo, 2047, L"%s - %s", szTitle ? szTitle : L"", szArtist ? szArtist : L"");
}
@@ -1227,7 +1227,7 @@ void CJabberProto::SetContactTune(MCONTACT hContact, LPCTSTR szArtist, LPCTSTR s
mir_free(szListeningTo);
}
-TCHAR* a2tf(const TCHAR *str, BOOL unicode)
+wchar_t* a2tf(const wchar_t *str, BOOL unicode)
{
if (str == NULL)
return NULL;
@@ -1235,7 +1235,7 @@ TCHAR* a2tf(const TCHAR *str, BOOL unicode)
return (unicode) ? mir_tstrdup(str) : mir_a2t((char*)str);
}
-void overrideStr(TCHAR*& dest, const TCHAR *src, BOOL unicode, const TCHAR *def = NULL)
+void overrideStr(wchar_t*& dest, const wchar_t *src, BOOL unicode, const wchar_t *def = NULL)
{
if (dest != NULL) {
mir_free(dest);
@@ -1256,8 +1256,8 @@ INT_PTR __cdecl CJabberProto::OnSetListeningTo(WPARAM, LPARAM lParam)
delSetting("ListeningTo");
}
else {
- TCHAR *szArtist = NULL, *szLength = NULL, *szSource = NULL;
- TCHAR *szTitle = NULL, *szTrack = NULL;
+ wchar_t *szArtist = NULL, *szLength = NULL, *szSource = NULL;
+ wchar_t *szTitle = NULL, *szTrack = NULL;
BOOL unicode = cm->dwFlags & LTI_UNICODE;
@@ -1267,20 +1267,20 @@ INT_PTR __cdecl CJabberProto::OnSetListeningTo(WPARAM, LPARAM lParam)
overrideStr(szTrack, cm->ptszTrack, unicode);
overrideStr(szLength, cm->ptszLength, unicode);
- TCHAR szLengthInSec[ 32 ];
+ wchar_t szLengthInSec[ 32 ];
szLengthInSec[ 0 ] = 0;
if (szLength) {
unsigned int multiplier = 1, result = 0;
- for (TCHAR *p = szLength; *p; p++)
- if (*p == _T(':'))
+ for (wchar_t *p = szLength; *p; p++)
+ if (*p == ':')
multiplier *= 60;
if (multiplier <= 3600) {
- TCHAR *szTmp = szLength;
+ wchar_t *szTmp = szLength;
while (szTmp[0]) {
- result += (_ttoi(szTmp) * multiplier);
+ result += (_wtoi(szTmp) * multiplier);
multiplier /= 60;
- szTmp = _tcschr(szTmp, _T(':'));
+ szTmp = wcschr(szTmp, ':');
if (!szTmp)
break;
szTmp++;
@@ -1367,7 +1367,7 @@ INT_PTR __cdecl CJabberProto::OnGetXStatusEx(WPARAM hContact, LPARAM lParam)
if (pData->flags & CSSF_UNICODE) {
ptrT title(ReadAdvStatusT(hContact, ADVSTATUS_MOOD, ADVSTATUS_VAL_TITLE));
if (title)
- _tcsncpy_s(pData->ptszName, STATUS_TITLE_MAX, title, _TRUNCATE);
+ wcsncpy_s(pData->ptszName, STATUS_TITLE_MAX, title, _TRUNCATE);
}
else {
ptrA title(ReadAdvStatusA(hContact, ADVSTATUS_MOOD, ADVSTATUS_VAL_TITLE));
@@ -1383,7 +1383,7 @@ INT_PTR __cdecl CJabberProto::OnGetXStatusEx(WPARAM hContact, LPARAM lParam)
if (pData->flags & CSSF_UNICODE) {
ptrT title(ReadAdvStatusT(hContact, ADVSTATUS_MOOD, ADVSTATUS_VAL_TEXT));
if (title)
- _tcsncpy_s(pData->ptszMessage, STATUS_TITLE_MAX, title, _TRUNCATE);
+ wcsncpy_s(pData->ptszMessage, STATUS_TITLE_MAX, title, _TRUNCATE);
}
else {
ptrA title(ReadAdvStatusA(hContact, ADVSTATUS_MOOD, ADVSTATUS_VAL_TEXT));
@@ -1463,7 +1463,7 @@ void CJabberProto::ResetAdvStatus(MCONTACT hContact, const char *pszSlot)
db_unset(hContact, "AdvStatus", szSetting);
}
-void CJabberProto::WriteAdvStatus(MCONTACT hContact, const char *pszSlot, const TCHAR *pszMode, const char *pszIcon, const TCHAR *pszTitle, const TCHAR *pszText)
+void CJabberProto::WriteAdvStatus(MCONTACT hContact, const char *pszSlot, const wchar_t *pszMode, const char *pszIcon, const wchar_t *pszTitle, const wchar_t *pszText)
{
char szSetting[128];
@@ -1490,7 +1490,7 @@ char* CJabberProto::ReadAdvStatusA(MCONTACT hContact, const char *pszSlot, const
return db_get_sa(hContact, "AdvStatus", szSetting);
}
-TCHAR* CJabberProto::ReadAdvStatusT(MCONTACT hContact, const char *pszSlot, const char *pszValue)
+wchar_t* CJabberProto::ReadAdvStatusT(MCONTACT hContact, const char *pszSlot, const char *pszValue)
{
char szSetting[128];
mir_snprintf(szSetting, "%s/%s/%s", m_szModuleName, pszSlot, pszValue);
@@ -1502,18 +1502,18 @@ TCHAR* CJabberProto::ReadAdvStatusT(MCONTACT hContact, const char *pszSlot, cons
void g_XstatusIconsInit()
{
- TCHAR szFile[MAX_PATH];
+ wchar_t szFile[MAX_PATH];
GetModuleFileName(hInst, szFile, _countof(szFile));
- if (TCHAR *p = _tcsrchr(szFile, '\\'))
+ if (wchar_t *p = wcsrchr(szFile, '\\'))
mir_tstrcpy(p + 1, L"..\\Icons\\xstatus_jabber.dll");
- TCHAR szSection[100];
- mir_tstrcpy(szSection, L"Protocols/Jabber/" LPGENT("Moods"));
+ wchar_t szSection[100];
+ mir_tstrcpy(szSection, L"Protocols/Jabber/" LPGENW("Moods"));
for (int i = 1; i < _countof(g_arrMoods); i++)
g_MoodIcons.RegisterIcon(g_arrMoods[i].szTag, szFile, -(200 + i), szSection, TranslateTS(g_arrMoods[i].szName));
- mir_tstrcpy(szSection, L"Protocols/Jabber/" LPGENT("Activities"));
+ mir_tstrcpy(szSection, L"Protocols/Jabber/" LPGENW("Activities"));
for (int k = 0; k < _countof(g_arrActivities); k++) {
if (g_arrActivities[k].szFirst)
g_ActivityIcons.RegisterIcon(g_arrActivities[k].szFirst, szFile, g_arrActivities[k].iconid, szSection, TranslateTS(g_arrActivities[k].szTitle));
diff --git a/protocols/JabberG/src/jabber_xstatus.h b/protocols/JabberG/src/jabber_xstatus.h
index 194a4c71de..ccda5b0886 100644
--- a/protocols/JabberG/src/jabber_xstatus.h
+++ b/protocols/JabberG/src/jabber_xstatus.h
@@ -32,12 +32,12 @@ struct CJabberProto;
class CPepService
{
public:
- CPepService(CJabberProto *proto, char *name, TCHAR *node);
+ CPepService(CJabberProto *proto, char *name, wchar_t *node);
virtual ~CPepService();
HGENMENU GetMenu() { return m_hMenuItem; }
- TCHAR *GetNode() { return m_node; }
- virtual void ProcessItems(const TCHAR *from, HXML items) = 0;
+ wchar_t *GetNode() { return m_node; }
+ virtual void ProcessItems(const wchar_t *from, HXML items) = 0;
void Publish();
void Retract();
@@ -52,7 +52,7 @@ protected:
CJabberProto *m_proto;
bool m_wasPublished;
char *m_name;
- TCHAR *m_node;
+ wchar_t *m_node;
HGENMENU m_hMenuItem;
virtual void CreateData(HXML) = 0;
@@ -64,7 +64,7 @@ class CPepServiceList: public OBJLIST<CPepService>
public:
CPepServiceList(): OBJLIST<CPepService>(1) {}
- void ProcessEvent(const TCHAR *from, HXML eventNode)
+ void ProcessEvent(const wchar_t *from, HXML eventNode)
{
for (int i=0; i < getCount(); i++)
{
@@ -111,7 +111,7 @@ public:
(*this)[i].ResetPublish();
}
- CPepService *Find(TCHAR *node)
+ CPepService *Find(wchar_t *node)
{
for (int i=0; i < getCount(); i++)
if (!mir_tstrcmp((*this)[i].GetNode(), node))
@@ -124,20 +124,20 @@ class CPepGuiService: public CPepService
{
typedef CPepService CSuper;
public:
- CPepGuiService(CJabberProto *proto, char *name, TCHAR *node);
+ CPepGuiService(CJabberProto *proto, char *name, wchar_t *node);
~CPepGuiService();
void InitGui();
void RebuildMenu();
bool LaunchSetGui(BYTE bQuiet);
protected:
- void UpdateMenuItem(HANDLE hIcolibIcon, TCHAR *text);
+ void UpdateMenuItem(HANDLE hIcolibIcon, wchar_t *text);
virtual void ShowSetDialog(BYTE bQuiet) = 0;
private:
HANDLE m_hMenuService;
HANDLE m_hIcolibItem;
- TCHAR *m_szText;
+ wchar_t *m_szText;
bool m_bGuiOpen;
@@ -150,11 +150,11 @@ class CPepMood: public CPepGuiService
public:
CPepMood(CJabberProto *proto);
~CPepMood();
- void ProcessItems(const TCHAR *from, HXML items);
+ void ProcessItems(const wchar_t *from, HXML items);
void ResetExtraIcon(MCONTACT hContact);
public:
- TCHAR *m_text;
+ wchar_t *m_text;
int m_mode;
protected:
@@ -162,7 +162,7 @@ protected:
void ShowSetDialog(BYTE bQuiet);
void SetExtraIcon(MCONTACT hContact, char *szMood);
- void SetMood(MCONTACT hContact, const TCHAR *szMood, const TCHAR *szText);
+ void SetMood(MCONTACT hContact, const wchar_t *szMood, const wchar_t *szText);
};
class CPepActivity: public CPepGuiService
@@ -171,11 +171,11 @@ class CPepActivity: public CPepGuiService
public:
CPepActivity(CJabberProto *proto);
~CPepActivity();
- void ProcessItems(const TCHAR *from, HXML items);
+ void ProcessItems(const wchar_t *from, HXML items);
void ResetExtraIcon(MCONTACT hContact);
protected:
- TCHAR *m_text;
+ wchar_t *m_text;
int m_mode;
void CreateData(HXML);
diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h
index 805b83eb23..56f199f509 100644
--- a/protocols/JabberG/src/stdafx.h
+++ b/protocols/JabberG/src/stdafx.h
@@ -149,7 +149,7 @@ public:
CCtrlFilterListView(CDlgBase* dlg, int ctrlId, bool trackFilter, bool keepHiglight);
~CCtrlFilterListView();
- TCHAR *GetFilterText();
+ wchar_t *GetFilterText();
CCallback<CCtrlFilterListView> OnFilterChanged;
protected:
@@ -159,7 +159,7 @@ protected:
void OnInit();
LRESULT CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam);
- void FilterHighlight(TCHAR *filter);
+ void FilterHighlight(wchar_t *filter);
};
#if !defined(OPENFILENAME_SIZE_VERSION_400)
@@ -177,8 +177,8 @@ protected:
#define JABBER_IQID "mir_"
#define JABBER_MAX_JID_LEN 1024
-#define JABBER_GC_MSG_QUIT LPGENT("I'm happy Miranda NG user. Get it at http://miranda-ng.org/.")
-#define JABBER_GC_MSG_SLAP LPGENT("/me slaps %s around a bit with a large trout")
+#define JABBER_GC_MSG_QUIT LPGENW("I'm happy Miranda NG user. Get it at http://miranda-ng.org/.")
+#define JABBER_GC_MSG_SLAP LPGENW("/me slaps %s around a bit with a large trout")
#define JABBER_SERVER_URL "https://xmpp.net/services.php"
// registered db event types
@@ -307,12 +307,12 @@ enum {
struct CJabberHttpAuthParams
{
enum {IQ = 1, MSG = 2} m_nType;
- TCHAR *m_szFrom;
- TCHAR *m_szIqId;
- TCHAR *m_szThreadId;
- TCHAR *m_szId;
- TCHAR *m_szMethod;
- TCHAR *m_szUrl;
+ wchar_t *m_szFrom;
+ wchar_t *m_szIqId;
+ wchar_t *m_szThreadId;
+ wchar_t *m_szId;
+ wchar_t *m_szMethod;
+ wchar_t *m_szUrl;
CJabberHttpAuthParams()
{
memset(this, 0, sizeof(CJabberHttpAuthParams));
@@ -352,8 +352,8 @@ typedef HANDLE JABBER_SOCKET;
struct JABBER_CONN_DATA : public MZeroedObject
{
- TCHAR username[512];
- TCHAR password[512];
+ wchar_t username[512];
+ wchar_t password[512];
char server[128];
char manualHost[128];
int port;
@@ -401,8 +401,8 @@ struct ThreadData
// connection & login data
JABBER_CONN_DATA conn;
- TCHAR resource[128];
- TCHAR fullJID[JABBER_MAX_JID_LEN];
+ wchar_t resource[128];
+ wchar_t fullJID[JABBER_MAX_JID_LEN];
ptrT tszNewPassword;
class TJabberAuth *auth;
@@ -420,11 +420,11 @@ struct ThreadData
struct JABBER_MODEMSGS
{
- TCHAR *szOnline;
- TCHAR *szAway;
- TCHAR *szNa;
- TCHAR *szDnd;
- TCHAR *szFreechat;
+ wchar_t *szOnline;
+ wchar_t *szAway;
+ wchar_t *szNa;
+ wchar_t *szDnd;
+ wchar_t *szFreechat;
};
typedef enum { FT_SI, FT_OOB, FT_BYTESTREAM, FT_IBB } JABBER_FT_TYPE;
@@ -444,10 +444,10 @@ struct filetransfer
JABBER_FT_TYPE type;
JABBER_SOCKET s;
JABBER_FILE_STATE state;
- TCHAR *jid;
+ wchar_t *jid;
int fileId;
- TCHAR* szId;
- TCHAR *sid;
+ wchar_t* szId;
+ wchar_t *sid;
int bCompleted;
HANDLE hWaitEvent;
@@ -459,13 +459,13 @@ struct filetransfer
// Used by file receiving only
char* httpHostName;
WORD httpPort;
- TCHAR *httpPath;
+ wchar_t *httpPath;
unsigned __int64 dwExpectedRecvFileSize;
// Used by file sending only
HANDLE hFileEvent;
unsigned __int64 *fileSize;
- TCHAR *szDescription;
+ wchar_t *szDescription;
CJabberProto *ppro;
};
@@ -500,11 +500,11 @@ struct JABBER_MUC_JIDLIST_INFO
~JABBER_MUC_JIDLIST_INFO();
JABBER_MUC_JIDLIST_TYPE type;
- TCHAR *roomJid; // filled-in by the WM_JABBER_REFRESH code
+ wchar_t *roomJid; // filled-in by the WM_JABBER_REFRESH code
HXML iqNode;
CJabberProto *ppro;
- TCHAR *type2str(void) const;
+ wchar_t *type2str(void) const;
};
typedef void (CJabberProto::*JABBER_FORM_SUBMIT_FUNC)(HXML values, void *userdata);
@@ -533,7 +533,7 @@ public:
void CreateInfoItem(char *pszName, bool bCompact=false, LPARAM pUserData=0);
void SetInfoItemCallback(char *pszName, void (CJabberProto::*onEvent)(CJabberInfoFrame_Event *));
- void UpdateInfoItem(char *pszName, HANDLE hIcolibItem, TCHAR *pszText);
+ void UpdateInfoItem(char *pszName, HANDLE hIcolibItem, wchar_t *pszText);
void ShowInfoItem(char *pszName, bool bShow);
void RemoveInfoItem(char *pszName);
@@ -564,7 +564,7 @@ private:
void UpdateSize();
void RemoveTooltip(int id);
- void SetToolTip(int id, RECT *rc, TCHAR *pszText);
+ void SetToolTip(int id, RECT *rc, wchar_t *pszText);
void PaintSkinGlyph(HDC hdc, RECT *rc, char **glyphs, COLORREF fallback);
void PaintCompact(HDC hdc);
@@ -590,7 +590,7 @@ extern HINSTANCE hInst;
extern HANDLE hExtraMood;
extern HANDLE hExtraActivity;
-extern TCHAR szCoreVersion[];
+extern wchar_t szCoreVersion[];
extern unsigned int g_nTempFileId;
extern int g_cbCountries;
@@ -613,11 +613,11 @@ void TreeList_Reset(HWND hwnd);
void TreeList_SetMode(HWND hwnd, int mode);
HTREELISTITEM TreeList_GetActiveItem(HWND hwnd);
void TreeList_SetSortMode(HWND hwnd, int col, BOOL descending);
-void TreeList_SetFilter(HWND hwnd, TCHAR *filter);
-HTREELISTITEM TreeList_AddItem(HWND hwnd, HTREELISTITEM hParent, TCHAR *text, LPARAM data);
+void TreeList_SetFilter(HWND hwnd, wchar_t *filter);
+HTREELISTITEM TreeList_AddItem(HWND hwnd, HTREELISTITEM hParent, wchar_t *text, LPARAM data);
void TreeList_ResetItem(HWND hwnd, HTREELISTITEM hParent);
void TreeList_MakeFakeParent(HTREELISTITEM hItem, BOOL flag);
-void TreeList_AppendColumn(HTREELISTITEM hItem, TCHAR *text);
+void TreeList_AppendColumn(HTREELISTITEM hItem, wchar_t *text);
int TreeList_AddIcon(HWND hwnd, HICON hIcon, int iOverlay);
void TreeList_SetIcon(HTREELISTITEM hItem, int iIcon, int iOverlay);
LPARAM TreeList_GetData(HTREELISTITEM hItem);
@@ -641,9 +641,9 @@ typedef struct TJabberFormLayoutInfo *HJFORMLAYOUT;
void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bCompact = FALSE);
void JabberFormDestroyUI(HWND hwndStatic);
-void JabberFormSetInstruction(HWND hwndForm, const TCHAR *text);
+void JabberFormSetInstruction(HWND hwndForm, const wchar_t *text);
HJFORMLAYOUT JabberFormCreateLayout(HWND hwndStatic); // use mir_free to destroy
-HJFORMCTRL JabberFormAppendControl(HWND hwndStatic, HJFORMLAYOUT layout_info, TJabberFormControlType type, const TCHAR *labelStr, const TCHAR *valueStr);
+HJFORMCTRL JabberFormAppendControl(HWND hwndStatic, HJFORMLAYOUT layout_info, TJabberFormControlType type, const wchar_t *labelStr, const wchar_t *valueStr);
void JabberFormLayoutControls(HWND hwndStatic, HJFORMLAYOUT layout_info, int *formHeight);
HXML JabberFormGetData(HWND hwndStatic, HXML xNode);
@@ -659,7 +659,7 @@ void ImageList_AddIcon_Icolib(HIMAGELIST hIml, HICON hIcon);
//---- jabber_libstr.c ----------------------------------------------
-int lstrcmp_null(const TCHAR *s1, const TCHAR *s2);
+int lstrcmp_null(const wchar_t *s1, const wchar_t *s2);
//---- jabber_menu.c ------------------------------------------------
@@ -670,17 +670,17 @@ int g_OnToolbarInit(WPARAM, LPARAM);
//---- jabber_misc.c ------------------------------------------------
void JabberChatDllError(void);
-TCHAR* UnEscapeChatTags(TCHAR* str_in);
+wchar_t* UnEscapeChatTags(wchar_t* str_in);
//---- jabber_adhoc.cpp ---------------------------------------------
struct CJabberAdhocStartupParams
{
- TCHAR *m_szJid;
- TCHAR *m_szNode;
+ wchar_t *m_szJid;
+ wchar_t *m_szNode;
CJabberProto *m_pProto;
- CJabberAdhocStartupParams(CJabberProto *proto, TCHAR* szJid, TCHAR* szNode = NULL)
+ CJabberAdhocStartupParams(CJabberProto *proto, wchar_t* szJid, wchar_t* szNode = NULL)
{
m_pProto = proto;
m_szJid = mir_tstrdup(szJid);
@@ -702,7 +702,7 @@ struct JabberAdHocData
RECT frameRect;
HXML AdHocNode;
HXML CommandsNode;
- TCHAR *ResponderJID;
+ wchar_t *ResponderJID;
};
//---- jabber_util.cpp ------------------------------------------------------------------
@@ -725,27 +725,27 @@ struct TStringPairs
typedef char JabberShaStrBuf[2*MIR_SHA1_HASH_SIZE + 1];
-TCHAR* __stdcall JabberNickFromJID(const TCHAR *jid);
-TCHAR* JabberPrepareJid(LPCTSTR jid);
+wchar_t* __stdcall JabberNickFromJID(const wchar_t *jid);
+wchar_t* JabberPrepareJid(LPCTSTR jid);
void __stdcall JabberUrlDecodeW(WCHAR *str);
char* __stdcall JabberSha1(const char *str, JabberShaStrBuf buf);
-TCHAR* __stdcall JabberStrFixLines(const TCHAR *str);
-void __stdcall JabberHttpUrlDecode(TCHAR *str);
+wchar_t* __stdcall JabberStrFixLines(const wchar_t *str);
+void __stdcall JabberHttpUrlDecode(wchar_t *str);
int __stdcall JabberCombineStatus(int status1, int status2);
-TCHAR* __stdcall JabberErrorStr(int errorCode);
-TCHAR* __stdcall JabberErrorMsg(HXML errorNode, int *errorCode = NULL);
-time_t __stdcall JabberIsoToUnixTime(const TCHAR *stamp);
-TCHAR* __stdcall JabberStripJid(const TCHAR *jid, TCHAR *dest, size_t destLen);
+wchar_t* __stdcall JabberErrorStr(int errorCode);
+wchar_t* __stdcall JabberErrorMsg(HXML errorNode, int *errorCode = NULL);
+time_t __stdcall JabberIsoToUnixTime(const wchar_t *stamp);
+wchar_t* __stdcall JabberStripJid(const wchar_t *jid, wchar_t *dest, size_t destLen);
int __stdcall JabberGetPacketID(HXML n);
-TCHAR* __stdcall JabberId2string(int id);
+wchar_t* __stdcall JabberId2string(int id);
LPCTSTR __stdcall JabberGetPictureType(HXML node, const char *picBuf);
-TCHAR* time2str(time_t _time, TCHAR *buf, size_t bufLen);
-time_t str2time(const TCHAR*);
+wchar_t* time2str(time_t _time, wchar_t *buf, size_t bufLen);
+time_t str2time(const wchar_t*);
-const TCHAR* JabberStrIStr(const TCHAR *str, const TCHAR *substr);
-void JabberCopyText(HWND hwnd, const TCHAR *text);
+const wchar_t* JabberStrIStr(const wchar_t *str, const wchar_t *substr);
+void JabberCopyText(HWND hwnd, const wchar_t *text);
CJabberProto* JabberChooseInstance(bool bIsLink=false);
bool JabberReadXep203delay(HXML node, time_t &msgTime);
diff --git a/protocols/MRA/src/Mra.cpp b/protocols/MRA/src/Mra.cpp
index 0acd463767..b749ea37ee 100644
--- a/protocols/MRA/src/Mra.cpp
+++ b/protocols/MRA/src/Mra.cpp
@@ -54,7 +54,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
///////////////////////////////////////////////////////////////////////////////
-static CMraProto* mraProtoInit(const char* pszProtoName, const TCHAR* tszUserName)
+static CMraProto* mraProtoInit(const char* pszProtoName, const wchar_t* tszUserName)
{
CMraProto *ppro = new CMraProto(pszProtoName, tszUserName);
g_Instances.insert(ppro);
diff --git a/protocols/MRA/src/MraAdvancedSearch.cpp b/protocols/MRA/src/MraAdvancedSearch.cpp
index 59e2da8242..fd0bd8ecb0 100644
--- a/protocols/MRA/src/MraAdvancedSearch.cpp
+++ b/protocols/MRA/src/MraAdvancedSearch.cpp
@@ -12,42 +12,42 @@ struct FieldNames
static const FieldNames GenderField[] =
{
- { 1, LPGENT("Male") },
- { 2, LPGENT("Female") },
+ { 1, LPGENW("Male") },
+ { 2, LPGENW("Female") },
{ 0, NULL }
};
static const FieldNames MonthField[] =
{
- { 1, LPGENT("January") },
- { 2, LPGENT("February") },
- { 3, LPGENT("March") },
- { 4, LPGENT("April") },
- { 5, LPGENT("May") },
- { 6, LPGENT("June") },
- { 7, LPGENT("July") },
- { 8, LPGENT("August") },
- { 9, LPGENT("September") },
- { 10, LPGENT("October") },
- { 11, LPGENT("November") },
- { 12, LPGENT("December") },
+ { 1, LPGENW("January") },
+ { 2, LPGENW("February") },
+ { 3, LPGENW("March") },
+ { 4, LPGENW("April") },
+ { 5, LPGENW("May") },
+ { 6, LPGENW("June") },
+ { 7, LPGENW("July") },
+ { 8, LPGENW("August") },
+ { 9, LPGENW("September") },
+ { 10, LPGENW("October") },
+ { 11, LPGENW("November") },
+ { 12, LPGENW("December") },
{ 0, NULL }
};
static const FieldNames ZodiakField[] =
{
- { 1, LPGENT("Aries") },
- { 2, LPGENT("Taurus") },
- { 3, LPGENT("Gemini") },
- { 4, LPGENT("Cancer") },
- { 5, LPGENT("Leo") },
- { 6, LPGENT("Virgo") },
- { 7, LPGENT("Libra") },
- { 8, LPGENT("Scorpio") },
- { 9, LPGENT("Sagittarius") },
- { 10, LPGENT("Capricorn") },
- { 11, LPGENT("Aquarius") },
- { 12, LPGENT("Pisces") },
+ { 1, LPGENW("Aries") },
+ { 2, LPGENW("Taurus") },
+ { 3, LPGENW("Gemini") },
+ { 4, LPGENW("Cancer") },
+ { 5, LPGENW("Leo") },
+ { 6, LPGENW("Virgo") },
+ { 7, LPGENW("Libra") },
+ { 8, LPGENW("Scorpio") },
+ { 9, LPGENW("Sagittarius") },
+ { 10, LPGENW("Capricorn") },
+ { 11, LPGENW("Aquarius") },
+ { 12, LPGENW("Pisces") },
{ 0, NULL }
};
@@ -76,7 +76,7 @@ void InitComboBoxNumders(HWND hWndCombo, DWORD dwStart, DWORD dwEnd)
ResetComboBox(hWndCombo);
for (DWORD i = dwStart; i <= dwEnd; i++) {
- TCHAR szBuff[MAX_PATH];
+ wchar_t szBuff[MAX_PATH];
mir_sntprintf(szBuff, L"%lu", i);
DWORD dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)szBuff);
SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, i);
@@ -254,7 +254,7 @@ HWND CMraProto::SearchAdvanced(HWND hWndDlg)
{
DWORD dwRequestFlags = 0;
char szUser[MAX_PATH], szDomain[MAX_PATH];
- TCHAR wszNickName[MAX_PATH], wszFirstName[MAX_PATH], wszLastName[MAX_PATH];
+ wchar_t wszNickName[MAX_PATH], wszFirstName[MAX_PATH], wszLastName[MAX_PATH];
size_t dwUserSize = GetDlgItemTextA(hWndDlg, IDC_EMAIL_USER, szUser, _countof(szUser));
size_t dwDomainSize = GetDlgItemTextA(hWndDlg, IDC_EMAIL_DOMAIN, szDomain, _countof(szDomain));
diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp
index 9f42d03f4f..b7f7aac5b2 100644
--- a/protocols/MRA/src/MraAvatars.cpp
+++ b/protocols/MRA/src/MraAvatars.cpp
@@ -55,7 +55,7 @@ DWORD CMraProto::MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle)
MRA_AVATARS_QUEUE *pmraaqAvatarsQueue = new MRA_AVATARS_QUEUE();
- TCHAR szBuffer[MAX_PATH];
+ wchar_t szBuffer[MAX_PATH];
mir_sntprintf(szBuffer, L"%s %s", m_tszUserName, TranslateT("Avatars' plugin connections"));
NETLIBUSER nlu = { sizeof(nlu) };
@@ -316,7 +316,7 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter)
ai.hContact = pmraaqiAvatarsQueueItem->hContact;
ai.format = dwAvatarFormat;
if (db_get_b(NULL, MRA_AVT_SECT_NAME, "ReturnAbsolutePath", MRA_AVT_DEFAULT_RET_ABC_PATH))
- _tcsncpy_s(ai.filename, wszFileName, _TRUNCATE);
+ wcsncpy_s(ai.filename, wszFileName, _TRUNCATE);
else
PathToRelativeT(wszFileName, ai.filename);
@@ -475,7 +475,7 @@ DWORD CMraProto::MraAvatarsGetFileName(HANDLE hQueue, MCONTACT hContact, DWORD d
if (IsContactChatAgent(hContact))
return ERROR_NOT_SUPPORTED;
- TCHAR tszBase[MAX_PATH];
+ wchar_t tszBase[MAX_PATH];
mir_sntprintf(tszBase, L"%s\\%s\\", VARST(L"%miranda_avatarcache%"), m_tszUserName);
res = tszBase;
@@ -631,7 +631,7 @@ INT_PTR CALLBACK MraAvatarsQueueDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wPara
db_set_b(NULL, MRA_AVT_SECT_NAME, "UseKeepAliveConn", IsDlgButtonChecked(hWndDlg, IDC_USE_KEEPALIVE_CONN));
db_set_dw(NULL, MRA_AVT_SECT_NAME, "ServerPort", GetDlgItemInt(hWndDlg, IDC_SERVERPORT, NULL, FALSE));
- TCHAR szServer[MAX_PATH];
+ wchar_t szServer[MAX_PATH];
GetDlgItemText(hWndDlg, IDC_SERVER, szServer, _countof(szServer));
db_set_ts(NULL, MRA_AVT_SECT_NAME, "Server", szServer);
return TRUE;
diff --git a/protocols/MRA/src/MraConstans.h b/protocols/MRA/src/MraConstans.h
index 1b9f89a0c1..ab2eb18dc0 100644
--- a/protocols/MRA/src/MraConstans.h
+++ b/protocols/MRA/src/MraConstans.h
@@ -40,7 +40,7 @@ static const LPSTR lpcszMailRuDomains[] =
#define EMAILS_MIN_COUNT 16 //internal // êîëëè÷åñòâî ýëåìåíòîâ îáÿçàòåëüíî ïðîâåðÿåìûõ ïðè èçâëå÷åíèè email àäðåñà èç èíôû þçåðà
#define PHONES_MIN_COUNT 4 //internal // êîëëè÷åñòâî ýëåìåíòîâ îáÿçàòåëüíî ïðîâåðÿåìûõ ïðè èçâëå÷åíèè email àäðåñà èç èíôû þçåðà
-#define MRA_ALARM_MESSAGE LPGENT("Your contact wakes you")
+#define MRA_ALARM_MESSAGE LPGENW("Your contact wakes you")
#define MRA_GOTO_INBOX "/GotoInbox"
#define MRA_GOTO_INBOX_STR LPGEN("Display &Inbox")
@@ -157,7 +157,7 @@ static const LPSTR lpcszMailRuDomains[] =
#define MRA_DEFAULT_SLOW_SEND TRUE
#define MRA_DEFAULT_CVT_SMILES_TO_TAGS TRUE
#define MRA_DEFAULT_MIRVER_RAW FALSE // hidden option
-#define MRA_DEFAULT_AUTH_MESSAGE LPGEN("Please authorize me")
+#define MRA_DEFAULT_AUTH_MESSAGE LPGENW("Please authorize me")
#define MRA_DEFAULT_RTF_RECEIVE_ENABLE FALSE
#define MRA_DEFAULT_RTF_SEND_ENABLE TRUE
diff --git a/protocols/MRA/src/MraFilesQueue.cpp b/protocols/MRA/src/MraFilesQueue.cpp
index 2b860467f0..bcb9aead3c 100644
--- a/protocols/MRA/src/MraFilesQueue.cpp
+++ b/protocols/MRA/src/MraFilesQueue.cpp
@@ -661,7 +661,7 @@ DWORD CMraProto::MraFilesQueueAddReceive(HANDLE hQueue, DWORD dwFlags, MCONTACT
p.dwNameLen = mir_tstrlen(p.lpwszName);
p.dwSize = _wtoi(wszCurrSize);
dat->dwFilesTotalSize += p.dwSize;
- dwFileNameTotalSize += p.dwNameLen * sizeof(TCHAR);
+ dwFileNameTotalSize += p.dwNameLen * sizeof(wchar_t);
dat->dwFilesCount++;
}
diff --git a/protocols/MRA/src/MraIcons.cpp b/protocols/MRA/src/MraIcons.cpp
index 8faf3d38a1..8b2c83a35d 100644
--- a/protocols/MRA/src/MraIcons.cpp
+++ b/protocols/MRA/src/MraIcons.cpp
@@ -74,7 +74,7 @@ void IconsLoad()
void InitXStatusIcons()
{
// load libs
- TCHAR szBuff[MAX_FILEPATH];
+ wchar_t szBuff[MAX_FILEPATH];
if (GetModuleFileName(NULL, szBuff, _countof(szBuff))) {
LPWSTR lpwszFileName;
g_dwMirWorkDirPathLen = GetFullPathName(szBuff, MAX_FILEPATH, g_szMirWorkDirPath, &lpwszFileName);
@@ -89,7 +89,7 @@ void InitXStatusIcons()
g_hDLLXStatusIcons = LoadLibraryEx(szBuff, NULL, 0);
if (g_hDLLXStatusIcons) {
dwBuffLen = LoadString(g_hDLLXStatusIcons, IDS_IDENTIFY, szBuff, MAX_FILEPATH);
- if (dwBuffLen == 0 || _tcsnicmp(L"# Custom Status Icons #", szBuff, 23)) {
+ if (dwBuffLen == 0 || wcsnicmp(L"# Custom Status Icons #", szBuff, 23)) {
FreeLibrary(g_hDLLXStatusIcons);
g_hDLLXStatusIcons = NULL;
}
@@ -101,8 +101,8 @@ void InitXStatusIcons()
GetModuleFileName((g_hDLLXStatusIcons != NULL) ? g_hDLLXStatusIcons : g_hInstance, szBuff, _countof(szBuff));
SKINICONDESC sid = { 0 };
- sid.section.t = LPGENT("Protocols")L"/" LPGENT("MRA") L"/" LPGENT("Custom Status");
- sid.defaultFile.t = szBuff;
+ sid.section.w = LPGENW("Protocols")L"/" LPGENW("MRA") L"/" LPGENW("Custom Status");
+ sid.defaultFile.w = szBuff;
sid.flags = SIDF_ALL_TCHAR;
hXStatusAdvancedStatusIcons[0] = NULL;
@@ -112,7 +112,7 @@ void InitXStatusIcons()
sid.pszName = szIconName;
int iCurIndex = i+IDI_XSTATUS1-1;
- sid.description.t = (TCHAR*)lpcszXStatusNameDef[i];
+ sid.description.w = (wchar_t*)lpcszXStatusNameDef[i];
sid.iDefaultIndex = -iCurIndex;
hXStatusAdvancedStatusIcons[i] = IcoLib_AddIcon(&sid);
diff --git a/protocols/MRA/src/MraPopUp.cpp b/protocols/MRA/src/MraPopUp.cpp
index 48eb22e5bc..bad3861365 100644
--- a/protocols/MRA/src/MraPopUp.cpp
+++ b/protocols/MRA/src/MraPopUp.cpp
@@ -4,13 +4,13 @@
#define POPUPS_TYPES_COUNT 7
static LPCWSTR lpcwszPopupsTypes[] =
{
- LPGENT("None"),
- LPGENT("Debug"),
- LPGENT("Information"),
- LPGENT("Question"),
- LPGENT("Warning"),
- LPGENT("Error"),
- LPGENT("NewMail"),
+ LPGENW("None"),
+ LPGENW("Debug"),
+ LPGENW("Information"),
+ LPGENW("Question"),
+ LPGENW("Warning"),
+ LPGENW("Error"),
+ LPGENW("NewMail"),
NULL
};
@@ -131,8 +131,8 @@ int CMraProto::OnPopupOptInit(WPARAM wParam, LPARAM)
odp.position = 100000000;
odp.hInstance = g_hInstance;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_POPUPS);
- odp.ptszTitle = m_tszUserName;
- odp.ptszGroup = LPGENT("Popups");
+ odp.pwszTitle = m_tszUserName;
+ odp.pwszGroup = LPGENW("Popups");
odp.groupPosition = 900000000;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.pfnDlgProc = MraPopupDlgProcOpts;
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp
index 5422fd32f8..ac34d5dfd1 100644
--- a/protocols/MRA/src/MraProto.cpp
+++ b/protocols/MRA/src/MraProto.cpp
@@ -7,7 +7,7 @@ static int MraExtraIconsApplyAll(WPARAM, LPARAM)
return 0;
}
-CMraProto::CMraProto(const char* _module, const TCHAR* _displayName) :
+CMraProto::CMraProto(const char* _module, const wchar_t* _displayName) :
PROTO<CMraProto>(_module, _displayName),
m_bLoggedIn(false),
m_groups(5, NumericKeySortT)
@@ -35,7 +35,7 @@ CMraProto::CMraProto(const char* _module, const TCHAR* _displayName) :
if (ServiceExists(MS_NUDGE_SEND))
m_heNudgeReceived = CreateProtoEvent(PE_NUDGE);
- TCHAR name[MAX_PATH];
+ wchar_t name[MAX_PATH];
mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = { sizeof(nlu) };
@@ -155,7 +155,7 @@ MCONTACT CMraProto::AddToList(int flags, PROTOSEARCHRESULT *psr)
if (psr->cbSize != sizeof(PROTOSEARCHRESULT))
return 0;
- return AddToListByEmail(psr->email.t, psr->nick.t, psr->firstName.t, psr->lastName.t, flags);
+ return AddToListByEmail(psr->email.w, psr->nick.w, psr->firstName.w, psr->lastName.w, flags);
}
MCONTACT CMraProto::AddToListByEvent(int, int, MEVENT hDbEvent)
@@ -200,7 +200,7 @@ int CMraProto::Authorize(MEVENT hDBEvent)
return 0;
}
-int CMraProto::AuthDeny(MEVENT hDBEvent, const TCHAR* szReason)
+int CMraProto::AuthDeny(MEVENT hDBEvent, const wchar_t* szReason)
{
if (!m_bLoggedIn) return 1;
@@ -230,7 +230,7 @@ int CMraProto::AuthRecv(MCONTACT, PROTORECVEVENT* pre)
/////////////////////////////////////////////////////////////////////////////////////////
-HANDLE CMraProto::FileAllow(MCONTACT, HANDLE hTransfer, const TCHAR *szPath)
+HANDLE CMraProto::FileAllow(MCONTACT, HANDLE hTransfer, const wchar_t *szPath)
{
if (szPath != NULL)
if (MraFilesQueueAccept(hFilesQueueHandle, (DWORD_PTR)hTransfer, szPath, mir_tstrlen(szPath)) == NO_ERROR)
@@ -249,7 +249,7 @@ int CMraProto::FileCancel(MCONTACT hContact, HANDLE hTransfer)
return 1;
}
-int CMraProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR*)
+int CMraProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t*)
{
return FileCancel(hContact, hTransfer);
}
@@ -300,12 +300,12 @@ int CMraProto::GetInfo(MCONTACT hContact, int)
/////////////////////////////////////////////////////////////////////////////////////////
-HANDLE CMraProto::SearchBasic(const TCHAR *id)
+HANDLE CMraProto::SearchBasic(const wchar_t *id)
{
return SearchByEmail(id);
}
-HANDLE CMraProto::SearchByEmail(const TCHAR *email)
+HANDLE CMraProto::SearchByEmail(const wchar_t *email)
{
if (m_bLoggedIn && email) {
CMStringA szEmail(email);
@@ -315,7 +315,7 @@ HANDLE CMraProto::SearchByEmail(const TCHAR *email)
return NULL;
}
-HANDLE CMraProto::SearchByName(const TCHAR *pszNick, const TCHAR *pszFirstName, const TCHAR *pszLastName)
+HANDLE CMraProto::SearchByName(const wchar_t *pszNick, const wchar_t *pszFirstName, const wchar_t *pszLastName)
{
if (m_bLoggedIn && (*pszNick || *pszFirstName || *pszLastName)) {
DWORD dwRequestFlags = 0;
@@ -371,7 +371,7 @@ int CMraProto::SendContacts(MCONTACT hContact, int, int nContacts, MCONTACT *hCo
return iRet;
}
-HANDLE CMraProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR **ppszFiles)
+HANDLE CMraProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t **ppszFiles)
{
if (!m_bLoggedIn || !hContact || !ppszFiles)
return NULL;
@@ -517,7 +517,7 @@ HANDLE CMraProto::GetAwayMsg(MCONTACT hContact)
if (!m_bLoggedIn || !hContact)
return 0;
- TCHAR szStatusDesc[MICBLOG_STATUS_MAX + MICBLOG_STATUS_MAX + MAX_PATH], szTime[64];
+ wchar_t szStatusDesc[MICBLOG_STATUS_MAX + MICBLOG_STATUS_MAX + MAX_PATH], szTime[64];
DWORD dwTime;
int iRet = 0;
@@ -537,7 +537,7 @@ HANDLE CMraProto::GetAwayMsg(MCONTACT hContact)
return (HANDLE)iRet;
}
-int CMraProto::SetAwayMsg(int iStatus, const TCHAR *msg)
+int CMraProto::SetAwayMsg(int iStatus, const wchar_t *msg)
{
if (!m_bLoggedIn)
return 1;
diff --git a/protocols/MRA/src/MraProto.h b/protocols/MRA/src/MraProto.h
index 1ce195d477..8ea6b37f14 100644
--- a/protocols/MRA/src/MraProto.h
+++ b/protocols/MRA/src/MraProto.h
@@ -31,7 +31,7 @@ struct MraGroupItem
struct CMraProto : public PROTO<CMraProto>
{
- CMraProto(const char*, const TCHAR*);
+ CMraProto(const char*, const wchar_t*);
~CMraProto();
// ====================================================================================
@@ -42,33 +42,33 @@ struct CMraProto : public PROTO<CMraProto>
virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent);
virtual int __cdecl Authorize(MEVENT hDBEvent);
- virtual int __cdecl AuthDeny(MEVENT hDBEvent, const TCHAR* szReason);
+ virtual int __cdecl AuthDeny(MEVENT hDBEvent, const wchar_t* szReason);
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
- virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath);
+ virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath);
virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason);
+ virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason);
virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
virtual int __cdecl GetInfo(MCONTACT hContact, int infoType);
- virtual HANDLE __cdecl SearchBasic(const TCHAR* id);
- virtual HANDLE __cdecl SearchByEmail(const TCHAR* email);
- virtual HANDLE __cdecl SearchByName(const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName);
+ virtual HANDLE __cdecl SearchBasic(const wchar_t* id);
+ virtual HANDLE __cdecl SearchByEmail(const wchar_t* email);
+ virtual HANDLE __cdecl SearchByName(const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName);
virtual HWND __cdecl SearchAdvanced(HWND owner);
virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
virtual int __cdecl RecvContacts(MCONTACT hContact, PROTORECVEVENT*);
virtual int __cdecl SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList);
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles);
+ virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles);
virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg);
virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode);
virtual int __cdecl SetStatus(int iNewStatus);
virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
- virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR* msg);
+ virtual int __cdecl SetAwayMsg(int m_iStatus, const wchar_t* msg);
virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp
index ebeb34d92d..3f863a1ed5 100644
--- a/protocols/MRA/src/Mra_functions.cpp
+++ b/protocols/MRA/src/Mra_functions.cpp
@@ -648,7 +648,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA &
CMStringA szEmail;
MCONTACT hContact = NULL;
- TCHAR szMailBoxStatus[MAX_SECONDLINE];
+ wchar_t szMailBoxStatus[MAX_SECONDLINE];
mir_sntprintf(szMailBoxStatus, TranslateT("Unread mail is available: %lu/%lu messages"), m_dwEmailMessagesUnread, dwEmailMessagesTotal);
if (!pszFrom.IsEmpty() || !pszSubject.IsEmpty()) {
@@ -658,7 +658,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA &
mir_sntprintf(szStatusText, TranslateT("From: %S\r\nSubject: %S\r\n%s"), pszFrom.c_str(), szSubject.c_str(), szMailBoxStatus);
}
- else _tcsncpy_s(szStatusText, szMailBoxStatus, _TRUNCATE);
+ else wcsncpy_s(szStatusText, szMailBoxStatus, _TRUNCATE);
if (bTrayIconNewMailNotify) {
char szServiceFunction[MAX_PATH] = { 0 }, *pszServiceFunctionName;
@@ -870,11 +870,11 @@ bool CMraProto::GetContactFirstEMail(MCONTACT hContact, BOOL bMRAOnly, CMStringA
void CMraProto::ShowFormattedErrorMessage(LPWSTR lpwszErrText, DWORD dwErrorCode)
{
- TCHAR szErrorText[2048], szErrDescription[1024];
+ wchar_t szErrorText[2048], szErrDescription[1024];
size_t dwErrDescriptionSize;
if (dwErrorCode == NO_ERROR)
- _tcsncpy_s(szErrorText, TranslateTS(lpwszErrText), _TRUNCATE);
+ wcsncpy_s(szErrorText, TranslateTS(lpwszErrText), _TRUNCATE);
else {
dwErrDescriptionSize = (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErrorCode, 0, szErrDescription, (_countof(szErrDescription) - sizeof(WCHAR)), NULL) - 2);
szErrDescription[dwErrDescriptionSize] = 0;
@@ -1019,7 +1019,7 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP
case WM_TIMER:
if (dat->dwCountdown != -1) {
- TCHAR szBuff[MAX_PATH];
+ wchar_t szBuff[MAX_PATH];
mir_sntprintf(szBuff, TranslateT("Closing in %ld"), dat->dwCountdown--);
SetDlgItemText(hWndDlg, IDOK, szBuff);
break;
@@ -1046,7 +1046,7 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP
SetWindowLongPtr(hWndDlg, GWLP_USERDATA, 0);
if (dat) { // set our xStatus
- TCHAR szBuff[STATUS_TITLE_MAX + STATUS_DESC_MAX];
+ wchar_t szBuff[STATUS_TITLE_MAX + STATUS_DESC_MAX];
DWORD dwBuffSize = GetDlgItemText(hWndDlg, IDC_XMSG, szBuff, (STATUS_DESC_MAX + 1));
char szValueName[MAX_PATH];
@@ -1145,7 +1145,7 @@ INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg, UINT message, WPARAM w
{
DWORD dwFlags;
DWORDLONG dwBlogStatusID;
- TCHAR szBuff[MICBLOG_STATUS_MAX];
+ wchar_t szBuff[MICBLOG_STATUS_MAX];
GetDlgItemText(hWndDlg, IDC_MSG_TO_SEND, szBuff, _countof(szBuff));
@@ -1172,7 +1172,7 @@ INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg, UINT message, WPARAM w
case IDC_MSG_TO_SEND:
if (HIWORD(wParam) == EN_CHANGE) {
- TCHAR tszBuff[MAX_PATH];
+ wchar_t tszBuff[MAX_PATH];
size_t dwMessageSize = GetWindowTextLength(GetDlgItem(hWndDlg, IDC_MSG_TO_SEND));
EnableWindow(GetDlgItem(hWndDlg, IDOK), (int)dwMessageSize);
@@ -1232,7 +1232,7 @@ DWORD FindFile(LPWSTR lpszFolder, DWORD dwFolderLen, LPWSTR lpszFileName, DWORD
DWORD dwRetErrorCode;
if (lpszFolder && dwFolderLen && lpszFileName && dwFileNameLen) {
- TCHAR szPath[32768];
+ wchar_t szPath[32768];
DWORD dwPathLen, dwRecDeepAllocated, dwRecDeepCurPos, dwFilePathLen;
RECURSION_DATA_STACK_ITEM *prdsiItems;
@@ -1434,15 +1434,15 @@ static DWORD ReplaceInBuff(LPVOID lpInBuff, size_t dwInBuffSize, size_t dwReplac
}
static const LPTSTR lpszXMLTags[] = { L"&apos;", L"&quot;", L"&amp;", L"&lt;", L"&gt;" };
-static const size_t dwXMLTagsCount[] = { (6 * sizeof(TCHAR)), (6 * sizeof(TCHAR)), (5 * sizeof(TCHAR)), (4 * sizeof(TCHAR)), (4 * sizeof(TCHAR)) };
+static const size_t dwXMLTagsCount[] = { (6 * sizeof(wchar_t)), (6 * sizeof(wchar_t)), (5 * sizeof(wchar_t)), (4 * sizeof(wchar_t)), (4 * sizeof(wchar_t)) };
static const LPTSTR lpszXMLSymbols[] = { L"\'", L"\"", L"&", L"<", L">" };
-static const size_t dwXMLSymbolsCount[] = { sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR) };
+static const size_t dwXMLSymbolsCount[] = { sizeof(wchar_t), sizeof(wchar_t), sizeof(wchar_t), sizeof(wchar_t), sizeof(wchar_t) };
//Decode XML coded string. The function translate special xml code into standard characters.
CMStringW DecodeXML(const CMStringW &lptszMessage)
{
CMStringW ret('\0', (lptszMessage.GetLength() * 4));
- ReplaceInBuff((void*)lptszMessage.GetString(), lptszMessage.GetLength()*sizeof(TCHAR), _countof(lpszXMLTags), (LPVOID*)lpszXMLTags, (size_t*)dwXMLTagsCount, (LPVOID*)lpszXMLSymbols, (size_t*)dwXMLSymbolsCount, ret);
+ ReplaceInBuff((void*)lptszMessage.GetString(), lptszMessage.GetLength()*sizeof(wchar_t), _countof(lpszXMLTags), (LPVOID*)lpszXMLTags, (size_t*)dwXMLTagsCount, (LPVOID*)lpszXMLSymbols, (size_t*)dwXMLSymbolsCount, ret);
return ret;
}
@@ -1450,6 +1450,6 @@ CMStringW DecodeXML(const CMStringW &lptszMessage)
CMStringW EncodeXML(const CMStringW &lptszMessage)
{
CMStringW ret('\0', (lptszMessage.GetLength() * 4));
- ReplaceInBuff((void*)lptszMessage.GetString(), lptszMessage.GetLength()*sizeof(TCHAR), _countof(lpszXMLTags), (LPVOID*)lpszXMLSymbols, (size_t*)dwXMLSymbolsCount, (LPVOID*)lpszXMLTags, (size_t*)dwXMLTagsCount, ret);
+ ReplaceInBuff((void*)lptszMessage.GetString(), lptszMessage.GetLength()*sizeof(wchar_t), _countof(lpszXMLTags), (LPVOID*)lpszXMLSymbols, (size_t*)dwXMLSymbolsCount, (LPVOID*)lpszXMLTags, (size_t*)dwXMLTagsCount, ret);
return ret;
}
diff --git a/protocols/MRA/src/Mra_menus.cpp b/protocols/MRA/src/Mra_menus.cpp
index 902f9eac07..a0ac316017 100644
--- a/protocols/MRA/src/Mra_menus.cpp
+++ b/protocols/MRA/src/Mra_menus.cpp
@@ -76,7 +76,7 @@ INT_PTR CMraProto::MraRequestAuthorization(WPARAM hContact, LPARAM)
CMStringW wszAuthMessage;
if (!mraGetStringW(NULL, "AuthMessage", wszAuthMessage))
- wszAuthMessage = TranslateT(MRA_DEFAULT_AUTH_MESSAGE);
+ wszAuthMessage = TranslateW(MRA_DEFAULT_AUTH_MESSAGE);
if (wszAuthMessage.IsEmpty())
return 1;
@@ -281,12 +281,12 @@ int CMraProto::MraRebuildStatusMenu(WPARAM, LPARAM)
HGENMENU hRoot;
{
- TCHAR szItem[MAX_PATH + 64];
+ wchar_t szItem[MAX_PATH + 64];
mir_sntprintf(szItem, L"%s Custom Status", m_tszUserName);
CMenuItem mi;
mi.root = pcli->pfnGetProtocolMenu(m_szModuleName);
- mi.name.t = szItem;
+ mi.name.w = szItem;
mi.position = 10001;
hRoot = Menu_AddStatusMenuItem(&mi, m_szModuleName);
}
@@ -308,14 +308,14 @@ int CMraProto::MraRebuildStatusMenu(WPARAM, LPARAM)
if (i) {
mir_snprintf(szValueName, "XStatus%ldName", i);
if (mraGetStringW(NULL, szValueName, szStatusTitle))
- mi.name.t = (TCHAR*)szStatusTitle.c_str();
+ mi.name.w = (wchar_t*)szStatusTitle.c_str();
else
- mi.name.t = (TCHAR*)lpcszXStatusNameDef[i];
+ mi.name.w = (wchar_t*)lpcszXStatusNameDef[i];
mi.hIcolibItem = hXStatusAdvancedStatusIcons[i];
}
else {
- mi.name.t = (TCHAR*)lpcszXStatusNameDef[i];
+ mi.name.w = (wchar_t*)lpcszXStatusNameDef[i];
mi.hIcolibItem = NULL;
}
hXStatusMenuItems[i] = Menu_AddStatusMenuItem(&mi, m_szModuleName);
@@ -340,7 +340,7 @@ HGENMENU CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bI
hRootMenu = Menu_GetProtocolRoot(this);
if (hRootMenu == NULL) {
- mi.name.t = m_tszUserName;
+ mi.name.w = m_tszUserName;
mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.hIcolibItem = g_hMainIcon;
hRootMenu = Menu_AddProtoMenuItem(&mi);
diff --git a/protocols/MRA/src/Mra_options.cpp b/protocols/MRA/src/Mra_options.cpp
index abf966c43f..6247ef9249 100644
--- a/protocols/MRA/src/Mra_options.cpp
+++ b/protocols/MRA/src/Mra_options.cpp
@@ -36,7 +36,7 @@ INT_PTR CALLBACK DlgProcOptsAccount(HWND hWndDlg, UINT msg, WPARAM wParam, LPARA
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- TCHAR szBuff[MAX_EMAIL_LEN];
+ wchar_t szBuff[MAX_EMAIL_LEN];
GetDlgItemText(hWndDlg, IDC_LOGIN, szBuff, _countof(szBuff));
ppro->setTString(NULL, "e-mail", szBuff);
@@ -86,7 +86,7 @@ INT_PTR CALLBACK DlgProcAccount(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lP
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- TCHAR szBuff[MAX_EMAIL_LEN];
+ wchar_t szBuff[MAX_EMAIL_LEN];
GetDlgItemText(hWndDlg, IDC_LOGIN, szBuff, _countof(szBuff));
ppro->mraSetStringW(NULL, "e-mail", szBuff);
@@ -186,7 +186,7 @@ INT_PTR CALLBACK DlgProcOptsConnections(HWND hWndDlg, UINT msg, WPARAM wParam, L
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- TCHAR szBuff[MAX_PATH];
+ wchar_t szBuff[MAX_PATH];
GetDlgItemText(hWndDlg, IDC_SERVER, szBuff, _countof(szBuff));
ppro->mraSetStringW(NULL, "Server", szBuff);
ppro->setWord("ServerPort", (WORD)GetDlgItemInt(hWndDlg, IDC_SERVERPORT, NULL, FALSE));
@@ -216,26 +216,26 @@ int CMraProto::OnOptionsInit(WPARAM wParam, LPARAM lParam)
OPTIONSDIALOGPAGE odp = { 0 };
odp.dwInitParam = (LPARAM)this;
odp.hInstance = g_hInstance;
- odp.ptszTitle = m_tszUserName;
- odp.ptszGroup = LPGENT("Network");
+ odp.pwszTitle = m_tszUserName;
+ odp.pwszGroup = LPGENW("Network");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.ptszTab = LPGENT("Account");
+ odp.pwszTab = LPGENW("Account");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ACCOUNT);
odp.pfnDlgProc = DlgProcOptsAccount;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Connections");
+ odp.pwszTab = LPGENW("Connections");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CONNECTIONS);
odp.pfnDlgProc = DlgProcOptsConnections;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Files");
+ odp.pwszTab = LPGENW("Files");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FILES);
odp.pfnDlgProc = MraFilesQueueDlgProcOpts;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Avatars");
+ odp.pwszTab = LPGENW("Avatars");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_AVATRS);
odp.pfnDlgProc = MraAvatarsQueueDlgProcOpts;
Options_AddPage(wParam, &odp);
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp
index 133101acee..283726a3d2 100644
--- a/protocols/MRA/src/Mra_proto.cpp
+++ b/protocols/MRA/src/Mra_proto.cpp
@@ -502,12 +502,12 @@ bool CMraProto::CmdUserInfo(BinBuffer &buf)
}
else if (szString == "micblog.status.id") {
buf >> szStringW;
- DWORDLONG dwBlogStatusID = _ttoi64(szStringW);
+ DWORDLONG dwBlogStatusID = _wtoi64(szStringW);
mraWriteContactSettingBlob(NULL, DBSETTING_BLOGSTATUSID, &dwBlogStatusID, sizeof(DWORDLONG));
}
else if (szString == "micblog.status.time") {
buf >> szStringW;
- setDword(DBSETTING_BLOGSTATUSTIME, _ttoi(szStringW));
+ setDword(DBSETTING_BLOGSTATUSTIME, _wtoi(szStringW));
}
else if (szString == "micblog.status.text") {
buf >> szStringW;
@@ -652,7 +652,7 @@ bool CMraProto::CmdFileTransferAck(BinBuffer &buf)
MraFilesQueueSendMirror(hFilesQueueHandle, dwTemp, szString);
break;
default:// ## unknown error
- TCHAR szBuff[1024];
+ wchar_t szBuff[1024];
mir_sntprintf(szBuff, TranslateT("MRIM_CS_FILE_TRANSFER_ACK: unknown error, code: %lu"), dwAckType);
ShowFormattedErrorMessage(szBuff, NO_ERROR);
break;
@@ -749,7 +749,7 @@ bool CMraProto::CmdContactAck(int cmd, int seq, BinBuffer &buf)
ShowFormattedErrorMessage(L"Group limit is 20", NO_ERROR);
break;
default:// ## unknown error
- TCHAR szBuff[1024];
+ wchar_t szBuff[1024];
mir_sntprintf(szBuff, TranslateT("MRIM_CS_*_CONTACT_ACK: unknown server error, code: %lu"), dwTemp);
MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, szBuff);
break;
@@ -941,7 +941,7 @@ bool CMraProto::CmdAnketaInfo(int seq, BinBuffer &buf)
}
}
else if (dwAckType == ACKTYPE_SEARCH) {
- TCHAR szNick[MAX_EMAIL_LEN] = { 0 },
+ wchar_t szNick[MAX_EMAIL_LEN] = { 0 },
szFirstName[MAX_EMAIL_LEN] = { 0 },
szLastName[MAX_EMAIL_LEN] = { 0 },
szEmail[MAX_EMAIL_LEN] = { 0 };
@@ -950,11 +950,11 @@ bool CMraProto::CmdAnketaInfo(int seq, BinBuffer &buf)
psr.cbSize = sizeof(psr);
psr.flags = PSR_UNICODE;
- psr.nick.t = szNick;
- psr.firstName.t = szFirstName;
- psr.lastName.t = szLastName;
- psr.email.t = szEmail;
- psr.id.t = szEmail;
+ psr.nick.w = szNick;
+ psr.firstName.w = szFirstName;
+ psr.lastName.w = szLastName;
+ psr.email.w = szEmail;
+ psr.id.w = szEmail;
for (DWORD i = 0; i < dwFieldsNum; i++) {
CMStringA &fld = pmralpsFields[i];
@@ -1043,7 +1043,7 @@ bool CMraProto::CmdGame(BinBuffer &buf)
case GAME_MESSAGES_NUMBER:
break;
default:
- TCHAR szBuff[1024];
+ wchar_t szBuff[1024];
mir_sntprintf(szBuff, TranslateT("MRIM_CS_GAME: unknown internal game message code: %lu"), dwGameMsg);
MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, szBuff);
break;
@@ -1307,7 +1307,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf)
CMStringW wszAuthMessage, nick;
if (mraGetStringW(NULL, "AuthMessage", wszAuthMessage) == FALSE) // def auth message
- wszAuthMessage = TranslateT(MRA_DEFAULT_AUTH_MESSAGE);
+ wszAuthMessage = TranslateW(MRA_DEFAULT_AUTH_MESSAGE);
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if (GetContactBasicInfoW(hContact, &dwID, NULL, NULL, NULL, NULL, &email, NULL, NULL) == NO_ERROR)
@@ -1350,7 +1350,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf)
else if (dwTemp == GET_CONTACTS_INTERR) // ïðîèçîøëà âíóòðåííÿÿ îøèáêà
ShowFormattedErrorMessage(L"MRIM_CS_CONTACT_LIST2: internal server error", NO_ERROR);
else {
- TCHAR szBuff[1024];
+ wchar_t szBuff[1024];
mir_sntprintf(szBuff, TranslateT("MRIM_CS_CONTACT_LIST2: unknown server error, code: %lu"), dwTemp);
MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, szBuff);
}
diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp
index d5477896e7..b5902ed4ae 100644
--- a/protocols/MRA/src/Mra_svcs.cpp
+++ b/protocols/MRA/src/Mra_svcs.cpp
@@ -66,56 +66,56 @@ LPCSTR lpcszStatusUri[] =
LPCWSTR lpcszXStatusNameDef[] =
{
- LPGENT("None"),
- LPGENT("Sick"),
- LPGENT("Home"),
- LPGENT("Eating"),
- LPGENT("Compass"),
- LPGENT("On WC"),
- LPGENT("Cooking"),
- LPGENT("Walking"),
- LPGENT("Alien"),
- LPGENT("Shrimp"),
- LPGENT("Got lost"),
- LPGENT("Crazy"),
- LPGENT("Duck"),
- LPGENT("Playing"),
- LPGENT("Smoking"),
- LPGENT("Office"),
- LPGENT("Meeting"),
- LPGENT("Beer"),
- LPGENT("Coffee"),
- LPGENT("Working"),
- LPGENT("Relaxing"),
- LPGENT("On the phone"),
- LPGENT("In institute"),
- LPGENT("At school"),
- LPGENT("Wrong number"),
- LPGENT("Laughing"),
- LPGENT("Malicious"),
- LPGENT("Imp"),
- LPGENT("Blind"),
- LPGENT("Disappointed"),
- LPGENT("Almost crying"),
- LPGENT("Fearful"),
- LPGENT("Angry"),
- LPGENT("Vampire"),
- LPGENT("Ass"),
- LPGENT("Love"),
- LPGENT("Sleeping"),
- LPGENT("Cool!"),
- LPGENT("Peace!"),
- LPGENT("Cock a snook"),
- LPGENT("Get out"),
- LPGENT("Death"),
- LPGENT("Rocket"),
- LPGENT("Devil-fish"),
- LPGENT("Heavy metal"),
- LPGENT("Things look bad"),
- LPGENT("Squirrel"),
- LPGENT("Star"),
- LPGENT("Music"),
- LPGENT("Dating"),
+ LPGENW("None"),
+ LPGENW("Sick"),
+ LPGENW("Home"),
+ LPGENW("Eating"),
+ LPGENW("Compass"),
+ LPGENW("On WC"),
+ LPGENW("Cooking"),
+ LPGENW("Walking"),
+ LPGENW("Alien"),
+ LPGENW("Shrimp"),
+ LPGENW("Got lost"),
+ LPGENW("Crazy"),
+ LPGENW("Duck"),
+ LPGENW("Playing"),
+ LPGENW("Smoking"),
+ LPGENW("Office"),
+ LPGENW("Meeting"),
+ LPGENW("Beer"),
+ LPGENW("Coffee"),
+ LPGENW("Working"),
+ LPGENW("Relaxing"),
+ LPGENW("On the phone"),
+ LPGENW("In institute"),
+ LPGENW("At school"),
+ LPGENW("Wrong number"),
+ LPGENW("Laughing"),
+ LPGENW("Malicious"),
+ LPGENW("Imp"),
+ LPGENW("Blind"),
+ LPGENW("Disappointed"),
+ LPGENW("Almost crying"),
+ LPGENW("Fearful"),
+ LPGENW("Angry"),
+ LPGENW("Vampire"),
+ LPGENW("Ass"),
+ LPGENW("Love"),
+ LPGENW("Sleeping"),
+ LPGENW("Cool!"),
+ LPGENW("Peace!"),
+ LPGENW("Cock a snook"),
+ LPGENW("Get out"),
+ LPGENW("Death"),
+ LPGENW("Rocket"),
+ LPGENW("Devil-fish"),
+ LPGENW("Heavy metal"),
+ LPGENW("Things look bad"),
+ LPGENW("Squirrel"),
+ LPGENW("Star"),
+ LPGENW("Music"),
+ LPGENW("Dating"),
NULL
};
@@ -247,7 +247,7 @@ int CMraProto::MraDbSettingChanged(WPARAM hContact, LPARAM lParam)
if (cws->value.type == DBVT_DELETED || (cws->value.type == DBVT_BYTE && cws->value.bVal == 0)) {
CMStringW wszAuthMessage;
if (!mraGetStringW(NULL, "AuthMessage", wszAuthMessage))
- wszAuthMessage = TranslateT(MRA_DEFAULT_AUTH_MESSAGE);
+ wszAuthMessage = TranslateW(MRA_DEFAULT_AUTH_MESSAGE);
db_unset(hContact, "CList", "Hidden");
diff --git a/protocols/MSN/src/msn.cpp b/protocols/MSN/src/msn.cpp
index ae71843bd2..2f217da0b5 100644
--- a/protocols/MSN/src/msn.cpp
+++ b/protocols/MSN/src/msn.cpp
@@ -86,7 +86,7 @@ static int OnModulesLoaded(WPARAM, LPARAM)
return 0;
}
-static CMsnProto* msnProtoInit(const char* pszProtoName, const TCHAR* tszUserName)
+static CMsnProto* msnProtoInit(const char* pszProtoName, const wchar_t* tszUserName)
{
CMsnProto *ppro = new CMsnProto(pszProtoName, tszUserName);
g_Instances.insert(ppro);
diff --git a/protocols/MSN/src/msn_auth.cpp b/protocols/MSN/src/msn_auth.cpp
index 27a002ceba..aa1bb8e95c 100644
--- a/protocols/MSN/src/msn_auth.cpp
+++ b/protocols/MSN/src/msn_auth.cpp
@@ -358,7 +358,7 @@ int CMsnProto::MSN_GetPassportAuth(void)
time_t ts = time(NULL);
- TCHAR szTs1[64], szTs2[64];
+ wchar_t szTs1[64], szTs2[64];
TimeZone_PrintTimeStamp(UTC_TIME_HANDLE, ts, L"I", szTs1, _countof(szTs1), 0);
TimeZone_PrintTimeStamp(UTC_TIME_HANDLE, ts + 20 * 60, L"I", szTs2, _countof(szTs2), 0);
@@ -969,7 +969,7 @@ void __cdecl CMsnProto::msn_IEAuthThread(void *pParam)
HWND hWnd;
MSG msg;
WNDCLASSEX wc={0};
- static const TCHAR *ClassName = L"SkypeLoginWindow";
+ static const wchar_t *ClassName = L"SkypeLoginWindow";
CoInitialize(NULL);
diff --git a/protocols/MSN/src/msn_avatar.cpp b/protocols/MSN/src/msn_avatar.cpp
index bb7121218a..5836baa234 100644
--- a/protocols/MSN/src/msn_avatar.cpp
+++ b/protocols/MSN/src/msn_avatar.cpp
@@ -71,7 +71,7 @@ LBL_Error:
return false;
}
- const TCHAR *szExt;
+ const wchar_t *szExt;
int fmt = ProtoGetBufferFormat(nlhrReply->pData, &szExt);
if (fmt == PA_FORMAT_UNKNOWN)
goto LBL_Error;
@@ -80,9 +80,9 @@ LBL_Error:
ai.format = fmt;
ai.hContact = p->hContact;
MSN_GetAvatarFileName(ai.hContact, ai.filename, _countof(ai.filename), szExt);
- _tremove(ai.filename);
+ _wremove(ai.filename);
- int fileId = _topen(ai.filename, _O_CREAT | _O_TRUNC | _O_WRONLY | O_BINARY, _S_IREAD | _S_IWRITE);
+ int fileId = _wopen(ai.filename, _O_CREAT | _O_TRUNC | _O_WRONLY | O_BINARY, _S_IREAD | _S_IWRITE);
if (fileId == -1)
goto LBL_Error;
diff --git a/protocols/MSN/src/msn_chat.cpp b/protocols/MSN/src/msn_chat.cpp
index 9c13070bc1..995404ea9b 100644
--- a/protocols/MSN/src/msn_chat.cpp
+++ b/protocols/MSN/src/msn_chat.cpp
@@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "msn_proto.h"
#include <m_history.h>
-static const TCHAR *m_ptszRoles[] = {
+static const wchar_t *m_ptszRoles[] = {
L"admin",
L"user"
};
@@ -47,14 +47,14 @@ int CMsnProto::MSN_ChatInit(GCThreadData *info, const char *pszID, const char *p
{
char *szNet, *szEmail;
- _tcsncpy(info->mChatID, _A2T(pszID), _countof(info->mChatID));
+ wcsncpy(info->mChatID, _A2T(pszID), _countof(info->mChatID));
parseWLID(NEWSTR_ALLOCA(pszID), &szNet, &szEmail, NULL);
info->netId = atoi(szNet);
strncpy(info->szEmail, szEmail, sizeof(info->szEmail));
- TCHAR szName[512];
+ wchar_t szName[512];
InterlockedIncrement(&m_chatID);
- if (*pszTopic) _tcsncpy(szName, _A2T(pszTopic), _countof(szName));
+ if (*pszTopic) wcsncpy(szName, _A2T(pszTopic), _countof(szName));
else mir_sntprintf(szName, L"%s %s%d",
m_tszUserName, TranslateT("Chat #"), m_chatID);
@@ -77,7 +77,7 @@ int CMsnProto::MSN_ChatInit(GCThreadData *info, const char *pszID, const char *p
CallServiceSync(MS_GC_EVENT, SESSION_ONLINE, (LPARAM)&gce);
CallServiceSync(MS_GC_EVENT, WINDOW_VISIBLE, (LPARAM)&gce);
- mir_free((TCHAR*)gce.ptszUID);
+ mir_free((wchar_t*)gce.ptszUID);
return 0;
}
@@ -143,7 +143,7 @@ void CMsnProto::MSN_ChatStart(ezxml_t xmli)
}
}
-void CMsnProto::MSN_KillChatSession(const TCHAR* id)
+void CMsnProto::MSN_KillChatSession(const wchar_t* id)
{
GCDEST gcd = { m_szModuleName, id, GC_EVENT_CONTROL };
GCEVENT gce = { sizeof(gce), &gcd };
@@ -168,7 +168,7 @@ void CMsnProto::MSN_Promoteuser(GCHOOK *gch, const char *pszRole)
thread->netId, thread->szEmail, _T2A(gch->ptszUID), pszRole);
}
-const TCHAR *CMsnProto::MSN_GCGetRole(GCThreadData* thread, const char *pszWLID)
+const wchar_t *CMsnProto::MSN_GCGetRole(GCThreadData* thread, const char *pszWLID)
{
if (thread)
for (int j = 0; j < thread->mJoinedContacts.getCount(); j++)
@@ -178,7 +178,7 @@ const TCHAR *CMsnProto::MSN_GCGetRole(GCThreadData* thread, const char *pszWLID)
return NULL;
}
-void CMsnProto::MSN_GCProcessThreadActivity(ezxml_t xmli, const TCHAR *mChatID)
+void CMsnProto::MSN_GCProcessThreadActivity(ezxml_t xmli, const wchar_t *mChatID)
{
if (!mir_strcmp(xmli->name, "topicupdate")) {
ezxml_t initiator = ezxml_child(xmli, "initiator");
@@ -191,8 +191,8 @@ void CMsnProto::MSN_GCProcessThreadActivity(ezxml_t xmli, const TCHAR *mChatID)
gce.ptszNick = GetContactNameT(hContInitiator);
gce.ptszText = mir_a2t(ezxml_txt(ezxml_child(xmli, "value")));
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
- mir_free((TCHAR*)gce.ptszUID);
- mir_free((TCHAR*)gce.ptszText);
+ mir_free((wchar_t*)gce.ptszUID);
+ mir_free((wchar_t*)gce.ptszText);
}
else if (ezxml_t target = ezxml_child(xmli, "target")) {
MCONTACT hContInitiator = NULL;
@@ -248,7 +248,7 @@ void CMsnProto::MSN_GCProcessThreadActivity(ezxml_t xmli, const TCHAR *mChatID)
MCONTACT hContTarget = MSN_HContactFromEmail(pszTarget);
gce.ptszNick = GetContactNameT(hContTarget);
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
- mir_free((TCHAR*)gce.ptszUID);
+ mir_free((wchar_t*)gce.ptszUID);
if ((gcd.iType == GC_EVENT_PART || gcd.iType == GC_EVENT_KICK) && gce.bIsMe) {
GCDEST gcd2 = { m_szModuleName, mChatID, GC_EVENT_CONTROL };
GCEVENT gce2 = { sizeof(gce2), &gcd2 };
@@ -282,7 +282,7 @@ void CMsnProto::MSN_GCRefreshThreadsInfo(void)
msnNsThread->sendPacketPayload("GET", "MSGR\\THREADS", "<threads>%s</threads>", buf);
}
-void CMsnProto::MSN_GCAddMessage(TCHAR *mChatID, MCONTACT hContact, char *email, time_t ts, bool sentMsg, char *msgBody)
+void CMsnProto::MSN_GCAddMessage(wchar_t *mChatID, MCONTACT hContact, char *email, time_t ts, bool sentMsg, char *msgBody)
{
GCDEST gcd = { m_szModuleName, mChatID, GC_EVENT_MESSAGE };
GCEVENT gce = { sizeof(gce), &gcd };
@@ -292,7 +292,7 @@ void CMsnProto::MSN_GCAddMessage(TCHAR *mChatID, MCONTACT hContact, char *email,
gce.time = ts;
gce.bIsMe = sentMsg;
- TCHAR* p = mir_utf8decodeT(msgBody);
+ wchar_t* p = mir_utf8decodeT(msgBody);
gce.ptszText = EscapeChatTags(p);
mir_free(p);
@@ -330,7 +330,7 @@ static void ChatInviteSend(HANDLE hItem, HWND hwndList, STRLIST &str, CMsnProto
int chk = SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0);
if (chk) {
if (IsHContactInfo(hItem)) {
- TCHAR buf[128] = L"";
+ wchar_t buf[128] = L"";
SendMessage(hwndList, CLM_GETITEMTEXT, (WPARAM)hItem, (LPARAM)buf);
if (buf[0]) str.insert(mir_t2a(buf));
@@ -420,13 +420,13 @@ INT_PTR CALLBACK DlgInviteToChat(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
switch (LOWORD(wParam)) {
case IDC_ADDSCR:
if (param->ppro->msnLoggedIn) {
- TCHAR email[MSN_MAX_EMAIL_LEN];
+ wchar_t email[MSN_MAX_EMAIL_LEN];
GetDlgItemText(hwndDlg, IDC_EDITSCR, email, _countof(email));
CLCINFOITEM cii = { 0 };
cii.cbSize = sizeof(cii);
cii.flags = CLCIIF_CHECKBOX | CLCIIF_BELOWCONTACTS;
- cii.pszText = _tcslwr(email);
+ cii.pszText = wcslwr(email);
HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CCLIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
SendDlgItemMessage(hwndDlg, IDC_CCLIST, CLM_SETCHECKMARK, (LPARAM)hItem, 1);
@@ -501,7 +501,7 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam)
if (gch->ptszText && gch->ptszText[0]) {
GCThreadData* thread = MSN_GetThreadByChatId(gch->pDest->ptszID);
if (thread) {
- TCHAR* pszMsg = UnEscapeChatTags(NEWTSTR_ALLOCA(gch->ptszText));
+ wchar_t* pszMsg = UnEscapeChatTags(NEWWSTR_ALLOCA(gch->ptszText));
rtrimt(pszMsg); // remove the ending linebreak
msnNsThread->sendMessage('N', thread->szEmail, thread->netId, UTF8(pszMsg), 0);
@@ -573,7 +573,7 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam)
break;
case 40:
- const TCHAR *pszRole = MSN_GCGetRole(MSN_GetThreadByChatId(gch->pDest->ptszID), _T2A(gch->ptszUID));
+ const wchar_t *pszRole = MSN_GCGetRole(MSN_GetThreadByChatId(gch->pDest->ptszID), _T2A(gch->ptszUID));
MSN_Promoteuser(gch, (pszRole && !mir_tstrcmp(pszRole, L"admin")) ? "user" : "admin");
break;
}
@@ -592,8 +592,8 @@ int CMsnProto::MSN_GCMenuHook(WPARAM, LPARAM lParam)
if (gcmi->Type == MENU_ON_LOG) {
static const struct gc_item Items[] =
{
- { LPGENT("&Invite user..."), 10, MENU_ITEM, FALSE },
- { LPGENT("&Leave chat session"), 20, MENU_ITEM, FALSE }
+ { LPGENW("&Invite user..."), 10, MENU_ITEM, FALSE },
+ { LPGENW("&Leave chat session"), 20, MENU_ITEM, FALSE }
};
gcmi->nItems = _countof(Items);
gcmi->Item = (gc_item*)Items;
@@ -603,10 +603,10 @@ int CMsnProto::MSN_GCMenuHook(WPARAM, LPARAM lParam)
if (!_stricmp(GetMyUsername(NETID_SKYPE), email)) {
static const struct gc_item Items[] =
{
- { LPGENT("User &details"), 10, MENU_ITEM, FALSE },
- { LPGENT("User &history"), 20, MENU_ITEM, FALSE },
+ { LPGENW("User &details"), 10, MENU_ITEM, FALSE },
+ { LPGENW("User &history"), 20, MENU_ITEM, FALSE },
{ L"", 100, MENU_SEPARATOR, FALSE },
- { LPGENT("&Leave chat session"), 110, MENU_ITEM, FALSE }
+ { LPGENW("&Leave chat session"), 110, MENU_ITEM, FALSE }
};
gcmi->nItems = _countof(Items);
gcmi->Item = (gc_item*)Items;
@@ -614,10 +614,10 @@ int CMsnProto::MSN_GCMenuHook(WPARAM, LPARAM lParam)
else {
static struct gc_item Items[] =
{
- { LPGENT("User &details"), 10, MENU_ITEM, FALSE },
- { LPGENT("User &history"), 20, MENU_ITEM, FALSE },
- { LPGENT("&Kick user") , 30, MENU_ITEM, FALSE },
- { LPGENT("&Op user") , 40, MENU_ITEM, FALSE }
+ { LPGENW("User &details"), 10, MENU_ITEM, FALSE },
+ { LPGENW("User &history"), 20, MENU_ITEM, FALSE },
+ { LPGENW("&Kick user") , 30, MENU_ITEM, FALSE },
+ { LPGENW("&Op user") , 40, MENU_ITEM, FALSE }
};
GCThreadData* thread = MSN_GetThreadByChatId(gcmi->pszID);
if (thread && thread->mMe && mir_tstrcmpi(thread->mMe->role, L"admin")) {
@@ -625,9 +625,9 @@ int CMsnProto::MSN_GCMenuHook(WPARAM, LPARAM lParam)
Items[3].bDisabled = TRUE;
}
else {
- const TCHAR *pszRole = MSN_GCGetRole(thread, email);
+ const wchar_t *pszRole = MSN_GCGetRole(thread, email);
if (pszRole && !mir_tstrcmpi(pszRole, L"admin"))
- Items[3].pszDesc = LPGENT("&Deop user");
+ Items[3].pszDesc = LPGENW("&Deop user");
}
gcmi->nItems = _countof(Items);
gcmi->Item = (gc_item*)Items;
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp
index c2a02ae5c1..b38a1c2680 100644
--- a/protocols/MSN/src/msn_commands.cpp
+++ b/protocols/MSN/src/msn_commands.cpp
@@ -125,7 +125,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
int msgBytes;
char *nick = NULL, *email = NULL;
- TCHAR *mChatID = NULL;
+ wchar_t *mChatID = NULL;
bool ubmMsg = strncmp(cmdString, "UBM", 3) == 0;
bool sdgMsg = strncmp(cmdString, "SDG", 3) == 0;
bool nfyMsg = strncmp(cmdString, "NFY", 3) == 0;
@@ -182,7 +182,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
msgBody = tHeader.readFromBuffer(msgBody);
if (!(email = NEWSTR_ALLOCA(tHeader["From"]))) return;
mChatID = mir_a2t(tHeader["To"]);
- if (_tcsncmp(mChatID, L"19:", 3)) mChatID[0]=0; // NETID_THREAD
+ if (wcsncmp(mChatID, L"19:", 3)) mChatID[0]=0; // NETID_THREAD
msgBody = tHeader.readFromBuffer(msgBody);
msgBody = tHeader.readFromBuffer(msgBody);
nick = NEWSTR_ALLOCA(tHeader["IM-Display-Name"]);
@@ -274,7 +274,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
psr[cnt] = (PROTOSEARCHRESULT*)mir_calloc(sizeof(PROTOSEARCHRESULT));
psr[cnt]->cbSize = sizeof(psr);
psr[cnt]->flags = PSR_TCHAR;
- psr[cnt]->id.t = psr[cnt]->nick.t = psr[cnt]->email.t = mir_a2t(wlid);
+ psr[cnt]->id.w = psr[cnt]->nick.w = psr[cnt]->email.w = mir_a2t(wlid);
cnt++;
}
}
@@ -286,7 +286,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
pre.lParam = cnt;
ProtoChainRecv(hContact, PSR_CONTACTS, 0, (LPARAM)&pre);
for (cnt=0; cnt<pre.lParam; cnt++) {
- mir_free(psr[cnt]->email.t);
+ mir_free(psr[cnt]->email.w);
mir_free(psr[cnt]);
}
}
@@ -519,18 +519,18 @@ void CMsnProto::MSN_ProcessURIObject(MCONTACT hContact, ezxml_t xmli)
ft->szInvcookie = (char*)mir_calloc(strlen(uri)+16);
sprintf(ft->szInvcookie, "%s/content/imgpsh", uri);
- TCHAR tComment[40];
+ wchar_t tComment[40];
mir_sntprintf(tComment, TranslateT("%I64u bytes"), ft->std.currentFileSize);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
pre.fileCount = 1;
pre.timestamp = time(NULL);
- pre.descr.t = (desc = ezxml_child(xmli, "Description"))?mir_utf8decodeT(desc->txt):tComment;
- pre.files.t = &ft->std.tszCurrentFile;
+ pre.descr.w = (desc = ezxml_child(xmli, "Description"))?mir_utf8decodeT(desc->txt):tComment;
+ pre.files.w = &ft->std.tszCurrentFile;
pre.lParam = (LPARAM)ft;
ProtoChainRecvFile(ft->std.hContact, &pre);
- if (desc) mir_free(pre.descr.t);
+ if (desc) mir_free(pre.descr.w);
} else uri=NULL;
}
@@ -574,9 +574,9 @@ void CMsnProto::MSN_ProcessYFind(char* buf, size_t len)
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
psr.flags = PSR_TCHAR;
- psr.id.t = szEmailT;
- psr.nick.t = szEmailT;
- psr.email.t = szEmailT;
+ psr.id.w = szEmailT;
+ psr.nick.w = szEmailT;
+ psr.email.w = szEmailT;
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, msnSearchId, (LPARAM)&psr);
}
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, msnSearchId, 0);
@@ -808,7 +808,7 @@ void CMsnProto::MSN_ProcessStatusMessage(ezxml_t xmli, const char* wlid)
char *format = mir_strdup(parts[3]);
char *unknown = NULL;
if (ServiceExists(MS_LISTENINGTO_GETUNKNOWNTEXT))
- unknown = mir_utf8encodeT((TCHAR *)CallService(MS_LISTENINGTO_GETUNKNOWNTEXT, 0, 0));
+ unknown = mir_utf8encodeT((wchar_t *)CallService(MS_LISTENINGTO_GETUNKNOWNTEXT, 0, 0));
for (unsigned i = 4; i < pCount; i++) {
char part[16];
@@ -848,7 +848,7 @@ void CMsnProto::MSN_ProcessStatusMessage(ezxml_t xmli, const char* wlid)
if (pCount > 12) lti.ptszType = mir_utf8decodeT(parts[12]);
else lti.ptszType = mir_utf8decodeT(parts[1]);
- TCHAR *cm = (TCHAR *)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)L"%title% - %artist%", (LPARAM)&lti);
+ wchar_t *cm = (wchar_t *)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)L"%title% - %artist%", (LPARAM)&lti);
setTString(hContact, "ListeningTo", cm);
mir_free(cm);
@@ -898,7 +898,7 @@ void CMsnProto::MSN_ProcessNotificationMessage(char* buf, size_t len)
SkinPlaySound(alertsoundname);
- TCHAR* alrt = mir_utf8decodeT(ezxml_txt(xmltxt));
+ wchar_t* alrt = mir_utf8decodeT(ezxml_txt(xmltxt));
MSN_ShowPopup(TranslateT("MSN Alert"), alrt, MSN_ALERT_POPUP | MSN_ALLOW_MSGBOX, fullurl);
mir_free(alrt);
}
@@ -1469,15 +1469,15 @@ void CMsnProto::MSN_InviteMessage(ThreadData* info, char* msgBody, char* email,
ft->szInvcookie = mir_strdup(Invcookie);
ft->p2p_dest = mir_strdup(email);
- TCHAR tComment[40];
+ wchar_t tComment[40];
mir_sntprintf(tComment, TranslateT("%I64u bytes"), ft->std.currentFileSize);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
pre.fileCount = 1;
pre.timestamp = time(NULL);
- pre.descr.t = tComment;
- pre.files.t = &ft->std.tszCurrentFile;
+ pre.descr.w = tComment;
+ pre.files.w = &ft->std.tszCurrentFile;
pre.lParam = (LPARAM)ft;
ProtoChainRecvFile(ft->std.hContact, &pre);
return;
@@ -1536,7 +1536,7 @@ void CMsnProto::MSN_InviteMessage(ThreadData* info, char* msgBody, char* email,
// netmeeting receive 1
if (Appname != NULL && !_stricmp(Appname, "NetMeeting")) {
- TCHAR text[512], *tszEmail = mir_a2t(email);
+ wchar_t text[512], *tszEmail = mir_a2t(email);
mir_sntprintf(text, TranslateT("Accept NetMeeting request from %s?"), tszEmail);
mir_free(tszEmail);
@@ -1644,7 +1644,7 @@ void CMsnProto::MSN_CustomSmiley(const char* msgBody, char* email, char* nick, i
ptrA buf(mir_base64_encode((PBYTE)lastsml, (unsigned)slen));
ptrA smileyName(mir_urlEncode(buf));
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
MSN_GetCustomSmileyFileName(hContact, path, _countof(path), smileyName, iSmileyType);
ft->std.tszCurrentFile = mir_tstrdup(path);
diff --git a/protocols/MSN/src/msn_ftold.cpp b/protocols/MSN/src/msn_ftold.cpp
index 2a50f97480..a9f220575f 100644
--- a/protocols/MSN/src/msn_ftold.cpp
+++ b/protocols/MSN/src/msn_ftold.cpp
@@ -57,7 +57,7 @@ void CMsnProto::msnftp_invite(filetransfer *ft)
if (isOffline) return;
if (thread != NULL) thread->mMsnFtp = ft;
- TCHAR* pszFiles = _tcsrchr(ft->std.ptszFiles[0], '\\');
+ wchar_t* pszFiles = wcsrchr(ft->std.ptszFiles[0], '\\');
if (pszFiles)
pszFiles++;
else
diff --git a/protocols/MSN/src/msn_libstr.cpp b/protocols/MSN/src/msn_libstr.cpp
index 3ce9e5a841..9e0cd37318 100644
--- a/protocols/MSN/src/msn_libstr.cpp
+++ b/protocols/MSN/src/msn_libstr.cpp
@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-static TCHAR* a2tf(const TCHAR* str, bool unicode)
+static wchar_t* a2tf(const wchar_t* str, bool unicode)
{
if (str == NULL)
return NULL;
@@ -30,7 +30,7 @@ static TCHAR* a2tf(const TCHAR* str, bool unicode)
return unicode ? mir_tstrdup(str) : mir_a2t((char*)str);
}
-void overrideStr(TCHAR*& dest, const TCHAR* src, bool unicode, const TCHAR* def)
+void overrideStr(wchar_t*& dest, const wchar_t* src, bool unicode, const wchar_t* def)
{
mir_free(dest);
dest = NULL;
@@ -298,21 +298,21 @@ void stripHTML(char* str)
// Process a string, and double all % characters, according to chat.dll's restrictions
// Returns a pointer to the new string (old one is not freed)
-TCHAR* EscapeChatTags(const TCHAR* pszText)
+wchar_t* EscapeChatTags(const wchar_t* pszText)
{
int nChars = 0;
- for (const TCHAR* p = pszText; (p = _tcschr(p, '%')) != NULL; p++)
+ for (const wchar_t* p = pszText; (p = wcschr(p, '%')) != NULL; p++)
nChars++;
if (nChars == 0)
return mir_tstrdup(pszText);
- TCHAR *pszNewText = (TCHAR*)mir_alloc(sizeof(TCHAR)*(mir_tstrlen(pszText) + 1 + nChars));
+ wchar_t *pszNewText = (wchar_t*)mir_alloc(sizeof(wchar_t)*(mir_tstrlen(pszText) + 1 + nChars));
if (pszNewText == NULL)
return mir_tstrdup(pszText);
- const TCHAR *s = pszText;
- TCHAR *d = pszNewText;
+ const wchar_t *s = pszText;
+ wchar_t *d = pszNewText;
while (*s) {
if (*s == '%')
*d++ = '%';
@@ -322,9 +322,9 @@ TCHAR* EscapeChatTags(const TCHAR* pszText)
return pszNewText;
}
-TCHAR* UnEscapeChatTags(TCHAR* str_in)
+wchar_t* UnEscapeChatTags(wchar_t* str_in)
{
- TCHAR *s = str_in, *d = str_in;
+ wchar_t *s = str_in, *d = str_in;
while (*s) {
if ((*s == '%' && s[1] == '%') || (*s == '\n' && s[1] == '\n'))
s++;
diff --git a/protocols/MSN/src/msn_links.cpp b/protocols/MSN/src/msn_links.cpp
index d047b03213..a46e26e1a6 100644
--- a/protocols/MSN/src/msn_links.cpp
+++ b/protocols/MSN/src/msn_links.cpp
@@ -27,14 +27,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
static HANDLE hServiceParseLink;
-static MCONTACT GetContact(TCHAR *arg, TCHAR **pemail, CMsnProto *proto)
+static MCONTACT GetContact(wchar_t *arg, wchar_t **pemail, CMsnProto *proto)
{
- TCHAR* email = NULL;
+ wchar_t* email = NULL;
do {
- TCHAR *tok = _tcschr(arg, '&'); /* next token */
+ wchar_t *tok = wcschr(arg, '&'); /* next token */
if (tok != NULL) *tok++ = '\0';
- if (_tcsnicmp(arg, L"contact=", 8) == 0) {
+ if (wcsnicmp(arg, L"contact=", 8) == 0) {
arg += 8;
UrlDecode(arg);
email = arg;
@@ -62,15 +62,15 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam)
{
if (lParam == 0) return 1; /* sanity check */
- TCHAR *arg = (TCHAR*)lParam;
+ wchar_t *arg = (wchar_t*)lParam;
/* skip leading prefix */
- arg = _tcschr(arg, ':');
+ arg = wcschr(arg, ':');
if (arg == NULL) return 1; /* parse failed */
for (++arg; *arg == '/'; ++arg) {}
- arg = NEWTSTR_ALLOCA(arg);
+ arg = NEWWSTR_ALLOCA(arg);
if (g_Instances.getCount() == 0) return 0;
@@ -85,10 +85,10 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam)
/* add a contact to the list */
- if (_tcsnicmp(arg, L"add?", 4) == 0) {
+ if (wcsnicmp(arg, L"add?", 4) == 0) {
arg += 4;
- TCHAR *email;
+ wchar_t *email;
MCONTACT hContact = GetContact(arg, &email, proto);
if (email == NULL) return 1;
@@ -96,8 +96,8 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam)
if (hContact == NULL) {
PROTOSEARCHRESULT psr = { sizeof(psr) };
psr.flags = PSR_TCHAR;
- psr.nick.t = email;
- psr.email.t = email;
+ psr.nick.w = email;
+ psr.email.w = email;
ADDCONTACTSTRUCT acs = { 0 };
acs.handleType = HANDLE_SEARCHRESULT;
@@ -109,7 +109,7 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam)
}
/* send a message to a contact */
/* "voice" and "video" not yet implemented, perform same action as "chat" */
- else if (_tcsnicmp(arg, L"chat?", 5) == 0) {
+ else if (wcsnicmp(arg, L"chat?", 5) == 0) {
arg += 5;
MCONTACT hContact = GetContact(arg, NULL, proto);
@@ -119,7 +119,7 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam)
return 0;
}
}
- else if (_tcsnicmp(arg, L"voice?", 6) == 0) {
+ else if (wcsnicmp(arg, L"voice?", 6) == 0) {
arg += 6;
MCONTACT hContact = GetContact(arg, NULL, proto);
@@ -129,7 +129,7 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam)
return 0;
}
}
- else if (_tcsnicmp(arg, L"video?", 6) == 0) {
+ else if (wcsnicmp(arg, L"video?", 6) == 0) {
arg += 6;
MCONTACT hContact = GetContact(arg, NULL, proto);
diff --git a/protocols/MSN/src/msn_lists.cpp b/protocols/MSN/src/msn_lists.cpp
index be82a1b15e..28126efa5d 100644
--- a/protocols/MSN/src/msn_lists.cpp
+++ b/protocols/MSN/src/msn_lists.cpp
@@ -244,12 +244,12 @@ void CMsnProto::MSN_CleanupLists(void)
if (p.hContact && !(p.list & (LIST_LL | LIST_FL | LIST_PL)) && p.list != LIST_RL) {
int count = db_event_count(p.hContact);
if (count) {
- TCHAR text[256];
- TCHAR *sze = mir_a2t(p.email);
+ wchar_t text[256];
+ wchar_t *sze = mir_a2t(p.email);
mir_sntprintf(text, TranslateT("Contact %s has been removed from the server.\nWould you like to keep it as \"Local Only\" contact to preserve history?"), sze);
mir_free(sze);
- TCHAR title[128];
+ wchar_t title[128];
mir_sntprintf(title, TranslateT("%s protocol"), m_tszUserName);
if (MessageBox(NULL, text, title, MB_YESNO | MB_ICONQUESTION | MB_SETFOREGROUND) == IDYES) {
@@ -266,7 +266,7 @@ void CMsnProto::MSN_CleanupLists(void)
}
if (p.list & (LIST_LL | LIST_FL) && p.hContact) {
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
MSN_GetCustomSmileyFileName(p.hContact, path, _countof(path), "", 0);
if (path[0]) {
SMADD_CONT cont;
@@ -369,7 +369,7 @@ static void AddPrivacyListEntries(HWND hwndList, CMsnProto *proto)
for (int i = 0; i < proto->m_arContacts.getCount(); ++i) {
MsnContact &cont = proto->m_arContacts[i];
if (!(cont.list & (LIST_FL | LIST_LL))) {
- cii.pszText = (TCHAR*)cont.email;
+ cii.pszText = (wchar_t*)cont.email;
hItem = (HANDLE)SendMessage(hwndList, CLM_ADDINFOITEMA, 0, (LPARAM)&cii);
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(0, (cont.list & LIST_LL) ? 1 : 0));
@@ -461,7 +461,7 @@ static void SaveSettings(MCONTACT hItem, HWND hwndList, CMsnProto* proto)
continue;
}
else if (IsHContactInfo(hItem)) {
- TCHAR buf[MSN_MAX_EMAIL_LEN];
+ wchar_t buf[MSN_MAX_EMAIL_LEN];
SendMessage(hwndList, CLM_GETITEMTEXT, (WPARAM)hItem, (LPARAM)buf);
WideCharToMultiByte(CP_ACP, 0, buf, -1, szEmail, sizeof(szEmail), 0, 0);
diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp
index 364d437356..27cb629258 100644
--- a/protocols/MSN/src/msn_mail.cpp
+++ b/protocols/MSN/src/msn_mail.cpp
@@ -207,8 +207,8 @@ void CMsnProto::processMailData(char* mailData)
void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial)
{
- TCHAR tBuffer[512];
- TCHAR tBuffer2[512];
+ wchar_t tBuffer[512];
+ wchar_t tBuffer2[512];
int UnreadMessages = mUnreadMessages;
int UnreadJunkEmails = mUnreadJunkEmails;
bool ShowPopup = isInitial;
@@ -259,7 +259,7 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial)
- TCHAR* msgtxt = _stricmp(From, Fromaddr) ?
+ wchar_t* msgtxt = _stricmp(From, Fromaddr) ?
TranslateT("Hotmail from %s (%S)") : TranslateT("Hotmail from %s");
mir_sntprintf(tBuffer, msgtxt, mimeFromW, Fromaddr);
@@ -377,17 +377,17 @@ void CMsnProto::displayEmailCount(MCONTACT hContact)
{
if (!emailEnabled || getByte("DisableHotmailCL", 0)) return;
- TCHAR* name = GetContactNameT(hContact);
+ wchar_t* name = GetContactNameT(hContact);
if (name == NULL) return;
- TCHAR* ch = name - 1;
+ wchar_t* ch = name - 1;
do {
- ch = _tcschr(ch + 1, '[');
- } while (ch && !_istdigit(ch[1]));
+ ch = wcschr(ch + 1, '[');
+ } while (ch && !iswdigit(ch[1]));
if (ch) *ch = 0;
rtrimt(name);
- TCHAR szNick[128];
+ wchar_t szNick[128];
mir_sntprintf(szNick, getByte("DisableHotmailJunk", 0) ? L"%s [%d]" : L"%s [%d][%d]", name, mUnreadMessages, mUnreadJunkEmails);
nickChg = true;
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp
index 532242e257..ef12418621 100644
--- a/protocols/MSN/src/msn_menu.cpp
+++ b/protocols/MSN/src/msn_menu.cpp
@@ -119,10 +119,10 @@ int CMsnProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
int listId = Lists_GetMask(szEmail);
bool noChat = !(listId & LIST_FL) || isMe || isChatRoom(hContact);
- Menu_ModifyItem(hBlockMenuItem, (listId & LIST_BL) ? LPGENT("&Unblock") : LPGENT("&Block"));
+ Menu_ModifyItem(hBlockMenuItem, (listId & LIST_BL) ? LPGENW("&Unblock") : LPGENW("&Block"));
Menu_ShowItem(hBlockMenuItem, !noChat);
- Menu_ModifyItem(hOpenInboxMenuItem, isMe ? LPGENT("Open &Hotmail Inbox") : LPGENT("Send &Hotmail E-mail"));
+ Menu_ModifyItem(hOpenInboxMenuItem, isMe ? LPGENW("Open &Hotmail Inbox") : LPGENW("Send &Hotmail E-mail"));
Menu_ShowItem(hOpenInboxMenuItem, emailEnabled);
#ifdef OBSOLETE
@@ -210,7 +210,7 @@ static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam
{
CMsnProto *proto = (CMsnProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (proto->msnLoggedIn) {
- TCHAR str[130];
+ wchar_t str[130];
GetDlgItemText(hwndDlg, IDC_NICKNAME, str, _countof(str));
proto->MSN_SendNickname(str);
}
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp
index 6d5b581a89..3d76b63cde 100644
--- a/protocols/MSN/src/msn_misc.cpp
+++ b/protocols/MSN/src/msn_misc.cpp
@@ -117,7 +117,7 @@ void CMsnProto::InitCustomFolders(void)
{
if (InitCstFldRan) return;
- TCHAR folder[MAX_PATH];
+ wchar_t folder[MAX_PATH];
mir_sntprintf(folder, L"%%miranda_avatarcache%%\\%S", m_szModuleName);
hCustomSmileyFolder = FoldersRegisterCustomPathT(LPGEN("Custom Smileys"), m_szModuleName, folder, m_tszUserName);
@@ -168,11 +168,11 @@ char* MSN_GetAvatarHash(char* szContext, char** pszUrl)
}
// MSN_GetAvatarFileName - gets a file name for an contact's avatar
-void CMsnProto::MSN_GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext)
+void CMsnProto::MSN_GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen, const wchar_t *ext)
{
size_t tPathLen = mir_sntprintf(pszDest, cbLen, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
- if (_taccess(pszDest, 0))
+ if (_waccess(pszDest, 0))
CreateDirectoryTreeT(pszDest);
size_t tPathLen2 = tPathLen;
@@ -181,7 +181,7 @@ void CMsnProto::MSN_GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t
if (getString(hContact, "PictContext", &dbv) == 0) {
char* szAvatarHash = MSN_GetAvatarHash(dbv.pszVal);
if (szAvatarHash != NULL) {
- TCHAR *sztAvatarHash = mir_a2t(szAvatarHash);
+ wchar_t *sztAvatarHash = mir_a2t(szAvatarHash);
tPathLen += mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s.", sztAvatarHash);
mir_free(sztAvatarHash);
mir_free(szAvatarHash);
@@ -196,7 +196,7 @@ void CMsnProto::MSN_GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t
pszDest[0] = 0;
}
else {
- TCHAR *sztModuleName = mir_a2t(m_szModuleName);
+ wchar_t *sztModuleName = mir_a2t(m_szModuleName);
tPathLen += mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s avatar.", sztModuleName);
mir_free(sztModuleName);
}
@@ -205,15 +205,15 @@ void CMsnProto::MSN_GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t
mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, L"*");
bool found = false;
- _tfinddata_t c_file;
- long hFile = _tfindfirst(pszDest, &c_file);
+ _wfinddata_t c_file;
+ long hFile = _wfindfirst(pszDest, &c_file);
if (hFile > -1L) {
do {
- if (_tcsrchr(c_file.name, '.')) {
+ if (wcsrchr(c_file.name, '.')) {
mir_sntprintf(pszDest + tPathLen2, cbLen - tPathLen2, L"\\%s", c_file.name);
found = true;
}
- } while (_tfindnext(hFile, &c_file) == 0);
+ } while (_wfindnext(hFile, &c_file) == 0);
_findclose(hFile);
}
@@ -225,7 +225,7 @@ void CMsnProto::MSN_GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t
}
}
-int CMsnProto::MSN_SetMyAvatar(const TCHAR* sztFname, void* pData, size_t cbLen)
+int CMsnProto::MSN_SetMyAvatar(const wchar_t* sztFname, void* pData, size_t cbLen)
{
mir_sha1_ctx sha1ctx;
BYTE sha1c[MIR_SHA1_HASH_SIZE], sha1d[MIR_SHA1_HASH_SIZE];
@@ -278,18 +278,18 @@ int CMsnProto::MSN_SetMyAvatar(const TCHAR* sztFname, void* pData, size_t cbLen)
ptrA szEncodedBuffer(mir_urlEncode(szBuffer));
free(szBuffer);
- const TCHAR *szExt;
+ const wchar_t *szExt;
int fmt = ProtoGetBufferFormat(pData, &szExt);
if (fmt == PA_FORMAT_UNKNOWN)
return fmt;
- TCHAR szFileName[MAX_PATH];
+ wchar_t szFileName[MAX_PATH];
MSN_GetAvatarFileName(NULL, szFileName, _countof(szFileName), NULL);
- _tremove(szFileName);
+ _wremove(szFileName);
MSN_GetAvatarFileName(NULL, szFileName, _countof(szFileName), szExt);
- int fileId = _topen(szFileName, _O_CREAT | _O_TRUNC | _O_WRONLY | O_BINARY, _S_IREAD | _S_IWRITE);
+ int fileId = _wopen(szFileName, _O_CREAT | _O_TRUNC | _O_WRONLY | O_BINARY, _S_IREAD | _S_IWRITE);
if (fileId >= 0) {
_write(fileId, pData, (unsigned)cbLen);
_close(fileId);
@@ -310,16 +310,16 @@ int CMsnProto::MSN_SetMyAvatar(const TCHAR* sztFname, void* pData, size_t cbLen)
}
// MSN_GetCustomSmileyFileName - gets a file name for an contact's custom smiley
-void CMsnProto::MSN_GetCustomSmileyFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen, const char* SmileyName, int type)
+void CMsnProto::MSN_GetCustomSmileyFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen, const char* SmileyName, int type)
{
size_t tPathLen;
InitCustomFolders();
- TCHAR* path = (TCHAR*)alloca(cbLen * sizeof(TCHAR));
+ wchar_t* path = (wchar_t*)alloca(cbLen * sizeof(wchar_t));
if (hCustomSmileyFolder == NULL || FoldersGetCustomPathT(hCustomSmileyFolder, path, (int)cbLen, L"")) {
- TCHAR *tmpPath = Utils_ReplaceVarsT(L"%miranda_userdata%");
- TCHAR *tszModuleName = mir_a2t(m_szModuleName);
+ wchar_t *tmpPath = Utils_ReplaceVarsT(L"%miranda_userdata%");
+ wchar_t *tszModuleName = mir_a2t(m_szModuleName);
tPathLen = mir_sntprintf(pszDest, cbLen, L"%s\\%s\\CustomSmiley", tmpPath, tszModuleName);
mir_free(tszModuleName);
mir_free(tmpPath);
@@ -333,20 +333,20 @@ void CMsnProto::MSN_GetCustomSmileyFileName(MCONTACT hContact, TCHAR* pszDest, s
DBVARIANT dbv = { 0 };
if (getTString(hContact, "e-mail", &dbv)) {
dbv.type = DBVT_ASCIIZ;
- dbv.ptszVal = (TCHAR*)mir_alloc(11*sizeof(TCHAR));
- _ui64tot((UINT_PTR)hContact, dbv.ptszVal, 10);
+ dbv.ptszVal = (wchar_t*)mir_alloc(11*sizeof(wchar_t));
+ _ui64tow((UINT_PTR)hContact, dbv.ptszVal, 10);
}
tPathLen += mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s", dbv.ptszVal);
db_free(&dbv);
}
else {
- TCHAR *tszModuleName = mir_a2t(m_szModuleName);
+ wchar_t *tszModuleName = mir_a2t(m_szModuleName);
tPathLen += mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s", tszModuleName);
mir_free(tszModuleName);
}
- bool exist = _taccess(pszDest, 0) == 0;
+ bool exist = _waccess(pszDest, 0) == 0;
if (type == 0) {
if (!exist) pszDest[0] = 0;
@@ -356,7 +356,7 @@ void CMsnProto::MSN_GetCustomSmileyFileName(MCONTACT hContact, TCHAR* pszDest, s
if (!exist)
CreateDirectoryTreeT(pszDest);
- TCHAR *sztSmileyName = mir_a2t(SmileyName);
+ wchar_t *sztSmileyName = mir_a2t(SmileyName);
mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s.%s", sztSmileyName,
type == MSN_APPID_CUSTOMSMILEY ? L"png" : L"gif");
mir_free(sztSmileyName);
@@ -587,7 +587,7 @@ void CMsnProto::MSN_StartStopTyping(GCThreadData* info, bool start)
}
// Helper to process texts
-static char * HtmlEncodeUTF8T(const TCHAR *src)
+static char * HtmlEncodeUTF8T(const wchar_t *src)
{
if (src == NULL)
return mir_strdup("");
@@ -633,7 +633,7 @@ void CMsnProto::MSN_SendStatusMessage(const char*)
if (msnCurrentMedia.ptszPlayer != NULL) lti.ptszPlayer = L"{7}";
if (msnCurrentMedia.ptszType != NULL) lti.ptszType = L"{8}";
- TCHAR *tmp = (TCHAR *)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)L"%title% - %artist%", (LPARAM)&lti);
+ wchar_t *tmp = (wchar_t *)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)L"%title% - %artist%", (LPARAM)&lti);
szFormatEnc = HtmlEncodeUTF8T(tmp);
mir_free(tmp);
}
@@ -788,7 +788,7 @@ void CMsnProto::MSN_SetServerStatus(int newStatus)
if (!getStringUtf("Place", &dbv))
szPlace = dbv.pszVal;
else {
- TCHAR buf[128] = L"Miranda";
+ wchar_t buf[128] = L"Miranda";
DWORD buflen = _countof(buf);
GetComputerName(buf, &buflen);
szPlace = mir_utf8encodeT(buf);
@@ -915,10 +915,10 @@ void CMsnProto::MsnInvokeMyURL(bool ismail, const char* url)
// MSN_ShowError - shows an error
void CMsnProto::MSN_ShowError(const char* msgtext, ...)
{
- TCHAR tBuffer[4096];
+ wchar_t tBuffer[4096];
va_list tArgs;
- TCHAR *buf = Langpack_PcharToTchar(msgtext);
+ wchar_t *buf = Langpack_PcharToTchar(msgtext);
va_start(tArgs, msgtext);
mir_vsntprintf(tBuffer, _countof(tBuffer), buf, tArgs);
@@ -983,7 +983,7 @@ LRESULT CALLBACK NullWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
// InitPopups - popup plugin support
void CMsnProto::InitPopups(void)
{
- TCHAR desc[256];
+ wchar_t desc[256];
char name[256];
POPUPCLASS ppc = { sizeof(ppc) };
@@ -1025,7 +1025,7 @@ void CALLBACK sttMainThreadCallback(void *param)
bool iserr = (pud->flags & MSN_SHOW_ERROR) != 0;
if ((iserr && !pud->proto->MyOptions.ShowErrorsAsPopups) || !ServiceExists(MS_POPUP_ADDPOPUPCLASS)) {
if (pud->flags & MSN_ALLOW_MSGBOX) {
- TCHAR szMsg[MAX_SECONDLINE + MAX_CONTACTNAME];
+ wchar_t szMsg[MAX_SECONDLINE + MAX_CONTACTNAME];
mir_sntprintf(szMsg, L"%s:\n%s", pud->title, pud->text);
int ret = MessageBox(NULL, szMsg, TranslateT("MSN Protocol"),
MB_YESNO | (iserr ? MB_ICONERROR : MB_ICONINFORMATION));
@@ -1044,8 +1044,8 @@ void CALLBACK sttMainThreadCallback(void *param)
char name[256];
POPUPDATACLASS ppd = { sizeof(ppd) };
- ppd.ptszTitle = pud->title;
- ppd.ptszText = pud->text;
+ ppd.pwszTitle = pud->title;
+ ppd.pwszText = pud->text;
ppd.PluginData = pud;
ppd.pszClassName = name;
@@ -1059,7 +1059,7 @@ void CALLBACK sttMainThreadCallback(void *param)
CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&ppd);
}
-void CMsnProto::MSN_ShowPopup(const TCHAR* nickname, const TCHAR* msg, int flags, const char* url)
+void CMsnProto::MSN_ShowPopup(const wchar_t* nickname, const wchar_t* msg, int flags, const char* url)
{
if (g_bTerminated) return;
@@ -1074,7 +1074,7 @@ void CMsnProto::MSN_ShowPopup(const TCHAR* nickname, const TCHAR* msg, int flags
}
-void CMsnProto::MSN_ShowPopup(const MCONTACT hContact, const TCHAR* msg, int flags)
+void CMsnProto::MSN_ShowPopup(const MCONTACT hContact, const wchar_t* msg, int flags)
{
MSN_ShowPopup(GetContactNameT(hContact), msg, flags, NULL);
}
@@ -1152,7 +1152,7 @@ int filetransfer::create(void)
int flags = _O_BINARY | _O_CREAT | _O_WRONLY | _O_APPEND;
if (std.currentFileProgress == 0) flags |= _O_TRUNC;
- fileId = _topen(std.tszCurrentFile, flags, _S_IREAD | _S_IWRITE);
+ fileId = _wopen(std.tszCurrentFile, flags, _S_IREAD | _S_IWRITE);
if (fileId == -1)
proto->MSN_ShowError("Cannot create file '%s' during a file transfer", std.tszCurrentFile);
@@ -1172,7 +1172,7 @@ int filetransfer::openNext(void)
while (std.ptszFiles && std.ptszFiles[cf]) {
struct _stati64 statbuf;
- if (_tstati64(std.ptszFiles[cf], &statbuf) == 0 && (statbuf.st_mode & _S_IFDIR) == 0)
+ if (_wstat64(std.ptszFiles[cf], &statbuf) == 0 && (statbuf.st_mode & _S_IFDIR) == 0)
break;
++cf;
@@ -1181,7 +1181,7 @@ int filetransfer::openNext(void)
if (std.ptszFiles && std.ptszFiles[cf]) {
bCompleted = false;
replaceStrT(std.tszCurrentFile, std.ptszFiles[cf]);
- fileId = _topen(std.tszCurrentFile, _O_BINARY | _O_RDONLY, _S_IREAD);
+ fileId = _wopen(std.tszCurrentFile, _O_BINARY | _O_RDONLY, _S_IREAD);
if (fileId != -1) {
std.currentFileSize = _filelengthi64(fileId);
std.currentFileProgress = 0;
diff --git a/protocols/MSN/src/msn_natdetect.cpp b/protocols/MSN/src/msn_natdetect.cpp
index c8a01be35c..30ecdbc16f 100644
--- a/protocols/MSN/src/msn_natdetect.cpp
+++ b/protocols/MSN/src/msn_natdetect.cpp
@@ -311,7 +311,7 @@ static bool IsIcfEnabled(void)
hr = fwProfile->get_AuthorizedApplications(&fwApps);
if (FAILED(hr)) goto error;
- TCHAR szFileName[MAX_PATH];
+ wchar_t szFileName[MAX_PATH];
GetModuleFileName(NULL, szFileName, _countof(szFileName));
wszFileName = mir_t2u(szFileName);
diff --git a/protocols/MSN/src/msn_opts.cpp b/protocols/MSN/src/msn_opts.cpp
index 2adbe2c31f..96437c9bef 100644
--- a/protocols/MSN/src/msn_opts.cpp
+++ b/protocols/MSN/src/msn_opts.cpp
@@ -219,7 +219,7 @@ LBL_Continue:
case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY) {
bool reconnectRequired = false;
- TCHAR screenStr[MAX_PATH];
+ wchar_t screenStr[MAX_PATH];
char password[100], szEmail[MSN_MAX_EMAIL_LEN];
DBVARIANT dbv;
@@ -567,7 +567,7 @@ static INT_PTR CALLBACK DlgProcAccMgrUI(HWND hwndDlg, UINT msg, WPARAM wParam, L
}
else proto->setString("Password", password);
- TCHAR szPlace[64];
+ wchar_t szPlace[64];
GetDlgItemText(hwndDlg, IDC_PLACE, szPlace, _countof(szPlace));
if (szPlace[0])
proto->setTString("Place", szPlace);
@@ -627,25 +627,25 @@ int CMsnProto::OnOptionsInit(WPARAM wParam, LPARAM)
odp.position = -790000000;
odp.hInstance = g_hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MSN);
- odp.ptszTitle = m_tszUserName;
- odp.ptszGroup = LPGENT("Network");
- odp.ptszTab = LPGENT("Account");
+ odp.pwszTitle = m_tszUserName;
+ odp.pwszGroup = LPGENW("Network");
+ odp.pwszTab = LPGENW("Account");
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
odp.pfnDlgProc = DlgProcMsnOpts;
odp.dwInitParam = (LPARAM)this;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Connection");
+ odp.pwszTab = LPGENW("Connection");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MSN_CONN);
odp.pfnDlgProc = DlgProcMsnConnOpts;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Server list");
+ odp.pwszTab = LPGENW("Server list");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_LISTSMGR);
odp.pfnDlgProc = DlgProcMsnServLists;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Notifications");
+ odp.pwszTab = LPGENW("Notifications");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_NOTIFY);
odp.pfnDlgProc = DlgProcHotmailPopupOpts;
Options_AddPage(wParam, &odp);
diff --git a/protocols/MSN/src/msn_p2p.cpp b/protocols/MSN/src/msn_p2p.cpp
index b130ad25aa..632aede4bc 100644
--- a/protocols/MSN/src/msn_p2p.cpp
+++ b/protocols/MSN/src/msn_p2p.cpp
@@ -161,7 +161,7 @@ bool p2p_IsDlFileOk(filetransfer* ft)
bool res = false;
- int fileId = _topen(ft->std.tszCurrentFile, O_RDONLY | _O_BINARY, _S_IREAD);
+ int fileId = _wopen(ft->std.tszCurrentFile, O_RDONLY | _O_BINARY, _S_IREAD);
if (fileId != -1) {
BYTE buf[4096];
int bytes;
@@ -201,7 +201,7 @@ void CMsnProto::p2p_pictureTransferFailed(filetransfer* ft)
}
break;
}
- _tremove(ft->std.tszCurrentFile);
+ _wremove(ft->std.tszCurrentFile);
}
void CMsnProto::p2p_savePicture2disk(filetransfer* ft)
@@ -209,13 +209,13 @@ void CMsnProto::p2p_savePicture2disk(filetransfer* ft)
ft->close();
if (p2p_IsDlFileOk(ft)) {
- int fileId = _topen(ft->std.tszCurrentFile, O_RDONLY | _O_BINARY, _S_IREAD);
+ int fileId = _wopen(ft->std.tszCurrentFile, O_RDONLY | _O_BINARY, _S_IREAD);
if (fileId == -1) {
p2p_pictureTransferFailed(ft);
return;
}
- const TCHAR* ext;
+ const wchar_t* ext;
int format;
BYTE buf[6];
@@ -237,7 +237,7 @@ void CMsnProto::p2p_savePicture2disk(filetransfer* ft)
ai.hContact = ft->std.hContact;
MSN_GetAvatarFileName(ai.hContact, ai.filename, _countof(ai.filename), ext);
- _trename(ft->std.tszCurrentFile, ai.filename);
+ _wrename(ft->std.tszCurrentFile, ai.filename);
// Store also avatar hash
char *szAvatarHash = MSN_GetAvatarHash(ft->p2p_object);
@@ -259,9 +259,9 @@ void CMsnProto::p2p_savePicture2disk(filetransfer* ft)
cont.hContact = ft->std.hContact;
cont.type = 1;
- TCHAR* pathcpy = mir_tstrdup(ft->std.tszCurrentFile);
- mir_tstrcpy(_tcsrchr(pathcpy, '.') + 1, ext);
- _trename(ft->std.tszCurrentFile, pathcpy);
+ wchar_t* pathcpy = mir_tstrdup(ft->std.tszCurrentFile);
+ mir_tstrcpy(wcsrchr(pathcpy, '.') + 1, ext);
+ _wrename(ft->std.tszCurrentFile, pathcpy);
cont.path = pathcpy;
@@ -1173,9 +1173,9 @@ void CMsnProto::p2p_InitFileTransfer(
db_free(&dbv);
}
if (pictmatch) {
- TCHAR szFileName[MAX_PATH];
+ wchar_t szFileName[MAX_PATH];
MSN_GetAvatarFileName(NULL, szFileName, _countof(szFileName), NULL);
- ft->fileId = _topen(szFileName, O_RDONLY | _O_BINARY, _S_IREAD);
+ ft->fileId = _wopen(szFileName, O_RDONLY | _O_BINARY, _S_IREAD);
if (ft->fileId == -1) {
p2p_sendStatus(ft, 603);
MSN_ShowError("Your avatar not set correctly. Avatar should be set in View/Change My Details | Avatar");
@@ -1223,15 +1223,15 @@ void CMsnProto::p2p_InitFileTransfer(
ft->std.totalBytes = ft->std.currentFileSize = ((HFileContext*)szContext)->dwSize;
ft->std.totalFiles = 1;
- TCHAR tComment[40];
+ wchar_t tComment[40];
mir_sntprintf(tComment, TranslateT("%I64u bytes"), ft->std.currentFileSize);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
pre.fileCount = 1;
pre.timestamp = time(NULL);
- pre.descr.t = tComment;
- pre.files.t = &ft->std.tszCurrentFile;
+ pre.descr.w = tComment;
+ pre.files.w = &ft->std.tszCurrentFile;
pre.lParam = (LPARAM)ft;
ProtoChainRecvFile(ft->std.hContact, &pre);
}
@@ -1698,7 +1698,7 @@ void CMsnProto::p2p_processSIP(ThreadData* info, char* msgbody, P2PB_Header* hdr
break;
ft->close();
- if (!(ft->std.flags & PFTS_SENDING)) _tremove(ft->std.tszCurrentFile);
+ if (!(ft->std.flags & PFTS_SENDING)) _wremove(ft->std.tszCurrentFile);
p2p_unregisterSession(ft);
}
@@ -2024,7 +2024,7 @@ void CMsnProto::p2p_invite(unsigned iAppID, filetransfer* ft, const char *wlid)
ctx->type = MSN_TYPEID_FTNOPREVIEW;
ctx->dwSize = ft->std.currentFileSize;
- TCHAR* pszFiles = _tcsrchr(ft->std.tszCurrentFile, '\\');
+ wchar_t* pszFiles = wcsrchr(ft->std.tszCurrentFile, '\\');
if (pszFiles)
pszFiles++;
else
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp
index d7258e5533..624c736f97 100644
--- a/protocols/MSN/src/msn_proto.cpp
+++ b/protocols/MSN/src/msn_proto.cpp
@@ -33,7 +33,7 @@ static int CompareLists(const MsnContact *p1, const MsnContact *p2)
return _stricmp(p1->email, p2->email);
}
-CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) :
+CMsnProto::CMsnProto(const char* aProtoName, const wchar_t* aUserName) :
PROTO<CMsnProto>(aProtoName, aUserName),
m_arContacts(10, CompareLists),
m_arGroups(10, CompareId),
@@ -125,16 +125,16 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) :
mailsoundname = (char*)mir_alloc(64);
mir_snprintf(mailsoundname, 64, "%s:Hotmail", m_szModuleName);
- SkinAddNewSoundExT(mailsoundname, m_tszUserName, LPGENT("Live Mail"));
+ SkinAddNewSoundExT(mailsoundname, m_tszUserName, LPGENW("Live Mail"));
alertsoundname = (char*)mir_alloc(64);
mir_snprintf(alertsoundname, 64, "%s:Alerts", m_szModuleName);
- SkinAddNewSoundExT(alertsoundname, m_tszUserName, LPGENT("Live Alert"));
+ SkinAddNewSoundExT(alertsoundname, m_tszUserName, LPGENW("Live Alert"));
AvatarQueue_Init();
InitCustomFolders();
- TCHAR szBuffer[MAX_PATH];
+ wchar_t szBuffer[MAX_PATH];
char szDbsettings[64];
NETLIBUSER nlu1 = { 0 };
@@ -261,10 +261,10 @@ MCONTACT CMsnProto::AddToListByEmail(const char *email, const char *nick, DWORD
MCONTACT __cdecl CMsnProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
{
- TCHAR *id = psr->id.t ? psr->id.t : psr->email.t;
+ wchar_t *id = psr->id.w ? psr->id.w : psr->email.w;
return AddToListByEmail(
psr->flags & PSR_UNICODE ? UTF8((wchar_t*)id) : UTF8((char*)id),
- psr->flags & PSR_UNICODE ? UTF8((wchar_t*)psr->nick.t) : UTF8((char*)psr->nick.t),
+ psr->flags & PSR_UNICODE ? UTF8((wchar_t*)psr->nick.w) : UTF8((char*)psr->nick.w),
flags);
}
@@ -294,7 +294,7 @@ int CMsnProto::AuthRecv(MCONTACT, PROTORECVEVENT* pre)
}
// PSS_AUTHREQUEST
-int __cdecl CMsnProto::AuthRequest(MCONTACT hContact, const TCHAR* szMessage)
+int __cdecl CMsnProto::AuthRequest(MCONTACT hContact, const wchar_t* szMessage)
{
if (msnLoggedIn) {
char email[MSN_MAX_EMAIL_LEN];
@@ -353,7 +353,7 @@ int CMsnProto::Authorize(MEVENT hDbEvent)
}
// MsnAuthDeny - called after unsuccessful authorization
-int CMsnProto::AuthDeny(MEVENT hDbEvent, const TCHAR*)
+int CMsnProto::AuthDeny(MEVENT hDbEvent, const wchar_t*)
{
if (!msnLoggedIn)
return 1;
@@ -397,7 +397,7 @@ int CMsnProto::AuthDeny(MEVENT hDbEvent, const TCHAR*)
// MsnBasicSearch - search contacts by e-mail
void __cdecl CMsnProto::MsnSearchAckThread(void* arg)
{
- const TCHAR* emailT = (TCHAR*)arg;
+ const wchar_t* emailT = (wchar_t*)arg;
T2Utf email(emailT);
if (Lists_IsInList(LIST_FL, email)) {
@@ -418,9 +418,9 @@ void __cdecl CMsnProto::MsnSearchAckThread(void* arg)
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
psr.flags = PSR_TCHAR;
- psr.id.t = (TCHAR*)emailT;
- psr.nick.t = (TCHAR*)emailT;
- psr.email.t = (TCHAR*)emailT;
+ psr.id.w = (wchar_t*)emailT;
+ psr.nick.w = (wchar_t*)emailT;
+ psr.email.w = (wchar_t*)emailT;
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, arg, (LPARAM)&psr);
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, arg, 0);
@@ -447,17 +447,17 @@ void __cdecl CMsnProto::MsnSearchAckThread(void* arg)
}
-HANDLE __cdecl CMsnProto::SearchBasic(const TCHAR* id)
+HANDLE __cdecl CMsnProto::SearchBasic(const wchar_t* id)
{
if (!msnLoggedIn) return 0;
- TCHAR* email = mir_tstrdup(id);
+ wchar_t* email = mir_tstrdup(id);
ForkThread(&CMsnProto::MsnSearchAckThread, email);
return email;
}
-HANDLE __cdecl CMsnProto::SearchByEmail(const TCHAR* email)
+HANDLE __cdecl CMsnProto::SearchByEmail(const wchar_t* email)
{
return SearchBasic(email);
}
@@ -491,7 +491,7 @@ void __cdecl CMsnProto::MsnFileAckThread(void* arg)
{
filetransfer* ft = (filetransfer*)arg;
- TCHAR filefull[MAX_PATH];
+ wchar_t filefull[MAX_PATH];
mir_sntprintf(filefull, L"%s\\%s", ft->std.tszWorkingDir, ft->std.tszCurrentFile);
replaceStrT(ft->std.tszCurrentFile, filefull);
@@ -574,7 +574,7 @@ void __cdecl CMsnProto::MsnFileAckThread(void* arg)
}
// MsnFileAllow - starts the file transfer
-HANDLE __cdecl CMsnProto::FileAllow(MCONTACT, HANDLE hTransfer, const TCHAR* szPath)
+HANDLE __cdecl CMsnProto::FileAllow(MCONTACT, HANDLE hTransfer, const wchar_t* szPath)
{
filetransfer* ft = (filetransfer*)hTransfer;
@@ -584,7 +584,7 @@ HANDLE __cdecl CMsnProto::FileAllow(MCONTACT, HANDLE hTransfer, const TCHAR* szP
#endif
if ((ft->std.tszWorkingDir = mir_tstrdup(szPath)) == NULL) {
- TCHAR szCurrDir[MAX_PATH];
+ wchar_t szCurrDir[MAX_PATH];
GetCurrentDirectory(_countof(szCurrDir), szCurrDir);
ft->std.tszWorkingDir = mir_tstrdup(szCurrDir);
}
@@ -633,7 +633,7 @@ int __cdecl CMsnProto::FileCancel(MCONTACT, HANDLE hTransfer)
}
// MsnFileDeny - rejects the file transfer request
-int __cdecl CMsnProto::FileDeny(MCONTACT, HANDLE hTransfer, const TCHAR* /*szReason*/)
+int __cdecl CMsnProto::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t* /*szReason*/)
{
filetransfer* ft = (filetransfer*)hTransfer;
@@ -661,7 +661,7 @@ int __cdecl CMsnProto::FileDeny(MCONTACT, HANDLE hTransfer, const TCHAR* /*szRea
}
// MsnFileResume - renames a file
-int __cdecl CMsnProto::FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename)
+int __cdecl CMsnProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename)
{
filetransfer* ft = (filetransfer*)hTransfer;
@@ -680,7 +680,7 @@ int __cdecl CMsnProto::FileResume(HANDLE hTransfer, int* action, const TCHAR** s
case FILERESUME_RESUME:
{
struct _stati64 statbuf;
- _tstati64(ft->std.tszCurrentFile, &statbuf);
+ _wstat64(ft->std.tszCurrentFile, &statbuf);
ft->std.currentFileProgress = statbuf.st_size;
}
break;
@@ -829,12 +829,12 @@ int CMsnProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre)
int i;
for (i = 0; i < pre->lParam; i++)
- dbei.cbBlob += int(mir_tstrlen(isrList[i]->nick.t) + 2 + mir_tstrlen(isrList[i]->id.t));
+ dbei.cbBlob += int(mir_tstrlen(isrList[i]->nick.w) + 2 + mir_tstrlen(isrList[i]->id.w));
dbei.pBlob = (PBYTE)_alloca(dbei.cbBlob);
for (i = 0, pCurBlob = dbei.pBlob; i < pre->lParam; i++) {
- mir_strcpy((char*)pCurBlob, _T2A(isrList[i]->nick.t));
+ mir_strcpy((char*)pCurBlob, _T2A(isrList[i]->nick.w));
pCurBlob += mir_strlen((char*)pCurBlob) + 1;
- mir_strcpy((char*)pCurBlob, _T2A(isrList[i]->id.t));
+ mir_strcpy((char*)pCurBlob, _T2A(isrList[i]->id.w));
pCurBlob += mir_strlen((char*)pCurBlob) + 1;
}
@@ -849,7 +849,7 @@ int CMsnProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre)
#ifdef OBSOLETE
// MsnSendFile - initiates a file transfer
-HANDLE __cdecl CMsnProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR** ppszFiles)
+HANDLE __cdecl CMsnProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t** ppszFiles)
{
if (!msnLoggedIn)
return 0;
@@ -871,7 +871,7 @@ HANDLE __cdecl CMsnProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR** ppsz
int count = 0;
while (ppszFiles[count] != NULL) {
struct _stati64 statbuf;
- if (_tstati64(ppszFiles[count++], &statbuf) == 0 && (statbuf.st_mode & _S_IFDIR) == 0) {
+ if (_wstat64(ppszFiles[count++], &statbuf) == 0 && (statbuf.st_mode & _S_IFDIR) == 0) {
sft->std.totalBytes += statbuf.st_size;
++sft->std.totalFiles;
}
@@ -1046,7 +1046,7 @@ int __cdecl CMsnProto::SendContacts(MCONTACT hContact, int, int nContacts, MCONT
}
// MsnSetAwayMsg - sets the current status message for a user
-int __cdecl CMsnProto::SetAwayMsg(int status, const TCHAR* msg)
+int __cdecl CMsnProto::SetAwayMsg(int status, const wchar_t* msg)
{
char** msgptr = GetStatusMsgLoc(status);
diff --git a/protocols/MSN/src/msn_proto.h b/protocols/MSN/src/msn_proto.h
index 2ea0df8129..6f26bf1c80 100644
--- a/protocols/MSN/src/msn_proto.h
+++ b/protocols/MSN/src/msn_proto.h
@@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
struct CMsnProto : public PROTO<CMsnProto>
{
- CMsnProto(const char*, const TCHAR*);
+ CMsnProto(const char*, const wchar_t*);
~CMsnProto();
//====================================================================================
@@ -36,26 +36,26 @@ struct CMsnProto : public PROTO<CMsnProto>
virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent);
virtual int __cdecl Authorize(MEVENT hDbEvent);
- virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR* szReason);
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t* szReason);
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage);
+ virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t* szMessage);
- virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath);
+ virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath);
virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason);
- virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename);
+ virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason);
+ virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename);
virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
virtual int __cdecl GetInfo(MCONTACT hContact, int infoType);
- virtual HANDLE __cdecl SearchBasic(const TCHAR* id);
- virtual HANDLE __cdecl SearchByEmail(const TCHAR* email);
+ virtual HANDLE __cdecl SearchBasic(const wchar_t* id);
+ virtual HANDLE __cdecl SearchByEmail(const wchar_t* email);
virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*);
virtual int __cdecl RecvContacts(MCONTACT hContact, PROTORECVEVENT*);
#ifdef OBSOLETE
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles);
+ virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles);
#endif
virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg);
virtual int __cdecl SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList);
@@ -64,7 +64,7 @@ struct CMsnProto : public PROTO<CMsnProto>
virtual int __cdecl SetStatus(int iNewStatus);
virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
- virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR* msg);
+ virtual int __cdecl SetAwayMsg(int m_iStatus, const wchar_t* msg);
virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
@@ -196,10 +196,10 @@ struct CMsnProto : public PROTO<CMsnProto>
void InitCustomFolders(void);
char* getSslResult(char** parUrl, const char* parAuthInfo, const char* hdrs, unsigned& status);
- bool getMyAvatarFile(char *url, TCHAR *fname);
+ bool getMyAvatarFile(char *url, wchar_t *fname);
void MSN_GoOffline(void);
- void MSN_GetCustomSmileyFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen, const char* SmileyName, int Type);
+ void MSN_GetCustomSmileyFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen, const char* SmileyName, int Type);
const char* MirandaStatusToMSN(int status);
WORD MSNStatusToMiranda(const char *status);
@@ -233,8 +233,8 @@ struct CMsnProto : public PROTO<CMsnProto>
void LoadOptions(void);
void InitPopups(void);
- void MSN_ShowPopup(const TCHAR* nickname, const TCHAR* msg, int flags, const char* url);
- void MSN_ShowPopup(const MCONTACT hContact, const TCHAR* msg, int flags);
+ void MSN_ShowPopup(const wchar_t* nickname, const wchar_t* msg, int flags, const char* url);
+ void MSN_ShowPopup(const MCONTACT hContact, const wchar_t* msg, int flags);
void MSN_ShowError(const char* msgtext, ...);
#ifdef OBSOLETE
@@ -242,7 +242,7 @@ struct CMsnProto : public PROTO<CMsnProto>
#endif
void MSN_SendNicknameUtf(const char* nickname);
- typedef struct { TCHAR *szName; const char *szMimeType; unsigned char *data; size_t dataSize; } StoreAvatarData;
+ typedef struct { wchar_t *szName; const char *szMimeType; unsigned char *data; size_t dataSize; } StoreAvatarData;
void __cdecl msn_storeAvatarThread(void* arg);
void __cdecl msn_storeProfileThread(void*);
@@ -305,7 +305,7 @@ struct CMsnProto : public PROTO<CMsnProto>
int MSN_GetActiveThreads(ThreadData**);
ThreadData* MSN_GetThreadByConnection(HANDLE hConn);
ThreadData* MSN_GetThreadByContact(const char* wlid, TInfoType type = SERVER_SWITCHBOARD);
- GCThreadData*MSN_GetThreadByChatId(const TCHAR* chatId);
+ GCThreadData*MSN_GetThreadByChatId(const wchar_t* chatId);
ThreadData* MSN_GetP2PThreadByContact(const char *wlid);
void MSN_StartP2PTransferByContact(const char* wlid);
ThreadData* MSN_GetThreadByPort(WORD wPort);
@@ -423,12 +423,12 @@ struct CMsnProto : public PROTO<CMsnProto>
int MSN_ChatInit(GCThreadData *info, const char *pszID, const char *pszTopic);
void MSN_ChatStart(ezxml_t xmli);
- void MSN_KillChatSession(const TCHAR* id);
+ void MSN_KillChatSession(const wchar_t* id);
void MSN_Kickuser(GCHOOK *gch);
void MSN_Promoteuser(GCHOOK *gch, const char *pszRole);
- const TCHAR *MSN_GCGetRole(GCThreadData* thread, const char *pszWLID);
- void MSN_GCProcessThreadActivity(ezxml_t xmli, const TCHAR *mChatID);
- void MSN_GCAddMessage(TCHAR *mChatID, MCONTACT hContact, char *email, time_t ts, bool sentMsg, char *msgBody);
+ const wchar_t *MSN_GCGetRole(GCThreadData* thread, const char *pszWLID);
+ void MSN_GCProcessThreadActivity(ezxml_t xmli, const wchar_t *mChatID);
+ void MSN_GCAddMessage(wchar_t *mChatID, MCONTACT hContact, char *email, time_t ts, bool sentMsg, char *msgBody);
void MSN_GCRefreshThreadsInfo(void);
MCONTACT MSN_GetChatInernalHandle(MCONTACT hContact);
@@ -516,8 +516,8 @@ struct CMsnProto : public PROTO<CMsnProto>
void AvatarQueue_Init(void);
void AvatarQueue_Uninit(void);
- void MSN_GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext);
- int MSN_SetMyAvatar(const TCHAR* szFname, void* pData, size_t cbLen);
+ void MSN_GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen, const wchar_t *ext);
+ int MSN_SetMyAvatar(const wchar_t* szFname, void* pData, size_t cbLen);
void __cdecl MSN_AvatarsThread(void*);
@@ -590,8 +590,8 @@ struct CMsnProto : public PROTO<CMsnProto>
bool MSN_StoreShareItem(const char* id, bool allowRecurse = true);
bool MSN_StoreCreateRelationships(bool allowRecurse = true);
bool MSN_StoreDeleteRelationships(bool tile, bool allowRecurse = true);
- bool MSN_StoreCreateDocument(const TCHAR *sztName, const char *szMimeType, const char *szPicData, bool allowRecurse = true);
- bool MSN_StoreUpdateDocument(const TCHAR *sztName, const char *szMimeType, const char *szPicData, bool allowRecurse = true);
+ bool MSN_StoreCreateDocument(const wchar_t *sztName, const char *szMimeType, const char *szPicData, bool allowRecurse = true);
+ bool MSN_StoreUpdateDocument(const wchar_t *sztName, const char *szMimeType, const char *szPicData, bool allowRecurse = true);
bool MSN_StoreFindDocuments(bool allowRecurse = true);
ezxml_t storeSoapHdr(const char* service, const char* scenario, ezxml_t& tbdy, char*& httphdr);
@@ -605,8 +605,8 @@ struct CMsnProto : public PROTO<CMsnProto>
//////////////////////////////////////////////////////////////////////////////////////
- TCHAR *m_DisplayNameCache;
- TCHAR* GetContactNameT(MCONTACT hContact);
+ wchar_t *m_DisplayNameCache;
+ wchar_t* GetContactNameT(MCONTACT hContact);
int getStringUtf(MCONTACT hContact, const char* name, DBVARIANT* result);
int getStringUtf(const char* name, DBVARIANT* result);
diff --git a/protocols/MSN/src/msn_skypeab.cpp b/protocols/MSN/src/msn_skypeab.cpp
index d2b1b52444..034b75f52e 100644
--- a/protocols/MSN/src/msn_skypeab.cpp
+++ b/protocols/MSN/src/msn_skypeab.cpp
@@ -41,10 +41,10 @@ bool CMsnProto::APISkypeComRequest(NETLIBHTTPREQUEST *nlhr, NETLIBHTTPHEADER *he
return true;
}
-static TCHAR* get_json_str(JSONNode *item, const char *pszValue)
+static wchar_t* get_json_str(JSONNode *item, const char *pszValue)
{
if (JSONNode *node = json_get(item, pszValue)) {
- TCHAR *ret = json_as_string(node);
+ wchar_t *ret = json_as_string(node);
if (!mir_tstrcmp(ret, L"null")) {
mir_free(ret);
return NULL;
@@ -194,10 +194,10 @@ bool CMsnProto::MSN_SKYABGetProfile(const char *wlid)
if (value = get_json_str(item, "firstname")) setTString(hContact, "FirstName", value);
if (value = get_json_str(item, "lastname")) setTString(hContact, "LastName", value);
if (value = get_json_str(item, "displayname")) setTString(hContact, "Nick", value);
- if (value = get_json_str(item, "gender")) setByte(hContact, "Gender", (BYTE)(_ttoi(value) == 1 ? 'M' : 'F'));
+ if (value = get_json_str(item, "gender")) setByte(hContact, "Gender", (BYTE)(_wtoi(value) == 1 ? 'M' : 'F'));
if (value = get_json_str(item, "birthday")) {
int d, m, y;
- _stscanf(value, L"%d-%d-%d", &y, &m, &d);
+ swscanf(value, L"%d-%d-%d", &y, &m, &d);
setWord(hContact, "BirthYear", y);
setByte(hContact, "BirthDay", d);
setByte(hContact, "BirthMonth", m);
@@ -387,13 +387,13 @@ bool CMsnProto::MSN_SKYABSearch(const char *keyWord, HANDLE hSearch)
JSONNode *ContactCards = json_get(item, "ContactCards");
JSONNode *Skype = json_get(ContactCards, "Skype");
- TCHAR *sDisplayName = json_as_string(json_get(Skype, "DisplayName"));
- TCHAR *sSkypeName = json_as_string(json_get(Skype, "SkypeName"));
+ wchar_t *sDisplayName = json_as_string(json_get(Skype, "DisplayName"));
+ wchar_t *sSkypeName = json_as_string(json_get(Skype, "SkypeName"));
PROTOSEARCHRESULT psr = { sizeof(psr) };
psr.flags = PSR_TCHAR;
- psr.id.t = sSkypeName;
- psr.nick.t = sDisplayName;
+ psr.id.w = sSkypeName;
+ psr.nick.w = sDisplayName;
ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_DATA, hSearch, (LPARAM)&psr);
}
json_free(items);
diff --git a/protocols/MSN/src/msn_soapstore.cpp b/protocols/MSN/src/msn_soapstore.cpp
index 09c8844223..4dafb1f4ef 100644
--- a/protocols/MSN/src/msn_soapstore.cpp
+++ b/protocols/MSN/src/msn_soapstore.cpp
@@ -504,7 +504,7 @@ bool CMsnProto::MSN_StoreDeleteRelationships(bool tile, bool allowRecurse)
}
-bool CMsnProto::MSN_StoreCreateDocument(const TCHAR *sztName, const char *szMimeType, const char *szPicData, bool allowRecurse)
+bool CMsnProto::MSN_StoreCreateDocument(const wchar_t *sztName, const char *szMimeType, const char *szPicData, bool allowRecurse)
{
char* reqHdr;
ezxml_t tbdy;
@@ -586,7 +586,7 @@ bool CMsnProto::MSN_StoreCreateDocument(const TCHAR *sztName, const char *szMime
}
-bool CMsnProto::MSN_StoreUpdateDocument(const TCHAR *sztName, const char *szMimeType, const char *szPicData, bool allowRecurse)
+bool CMsnProto::MSN_StoreUpdateDocument(const wchar_t *sztName, const char *szMimeType, const char *szPicData, bool allowRecurse)
{
char* reqHdr;
T2Utf szName(sztName);
diff --git a/protocols/MSN/src/msn_ssl.cpp b/protocols/MSN/src/msn_ssl.cpp
index 76a0b6390c..8420e7e501 100644
--- a/protocols/MSN/src/msn_ssl.cpp
+++ b/protocols/MSN/src/msn_ssl.cpp
@@ -103,7 +103,7 @@ char* CMsnProto::getSslResult(char** parUrl, const char* parAuthInfo, const char
return result;
}
-bool CMsnProto::getMyAvatarFile(char *url, TCHAR *fname)
+bool CMsnProto::getMyAvatarFile(char *url, wchar_t *fname)
{
NETLIBHTTPREQUEST nlhr = { 0 };
bool result = true;
diff --git a/protocols/MSN/src/msn_std.cpp b/protocols/MSN/src/msn_std.cpp
index 1edd062c00..29bbda9faf 100644
--- a/protocols/MSN/src/msn_std.cpp
+++ b/protocols/MSN/src/msn_std.cpp
@@ -43,12 +43,12 @@ void CMsnProto::setStringUtf(MCONTACT hContact, const char* name, const char* va
/////////////////////////////////////////////////////////////////////////////////////////
-TCHAR* CMsnProto::GetContactNameT(MCONTACT hContact)
+wchar_t* CMsnProto::GetContactNameT(MCONTACT hContact)
{
if (hContact)
- return (TCHAR*)pcli->pfnGetContactDisplayName(WPARAM(hContact), 0);
+ return (wchar_t*)pcli->pfnGetContactDisplayName(WPARAM(hContact), 0);
- TCHAR *str = Contact_GetInfo(CNF_DISPLAY, NULL, m_szModuleName);
+ wchar_t *str = Contact_GetInfo(CNF_DISPLAY, NULL, m_szModuleName);
if (str != NULL) {
mir_free(m_DisplayNameCache);
return m_DisplayNameCache = str;
diff --git a/protocols/MSN/src/msn_svcs.cpp b/protocols/MSN/src/msn_svcs.cpp
index 0a9e5b5b0b..a0cc11efe2 100644
--- a/protocols/MSN/src/msn_svcs.cpp
+++ b/protocols/MSN/src/msn_svcs.cpp
@@ -41,14 +41,14 @@ INT_PTR CMsnProto::GetMyAwayMsg(WPARAM wParam, LPARAM lParam)
INT_PTR CMsnProto::GetAvatar(WPARAM wParam, LPARAM lParam)
{
- TCHAR* buf = (TCHAR*)wParam;
+ wchar_t* buf = (wchar_t*)wParam;
int size = (int)lParam;
if (buf == NULL || size <= 0)
return -1;
MSN_GetAvatarFileName(NULL, buf, size, NULL);
- return _taccess(buf, 0);
+ return _waccess(buf, 0);
}
@@ -64,7 +64,7 @@ void CMsnProto::sttFakeAvatarAck(void* arg)
INT_PTR CMsnProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
{
PROTO_AVATAR_INFORMATION *pai = (PROTO_AVATAR_INFORMATION*)lParam;
- TCHAR filename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
MsnContact *cont = NULL;
if (pai->hContact) {
@@ -185,11 +185,11 @@ INT_PTR CMsnProto::GetAvatarCaps(WPARAM wParam, LPARAM lParam)
INT_PTR CMsnProto::SetAvatar(WPARAM, LPARAM lParam)
{
- TCHAR* szFileName = (TCHAR*)lParam;
+ wchar_t* szFileName = (wchar_t*)lParam;
- TCHAR tFileName[MAX_PATH];
+ wchar_t tFileName[MAX_PATH];
MSN_GetAvatarFileName(NULL, tFileName, _countof(tFileName), NULL);
- _tremove(tFileName);
+ _wremove(tFileName);
if (szFileName == NULL) {
delSetting("PictObject");
@@ -197,7 +197,7 @@ INT_PTR CMsnProto::SetAvatar(WPARAM, LPARAM lParam)
ForkThread(&CMsnProto::msn_storeAvatarThread, NULL);
}
else {
- int fileId = _topen(szFileName, _O_RDONLY | _O_BINARY, _S_IREAD);
+ int fileId = _wopen(szFileName, _O_RDONLY | _O_BINARY, _S_IREAD);
if (fileId < 0) return 1;
size_t dwPngSize = _filelengthi64(fileId);
@@ -210,8 +210,8 @@ INT_PTR CMsnProto::SetAvatar(WPARAM, LPARAM lParam)
_read(fileId, pData, (unsigned)dwPngSize);
_close(fileId);
- TCHAR drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT];
- _tsplitpath(szFileName, drive, dir, fname, ext);
+ wchar_t drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT];
+ _wsplitpath(szFileName, drive, dir, fname, ext);
MSN_SetMyAvatar(fname, pData, dwPngSize);
@@ -355,11 +355,11 @@ INT_PTR CMsnProto::SetCurrentMedia(WPARAM, LPARAM lParam)
if (msnCurrentMedia.cbSize == 0)
delSetting("ListeningTo");
else {
- TCHAR *text;
+ wchar_t *text;
if (ServiceExists(MS_LISTENINGTO_GETPARSEDTEXT))
- text = (TCHAR *)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)L"%title% - %artist%", (LPARAM)&msnCurrentMedia);
+ text = (wchar_t *)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)L"%title% - %artist%", (LPARAM)&msnCurrentMedia);
else {
- text = (TCHAR *)mir_alloc(128 * sizeof(TCHAR));
+ text = (wchar_t *)mir_alloc(128 * sizeof(wchar_t));
mir_sntprintf(text, 128, L"%s - %s", (msnCurrentMedia.ptszTitle ? msnCurrentMedia.ptszTitle : L""),
(msnCurrentMedia.ptszArtist ? msnCurrentMedia.ptszArtist : L""));
}
diff --git a/protocols/MSN/src/msn_threads.cpp b/protocols/MSN/src/msn_threads.cpp
index 86c5250e83..ea171e6215 100644
--- a/protocols/MSN/src/msn_threads.cpp
+++ b/protocols/MSN/src/msn_threads.cpp
@@ -383,7 +383,7 @@ ThreadData* CMsnProto::MSN_GetThreadByContact(const char* wlid, TInfoType type)
return NULL;
}
-GCThreadData* CMsnProto::MSN_GetThreadByChatId(const TCHAR* chatId)
+GCThreadData* CMsnProto::MSN_GetThreadByChatId(const wchar_t* chatId)
{
if (mir_tstrlen(chatId) == 0)
return NULL;
diff --git a/protocols/MSN/src/stdafx.h b/protocols/MSN/src/stdafx.h
index 6607c74d92..859023b6bc 100644
--- a/protocols/MSN/src/stdafx.h
+++ b/protocols/MSN/src/stdafx.h
@@ -239,10 +239,10 @@ char* getNewUuid(void);
time_t IsoToUnixTime(const char *stamp);
time_t MsnTSToUnixtime(const char *pszTS);
-TCHAR* EscapeChatTags(const TCHAR* pszText);
-TCHAR* UnEscapeChatTags(TCHAR* str_in);
+wchar_t* EscapeChatTags(const wchar_t* pszText);
+wchar_t* UnEscapeChatTags(wchar_t* str_in);
-void overrideStr(TCHAR*& dest, const TCHAR* src, bool unicode, const TCHAR* def = NULL);
+void overrideStr(wchar_t*& dest, const wchar_t* src, bool unicode, const wchar_t* def = NULL);
char* arrayToHex(BYTE* data, size_t datasz);
@@ -268,8 +268,8 @@ typedef struct _tag_PopupData
{
unsigned flags;
char* url;
- TCHAR* title;
- TCHAR* text;
+ wchar_t* title;
+ wchar_t* text;
CMsnProto* proto;
} PopupData;
@@ -542,7 +542,7 @@ typedef void (__cdecl CMsnProto::*MsnThreadFunc)(void*);
struct GCUserItem
{
char WLID[MSN_MAX_EMAIL_LEN];
- TCHAR role[8];
+ wchar_t role[8];
BYTE btag;
};
@@ -554,7 +554,7 @@ struct GCThreadData
LIST<GCUserItem> mJoinedContacts;
GCUserItem* mCreator;
GCUserItem* mMe;
- TCHAR mChatID[MSN_MAX_EMAIL_LEN];
+ wchar_t mChatID[MSN_MAX_EMAIL_LEN];
int netId; // from mChatID
char szEmail[MSN_MAX_EMAIL_LEN]; // frim mChatID
};
@@ -577,7 +577,7 @@ struct ThreadData
HANDLE mIncomingBoundPort; // Netlib listen for the thread
HANDLE hWaitEvent;
WORD mIncomingPort;
- TCHAR mChatID[10];
+ wchar_t mChatID[10];
bool mIsMainThread;
clock_t mWaitPeriod;
@@ -1028,11 +1028,11 @@ INT_PTR CALLBACK DlgDeleteContactUI(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
struct InviteChatParam
{
- TCHAR* id;
+ wchar_t* id;
MCONTACT hContact;
CMsnProto* ppro;
- InviteChatParam(const TCHAR* id, MCONTACT hContact, CMsnProto* ppro)
+ InviteChatParam(const wchar_t* id, MCONTACT hContact, CMsnProto* ppro)
: id(mir_tstrdup(id)), hContact(hContact), ppro(ppro) {}
~InviteChatParam() {
diff --git a/protocols/MinecraftDynmap/src/dialogs.cpp b/protocols/MinecraftDynmap/src/dialogs.cpp
index a12d70b99c..28c428e30b 100644
--- a/protocols/MinecraftDynmap/src/dialogs.cpp
+++ b/protocols/MinecraftDynmap/src/dialogs.cpp
@@ -71,7 +71,7 @@ static void LoadDBText(MinecraftDynmapProto* ppro, HWND hwnd, int idCtrl, const
static void StoreDBText(MinecraftDynmapProto* ppro, HWND hwnd, int idCtrl, const char* szSetting)
{
- TCHAR tstr[250+1];
+ wchar_t tstr[250+1];
GetDlgItemText(hwnd, idCtrl, tstr, _countof(tstr));
if (tstr[0] != '\0') {
diff --git a/protocols/MinecraftDynmap/src/main.cpp b/protocols/MinecraftDynmap/src/main.cpp
index a4d6c02ed7..02cd9c4603 100644
--- a/protocols/MinecraftDynmap/src/main.cpp
+++ b/protocols/MinecraftDynmap/src/main.cpp
@@ -72,7 +72,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCO
/////////////////////////////////////////////////////////////////////////////////////////
// Load
-static PROTO_INTERFACE* protoInit(const char *proto_name,const TCHAR *username)
+static PROTO_INTERFACE* protoInit(const char *proto_name,const wchar_t *username)
{
MinecraftDynmapProto *proto = new MinecraftDynmapProto(proto_name, username);
g_Instances.insert(proto);
diff --git a/protocols/MinecraftDynmap/src/proto.cpp b/protocols/MinecraftDynmap/src/proto.cpp
index f2a15d6065..71c7932685 100644
--- a/protocols/MinecraftDynmap/src/proto.cpp
+++ b/protocols/MinecraftDynmap/src/proto.cpp
@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-MinecraftDynmapProto::MinecraftDynmapProto(const char* proto_name, const TCHAR* username) :
+MinecraftDynmapProto::MinecraftDynmapProto(const char* proto_name, const wchar_t* username) :
PROTO<MinecraftDynmapProto>(proto_name, username), m_interval(0), hConnection(0), hEventsConnection(0),
m_updateRate(5000), m_nick("")
{
@@ -42,7 +42,7 @@ MinecraftDynmapProto::MinecraftDynmapProto(const char* proto_name, const TCHAR*
HookProtoEvent(ME_GC_EVENT, &MinecraftDynmapProto::OnChatEvent);
// Create standard network connection
- TCHAR descr[512];
+ wchar_t descr[512];
NETLIBUSER nlu = {sizeof(nlu)};
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
nlu.szSettingsModule = m_szModuleName;
@@ -50,7 +50,7 @@ MinecraftDynmapProto::MinecraftDynmapProto(const char* proto_name, const TCHAR*
nlu.ptszDescriptiveName = descr;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
if (m_hNetlibUser == NULL) {
- TCHAR error[200];
+ wchar_t error[200];
mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
MessageBox(NULL, error, L"Miranda NG", MB_OK | MB_ICONERROR);
}
@@ -176,13 +176,13 @@ int MinecraftDynmapProto::OnModulesLoaded(WPARAM, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = g_hInstance;
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
odp.dwInitParam = LPARAM(this);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
odp.position = 271828;
- odp.ptszGroup = LPGENT("Network");
- odp.ptszTab = LPGENT("Account");
+ odp.pwszGroup = LPGENW("Network");
+ odp.pwszTab = LPGENW("Account");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.pfnDlgProc = MinecraftDynmapOptionsProc;
Options_AddPage(wParam, &odp);
diff --git a/protocols/MinecraftDynmap/src/proto.h b/protocols/MinecraftDynmap/src/proto.h
index 774f0eddb5..65f67cc25b 100644
--- a/protocols/MinecraftDynmap/src/proto.h
+++ b/protocols/MinecraftDynmap/src/proto.h
@@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
class MinecraftDynmapProto : public PROTO<MinecraftDynmapProto>
{
public:
- MinecraftDynmapProto(const char *proto_name, const TCHAR *username);
+ MinecraftDynmapProto(const char *proto_name, const wchar_t *username);
~MinecraftDynmapProto();
inline const char* ModuleName() const {
diff --git a/protocols/Omegle/src/chat.cpp b/protocols/Omegle/src/chat.cpp
index 6fe46e57b4..b3db982704 100644
--- a/protocols/Omegle/src/chat.cpp
+++ b/protocols/Omegle/src/chat.cpp
@@ -21,10 +21,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-void OmegleProto::UpdateChat(const TCHAR *name, const TCHAR *message, bool addtolog)
+void OmegleProto::UpdateChat(const wchar_t *name, const wchar_t *message, bool addtolog)
{
// replace % to %% to not interfere with chat color codes
- std::tstring smessage = message;
+ std::wstring smessage = message;
utils::text::treplace_all(&smessage, L"%", L"%%");
GCDEST gcd = { m_szModuleName, m_tszUserName, GC_EVENT_MESSAGE };
@@ -226,7 +226,7 @@ GCEVENT gce = { sizeof(gce), &gcd };
CallServiceSync(MS_GC_EVENT,WINDOW_CLEARLOG,reinterpret_cast<LPARAM>(&gce));
}*/
-void OmegleProto::AddChatContact(const TCHAR *name)
+void OmegleProto::AddChatContact(const wchar_t *name)
{
GCDEST gcd = { m_szModuleName, m_tszUserName, GC_EVENT_JOIN };
GCEVENT gce = { sizeof(gce), &gcd };
@@ -248,7 +248,7 @@ void OmegleProto::AddChatContact(const TCHAR *name)
CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast<LPARAM>(&gce));
}
-void OmegleProto::DeleteChatContact(const TCHAR *name)
+void OmegleProto::DeleteChatContact(const wchar_t *name)
{
GCDEST gcd = { m_szModuleName, m_tszUserName, GC_EVENT_PART };
GCEVENT gce = { sizeof(gce), &gcd };
@@ -296,7 +296,7 @@ INT_PTR OmegleProto::OnJoinChat(WPARAM, LPARAM suppress)
return 0;
}
-void OmegleProto::SetTopic(const TCHAR *topic)
+void OmegleProto::SetTopic(const wchar_t *topic)
{
GCDEST gcd = { m_szModuleName, m_tszUserName, GC_EVENT_TOPIC };
GCEVENT gce = { sizeof(gce), &gcd };
diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp
index db1391ba82..27370cb1f4 100644
--- a/protocols/Omegle/src/communication.cpp
+++ b/protocols/Omegle/src/communication.cpp
@@ -365,7 +365,7 @@ bool Omegle_client::start()
char str[255];
mir_snprintf(str, Translate("Connected to server %s. There are %s users online now."), server_.c_str(), count.c_str());
- TCHAR *msg = mir_a2t(str);
+ wchar_t *msg = mir_a2t(str);
parent->UpdateChat(NULL, msg);
mir_free(msg);
}
@@ -374,7 +374,7 @@ bool Omegle_client::start()
char str[255];
mir_snprintf(str, Translate("Connected to server %s."), server_.c_str());
- TCHAR *msg = mir_a2t(str);
+ wchar_t *msg = mir_a2t(str);
parent->UpdateChat(NULL, msg);
mir_free(msg);
}
@@ -506,7 +506,7 @@ bool Omegle_client::events()
// We got info about count of connected people there
ptrT count(json_as_string(json_get(data, "count")));
- TCHAR strT[255];
+ wchar_t strT[255];
mir_sntprintf(strT, TranslateT("On whole Omegle are %s strangers online now."), count);
parent->UpdateChat(NULL, strT);
@@ -531,7 +531,7 @@ bool Omegle_client::events()
waiting = false;
}
else if (name == "commonLikes") {
- std::tstring likes = TranslateT("You and the Stranger both like: ");
+ std::wstring likes = TranslateT("You and the Stranger both like: ");
JSONNode *items = json_at(item, 1);
size_t size = json_size(items);
@@ -614,7 +614,7 @@ bool Omegle_client::events()
ptrT stranger(json_as_string(json_at(item, 1)));
- TCHAR strT[255];
+ wchar_t strT[255];
mir_sntprintf(strT, TranslateT("%s disconnected."), TranslateTS(stranger));
parent->UpdateChat(NULL, strT);
@@ -639,7 +639,7 @@ bool Omegle_client::events()
else if (name == "error") {
ptrT error(json_as_string(json_at(item, 1)));
- TCHAR strT[255];
+ wchar_t strT[255];
mir_sntprintf(strT, TranslateT("Error: %s"), TranslateTS(error));
parent->UpdateChat(NULL, strT);
}
diff --git a/protocols/Omegle/src/dialogs.cpp b/protocols/Omegle/src/dialogs.cpp
index 7ff7b76097..9868c51c57 100644
--- a/protocols/Omegle/src/dialogs.cpp
+++ b/protocols/Omegle/src/dialogs.cpp
@@ -45,7 +45,7 @@ static void LoadDBText(OmegleProto* ppro, HWND hwnd, int idCtrl, const char* szS
static void StoreDBText(OmegleProto* ppro, HWND hwnd, int idCtrl, const char* szSetting)
{
- TCHAR tstr[250 + 1];
+ wchar_t tstr[250 + 1];
GetDlgItemText(hwnd, idCtrl, tstr, _countof(tstr));
if (tstr[0] != '\0') {
diff --git a/protocols/Omegle/src/main.cpp b/protocols/Omegle/src/main.cpp
index fbde3bf512..309d0fe897 100644
--- a/protocols/Omegle/src/main.cpp
+++ b/protocols/Omegle/src/main.cpp
@@ -74,7 +74,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC
/////////////////////////////////////////////////////////////////////////////////////////
// Load
-static PROTO_INTERFACE* protoInit(const char *proto_name, const TCHAR *username)
+static PROTO_INTERFACE* protoInit(const char *proto_name, const wchar_t *username)
{
OmegleProto *proto = new OmegleProto(proto_name, username);
g_Instances.insert(proto);
diff --git a/protocols/Omegle/src/messages.cpp b/protocols/Omegle/src/messages.cpp
index 8cabb89dcb..2a8f16b95e 100644
--- a/protocols/Omegle/src/messages.cpp
+++ b/protocols/Omegle/src/messages.cpp
@@ -34,7 +34,7 @@ void OmegleProto::SendMsgWorker(void *p)
if (facy.state_ == STATE_ACTIVE && data.length() && facy.send_message(data))
{
- TCHAR *msg = mir_a2t_cp(data.c_str(), CP_UTF8);
+ wchar_t *msg = mir_a2t_cp(data.c_str(), CP_UTF8);
UpdateChat(facy.nick_, msg);
mir_free(msg);
}
diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp
index 42d0249c1d..aff30158c6 100644
--- a/protocols/Omegle/src/proto.cpp
+++ b/protocols/Omegle/src/proto.cpp
@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-OmegleProto::OmegleProto(const char* proto_name, const TCHAR* username) :
+OmegleProto::OmegleProto(const char* proto_name, const wchar_t* username) :
PROTO<OmegleProto>(proto_name, username)
{
this->facy.parent = this;
@@ -42,7 +42,7 @@ PROTO<OmegleProto>(proto_name, username)
HookProtoEvent(ME_GC_EVENT, &OmegleProto::OnChatEvent);
// Create standard network connection
- TCHAR descr[512];
+ wchar_t descr[512];
NETLIBUSER nlu = { sizeof(nlu) };
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
nlu.szSettingsModule = m_szModuleName;
@@ -50,17 +50,17 @@ PROTO<OmegleProto>(proto_name, username)
nlu.ptszDescriptiveName = descr;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
if (m_hNetlibUser == NULL) {
- TCHAR error[200];
+ wchar_t error[200];
mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
MessageBox(NULL, error, L"Miranda NG", MB_OK | MB_ICONERROR);
}
facy.set_handle(m_hNetlibUser);
- SkinAddNewSoundExT("StrangerTyp", m_tszUserName, LPGENT("Stranger is typing"));
- SkinAddNewSoundExT("StrangerTypStop", m_tszUserName, LPGENT("Stranger stopped typing"));
- SkinAddNewSoundExT("StrangerChange", m_tszUserName, LPGENT("Changing stranger"));
- SkinAddNewSoundExT("StrangerMessage", m_tszUserName, LPGENT("Receive message"));
+ SkinAddNewSoundExT("StrangerTyp", m_tszUserName, LPGENW("Stranger is typing"));
+ SkinAddNewSoundExT("StrangerTypStop", m_tszUserName, LPGENW("Stranger stopped typing"));
+ SkinAddNewSoundExT("StrangerChange", m_tszUserName, LPGENW("Changing stranger"));
+ SkinAddNewSoundExT("StrangerMessage", m_tszUserName, LPGENW("Receive message"));
}
OmegleProto::~OmegleProto()
@@ -181,13 +181,13 @@ int OmegleProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = g_hInstance;
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
odp.dwInitParam = LPARAM(this);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
odp.position = 271828;
- odp.ptszGroup = LPGENT("Network");
- odp.ptszTab = LPGENT("Account");
+ odp.pwszGroup = LPGENW("Network");
+ odp.pwszTab = LPGENW("Account");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.pfnDlgProc = OmegleOptionsProc;
Options_AddPage(wParam, &odp);
diff --git a/protocols/Omegle/src/proto.h b/protocols/Omegle/src/proto.h
index 522f060991..5b0362b240 100644
--- a/protocols/Omegle/src/proto.h
+++ b/protocols/Omegle/src/proto.h
@@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
class OmegleProto : public PROTO < OmegleProto >
{
public:
- OmegleProto(const char *proto_name, const TCHAR *username);
+ OmegleProto(const char *proto_name, const wchar_t *username);
~OmegleProto();
inline const char* ModuleName() const
@@ -88,14 +88,14 @@ public:
//bool IsMyContact(HANDLE, bool include_chat = false);
// Chat handling
- void AddChat(const TCHAR *id, const TCHAR *name);
- void UpdateChat(const TCHAR *name, const TCHAR *message, bool addtochat = true);
+ void AddChat(const wchar_t *id, const wchar_t *name);
+ void UpdateChat(const wchar_t *name, const wchar_t *message, bool addtochat = true);
void SendChatMessage(std::string message);
- void AddChatContact(const TCHAR *nick);
- void DeleteChatContact(const TCHAR *name);
+ void AddChatContact(const wchar_t *nick);
+ void DeleteChatContact(const wchar_t *name);
void SetChatStatus(int);
void ClearChat();
- void SetTopic(const TCHAR *topic = NULL);
+ void SetTopic(const wchar_t *topic = NULL);
MCONTACT GetChatHandle();
// Connection client
diff --git a/protocols/Sametime/src/conference.cpp b/protocols/Sametime/src/conference.cpp
index 46cf1bbf83..71c0528eb0 100644
--- a/protocols/Sametime/src/conference.cpp
+++ b/protocols/Sametime/src/conference.cpp
@@ -108,8 +108,8 @@ void mwServiceConf_conf_opened(mwConference* conf, GList* members)
CSametimeProto* proto = getProtoFromMwConference(conf);
proto->debugLog(L"mwServiceConf_conf_opened() start");
- TCHAR* tszConfId = mir_utf8decodeT(mwConference_getName(conf));
- TCHAR* tszConfTitle = mir_utf8decodeT(mwConference_getTitle(conf));
+ wchar_t* tszConfId = mir_utf8decodeT(mwConference_getName(conf));
+ wchar_t* tszConfTitle = mir_utf8decodeT(mwConference_getTitle(conf));
// create new chat session
GCSESSION gcs = { sizeof(gcs) };
@@ -141,8 +141,8 @@ void mwServiceConf_conf_opened(mwConference* conf, GList* members)
for (;user; user=user->next) {
proto->debugLog(L"mwServiceConf_conf_opened() add user");
- TCHAR* tszUserName = mir_utf8decodeT(((mwLoginInfo*)user->data)->user_name);
- TCHAR* tszUserId = mir_utf8decodeT(((mwLoginInfo*)user->data)->login_id);
+ wchar_t* tszUserName = mir_utf8decodeT(((mwLoginInfo*)user->data)->user_name);
+ wchar_t* tszUserId = mir_utf8decodeT(((mwLoginInfo*)user->data)->login_id);
gce.ptszNick = tszUserName;
gce.ptszUID = tszUserId;
gce.bIsMe = (strcmp(((mwLoginInfo*)user->data)->login_id, proto->my_login_info->login_id) == 0);
@@ -173,7 +173,7 @@ void mwServiceConf_conf_closed(mwConference* conf, guint32 reason)
CSametimeProto* proto = getProtoFromMwConference(conf);
proto->debugLog(L"mwServiceConf_conf_closed() start");
- TCHAR* tszConfId = mir_utf8decodeT(mwConference_getName(conf));
+ wchar_t* tszConfId = mir_utf8decodeT(mwConference_getName(conf));
GCDEST gcd = { proto->m_szModuleName };
gcd.ptszID = tszConfId;
@@ -261,7 +261,7 @@ void mwServiceConf_on_text(mwConference* conf, mwLoginInfo* user, const char* wh
CSametimeProto* proto = getProtoFromMwConference(conf);
proto->debugLog(L"mwServiceConf_on_text() start");
- TCHAR* tszConfId = mir_utf8decodeT(mwConference_getName(conf));
+ wchar_t* tszConfId = mir_utf8decodeT(mwConference_getName(conf));
GCDEST gcd = { proto->m_szModuleName };
gcd.ptszID = tszConfId;
@@ -270,9 +270,9 @@ void mwServiceConf_on_text(mwConference* conf, mwLoginInfo* user, const char* wh
GCEVENT gce = { sizeof(gce), &gcd };
gce.dwFlags = GCEF_ADDTOLOG;
- TCHAR* textT = mir_utf8decodeT(what);
- TCHAR* tszUserName = mir_utf8decodeT(user->user_name);
- TCHAR* tszUserId = mir_utf8decodeT(user->login_id);
+ wchar_t* textT = mir_utf8decodeT(what);
+ wchar_t* tszUserName = mir_utf8decodeT(user->user_name);
+ wchar_t* tszUserId = mir_utf8decodeT(user->login_id);
gce.ptszText = textT;
gce.ptszNick = tszUserName;
gce.ptszUID = tszUserId;
@@ -319,7 +319,7 @@ void CSametimeProto::TerminateConference(char* name)
for (;conf;conf = conf->next) {
if (strcmp(name, mwConference_getName((mwConference*)conf->data)) == 0) {
- TCHAR* idt = mir_utf8decodeT(name);
+ wchar_t* idt = mir_utf8decodeT(name);
GCDEST gcd = {m_szModuleName, idt, GC_EVENT_CONTROL};
GCEVENT gce = { sizeof(gce), &gcd };
@@ -341,7 +341,7 @@ int CSametimeProto::GcEventHook(WPARAM wParam, LPARAM lParam) {
GList *conferences = mwServiceConference_getConferences(service_conference);
for (GList *conf = conferences;conf;conf = conf->next) {
- TCHAR* tszConfId = mir_utf8decodeT(mwConference_getName((mwConference*)conf->data));
+ wchar_t* tszConfId = mir_utf8decodeT(mwConference_getName((mwConference*)conf->data));
if (mir_tstrcmp(gch->pDest->ptszID, tszConfId) == 0) {
switch(gch->pDest->iType) {
case GC_USER_MESSAGE:
@@ -405,8 +405,8 @@ INT_PTR CSametimeProto::onMenuCreateChat(WPARAM wParam, LPARAM lParam)
mwAwareIdBlock id_block;
mwIdBlock idb;
if (my_login_info && GetAwareIdFromContact(hContact, &id_block)) {
- TCHAR title[512];
- TCHAR* ts = mir_utf8decodeT(my_login_info->user_name);
+ wchar_t title[512];
+ wchar_t* ts = mir_utf8decodeT(my_login_info->user_name);
mir_sntprintf(title, TranslateT("%s's conference"), ts);
mir_free(ts);
@@ -509,13 +509,13 @@ void CSametimeProto::InitConferenceMenu()
mi.flags = CMIF_TCHAR | CMIF_NOTOFFLINE;
SET_UID(mi, 0x98cf8a8c, 0x75ba, 0x46f2, 0xa3, 0x35, 0x65, 0x46, 0x4a, 0x38, 0x20, 0x7d);
- mi.name.t = LPGENT("Leave conference");
+ mi.name.w = LPGENW("Leave conference");
mi.pszService = MS_SAMETIME_MENULEAVECHAT;
mi.hIcolibItem = GetIconHandle(IDI_ICON_LEAVE);
hLeaveChatMenuItem = Menu_AddContactMenuItem(&mi, m_szModuleName);
SET_UID(mi, 0x45501e10, 0x2914, 0x4daa, 0xb4, 0xcf, 0x83, 0x8a, 0x6a, 0x14, 0xd, 0x7);
- mi.name.t = LPGENT("Start conference");
+ mi.name.w = LPGENW("Start conference");
mi.pszService = MS_SAMETIME_MENUCREATECHAT;
mi.hIcolibItem = GetIconHandle(IDI_ICON_INVITE);
hCreateChatMenuItem = Menu_AddContactMenuItem(&mi);
diff --git a/protocols/Sametime/src/files.cpp b/protocols/Sametime/src/files.cpp
index bbc71b346b..567520469a 100644
--- a/protocols/Sametime/src/files.cpp
+++ b/protocols/Sametime/src/files.cpp
@@ -28,22 +28,22 @@ void mwFileTransfer_offered(mwFileTransfer* ft)
proto->ProtoBroadcastAck(hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, (HANDLE)ft, 0);
- TCHAR* filenameT = mir_utf8decodeT(mwFileTransfer_getFileName(ft));
+ wchar_t* filenameT = mir_utf8decodeT(mwFileTransfer_getFileName(ft));
const char* message = mwFileTransfer_getMessage(ft);
- TCHAR descriptionT[512];
+ wchar_t descriptionT[512];
if (message) {
- TCHAR* messageT = mir_utf8decodeT(message);
+ wchar_t* messageT = mir_utf8decodeT(message);
mir_sntprintf(descriptionT, L"%s - %s", filenameT, messageT);
mir_free(messageT);
} else
- _tcsncpy_s(descriptionT, filenameT, _TRUNCATE);
+ wcsncpy_s(descriptionT, filenameT, _TRUNCATE);
PROTORECVFILET pre = {0};
pre.dwFlags = PRFF_TCHAR;
pre.fileCount = 1;
pre.timestamp = time(NULL);
- pre.descr.t = descriptionT;
- pre.files.t = &filenameT;
+ pre.descr.w = descriptionT;
+ pre.files.w = &filenameT;
pre.lParam = (LPARAM)ft;
ProtoChainRecvFile(hContact, &pre);
@@ -282,7 +282,7 @@ mwFileTransferHandler mwFileTransfer_handler = {
mwFileTransfer_clear
};
-HANDLE CSametimeProto::SendFilesToUser(MCONTACT hContact, TCHAR** files, const TCHAR* ptszDesc)
+HANDLE CSametimeProto::SendFilesToUser(MCONTACT hContact, wchar_t** files, const wchar_t* ptszDesc)
{
debugLog(L"CSametimeProto::SendFilesToUser() start");
@@ -300,7 +300,7 @@ HANDLE CSametimeProto::SendFilesToUser(MCONTACT hContact, TCHAR** files, const T
if (hFile != INVALID_HANDLE_VALUE) {
DWORD filesize = GetFileSize(hFile, 0);
- TCHAR *fn = _tcsrchr(files[i], '\\');
+ wchar_t *fn = wcsrchr(files[i], '\\');
if (fn)
fn++;
else
diff --git a/protocols/Sametime/src/messaging.cpp b/protocols/Sametime/src/messaging.cpp
index 2bde61b90e..a6092c0c21 100644
--- a/protocols/Sametime/src/messaging.cpp
+++ b/protocols/Sametime/src/messaging.cpp
@@ -95,9 +95,9 @@ void mwIm_place_invite(struct mwConversation* conv, const char* message, const c
///TODO unimplemented
- TCHAR* tszMessage = mir_utf8decodeT(message);
+ wchar_t* tszMessage = mir_utf8decodeT(message);
- TCHAR msg[512];
+ wchar_t msg[512];
mir_sntprintf(msg, TranslateT("SERVICE NOT IMPLEMENTED. %s"), tszMessage);
proto->showPopup(msg, SAMETIME_POPUP_INFO);
diff --git a/protocols/Sametime/src/options.cpp b/protocols/Sametime/src/options.cpp
index 9f31d92ba6..aa08112856 100644
--- a/protocols/Sametime/src/options.cpp
+++ b/protocols/Sametime/src/options.cpp
@@ -6,7 +6,7 @@
#define NUM_IDS 24
-TCHAR* client_names[NUM_IDS] = {
+wchar_t* client_names[NUM_IDS] = {
L"Official Binary Library",
L"Official Java Applet",
L"Official Binary Application",
@@ -65,7 +65,7 @@ int client_ids[NUM_IDS] = {
#define NUM_CVS 5
-TCHAR* CV_names[NUM_CVS] = {
+wchar_t* CV_names[NUM_CVS] = {
L"Sametime (Use old client version)",
L"Sametime (Miranda default)",
L"Sametime 8",
@@ -102,19 +102,19 @@ static INT_PTR CALLBACK DlgProcOptNet(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
WORD client_ver = proto->GetClientVersion();
if (client_ver) {
- TCHAR verbuf[100];
+ wchar_t verbuf[100];
mir_sntprintf(verbuf, TranslateT("Client protocol version: %03d.%03d"), (client_ver & 0xFF00) >> 8, client_ver & 0xFF);
SetDlgItemText(hwndDlg, IDC_ST_CLIENTVER, verbuf);
}
WORD server_ver = proto->GetServerVersion();
if (server_ver) {
- TCHAR verbuf[100];
+ wchar_t verbuf[100];
mir_sntprintf(verbuf, TranslateT("Server protocol version: %03d.%03d"), (server_ver & 0xFF00) >> 8, server_ver & 0xFF);
SetDlgItemText(hwndDlg, IDC_ST_SERVERVER, verbuf);
}
- TCHAR *s = mir_utf8decodeT(proto->options.server_name); SetDlgItemText(hwndDlg, IDC_ED_SNAME, s); mir_free(s);
+ wchar_t *s = mir_utf8decodeT(proto->options.server_name); SetDlgItemText(hwndDlg, IDC_ED_SNAME, s); mir_free(s);
s = mir_utf8decodeT(proto->options.id); SetDlgItemText(hwndDlg, IDC_ED_NAME, s); mir_free(s);
s = mir_utf8decodeT(proto->options.pword); SetDlgItemText(hwndDlg, IDC_ED_PWORD, s); mir_free(s);
@@ -230,7 +230,7 @@ static INT_PTR CALLBACK DlgProcOptNet(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
case IDC_BTN_IMPORTCONTACTS:
{
- TCHAR import_filename[MAX_PATH]; import_filename[0] = 0;
+ wchar_t import_filename[MAX_PATH]; import_filename[0] = 0;
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
@@ -291,7 +291,7 @@ static INT_PTR CALLBACK DlgProcOptNet(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == PSN_APPLY) {
- TCHAR ws[2048];
+ wchar_t ws[2048];
GetDlgItemText(hwndDlg, IDC_ED_SNAME, ws, LSTRINGLEN);
mir_strcpy(proto->options.server_name, T2Utf(ws));
@@ -350,8 +350,8 @@ int CSametimeProto::OptInit(WPARAM wParam, LPARAM)
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTNET);
- odp.ptszTitle = m_tszUserName;
- odp.ptszGroup = LPGENT("Network");
+ odp.pwszTitle = m_tszUserName;
+ odp.pwszGroup = LPGENW("Network");
odp.pfnDlgProc = DlgProcOptNet;
odp.dwInitParam = (LPARAM)this;
Options_AddPage(wParam, &odp);
diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp
index 6a9e9a3169..0a950bc123 100644
--- a/protocols/Sametime/src/sametime.cpp
+++ b/protocols/Sametime/src/sametime.cpp
@@ -248,7 +248,7 @@ void CSametimeProto::BroadcastNewStatus(int iNewStatus)
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)previous_status, m_iStatus);
}
-static CSametimeProto* sametime_proto_init(const char* pszProtoName, const TCHAR* tszUserName)
+static CSametimeProto* sametime_proto_init(const char* pszProtoName, const wchar_t* tszUserName)
{
CSametimeProto* proto = new CSametimeProto(pszProtoName, tszUserName);
g_Instances.insert(proto);
diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp
index 4278a309c8..ca84865901 100644
--- a/protocols/Sametime/src/sametime_proto.cpp
+++ b/protocols/Sametime/src/sametime_proto.cpp
@@ -1,7 +1,7 @@
#include "StdAfx.h"
#include "sametime.h"
-CSametimeProto::CSametimeProto(const char* pszProtoName, const TCHAR* tszUserName) :
+CSametimeProto::CSametimeProto(const char* pszProtoName, const wchar_t* tszUserName) :
PROTO<CSametimeProto>(pszProtoName, tszUserName),
is_idle(false), idle_status(false),
first_online(true),
@@ -14,7 +14,7 @@ CSametimeProto::CSametimeProto(const char* pszProtoName, const TCHAR* tszUserNam
server_connection(0)
{
// Register m_hNetlibUser user
- TCHAR name[128];
+ wchar_t name[128];
mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
@@ -83,7 +83,7 @@ MCONTACT CSametimeProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
return AddSearchedUser(sr, flags & PALF_TEMPORARY);
}
-HANDLE CSametimeProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath)
+HANDLE CSametimeProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath)
{
debugLog(L"CSametimeProto::FileAllow() hContact=[%x], szPath=[%s]", hContact, szPath);
char* szPathA = mir_t2a(szPath);
@@ -99,14 +99,14 @@ int CSametimeProto::FileCancel(MCONTACT hContact, HANDLE hTransfer)
return 0;
}
-int CSametimeProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason)
+int CSametimeProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason)
{
debugLog(L"CSametimeProto::FileDeny() hContact=[%x], szReason=[%s]", hContact, szReason);
RejectFileTransfer(hTransfer);
return 0;
}
-int CSametimeProto::FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename)
+int CSametimeProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename)
{
debugLog(L"CSametimeProto::FileResume() action=[%d]", &action);
return 0;
@@ -157,7 +157,7 @@ int CSametimeProto::GetInfo(MCONTACT hContact, int infoType)
return 0;
}
-HANDLE CSametimeProto::SearchBasic(const TCHAR* id)
+HANDLE CSametimeProto::SearchBasic(const wchar_t* id)
{
debugLog(L"CSametimeProto::SearchBasic() id:len=[%d]", id == NULL ? -1 : mir_tstrlen(id));
return (HANDLE)SearchForUser(T2Utf(id), FALSE);
@@ -166,7 +166,7 @@ HANDLE CSametimeProto::SearchBasic(const TCHAR* id)
HWND CSametimeProto::SearchAdvanced(HWND owner)
{
- TCHAR buf[512];
+ wchar_t buf[512];
if (GetDlgItemText(owner, IDC_EDIT1, buf, _countof(buf))) {
debugLog(L"CSametimeProto::SearchAdvanced() buf:len=[%d]", mir_tstrlen(buf));
return (HWND)SearchForUser(T2Utf(buf), TRUE);
@@ -201,7 +201,7 @@ int CSametimeProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre)
return Proto_RecvMessage(hContact, pre);
}
-HANDLE CSametimeProto::SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles)
+HANDLE CSametimeProto::SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles)
{
debugLog(L"CSametimeProto::SendFile() hContact=[%x]", hContact);
if (m_iStatus != ID_STATUS_OFFLINE) {
@@ -282,7 +282,7 @@ int CSametimeProto::RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt
return 0;
}
-int CSametimeProto::SetAwayMsg(int iStatus, const TCHAR* msg)
+int CSametimeProto::SetAwayMsg(int iStatus, const wchar_t* msg)
{
debugLog(L"CSametimeProto::SetAwayMsg() iStatus=[%d], msg:len=[%d]", iStatus, msg == NULL ? -1 : mir_tstrlen(msg));
SetSessionAwayMessage(iStatus, msg);
diff --git a/protocols/Sametime/src/sametime_proto.h b/protocols/Sametime/src/sametime_proto.h
index 7b51b77476..4e652a5dd8 100644
--- a/protocols/Sametime/src/sametime_proto.h
+++ b/protocols/Sametime/src/sametime_proto.h
@@ -7,7 +7,7 @@
struct CSametimeProto : public PROTO<CSametimeProto>
{
- CSametimeProto(const char*, const TCHAR* );
+ CSametimeProto(const char*, const wchar_t* );
~CSametimeProto();
//====================================================================================
@@ -17,29 +17,29 @@ struct CSametimeProto : public PROTO<CSametimeProto>
virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
- virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath);
+ virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath);
virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason);
- virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename);
+ virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason);
+ virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename);
virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
virtual int __cdecl GetInfo(MCONTACT hContact, int infoType);
- virtual HANDLE __cdecl SearchBasic(const TCHAR* id);
+ virtual HANDLE __cdecl SearchBasic(const wchar_t* id);
virtual HWND __cdecl SearchAdvanced(HWND owner);
virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
virtual int __cdecl RecvFile(MCONTACT hContact, PROTORECVFILET*);
virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*);
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles);
+ virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles);
virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg);
virtual int __cdecl SetStatus(int iNewStatus);
virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt);
- virtual int __cdecl SetAwayMsg(int iStatus, const TCHAR* msg);
+ virtual int __cdecl SetAwayMsg(int iStatus, const wchar_t* msg);
virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
@@ -73,7 +73,7 @@ struct CSametimeProto : public PROTO<CSametimeProto>
bool GetAwareIdFromContact(MCONTACT hContact, mwAwareIdBlock* id_block);
MCONTACT FindContactByUserId(const char* id);
void ImportContactsFromList(mwSametimeList* user_list, bool temporary);
- void ImportContactsFromFile(TCHAR* filename);
+ void ImportContactsFromFile(wchar_t* filename);
void ExportContactsToList(mwSametimeList* user_list);
void ExportContactsToServer();
void UserListAddStored();
@@ -93,7 +93,7 @@ struct CSametimeProto : public PROTO<CSametimeProto>
HANDLE AcceptFileTransfer(MCONTACT hContact, HANDLE hFt, char* save_path);
void RejectFileTransfer(HANDLE hFt);
void CancelFileTransfer(HANDLE hFt);
- HANDLE SendFilesToUser(MCONTACT hContact, TCHAR** files, const TCHAR* pszDesc);
+ HANDLE SendFilesToUser(MCONTACT hContact, wchar_t** files, const wchar_t* pszDesc);
// conference.cpp
void InitConference();
@@ -117,7 +117,7 @@ struct CSametimeProto : public PROTO<CSametimeProto>
int SetSessionStatus(int status);
void UpdateSelfStatus();
int SetIdle(bool idle);
- void SetSessionAwayMessage(int status, const TCHAR* msg);
+ void SetSessionAwayMessage(int status, const wchar_t* msg);
WORD GetClientVersion();
WORD GetServerVersion();
INT_PTR __cdecl SessionAnnounce(WPARAM wParam, LPARAM lParam);
@@ -132,7 +132,7 @@ struct CSametimeProto : public PROTO<CSametimeProto>
void SaveOptions();
// utils.cpp
- void showPopup(const TCHAR* msg, SametimePopupEnum flag);
+ void showPopup(const wchar_t* msg, SametimePopupEnum flag);
void showPopup(guint32 code);
void RegisterPopups();
void UnregisterPopups();
@@ -207,7 +207,7 @@ typedef struct tag_TFakeAckParams {
struct SendAnnouncementFunc_arg {
CSametimeProto* proto;
- TCHAR msg[MAX_MESSAGE_SIZE];
+ wchar_t msg[MAX_MESSAGE_SIZE];
GList* recipients;
};
@@ -221,8 +221,8 @@ struct SessionAnnounceDialogProc_arg {
struct PopupData {
SametimePopupEnum flag;
- TCHAR* title;
- TCHAR* text;
+ wchar_t* title;
+ wchar_t* text;
CSametimeProto* proto;
};
diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp
index 496b1ea95e..6fa0644c75 100644
--- a/protocols/Sametime/src/sametime_session.cpp
+++ b/protocols/Sametime/src/sametime_session.cpp
@@ -137,7 +137,7 @@ void __cdecl SessionAdmin(struct mwSession* session, const char* text)
{
CSametimeProto* proto = (CSametimeProto*)mwSession_getProperty(session, "PROTO_STRUCT_PTR");
proto->debugLog(L"SessionAdmin()");
- TCHAR* tt = mir_utf8decodeT(text);
+ wchar_t* tt = mir_utf8decodeT(text);
MessageBox(0, tt, TranslateT("Sametime administrator message"), MB_OK);
mir_free(tt);
}
@@ -146,9 +146,9 @@ void __cdecl SessionAnnounce(struct mwSession* session, struct mwLoginInfo* from
{
CSametimeProto* proto = (CSametimeProto*)mwSession_getProperty(session, "PROTO_STRUCT_PTR");
proto->debugLog(L"SessionAnnounce()");
- TCHAR* stzFrom;
- TCHAR* stzText;
- TCHAR stzFromBuff[256];
+ wchar_t* stzFrom;
+ wchar_t* stzText;
+ wchar_t stzFromBuff[256];
stzFrom = mir_utf8decodeT(from->user_name);
stzText = mir_utf8decodeT(text);
mir_sntprintf(stzFromBuff, TranslateT("Session announcement - from '%s'"), stzFrom);
@@ -208,7 +208,7 @@ void __cdecl SessionSetUserStatus(struct mwSession* session)
break;
default:
- TCHAR buff[512];
+ wchar_t buff[512];
mir_sntprintf(buff, TranslateT("Unknown user status: %d"), us.status);
proto->showPopup(buff, SAMETIME_POPUP_ERROR);
proto->debugLog(buff);
@@ -311,7 +311,7 @@ int CSametimeProto::SetIdle(bool idle)
return 0;
}
-void CSametimeProto::SetSessionAwayMessage(int status, const TCHAR* msgT)
+void CSametimeProto::SetSessionAwayMessage(int status, const wchar_t* msgT)
{
debugLog(L"SetSessionAwayMessage() status=[%d], msgT:len=[%d]", status, msgT == NULL ? -1 : mir_tstrlen(msgT));
@@ -578,7 +578,7 @@ void CSametimeProto::InitSessionMenu()
CMenuItem mi;
mi.flags = CMIF_TCHAR;
mi.position = 2000060000;
- mi.name.t = LPGENT("Send announcement...");
+ mi.name.w = LPGENW("Send announcement...");
mi.pszService = MS_SAMETIME_MENUANNOUNCESESSION;
mi.hIcolibItem = GetIconHandle(IDI_ICON_ANNOUNCE);
Menu_AddContactMenuItem(&mi, m_szModuleName);
diff --git a/protocols/Sametime/src/userlist.cpp b/protocols/Sametime/src/userlist.cpp
index 3766dc73f7..4660b68c8f 100644
--- a/protocols/Sametime/src/userlist.cpp
+++ b/protocols/Sametime/src/userlist.cpp
@@ -298,7 +298,7 @@ void CSametimeProto::ExportContactsToList(mwSametimeList* user_list)
}
}
-void CSametimeProto::ImportContactsFromFile(TCHAR* filename)
+void CSametimeProto::ImportContactsFromFile(wchar_t* filename)
{
debugLog(L"CSametimeProto::ImportContactsFromFile() start");
std::ifstream in(filename);
@@ -654,8 +654,8 @@ void mwResolve_handler_callback(mwServiceResolve* srvc, guint32 id, guint32 code
mcsr.psr.nick.a = mcsr.name;
mcsr.nFieldCount = 4;
- TCHAR fields[4][512];
- TCHAR *fields_addr[4];
+ wchar_t fields[4][512];
+ wchar_t *fields_addr[4];
mcsr.pszFields = fields_addr;
mcsr.pszFields[0] = fields[0];
mcsr.pszFields[1] = fields[1];
@@ -665,10 +665,10 @@ void mwResolve_handler_callback(mwServiceResolve* srvc, guint32 id, guint32 code
if (advanced == TRUE) {
// send column names
mcsr.psr.cbSize = 0;
- _tcsncpy(mcsr.pszFields[0], TranslateT("ID"), 512);
- _tcsncpy(mcsr.pszFields[1], TranslateT("Name"), 512);
- _tcsncpy(mcsr.pszFields[2], TranslateT("Description"), 512);
- _tcsncpy(mcsr.pszFields[3], TranslateT("Group?"), 512);
+ wcsncpy(mcsr.pszFields[0], TranslateT("ID"), 512);
+ wcsncpy(mcsr.pszFields[1], TranslateT("Name"), 512);
+ wcsncpy(mcsr.pszFields[2], TranslateT("Description"), 512);
+ wcsncpy(mcsr.pszFields[3], TranslateT("Group?"), 512);
proto->ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SEARCHRESULT, (HANDLE)id, (LPARAM)&mcsr);
}
@@ -689,7 +689,7 @@ void mwResolve_handler_callback(mwServiceResolve* srvc, guint32 id, guint32 code
mcsr.pszFields[2][0] = 0;
mcsr.group = (((mwResolveMatch *)mri->data)->type == mwResolveMatch_GROUP);
- _tcsncpy_s(mcsr.pszFields[3], 512, mcsr.group ? TranslateT("True") : TranslateT("False"), _TRUNCATE);
+ wcsncpy_s(mcsr.pszFields[3], 512, mcsr.group ? TranslateT("True") : TranslateT("False"), _TRUNCATE);
if (advanced == TRUE)
proto->ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SEARCHRESULT, (HANDLE)id, (LPARAM)&mcsr);
diff --git a/protocols/Sametime/src/utils.cpp b/protocols/Sametime/src/utils.cpp
index 0a73ddce90..0e24204f8d 100644
--- a/protocols/Sametime/src/utils.cpp
+++ b/protocols/Sametime/src/utils.cpp
@@ -29,7 +29,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar
void CSametimeProto::RegisterPopups()
{
- TCHAR szDescr[256];
+ wchar_t szDescr[256];
char szName[256];
debugLog(L"CSametimeProto::RegisterPopups()");
@@ -86,8 +86,8 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam)
if (disp == ED_POP) {
POPUPDATACLASS ppd = { sizeof(ppd) };
char szName[256];
- ppd.ptszTitle = puData->title;
- ppd.ptszText = puData->text;
+ ppd.pwszTitle = puData->title;
+ ppd.pwszText = puData->text;
if (puData->flag == SAMETIME_POPUP_ERROR)
mir_snprintf(szName, "%s_%s", proto->m_szModuleName, "Error");
else
@@ -125,7 +125,7 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam)
}
}
-void CSametimeProto::showPopup(const TCHAR* msg, SametimePopupEnum flag)
+void CSametimeProto::showPopup(const wchar_t* msg, SametimePopupEnum flag)
{
if (Miranda_Terminated()) return;
@@ -143,7 +143,7 @@ void CSametimeProto::showPopup(guint32 code)
struct mwReturnCodeDesc *rcDesc = mwGetReturnCodeDesc(code);
SametimePopupEnum flag = (rcDesc->type == mwReturnCodeError ? SAMETIME_POPUP_ERROR : SAMETIME_POPUP_INFO);
- TCHAR buff[512];
+ wchar_t buff[512];
mir_sntprintf(buff, TranslateT("%s\n\nSametime error %S\n%s"), TranslateTS(_A2T(rcDesc->name)), rcDesc->codeString, TranslateTS(_A2T(rcDesc->description)));
showPopup(buff, flag);
diff --git a/protocols/SkypeWeb/src/skype_avatars.cpp b/protocols/SkypeWeb/src/skype_avatars.cpp
index 26ef2bcb81..d2c766c4e1 100644
--- a/protocols/SkypeWeb/src/skype_avatars.cpp
+++ b/protocols/SkypeWeb/src/skype_avatars.cpp
@@ -68,7 +68,7 @@ void CSkypeProto::OnReceiveAvatar(const NETLIBHTTPREQUEST *response, void *arg)
setByte(hContact, "AvatarType", ai.format);
GetAvatarFileName(hContact, ai.filename, _countof(ai.filename));
- FILE *out = _tfopen(ai.filename, L"wb");
+ FILE *out = _wfopen(ai.filename, L"wb");
if (out == NULL) {
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, &ai, 0);
return;
@@ -100,11 +100,11 @@ INT_PTR CSkypeProto::SvcGetAvatarInfo(WPARAM, LPARAM lParam)
pai->format = getByte(pai->hContact, "AvatarType", PA_FORMAT_JPEG);
- TCHAR tszFileName[MAX_PATH];
+ wchar_t tszFileName[MAX_PATH];
GetAvatarFileName(pai->hContact, tszFileName, _countof(tszFileName));
- _tcsncpy(pai->filename, tszFileName, _countof(pai->filename));
+ wcsncpy(pai->filename, tszFileName, _countof(pai->filename));
- if (::_taccess(pai->filename, 0) == 0 && !getBool(pai->hContact, "NeedNewAvatar", 0))
+ if (::_waccess(pai->filename, 0) == 0 && !getBool(pai->hContact, "NeedNewAvatar", 0))
return GAIR_SUCCESS;
if (IsOnline()) {
@@ -119,13 +119,13 @@ INT_PTR CSkypeProto::SvcGetAvatarInfo(WPARAM, LPARAM lParam)
INT_PTR CSkypeProto::SvcGetMyAvatar(WPARAM wParam, LPARAM lParam)
{
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
GetAvatarFileName(NULL, path, _countof(path));
- _tcsncpy((TCHAR*)wParam, path, (int)lParam);
+ wcsncpy((wchar_t*)wParam, path, (int)lParam);
return 0;
}
-void CSkypeProto::GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen)
+void CSkypeProto::GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen)
{
int tPathLen = mir_sntprintf(pszDest, cbLen, L"%s\\%s", VARST(L"%miranda_avatarcache%"), m_tszUserName);
@@ -135,7 +135,7 @@ void CSkypeProto::GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cb
pszDest[tPathLen++] = '\\';
- const TCHAR* szFileType = ProtoGetAvatarExtension(getByte(hContact, "AvatarType", PA_FORMAT_JPEG));
+ const wchar_t* szFileType = ProtoGetAvatarExtension(getByte(hContact, "AvatarType", PA_FORMAT_JPEG));
CMStringA username(Contacts[hContact]);
username.Replace("live:", "__live_");
username.Replace("facebook:", "__facebook_");
@@ -166,14 +166,14 @@ void CSkypeProto::SetAvatarUrl(MCONTACT hContact, CMString &tszUrl)
INT_PTR CSkypeProto::SvcSetMyAvatar(WPARAM, LPARAM lParam)
{
- TCHAR *path = (TCHAR*)lParam;
- TCHAR avatarPath[MAX_PATH];
+ wchar_t *path = (wchar_t*)lParam;
+ wchar_t avatarPath[MAX_PATH];
GetAvatarFileName(NULL, avatarPath, _countof(avatarPath));
if (path != NULL)
{
if (CopyFile(path, avatarPath, FALSE))
{
- FILE *hFile = _tfopen(path, L"rb");
+ FILE *hFile = _wfopen(path, L"rb");
if (hFile)
{
fseek(hFile, 0, SEEK_END);
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp
index 8fa95966d9..282793848c 100644
--- a/protocols/SkypeWeb/src/skype_chatrooms.cpp
+++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp
@@ -58,7 +58,7 @@ MCONTACT CSkypeProto::FindChatRoom(const char *chatname)
return si ? si->hContact : 0;
}
-void CSkypeProto::StartChatRoom(const TCHAR *tid, const TCHAR *tname)
+void CSkypeProto::StartChatRoom(const wchar_t *tid, const wchar_t *tname)
{
// Create the group chat session
GCSESSION gcw = { sizeof(gcw) };
@@ -408,9 +408,9 @@ void CSkypeProto::OnChatEvent(const JSONNode &node)
}
}
-TCHAR* UnEscapeChatTags(TCHAR* str_in)
+wchar_t* UnEscapeChatTags(wchar_t* str_in)
{
- TCHAR *s = str_in, *d = str_in;
+ wchar_t *s = str_in, *d = str_in;
while (*s) {
if (*s == '%' && s[1] == '%')
s++;
@@ -420,12 +420,12 @@ TCHAR* UnEscapeChatTags(TCHAR* str_in)
return str_in;
}
-void CSkypeProto::OnSendChatMessage(const TCHAR *chat_id, const TCHAR * tszMessage)
+void CSkypeProto::OnSendChatMessage(const wchar_t *chat_id, const wchar_t * tszMessage)
{
if (!IsOnline())
return;
- TCHAR *buf = NEWTSTR_ALLOCA(tszMessage);
+ wchar_t *buf = NEWWSTR_ALLOCA(tszMessage);
rtrimt(buf);
UnEscapeChatTags(buf);
@@ -438,7 +438,7 @@ void CSkypeProto::OnSendChatMessage(const TCHAR *chat_id, const TCHAR * tszMessa
SendRequest(new SendChatMessageRequest(szChatId, time(NULL), szMessage, li));
}
-void CSkypeProto::AddMessageToChat(const TCHAR *chat_id, const TCHAR *from, const char *content, bool isAction, int emoteOffset, time_t timestamp, bool isLoading)
+void CSkypeProto::AddMessageToChat(const wchar_t *chat_id, const wchar_t *from, const char *content, bool isAction, int emoteOffset, time_t timestamp, bool isLoading)
{
GCDEST gcd = { m_szModuleName, chat_id, isAction ? GC_EVENT_ACTION : GC_EVENT_MESSAGE };
GCEVENT gce = { sizeof(GCEVENT), &gcd };
@@ -468,7 +468,7 @@ void CSkypeProto::AddMessageToChat(const TCHAR *chat_id, const TCHAR *from, cons
void CSkypeProto::OnGetChatInfo(const NETLIBHTTPREQUEST *response, void *p)
{
- ptrT topic((TCHAR*)p); // memory must be freed in any case
+ ptrT topic((wchar_t*)p); // memory must be freed in any case
if (response == NULL || response->pData == NULL)
return;
@@ -520,13 +520,13 @@ void CSkypeProto::ChangeChatTopic(const char *chat_id, const char *topic, const
CallService(MS_GC_EVENT, 0, reinterpret_cast<LPARAM>(&gce));
}
-bool CSkypeProto::IsChatContact(const TCHAR *chat_id, const char *id)
+bool CSkypeProto::IsChatContact(const wchar_t *chat_id, const char *id)
{
ptrA users(GetChatUsers(chat_id));
return (users != NULL && strstr(users, id) != NULL);
}
-char *CSkypeProto::GetChatUsers(const TCHAR *chat_id)
+char *CSkypeProto::GetChatUsers(const wchar_t *chat_id)
{
GC_INFO gci = { 0 };
gci.Flags = GCF_USERS;
@@ -536,13 +536,13 @@ char *CSkypeProto::GetChatUsers(const TCHAR *chat_id)
return gci.pszUsers;
}
-void CSkypeProto::AddChatContact(const TCHAR *tchat_id, const char *id, const char *name, const TCHAR *role, bool isChange)
+void CSkypeProto::AddChatContact(const wchar_t *tchat_id, const char *id, const char *name, const wchar_t *role, bool isChange)
{
if (IsChatContact(tchat_id, id))
return;
ptrT tnick(mir_a2t_cp(name, CP_UTF8));
- if (TCHAR *tmp = db_get_tsa(FindChatRoom(_T2A(tchat_id)), "UsersNicks", id))
+ if (wchar_t *tmp = db_get_tsa(FindChatRoom(_T2A(tchat_id)), "UsersNicks", id))
tnick = tmp;
ptrT tid(mir_a2t(id));
@@ -560,7 +560,7 @@ void CSkypeProto::AddChatContact(const TCHAR *tchat_id, const char *id, const ch
CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast<LPARAM>(&gce));
}
-void CSkypeProto::RemoveChatContact(const TCHAR *tchat_id, const char *id, const char *name, bool isKick, const char *initiator)
+void CSkypeProto::RemoveChatContact(const wchar_t *tchat_id, const char *id, const char *name, bool isKick, const char *initiator)
{
if (IsMe(id))
return;
@@ -619,9 +619,9 @@ int CSkypeProto::OnGroupChatMenuHook(WPARAM, LPARAM lParam)
{
static const struct gc_item Items[] =
{
- { LPGENT("&Invite user..."), 10, MENU_ITEM, FALSE },
- { LPGENT("&Leave chat session"), 20, MENU_ITEM, FALSE },
- { LPGENT("&Change topic"), 30, MENU_ITEM, FALSE }
+ { LPGENW("&Invite user..."), 10, MENU_ITEM, FALSE },
+ { LPGENW("&Leave chat session"), 20, MENU_ITEM, FALSE },
+ { LPGENW("&Change topic"), 30, MENU_ITEM, FALSE }
};
gcmi->nItems = _countof(Items);
gcmi->Item = (gc_item*)Items;
@@ -637,12 +637,12 @@ int CSkypeProto::OnGroupChatMenuHook(WPARAM, LPARAM lParam)
{*/
static const struct gc_item Items[] =
{
- { LPGENT("Kick &user"), 10, MENU_ITEM },
+ { LPGENW("Kick &user"), 10, MENU_ITEM },
{ NULL, 0, MENU_SEPARATOR },
- { LPGENT("Set &role"), 20, MENU_NEWPOPUP },
- { LPGENT("&Admin"), 30, MENU_POPUPITEM },
- { LPGENT("&User"), 40, MENU_POPUPITEM },
- { LPGENT("Change nick"), 50, MENU_ITEM },
+ { LPGENW("Set &role"), 20, MENU_NEWPOPUP },
+ { LPGENW("&Admin"), 30, MENU_POPUPITEM },
+ { LPGENW("&User"), 40, MENU_POPUPITEM },
+ { LPGENW("Change nick"), 50, MENU_ITEM },
};
gcmi->nItems = _countof(Items);
gcmi->Item = (gc_item*)Items;
diff --git a/protocols/SkypeWeb/src/skype_db.h b/protocols/SkypeWeb/src/skype_db.h
index 63a38ecadc..60a00b0ac5 100644
--- a/protocols/SkypeWeb/src/skype_db.h
+++ b/protocols/SkypeWeb/src/skype_db.h
@@ -41,11 +41,11 @@ struct CSkypeOptions
CMOption<BYTE> bMarkAllAsUnread;
CMOption<BYTE> bUseHostnameAsPlace;
- CMOption<TCHAR*> wstrPlace;
+ CMOption<wchar_t*> wstrPlace;
CMOption<BYTE> bUseBBCodes;
- CMOption<TCHAR*> wstrCListGroup;
+ CMOption<wchar_t*> wstrCListGroup;
CSkypeOptions(PROTO_INTERFACE *proto) :
diff --git a/protocols/SkypeWeb/src/skype_dialogs.cpp b/protocols/SkypeWeb/src/skype_dialogs.cpp
index 4624bb5c45..ecf870469d 100644
--- a/protocols/SkypeWeb/src/skype_dialogs.cpp
+++ b/protocols/SkypeWeb/src/skype_dialogs.cpp
@@ -45,7 +45,7 @@ void CSkypeInviteDlg::OnInitDialog()
{
if (!m_proto->isChatRoom(hContact))
{
- TCHAR *ptszNick = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *ptszNick = pcli->pfnGetContactDisplayName(hContact, 0);
m_combo.AddString(ptszNick, hContact);
}
}
diff --git a/protocols/SkypeWeb/src/skype_events.cpp b/protocols/SkypeWeb/src/skype_events.cpp
index f38ee7a8dd..cd72da2f78 100644
--- a/protocols/SkypeWeb/src/skype_events.cpp
+++ b/protocols/SkypeWeb/src/skype_events.cpp
@@ -73,7 +73,7 @@ INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam)
if (xmlDuration != NULL)
{
- callDuration = _ttol(xmlGetText(xmlDuration));
+ callDuration = _wtol(xmlGetText(xmlDuration));
break;
}
}
@@ -115,7 +115,7 @@ INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam)
HXML xmlNode = xmlGetNthChild(xml, L"file", i);
if (xmlNode != NULL)
{
- fileSize = _ttol(xmlGetAttrValue(xmlNode, L"size"));
+ fileSize = _wtol(xmlGetAttrValue(xmlNode, L"size"));
char *fileName = _T2A(xmlGetText(xmlNode));
if (fileName != NULL)
{
diff --git a/protocols/SkypeWeb/src/skype_files.cpp b/protocols/SkypeWeb/src/skype_files.cpp
index bc562a8746..2a2941bdfd 100644
--- a/protocols/SkypeWeb/src/skype_files.cpp
+++ b/protocols/SkypeWeb/src/skype_files.cpp
@@ -2,7 +2,7 @@
#define FILETRANSFER_FAILED(fup) { ProtoBroadcastAck(fup->hContact, ACKTYPE_FILE, ACKRESULT_FAILED, (HANDLE)fup); delete fup; fup = nullptr;}
-HANDLE CSkypeProto::SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles)
+HANDLE CSkypeProto::SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles)
{
if (IsOnline())
{
@@ -38,7 +38,7 @@ void CSkypeProto::OnASMObjectCreated(const NETLIBHTTPREQUEST *response, void *ar
JSONNode node = JSONNode::parse((char*)response->pData);
std::string strObjectId = node["id"].as_string();
fup->uid = mir_strdup(strObjectId.c_str());
- FILE *pFile = _tfopen(fup->tszFileName, L"rb");
+ FILE *pFile = _wfopen(fup->tszFileName, L"rb");
if (pFile == NULL) return;
fseek(pFile, 0, SEEK_END);
@@ -75,7 +75,7 @@ void CSkypeProto::OnASMObjectUploaded(const NETLIBHTTPREQUEST *response, void *a
return;
}
- TCHAR *tszFile = _tcsrchr(fup->tszFileName, L'\\') + 1;
+ wchar_t *tszFile = wcsrchr(fup->tszFileName, L'\\') + 1;
HXML xml = xmlCreateNode(L"URIObject", nullptr, 0);
xmlAddChild(xml, L"Title", tszFile);
diff --git a/protocols/SkypeWeb/src/skype_icons.cpp b/protocols/SkypeWeb/src/skype_icons.cpp
index c4c40d1219..18ab4ad130 100644
--- a/protocols/SkypeWeb/src/skype_icons.cpp
+++ b/protocols/SkypeWeb/src/skype_icons.cpp
@@ -19,20 +19,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
IconItemT CSkypeProto::Icons[] =
{
- { LPGENT("Protocol icon"), "main", IDI_SKYPE },
- { LPGENT("Create new chat icon"), "conference", IDI_CONFERENCE },
- { LPGENT("Sync history icon"), "synchistory", IDI_SYNCHISTORY },
- { LPGENT("Block user icon"), "user_block", IDI_BLOCKUSER },
- { LPGENT("Unblock user icon"), "user_unblock", IDI_UNBLOCKUSER },
- { LPGENT("Incoming call icon"), "inc_call", IDI_CALL },
- { LPGENT("Notification icon"), "notify", IDI_NOTIFY },
- { LPGENT("Error icon"), "error", IDI_ERRORICON },
- { LPGENT("Action icon"), "me_action", IDI_ACTION_ME }
+ { LPGENW("Protocol icon"), "main", IDI_SKYPE },
+ { LPGENW("Create new chat icon"), "conference", IDI_CONFERENCE },
+ { LPGENW("Sync history icon"), "synchistory", IDI_SYNCHISTORY },
+ { LPGENW("Block user icon"), "user_block", IDI_BLOCKUSER },
+ { LPGENW("Unblock user icon"), "user_unblock", IDI_UNBLOCKUSER },
+ { LPGENW("Incoming call icon"), "inc_call", IDI_CALL },
+ { LPGENW("Notification icon"), "notify", IDI_NOTIFY },
+ { LPGENW("Error icon"), "error", IDI_ERRORICON },
+ { LPGENW("Action icon"), "me_action", IDI_ACTION_ME }
};
void CSkypeProto::InitIcons()
{
- Icon_RegisterT(g_hInstance, LPGENT("Protocols") L"/" LPGENT(MODULE), Icons, _countof(Icons), MODULE);
+ Icon_RegisterT(g_hInstance, LPGENW("Protocols") L"/" MODULEW, Icons, _countof(Icons), MODULE);
}
HICON CSkypeProto::GetIcon(int iconId)
diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp
index 7909698b37..e2d820eb75 100644
--- a/protocols/SkypeWeb/src/skype_login.cpp
+++ b/protocols/SkypeWeb/src/skype_login.cpp
@@ -236,7 +236,7 @@ void CSkypeProto::SendPresence(bool isLogin)
epname = mir_utf8encodeT(m_opts.wstrPlace);
else
{
- TCHAR compName[MAX_COMPUTERNAME_LENGTH + 1];
+ wchar_t compName[MAX_COMPUTERNAME_LENGTH + 1];
DWORD size = _countof(compName);
GetComputerName(compName, &size);
epname = mir_utf8encodeT(compName);
diff --git a/protocols/SkypeWeb/src/skype_menus.cpp b/protocols/SkypeWeb/src/skype_menus.cpp
index 6e612c60ce..8ad180448e 100644
--- a/protocols/SkypeWeb/src/skype_menus.cpp
+++ b/protocols/SkypeWeb/src/skype_menus.cpp
@@ -65,7 +65,7 @@ void CSkypeProto::InitMenus()
// Request authorization
mi.pszService = MODULE"/RequestAuth";
- mi.name.t = LPGENT("Request authorization");
+ mi.name.w = LPGENW("Request authorization");
mi.position = CMI_POSITION + CMI_AUTH_REQUEST;
mi.hIcolibItem = ::Skin_GetIconHandle(SKINICON_AUTH_REQUEST);
SET_UID(mi, 0x36375a1f, 0xc142, 0x4d6e, 0xa6, 0x57, 0xe4, 0x76, 0x5d, 0xbc, 0x59, 0x8e);
@@ -74,7 +74,7 @@ void CSkypeProto::InitMenus()
// Grant authorization
mi.pszService = MODULE"/GrantAuth";
- mi.name.t = LPGENT("Grant authorization");
+ mi.name.w = LPGENW("Grant authorization");
mi.position = CMI_POSITION + CMI_AUTH_GRANT;
mi.hIcolibItem = ::Skin_GetIconHandle(SKINICON_AUTH_GRANT);
SET_UID(mi, 0x4c90452a, 0x869a, 0x4a81, 0xaf, 0xa8, 0x28, 0x34, 0xaf, 0x2b, 0x6b, 0x30);
@@ -82,7 +82,7 @@ void CSkypeProto::InitMenus()
CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::OnGrantAuth>);
mi.pszService = MODULE"/GetHistory";
- mi.name.t = LPGENT("Get server history");
+ mi.name.w = LPGENW("Get server history");
mi.position = CMI_POSITION + CMI_GETSERVERHISTORY;
mi.hIcolibItem = GetIconHandle(IDI_SYNCHISTORY);
SET_UID(mi, 0xc9a64e98, 0x9257, 0x4b52, 0x98, 0xdd, 0x7f, 0x56, 0xb3, 0x90, 0xe3, 0xde);
@@ -90,7 +90,7 @@ void CSkypeProto::InitMenus()
CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::GetContactHistory>);
mi.pszService = MODULE"/BlockContact";
- mi.name.t = LPGENT("Block contact");
+ mi.name.w = LPGENW("Block contact");
mi.position = CMI_POSITION + CMI_BLOCK;
mi.hIcolibItem = GetIconHandle(IDI_BLOCKUSER);
SET_UID(mi ,0xc6169b8f, 0x53ab, 0x4242, 0xbe, 0x90, 0xe2, 0x4a, 0xa5, 0x73, 0x88, 0x32);
@@ -98,7 +98,7 @@ void CSkypeProto::InitMenus()
CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::BlockContact>);
mi.pszService = MODULE"/UnblockContact";
- mi.name.t = LPGENT("Unblock contact");
+ mi.name.w = LPGENW("Unblock contact");
mi.position = CMI_POSITION + CMI_UNBLOCK;
mi.hIcolibItem = GetIconHandle(IDI_UNBLOCKUSER);
SET_UID(mi, 0x88542f43, 0x7448, 0x48d0, 0x81, 0xa3, 0x26, 0x0, 0x4f, 0x37, 0xee, 0xe0);
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp
index cc9ac8e2ca..4d35393d12 100644
--- a/protocols/SkypeWeb/src/skype_messages.cpp
+++ b/protocols/SkypeWeb/src/skype_messages.cpp
@@ -290,14 +290,14 @@ void CSkypeProto::ProcessContactRecv(MCONTACT hContact, time_t timestamp, const
HXML xmlContact = xmlGetNthChild(xmlNode, L"c", i);
if (xmlContact != NULL)
{
- const TCHAR *tszContactId = xmlGetAttrValue(xmlContact, L"s");
- //const TCHAR *tszContactName = xmlGetAttrValue(xmlContact, L"f");
+ const wchar_t *tszContactId = xmlGetAttrValue(xmlContact, L"s");
+ //const wchar_t *tszContactName = xmlGetAttrValue(xmlContact, L"f");
psr[nCount] = (PROTOSEARCHRESULT*)mir_calloc(sizeof(PROTOSEARCHRESULT));
psr[nCount]->cbSize = sizeof(psr);
psr[nCount]->flags = PSR_TCHAR;
- psr[nCount]->id.t = mir_tstrdup(tszContactId);
- //psr[nCount]->nick.t = mir_tstrdup(tszContactName == NULL ? L"" : tszContactName);
+ psr[nCount]->id.w = mir_tstrdup(tszContactId);
+ //psr[nCount]->nick.w = mir_tstrdup(tszContactName == NULL ? L"" : tszContactName);
nCount++;
}
}
@@ -319,7 +319,7 @@ void CSkypeProto::ProcessContactRecv(MCONTACT hContact, time_t timestamp, const
ProtoChainRecv(hContact, PSR_CONTACTS, 0, (LPARAM)&pre);
for (DWORD i = 0; i < *((PDWORD)b); i++)
{
- mir_free(psr[i]->id.t);
+ mir_free(psr[i]->id.w);
mir_free(psr[i]);
}
mir_free(b);
diff --git a/protocols/SkypeWeb/src/skype_options.cpp b/protocols/SkypeWeb/src/skype_options.cpp
index fc6136012c..2026a509eb 100644
--- a/protocols/SkypeWeb/src/skype_options.cpp
+++ b/protocols/SkypeWeb/src/skype_options.cpp
@@ -72,11 +72,11 @@ int CSkypeProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
odp.hInstance = g_hInstance;
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.ptszGroup = LPGENT("Network");
+ odp.pwszGroup = LPGENW("Network");
- odp.ptszTab = LPGENT("Account");
+ odp.pwszTab = LPGENW("Account");
odp.pDialog = CSkypeOptionsMain::CreateOptionsPage(this);
Options_AddPage(wParam, &odp);
diff --git a/protocols/SkypeWeb/src/skype_popups.cpp b/protocols/SkypeWeb/src/skype_popups.cpp
index 49a7b40d60..65e5bb3487 100644
--- a/protocols/SkypeWeb/src/skype_popups.cpp
+++ b/protocols/SkypeWeb/src/skype_popups.cpp
@@ -2,7 +2,7 @@
void CSkypeProto::InitPopups()
{
- TCHAR desc[256];
+ wchar_t desc[256];
char name[256];
POPUPCLASS ppc = { sizeof(ppc) };
ppc.flags = PCF_TCHAR;
@@ -47,7 +47,7 @@ void CSkypeProto::UninitPopups()
}
}
-void CSkypeProto::ShowNotification(const TCHAR *caption, const TCHAR *message, MCONTACT hContact, int type)
+void CSkypeProto::ShowNotification(const wchar_t *caption, const wchar_t *message, MCONTACT hContact, int type)
{
if (Miranda_Terminated())
return;
@@ -75,8 +75,8 @@ void CSkypeProto::ShowNotification(const TCHAR *caption, const TCHAR *message, M
}
POPUPDATACLASS ppd = { sizeof(ppd) };
- ppd.ptszTitle = caption;
- ppd.ptszText = message;
+ ppd.pwszTitle = caption;
+ ppd.pwszText = message;
ppd.pszClassName = className.GetBuffer();
ppd.hContact = hContact;
@@ -88,7 +88,7 @@ void CSkypeProto::ShowNotification(const TCHAR *caption, const TCHAR *message, M
}
}
-void CSkypeProto::ShowNotification(const TCHAR *message, MCONTACT hContact)
+void CSkypeProto::ShowNotification(const wchar_t *message, MCONTACT hContact)
{
ShowNotification(_T(MODULE), message, hContact);
}
diff --git a/protocols/SkypeWeb/src/skype_profile.cpp b/protocols/SkypeWeb/src/skype_profile.cpp
index fff14b059f..2c4678a93a 100644
--- a/protocols/SkypeWeb/src/skype_profile.cpp
+++ b/protocols/SkypeWeb/src/skype_profile.cpp
@@ -17,11 +17,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-std::map<std::tstring, std::tstring> CSkypeProto::languages;
+std::map<std::wstring, std::wstring> CSkypeProto::languages;
void CSkypeProto::InitLanguages()
{
- std::map<std::tstring, std::tstring> result;
+ std::map<std::wstring, std::wstring> result;
result[L"ab"] = L"Abkhazian";
result[L"aa"] = L"Afar";
result[L"af"] = L"Afrikaans";
@@ -288,7 +288,7 @@ void CSkypeProto::UpdateProfileGender(const JSONNode &root, MCONTACT hContact)
{
CMString gender = root["gender"].as_mstring();
if (!gender.IsEmpty() && gender != "null")
- setByte(hContact, "Gender", (BYTE)(_ttoi(gender) == 1 ? 'M' : 'F'));
+ setByte(hContact, "Gender", (BYTE)(_wtoi(gender) == 1 ? 'M' : 'F'));
else
delSetting(hContact, "Gender");
}
@@ -299,7 +299,7 @@ void CSkypeProto::UpdateProfileBirthday(const JSONNode &root, MCONTACT hContact)
if (!birthday.IsEmpty() && birthday != "null")
{
int d, m, y;
- _stscanf(birthday.GetBuffer(), L"%d-%d-%d", &y, &m, &d);
+ swscanf(birthday.GetBuffer(), L"%d-%d-%d", &y, &m, &d);
setWord(hContact, "BirthYear", y);
setByte(hContact, "BirthDay", d);
setByte(hContact, "BirthMonth", m);
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp
index a4ff764aef..cf003bdb17 100644
--- a/protocols/SkypeWeb/src/skype_proto.cpp
+++ b/protocols/SkypeWeb/src/skype_proto.cpp
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-CSkypeProto::CSkypeProto(const char* protoName, const TCHAR* userName) :
+CSkypeProto::CSkypeProto(const char* protoName, const wchar_t* userName) :
PROTO<CSkypeProto>(protoName, userName),
m_PopupClasses(1),
m_InviteDialogs(1),
@@ -42,7 +42,7 @@ CSkypeProto::CSkypeProto(const char* protoName, const TCHAR* userName) :
CreateProtoService("/IncomingCallCLE", &CSkypeProto::OnIncomingCallCLE);
CreateProtoService("/IncomingCallPP", &CSkypeProto::OnIncomingCallPP);
- m_tszAvatarFolder = std::tstring(VARST(L"%miranda_avatarcache%")) + L"\\" + m_tszUserName;
+ m_tszAvatarFolder = std::wstring(VARST(L"%miranda_avatarcache%")) + L"\\" + m_tszUserName;
DWORD dwAttributes = GetFileAttributes(m_tszAvatarFolder.c_str());
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
CreateDirectoryTreeT(m_tszAvatarFolder.c_str());
@@ -114,7 +114,7 @@ DWORD_PTR CSkypeProto::GetCaps(int type, MCONTACT)
return 0;
}
-int CSkypeProto::SetAwayMsg(int, const TCHAR *msg)
+int CSkypeProto::SetAwayMsg(int, const wchar_t *msg)
{
PushRequest(new SetStatusMsgRequest(msg ? T2Utf(msg) : "", li));
return 0;
@@ -148,7 +148,7 @@ MCONTACT CSkypeProto::AddToList(int, PROTOSEARCHRESULT *psr)
MCONTACT hContact;
if (psr->flags & PSR_UNICODE)
- hContact = AddContact(T2Utf(psr->id.t));
+ hContact = AddContact(T2Utf(psr->id.w));
else
hContact = AddContact(psr->id.a);
@@ -186,7 +186,7 @@ int CSkypeProto::Authorize(MEVENT hDbEvent)
return 0;
}
-int CSkypeProto::AuthDeny(MEVENT hDbEvent, const TCHAR*)
+int CSkypeProto::AuthDeny(MEVENT hDbEvent, const wchar_t*)
{
MCONTACT hContact = GetContactFromAuthEvent(hDbEvent);
if (hContact == INVALID_CONTACT_ID)
@@ -201,7 +201,7 @@ int CSkypeProto::AuthRecv(MCONTACT, PROTORECVEVENT* pre)
return Proto_AuthRecv(m_szModuleName, pre);
}
-int CSkypeProto::AuthRequest(MCONTACT hContact, const TCHAR *szMessage)
+int CSkypeProto::AuthRequest(MCONTACT hContact, const wchar_t *szMessage)
{
if (hContact == INVALID_CONTACT_ID)
return 1;
@@ -329,16 +329,16 @@ int CSkypeProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre)
//if (GetMessageFromDb(hContact, szMessageId, pre->timestamp)) return 0;
for (i = 0; i < nCount; i++)
- cbBlob += int(/*mir_tstrlen(isrList[i]->nick.t)*/0 + 2 + mir_tstrlen(isrList[i]->id.t) + mir_strlen(szMessageId));
+ cbBlob += int(/*mir_tstrlen(isrList[i]->nick.w)*/0 + 2 + mir_tstrlen(isrList[i]->id.w) + mir_strlen(szMessageId));
pBlob = (PBYTE)mir_calloc(cbBlob);
for (i = 0, pCurBlob = pBlob; i < nCount; i++)
{
- //mir_strcpy((char*)pCurBlob, _T2A(isrList[i]->nick.t));
+ //mir_strcpy((char*)pCurBlob, _T2A(isrList[i]->nick.w));
pCurBlob += mir_strlen((PCHAR)pCurBlob) + 1;
- mir_strcpy((char*)pCurBlob, _T2A(isrList[i]->id.t));
+ mir_strcpy((char*)pCurBlob, _T2A(isrList[i]->id.w));
pCurBlob += mir_strlen((char*)pCurBlob) + 1;
}
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h
index 94f0aa43a6..37320a43d6 100644
--- a/protocols/SkypeWeb/src/skype_proto.h
+++ b/protocols/SkypeWeb/src/skype_proto.h
@@ -41,24 +41,24 @@ public:
virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent);
- virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage);
+ virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t* szMessage);
virtual int __cdecl Authorize(MEVENT hDbEvent);
- virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR* szReason);
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t* szReason);
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
virtual int __cdecl GetInfo(MCONTACT hContact, int infoType);
- virtual HANDLE __cdecl SearchBasic(const TCHAR* id);
+ virtual HANDLE __cdecl SearchBasic(const wchar_t* id);
virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg);
virtual int __cdecl SetStatus(int iNewStatus);
virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
virtual int __cdecl OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam);
virtual int __cdecl RecvContacts(MCONTACT hContact, PROTORECVEVENT*);
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles);
+ virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles);
virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
- virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg);
+ virtual int __cdecl SetAwayMsg(int m_iStatus, const wchar_t *msg);
// accounts
- static CSkypeProto* InitAccount(const char *protoName, const TCHAR *userName);
+ static CSkypeProto* InitAccount(const char *protoName, const wchar_t *userName);
static int UninitAccount(CSkypeProto *proto);
// icons
@@ -137,7 +137,7 @@ private:
std::map<HANDLE, time_t> m_mpOutMessages;
std::map<std::string, std::string> cookies;
- static std::map<std::tstring, std::tstring> languages;
+ static std::map<std::wstring, std::wstring> languages;
HANDLE m_pollingConnection,
m_hPollingThread,
@@ -174,14 +174,14 @@ private:
INT_PTR __cdecl OnAccountManagerInit(WPARAM, LPARAM);
- std::tstring m_tszAvatarFolder;
+ std::wstring m_tszAvatarFolder;
INT_PTR __cdecl SvcGetAvatarInfo(WPARAM, LPARAM);
INT_PTR __cdecl SvcGetAvatarCaps(WPARAM, LPARAM);
INT_PTR __cdecl SvcGetMyAvatar(WPARAM, LPARAM);
INT_PTR __cdecl SvcSetMyAvatar(WPARAM, LPARAM);
- int InternalSetAvatar(MCONTACT hContact, const char *szJid, const TCHAR *ptszFileName);
+ int InternalSetAvatar(MCONTACT hContact, const char *szJid, const wchar_t *ptszFileName);
// requests
@@ -282,7 +282,7 @@ private:
void SetAvatarUrl(MCONTACT hContact, CMString &tszUrl);
void ReloadAvatarInfo(MCONTACT hContact);
- void GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen);
+ void GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen);
void OnReceiveAvatar(const NETLIBHTTPREQUEST *response, void *arg);
void OnSentAvatar(const NETLIBHTTPREQUEST *response);
@@ -339,17 +339,17 @@ private:
INT_PTR __cdecl OnJoinChatRoom(WPARAM hContact, LPARAM);
INT_PTR __cdecl OnLeaveChatRoom(WPARAM hContact, LPARAM);
- void StartChatRoom(const TCHAR *tid, const TCHAR *tname);
+ void StartChatRoom(const wchar_t *tid, const wchar_t *tname);
void OnLoadChats(const NETLIBHTTPREQUEST *response);
void OnGetChatInfo(const NETLIBHTTPREQUEST *response, void *p);
void OnChatEvent(const JSONNode &node);
- void OnSendChatMessage(const TCHAR *chat_id, const TCHAR * tszMessage);
- char *GetChatUsers(const TCHAR *chat_id);
- bool IsChatContact(const TCHAR *chat_id, const char *id);
- void AddMessageToChat(const TCHAR *chat_id, const TCHAR *from, const char *content, bool isAction, int emoteOffset, time_t timestamp, bool isLoading = false);
- void AddChatContact(const TCHAR *tchat_id, const char *id, const char *name, const TCHAR *role, bool isChange = false);
- void RemoveChatContact(const TCHAR *tchat_id, const char *id, const char *name, bool isKick = false, const char *initiator = "");
+ void OnSendChatMessage(const wchar_t *chat_id, const wchar_t * tszMessage);
+ char *GetChatUsers(const wchar_t *chat_id);
+ bool IsChatContact(const wchar_t *chat_id, const char *id);
+ void AddMessageToChat(const wchar_t *chat_id, const wchar_t *from, const char *content, bool isAction, int emoteOffset, time_t timestamp, bool isLoading = false);
+ void AddChatContact(const wchar_t *tchat_id, const char *id, const char *name, const wchar_t *role, bool isChange = false);
+ void RemoveChatContact(const wchar_t *tchat_id, const char *id, const char *name, bool isKick = false, const char *initiator = "");
void RenameChat(const char *chat_id, const char *name);
void ChangeChatTopic(const char * chat_id, const char *topic, const char *initiator);
@@ -389,9 +389,9 @@ private:
static int SkypeToMirandaStatus(const char *status);
static const char *MirandaToSkypeStatus(int status);
- void ShowNotification(const TCHAR *message, MCONTACT hContact = NULL);
- void ShowNotification(const TCHAR *caption, const TCHAR *message, MCONTACT hContact = NULL, int type = 0);
- static bool IsFileExists(std::tstring path);
+ void ShowNotification(const wchar_t *message, MCONTACT hContact = NULL);
+ void ShowNotification(const wchar_t *caption, const wchar_t *message, MCONTACT hContact = NULL, int type = 0);
+ static bool IsFileExists(std::wstring path);
static LRESULT CALLBACK PopupDlgProcCall(HWND hPopup, UINT uMsg, WPARAM wParam, LPARAM lParam);
diff --git a/protocols/SkypeWeb/src/skype_search.cpp b/protocols/SkypeWeb/src/skype_search.cpp
index 7c7637abdc..427cab89ad 100644
--- a/protocols/SkypeWeb/src/skype_search.cpp
+++ b/protocols/SkypeWeb/src/skype_search.cpp
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-HANDLE CSkypeProto::SearchBasic(const TCHAR* id)
+HANDLE CSkypeProto::SearchBasic(const wchar_t* id)
{
ForkThread(&CSkypeProto::SearchBasicThread, (void *)id);
return (HANDLE)1;
@@ -28,7 +28,7 @@ void CSkypeProto::SearchBasicThread(void* id)
debugLogA("CSkypeProto::OnSearchBasicThread");
if (IsOnline())
{
- ptrA szString(mir_urlEncode(T2Utf((TCHAR*)id)));
+ ptrA szString(mir_urlEncode(T2Utf((wchar_t*)id)));
SendRequest(new GetSearchRequest(szString, li), &CSkypeProto::OnSearch);
}
}
diff --git a/protocols/SkypeWeb/src/skype_utils.cpp b/protocols/SkypeWeb/src/skype_utils.cpp
index 58d0ad84e4..42fe0bf575 100644
--- a/protocols/SkypeWeb/src/skype_utils.cpp
+++ b/protocols/SkypeWeb/src/skype_utils.cpp
@@ -32,7 +32,7 @@ time_t CSkypeProto::IsoToUnixTime(const char *stamp)
// skip '-' chars
int si = 0, sj = 0;
while (true) {
- if (p[si] == _T('-'))
+ if (p[si] == '-')
si++;
else if (!(p[sj++] = p[si++]))
break;
@@ -426,9 +426,9 @@ int CSkypeProto::SkypeToMirandaStatus(const char *status)
return ID_STATUS_OFFLINE;
}
-bool CSkypeProto::IsFileExists(std::tstring path)
+bool CSkypeProto::IsFileExists(std::wstring path)
{
- return _taccess(path.c_str(), 0) == 0;
+ return _waccess(path.c_str(), 0) == 0;
}
// url parsing
@@ -480,14 +480,14 @@ CMStringA CSkypeProto::GetServerFromUrl(const char *url)
INT_PTR CSkypeProto::ParseSkypeUriService(WPARAM, LPARAM lParam)
{
- TCHAR *arg = (TCHAR *)lParam;
+ wchar_t *arg = (wchar_t *)lParam;
if (arg == NULL)
return 1;
// skip leading prefix
- TCHAR szUri[1024];
- _tcsncpy_s(szUri, arg, _TRUNCATE);
- TCHAR *szJid = _tcschr(szUri, _T(':'));
+ wchar_t szUri[1024];
+ wcsncpy_s(szUri, arg, _TRUNCATE);
+ wchar_t *szJid = wcschr(szUri, ':');
if (szJid == NULL)
return 1;
@@ -496,13 +496,13 @@ INT_PTR CSkypeProto::ParseSkypeUriService(WPARAM, LPARAM lParam)
return 1;
// command code
- TCHAR *szCommand = szJid;
- szCommand = _tcschr(szCommand, _T('?'));
+ wchar_t *szCommand = szJid;
+ szCommand = wcschr(szCommand, '?');
if (szCommand)
*(szCommand++) = 0;
// parameters
- TCHAR *szSecondParam = szCommand ? _tcschr(szCommand, _T('&')) : NULL;
+ wchar_t *szSecondParam = szCommand ? wcschr(szCommand, '&') : NULL;
if (szSecondParam)
*(szSecondParam++) = 0;
@@ -511,7 +511,7 @@ INT_PTR CSkypeProto::ParseSkypeUriService(WPARAM, LPARAM lParam)
{
if (szSecondParam)
{
- TCHAR *szChatId = _tcsstr(szSecondParam, L"id=");
+ wchar_t *szChatId = wcsstr(szSecondParam, L"id=");
if (szChatId)
{
szChatId += 5;
@@ -537,8 +537,8 @@ INT_PTR CSkypeProto::ParseSkypeUriService(WPARAM, LPARAM lParam)
{
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
- psr.id.t = mir_tstrdup(szJid);
- psr.nick.t = mir_tstrdup(szJid);
+ psr.id.w = mir_tstrdup(szJid);
+ psr.nick.w = mir_tstrdup(szJid);
psr.flags = PSR_UNICODE;
ADDCONTACTSTRUCT acs = { 0 };
diff --git a/protocols/SkypeWeb/src/skype_utils.h b/protocols/SkypeWeb/src/skype_utils.h
index afb15d7d91..45e57d6311 100644
--- a/protocols/SkypeWeb/src/skype_utils.h
+++ b/protocols/SkypeWeb/src/skype_utils.h
@@ -97,8 +97,8 @@ struct CFileUploadParam : public MZeroedObject {
size_t size;
MCONTACT hContact;
- __forceinline CFileUploadParam(MCONTACT _hContact, const TCHAR* _desc, TCHAR** _files) : hContact(_hContact), tszDesc(mir_tstrdup(_desc)), tszFileName(mir_tstrdup(_files[0])) {};
- __forceinline bool IsAccess() { return ::_taccess(tszFileName, 0) == 0; }
+ __forceinline CFileUploadParam(MCONTACT _hContact, const wchar_t* _desc, wchar_t** _files) : hContact(_hContact), tszDesc(mir_tstrdup(_desc)), tszFileName(mir_tstrdup(_files[0])) {};
+ __forceinline bool IsAccess() { return ::_waccess(tszFileName, 0) == 0; }
};
diff --git a/protocols/SkypeWeb/src/stdafx.h b/protocols/SkypeWeb/src/stdafx.h
index 4f33cf6d1a..005f61f945 100644
--- a/protocols/SkypeWeb/src/stdafx.h
+++ b/protocols/SkypeWeb/src/stdafx.h
@@ -191,6 +191,7 @@ public:
#define MODULE "Skype"
+#define MODULEW L"Skype"
#define SKYPE_MAX_CONNECT_RETRIES 10
diff --git a/protocols/Steam/src/stdafx.h b/protocols/Steam/src/stdafx.h
index 44e3dfc893..2ebe847089 100644
--- a/protocols/Steam/src/stdafx.h
+++ b/protocols/Steam/src/stdafx.h
@@ -41,6 +41,7 @@
#include "version.h"
#define MODULE "Steam"
+#define MODULEW L"Steam"
#define STEAM_API_TIMEOUT 30
#define STEAM_API_IDLEOUT_AWAY 600
diff --git a/protocols/Steam/src/steam_avatars.cpp b/protocols/Steam/src/steam_avatars.cpp
index ad2348463d..8b852a8fed 100644
--- a/protocols/Steam/src/steam_avatars.cpp
+++ b/protocols/Steam/src/steam_avatars.cpp
@@ -1,8 +1,8 @@
#include "stdafx.h"
-TCHAR* CSteamProto::GetAvatarFilePath(MCONTACT hContact)
+wchar_t* CSteamProto::GetAvatarFilePath(MCONTACT hContact)
{
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
mir_sntprintf(path, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
DWORD dwAttributes = GetFileAttributes(path);
@@ -24,7 +24,7 @@ bool CSteamProto::GetDbAvatarInfo(PROTO_AVATAR_INFORMATION &pai)
if (!path)
return false;
- _tcsncpy_s(pai.filename, path, _TRUNCATE);
+ wcsncpy_s(pai.filename, path, _TRUNCATE);
pai.format = PA_FORMAT_JPEG;
return true;
@@ -68,7 +68,7 @@ INT_PTR CSteamProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
if (GetDbAvatarInfo(*pai))
{
- bool fileExist = _taccess(pai->filename, 0) == 0;
+ bool fileExist = _waccess(pai->filename, 0) == 0;
bool needLoad;
if (pai->hContact)
@@ -141,13 +141,13 @@ INT_PTR CSteamProto::GetMyAvatar(WPARAM wParam, LPARAM lParam)
if (!wParam || !lParam)
return -3;
- TCHAR* buf = (TCHAR*)wParam;
+ wchar_t* buf = (wchar_t*)wParam;
int size = (int)lParam;
PROTO_AVATAR_INFORMATION ai = { 0 };
switch (GetAvatarInfo(0, (LPARAM)&ai)) {
case GAIR_SUCCESS:
- _tcsncpy(buf, ai.filename, size);
+ wcsncpy(buf, ai.filename, size);
buf[size - 1] = 0;
return 0;
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp
index de1253ad2e..3cbdb66c21 100644
--- a/protocols/Steam/src/steam_contacts.cpp
+++ b/protocols/Steam/src/steam_contacts.cpp
@@ -110,11 +110,11 @@ void CSteamProto::UpdateContact(MCONTACT hContact, JSONNode *data)
node = json_get(data, "realname");
if (node != NULL)
{
- std::tstring realname = (TCHAR*)ptrT(json_as_string(node));
+ std::wstring realname = (wchar_t*)ptrT(json_as_string(node));
if (!realname.empty())
{
size_t pos = realname.find(L' ', 1);
- if (pos != std::tstring::npos)
+ if (pos != std::wstring::npos)
{
setTString(hContact, "FirstName", realname.substr(0, pos).c_str());
setTString(hContact, "LastName", realname.substr(pos + 1).c_str());
@@ -265,7 +265,7 @@ void CSteamProto::ContactIsRemoved(MCONTACT hContact)
SetContactStatus(hContact, ID_STATUS_OFFLINE);
ptrT nick(getTStringA(hContact, "Nick"));
- TCHAR message[MAX_PATH];
+ wchar_t message[MAX_PATH];
mir_sntprintf(message, MAX_PATH, TranslateT("%s has been removed from your contact list"), nick);
ShowNotification(L"Steam", message);
@@ -283,7 +283,7 @@ void CSteamProto::ContactIsFriend(MCONTACT hContact)
delSetting(hContact, "Grant");
ptrT nick(getTStringA(hContact, "Nick"));
- TCHAR message[MAX_PATH];
+ wchar_t message[MAX_PATH];
mir_sntprintf(message, MAX_PATH, TranslateT("%s is back in your contact list"), nick);
ShowNotification(L"Steam", message);
@@ -602,7 +602,7 @@ void CSteamProto::OnGotAvatar(const HttpResponse *response, void *arg)
return;
}
- FILE *fp = _tfopen(ai.filename, L"wb");
+ FILE *fp = _wfopen(ai.filename, L"wb");
if (fp)
{
fwrite(response->pData, sizeof(char), response->dataLength, fp);
@@ -763,25 +763,25 @@ void CSteamProto::OnSearchResults(const HttpResponse *response, void *arg)
ssr.hdr.flags = PSR_TCHAR;
node = json_get(child, "steamid");
- ssr.hdr.id.t = mir_tstrdup(ptrT(json_as_string(node)));
+ ssr.hdr.id.w = mir_tstrdup(ptrT(json_as_string(node)));
node = json_get(child, "personaname");
- ssr.hdr.nick.t = mir_tstrdup(ptrT(json_as_string(node)));
+ ssr.hdr.nick.w = mir_tstrdup(ptrT(json_as_string(node)));
node = json_get(child, "realname");
if (node != NULL)
{
- std::tstring realname = (TCHAR*)ptrT(json_as_string(node));
+ std::wstring realname = (wchar_t*)ptrT(json_as_string(node));
if (!realname.empty())
{
size_t pos = realname.find(' ', 1);
- if (pos != std::tstring::npos)
+ if (pos != std::wstring::npos)
{
- ssr.hdr.firstName.t = mir_tstrdup(realname.substr(0, pos).c_str());
- ssr.hdr.lastName.t = mir_tstrdup(realname.substr(pos + 1).c_str());
+ ssr.hdr.firstName.w = mir_tstrdup(realname.substr(0, pos).c_str());
+ ssr.hdr.lastName.w = mir_tstrdup(realname.substr(pos + 1).c_str());
}
else
- ssr.hdr.firstName.t = mir_tstrdup(realname.c_str());
+ ssr.hdr.firstName.w = mir_tstrdup(realname.c_str());
}
}
diff --git a/protocols/Steam/src/steam_events.cpp b/protocols/Steam/src/steam_events.cpp
index c416cbd957..9caa7091b9 100644
--- a/protocols/Steam/src/steam_events.cpp
+++ b/protocols/Steam/src/steam_events.cpp
@@ -34,15 +34,15 @@ int CSteamProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = g_hInstance;
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.ptszGroup = LPGENT("Network");
+ odp.pwszGroup = LPGENW("Network");
- odp.ptszTab = LPGENT("Account");
+ odp.pwszTab = LPGENW("Account");
odp.pDialog = CSteamOptionsMain::CreateOptionsPage(this);
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Blocked contacts");
+ odp.pwszTab = LPGENW("Blocked contacts");
odp.pDialog = CSteamOptionsBlockList::CreateOptionsPage(this);
Options_AddPage(wParam, &odp);
return 0;
diff --git a/protocols/Steam/src/steam_history.cpp b/protocols/Steam/src/steam_history.cpp
index 75e40a5674..8a16ee5bf3 100644
--- a/protocols/Steam/src/steam_history.cpp
+++ b/protocols/Steam/src/steam_history.cpp
@@ -28,13 +28,13 @@ void CSteamProto::OnGotConversations(const HttpResponse *response)
JSONNode *session = json_at(nsessions, i);
node = json_get(session, "accountid_friend");
- const char *who = AccountIdToSteamId(_ttoi64(ptrT(json_as_string(node))));
+ const char *who = AccountIdToSteamId(_wtoi64(ptrT(json_as_string(node))));
node = json_get(session, "last_message");
- time_t lastMessageTS = _ttoi64(ptrT(json_as_string(node)));
+ time_t lastMessageTS = _wtoi64(ptrT(json_as_string(node)));
/*node = json_get(session, "last_view");
- time_t last_view = _ttoi64(ptrT(json_as_string(node)));
+ time_t last_view = _wtoi64(ptrT(json_as_string(node)));
node = json_get(session, "unread_message_count");
long unread_count = json_as_int(node);*/
@@ -79,14 +79,14 @@ void CSteamProto::OnGotHistoryMessages(const HttpResponse *response, void *arg)
JSONNode *message = json_at(nmessages, i - 1);
node = json_get(message, "accountid");
- const char *authorSteamId = AccountIdToSteamId(_ttoi64(ptrT(json_as_string(node))));
+ const char *authorSteamId = AccountIdToSteamId(_wtoi64(ptrT(json_as_string(node))));
node = json_get(message, "message");
ptrT text(json_as_string(node));
T2Utf szMessage(text);
node = json_get(message, "timestamp");
- time_t timestamp = _ttoi64(ptrT(json_as_string(node)));
+ time_t timestamp = _wtoi64(ptrT(json_as_string(node)));
// Ignore already existing messages
if (timestamp <= m_lastMessageTS)
diff --git a/protocols/Steam/src/steam_login.cpp b/protocols/Steam/src/steam_login.cpp
index fd8d7399f7..15fb3d6483 100644
--- a/protocols/Steam/src/steam_login.cpp
+++ b/protocols/Steam/src/steam_login.cpp
@@ -383,7 +383,7 @@ void CSteamProto::OnLoggedOn(const HttpResponse *response)
if (m_lastMessageTS <= 0) {
node = json_get(root, "utc_timestamp");
- time_t timestamp = _ttoi64(ptrT(json_as_string(node)));
+ time_t timestamp = _wtoi64(ptrT(json_as_string(node)));
setDword("LastMessageTS", timestamp);
}
diff --git a/protocols/Steam/src/steam_menus.cpp b/protocols/Steam/src/steam_menus.cpp
index e2c4fcd5b7..c6252dc81b 100644
--- a/protocols/Steam/src/steam_menus.cpp
+++ b/protocols/Steam/src/steam_menus.cpp
@@ -103,7 +103,7 @@ void CSteamProto::OnInitStatusMenu()
// Show block list
mi.pszService = "/BlockList";
CreateProtoService(mi.pszService, &CSteamProto::OpenBlockListCommand);
- mi.name.t = LPGENT("Blocked contacts");
+ mi.name.w = LPGENW("Blocked contacts");
mi.position = 200000 + SMI_BLOCKED_LIST;
Menu_AddProtoMenuItem(&mi, m_szModuleName);
}
@@ -120,7 +120,7 @@ void CSteamProto::InitMenus()
// "Request authorization"
SET_UID(mi, 0x36375a1f, 0xc142, 0x4d6e, 0xa6, 0x57, 0xe4, 0x76, 0x5d, 0xbc, 0x59, 0x8e);
mi.pszService = MODULE "/AuthRequest";
- mi.name.t = LPGENT("Request authorization");
+ mi.name.w = LPGENW("Request authorization");
mi.position = -201001000 + CMI_AUTH_REQUEST;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_AUTH_REQUEST);
contactMenuItems[CMI_AUTH_REQUEST] = Menu_AddContactMenuItem(&mi);
@@ -129,7 +129,7 @@ void CSteamProto::InitMenus()
// "Block"
SET_UID(mi, 0xc6169b8f, 0x53ab, 0x4242, 0xbe, 0x90, 0xe2, 0x4a, 0xa5, 0x73, 0x88, 0x32);
mi.pszService = MODULE "/Block";
- mi.name.t = LPGENT("Block");
+ mi.name.w = LPGENW("Block");
mi.position = -201001001 + CMI_BLOCK;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_AUTH_REQUEST);
contactMenuItems[CMI_BLOCK] = Menu_AddContactMenuItem(&mi);
@@ -140,7 +140,7 @@ void CSteamProto::InitMenus()
// "Join to game"
SET_UID(mi, 0x1a6aaab7, 0xba31, 0x4b47, 0x8e, 0xce, 0xf8, 0x8e, 0xf4, 0x62, 0x4f, 0xd7);
mi.pszService = MODULE "/JoinToGame";
- mi.name.t = LPGENT("Join to game");
+ mi.name.w = LPGENW("Join to game");
mi.position = -200001000 + CMI_JOIN_GAME;
mi.hIcolibItem = NULL;
contactMenuItems[CMI_JOIN_GAME] = Menu_AddContactMenuItem(&mi);
diff --git a/protocols/Steam/src/steam_options.cpp b/protocols/Steam/src/steam_options.cpp
index 66bc247ea8..00f933a804 100644
--- a/protocols/Steam/src/steam_options.cpp
+++ b/protocols/Steam/src/steam_options.cpp
@@ -25,7 +25,7 @@ void CSteamOptionsMain::OnInitDialog()
void CSteamOptionsMain::OnApply()
{
- TCHAR *group = m_group.GetText();
+ wchar_t *group = m_group.GetText();
if (mir_tstrlen(group) > 0 && !Clist_GroupExists(group))
Clist_GroupCreate(0, group);
diff --git a/protocols/Steam/src/steam_polling.cpp b/protocols/Steam/src/steam_polling.cpp
index 9958bd334c..22896647d8 100644
--- a/protocols/Steam/src/steam_polling.cpp
+++ b/protocols/Steam/src/steam_polling.cpp
@@ -35,7 +35,7 @@ void CSteamProto::ParsePollData(JSONNode *data)
PROTORECVEVENT recv = { 0 };
recv.timestamp = timestamp;
recv.szMessage = szMessage;
- if (_tcsstr(type, L"my_") == NULL)
+ if (wcsstr(type, L"my_") == NULL)
{
ProtoChainRecvMsg(hContact, &recv);
}
@@ -223,7 +223,7 @@ void CSteamProto::PollingThread(void*)
{
// Remember last message timestamp
node = json_get(root, "utc_timestamp");
- time_t timestamp = _ttoi64(ptrT(json_as_string(node)));
+ time_t timestamp = _wtoi64(ptrT(json_as_string(node)));
if (timestamp > getDword("LastMessageTS", 0))
setDword("LastMessageTS", timestamp);
diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp
index a6aacedd65..9eadb0fb42 100644
--- a/protocols/Steam/src/steam_proto.cpp
+++ b/protocols/Steam/src/steam_proto.cpp
@@ -1,6 +1,6 @@
#include "stdafx.h"
-CSteamProto::CSteamProto(const char* protoName, const TCHAR* userName)
+CSteamProto::CSteamProto(const char* protoName, const wchar_t* userName)
: PROTO<CSteamProto>(protoName, userName),
hAuthProcess(1), hMessageProcess(1)
{
@@ -18,22 +18,22 @@ CSteamProto::CSteamProto(const char* protoName, const TCHAR* userName)
GetModuleFileName(g_hInstance, filePath, MAX_PATH);
wchar_t sectionName[100];
- mir_sntprintf(sectionName, L"%s/%s", LPGENT("Protocols"), LPGENT(MODULE));
+ mir_sntprintf(sectionName, L"%s/%s", LPGENW("Protocols"), MODULEW);
char settingName[100];
mir_snprintf(settingName, "%s_%s", MODULE, "main");
SKINICONDESC sid = { 0 };
sid.flags = SIDF_ALL_TCHAR;
- sid.defaultFile.t = filePath;
+ sid.defaultFile.w = filePath;
sid.pszName = settingName;
- sid.section.t = sectionName;
- sid.description.t = LPGENT("Protocol icon");
+ sid.section.w = sectionName;
+ sid.description.w = LPGENW("Protocol icon");
sid.iDefaultIndex = -IDI_STEAM;
IcoLib_AddIcon(&sid);
mir_snprintf(settingName, "%s_%s", MODULE, "gaming");
- sid.description.t = LPGENT("Gaming icon");
+ sid.description.w = LPGENW("Gaming icon");
sid.iDefaultIndex = -IDI_GAMING;
IcoLib_AddIcon(&sid);
@@ -65,7 +65,7 @@ CSteamProto::CSteamProto(const char* protoName, const TCHAR* userName)
CreateProtoService(STEAM_DB_GETEVENTTEXT_CHATSTATES, &CSteamProto::OnGetEventTextChatStates);
// netlib support
- TCHAR name[128];
+ wchar_t name[128];
mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = { sizeof(nlu) };
@@ -85,7 +85,7 @@ CSteamProto::~CSteamProto()
MCONTACT CSteamProto::AddToList(int, PROTOSEARCHRESULT* psr)
{
MCONTACT hContact = NULL;
- ptrA steamId(mir_u2a(psr->id.t));
+ ptrA steamId(mir_u2a(psr->id.w));
if (psr->cbSize == sizeof(PROTOSEARCHRESULT))
{
if (!FindContact(steamId))
@@ -136,7 +136,7 @@ int CSteamProto::Authorize(MEVENT hDbEvent)
return 1;
}
-int CSteamProto::AuthDeny(MEVENT hDbEvent, const TCHAR*)
+int CSteamProto::AuthDeny(MEVENT hDbEvent, const wchar_t*)
{
if (IsOnline() && hDbEvent)
{
@@ -162,7 +162,7 @@ int CSteamProto::AuthDeny(MEVENT hDbEvent, const TCHAR*)
return 1;
}
-int CSteamProto::AuthRequest(MCONTACT hContact, const TCHAR*)
+int CSteamProto::AuthRequest(MCONTACT hContact, const wchar_t*)
{
if (IsOnline() && hContact)
{
@@ -222,7 +222,7 @@ DWORD_PTR CSteamProto:: GetCaps(int type, MCONTACT)
}
}
-HANDLE CSteamProto::SearchBasic(const TCHAR* id)
+HANDLE CSteamProto::SearchBasic(const wchar_t* id)
{
if (!this->IsOnline())
return 0;
@@ -238,13 +238,13 @@ HANDLE CSteamProto::SearchBasic(const TCHAR* id)
return (HANDLE)STEAM_SEARCH_BYID;
}
-HANDLE CSteamProto::SearchByName(const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName)
+HANDLE CSteamProto::SearchByName(const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName)
{
if (!this->IsOnline())
return 0;
// Combine all fields to single text
- TCHAR keywordsT[200];
+ wchar_t keywordsT[200];
mir_sntprintf(keywordsT, L"%s %s %s", nick, firstName, lastName);
ptrA token(getStringA("TokenSecret"));
diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h
index 672f500451..812f88051e 100644
--- a/protocols/Steam/src/steam_proto.h
+++ b/protocols/Steam/src/steam_proto.h
@@ -46,13 +46,13 @@ public:
virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT *psr);
virtual int __cdecl Authorize(MEVENT hDbEvent);
- virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR *szReason);
- virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR * szMessage);
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t *szReason);
+ virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t * szMessage);
virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
- virtual HANDLE __cdecl SearchBasic(const TCHAR *id);
- virtual HANDLE __cdecl SearchByName(const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName);
+ virtual HANDLE __cdecl SearchBasic(const wchar_t *id);
+ virtual HANDLE __cdecl SearchByName(const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName);
virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg);
@@ -74,7 +74,7 @@ public:
static void UninitMenus();
protected:
- TCHAR *password;
+ wchar_t *password;
bool isLoginAgain;
time_t m_idleTS;
HANDLE m_evRequestsQueue, m_hQueueThread;
@@ -192,7 +192,7 @@ protected:
void OnInitStatusMenu();
// avatars
- TCHAR* GetAvatarFilePath(MCONTACT hContact);
+ wchar_t* GetAvatarFilePath(MCONTACT hContact);
bool GetDbAvatarInfo(PROTO_AVATAR_INFORMATION &pai);
void CheckAvatarChange(MCONTACT hContact, std::string avatarUrl);
@@ -223,8 +223,8 @@ protected:
static int RsaEncrypt(const char *pszModulus, const char *data, BYTE *encrypted, DWORD &encryptedSize);
- static void CSteamProto::ShowNotification(const TCHAR *message, int flags = 0, MCONTACT hContact = NULL);
- static void CSteamProto::ShowNotification(const TCHAR *caption, const wchar_t *message, int flags = 0, MCONTACT hContact = NULL);
+ static void CSteamProto::ShowNotification(const wchar_t *message, int flags = 0, MCONTACT hContact = NULL);
+ static void CSteamProto::ShowNotification(const wchar_t *caption, const wchar_t *message, int flags = 0, MCONTACT hContact = NULL);
INT_PTR __cdecl OnGetEventTextChatStates(WPARAM wParam, LPARAM lParam);
diff --git a/protocols/Steam/src/steam_utils.cpp b/protocols/Steam/src/steam_utils.cpp
index c45440cb10..264afff378 100644
--- a/protocols/Steam/src/steam_utils.cpp
+++ b/protocols/Steam/src/steam_utils.cpp
@@ -159,7 +159,7 @@ exit:
return 0;
}
-void CSteamProto::ShowNotification(const TCHAR *caption, const wchar_t *message, int flags, MCONTACT hContact)
+void CSteamProto::ShowNotification(const wchar_t *caption, const wchar_t *message, int flags, MCONTACT hContact)
{
if (Miranda_Terminated())
return;
@@ -179,9 +179,9 @@ void CSteamProto::ShowNotification(const TCHAR *caption, const wchar_t *message,
MessageBox(NULL, message, caption, MB_OK | flags);
}
-void CSteamProto::ShowNotification(const TCHAR *message, int flags, MCONTACT hContact)
+void CSteamProto::ShowNotification(const wchar_t *message, int flags, MCONTACT hContact)
{
- ShowNotification(TranslateT(MODULE), message, flags, hContact);
+ ShowNotification(MODULEW, message, flags, hContact);
}
INT_PTR __cdecl CSteamProto::OnGetEventTextChatStates(WPARAM, LPARAM lParam)
diff --git a/protocols/Tlen/src/stdafx.h b/protocols/Tlen/src/stdafx.h
index 9341656dc3..d0b6031d7a 100644
--- a/protocols/Tlen/src/stdafx.h
+++ b/protocols/Tlen/src/stdafx.h
@@ -204,7 +204,7 @@ struct TLEN_VOICE_CONTROL_STRUCT;
struct TlenProtocol : public PROTO<TlenProtocol>
{
- TlenProtocol( const char*, const TCHAR* );
+ TlenProtocol( const char*, const wchar_t* );
~TlenProtocol();
//====================================================================================
@@ -215,23 +215,23 @@ struct TlenProtocol : public PROTO<TlenProtocol>
virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent);
virtual int __cdecl Authorize(MEVENT hDbEvent);
- virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR* szReason);
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t* szReason);
- virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath);
+ virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath);
virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason);
- virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename);
+ virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason);
+ virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename);
virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
virtual int __cdecl GetInfo(MCONTACT hContact, int infoType);
- virtual HANDLE __cdecl SearchBasic(const TCHAR* id);
- virtual HANDLE __cdecl SearchByEmail(const TCHAR* email);
- virtual HANDLE __cdecl SearchByName(const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName);
+ virtual HANDLE __cdecl SearchBasic(const wchar_t* id);
+ virtual HANDLE __cdecl SearchByEmail(const wchar_t* email);
+ virtual HANDLE __cdecl SearchByName(const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName);
virtual HWND __cdecl SearchAdvanced(HWND owner);
virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles);
+ virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles);
virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg);
virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode);
@@ -239,7 +239,7 @@ struct TlenProtocol : public PROTO<TlenProtocol>
virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt);
- virtual int __cdecl SetAwayMsg(int iStatus, const TCHAR* msg);
+ virtual int __cdecl SetAwayMsg(int iStatus, const wchar_t* msg);
virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
@@ -416,7 +416,7 @@ typedef struct {
typedef struct {
int id;
- TCHAR *name;
+ wchar_t *name;
} TLEN_FIELD_MAP;
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp
index e7ce5b729b..d0bfbce5f4 100644
--- a/protocols/Tlen/src/tlen.cpp
+++ b/protocols/Tlen/src/tlen.cpp
@@ -335,7 +335,7 @@ void TlenProtocol::initMenuItems()
hMenuContactGrantAuth = Menu_AddContactMenuItem(&mi, m_szModuleName);
}
-TlenProtocol* tlenProtoInit(const char* pszProtoName, const TCHAR* tszUserName)
+TlenProtocol* tlenProtoInit(const char* pszProtoName, const wchar_t* tszUserName)
{
TlenProtocol* ppro = new TlenProtocol(pszProtoName, tszUserName);
return ppro;
diff --git a/protocols/Tlen/src/tlen_avatar.cpp b/protocols/Tlen/src/tlen_avatar.cpp
index 19466f5c10..47645f8bb8 100644
--- a/protocols/Tlen/src/tlen_avatar.cpp
+++ b/protocols/Tlen/src/tlen_avatar.cpp
@@ -31,16 +31,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* TlenGetAvatarFileName() - gets a file name for the avatar image */
-void TlenGetAvatarFileName(TlenProtocol *proto, TLEN_LIST_ITEM *item, TCHAR* ptszDest, int cbLen)
+void TlenGetAvatarFileName(TlenProtocol *proto, TLEN_LIST_ITEM *item, wchar_t* ptszDest, int cbLen)
{
int tPathLen = mir_sntprintf(ptszDest, cbLen, TEXT("%s\\%S"), VARST(TEXT("%miranda_avatarcache%")), proto->m_szModuleName);
- if (_taccess(ptszDest, 0)) {
+ if (_waccess(ptszDest, 0)) {
int ret = CreateDirectoryTreeT(ptszDest);
if (ret == 0)
proto->debugLog(L"getAvatarFilename(): Created new directory for avatar cache: %s.", ptszDest);
else {
proto->debugLog(L"getAvatarFilename(): Can not create directory for avatar cache: %s. errno=%d: %s", ptszDest, errno, strerror(errno));
- TCHAR buffer[512];
+ wchar_t buffer[512];
mir_sntprintf(buffer, TranslateT("Cannot create avatars cache directory. ERROR: %d: %s\n%s"), errno, _tcserror(errno), ptszDest);
PUShowMessageT(buffer, SM_WARNING);
}
@@ -56,7 +56,7 @@ void TlenGetAvatarFileName(TlenProtocol *proto, TLEN_LIST_ITEM *item, TCHAR* pts
else
format = db_get_dw(NULL, proto->m_szModuleName, "AvatarFormat", PA_FORMAT_UNKNOWN);
- const TCHAR *tszFileType = ProtoGetAvatarExtension(format);
+ const wchar_t *tszFileType = ProtoGetAvatarExtension(format);
if (item != NULL)
mir_sntprintf(ptszDest + tPathLen, MAX_PATH - tPathLen, TEXT("%S%s"), ptrA(TlenSha1(item->jid)), tszFileType);
else
@@ -65,7 +65,7 @@ void TlenGetAvatarFileName(TlenProtocol *proto, TLEN_LIST_ITEM *item, TCHAR* pts
static void RemoveAvatar(TlenProtocol *proto, MCONTACT hContact)
{
- TCHAR tFileName[MAX_PATH];
+ wchar_t tFileName[MAX_PATH];
if (hContact == NULL)
proto->threadData->avatarHash[0] = '\0';
@@ -79,7 +79,7 @@ static void RemoveAvatar(TlenProtocol *proto, MCONTACT hContact)
static void SetAvatar(TlenProtocol *proto, MCONTACT hContact, TLEN_LIST_ITEM *item, char *data, int len, DWORD format)
{
- TCHAR filename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
char md5[33];
mir_md5_state_t ctx;
DWORD digest[4];
@@ -104,7 +104,7 @@ static void SetAvatar(TlenProtocol *proto, MCONTACT hContact, TLEN_LIST_ITEM *it
}
TlenGetAvatarFileName(proto, item, filename, _countof(filename) - 1);
DeleteFile(filename);
- FILE *out = _tfopen(filename, TEXT("wb"));
+ FILE *out = _wfopen(filename, TEXT("wb"));
if (out != NULL) {
fwrite(data, len, 1, out);
fclose(out);
@@ -113,7 +113,7 @@ static void SetAvatar(TlenProtocol *proto, MCONTACT hContact, TLEN_LIST_ITEM *it
db_set_dw(hContact, proto->m_szModuleName, "AvatarFormat", format);
}
else {
- TCHAR buffer[128];
+ wchar_t buffer[128];
mir_sntprintf(buffer, TranslateT("Cannot save new avatar file \"%s\" Error:\n\t%s (Error: %d)"), filename, _tcserror(errno), errno);
PUShowMessageT(buffer, SM_WARNING);
proto->debugLog(buffer);
diff --git a/protocols/Tlen/src/tlen_avatar.h b/protocols/Tlen/src/tlen_avatar.h
index 5de5d482a6..d994713a54 100644
--- a/protocols/Tlen/src/tlen_avatar.h
+++ b/protocols/Tlen/src/tlen_avatar.h
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void TlenProcessPresenceAvatar(TlenProtocol *proto, XmlNode *node, TLEN_LIST_ITEM *item);
int TlenProcessAvatarNode(TlenProtocol *proto, XmlNode *avatarNode, TLEN_LIST_ITEM *item);
-void TlenGetAvatarFileName(TlenProtocol *proto, TLEN_LIST_ITEM *item, TCHAR* psztDest, int cbLen);
+void TlenGetAvatarFileName(TlenProtocol *proto, TLEN_LIST_ITEM *item, wchar_t* psztDest, int cbLen);
void TlenGetAvatar(TlenProtocol *proto, MCONTACT hContact);
void TlenUploadAvatar(TlenProtocol *proto, unsigned char *data, int dataLen, int access);
void TlenRemoveAvatar(TlenProtocol *proto);
diff --git a/protocols/Tlen/src/tlen_file.cpp b/protocols/Tlen/src/tlen_file.cpp
index d43ff1d153..48baafe6d1 100644
--- a/protocols/Tlen/src/tlen_file.cpp
+++ b/protocols/Tlen/src/tlen_file.cpp
@@ -583,13 +583,13 @@ void TlenProcessF(XmlNode *node, ThreadData *info)
}
if (szFilename[0] != '\0' && ft->iqId != NULL) {
- TCHAR* filenameT = mir_utf8decodeT((char*)szFilename);
+ wchar_t* filenameT = mir_utf8decodeT((char*)szFilename);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
pre.fileCount = 1;
pre.timestamp = time(NULL);
- pre.descr.t = filenameT;
- pre.files.t = &filenameT;
+ pre.descr.w = filenameT;
+ pre.files.w = &filenameT;
pre.lParam = (LPARAM)ft;
ft->proto->debugLogA("sending chainrecv");
ProtoChainRecvFile(ft->hContact, &pre);
diff --git a/protocols/Tlen/src/tlen_iqid.cpp b/protocols/Tlen/src/tlen_iqid.cpp
index 810c3b9f66..364bca28c2 100644
--- a/protocols/Tlen/src/tlen_iqid.cpp
+++ b/protocols/Tlen/src/tlen_iqid.cpp
@@ -429,47 +429,47 @@ void TlenIqResultSearch(TlenProtocol *proto, XmlNode *iqNode)
mir_snprintf(jsr.jid, "%s@%s", jid, dbv.pszVal);
}
jsr.jid[sizeof(jsr.jid) - 1] = '\0';
- jsr.hdr.id.t = mir_a2t(jid);
+ jsr.hdr.id.w = mir_a2t(jid);
if ((n = TlenXmlGetChild(itemNode, "nick")) != NULL && n->text != NULL) {
char* buf = TlenTextDecode(n->text);
- jsr.hdr.nick.t = mir_a2t(buf);
+ jsr.hdr.nick.w = mir_a2t(buf);
mir_free(buf);
}
else {
- jsr.hdr.nick.t = mir_tstrdup(TEXT(""));
+ jsr.hdr.nick.w = mir_tstrdup(TEXT(""));
}
if ((n = TlenXmlGetChild(itemNode, "first")) != NULL && n->text != NULL) {
char* buf = TlenTextDecode(n->text);
- jsr.hdr.firstName.t = mir_a2t(buf);
+ jsr.hdr.firstName.w = mir_a2t(buf);
mir_free(buf);
}
else {
- jsr.hdr.firstName.t = mir_tstrdup(TEXT(""));
+ jsr.hdr.firstName.w = mir_tstrdup(TEXT(""));
}
if ((n = TlenXmlGetChild(itemNode, "last")) != NULL && n->text != NULL) {
char* buf = TlenTextDecode(n->text);
- jsr.hdr.lastName.t = mir_a2t(buf);
+ jsr.hdr.lastName.w = mir_a2t(buf);
mir_free(buf);
}
else {
- jsr.hdr.lastName.t = mir_tstrdup(TEXT(""));
+ jsr.hdr.lastName.w = mir_tstrdup(TEXT(""));
}
if ((n = TlenXmlGetChild(itemNode, "email")) != NULL && n->text != NULL) {
char* buf = TlenTextDecode(n->text);
- jsr.hdr.email.t = mir_a2t(buf);
+ jsr.hdr.email.w = mir_a2t(buf);
mir_free(buf);
}
else {
- jsr.hdr.email.t = mir_tstrdup(TEXT(""));
+ jsr.hdr.email.w = mir_tstrdup(TEXT(""));
}
ProtoBroadcastAck(proto->m_szModuleName, NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&jsr);
found = 1;
- mir_free(jsr.hdr.id.t);
- mir_free(jsr.hdr.nick.t);
- mir_free(jsr.hdr.firstName.t);
- mir_free(jsr.hdr.lastName.t);
- mir_free(jsr.hdr.email.t);
+ mir_free(jsr.hdr.id.w);
+ mir_free(jsr.hdr.nick.w);
+ mir_free(jsr.hdr.firstName.w);
+ mir_free(jsr.hdr.lastName.w);
+ mir_free(jsr.hdr.email.w);
}
}
}
@@ -480,7 +480,7 @@ void TlenIqResultSearch(TlenProtocol *proto, XmlNode *iqNode)
else
mir_snprintf(jsr.jid, "%s@%s", proto->searchJID, dbv.pszVal);
- jsr.hdr.nick.t = jsr.hdr.firstName.t = jsr.hdr.lastName.t = jsr.hdr.email.t = jsr.hdr.id.t = TEXT("");
+ jsr.hdr.nick.w = jsr.hdr.firstName.w = jsr.hdr.lastName.w = jsr.hdr.email.w = jsr.hdr.id.w = TEXT("");
ProtoBroadcastAck(proto->m_szModuleName, NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&jsr);
}
mir_free(proto->searchJID);
diff --git a/protocols/Tlen/src/tlen_opt.cpp b/protocols/Tlen/src/tlen_opt.cpp
index e3058a8526..abaaa4e584 100644
--- a/protocols/Tlen/src/tlen_opt.cpp
+++ b/protocols/Tlen/src/tlen_opt.cpp
@@ -35,14 +35,14 @@ static INT_PTR CALLBACK TlenPopupsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
typedef struct TabDefStruct {
DLGPROC dlgProc;
DWORD dlgId;
- TCHAR *tabName;
+ wchar_t *tabName;
} TabDef;
static TabDef tabPages[] = {
- {TlenBasicOptDlgProc, IDD_OPTIONS_BASIC, LPGENT("General")},
- {TlenVoiceOptDlgProc, IDD_OPTIONS_VOICE, LPGENT("Voice Chats")},
- {TlenAdvOptDlgProc, IDD_OPTIONS_ADVANCED, LPGENT("Advanced")},
- {TlenPopupsDlgProc, IDD_OPTIONS_POPUPS, LPGENT("Notifications")}
+ {TlenBasicOptDlgProc, IDD_OPTIONS_BASIC, LPGENW("General")},
+ {TlenVoiceOptDlgProc, IDD_OPTIONS_VOICE, LPGENW("Voice Chats")},
+ {TlenAdvOptDlgProc, IDD_OPTIONS_ADVANCED, LPGENW("Advanced")},
+ {TlenPopupsDlgProc, IDD_OPTIONS_POPUPS, LPGENW("Notifications")}
};
void TlenLoadOptions(TlenProtocol *proto)
@@ -86,14 +86,14 @@ int TlenProtocol::OptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
- odp.ptszGroup = LPGENT("Network");
- odp.ptszTitle = m_tszUserName;
+ odp.pwszGroup = LPGENW("Network");
+ odp.pwszTitle = m_tszUserName;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
odp.dwInitParam = (LPARAM)this;
for (int i = 0; i < _countof(tabPages); i++) {
odp.pszTemplate = MAKEINTRESOURCEA(tabPages[i].dlgId);
odp.pfnDlgProc = tabPages[i].dlgProc;
- odp.ptszTab = tabPages[i].tabName;
+ odp.pwszTab = tabPages[i].tabName;
Options_AddPage(wParam, &odp);
}
return 0;
@@ -594,7 +594,7 @@ static INT_PTR CALLBACK TlenAdvOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
#define POPUP_DEFAULT_COLORBKG 0xDCBDA5
#define POPUP_DEFAULT_COLORTXT 0x000000
-static void MailPopupPreview(DWORD colorBack, DWORD colorText, TCHAR *title, TCHAR *emailInfo, int delay)
+static void MailPopupPreview(DWORD colorBack, DWORD colorText, wchar_t *title, wchar_t *emailInfo, int delay)
{
if (!ServiceExists(MS_POPUP_ADDPOPUPT))
return;
@@ -602,8 +602,8 @@ static void MailPopupPreview(DWORD colorBack, DWORD colorText, TCHAR *title, TCH
HICON hIcon = GetIcolibIcon(IDI_MAIL);
ppd.lchIcon = CopyIcon(hIcon);
ReleaseIcolibIcon(hIcon);
- _tcsncpy(ppd.lptzContactName, title, MAX_CONTACTNAME-1);
- _tcsncpy(ppd.lptzText, emailInfo,MAX_SECONDLINE-1);
+ wcsncpy(ppd.lptzContactName, title, MAX_CONTACTNAME-1);
+ wcsncpy(ppd.lptzText, emailInfo,MAX_SECONDLINE-1);
ppd.colorBack = colorBack;
ppd.colorText = colorText;
ppd.iSeconds = delay;
@@ -648,7 +648,7 @@ static INT_PTR CALLBACK TlenPopupsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
case IDC_PREVIEW:
{
int delay;
- TCHAR title[256];
+ wchar_t title[256];
if (IsDlgButtonChecked(hwndDlg, IDC_DELAY_POPUP)) {
delay=0;
} else if (IsDlgButtonChecked(hwndDlg, IDC_DELAY_PERMANENT)) {
diff --git a/protocols/Tlen/src/tlen_p2p_new.cpp b/protocols/Tlen/src/tlen_p2p_new.cpp
index 6afb490b0d..5cc872a3bb 100644
--- a/protocols/Tlen/src/tlen_p2p_new.cpp
+++ b/protocols/Tlen/src/tlen_p2p_new.cpp
@@ -260,13 +260,13 @@ void __cdecl TlenProcessP2P(XmlNode *node, ThreadData *info) {
char fileInfo[128];
item->ft = ft;
mir_snprintf(fileInfo, "%s file(s), %s bytes", c, s);
- TCHAR* filenameT = mir_utf8decodeT((char*)fileInfo);
+ wchar_t* filenameT = mir_utf8decodeT((char*)fileInfo);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
pre.fileCount = 1;
pre.timestamp = time(NULL);
- pre.descr.t = filenameT;
- pre.files.t = &filenameT;
+ pre.descr.w = filenameT;
+ pre.files.w = &filenameT;
pre.lParam = (LPARAM)ft;
ft->proto->debugLogA("sending chainrecv");
ProtoChainRecvFile(ft->hContact, &pre);
diff --git a/protocols/Tlen/src/tlen_picture.cpp b/protocols/Tlen/src/tlen_picture.cpp
index a4d77111ca..14b15ad15c 100644
--- a/protocols/Tlen/src/tlen_picture.cpp
+++ b/protocols/Tlen/src/tlen_picture.cpp
@@ -250,7 +250,7 @@ BOOL SendPicture(TlenProtocol *proto, MCONTACT hContact) {
if (!db_get(hContact, proto->m_szModuleName, "jid", &dbv)) {
char *jid = dbv.pszVal;
- TCHAR tszFilter[512], tszFileName[MAX_PATH];
+ wchar_t tszFilter[512], tszFileName[MAX_PATH];
Bitmap_GetFilter(tszFilter, _countof(tszFilter));
tszFileName[0] = '\0';
@@ -263,7 +263,7 @@ BOOL SendPicture(TlenProtocol *proto, MCONTACT hContact) {
ofn.Flags = OFN_FILEMUSTEXIST;
if (GetOpenFileName(&ofn)) {
long size;
- FILE* fp = _tfopen(tszFileName, L"rb");
+ FILE* fp = _wfopen(tszFileName, L"rb");
if (fp) {
fseek(fp, 0, SEEK_END);
size = ftell(fp);
diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp
index 9ce4fc360e..91d4d18ee4 100644
--- a/protocols/Tlen/src/tlen_svc.cpp
+++ b/protocols/Tlen/src/tlen_svc.cpp
@@ -86,7 +86,7 @@ void TlenResetSearchQuery(TlenProtocol *proto) {
proto->searchID = TlenSerialNext(proto);
}
-HANDLE TlenProtocol::SearchBasic(const TCHAR* id)
+HANDLE TlenProtocol::SearchBasic(const wchar_t* id)
{
int iqId = 0;
if (!isOnline) return 0;
@@ -104,7 +104,7 @@ HANDLE TlenProtocol::SearchBasic(const TCHAR* id)
return (HANDLE)iqId;
}
-HANDLE TlenProtocol::SearchByEmail(const TCHAR* email)
+HANDLE TlenProtocol::SearchByEmail(const wchar_t* email)
{
int iqId = 0;
@@ -123,7 +123,7 @@ HANDLE TlenProtocol::SearchByEmail(const TCHAR* email)
return (HANDLE)iqId;
}
-HANDLE TlenProtocol::SearchByName(const TCHAR* nickT, const TCHAR* firstNameT, const TCHAR* lastNameT)
+HANDLE TlenProtocol::SearchByName(const wchar_t* nickT, const wchar_t* firstNameT, const wchar_t* lastNameT)
{
if (!isOnline) return 0;
@@ -310,7 +310,7 @@ int TlenProtocol::Authorize(MEVENT hDbEvent)
return 0;
}
-int TlenProtocol::AuthDeny(MEVENT hDbEvent, const TCHAR*)
+int TlenProtocol::AuthDeny(MEVENT hDbEvent, const wchar_t*)
{
if (!isOnline)
return 1;
@@ -413,7 +413,7 @@ INT_PTR TlenProtocol::GetStatus(WPARAM, LPARAM)
return m_iStatus;
}
-int TlenProtocol::SetAwayMsg(int iStatus, const TCHAR* msg)
+int TlenProtocol::SetAwayMsg(int iStatus, const wchar_t* msg)
{
char **szMsg;
char *newModeMsg;
@@ -716,12 +716,12 @@ int TlenProtocol::RecvAwayMsg(MCONTACT, int, PROTORECVEVENT*)
return 0;
}
-HANDLE TlenProtocol::FileAllow(MCONTACT, HANDLE hTransfer, const TCHAR* szPath)
+HANDLE TlenProtocol::FileAllow(MCONTACT, HANDLE hTransfer, const wchar_t* szPath)
{
if (!isOnline) return 0;
TLEN_FILE_TRANSFER *ft = (TLEN_FILE_TRANSFER *)hTransfer;
- ft->szSavePath = mir_strdup(mir_t2a(szPath)); //TODO convert to TCHAR*
+ ft->szSavePath = mir_strdup(mir_t2a(szPath)); //TODO convert to wchar_t*
TLEN_LIST_ITEM *item = TlenListAdd(this, LIST_FILE, ft->iqId);
if (item != NULL) {
item->ft = ft;
@@ -737,7 +737,7 @@ HANDLE TlenProtocol::FileAllow(MCONTACT, HANDLE hTransfer, const TCHAR* szPath)
return (HANDLE)hTransfer;
}
-int TlenProtocol::FileDeny(MCONTACT, HANDLE hTransfer, const TCHAR*)
+int TlenProtocol::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t*)
{
if (!isOnline) return 1;
@@ -754,7 +754,7 @@ int TlenProtocol::FileDeny(MCONTACT, HANDLE hTransfer, const TCHAR*)
return 0;
}
-int TlenProtocol::FileResume(HANDLE, int*, const TCHAR**)
+int TlenProtocol::FileResume(HANDLE, int*, const wchar_t**)
{
return 0;
}
@@ -779,7 +779,7 @@ int TlenProtocol::FileCancel(MCONTACT, HANDLE hTransfer)
return 0;
}
-HANDLE TlenProtocol::SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles)
+HANDLE TlenProtocol::SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles)
{
int i, j;
struct _stat statbuf;
@@ -1043,7 +1043,7 @@ int TlenProtocol::UserIsTyping(MCONTACT hContact, int type)
INT_PTR TlenProtocol::GetMyAvatar(WPARAM wParam, LPARAM lParam)
{
- TCHAR* buf = (TCHAR*)wParam;
+ wchar_t* buf = (wchar_t*)wParam;
int size = (int)lParam;
if (buf == NULL || size <= 0)
return -1;
@@ -1084,8 +1084,8 @@ INT_PTR TlenProtocol::SetMyAvatar(WPARAM, LPARAM lParam)
PUShowMessageT(TranslateT("You need to be connected to Tlen account to set avatar."), SM_WARNING);
return 1;
}
- TCHAR* szFileName = (TCHAR*)lParam;
- TCHAR tFileName[MAX_PATH];
+ wchar_t* szFileName = (wchar_t*)lParam;
+ wchar_t tFileName[MAX_PATH];
if (szFileName != NULL) {
int result = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_USER_CHANGEAVATAR), NULL, TlenChangeAvatarDlgProc, (LPARAM)NULL);
TlenGetAvatarFileName(this, NULL, tFileName, MAX_PATH);
@@ -1173,7 +1173,7 @@ void TlenInitServicesVTbl(TlenProtocol *proto)
proto->CreateProtoService(PS_CREATEACCMGRUI, &TlenProtocol::AccMgrUI);
}
-TlenProtocol::TlenProtocol(const char *aProtoName, const TCHAR *aUserName) :
+TlenProtocol::TlenProtocol(const char *aProtoName, const wchar_t *aUserName) :
PROTO<TlenProtocol>(aProtoName, aUserName)
{
TlenInitServicesVTbl(this);
diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp
index 77dac550d6..f0cc77fd33 100644
--- a/protocols/Tlen/src/tlen_thread.cpp
+++ b/protocols/Tlen/src/tlen_thread.cpp
@@ -1069,8 +1069,8 @@ static void TlenMailPopup(TlenProtocol *proto, char *title, char *emailInfo)
POPUPDATAT ppd = { 0 };
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_MAIL));
- _tcsncpy(ppd.lptzContactName, _A2T(title), MAX_CONTACTNAME -1);
- _tcsncpy(ppd.lptzText, _A2T(emailInfo), MAX_SECONDLINE - 1);
+ wcsncpy(ppd.lptzContactName, _A2T(title), MAX_CONTACTNAME -1);
+ wcsncpy(ppd.lptzText, _A2T(emailInfo), MAX_SECONDLINE - 1);
ppd.colorBack = db_get_dw(NULL, proto->m_szModuleName, "MailPopupBack", 0);
ppd.colorText = db_get_dw(NULL, proto->m_szModuleName, "MailPopupText", 0);
BYTE delayMode = db_get_b(NULL, proto->m_szModuleName, "MailPopupDelayMode", 0);
diff --git a/protocols/Tlen/src/tlen_userinfo.cpp b/protocols/Tlen/src/tlen_userinfo.cpp
index 04ca98b5aa..c361120161 100644
--- a/protocols/Tlen/src/tlen_userinfo.cpp
+++ b/protocols/Tlen/src/tlen_userinfo.cpp
@@ -139,7 +139,7 @@ int TlenProtocol::UserInfoInit(WPARAM wParam, LPARAM lParam)
odp.pfnDlgProc = TlenUserInfoDlgProc;
odp.position = -2000000000;
odp.pszTemplate = ((HANDLE)lParam != NULL) ? MAKEINTRESOURCEA(IDD_USER_INFO):MAKEINTRESOURCEA(IDD_USER_VCARD);
- odp.ptszTitle = (hContact != NULL) ? LPGENT("Account") : m_tszUserName;
+ odp.pwszTitle = (hContact != NULL) ? LPGENW("Account") : m_tszUserName;
odp.dwInitParam = (LPARAM)this;
UserInfo_AddPage(wParam, &odp);
diff --git a/protocols/Tlen/src/tlen_ws.cpp b/protocols/Tlen/src/tlen_ws.cpp
index 10d7042ae9..88fbf0681e 100644
--- a/protocols/Tlen/src/tlen_ws.cpp
+++ b/protocols/Tlen/src/tlen_ws.cpp
@@ -27,7 +27,7 @@ BOOL TlenWsInit(TlenProtocol *proto)
{
NETLIBUSER nlu = {0};
NETLIBUSERSETTINGS nlus = {0};
- TCHAR name[128];
+ wchar_t name[128];
nlu.cbSize = sizeof(nlu);
diff --git a/protocols/Tox/src/stdafx.h b/protocols/Tox/src/stdafx.h
index a2de2a5528..9f37777cc5 100644
--- a/protocols/Tox/src/stdafx.h
+++ b/protocols/Tox/src/stdafx.h
@@ -69,6 +69,7 @@ struct CToxProto;
extern HINSTANCE g_hInstance;
#define MODULE "Tox"
+#define MODULEW L"Tox"
#define TOX_ERROR -1
diff --git a/protocols/Tox/src/tox_accounts.cpp b/protocols/Tox/src/tox_accounts.cpp
index f4a2ad222d..0c4cea1a40 100644
--- a/protocols/Tox/src/tox_accounts.cpp
+++ b/protocols/Tox/src/tox_accounts.cpp
@@ -45,9 +45,9 @@ int CToxProto::OnAccountRenamed(WPARAM, LPARAM)
mir_cslock locker(profileLock);
ptrT newPath(GetToxProfilePath());
- TCHAR oldPath[MAX_PATH];
+ wchar_t oldPath[MAX_PATH];
mir_sntprintf(oldPath, MAX_PATH, L"%s\\%s.tox", VARST(L"%miranda_userdata%"), accountName);
- _trename(oldPath, newPath);
+ _wrename(oldPath, newPath);
mir_free(accountName);
accountName = mir_tstrdup(m_tszUserName);
diff --git a/protocols/Tox/src/tox_avatars.cpp b/protocols/Tox/src/tox_avatars.cpp
index b62328ae11..252f9f6a18 100644
--- a/protocols/Tox/src/tox_avatars.cpp
+++ b/protocols/Tox/src/tox_avatars.cpp
@@ -1,8 +1,8 @@
#include "stdafx.h"
-TCHAR* CToxProto::GetAvatarFilePath(MCONTACT hContact)
+wchar_t* CToxProto::GetAvatarFilePath(MCONTACT hContact)
{
- TCHAR *path = (TCHAR*)mir_calloc(MAX_PATH * sizeof(TCHAR) + 1);
+ wchar_t *path = (wchar_t*)mir_calloc(MAX_PATH * sizeof(wchar_t) + 1);
mir_sntprintf(path, MAX_PATH, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
DWORD dwAttributes = GetFileAttributes(path);
@@ -22,9 +22,9 @@ TCHAR* CToxProto::GetAvatarFilePath(MCONTACT hContact)
return path;
}
-void CToxProto::SetToxAvatar(const TCHAR* path)
+void CToxProto::SetToxAvatar(const wchar_t* path)
{
- FILE *hFile = _tfopen(path, L"rb");
+ FILE *hFile = _wfopen(path, L"rb");
if (!hFile)
{
debugLogA(__FUNCTION__": failed to open avatar file");
@@ -96,7 +96,7 @@ void CToxProto::SetToxAvatar(const TCHAR* path)
transfer->pfts.flags |= PFTS_SENDING;
memcpy(transfer->hash, hash, TOX_HASH_LENGTH);
transfer->pfts.hContact = hContact;
- transfer->hFile = _tfopen(path, L"rb");
+ transfer->hFile = _wfopen(path, L"rb");
transfers.Add(transfer);
}
}
@@ -150,7 +150,7 @@ INT_PTR CToxProto::GetMyAvatar(WPARAM wParam, LPARAM lParam)
{
ptrT path(GetAvatarFilePath());
if (IsFileExists(path))
- mir_tstrncpy((TCHAR*)wParam, path, (int)lParam);
+ mir_tstrncpy((wchar_t*)wParam, path, (int)lParam);
return 0;
}
@@ -158,7 +158,7 @@ INT_PTR CToxProto::GetMyAvatar(WPARAM wParam, LPARAM lParam)
INT_PTR CToxProto::SetMyAvatar(WPARAM, LPARAM lParam)
{
debugLogA(__FUNCTION__": setting avatar");
- TCHAR *path = (TCHAR*)lParam;
+ wchar_t *path = (wchar_t*)lParam;
ptrT avatarPath(GetAvatarFilePath());
if (path != NULL)
{
@@ -230,7 +230,7 @@ void CToxProto::OnGotFriendAvatarInfo(AvatarTransferParam *transfer)
db_free(&dbv);
}
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
mir_sntprintf(path, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
OnFileAllow(transfer->pfts.hContact, transfer, path);
}
diff --git a/protocols/Tox/src/tox_chatrooms.cpp b/protocols/Tox/src/tox_chatrooms.cpp
index 59580431a3..f0a538fb5c 100644
--- a/protocols/Tox/src/tox_chatrooms.cpp
+++ b/protocols/Tox/src/tox_chatrooms.cpp
@@ -28,7 +28,7 @@ MCONTACT CToxProto::AddChatRoom(int groupNumber)
setWord(hContact, TOX_SETTINGS_CHAT_ID, groupNumber);
- TCHAR title[MAX_PATH];
+ wchar_t title[MAX_PATH];
mir_sntprintf(title, L"%s #%d", TranslateT("Group chat"), groupNumber);
setTString(hContact, "Nick", title);
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp
index c834e43ad0..a78d6e3b39 100644
--- a/protocols/Tox/src/tox_contacts.cpp
+++ b/protocols/Tox/src/tox_contacts.cpp
@@ -343,7 +343,7 @@ void CToxProto::OnConnectionStatusChanged(Tox*, uint32_t friendNumber, TOX_CONNE
ptrT avatarPath(proto->GetAvatarFilePath());
if (IsFileExists(avatarPath))
{
- FILE *hFile = _tfopen(avatarPath, L"rb");
+ FILE *hFile = _wfopen(avatarPath, L"rb");
if (!hFile)
{
Netlib_Logf(proto->m_hNetlibUser, __FUNCTION__": failed to open avatar file");
@@ -401,7 +401,7 @@ int CToxProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam)
odp.flags = ODPF_TCHAR | ODPF_DONTTRANSLATE;
odp.hInstance = g_hInstance;
odp.dwInitParam = (LPARAM)this;
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
odp.pfnDlgProc = UserInfoProc;
odp.position = -2000000000;
@@ -456,7 +456,7 @@ INT_PTR CToxProto::UserInfoProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar
{
break;
}
- TCHAR dnsId[MAX_PATH];
+ wchar_t dnsId[MAX_PATH];
GetDlgItemText(hwnd, IDC_DNS_ID, dnsId, MAX_PATH);
proto->setTString(hContact, TOX_SETTINGS_DNS, dnsId);
break;
diff --git a/protocols/Tox/src/tox_icons.cpp b/protocols/Tox/src/tox_icons.cpp
index 4aec68a172..083bf078c2 100644
--- a/protocols/Tox/src/tox_icons.cpp
+++ b/protocols/Tox/src/tox_icons.cpp
@@ -2,16 +2,16 @@
IconItemT CToxProto::Icons[] =
{
- { LPGENT("Protocol icon"), "main", IDI_TOX },
- { LPGENT("Audio call"), "audio_call", IDI_AUDIO_CALL },
- { LPGENT("Audio ring"), "audio_ring", IDI_AUDIO_RING },
- { LPGENT("Audio start"), "audio_start", IDI_AUDIO_START },
- { LPGENT("Audio end"), "audio_end", IDI_AUDIO_END },
+ { LPGENW("Protocol icon"), "main", IDI_TOX },
+ { LPGENW("Audio call"), "audio_call", IDI_AUDIO_CALL },
+ { LPGENW("Audio ring"), "audio_ring", IDI_AUDIO_RING },
+ { LPGENW("Audio start"), "audio_start", IDI_AUDIO_START },
+ { LPGENW("Audio end"), "audio_end", IDI_AUDIO_END },
};
void CToxProto::InitIcons()
{
- Icon_RegisterT(g_hInstance, LPGENT("Protocols") L"/" LPGENT(MODULE), Icons, _countof(Icons), MODULE);
+ Icon_RegisterT(g_hInstance, LPGENW("Protocols") L"/" MODULEW, Icons, _countof(Icons), MODULE);
}
HANDLE CToxProto::GetIconHandle(int iconId)
diff --git a/protocols/Tox/src/tox_menus.cpp b/protocols/Tox/src/tox_menus.cpp
index 50f51fada4..e7580ef650 100644
--- a/protocols/Tox/src/tox_menus.cpp
+++ b/protocols/Tox/src/tox_menus.cpp
@@ -45,7 +45,7 @@ void CToxProto::InitMenus()
// Request authorization
SET_UID(mi, 0x36375a1f, 0xc142, 0x4d6e, 0xa6, 0x57, 0xe4, 0x76, 0x5d, 0xbc, 0x59, 0x8e);
mi.pszService = MODULE"/RequestAuth";
- mi.name.t = LPGENT("Request authorization");
+ mi.name.w = LPGENW("Request authorization");
mi.position = CMI_POSITION + CMI_AUTH_REQUEST;
mi.hIcolibItem = ::Skin_GetIconHandle(SKINICON_AUTH_REQUEST);
ContactMenuItems[CMI_AUTH_REQUEST] = Menu_AddContactMenuItem(&mi);
@@ -54,7 +54,7 @@ void CToxProto::InitMenus()
// Grant authorization
SET_UID(mi, 0x4c90452a, 0x869a, 0x4a81, 0xaf, 0xa8, 0x28, 0x34, 0xaf, 0x2b, 0x6b, 0x30);
mi.pszService = MODULE"/GrantAuth";
- mi.name.t = LPGENT("Grant authorization");
+ mi.name.w = LPGENW("Grant authorization");
mi.position = CMI_POSITION + CMI_AUTH_GRANT;
mi.hIcolibItem = ::Skin_GetIconHandle(SKINICON_AUTH_GRANT);
ContactMenuItems[CMI_AUTH_GRANT] = Menu_AddContactMenuItem(&mi);
@@ -63,7 +63,7 @@ void CToxProto::InitMenus()
// Start audio call
SET_UID(mi, 0x116cb7fe, 0xce37, 0x429c, 0xb0, 0xa9, 0x7d, 0xe7, 0x70, 0x59, 0xc3, 0x95);
mi.pszService = MODULE"/Audio/Call";
- mi.name.t = LPGENT("Call");
+ mi.name.w = LPGENW("Call");
mi.position = -2000020000 + CMI_AUDIO_CALL;
mi.hIcolibItem = GetIconHandle(IDI_AUDIO_START);
ContactMenuItems[CMI_AUDIO_CALL] = Menu_AddContactMenuItem(&mi);
@@ -79,7 +79,7 @@ int CToxProto::OnInitStatusMenu()
// Create copy tox id command
mi.pszService = "/CopyToxID";
CreateProtoService(mi.pszService, &CToxProto::OnCopyToxID);
- mi.name.t = LPGENT("Copy Tox ID");
+ mi.name.w = LPGENW("Copy Tox ID");
mi.position = SMI_POSITION + SMI_TOXID_COPY;
Menu_AddProtoMenuItem(&mi, m_szModuleName);
@@ -87,7 +87,7 @@ int CToxProto::OnInitStatusMenu()
/*
mi.pszService = "/CreateChatRoom";
CreateProtoService(mi.pszService, &CToxProto::OnCreateChatRoom);
- mi.name.t = LPGENT("Create group chat");
+ mi.name.w = LPGENW("Create group chat");
mi.position = SMI_POSITION + SMI_GROUPCHAT_CREATE;
mi.hIcolibItem = Skin_GetIconHandle("conference");
HGENMENU hCreateChatRoom = Menu_AddProtoMenuItem(&mi, m_szModuleName);*/
diff --git a/protocols/Tox/src/tox_multimedia.cpp b/protocols/Tox/src/tox_multimedia.cpp
index 48526fa19e..1238ecfda7 100644
--- a/protocols/Tox/src/tox_multimedia.cpp
+++ b/protocols/Tox/src/tox_multimedia.cpp
@@ -31,7 +31,7 @@ void CToxCallDlgBase::SetIcon(const char *name)
Window_SetIcon_IcoLib(m_hwnd, IcoLib_GetIconHandle(iconName));
}
-void CToxCallDlgBase::SetTitle(const TCHAR *title)
+void CToxCallDlgBase::SetTitle(const wchar_t *title)
{
SetWindowText(m_hwnd, title);
}
@@ -51,10 +51,10 @@ void CToxIncomingCall::OnInitDialog()
CToxCallDlgBase::OnInitDialog();
Utils_RestoreWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "IncomingCallWindow_");
- TCHAR *nick = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *nick = pcli->pfnGetContactDisplayName(hContact, 0);
from.SetText(nick);
- TCHAR title[MAX_PATH];
+ wchar_t title[MAX_PATH];
mir_sntprintf(title, TranslateT("Incoming call from %s"), nick);
SetTitle(title);
SetIcon("audio_ring");
@@ -105,10 +105,10 @@ void CToxOutgoingCall::OnInitDialog()
CToxCallDlgBase::OnInitDialog();
Utils_RestoreWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "OutgoingCallWindow_");
- TCHAR *nick = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *nick = pcli->pfnGetContactDisplayName(hContact, 0);
to.SetText(nick);
- TCHAR title[MAX_PATH];
+ wchar_t title[MAX_PATH];
mir_sntprintf(title, TranslateT("Outgoing call to %s"), nick);
SetTitle(title);
SetIcon("audio_end");
@@ -147,7 +147,7 @@ void CToxOutgoingCall::OnCall(CCtrlBase*)
//mir_free(cSettings);
char *message = NULL;
- TCHAR title[MAX_PATH];
+ wchar_t title[MAX_PATH];
if (GetWindowText(m_hwnd, title, _countof(title)))
message = mir_utf8encodeT(title);
else
@@ -216,7 +216,7 @@ void CToxCallDialog::OnClose()
{
debugLogA(__FUNCTION__": failed to get input device caps (%d)", error);
- TCHAR errorMessage[MAX_PATH];
+ wchar_t errorMessage[MAX_PATH];
waveInGetErrorText(error, errorMessage, _countof(errorMessage));
CToxProto::ShowNotification(
TranslateT("Unable to find input audio device"),
@@ -315,7 +315,7 @@ void CToxProto::OnFriendCall(ToxAV *toxAV, uint32_t friend_number, bool audio_en
return;
}
- TCHAR message[MAX_PATH];
+ wchar_t message[MAX_PATH];
mir_sntprintf(message, TranslateT("Incoming call from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
T2Utf szMessage(message);
@@ -350,7 +350,7 @@ INT_PTR CToxProto::OnRecvAudioCall(WPARAM hContact, LPARAM lParam)
cle.lParam = DB_EVENT_CALL;
cle.hIcon = IcoLib_GetIconByHandle(GetIconHandle(IDI_AUDIO_RING));
- TCHAR szTooltip[MAX_PATH];
+ wchar_t szTooltip[MAX_PATH];
mir_sntprintf(szTooltip, TranslateT("Incoming call from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
cle.ptszTooltip = szTooltip;
@@ -520,7 +520,7 @@ static void CALLBACK ToxShowDialogApcProc(void *arg)
proto->debugLogA(__FUNCTION__": failed to open audio device (%d)", error);
toxav_hangup(proto->toxThread->Tox()AV, callId);
- TCHAR errorMessage[MAX_PATH];
+ wchar_t errorMessage[MAX_PATH];
waveInGetErrorText(error, errorMessage, _countof(errorMessage));
CToxProto::ShowNotification(
TranslateT("Unable to find output audio device"),
diff --git a/protocols/Tox/src/tox_multimedia.h b/protocols/Tox/src/tox_multimedia.h
index 2f3d41a93f..922b9b406f 100644
--- a/protocols/Tox/src/tox_multimedia.h
+++ b/protocols/Tox/src/tox_multimedia.h
@@ -14,7 +14,7 @@ protected:
INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
void SetIcon(const char *name);
- void SetTitle(const TCHAR *title);
+ void SetTitle(const wchar_t *title);
public:
CToxCallDlgBase(CToxProto *proto, int idDialog, MCONTACT hContact);
diff --git a/protocols/Tox/src/tox_network.cpp b/protocols/Tox/src/tox_network.cpp
index f4e6d887f5..c7212e780b 100644
--- a/protocols/Tox/src/tox_network.cpp
+++ b/protocols/Tox/src/tox_network.cpp
@@ -73,7 +73,7 @@ void CToxProto::BootstrapNodesFromJson(CToxThread *toxThread, bool isUdp, bool i
if (IsFileExists(path))
{
- FILE *hFile = _tfopen(path, L"r");
+ FILE *hFile = _wfopen(path, L"r");
if (hFile != NULL)
{
_fseeki64(hFile, 0, SEEK_END);
@@ -157,7 +157,7 @@ void CToxProto::UpdateNodes()
if (lastUpdate <= getDword("NodesUpdate", 0))
return;
- ptrT path(mir_tstrdup((TCHAR*)VARST(_T(TOX_JSON_PATH))));
+ ptrT path(mir_tstrdup((wchar_t*)VARST(_T(TOX_JSON_PATH))));
if (!IsFileExists(path))
{
HANDLE hProfile = CreateFile(path, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -169,7 +169,7 @@ void CToxProto::UpdateNodes()
CloseHandle(hProfile);
}
- FILE *hFile = _tfopen(path, L"w");
+ FILE *hFile = _wfopen(path, L"w");
if (!hFile)
{
debugLogA(__FUNCTION__": failed to open tox.json");
diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp
index 527144081b..8d65a7b0a8 100644
--- a/protocols/Tox/src/tox_options.cpp
+++ b/protocols/Tox/src/tox_options.cpp
@@ -104,11 +104,11 @@ void CToxOptionsMain::ProfileCreate_OnClick(CCtrlButton*)
void CToxOptionsMain::ProfileImport_OnClick(CCtrlButton*)
{
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
mir_sntprintf(filter, L"%s(*.tox)%c*.tox%c%s(*.*)%c*.*%c%c",
TranslateT("Tox profile"), 0, 0, TranslateT("All files"), 0, 0, 0);
- TCHAR profilePath[MAX_PATH] = { 0 };
+ wchar_t profilePath[MAX_PATH] = { 0 };
OPENFILENAME ofn = { sizeof(ofn) };
ofn.hwndOwner = m_hwnd;
@@ -162,11 +162,11 @@ void CToxOptionsMain::ProfileImport_OnClick(CCtrlButton*)
void CToxOptionsMain::ProfileExport_OnClick(CCtrlButton*)
{
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
mir_sntprintf(filter, L"%s(*.tox)%c*.tox%c%c",
TranslateT("Tox profile"), 0, 0, 0);
- TCHAR profilePath[MAX_PATH];
+ wchar_t profilePath[MAX_PATH];
mir_tstrncpy(profilePath, L"tox_save.tox", _countof(profilePath));
OPENFILENAME ofn = { sizeof(ofn) };
@@ -337,7 +337,7 @@ void CToxNodeEditor::OnInitDialog()
lvi.mask = LVIF_TEXT;
lvi.iItem = m_iItem;
lvi.cchTextMax = MAX_PATH;
- lvi.pszText = (TCHAR*)alloca(MAX_PATH * sizeof(TCHAR));
+ lvi.pszText = (wchar_t*)alloca(MAX_PATH * sizeof(wchar_t));
lvi.iSubItem = 0;
m_list->GetItem(&lvi);
@@ -542,7 +542,7 @@ void CToxOptionsNodeList::ReloadNodeList()
{
ptrA json;
- FILE *hFile = _tfopen(path, L"r");
+ FILE *hFile = _wfopen(path, L"r");
if (hFile != NULL)
{
_fseeki64(hFile, 0, SEEK_END);
@@ -614,7 +614,7 @@ void CToxOptionsNodeList::ReloadNodeList()
void CToxOptionsNodeList::OnApply()
{
char setting[MAX_PATH];
- TCHAR tszText[MAX_PATH];
+ wchar_t tszText[MAX_PATH];
LVITEM lvi = { 0 };
lvi.cchTextMax = MAX_PATH;
@@ -650,7 +650,7 @@ void CToxOptionsNodeList::OnApply()
lvi.iSubItem = 2;
m_nodes.GetItem(&lvi);
mir_snprintf(setting, TOX_SETTINGS_NODE_PORT, iItem);
- db_set_w(NULL, module, setting, _ttoi(lvi.pszText));
+ db_set_w(NULL, module, setting, _wtoi(lvi.pszText));
lvi.iSubItem = 3;
m_nodes.GetItem(&lvi);
@@ -680,19 +680,19 @@ void CToxOptionsNodeList::OnApply()
int CToxProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.ptszGroup = LPGENT("Network");
+ odp.pwszGroup = LPGENW("Network");
- odp.ptszTab = LPGENT("Account");
+ odp.pwszTab = LPGENW("Account");
odp.pDialog = CToxOptionsMain::CreateOptionsPage(this);
Options_AddPage(wParam, &odp);
- /*odp.ptszTab = LPGENT("Multimedia");
+ /*odp.pwszTab = LPGENW("Multimedia");
odp.pDialog = CToxOptionsMultimedia::CreateOptionsPage(this);
Options_AddPage(wParam, &odp);*/
- odp.ptszTab = LPGENT("Nodes");
+ odp.pwszTab = LPGENW("Nodes");
odp.pDialog = CToxOptionsNodeList::CreateOptionsPage(this);
Options_AddPage(wParam, &odp);
diff --git a/protocols/Tox/src/tox_profile.cpp b/protocols/Tox/src/tox_profile.cpp
index 8c4c49d442..32a024480d 100644
--- a/protocols/Tox/src/tox_profile.cpp
+++ b/protocols/Tox/src/tox_profile.cpp
@@ -2,15 +2,15 @@
HANDLE CToxProto::hProfileFolderPath;
-TCHAR* CToxProto::GetToxProfilePath()
+wchar_t* CToxProto::GetToxProfilePath()
{
return GetToxProfilePath(m_tszUserName);
}
-TCHAR* CToxProto::GetToxProfilePath(const TCHAR *accountName)
+wchar_t* CToxProto::GetToxProfilePath(const wchar_t *accountName)
{
- TCHAR *profilePath = (TCHAR*)mir_calloc(MAX_PATH * sizeof(TCHAR) + 1);
- TCHAR profileRootPath[MAX_PATH];
+ wchar_t *profilePath = (wchar_t*)mir_calloc(MAX_PATH * sizeof(wchar_t) + 1);
+ wchar_t profileRootPath[MAX_PATH];
FoldersGetCustomPathT(hProfileFolderPath, profileRootPath, _countof(profileRootPath), VARST(L"%miranda_userdata%"));
mir_sntprintf(profilePath, MAX_PATH, L"%s\\%s.tox", profileRootPath, accountName);
return profilePath;
@@ -26,7 +26,7 @@ bool CToxProto::LoadToxProfile(Tox_Options *options)
if (!IsFileExists(profilePath))
return false;
- FILE *profile = _tfopen(profilePath, L"rb");
+ FILE *profile = _wfopen(profilePath, L"rb");
if (profile == NULL)
{
ShowNotification(TranslateT("Unable to open Tox profile"), MB_ICONERROR);
@@ -122,7 +122,7 @@ void CToxProto::SaveToxProfile(CToxThread *toxThread)
}
ptrT profilePath(GetToxProfilePath());
- FILE *profile = _tfopen(profilePath, L"wb");
+ FILE *profile = _wfopen(profilePath, L"wb");
if (profile == NULL)
{
debugLogA(__FUNCTION__": failed to open tox profile");
diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp
index ef14dc0b0a..cf8987757d 100644
--- a/protocols/Tox/src/tox_proto.cpp
+++ b/protocols/Tox/src/tox_proto.cpp
@@ -1,6 +1,6 @@
#include "stdafx.h"
-CToxProto::CToxProto(const char* protoName, const TCHAR* userName)
+CToxProto::CToxProto(const char* protoName, const wchar_t* userName)
: PROTO<CToxProto>(protoName, userName),
hPollingThread(NULL), toxThread(NULL),
hOutDevice(NULL), hMessageProcess(1)
@@ -90,13 +90,13 @@ int CToxProto::AuthRecv(MCONTACT, PROTORECVEVENT* pre)
return Proto_AuthRecv(m_szModuleName, pre);
}
-int CToxProto::AuthRequest(MCONTACT hContact, const TCHAR *szMessage)
+int CToxProto::AuthRequest(MCONTACT hContact, const wchar_t *szMessage)
{
ptrA reason(mir_utf8encodeW(szMessage));
return OnRequestAuth(hContact, (LPARAM)reason);
}
-HANDLE CToxProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *tszPath)
+HANDLE CToxProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *tszPath)
{
return OnFileAllow(hContact, hTransfer, tszPath);
}
@@ -106,12 +106,12 @@ int CToxProto::FileCancel(MCONTACT hContact, HANDLE hTransfer)
return CancelTransfer(hContact, hTransfer);
}
-int CToxProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR*)
+int CToxProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t*)
{
return FileCancel(hContact, hTransfer);
}
-int CToxProto::FileResume(HANDLE hTransfer, int *action, const TCHAR **szFilename)
+int CToxProto::FileResume(HANDLE hTransfer, int *action, const wchar_t **szFilename)
{
return OnFileResume(hTransfer, action, szFilename);
}
@@ -131,7 +131,7 @@ int CToxProto::SendMsg(MCONTACT hContact, int, const char *msg)
return OnSendMessage(hContact, msg);
}
-HANDLE CToxProto::SendFile(MCONTACT hContact, const TCHAR *msg, TCHAR **ppszFiles)
+HANDLE CToxProto::SendFile(MCONTACT hContact, const wchar_t *msg, wchar_t **ppszFiles)
{
return OnSendFile(hContact, msg, ppszFiles);
}
@@ -200,7 +200,7 @@ HANDLE CToxProto::GetAwayMsg(MCONTACT hContact)
return 0;
}
-int CToxProto::SetAwayMsg(int, const TCHAR *msg)
+int CToxProto::SetAwayMsg(int, const wchar_t *msg)
{
if (IsOnline())
{
diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h
index d5bd786be9..615e713532 100644
--- a/protocols/Tox/src/tox_proto.h
+++ b/protocols/Tox/src/tox_proto.h
@@ -25,12 +25,12 @@ public:
virtual int __cdecl Authorize(MEVENT hDbEvent);
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage);
+ virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t* szMessage);
- virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* tszPath);
+ virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* tszPath);
virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* tszReason);
- virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** tszFilename);
+ virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* tszReason);
+ virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const wchar_t** tszFilename);
virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
@@ -39,19 +39,19 @@ public:
virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg);
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR*, TCHAR **ppszFiles);
+ virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t*, wchar_t **ppszFiles);
virtual int __cdecl SetStatus(int iNewStatus);
virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
- virtual int __cdecl SetAwayMsg(int iStatus, const TCHAR* msg);
+ virtual int __cdecl SetAwayMsg(int iStatus, const wchar_t* msg);
virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
virtual int __cdecl OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam);
// accounts
- static CToxProto* InitAccount(const char *protoName, const TCHAR *userName);
+ static CToxProto* InitAccount(const char *protoName, const wchar_t *userName);
static int UninitAccount(CToxProto *proto);
// icons
@@ -68,7 +68,7 @@ public:
private:
CToxThread *toxThread;
mir_cs profileLock;
- TCHAR *accountName;
+ wchar_t *accountName;
HANDLE hPollingThread;
CTransferList transfers;
ULONG hMessageProcess;
@@ -76,8 +76,8 @@ private:
static HANDLE hProfileFolderPath;
// tox profile
- TCHAR* GetToxProfilePath();
- static TCHAR* GetToxProfilePath(const TCHAR *accountName);
+ wchar_t* GetToxProfilePath();
+ static wchar_t* GetToxProfilePath(const wchar_t *accountName);
bool LoadToxProfile(Tox_Options *options);
void SaveToxProfile(CToxThread *toxThread);
@@ -225,9 +225,9 @@ private:
int __cdecl OnPreCreateMessage(WPARAM wParam, LPARAM lParam);
// transfer
- HANDLE OnFileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *tszPath);
- int OnFileResume(HANDLE hTransfer, int *action, const TCHAR **szFilename);
- HANDLE OnSendFile(MCONTACT hContact, const TCHAR*, TCHAR **ppszFiles);
+ HANDLE OnFileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *tszPath);
+ int OnFileResume(HANDLE hTransfer, int *action, const wchar_t **szFilename);
+ HANDLE OnSendFile(MCONTACT hContact, const wchar_t*, wchar_t **ppszFiles);
int CancelTransfer(MCONTACT hContact, HANDLE hTransfer);
@@ -244,8 +244,8 @@ private:
void CancelAllTransfers(CToxThread *toxThread);
// avatars
- TCHAR* GetAvatarFilePath(MCONTACT hContact = NULL);
- void SetToxAvatar(const TCHAR* path);
+ wchar_t* GetAvatarFilePath(MCONTACT hContact = NULL);
+ void SetToxAvatar(const wchar_t* path);
INT_PTR __cdecl GetAvatarCaps(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl GetAvatarInfo(WPARAM, LPARAM lParam);
@@ -284,13 +284,13 @@ private:
static TOX_USER_STATUS MirandaToToxStatus(int status);
static int ToxToMirandaStatus(TOX_USER_STATUS userstatus);
- static TCHAR* ToxErrorToString(TOX_ERR_NEW error);
- static TCHAR* ToxErrorToString(TOX_ERR_FRIEND_SEND_MESSAGE error);
+ static wchar_t* ToxErrorToString(TOX_ERR_NEW error);
+ static wchar_t* ToxErrorToString(TOX_ERR_FRIEND_SEND_MESSAGE error);
- static void ShowNotification(const TCHAR *message, int flags = 0, MCONTACT hContact = NULL);
- static void ShowNotification(const TCHAR *caption, const TCHAR *message, int flags = 0, MCONTACT hContact = NULL);
+ static void ShowNotification(const wchar_t *message, int flags = 0, MCONTACT hContact = NULL);
+ static void ShowNotification(const wchar_t *caption, const wchar_t *message, int flags = 0, MCONTACT hContact = NULL);
- static bool IsFileExists(const TCHAR* path);
+ static bool IsFileExists(const wchar_t* path);
MEVENT AddEventToDb(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, PBYTE pBlob, size_t cbBlob);
diff --git a/protocols/Tox/src/tox_search.cpp b/protocols/Tox/src/tox_search.cpp
index 197f1baaa3..ece71c724d 100644
--- a/protocols/Tox/src/tox_search.cpp
+++ b/protocols/Tox/src/tox_search.cpp
@@ -91,7 +91,7 @@ void CToxProto::SearchByNameAsync(void *arg)
/*int resolved = 0;
- if (IsFileExists((TCHAR*)VARST(_T(TOX_INI_PATH))))
+ if (IsFileExists((wchar_t*)VARST(_T(TOX_INI_PATH))))
{
char fileName[MAX_PATH];
mir_strcpy(fileName, VARS(TOX_INI_PATH));
@@ -223,7 +223,7 @@ HWND CToxProto::OnSearchAdvanced(HWND owner)
std::smatch match;
std::regex regex("^\\s*([A-Fa-f0-9]{76})\\s*$");
- TCHAR text[MAX_PATH];
+ wchar_t text[MAX_PATH];
GetDlgItemText(owner, IDC_SEARCH, text, _countof(text));
const std::string query = T2Utf(text).str();
diff --git a/protocols/Tox/src/tox_services.cpp b/protocols/Tox/src/tox_services.cpp
index 3875a66f47..1b5ab155a6 100644
--- a/protocols/Tox/src/tox_services.cpp
+++ b/protocols/Tox/src/tox_services.cpp
@@ -2,7 +2,7 @@
INT_PTR CToxProto::SetMyNickname(WPARAM wParam, LPARAM lParam)
{
- ptrT nickname((wParam & SMNN_UNICODE) ? mir_u2t((TCHAR*)lParam) : mir_a2t((char*)lParam));
+ ptrT nickname((wParam & SMNN_UNICODE) ? mir_u2t((wchar_t*)lParam) : mir_a2t((char*)lParam));
setTString("Nick", nickname);
if (IsOnline())
diff --git a/protocols/Tox/src/tox_transfer.cpp b/protocols/Tox/src/tox_transfer.cpp
index e2b3286d22..d775117f70 100644
--- a/protocols/Tox/src/tox_transfer.cpp
+++ b/protocols/Tox/src/tox_transfer.cpp
@@ -19,7 +19,7 @@ void CToxProto::OnFriendFile(Tox*, uint32_t friendNumber, uint32_t fileNumber, u
Netlib_Logf(proto->m_hNetlibUser, __FUNCTION__": incoming avatar (%d) from (%d)", fileNumber, friendNumber);
ptrT address(proto->getTStringA(hContact, TOX_SETTINGS_ID));
- TCHAR avatarName[MAX_PATH];
+ wchar_t avatarName[MAX_PATH];
mir_sntprintf(avatarName, MAX_PATH, L"%s.png", address);
AvatarTransferParam *transfer = new AvatarTransferParam(friendNumber, fileNumber, avatarName, fileSize);
@@ -45,7 +45,7 @@ void CToxProto::OnFriendFile(Tox*, uint32_t friendNumber, uint32_t fileNumber, u
ptrA rawName((char*)mir_alloc(filenameLength + 1));
memcpy(rawName, fileName, filenameLength);
rawName[filenameLength] = 0;
- TCHAR *name = mir_utf8decodeT(rawName);
+ wchar_t *name = mir_utf8decodeT(rawName);
FileTransferParam *transfer = new FileTransferParam(friendNumber, fileNumber, name, fileSize);
transfer->pfts.flags |= PFTS_RECEIVING;
@@ -56,8 +56,8 @@ void CToxProto::OnFriendFile(Tox*, uint32_t friendNumber, uint32_t fileNumber, u
pre.dwFlags = PRFF_TCHAR;
pre.fileCount = 1;
pre.timestamp = time(NULL);
- pre.descr.t = L"";
- pre.files.t = &name;
+ pre.descr.w = L"";
+ pre.files.w = &name;
pre.lParam = (LPARAM)transfer;
ProtoChainRecvFile(hContact, &pre);
}
@@ -71,20 +71,20 @@ void CToxProto::OnFriendFile(Tox*, uint32_t friendNumber, uint32_t fileNumber, u
}
// file request is allowed
-HANDLE CToxProto::OnFileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *tszPath)
+HANDLE CToxProto::OnFileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *tszPath)
{
FileTransferParam *transfer = (FileTransferParam*)hTransfer;
transfer->pfts.tszWorkingDir = mir_tstrdup(tszPath);
// stupid fix
- TCHAR fullPath[MAX_PATH];
+ wchar_t fullPath[MAX_PATH];
mir_sntprintf(fullPath, L"%s\\%s", transfer->pfts.tszWorkingDir, transfer->pfts.tszCurrentFile);
transfer->ChangeName(fullPath);
if (!ProtoBroadcastAck(hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, (HANDLE)transfer, (LPARAM)&transfer->pfts))
{
int action = FILERESUME_OVERWRITE;
- const TCHAR **szFilename = (const TCHAR**)mir_alloc(sizeof(TCHAR*) * 2);
+ const wchar_t **szFilename = (const wchar_t**)mir_alloc(sizeof(wchar_t*) * 2);
szFilename[0] = fullPath;
szFilename[1] = NULL;
OnFileResume(hTransfer, &action, szFilename);
@@ -95,7 +95,7 @@ HANDLE CToxProto::OnFileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *
}
// if file is exists
-int CToxProto::OnFileResume(HANDLE hTransfer, int *action, const TCHAR **szFilename)
+int CToxProto::OnFileResume(HANDLE hTransfer, int *action, const wchar_t **szFilename)
{
FileTransferParam *transfer = (FileTransferParam*)hTransfer;
@@ -111,7 +111,7 @@ int CToxProto::OnFileResume(HANDLE hTransfer, int *action, const TCHAR **szFilen
ToxHexAddress pubKey = GetContactPublicKey(transfer->friendNumber);
- TCHAR *mode = *action == FILERESUME_OVERWRITE ? L"wb" : L"ab";
+ wchar_t *mode = *action == FILERESUME_OVERWRITE ? L"wb" : L"ab";
if (!transfer->OpenFile(mode))
{
debugLogA(__FUNCTION__": failed to open file (%d) from %s(%d)", transfer->fileNumber, (const char*)pubKey, transfer->friendNumber);
@@ -200,23 +200,23 @@ void CToxProto::OnDataReceiving(Tox*, uint32_t friendNumber, uint32_t fileNumber
/* FILE SENDING */
// outcoming file flow
-HANDLE CToxProto::OnSendFile(MCONTACT hContact, const TCHAR*, TCHAR **ppszFiles)
+HANDLE CToxProto::OnSendFile(MCONTACT hContact, const wchar_t*, wchar_t **ppszFiles)
{
int32_t friendNumber = GetToxFriendNumber(hContact);
if (friendNumber == UINT32_MAX)
return NULL;
- FILE *hFile = _tfopen(ppszFiles[0], L"rb");
+ FILE *hFile = _wfopen(ppszFiles[0], L"rb");
if (hFile == NULL)
{
debugLogA(__FUNCTION__": cannot open file %s", ppszFiles[0]);
return NULL;
}
- TCHAR *fileName = _tcsrchr(ppszFiles[0], '\\') + 1;
+ wchar_t *fileName = wcsrchr(ppszFiles[0], '\\') + 1;
size_t fileDirLength = fileName - ppszFiles[0];
- TCHAR *fileDir = (TCHAR*)mir_alloc(sizeof(TCHAR)*(fileDirLength + 1));
- _tcsncpy(fileDir, ppszFiles[0], fileDirLength);
+ wchar_t *fileDir = (wchar_t*)mir_alloc(sizeof(wchar_t)*(fileDirLength + 1));
+ wcsncpy(fileDir, ppszFiles[0], fileDirLength);
fileDir[fileDirLength] = '\0';
_fseeki64(hFile, 0, SEEK_END);
diff --git a/protocols/Tox/src/tox_transfer.h b/protocols/Tox/src/tox_transfer.h
index a8dcc55b62..40f8faea75 100644
--- a/protocols/Tox/src/tox_transfer.h
+++ b/protocols/Tox/src/tox_transfer.h
@@ -11,7 +11,7 @@ struct FileTransferParam
TOX_FILE_KIND transferType;
- FileTransferParam(uint32_t friendNumber, uint32_t fileNumber, const TCHAR *fileName, uint64_t fileSize)
+ FileTransferParam(uint32_t friendNumber, uint32_t fileNumber, const wchar_t *fileName, uint64_t fileSize)
{
hFile = NULL;
this->friendNumber = friendNumber;
@@ -22,7 +22,7 @@ struct FileTransferParam
pfts.flags = PFTS_TCHAR;
pfts.hContact = NULL;
pfts.totalFiles = 1;
- pfts.ptszFiles = (TCHAR**)mir_alloc(sizeof(TCHAR*)*(pfts.totalFiles + 1));
+ pfts.ptszFiles = (wchar_t**)mir_alloc(sizeof(wchar_t*)*(pfts.totalFiles + 1));
pfts.ptszFiles[0] = pfts.tszCurrentFile = mir_tstrdup(fileName);
pfts.ptszFiles[pfts.totalFiles] = NULL;
pfts.totalBytes = pfts.currentFileSize = fileSize;
@@ -34,13 +34,13 @@ struct FileTransferParam
transferType = TOX_FILE_KIND_DATA;
}
- bool OpenFile(const TCHAR *mode)
+ bool OpenFile(const wchar_t *mode)
{
- hFile = _tfopen(pfts.tszCurrentFile, mode);
+ hFile = _wfopen(pfts.tszCurrentFile, mode);
return hFile != NULL;
}
- void ChangeName(const TCHAR *fileName)
+ void ChangeName(const wchar_t *fileName)
{
pfts.ptszFiles[0] = replaceStrT(pfts.tszCurrentFile, fileName);
}
@@ -68,7 +68,7 @@ struct AvatarTransferParam : public FileTransferParam
{
uint8_t hash[TOX_HASH_LENGTH];
- AvatarTransferParam(uint32_t friendNumber, uint32_t fileNumber, const TCHAR *fileName, uint64_t fileSize)
+ AvatarTransferParam(uint32_t friendNumber, uint32_t fileNumber, const wchar_t *fileName, uint64_t fileSize)
: FileTransferParam(friendNumber, fileNumber, fileName, fileSize)
{
transferType = TOX_FILE_KIND_AVATAR;
diff --git a/protocols/Tox/src/tox_utils.cpp b/protocols/Tox/src/tox_utils.cpp
index 0ad5015340..f09f7ca8c1 100644
--- a/protocols/Tox/src/tox_utils.cpp
+++ b/protocols/Tox/src/tox_utils.cpp
@@ -55,7 +55,7 @@ int CToxProto::ToxToMirandaStatus(TOX_USER_STATUS userstatus)
return status;
}
-TCHAR* CToxProto::ToxErrorToString(TOX_ERR_NEW error)
+wchar_t* CToxProto::ToxErrorToString(TOX_ERR_NEW error)
{
switch (error)
{
@@ -82,20 +82,20 @@ TCHAR* CToxProto::ToxErrorToString(TOX_ERR_NEW error)
}
}
-TCHAR* CToxProto::ToxErrorToString(TOX_ERR_FRIEND_SEND_MESSAGE error)
+wchar_t* CToxProto::ToxErrorToString(TOX_ERR_FRIEND_SEND_MESSAGE error)
{
switch (error)
{
- case TOX_ERR_FRIEND_SEND_MESSAGE_NULL:
- return TranslateT("One of the arguments is missing");
- case TOX_ERR_FRIEND_SEND_MESSAGE_FRIEND_NOT_FOUND:
- return TranslateT("The friend number did not designate a valid friend");
- case TOX_ERR_FRIEND_SEND_MESSAGE_FRIEND_NOT_CONNECTED:
- return TranslateT("This client is currently not connected to the friend");
- case TOX_ERR_FRIEND_SEND_MESSAGE_SENDQ:
- return TranslateT("An allocation error occurred while increasing the send queue size");
- case TOX_ERR_FRIEND_SEND_MESSAGE_TOO_LONG:
- return TranslateT("Message length exceeded TOX_MAX_MESSAGE_LENGTH");
+ case TOX_ERR_FRIEND_SEND_MESSAGE_NULL:
+ return TranslateT("One of the arguments is missing");
+ case TOX_ERR_FRIEND_SEND_MESSAGE_FRIEND_NOT_FOUND:
+ return TranslateT("The friend number did not designate a valid friend");
+ case TOX_ERR_FRIEND_SEND_MESSAGE_FRIEND_NOT_CONNECTED:
+ return TranslateT("This client is currently not connected to the friend");
+ case TOX_ERR_FRIEND_SEND_MESSAGE_SENDQ:
+ return TranslateT("An allocation error occurred while increasing the send queue size");
+ case TOX_ERR_FRIEND_SEND_MESSAGE_TOO_LONG:
+ return TranslateT("Message length exceeded TOX_MAX_MESSAGE_LENGTH");
case TOX_ERR_FRIEND_SEND_MESSAGE_EMPTY:
return TranslateT("Attempted to send a zero-length message");
default:
@@ -103,7 +103,7 @@ TCHAR* CToxProto::ToxErrorToString(TOX_ERR_FRIEND_SEND_MESSAGE error)
}
}
-void CToxProto::ShowNotification(const TCHAR *caption, const TCHAR *message, int flags, MCONTACT hContact)
+void CToxProto::ShowNotification(const wchar_t *caption, const wchar_t *message, int flags, MCONTACT hContact)
{
if (Miranda_Terminated())
{
@@ -125,14 +125,14 @@ void CToxProto::ShowNotification(const TCHAR *caption, const TCHAR *message, int
MessageBox(NULL, message, caption, MB_OK | flags);
}
-void CToxProto::ShowNotification(const TCHAR *message, int flags, MCONTACT hContact)
+void CToxProto::ShowNotification(const wchar_t *message, int flags, MCONTACT hContact)
{
ShowNotification(_T(MODULE), message, flags, hContact);
}
-bool CToxProto::IsFileExists(const TCHAR* path)
+bool CToxProto::IsFileExists(const wchar_t* path)
{
- return _taccess(path, 0) == 0;
+ return _waccess(path, 0) == 0;
}
MEVENT CToxProto::AddEventToDb(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, PBYTE pBlob, size_t cbBlob)
@@ -149,7 +149,7 @@ MEVENT CToxProto::AddEventToDb(MCONTACT hContact, WORD type, DWORD timestamp, DW
INT_PTR CToxProto::ParseToxUri(WPARAM, LPARAM lParam)
{
- TCHAR *uri = (TCHAR*)lParam;
+ wchar_t *uri = (wchar_t*)lParam;
if (mir_tstrlen(uri) <= 4)
return 1;
@@ -168,7 +168,7 @@ INT_PTR CToxProto::ParseToxUri(WPARAM, LPARAM lParam)
if (proto == NULL)
return 1;
- if (_tcschr(uri, _T('@')) != NULL)
+ if (wcschr(uri, '@') != NULL)
return 1;
PROTOSEARCHRESULT psr = { sizeof(psr) };
diff --git a/protocols/Twitter/src/StringUtil.cpp b/protocols/Twitter/src/StringUtil.cpp
index d9b7123216..a902495c20 100644
--- a/protocols/Twitter/src/StringUtil.cpp
+++ b/protocols/Twitter/src/StringUtil.cpp
@@ -24,7 +24,7 @@ THE SOFTWARE.
#include "stdafx.h"
-void Split(const tstring& str, std::vector<tstring>& out, TCHAR sep, bool includeEmpty)
+void Split(const wstring& str, std::vector<wstring>& out, wchar_t sep, bool includeEmpty)
{
unsigned start = 0;
unsigned end = 0;
@@ -44,7 +44,7 @@ void Split(const tstring& str, std::vector<tstring>& out, TCHAR sep, bool includ
}
}
-tstring GetWord(const tstring& str, unsigned index, bool getRest)
+wstring GetWord(const wstring& str, unsigned index, bool getRest)
{
unsigned start = 0;
unsigned end = 0;
@@ -52,7 +52,7 @@ tstring GetWord(const tstring& str, unsigned index, bool getRest)
unsigned count = 0;
while (true) {
- if (end == str.size() || str[end] == _T(' ')) {
+ if (end == str.size() || str[end] == ' ') {
if (end > start) {
if (count == index) {
if (getRest)
diff --git a/protocols/Twitter/src/StringUtil.h b/protocols/Twitter/src/StringUtil.h
index 0fe42aedce..f1ebdb55e1 100644
--- a/protocols/Twitter/src/StringUtil.h
+++ b/protocols/Twitter/src/StringUtil.h
@@ -25,8 +25,8 @@ THE SOFTWARE.
#ifndef _STRINGUTIL_H_INCLUDED_
#define _STRINGUTIL_H_INCLUDED_
-void Split(const tstring& str, std::vector<tstring>& out, TCHAR sep, bool includeEmpty);
-tstring GetWord(const tstring& str, unsigned index, bool getRest = false);
+void Split(const wstring& str, std::vector<wstring>& out, wchar_t sep, bool includeEmpty);
+wstring GetWord(const wstring& str, unsigned index, bool getRest = false);
std::string& replaceAll(std::string& context, const std::string& from, const std::string& to);
@@ -42,7 +42,7 @@ inline std::wstring UTF8ToWide(const std::string& str)
return (wchar_t*)ptrW(mir_utf8decodeW(str.c_str()));
}
-inline bool Compare(const tstring& one, const tstring& two, bool caseSensitive)
+inline bool Compare(const wstring& one, const wstring& two, bool caseSensitive)
{
return caseSensitive ? (one == two) : (mir_tstrcmpi(one.c_str(), two.c_str()) == 0);
}
diff --git a/protocols/Twitter/src/chat.cpp b/protocols/Twitter/src/chat.cpp
index 13d438c185..940d34eee5 100644
--- a/protocols/Twitter/src/chat.cpp
+++ b/protocols/Twitter/src/chat.cpp
@@ -51,9 +51,9 @@ void TwitterProto::UpdateChat(const twitter_user &update)
CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast<LPARAM>(&gce));
- mir_free(const_cast<TCHAR*>(gce.ptszNick));
- mir_free(const_cast<TCHAR*>(gce.ptszUID));
- mir_free(const_cast<TCHAR*>(gce.ptszText));
+ mir_free(const_cast<wchar_t*>(gce.ptszNick));
+ mir_free(const_cast<wchar_t*>(gce.ptszUID));
+ mir_free(const_cast<wchar_t*>(gce.ptszText));
}
int TwitterProto::OnChatOutgoing(WPARAM, LPARAM lParam)
@@ -98,8 +98,8 @@ void TwitterProto::AddChatContact(const char *name, const char *nick)
gce.ptszStatus = L"Normal";
CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast<LPARAM>(&gce));
- mir_free(const_cast<TCHAR*>(gce.ptszNick));
- mir_free(const_cast<TCHAR*>(gce.ptszUID));
+ mir_free(const_cast<wchar_t*>(gce.ptszNick));
+ mir_free(const_cast<wchar_t*>(gce.ptszUID));
}
void TwitterProto::DeleteChatContact(const char *name)
@@ -111,7 +111,7 @@ void TwitterProto::DeleteChatContact(const char *name)
gce.ptszUID = gce.ptszNick;
CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast<LPARAM>(&gce));
- mir_free(const_cast<TCHAR*>(gce.ptszNick));
+ mir_free(const_cast<wchar_t*>(gce.ptszNick));
}
INT_PTR TwitterProto::OnJoinChat(WPARAM, LPARAM suppress)
diff --git a/protocols/Twitter/src/connection.cpp b/protocols/Twitter/src/connection.cpp
index 87c5e25aaa..bad7284cbf 100644
--- a/protocols/Twitter/src/connection.cpp
+++ b/protocols/Twitter/src/connection.cpp
@@ -400,7 +400,7 @@ void TwitterProto::UpdateAvatarWorker(void *p)
return;
std::string ext = data->url.substr(data->url.rfind('.')); // finds the filetype of the avatar
- std::tstring filename = GetAvatarFolder() + _T('\\') + dbv.ptszVal + (TCHAR*)_A2T(ext.c_str()); // local filename and path
+ std::wstring filename = GetAvatarFolder() + L'\\' + dbv.ptszVal + (wchar_t*)_A2T(ext.c_str()); // local filename and path
db_free(&dbv);
PROTO_AVATAR_INFORMATION ai = { 0 };
@@ -412,7 +412,7 @@ void TwitterProto::UpdateAvatarWorker(void *p)
return; // lets just ignore unknown formats... if not it crashes miranda. should probably speak to borkra about this.
}
- _tcsncpy(ai.filename, filename.c_str(), MAX_PATH); // puts the local file name in the avatar struct, to a max of 260 chars (as of now)
+ wcsncpy(ai.filename, filename.c_str(), MAX_PATH); // puts the local file name in the avatar struct, to a max of 260 chars (as of now)
debugLogA("***** Updating avatar: %s", data->url.c_str());
mir_cslock lck(avatar_lock_);
@@ -536,7 +536,7 @@ void TwitterProto::ShowContactPopup(MCONTACT hContact, const std::string &text,
DBVARIANT dbv;
if (!db_get_ts(hContact, "CList", "MyHandle", &dbv) || !getTString(hContact, TWITTER_KEY_UN, &dbv)) {
- _tcsncpy(popup.lptzContactName, dbv.ptszVal, MAX_CONTACTNAME);
+ wcsncpy(popup.lptzContactName, dbv.ptszVal, MAX_CONTACTNAME);
db_free(&dbv);
}
diff --git a/protocols/Twitter/src/contacts.cpp b/protocols/Twitter/src/contacts.cpp
index e6c2321d29..880ba6974a 100644
--- a/protocols/Twitter/src/contacts.cpp
+++ b/protocols/Twitter/src/contacts.cpp
@@ -49,8 +49,8 @@ MCONTACT TwitterProto::AddToList(int, PROTOSEARCHRESULT *psr)
if (m_iStatus != ID_STATUS_ONLINE)
return 0;
- ForkThread(&TwitterProto::AddToListWorker, mir_utf8encodeT(psr->nick.t));
- return AddToClientList(_T2A(psr->nick.t), "");
+ ForkThread(&TwitterProto::AddToListWorker, mir_utf8encodeT(psr->nick.w));
+ return AddToClientList(_T2A(psr->nick.w), "");
}
// *************************
@@ -93,10 +93,10 @@ int TwitterProto::GetInfo(MCONTACT hContact, int info_type)
struct search_query
{
- search_query(const std::tstring &_query, bool _by_email) : query(_query), by_email(_by_email)
+ search_query(const std::wstring &_query, bool _by_email) : query(_query), by_email(_by_email)
{
}
- std::tstring query;
+ std::wstring query;
bool by_email;
};
@@ -127,27 +127,27 @@ void TwitterProto::DoSearch(void *pArg)
if (found) {
PROTOSEARCHRESULT psr = { sizeof(psr) };
psr.flags = PSR_TCHAR;
- psr.nick.t = mir_a2t(info.username.c_str());
- psr.firstName.t = mir_a2t(info.real_name.c_str());
+ psr.nick.w = mir_a2t(info.username.c_str());
+ psr.firstName.w = mir_a2t(info.real_name.c_str());
ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)&psr);
ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)1, 0);
- mir_free(psr.nick.t);
- mir_free(psr.firstName.t);
+ mir_free(psr.nick.w);
+ mir_free(psr.firstName.w);
}
else ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)1, 0);
delete query;
}
-HANDLE TwitterProto::SearchBasic(const TCHAR *username)
+HANDLE TwitterProto::SearchBasic(const wchar_t *username)
{
ForkThread(&TwitterProto::DoSearch, new search_query(username, false));
return (HANDLE)1;
}
-HANDLE TwitterProto::SearchByEmail(const TCHAR *email)
+HANDLE TwitterProto::SearchByEmail(const wchar_t *email)
{
ForkThread(&TwitterProto::DoSearch, new search_query(email, true));
return (HANDLE)1;
diff --git a/protocols/Twitter/src/main.cpp b/protocols/Twitter/src/main.cpp
index 2995269fcd..ccc9b20db5 100644
--- a/protocols/Twitter/src/main.cpp
+++ b/protocols/Twitter/src/main.cpp
@@ -70,7 +70,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC
/////////////////////////////////////////////////////////////////////////////////////////
// Load
-static PROTO_INTERFACE* protoInit(const char *proto_name, const TCHAR *username)
+static PROTO_INTERFACE* protoInit(const char *proto_name, const wchar_t *username)
{
TwitterProto *proto = new TwitterProto(proto_name, username);
g_Instances.insert(proto);
diff --git a/protocols/Twitter/src/oauth.cpp b/protocols/Twitter/src/oauth.cpp
index 2bd69b9837..b87e008bcb 100644
--- a/protocols/Twitter/src/oauth.cpp
+++ b/protocols/Twitter/src/oauth.cpp
@@ -396,5 +396,5 @@ wstring mir_twitter::OAuthCreateSignature(const wstring& signatureBase, const ws
string data = WideToUTF8(signatureBase);
mir_hmac_sha1(digest, (PBYTE)keyBytes.c_str(), keyBytes.size(), (PBYTE)data.c_str(), data.size());
ptrA encoded(mir_base64_encode(digest, sizeof(digest)));
- return UrlEncode((TCHAR*)_A2T(encoded));
+ return UrlEncode((wchar_t*)_A2T(encoded));
}
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp
index ffa2245609..5b58154808 100644
--- a/protocols/Twitter/src/proto.cpp
+++ b/protocols/Twitter/src/proto.cpp
@@ -26,7 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
static volatile LONG g_msgid = 1;
-TwitterProto::TwitterProto(const char *proto_name, const TCHAR *username) :
+TwitterProto::TwitterProto(const char *proto_name, const wchar_t *username) :
PROTO<TwitterProto>(proto_name, username)
{
CreateProtoService(PS_CREATEACCMGRUI, &TwitterProto::SvcCreateAccMgrUI);
@@ -264,7 +264,7 @@ int TwitterProto::OnBuildStatusMenu(WPARAM, LPARAM)
// "Send Tweet..."
mi.pszService = "/Tweet";
CreateProtoService(mi.pszService, &TwitterProto::OnTweet);
- mi.name.t = LPGENT("Send Tweet...");
+ mi.name.w = LPGENW("Send Tweet...");
mi.position = 200001;
mi.hIcolibItem = GetIconHandle("tweet");
Menu_AddStatusMenuItem(&mi, m_szModuleName);
@@ -276,18 +276,18 @@ int TwitterProto::OnOptionsInit(WPARAM wParam, LPARAM)
OPTIONSDIALOGPAGE odp = { 0 };
odp.position = 271828;
odp.hInstance = g_hInstance;
- odp.ptszGroup = LPGENT("Network");
- odp.ptszTitle = m_tszUserName;
+ odp.pwszGroup = LPGENW("Network");
+ odp.pwszTitle = m_tszUserName;
odp.dwInitParam = LPARAM(this);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.ptszTab = LPGENT("Basic");
+ odp.pwszTab = LPGENW("Basic");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.pfnDlgProc = options_proc;
Options_AddPage(wParam, &odp);
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
- odp.ptszTab = LPGENT("Popups");
+ odp.pwszTab = LPGENW("Popups");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS_POPUPS);
odp.pfnDlgProc = popup_options_proc;
Options_AddPage(wParam, &odp);
@@ -307,7 +307,7 @@ INT_PTR TwitterProto::OnTweet(WPARAM, LPARAM)
int TwitterProto::OnModulesLoaded(WPARAM, LPARAM)
{
- TCHAR descr[512];
+ wchar_t descr[512];
NETLIBUSER nlu = { sizeof(nlu) };
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR;
nlu.szSettingsModule = m_szModuleName;
@@ -317,7 +317,7 @@ int TwitterProto::OnModulesLoaded(WPARAM, LPARAM)
nlu.ptszDescriptiveName = descr;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
if (m_hNetlibUser == NULL) {
- TCHAR error[200];
+ wchar_t error[200];
mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
MessageBox(NULL, error, L"Miranda NG", MB_OK | MB_ICONERROR);
}
@@ -330,7 +330,7 @@ int TwitterProto::OnModulesLoaded(WPARAM, LPARAM)
nlu.ptszDescriptiveName = descr;
hAvatarNetlib_ = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
if (hAvatarNetlib_ == NULL) {
- TCHAR error[200];
+ wchar_t error[200];
mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), TranslateT("Twitter (avatars)"));
MessageBox(NULL, error, L"Miranda NG", MB_OK | MB_ICONERROR);
}
@@ -421,7 +421,7 @@ void TwitterProto::SendTweetWorker(void *p)
char *text = static_cast<char*>(p);
if (mir_strlen(mir_utf8decodeA(text)) > 140) { // looks like the chat max outgoing msg thing doesn't work, so i'll do it here.
- TCHAR errorPopup[280];
+ wchar_t errorPopup[280];
mir_sntprintf(errorPopup, TranslateT("Don't be crazy! Everyone knows the max tweet size is 140, and you're trying to fit %d chars in there?"), mir_strlen(text));
ShowPopup(errorPopup, 1);
return;
@@ -452,9 +452,9 @@ void TwitterProto::UpdateSettings()
}
}
-std::tstring TwitterProto::GetAvatarFolder()
+std::wstring TwitterProto::GetAvatarFolder()
{
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
mir_sntprintf(path, L"%s\\%s", VARST(L"%miranda_avatarcache%"), m_tszUserName);
return path;
}
diff --git a/protocols/Twitter/src/proto.h b/protocols/Twitter/src/proto.h
index 4ef55b48cf..9aaa196240 100644
--- a/protocols/Twitter/src/proto.h
+++ b/protocols/Twitter/src/proto.h
@@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
class TwitterProto : public PROTO<TwitterProto>
{
public:
- TwitterProto(const char*,const TCHAR*);
+ TwitterProto(const char*,const wchar_t*);
~TwitterProto();
//PROTO_INTERFACE
@@ -33,8 +33,8 @@ public:
virtual DWORD_PTR __cdecl GetCaps(int, MCONTACT = 0);
virtual int __cdecl GetInfo(MCONTACT, int);
- virtual HANDLE __cdecl SearchBasic(const TCHAR *);
- virtual HANDLE __cdecl SearchByEmail(const TCHAR *);
+ virtual HANDLE __cdecl SearchBasic(const wchar_t *);
+ virtual HANDLE __cdecl SearchByEmail(const wchar_t *);
virtual int __cdecl RecvMsg(MCONTACT, PROTORECVEVENT *);
virtual int __cdecl SendMsg(MCONTACT, int, const char *);
@@ -108,7 +108,7 @@ private:
void TwitterProto::resetOAuthKeys();
- std::tstring GetAvatarFolder();
+ std::wstring GetAvatarFolder();
mir_cs signon_lock_;
mir_cs avatar_lock_;
diff --git a/protocols/Twitter/src/stdafx.h b/protocols/Twitter/src/stdafx.h
index d8b3ba5274..bd46045ca8 100644
--- a/protocols/Twitter/src/stdafx.h
+++ b/protocols/Twitter/src/stdafx.h
@@ -10,7 +10,6 @@
#include <Wincrypt.h>
#include <stdio.h>
#include <direct.h>
-#include <tchar.h>
#include <time.h>
#include <cstdio>
@@ -29,7 +28,7 @@ using std::list;
using std::min;
#include <sstream>
-typedef std::basic_string<TCHAR> tstring;
+typedef std::basic_string<wchar_t> wstring;
#include "resource.h"
diff --git a/protocols/Twitter/src/theme.cpp b/protocols/Twitter/src/theme.cpp
index db2f27dcf7..4f0f988d02 100644
--- a/protocols/Twitter/src/theme.cpp
+++ b/protocols/Twitter/src/theme.cpp
@@ -95,7 +95,7 @@ void InitContactMenus()
SET_UID(mi, 0xfc4e1245, 0xc8e0, 0x4de2, 0x92, 0x15, 0xfc, 0xcf, 0x48, 0xf9, 0x41, 0x56);
mi.position = -2000006000;
mi.hIcolibItem = GetIconHandle("reply");
- mi.name.t = LPGENT("Reply...");
+ mi.name.w = LPGENW("Reply...");
mi.pszService = "Twitter/ReplyToTweet";
g_hMenuItems[0] = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, GlobalService<&TwitterProto::ReplyToTweet>);
@@ -103,7 +103,7 @@ void InitContactMenus()
SET_UID(mi, 0x7f7e4c24, 0x821c, 0x450f, 0x93, 0x76, 0xbe, 0x65, 0xe9, 0x2f, 0xb6, 0xc2);
mi.position = -2000006000;
mi.hIcolibItem = GetIconHandle("homepage");
- mi.name.t = LPGENT("Visit Homepage");
+ mi.name.w = LPGENW("Visit Homepage");
mi.pszService = "Twitter/VisitHomepage";
g_hMenuItems[1] = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, GlobalService<&TwitterProto::VisitHomepage>);
diff --git a/protocols/Twitter/src/twitter.h b/protocols/Twitter/src/twitter.h
index 5558ad376a..d332050108 100644
--- a/protocols/Twitter/src/twitter.h
+++ b/protocols/Twitter/src/twitter.h
@@ -25,7 +25,7 @@ using std::vector;
#include "http.h"
-#define tstring wstring
+#define wstring wstring
typedef unsigned long long twitter_id;
typedef std::map<std::wstring, std::wstring> OAuthParameters;
diff --git a/protocols/Twitter/src/ui.cpp b/protocols/Twitter/src/ui.cpp
index f82017d613..b6e067dab7 100644
--- a/protocols/Twitter/src/ui.cpp
+++ b/protocols/Twitter/src/ui.cpp
@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "proto.h"
#include "twitter.h"
-static const TCHAR *sites[] = {
+static const wchar_t *sites[] = {
L"https://api.twitter.com/",
L"https://identi.ca/api/"
};
@@ -80,7 +80,7 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
if (reinterpret_cast<NMHDR*>(lParam)->code == PSN_APPLY) {
proto = reinterpret_cast<TwitterProto*>(GetWindowLongPtr(hwndDlg, GWLP_USERDATA));
char str[128];
- TCHAR tstr[128];
+ wchar_t tstr[128];
GetDlgItemTextA(hwndDlg, IDC_SERVER, str, _countof(str) - 1);
if (str[mir_strlen(str) - 1] != '/')
@@ -112,14 +112,14 @@ INT_PTR CALLBACK tweet_proc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
SetDlgItemText(hwndDlg, IDC_CHARACTERS, L"140");
// Set window title
- TCHAR title[512];
+ wchar_t title[512];
mir_sntprintf(title, L"Send Tweet for %s", proto->m_tszUserName);
SetWindowText(hwndDlg, title);
return true;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK) {
- TCHAR msg[141];
+ wchar_t msg[141];
proto = reinterpret_cast<TwitterProto*>(GetWindowLongPtr(hwndDlg, GWLP_USERDATA));
GetDlgItemText(hwndDlg, IDC_TWEETMSG, msg, _countof(msg));
@@ -295,8 +295,8 @@ namespace popup_options
struct
{
- TCHAR *name;
- TCHAR *text;
+ wchar_t *name;
+ wchar_t *text;
} const quotes[] = {
{
L"Dorothy Parker", L"If, with the literate, I am\n"
@@ -329,8 +329,8 @@ namespace popup_options
// Pick a random quote
int q = rand() % _countof(quotes);
- _tcsncpy(popup.lptzContactName, quotes[q].name, MAX_CONTACTNAME);
- _tcsncpy(popup.lptzText, quotes[q].text, MAX_SECONDLINE);
+ wcsncpy(popup.lptzContactName, quotes[q].name, MAX_CONTACTNAME);
+ wcsncpy(popup.lptzText, quotes[q].text, MAX_SECONDLINE);
popup.lchContact = hContact;
popup.iSeconds = get_timeout(hwndDlg);
diff --git a/protocols/Twitter/src/utility.cpp b/protocols/Twitter/src/utility.cpp
index e8056e02a8..565ef3622b 100644
--- a/protocols/Twitter/src/utility.cpp
+++ b/protocols/Twitter/src/utility.cpp
@@ -130,7 +130,7 @@ http::response mir_twitter::slurp(const std::string &url, http::method meth, OAu
return resp_data;
}
-bool save_url(HANDLE hNetlib, const std::string &url, const std::tstring &filename)
+bool save_url(HANDLE hNetlib, const std::string &url, const std::wstring &filename)
{
NETLIBHTTPREQUEST req = { sizeof(req) };
req.requestType = REQUEST_GET;
@@ -144,12 +144,12 @@ bool save_url(HANDLE hNetlib, const std::string &url, const std::tstring &filena
bool success = (resp->resultCode == 200);
if (success) {
// Create folder if necessary
- std::tstring dir = filename.substr(0, filename.rfind('\\'));
- if (_taccess(dir.c_str(), 0))
+ std::wstring dir = filename.substr(0, filename.rfind('\\'));
+ if (_waccess(dir.c_str(), 0))
CreateDirectoryTreeT(dir.c_str());
// Write to file
- FILE *f = _tfopen(filename.c_str(), L"wb");
+ FILE *f = _wfopen(filename.c_str(), L"wb");
fwrite(resp->pData, 1, resp->dataLength, f);
fclose(f);
}
diff --git a/protocols/Twitter/src/utility.h b/protocols/Twitter/src/utility.h
index a7f4f968cd..d5115a1bad 100644
--- a/protocols/Twitter/src/utility.h
+++ b/protocols/Twitter/src/utility.h
@@ -90,9 +90,9 @@ protected:
PROTO_INTERFACE *ppro_;
};
-inline void mbcs_to_tcs(UINT code_page, const char *mbstr, TCHAR *tstr, int tlen)
+inline void mbcs_to_tcs(UINT code_page, const char *mbstr, wchar_t *tstr, int tlen)
{
MultiByteToWideChar(code_page, 0, mbstr, -1, tstr, tlen);
}
-bool save_url(HANDLE hNetlib,const std::string &url,const std::tstring &filename); \ No newline at end of file
+bool save_url(HANDLE hNetlib,const std::string &url,const std::wstring &filename);
diff --git a/protocols/VKontakte/src/main.cpp b/protocols/VKontakte/src/main.cpp
index 5b1f032980..ef8c14bb0c 100644
--- a/protocols/VKontakte/src/main.cpp
+++ b/protocols/VKontakte/src/main.cpp
@@ -56,7 +56,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCO
/////////////////////////////////////////////////////////////////////////////////////////
// OnLoad - initialize the plugin instance
-static CVkProto* vkProtoInit(const char *pszProtoName, const TCHAR *tszUserName)
+static CVkProto* vkProtoInit(const char *pszProtoName, const wchar_t *tszUserName)
{
CVkProto *ppro = new CVkProto(pszProtoName, tszUserName);
return ppro;
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index 0e835a8e35..8ac554321c 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -46,16 +46,16 @@ LPCSTR findHeader(NETLIBHTTPREQUEST *pReq, LPCSTR szField)
return NULL;
}
-bool tlstrstr(TCHAR *_s1, TCHAR *_s2)
+bool tlstrstr(wchar_t *_s1, wchar_t *_s2)
{
- TCHAR s1[1024], s2[1024];
+ wchar_t s1[1024], s2[1024];
- _tcsncpy_s(s1, _s1, _TRUNCATE);
+ wcsncpy_s(s1, _s1, _TRUNCATE);
CharLowerBuff(s1, _countof(s1));
- _tcsncpy_s(s2, _s2, _TRUNCATE);
+ wcsncpy_s(s2, _s2, _TRUNCATE);
CharLowerBuff(s2, _countof(s2));
- return _tcsstr(s1, s2) != NULL;
+ return wcsstr(s1, s2) != NULL;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -148,7 +148,7 @@ void CVkProto::ClearAccessToken()
ShutdownSession();
}
-TCHAR* CVkProto::GetUserStoredPassword()
+wchar_t* CVkProto::GetUserStoredPassword()
{
debugLogA("CVkProto::GetUserStoredPassword");
ptrA szRawPass(getStringA("Password"));
@@ -677,7 +677,7 @@ void CVkProto::SetSrmmReadStatus(MCONTACT hContact)
if (!time)
return;
- TCHAR ttime[64];
+ wchar_t ttime[64];
_locale_t locale = _create_locale(LC_ALL, "");
_tcsftime_l(ttime, _countof(ttime), L"%X - %x", localtime(&time), locale);
_free_locale(locale);
@@ -955,7 +955,7 @@ CMString CVkProto::SetBBCString(LPCTSTR ptszString, BBCSupport iBBC, VKBBCType b
if (IsEmpty(ptszString))
return CMString();
- TCHAR *ptszFormat = NULL;
+ wchar_t *ptszFormat = NULL;
for (int i = 0; i < _countof(bbcItem); i++)
if (bbcItem[i].vkBBCType == bbcType && bbcItem[i].vkBBCSettings == iBBC) {
ptszFormat = bbcItem[i].ptszTempate;
@@ -1252,7 +1252,7 @@ CMString CVkProto::GetFwdMessages(const JSONNode &jnMessages, const JSONNode &jn
}
time_t datetime = (time_t)jnMsg["date"].as_int();
- TCHAR ttime[64];
+ wchar_t ttime[64];
_locale_t locale = _create_locale(LC_ALL, "");
_tcsftime_l(ttime, _countof(ttime), L"%x %X", localtime(&datetime), locale);
_free_locale(locale);
@@ -1276,7 +1276,7 @@ CMString CVkProto::GetFwdMessages(const JSONNode &jnMessages, const JSONNode &jn
}
tszBody.Replace(L"\n", L"\n\t");
- TCHAR tcSplit = m_vkOptions.bSplitFormatFwdMsg ? '\n' : ' ';
+ wchar_t tcSplit = m_vkOptions.bSplitFormatFwdMsg ? '\n' : ' ';
CMString tszMes(FORMAT, L"%s %s%c%s %s:\n\n%s\n",
SetBBCString(TranslateT("Message from"), iBBC, vkbbcB),
SetBBCString(tszNick, iBBC, vkbbcUrl, tszUrl),
@@ -1286,7 +1286,7 @@ CMString CVkProto::GetFwdMessages(const JSONNode &jnMessages, const JSONNode &jn
SetBBCString(tszBody, iBBC, vkbbcCode));
if (!res.IsEmpty())
- res.AppendChar(_T('\n'));
+ res.AppendChar('\n');
res += tszMes;
}
@@ -1312,14 +1312,14 @@ void CVkProto::SetInvisible(MCONTACT hContact)
CMString CVkProto::RemoveBBC(CMString& tszSrc)
{
- static const TCHAR *tszSimpleBBCodes[][2] = {
+ static const wchar_t *tszSimpleBBCodes[][2] = {
{ L"[b]", L"[/b]" },
{ L"[u]", L"[/u]" },
{ L"[i]", L"[/i]" },
{ L"[s]", L"[/s]" },
};
- static const TCHAR *tszParamBBCodes[][2] = {
+ static const wchar_t *tszParamBBCodes[][2] = {
{ L"[url=", L"[/url]" },
{ L"[img=", L"[/img]" },
{ L"[size=", L"[/size]" },
@@ -1392,13 +1392,13 @@ CMString CVkProto::RemoveBBC(CMString& tszSrc)
void CVkProto::ShowCaptchaInBrowser(HBITMAP hBitmap)
{
- TCHAR tszTempDir[MAX_PATH];
+ wchar_t tszTempDir[MAX_PATH];
if (!GetEnvironmentVariable(L"TEMP", tszTempDir, MAX_PATH))
return;
CMString tszHTMLPath(FORMAT, L"%s\\miranda_captcha.html", tszTempDir);
- FILE *pFile = _tfopen(tszHTMLPath, L"w");
+ FILE *pFile = _wfopen(tszHTMLPath, L"w");
if (pFile == NULL)
return;
diff --git a/protocols/VKontakte/src/stdafx.h b/protocols/VKontakte/src/stdafx.h
index a5e441027e..c78a27b0cc 100644
--- a/protocols/VKontakte/src/stdafx.h
+++ b/protocols/VKontakte/src/stdafx.h
@@ -21,7 +21,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdio.h>
#include <malloc.h>
-#include <tchar.h>
#include <time.h>
#include <locale.h>
diff --git a/protocols/VKontakte/src/vk.h b/protocols/VKontakte/src/vk.h
index feddbdcc82..008541791c 100644
--- a/protocols/VKontakte/src/vk.h
+++ b/protocols/VKontakte/src/vk.h
@@ -97,7 +97,7 @@ extern mir_cs csInstances;
extern HINSTANCE hInst;
LPCSTR findHeader(NETLIBHTTPREQUEST *hdr, LPCSTR szField);
-bool tlstrstr(TCHAR *_s1, TCHAR *_s2);
+bool tlstrstr(wchar_t *_s1, wchar_t *_s2);
void InitIcons(void);
HANDLE GetIconHandle(int iCommand);
diff --git a/protocols/VKontakte/src/vk_avatars.cpp b/protocols/VKontakte/src/vk_avatars.cpp
index 38cb5d7057..a2ada3e6d0 100644
--- a/protocols/VKontakte/src/vk_avatars.cpp
+++ b/protocols/VKontakte/src/vk_avatars.cpp
@@ -27,7 +27,7 @@ void CVkProto::OnReceiveAvatar(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
GetAvatarFileName(param->hContact, ai.filename, _countof(ai.filename));
ai.format = ProtoGetBufferFormat(reply->pData);
- FILE *out = _tfopen(ai.filename, L"wb");
+ FILE *out = _wfopen(ai.filename, L"wb");
if (out == NULL) {
ProtoBroadcastAck(param->hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, &ai);
delete param;
@@ -85,13 +85,13 @@ INT_PTR CVkProto::SvcGetAvatarInfo(WPARAM, LPARAM lParam)
if (szUrl == NULL)
return GAIR_NOAVATAR;
- TCHAR tszFileName[MAX_PATH];
+ wchar_t tszFileName[MAX_PATH];
GetAvatarFileName(pai->hContact, tszFileName, _countof(tszFileName));
- _tcsncpy(pai->filename, tszFileName, _countof(pai->filename));
+ wcsncpy(pai->filename, tszFileName, _countof(pai->filename));
pai->format = ProtoGetAvatarFormat(pai->filename);
- if (::_taccess(pai->filename, 0) == 0 && !getBool(pai->hContact, "NeedNewAvatar"))
+ if (::_waccess(pai->filename, 0) == 0 && !getBool(pai->hContact, "NeedNewAvatar"))
return GAIR_SUCCESS;
if (IsOnline()) {
@@ -119,16 +119,16 @@ INT_PTR CVkProto::SvcGetMyAvatar(WPARAM wParam, LPARAM lParam)
if (SvcGetAvatarInfo(0, (LPARAM)&ai) != GAIR_SUCCESS)
return 1;
- TCHAR *buf = (TCHAR*)wParam;
+ wchar_t *buf = (wchar_t*)wParam;
int size = (int)lParam;
- _tcsncpy(buf, ai.filename, size);
+ wcsncpy(buf, ai.filename, size);
buf[size - 1] = 0;
return 0;
}
-void CVkProto::GetAvatarFileName(MCONTACT hContact, TCHAR *pszDest, size_t cbLen)
+void CVkProto::GetAvatarFileName(MCONTACT hContact, wchar_t *pszDest, size_t cbLen)
{
int tPathLen = mir_sntprintf(pszDest, cbLen, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
@@ -138,10 +138,10 @@ void CVkProto::GetAvatarFileName(MCONTACT hContact, TCHAR *pszDest, size_t cbLen
pszDest[tPathLen++] = '\\';
- const TCHAR *szFileType = L".jpg";
+ const wchar_t *szFileType = L".jpg";
ptrT szUrl(getTStringA(hContact, "AvatarUrl"));
if (szUrl) {
- TCHAR *p = _tcsrchr(szUrl, '.');
+ wchar_t *p = wcsrchr(szUrl, '.');
if (p != NULL)
szFileType = p;
}
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index d931c85be0..10726e6842 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -24,7 +24,7 @@ enum
IDM_KICK, IDM_INFO, IDM_CHANGENICK, IDM_VISIT_PROFILE
};
-static LPCTSTR sttStatuses[] = { LPGENT("Participants"), LPGENT("Owners") };
+static LPCTSTR sttStatuses[] = { LPGENW("Participants"), LPGENW("Owners") };
extern JSONNode nullNode;
@@ -170,8 +170,8 @@ void CVkProto::OnReceiveChatInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
break;
int uid = jnUser["id"].as_int();
- TCHAR tszId[20];
- _itot(uid, tszId, 10);
+ wchar_t tszId[20];
+ _itow(uid, tszId, 10);
bool bNew;
CVkChatUser *cu = cc->m_users.find((CVkChatUser*)&uid);
@@ -209,8 +209,8 @@ void CVkProto::OnReceiveChatInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
if (!cu.m_bDel)
continue;
- TCHAR tszId[20];
- _itot(cu.m_uid, tszId, 10);
+ wchar_t tszId[20];
+ _itow(cu.m_uid, tszId, 10);
GCDEST gcd = { m_szModuleName, cc->m_tszId, GC_EVENT_PART };
GCEVENT gce = { sizeof(GCEVENT), &gcd };
@@ -341,7 +341,7 @@ void CVkProto::AppendChatMessage(int id, const JSONNode &jnMsg, const JSONNode &
}
else {
int a_uid = 0;
- int iReadCount = _stscanf(tszActionMid, L"%d", &a_uid);
+ int iReadCount = swscanf(tszActionMid, L"%d", &a_uid);
if (iReadCount == 1) {
CVkChatUser *cu = cc->m_users.find((CVkChatUser*)&a_uid);
if (cu == NULL)
@@ -364,7 +364,7 @@ void CVkProto::AppendChatMessage(int id, const JSONNode &jnMsg, const JSONNode &
tszBody.AppendFormat(L" (https://vk.com/id%s) %s", tszUid, TranslateT("returned to chat"));
else {
int a_uid = 0;
- int iReadCount = _stscanf(tszActionMid, L"%d", &a_uid);
+ int iReadCount = swscanf(tszActionMid, L"%d", &a_uid);
if (iReadCount == 1) {
CVkChatUser *cu = cc->m_users.find((CVkChatUser*)&a_uid);
if (cu == NULL)
@@ -424,8 +424,8 @@ void CVkProto::AppendChatMessage(CVkChatInfo *cc, int uid, int msgTime, LPCTSTR
cu->m_bUnknown = true;
}
- TCHAR tszId[20];
- _itot(uid, tszId, 10);
+ wchar_t tszId[20];
+ _itow(uid, tszId, 10);
GCDEST gcd = { m_szModuleName, cc->m_tszId, bIsAction ? GC_EVENT_ACTION : GC_EVENT_MESSAGE };
GCEVENT gce = { sizeof(GCEVENT), &gcd };
@@ -434,7 +434,7 @@ void CVkProto::AppendChatMessage(CVkChatInfo *cc, int uid, int msgTime, LPCTSTR
gce.time = msgTime;
gce.dwFlags = (bIsHistory) ? GCEF_NOTNOTIFY : GCEF_ADDTOLOG;
gce.ptszNick = cu->m_tszNick ? mir_tstrdup(cu->m_tszNick) : mir_tstrdup(hContact ? ptrT(db_get_tsa(hContact, m_szModuleName, "Nick")) : TranslateT("Unknown"));
- gce.ptszText = IsEmpty((TCHAR *)ptszBody) ? mir_tstrdup(L"...") : mir_tstrdup(ptszBody);
+ gce.ptszText = IsEmpty((wchar_t *)ptszBody) ? mir_tstrdup(L"...") : mir_tstrdup(ptszBody);
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
StopChatContactTyping(cc->m_chatid, uid);
}
@@ -469,9 +469,9 @@ void CVkProto::SetChatStatus(MCONTACT hContact, int iStatus)
/////////////////////////////////////////////////////////////////////////////////////////
-TCHAR* UnEscapeChatTags(TCHAR *str_in)
+wchar_t* UnEscapeChatTags(wchar_t *str_in)
{
- TCHAR *s = str_in, *d = str_in;
+ wchar_t *s = str_in, *d = str_in;
while (*s) {
if (*s == '%' && s[1] == '%')
s++;
@@ -506,13 +506,13 @@ int CVkProto::OnChatEvent(WPARAM, LPARAM lParam)
case GC_USER_PRIVMESS:
{
- MCONTACT hContact = FindUser(_ttoi(gch->ptszUID));
+ MCONTACT hContact = FindUser(_wtoi(gch->ptszUID));
if (hContact == NULL) {
- hContact = FindUser(_ttoi(gch->ptszUID), true);
+ hContact = FindUser(_wtoi(gch->ptszUID), true);
db_set_b(hContact, "CList", "Hidden", 1);
db_set_b(hContact, "CList", "NotOnList", 1);
db_set_dw(hContact, "Ignore", "Mask1", 0);
- RetrieveUserInfo(_ttoi(gch->ptszUID));
+ RetrieveUserInfo(_wtoi(gch->ptszUID));
}
CallService(MS_MSG_SENDMESSAGET, hContact);
}
@@ -796,8 +796,8 @@ void CVkProto::NickMenuHook(CVkChatInfo *cc, GCHOOK *gch)
GCDEST gcd = { m_szModuleName, cc->m_tszId, GC_EVENT_NICK };
GCEVENT gce = { sizeof(GCEVENT), &gcd };
- TCHAR tszId[20];
- _itot(cu->m_uid, tszId, 10);
+ wchar_t tszId[20];
+ _itow(cu->m_uid, tszId, 10);
gce.ptszNick = mir_tstrdup(cu->m_tszNick);
gce.bIsMe = (cu->m_uid == m_myUserId);
@@ -829,18 +829,18 @@ void CVkProto::NickMenuHook(CVkChatInfo *cc, GCHOOK *gch)
static gc_item sttLogListItems[] =
{
- { LPGENT("&Invite a user"), IDM_INVITE, MENU_ITEM },
- { LPGENT("View/change &title"), IDM_TOPIC, MENU_ITEM },
+ { LPGENW("&Invite a user"), IDM_INVITE, MENU_ITEM },
+ { LPGENW("View/change &title"), IDM_TOPIC, MENU_ITEM },
{ NULL, 0, MENU_SEPARATOR },
- { LPGENT("&Destroy room"), IDM_DESTROY, MENU_ITEM }
+ { LPGENW("&Destroy room"), IDM_DESTROY, MENU_ITEM }
};
static gc_item sttListItems[] =
{
- { LPGENT("&User details"), IDM_INFO, MENU_ITEM },
- { LPGENT("Visit profile"), IDM_VISIT_PROFILE, MENU_ITEM },
- { LPGENT("Change nick"), IDM_CHANGENICK, MENU_ITEM },
- { LPGENT("&Kick"), IDM_KICK, MENU_ITEM }
+ { LPGENW("&User details"), IDM_INFO, MENU_ITEM },
+ { LPGENW("Visit profile"), IDM_VISIT_PROFILE, MENU_ITEM },
+ { LPGENW("Change nick"), IDM_CHANGENICK, MENU_ITEM },
+ { LPGENW("&Kick"), IDM_KICK, MENU_ITEM }
};
int CVkProto::OnGcMenuHook(WPARAM, LPARAM lParam)
diff --git a/protocols/VKontakte/src/vk_dialogs.cpp b/protocols/VKontakte/src/vk_dialogs.cpp
index 9e6ba15815..5c119b5d5b 100644
--- a/protocols/VKontakte/src/vk_dialogs.cpp
+++ b/protocols/VKontakte/src/vk_dialogs.cpp
@@ -160,7 +160,7 @@ void CVkInviteChatForm::OnInitDialog()
{
for (MCONTACT hContact = db_find_first(m_proto->m_szModuleName); hContact; hContact = db_find_next(hContact, m_proto->m_szModuleName)) {
if (!m_proto->isChatRoom(hContact)) {
- TCHAR *ptszNick = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *ptszNick = pcli->pfnGetContactDisplayName(hContact, 0);
m_cbxCombo.AddString(ptszNick, hContact);
}
}
diff --git a/protocols/VKontakte/src/vk_dialogs.h b/protocols/VKontakte/src/vk_dialogs.h
index 45272b285c..32ee12608f 100644
--- a/protocols/VKontakte/src/vk_dialogs.h
+++ b/protocols/VKontakte/src/vk_dialogs.h
@@ -52,12 +52,12 @@ public:
struct WALLPOST_FORM_PARAMS
{
- TCHAR *ptszMsg;
- TCHAR *ptszUrl;
- TCHAR *ptszNick;
+ wchar_t *ptszMsg;
+ wchar_t *ptszUrl;
+ wchar_t *ptszNick;
bool bFriendsOnly;
- WALLPOST_FORM_PARAMS(TCHAR *nick) :
+ WALLPOST_FORM_PARAMS(wchar_t *nick) :
ptszNick(nick),
bFriendsOnly(false)
{
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp
index 2bc441d403..be5b0eed16 100644
--- a/protocols/VKontakte/src/vk_feed.cpp
+++ b/protocols/VKontakte/src/vk_feed.cpp
@@ -84,7 +84,7 @@ void CVkProto::AddCListEvent(bool bNews)
cle.flags = CLEF_URGENT | CLEF_TCHAR;
cle.hContact = hContact;
cle.hDbEvent = NULL;
- TCHAR toolTip[255];
+ wchar_t toolTip[255];
mir_sntprintf(toolTip, bNews ? TranslateT("New news") : TranslateT("New notifications"));
cle.ptszTooltip = toolTip;
pcli->pfnAddEvent(&cle);
@@ -238,9 +238,9 @@ CVKNewsItem* CVkProto::GetVkNewsItem(const JSONNode &jnItem, OBJLIST<CVkUserInfo
const JSONNode &jnAttachments = jnItem["attachments"];
if (jnAttachments) {
if (!tszText.IsEmpty())
- tszText.AppendChar(_T('\n'));
+ tszText.AppendChar('\n');
if (!tszPopupText.IsEmpty())
- tszPopupText.AppendChar(_T('\n'));
+ tszPopupText.AppendChar('\n');
tszPopupText += TranslateT("(attachments)");
tszText += GetAttachmentDescr(jnAttachments, m_vkOptions.bUseBBCOnAttacmentsAsNews ? m_vkOptions.BBCForNews() : m_vkOptions.BBCForAttachments());
}
@@ -267,7 +267,7 @@ CVKNewsItem* CVkProto::GetVkNewsItem(const JSONNode &jnItem, OBJLIST<CVkUserInfo
vkNewsItem->tszId.AppendFormat(L"%d_%d", vkNewsItem->vkUser->m_UserId, iPostId);
if (bPostLink) {
vkNewsItem->tszLink = CMString(L"https://vk.com/wall") + vkNewsItem->tszId;
- vkNewsItem->tszText.AppendChar(_T('\n'));
+ vkNewsItem->tszText.AppendChar('\n');
vkNewsItem->tszText += SetBBCString(TranslateT("Link"), m_vkOptions.BBCForNews(), vkbbcUrl, vkNewsItem->tszLink);
}
diff --git a/protocols/VKontakte/src/vk_files.cpp b/protocols/VKontakte/src/vk_files.cpp
index cb1e0bc607..59738aab54 100644
--- a/protocols/VKontakte/src/vk_files.cpp
+++ b/protocols/VKontakte/src/vk_files.cpp
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-HANDLE CVkProto::SendFile(MCONTACT hContact, const TCHAR *desc, TCHAR **files)
+HANDLE CVkProto::SendFile(MCONTACT hContact, const wchar_t *desc, wchar_t **files)
{
debugLogA("CVkProto::SendFile");
@@ -155,7 +155,7 @@ void CVkProto::OnReciveUploadServer(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *
return;
}
- FILE *pFile = _tfopen(fup->FileName, L"rb");
+ FILE *pFile = _wfopen(fup->FileName, L"rb");
if (pFile == NULL) {
SendFileFiled(fup, VKERR_ERR_OPEN_FILE);
return;
diff --git a/protocols/VKontakte/src/vk_messages.cpp b/protocols/VKontakte/src/vk_messages.cpp
index bdb6bdc3b0..8e0907cb20 100644
--- a/protocols/VKontakte/src/vk_messages.cpp
+++ b/protocols/VKontakte/src/vk_messages.cpp
@@ -104,7 +104,7 @@ void CVkProto::OnSendMessage(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
UINT mid;
if (jnResponse.type() != JSON_STRING)
mid = jnResponse.as_int();
- else if (_stscanf(jnResponse.as_mstring(), L"%d", &mid) != 1)
+ else if (swscanf(jnResponse.as_mstring(), L"%d", &mid) != 1)
mid = 0;
if (param->iMsgID != -1)
@@ -281,7 +281,7 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
if (chat_id != 0) {
debugLogA("CVkProto::OnReceiveMessages chat_id != 0");
CMString action_chat = jnMsg["action"].as_mstring();
- int action_mid = _ttoi(jnMsg["action_mid"].as_mstring());
+ int action_mid = _wtoi(jnMsg["action_mid"].as_mstring());
if ((action_chat == "chat_kick_user") && (action_mid == m_myUserId))
KickFromChat(chat_id, uid, jnMsg, jnFUsers);
else {
diff --git a/protocols/VKontakte/src/vk_options.cpp b/protocols/VKontakte/src/vk_options.cpp
index b2b6d7233a..aedf678894 100644
--- a/protocols/VKontakte/src/vk_options.cpp
+++ b/protocols/VKontakte/src/vk_options.cpp
@@ -74,32 +74,32 @@ int CVkProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
odp.dwInitParam = LPARAM(this);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.ptszGroup = LPGENT("Network");
+ odp.pwszGroup = LPGENW("Network");
- odp.ptszTab = LPGENT("Account");
+ odp.pwszTab = LPGENW("Account");
odp.position = 1;
odp.pDialog = new CVkOptionAccountForm(this);
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Advanced");
+ odp.pwszTab = LPGENW("Advanced");
odp.position = 2;
odp.pDialog = new CVkOptionAdvancedForm(this);
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("News and notifications");
+ odp.pwszTab = LPGENW("News and notifications");
odp.position = 3;
odp.pDialog = new CVkOptionFeedsForm(this);
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("View");
+ odp.pwszTab = LPGENW("View");
odp.position = 4;
odp.pDialog = new CVkOptionViewForm(this);
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Menu");
+ odp.pwszTab = LPGENW("Menu");
odp.position = 5;
odp.pDialog = new CVkOptionMenuForm(this);
Options_AddPage(wParam, &odp);
@@ -110,15 +110,15 @@ int CVkProto::OnOptionsInit(WPARAM wParam, LPARAM)
////////////////////// Account page //////////////////////////////////////////
static CVKLang vkLangCodes[] = {
- { NULL, LPGENT("Account language") },
- { L"en", LPGENT("English") },
- { L"ru", LPGENT("Russian") },
- { L"be", LPGENT("Belarusian") },
- { L"ua", LPGENT("Ukrainian") },
- { L"es", LPGENT("Spanish") },
- { L"fi", LPGENT("Finnish") },
- { L"de", LPGENT("German") },
- { L"it", LPGENT("Italian") },
+ { NULL, LPGENW("Account language") },
+ { L"en", LPGENW("English") },
+ { L"ru", LPGENW("Russian") },
+ { L"be", LPGENW("Belarusian") },
+ { L"ua", LPGENW("Ukrainian") },
+ { L"es", LPGENW("Spanish") },
+ { L"fi", LPGENW("Finnish") },
+ { L"de", LPGENW("German") },
+ { L"it", LPGENW("Italian") },
};
static CVKSync vkHistorySyncMethods[] =
@@ -192,7 +192,7 @@ void CVkOptionAccountForm::OnApply()
{
m_proto->m_vkOptions.iSyncHistoryMetod = m_cbxSyncHistory.GetItemData(m_cbxSyncHistory.GetCurSel());
m_proto->m_vkOptions.iMarkMessageReadOn = m_cbxMarkAsRead.GetItemData(m_cbxMarkAsRead.GetCurSel());
- m_proto->m_vkOptions.ptszVKLang = (TCHAR *)m_cbxVKLang.GetItemData(m_cbxVKLang.GetCurSel());
+ m_proto->m_vkOptions.ptszVKLang = (wchar_t *)m_cbxVKLang.GetItemData(m_cbxVKLang.GetCurSel());
ptrT ptszGroupName(m_edtGroupName.GetText());
if (mir_tstrcmp(m_ptszOldGroup, ptszGroupName)) {
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index f7c5c77900..a31f4658a2 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -33,7 +33,7 @@ LIST<CVkProto> vk_Instances(1, sttCompareProtocols);
mir_cs csInstances;
static COLORREF sttColors[] = { 0, 1, 2, 3, 4, 5, 6 };
-CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) :
+CVkProto::CVkProto(const char *szModuleName, const wchar_t *ptszUserName) :
PROTO<CVkProto>(szModuleName, ptszUserName),
m_arRequestsQueue(10, sttCompareAsyncHttpRequest),
m_sendIds(3, PtrKeySortT),
@@ -61,7 +61,7 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) :
HookProtoEvent(ME_OPT_INITIALISE, &CVkProto::OnOptionsInit);
- TCHAR descr[512];
+ wchar_t descr[512];
mir_sntprintf(descr, TranslateT("%s server connection"), m_tszUserName);
NETLIBUSER nlu = {sizeof(nlu)};
@@ -120,7 +120,7 @@ int CVkProto::OnModulesLoaded(WPARAM, LPARAM)
HookProtoEvent(ME_DB_EVENT_MARKED_READ, &CVkProto::OnDbEventRead);
HookProtoEvent(ME_DB_CONTACT_SETTINGCHANGED, &CVkProto::OnDbSettingChanged);
//Sounds
- SkinAddNewSoundExT("VKNewsFeed", m_tszUserName, LPGENT("VKontakte newsfeed & notification event"));
+ SkinAddNewSoundExT("VKNewsFeed", m_tszUserName, LPGENW("VKontakte newsfeed & notification event"));
InitPopups();
InitMenus();
@@ -233,70 +233,70 @@ void CVkProto::InitMenus()
mi.pszService = PS_VISITPROFILE;
mi.position = -200001000 + CMI_VISITPROFILE;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_VISITPROFILE));
- mi.name.t = LPGENT("Visit profile");
+ mi.name.w = LPGENW("Visit profile");
SET_UID(mi, 0x828cc50e, 0x398d, 0x43a2, 0xbf, 0xd3, 0xa9, 0x96, 0x47, 0x9d, 0x52, 0xff);
m_hContactMenuItems[CMI_VISITPROFILE] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_MARKMESSAGESASREAD;
mi.position = -200001000 + CMI_MARKMESSAGESASREAD;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_MARKMESSAGESASREAD));
- mi.name.t = LPGENT("Mark messages as read");
+ mi.name.w = LPGENW("Mark messages as read");
SET_UID(mi, 0x2587a649, 0xe5d5, 0x4e90, 0x8b, 0x35, 0x81, 0x4c, 0xb1, 0x5, 0x94, 0x7);
m_hContactMenuItems[CMI_MARKMESSAGESASREAD] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_WALLPOST;
mi.position = -200001000 + CMI_WALLPOST;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_WALL));
- mi.name.t = LPGENT("Send message to user\'s wall");
+ mi.name.w = LPGENW("Send message to user\'s wall");
SET_UID(mi, 0xd8841aaf, 0x15f6, 0x4be9, 0x9f, 0x4f, 0x16, 0xa9, 0x47, 0x6a, 0x19, 0x81);
m_hContactMenuItems[CMI_WALLPOST] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_ADDASFRIEND;
mi.position = -200001000 + CMI_ADDASFRIEND;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDADD));
- mi.name.t = LPGENT("Add as friend");
+ mi.name.w = LPGENW("Add as friend");
SET_UID(mi, 0xf11b9a7f, 0x569, 0x4023, 0xb0, 0xd6, 0xa3, 0x16, 0xf6, 0xd4, 0xfb, 0xb5);
m_hContactMenuItems[CMI_ADDASFRIEND] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_DELETEFRIEND;
mi.position = -200001000 + CMI_DELETEFRIEND;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL));
- mi.name.t = LPGENT("Delete from friend list");
+ mi.name.w = LPGENW("Delete from friend list");
SET_UID(mi, 0x1e26514, 0x854f, 0x4e60, 0x8c, 0xf8, 0xab, 0xaa, 0xe0, 0xc3, 0xa5, 0xa7);
m_hContactMenuItems[CMI_DELETEFRIEND] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_BANUSER;
mi.position = -200001000 + CMI_BANUSER;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_BAN));
- mi.name.t = LPGENT("Ban user");
+ mi.name.w = LPGENW("Ban user");
SET_UID(mi, 0x7ba06bab, 0xf770, 0x4938, 0x9c, 0x76, 0xef, 0x40, 0xbc, 0x55, 0x0, 0x9b);
m_hContactMenuItems[CMI_BANUSER] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_REPORTABUSE;
mi.position = -200001000 + CMI_REPORTABUSE;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_ABUSE));
- mi.name.t = LPGENT("Report abuse");
+ mi.name.w = LPGENW("Report abuse");
SET_UID(mi, 0x56454cb9, 0xd80, 0x4050, 0xbe, 0xfc, 0x2c, 0xf6, 0x10, 0x2a, 0x7d, 0x19);
m_hContactMenuItems[CMI_REPORTABUSE] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_DESTROYKICKCHAT;
mi.position = -200001000 + CMI_DESTROYKICKCHAT;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL));
- mi.name.t = LPGENT("Destroy room");
+ mi.name.w = LPGENW("Destroy room");
SET_UID(mi, 0x4fa6e75a, 0x30cd, 0x4482, 0xae, 0x8f, 0x0, 0x38, 0xd0, 0x17, 0x33, 0xcd);
m_hContactMenuItems[CMI_DESTROYKICKCHAT] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_OPENBROADCAST;
mi.position = -200001000 + CMI_OPENBROADCAST;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_BROADCAST));
- mi.name.t = LPGENT("Open broadcast");
+ mi.name.w = LPGENW("Open broadcast");
SET_UID(mi, 0x85251a06, 0xf734, 0x4985, 0x8c, 0x36, 0x6f, 0x66, 0x46, 0xf9, 0xa0, 0x10);
m_hContactMenuItems[CMI_OPENBROADCAST] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_LOADVKNEWS;
mi.position = -200001000 + CMI_LOADVKNEWS;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION));
- mi.name.t = LPGENT("Load news from VK");
+ mi.name.w = LPGENW("Load news from VK");
SET_UID(mi, 0xe1f6888b, 0x21ae, 0x409f, 0x82, 0xa2, 0x7b, 0x72, 0xef, 0x47, 0x9, 0xc0);
m_hContactMenuItems[CMI_LOADVKNEWS] = Menu_AddContactMenuItem(&mi, m_szModuleName);
@@ -304,7 +304,7 @@ void CVkProto::InitMenus()
mi.pszService = PS_GETSERVERHISTORY;
mi.position = -200001000 + CMI_GETSERVERHISTORY;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
- mi.name.t = LPGENT("Reload messages from vk.com...");
+ mi.name.w = LPGENW("Reload messages from vk.com...");
SET_UID(mi, 0xc6b59e9f, 0x5250, 0x4146, 0xb6, 0xf3, 0x2d, 0xe1, 0x4, 0x3b, 0x95, 0xf5);
m_hContactMenuItems[CMI_GETSERVERHISTORY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
@@ -313,42 +313,42 @@ void CVkProto::InitMenus()
mi.pszService = PS_GETSERVERHISTORYLAST1DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST1DAY;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
- mi.name.t = LPGENT("for last 1 day");
+ mi.name.w = LPGENW("for last 1 day");
SET_UID(mi, 0x508dce88, 0x1a9a, 0x4dd7, 0x90, 0xf4, 0x41, 0x35, 0x7b, 0xc3, 0x17, 0xed);
m_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST1DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETSERVERHISTORYLAST3DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST3DAY;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
- mi.name.t = LPGENT("for last 3 days");
+ mi.name.w = LPGENW("for last 3 days");
SET_UID(mi, 0x9a878764, 0x5bbf, 0x433a, 0xbd, 0x50, 0xa9, 0xb9, 0x16, 0x1f, 0x99, 0x29);
m_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST3DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETSERVERHISTORYLAST7DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST7DAY;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
- mi.name.t = LPGENT("for last week");
+ mi.name.w = LPGENW("for last week");
SET_UID(mi, 0xc6482460, 0xd280, 0x4596, 0x97, 0x4b, 0xf7, 0xfa, 0x6d, 0xe, 0xd5, 0xda);
m_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST7DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETSERVERHISTORYLAST30DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST30DAY;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
- mi.name.t = LPGENT("for last 30 days");
+ mi.name.w = LPGENW("for last 30 days");
SET_UID(mi, 0xc48e8a9f, 0x2860, 0x4d5b, 0xa8, 0xdf, 0xb8, 0x3f, 0xdf, 0x7b, 0xa2, 0xba);
m_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST30DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETSERVERHISTORYLAST90DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST90DAY;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
- mi.name.t = LPGENT("for last 90 days");
+ mi.name.w = LPGENW("for last 90 days");
SET_UID(mi, 0xd8e30530, 0xa585, 0x4672, 0xa6, 0x39, 0x18, 0xc9, 0xc9, 0xcb, 0xc7, 0x7d);
m_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST90DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETALLSERVERHISTORYFORCONTACT;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETALLSERVERHISTORYFORCONTACT;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
- mi.name.t = LPGENT("for all time");
+ mi.name.w = LPGENW("for all time");
SET_UID(mi, 0xaee3d02b, 0x3667, 0x47c8, 0x9f, 0x43, 0x14, 0xb7, 0xab, 0x52, 0x14, 0x94);
m_hContactHistoryMenuItems[CHMI_GETALLSERVERHISTORYFORCONTACT] = Menu_AddContactMenuItem(&mi, m_szModuleName);
}
@@ -418,7 +418,7 @@ LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
void CVkProto::InitPopups(void)
{
- TCHAR desc[256];
+ wchar_t desc[256];
char name[256];
POPUPCLASS ppc = { sizeof(ppc) };
ppc.flags = PCF_TCHAR;
@@ -446,14 +446,14 @@ void CVkProto::InitPopups(void)
m_hPopupClassNotification = Popup_RegisterClass(&ppc);
}
-void CVkProto::MsgPopup(MCONTACT hContact, const TCHAR *szMsg, const TCHAR *szTitle, bool err)
+void CVkProto::MsgPopup(MCONTACT hContact, const wchar_t *szMsg, const wchar_t *szTitle, bool err)
{
if (ServiceExists(MS_POPUP_ADDPOPUPCLASS)) {
char name[256];
POPUPDATACLASS ppd = { sizeof(ppd) };
- ppd.ptszTitle = szTitle;
- ppd.ptszText = szMsg;
+ ppd.pwszTitle = szTitle;
+ ppd.pwszText = szMsg;
ppd.pszClassName = name;
ppd.hContact = hContact;
ppd.PluginData = new CVkSendMsgParam(hContact);
@@ -534,7 +534,7 @@ MCONTACT CVkProto::AddToList(int, PROTOSEARCHRESULT *psr)
{
debugLogA("CVkProto::AddToList");
- int uid = _ttoi(psr->id.t);
+ int uid = _wtoi(psr->id.w);
if (!uid)
return NULL;
@@ -543,7 +543,7 @@ MCONTACT CVkProto::AddToList(int, PROTOSEARCHRESULT *psr)
return hContact;
}
-int CVkProto::AuthRequest(MCONTACT hContact, const TCHAR *message)
+int CVkProto::AuthRequest(MCONTACT hContact, const wchar_t *message)
{
debugLogA("CVkProto::AuthRequest");
if (!IsOnline())
@@ -553,9 +553,9 @@ int CVkProto::AuthRequest(MCONTACT hContact, const TCHAR *message)
if (userID == -1 || !hContact || userID == VK_FEED_USER)
return 1;
- TCHAR msg[501] = {0};
+ wchar_t msg[501] = {0};
if (message)
- _tcsncpy_s(msg, 500, message, _TRUNCATE);
+ wcsncpy_s(msg, 500, message, _TRUNCATE);
Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/friends.add.json", true, &CVkProto::OnReceiveAuthRequest)
<< INT_PARAM("user_id", userID)
@@ -616,7 +616,7 @@ int CVkProto::Authorize(MEVENT hDbEvent)
return AuthRequest(hContact, NULL);
}
-int CVkProto::AuthDeny(MEVENT hDbEvent, const TCHAR*)
+int CVkProto::AuthDeny(MEVENT hDbEvent, const wchar_t*)
{
debugLogA("CVkProto::AuthDeny");
if (!IsOnline())
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h
index ce1f7f02ed..0b8e5b5962 100644
--- a/protocols/VKontakte/src/vk_proto.h
+++ b/protocols/VKontakte/src/vk_proto.h
@@ -45,7 +45,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
struct CVkProto : public PROTO<CVkProto>
{
- CVkProto(const char*, const TCHAR*);
+ CVkProto(const char*, const wchar_t*);
~CVkProto();
//====================================================================================
@@ -54,16 +54,16 @@ struct CVkProto : public PROTO<CVkProto>
virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT *psr);
virtual int __cdecl Authorize(MEVENT hDbEvent);
- virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR *szReason);
- virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage);
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t *szReason);
+ virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t *szMessage);
virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
virtual int __cdecl GetInfo(MCONTACT hContact, int infoType);
- virtual HANDLE __cdecl SearchBasic(const TCHAR *id);
- virtual HANDLE __cdecl SearchByEmail(const TCHAR *email);
- virtual HANDLE __cdecl SearchByName(const TCHAR *nick, const TCHAR *firstName, const TCHAR *lastName);
+ virtual HANDLE __cdecl SearchBasic(const wchar_t *id);
+ virtual HANDLE __cdecl SearchByEmail(const wchar_t *email);
+ virtual HANDLE __cdecl SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName);
virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*);
virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char *msg);
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles);
+ virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles);
virtual int __cdecl SetStatus(int iNewStatus);
virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
@@ -118,7 +118,7 @@ struct CVkProto : public PROTO<CVkProto>
__forceinline bool IsOnline() const { return m_bOnline; }
void OnTimerTic();
void ClearAccessToken();
- TCHAR* GetUserStoredPassword(void);
+ wchar_t* GetUserStoredPassword(void);
void ShowCaptchaInBrowser(HBITMAP hBitmap);
static mir_cs m_csTimer;
@@ -232,7 +232,7 @@ private:
//==== PopUps ========================================================================
void InitPopups(void);
- void MsgPopup(MCONTACT hContact, const TCHAR *szMsg, const TCHAR *szTitle, bool err = false);
+ void MsgPopup(MCONTACT hContact, const wchar_t *szMsg, const wchar_t *szTitle, bool err = false);
//==== Hooks =========================================================================
@@ -302,7 +302,7 @@ private:
void OnReceiveMessages(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
void OnReceiveDlgs(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
void OnSendMessage(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
- void WallPost(MCONTACT hContact, TCHAR *ptszMsg, TCHAR *ptszUrl, bool bFriendsOnly);
+ void WallPost(MCONTACT hContact, wchar_t *ptszMsg, wchar_t *ptszUrl, bool bFriendsOnly);
void GetServerHistoryLastNDay(MCONTACT hContact, int NDay);
void GetServerHistory(MCONTACT hContact, int iOffset, int iCount, int iTime, int iLastMsgId, bool once = false);
void OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq);
@@ -358,7 +358,7 @@ private:
void OnLoggedOut();
void ShutdownSession();
void SetAvatarUrl(MCONTACT hContact, CMString &tszUrl);
- void GetAvatarFileName(MCONTACT hContact, TCHAR *pszDest, size_t cbLen);
+ void GetAvatarFileName(MCONTACT hContact, wchar_t *pszDest, size_t cbLen);
void ReloadAvatarInfo(MCONTACT hContact);
void __cdecl SendMsgAck(void *param);
void __cdecl ChatContactTypingThread(void *p);
diff --git a/protocols/VKontakte/src/vk_search.cpp b/protocols/VKontakte/src/vk_search.cpp
index bc5ebb88d2..c19c3610bf 100644
--- a/protocols/VKontakte/src/vk_search.cpp
+++ b/protocols/VKontakte/src/vk_search.cpp
@@ -17,19 +17,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-HANDLE CVkProto::SearchBasic(const TCHAR *id)
+HANDLE CVkProto::SearchBasic(const wchar_t *id)
{
ForkThread(&CVkProto::SearchBasicThread, (void *)id);
return (HANDLE)1;
}
-HANDLE CVkProto::SearchByEmail(const TCHAR *email)
+HANDLE CVkProto::SearchByEmail(const wchar_t *email)
{
ForkThread(&CVkProto::SearchByMailThread, (void *)email);
return (HANDLE)1;
}
-HANDLE CVkProto::SearchByName(const TCHAR *nick, const TCHAR *firstName, const TCHAR *lastName)
+HANDLE CVkProto::SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName)
{
PROTOSEARCHBYNAME *psr = new (PROTOSEARCHBYNAME);
@@ -47,7 +47,7 @@ void CVkProto::SearchBasicThread(void *id)
if (!IsOnline())
return;
AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/users.get.json", true, &CVkProto::OnSearch)
- << TCHAR_PARAM("user_ids", (TCHAR *)id)
+ << TCHAR_PARAM("user_ids", (wchar_t *)id)
<< CHAR_PARAM("fields", "nickname, domain");
pReq->pUserInfo = NULL;
Push(pReq);
@@ -59,7 +59,7 @@ void CVkProto::SearchByMailThread(void *email)
if (!IsOnline())
return;
AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/account.lookupContacts.json", true, &CVkProto::OnSearchByMail)
- << TCHAR_PARAM("contacts", (TCHAR *)email)
+ << TCHAR_PARAM("contacts", (wchar_t *)email)
<< CHAR_PARAM("service", "email");
Push(pReq);
}
@@ -68,14 +68,14 @@ void __cdecl CVkProto::SearchThread(void *p)
{
PROTOSEARCHBYNAME *pParam = (PROTOSEARCHBYNAME *)p;
- TCHAR arg[200];
+ wchar_t arg[200];
mir_sntprintf(arg, L"%s %s %s", pParam->pszFirstName, pParam->pszNick, pParam->pszLastName);
debugLog(L"CVkProto::SearchThread %s", arg);
if (!IsOnline())
return;
AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/users.search.json", true, &CVkProto::OnSearch)
- << TCHAR_PARAM("q", (TCHAR *)arg)
+ << TCHAR_PARAM("q", (wchar_t *)arg)
<< CHAR_PARAM("fields", "nickname, domain")
<< INT_PARAM("count", 200);
pReq->pUserInfo = p;
@@ -126,19 +126,19 @@ void CVkProto::OnSearch(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
CMString Nick(jnRecord["nickname"].as_mstring());
CMString Domain(jnRecord["domain"].as_mstring());
- psr.id.t = mir_tstrdup(Id);
- psr.firstName.t = mir_tstrdup(FirstName);
- psr.lastName.t = mir_tstrdup(LastName);
- psr.nick.t = Nick.IsEmpty() ? mir_tstrdup(Domain) : mir_tstrdup(Nick);
+ psr.id.w = mir_tstrdup(Id);
+ psr.firstName.w = mir_tstrdup(FirstName);
+ psr.lastName.w = mir_tstrdup(LastName);
+ psr.nick.w = Nick.IsEmpty() ? mir_tstrdup(Domain) : mir_tstrdup(Nick);
bool filter = true;
if (pParam) {
- if (psr.firstName.t && pParam->pszFirstName)
- filter = tlstrstr(psr.firstName.t, pParam->pszFirstName) && filter;
- if (psr.lastName.t && pParam->pszLastName)
- filter = tlstrstr(psr.lastName.t, pParam->pszLastName) && filter;
- if (psr.nick.t && pParam->pszNick)
- filter = tlstrstr(psr.nick.t, pParam->pszNick) && filter;
+ if (psr.firstName.w && pParam->pszFirstName)
+ filter = tlstrstr(psr.firstName.w, pParam->pszFirstName) && filter;
+ if (psr.lastName.w && pParam->pszLastName)
+ filter = tlstrstr(psr.lastName.w, pParam->pszLastName) && filter;
+ if (psr.nick.w && pParam->pszNick)
+ filter = tlstrstr(psr.nick.w, pParam->pszNick) && filter;
}
if (filter)
@@ -184,11 +184,11 @@ void CVkProto::OnSearchByMail(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
CMString Nick(jnRecord["nickname"].as_mstring());
CMString Email(jnRecord["contact"].as_mstring());
- psr.id.t = mir_tstrdup(Id);
- psr.firstName.t = mir_tstrdup(FirstName);
- psr.lastName.t = mir_tstrdup(LastName);
- psr.nick.t = Nick.IsEmpty() ? mir_tstrdup(Email) : mir_tstrdup(Nick);
- psr.email.t = mir_tstrdup(Email);
+ psr.id.w = mir_tstrdup(Id);
+ psr.firstName.w = mir_tstrdup(FirstName);
+ psr.lastName.w = mir_tstrdup(LastName);
+ psr.nick.w = Nick.IsEmpty() ? mir_tstrdup(Email) : mir_tstrdup(Nick);
+ psr.email.w = mir_tstrdup(Email);
ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)&psr);
}
diff --git a/protocols/VKontakte/src/vk_status.cpp b/protocols/VKontakte/src/vk_status.cpp
index 8a3566270c..add498f486 100644
--- a/protocols/VKontakte/src/vk_status.cpp
+++ b/protocols/VKontakte/src/vk_status.cpp
@@ -160,7 +160,7 @@ void CVkProto::OnReceiveStatus(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
const JSONNode &jnAudio = jnResponse["audio"];
if (!jnAudio) {
CMString tszStatusText(jnResponse["text"].as_mstring());
- if (tszStatusText[0] != TCHAR(9835))
+ if (tszStatusText[0] != wchar_t(9835))
setTString("OldStatusMsg", tszStatusText);
}
}
diff --git a/protocols/VKontakte/src/vk_struct.cpp b/protocols/VKontakte/src/vk_struct.cpp
index ad7ff94525..a1d074a9ad 100644
--- a/protocols/VKontakte/src/vk_struct.cpp
+++ b/protocols/VKontakte/src/vk_struct.cpp
@@ -98,7 +98,7 @@ void AsyncHttpRequest::Redirect(NETLIBHTTPREQUEST *nhr)
/////////////////////////////////////////////////////////////////////////////////////////
-CVkFileUploadParam::CVkFileUploadParam(MCONTACT _hContact, const TCHAR *_desc, TCHAR **_files) :
+CVkFileUploadParam::CVkFileUploadParam(MCONTACT _hContact, const wchar_t *_desc, wchar_t **_files) :
hContact(_hContact),
Desc(mir_tstrdup(_desc)),
FileName(mir_tstrdup(_files[0])),
@@ -125,11 +125,11 @@ CVkFileUploadParam::VKFileType CVkFileUploadParam::GetType()
if (fname)
mir_free(fname);
- TCHAR img[] = L".jpg .jpeg .png .bmp";
- TCHAR audio[] = L".mp3";
+ wchar_t img[] = L".jpg .jpeg .png .bmp";
+ wchar_t audio[] = L".mp3";
- TCHAR DRIVE[3], DIR[256], FNAME[256], EXT[256];
- _tsplitpath(FileName, DRIVE, DIR, FNAME, EXT);
+ wchar_t DRIVE[3], DIR[256], FNAME[256], EXT[256];
+ _wsplitpath(FileName, DRIVE, DIR, FNAME, EXT);
T2Utf pszFNAME(FNAME), pszEXT(EXT);
CMStringA fn(FORMAT, "%s%s", pszFNAME, pszEXT);
@@ -155,7 +155,7 @@ CVkFileUploadParam::VKFileType CVkFileUploadParam::GetType()
CVkChatUser* CVkChatInfo::GetUserById(LPCTSTR ptszId)
{
- int user_id = _ttoi(ptszId);
+ int user_id = _wtoi(ptszId);
return m_users.find((CVkChatUser*)&user_id);
}
diff --git a/protocols/VKontakte/src/vk_struct.h b/protocols/VKontakte/src/vk_struct.h
index 5d084189e6..86cee657fe 100644
--- a/protocols/VKontakte/src/vk_struct.h
+++ b/protocols/VKontakte/src/vk_struct.h
@@ -81,17 +81,17 @@ AsyncHttpRequest* operator<<(AsyncHttpRequest*, const TCHAR_PARAM&);
struct CVkFileUploadParam : public MZeroedObject {
enum VKFileType { typeInvalid, typeImg, typeAudio, typeDoc, typeNotSupported };
- TCHAR *FileName;
- TCHAR *Desc;
+ wchar_t *FileName;
+ wchar_t *Desc;
char *atr;
char *fname;
MCONTACT hContact;
VKFileType filetype;
- CVkFileUploadParam(MCONTACT _hContact, const TCHAR *_desc, TCHAR **_files);
+ CVkFileUploadParam(MCONTACT _hContact, const wchar_t *_desc, wchar_t **_files);
~CVkFileUploadParam();
VKFileType GetType();
- __forceinline bool IsAccess() { return ::_taccess(FileName, 0) == 0; }
+ __forceinline bool IsAccess() { return ::_waccess(FileName, 0) == 0; }
__forceinline char* atrName() { GetType(); return atr; }
__forceinline char* fileName() { GetType(); return fname; }
};
@@ -203,9 +203,9 @@ struct CVkUserInfo : public MZeroedObject {
enum VKObjType { vkNull, vkPost, vkPhoto, vkVideo, vkComment, vkTopic, vkUsers, vkCopy, vkInvite };
struct CVKNotification {
- TCHAR *ptszType;
+ wchar_t *ptszType;
VKObjType vkParent, vkFeedback;
- TCHAR *ptszTranslate;
+ wchar_t *ptszTranslate;
};
struct CVKNewsItem : public MZeroedObject {
@@ -237,7 +237,7 @@ enum BBCSupport : BYTE { bbcNo, bbcBasic, bbcAdvanced };
struct CVKBBCItem {
VKBBCType vkBBCType;
BBCSupport vkBBCSettings;
- TCHAR *ptszTempate;
+ wchar_t *ptszTempate;
};
struct CVKChatContactTypingParam {
@@ -252,12 +252,12 @@ struct CVKChatContactTypingParam {
struct CVKInteres {
const char *szField;
- TCHAR *ptszTranslate;
+ wchar_t *ptszTranslate;
};
struct CVKLang {
- TCHAR *szCode;
- TCHAR *szDescription;
+ wchar_t *szCode;
+ wchar_t *szDescription;
};
enum MarkMsgReadOn : BYTE { markOnRead, markOnReceive, markOnReply, markOnTyping };
@@ -266,12 +266,12 @@ enum MusicSendMetod : BYTE { sendNone, sendStatusOnly, sendBroadcastOnly, sendBr
enum IMGBBCSypport : BYTE { imgNo, imgFullSize, imgPreview130, imgPreview604 };
struct CVKSync {
- const TCHAR *type;
+ const wchar_t *type;
SyncHistoryMetod data;
};
struct CVKMarkMsgRead {
- const TCHAR *type;
+ const wchar_t *type;
MarkMsgReadOn data;
};
@@ -351,9 +351,9 @@ struct CVKOptions {
CMOption<DWORD> iInvisibleInterval;
CMOption<DWORD> iMaxFriendsCount;
- CMOption<TCHAR*> ptszDefaultGroup;
- CMOption<TCHAR*> ptszReturnChatMessage;
- CMOption<TCHAR*> ptszVKLang;
+ CMOption<wchar_t*> ptszDefaultGroup;
+ CMOption<wchar_t*> ptszReturnChatMessage;
+ CMOption<wchar_t*> ptszVKLang;
CVKOptions(PROTO_INTERFACE *proto);
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index 2f2dcdae8b..185f52e583 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -297,7 +297,7 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self)
tszValue = jnItem["bdate"].as_mstring();
if (!tszValue.IsEmpty()) {
int d, m, y, iReadCount;
- iReadCount = _stscanf(tszValue, L"%d.%d.%d", &d, &m, &y);
+ iReadCount = swscanf(tszValue, L"%d.%d.%d", &d, &m, &y);
if (iReadCount > 1) {
if (iReadCount == 3)
setWord(hContact, "BirthYear", y);
@@ -330,7 +330,7 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self)
db_set_dw(hContact, "BuddyExpectator", "LastSeen", (DWORD)time(NULL));
db_set_dw(hContact, "BuddyExpectator", "LastStatus", ID_STATUS_ONLINE);
- int online_app = _ttoi(jnItem["online_app"].as_mstring());
+ int online_app = _wtoi(jnItem["online_app"].as_mstring());
int online_mobile = jnItem["online_mobile"].as_int();
if (online_app == 0 && online_mobile == 0)
@@ -368,7 +368,7 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self)
setTString(hContact, "AudioUrl", jnAudio["url"].as_mstring());
}
}
- else if (tszValue[0] == TCHAR(9835) && tszValue.GetLength() > 2) {
+ else if (tszValue[0] == wchar_t(9835) && tszValue.GetLength() > 2) {
setTString(hContact, "ListeningTo", &(tszValue.GetBuffer())[2]);
db_unset(hContact, m_szModuleName, "AudioUrl");
}
diff --git a/protocols/VKontakte/src/vk_wallpost.cpp b/protocols/VKontakte/src/vk_wallpost.cpp
index 3dc00b686f..5871dbcff3 100644
--- a/protocols/VKontakte/src/vk_wallpost.cpp
+++ b/protocols/VKontakte/src/vk_wallpost.cpp
@@ -30,7 +30,7 @@ INT_PTR __cdecl CVkProto::SvcWallPost(WPARAM hContact, LPARAM)
return 0;
}
-void CVkProto::WallPost(MCONTACT hContact, TCHAR *ptszMsg, TCHAR *ptszUrl, bool bFriendsOnly)
+void CVkProto::WallPost(MCONTACT hContact, wchar_t *ptszMsg, wchar_t *ptszUrl, bool bFriendsOnly)
{
debugLogA("CVkProto::WallPost");
if (!IsOnline() || (IsEmpty(ptszMsg) && IsEmpty(ptszUrl)))
diff --git a/protocols/WhatsApp/src/WhatsAPI++/MediaUploader.cpp b/protocols/WhatsApp/src/WhatsAPI++/MediaUploader.cpp
index 9b85cf80bb..ef8fec4bb3 100644
--- a/protocols/WhatsApp/src/WhatsAPI++/MediaUploader.cpp
+++ b/protocols/WhatsApp/src/WhatsAPI++/MediaUploader.cpp
@@ -19,7 +19,7 @@ static NETLIBHTTPHEADER s_imageHeaders[] =
{ "Content-Type", "multipart/form-data; boundary=zzXXzzYYzzXXzzQQ" }
};
-static std::vector<unsigned char>* sttFileToMem(const TCHAR *ptszFileName)
+static std::vector<unsigned char>* sttFileToMem(const wchar_t *ptszFileName)
{
HANDLE hFile = CreateFile(ptszFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
diff --git a/protocols/WhatsApp/src/avatars.cpp b/protocols/WhatsApp/src/avatars.cpp
index 2121430f62..e1839586e6 100644
--- a/protocols/WhatsApp/src/avatars.cpp
+++ b/protocols/WhatsApp/src/avatars.cpp
@@ -8,8 +8,8 @@ INT_PTR WhatsAppProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
if (id == NULL)
return GAIR_NOAVATAR;
- std::tstring tszFileName = GetAvatarFileName(pai->hContact);
- _tcsncpy_s(pai->filename, tszFileName.c_str(), _TRUNCATE);
+ std::wstring tszFileName = GetAvatarFileName(pai->hContact);
+ wcsncpy_s(pai->filename, tszFileName.c_str(), _TRUNCATE);
pai->format = PA_FORMAT_JPEG;
ptrA szAvatarId(getStringA(pai->hContact, WHATSAPP_KEY_AVATAR_ID));
@@ -44,9 +44,9 @@ INT_PTR WhatsAppProto::GetAvatarCaps(WPARAM wParam, LPARAM lParam)
return -1;
}
-std::tstring WhatsAppProto::GetAvatarFileName(MCONTACT hContact)
+std::wstring WhatsAppProto::GetAvatarFileName(MCONTACT hContact)
{
- std::tstring result = m_tszAvatarFolder + L"\\";
+ std::wstring result = m_tszAvatarFolder + L"\\";
std::string jid;
if (hContact != NULL) {
@@ -58,17 +58,17 @@ std::tstring WhatsAppProto::GetAvatarFileName(MCONTACT hContact)
}
else jid = m_szJid;
- return result + std::tstring(_A2T(jid.c_str())) + L".jpg";
+ return result + std::wstring(_A2T(jid.c_str())) + L".jpg";
}
INT_PTR WhatsAppProto::GetMyAvatar(WPARAM wParam, LPARAM lParam)
{
- std::tstring tszOwnAvatar(m_tszAvatarFolder + L"\\myavatar.jpg");
- _tcsncpy_s((TCHAR*)wParam, lParam, tszOwnAvatar.c_str(), _TRUNCATE);
+ std::wstring tszOwnAvatar(m_tszAvatarFolder + L"\\myavatar.jpg");
+ wcsncpy_s((wchar_t*)wParam, lParam, tszOwnAvatar.c_str(), _TRUNCATE);
return 0;
}
-static std::vector<unsigned char>* sttFileToMem(const TCHAR *ptszFileName)
+static std::vector<unsigned char>* sttFileToMem(const wchar_t *ptszFileName)
{
HANDLE hFile = CreateFile(ptszFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
@@ -81,12 +81,12 @@ static std::vector<unsigned char>* sttFileToMem(const TCHAR *ptszFileName)
return result;
}
-int WhatsAppProto::InternalSetAvatar(MCONTACT hContact, const char *szJid, const TCHAR *ptszFileName)
+int WhatsAppProto::InternalSetAvatar(MCONTACT hContact, const char *szJid, const wchar_t *ptszFileName)
{
if (!isOnline() || ptszFileName == NULL)
return 1;
- if (_taccess(ptszFileName, 4) != 0)
+ if (_waccess(ptszFileName, 4) != 0)
return errno;
ResizeBitmap resize = { 0 };
@@ -100,15 +100,15 @@ int WhatsAppProto::InternalSetAvatar(MCONTACT hContact, const char *szJid, const
if (hbmpPreview == NULL)
return 3;
- TCHAR tszTempFile[MAX_PATH], tszMyFile[MAX_PATH];
+ wchar_t tszTempFile[MAX_PATH], tszMyFile[MAX_PATH];
if (hContact == NULL) {
mir_sntprintf(tszMyFile, L"%s\\myavatar.jpg", m_tszAvatarFolder.c_str());
mir_sntprintf(tszTempFile, L"%s\\myavatar.preview.jpg", m_tszAvatarFolder.c_str());
}
else {
- std::tstring tszContactAva = GetAvatarFileName(hContact);
- _tcsncpy_s(tszMyFile, tszContactAva.c_str(), _TRUNCATE);
- _tcsncpy_s(tszTempFile, (tszContactAva + L".preview").c_str(), _TRUNCATE);
+ std::wstring tszContactAva = GetAvatarFileName(hContact);
+ wcsncpy_s(tszMyFile, tszContactAva.c_str(), _TRUNCATE);
+ wcsncpy_s(tszTempFile, (tszContactAva + L".preview").c_str(), _TRUNCATE);
}
IMGSRVC_INFO saveInfo = { sizeof(saveInfo), 0 };
@@ -130,5 +130,5 @@ int WhatsAppProto::InternalSetAvatar(MCONTACT hContact, const char *szJid, const
INT_PTR WhatsAppProto::SetMyAvatar(WPARAM, LPARAM lParam)
{
- return InternalSetAvatar(NULL, m_szJid.c_str(), (const TCHAR*)lParam);
+ return InternalSetAvatar(NULL, m_szJid.c_str(), (const wchar_t*)lParam);
}
diff --git a/protocols/WhatsApp/src/chat.cpp b/protocols/WhatsApp/src/chat.cpp
index e55e8274cf..f33a628461 100644
--- a/protocols/WhatsApp/src/chat.cpp
+++ b/protocols/WhatsApp/src/chat.cpp
@@ -1,6 +1,6 @@
#include "stdafx.h"
-static const TCHAR *sttStatuses[] = { LPGENT("Members"), LPGENT("Owners") };
+static const wchar_t *sttStatuses[] = { LPGENW("Members"), LPGENW("Owners") };
enum
{
@@ -100,17 +100,17 @@ int WhatsAppProto::onGroupChatEvent(WPARAM, LPARAM lParam)
static gc_item sttLogListItems[] =
{
- { LPGENT("&Invite a user"), IDM_INVITE, MENU_ITEM },
+ { LPGENW("&Invite a user"), IDM_INVITE, MENU_ITEM },
{ NULL, 0, MENU_SEPARATOR },
- { LPGENT("&Room options"), 0, MENU_NEWPOPUP },
- { LPGENT("View/change &topic"), IDM_TOPIC, MENU_POPUPITEM },
- { LPGENT("&Quit chat session"), IDM_LEAVE, MENU_POPUPITEM },
+ { LPGENW("&Room options"), 0, MENU_NEWPOPUP },
+ { LPGENW("View/change &topic"), IDM_TOPIC, MENU_POPUPITEM },
+ { LPGENW("&Quit chat session"), IDM_LEAVE, MENU_POPUPITEM },
#ifdef _DEBUG
- { LPGENT("Set &avatar"), IDM_AVATAR, MENU_POPUPITEM }, // doesn't work, therefore commented out
+ { LPGENW("Set &avatar"), IDM_AVATAR, MENU_POPUPITEM }, // doesn't work, therefore commented out
#endif
{ NULL, 0, MENU_SEPARATOR },
- { LPGENT("Copy room &JID"), IDM_CPY_RJID, MENU_ITEM },
- { LPGENT("Copy room topic"), IDM_CPY_TOPIC, MENU_ITEM },
+ { LPGENW("Copy room &JID"), IDM_CPY_RJID, MENU_ITEM },
+ { LPGENW("Copy room topic"), IDM_CPY_TOPIC, MENU_ITEM },
};
void WhatsAppProto::ChatLogMenuHook(WAChatInfo *pInfo, struct GCHOOK *gch)
@@ -165,7 +165,7 @@ void WhatsAppProto::EditChatSubject(WAChatInfo *pInfo)
void WhatsAppProto::SetChatAvatar(WAChatInfo *pInfo)
{
- TCHAR tszFileName[MAX_PATH], filter[256];
+ wchar_t tszFileName[MAX_PATH], filter[256];
Bitmap_GetFilter(filter, _countof(filter));
OPENFILENAME ofn = { 0 };
@@ -178,7 +178,7 @@ void WhatsAppProto::SetChatAvatar(WAChatInfo *pInfo)
ofn.lpstrInitialDir = L".";
ofn.lpstrDefExt = L"";
if (GetOpenFileName(&ofn))
- if (_taccess(tszFileName, 4) != -1)
+ if (_waccess(tszFileName, 4) != -1)
InternalSetAvatar(pInfo->hContact, _T2A(pInfo->tszJid), tszFileName);
}
@@ -187,12 +187,12 @@ void WhatsAppProto::SetChatAvatar(WAChatInfo *pInfo)
static gc_item sttNickListItems[] =
{
- { LPGENT("&Add to roster"), IDM_ADD_RJID, MENU_POPUPITEM },
+ { LPGENW("&Add to roster"), IDM_ADD_RJID, MENU_POPUPITEM },
{ NULL, 0, MENU_SEPARATOR },
- { LPGENT("&Kick"), IDM_KICK, MENU_ITEM },
+ { LPGENW("&Kick"), IDM_KICK, MENU_ITEM },
{ NULL, 0, MENU_SEPARATOR },
- { LPGENT("Copy &nickname"), IDM_CPY_NICK, MENU_ITEM },
- { LPGENT("Copy real &JID"), IDM_CPY_RJID, MENU_ITEM },
+ { LPGENW("Copy &nickname"), IDM_CPY_NICK, MENU_ITEM },
+ { LPGENW("Copy real &JID"), IDM_CPY_RJID, MENU_ITEM },
};
void WhatsAppProto::NickListMenuHook(WAChatInfo *pInfo, struct GCHOOK *gch)
@@ -216,7 +216,7 @@ void WhatsAppProto::NickListMenuHook(WAChatInfo *pInfo, struct GCHOOK *gch)
}
}
-void WhatsAppProto::AddChatUser(WAChatInfo*, const TCHAR *ptszJid)
+void WhatsAppProto::AddChatUser(WAChatInfo*, const wchar_t *ptszJid)
{
std::string jid((char*)_T2A(ptszJid));
MCONTACT hContact = ContactIDToHContact(jid);
@@ -226,8 +226,8 @@ void WhatsAppProto::AddChatUser(WAChatInfo*, const TCHAR *ptszJid)
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
psr.flags = PSR_TCHAR;
- psr.id.t = (TCHAR*)ptszJid;
- psr.nick.t = GetChatUserNick(jid);
+ psr.id.w = (wchar_t*)ptszJid;
+ psr.nick.w = GetChatUserNick(jid);
ADDCONTACTSTRUCT acs = { 0 };
acs.handleType = HANDLE_SEARCHRESULT;
@@ -236,7 +236,7 @@ void WhatsAppProto::AddChatUser(WAChatInfo*, const TCHAR *ptszJid)
CallService(MS_ADDCONTACT_SHOW, (WPARAM)pcli->hwndContactList, (LPARAM)&acs);
}
-void WhatsAppProto::KickChatUser(WAChatInfo *pInfo, const TCHAR *ptszJid)
+void WhatsAppProto::KickChatUser(WAChatInfo *pInfo, const wchar_t *ptszJid)
{
if (!isOnline())
return;
@@ -290,7 +290,7 @@ int WhatsAppProto::OnChatMenu(WPARAM, LPARAM lParam)
WAChatInfo* WhatsAppProto::InitChat(const std::string &jid, const std::string &nick)
{
- TCHAR *ptszJid = str2t(jid), *ptszNick = str2t(nick);
+ wchar_t *ptszJid = str2t(jid), *ptszNick = str2t(nick);
WAChatInfo *pInfo = new WAChatInfo(ptszJid, ptszNick);
m_chats[jid] = pInfo;
@@ -328,9 +328,9 @@ WAChatInfo* WhatsAppProto::InitChat(const std::string &jid, const std::string &n
return pInfo;
}
-TCHAR* WhatsAppProto::GetChatUserNick(const std::string &jid)
+wchar_t* WhatsAppProto::GetChatUserNick(const std::string &jid)
{
- TCHAR* tszNick;
+ wchar_t* tszNick;
if (m_szJid != jid) {
MCONTACT hContact = ContactIDToHContact(jid);
tszNick = (hContact == 0) ? utils::removeA(str2t(jid)) : mir_tstrdup(pcli->pfnGetContactDisplayName(hContact, 0));
diff --git a/protocols/WhatsApp/src/contacts.cpp b/protocols/WhatsApp/src/contacts.cpp
index 3dfeec59a1..2c9f0c17e9 100644
--- a/protocols/WhatsApp/src/contacts.cpp
+++ b/protocols/WhatsApp/src/contacts.cpp
@@ -133,11 +133,11 @@ void WhatsAppProto::UpdateStatusMsg(MCONTACT hContact)
bool denied = getBool(hContact, WHATSAPP_KEY_LAST_SEEN_DENIED, false);
if (lastSeen > 0) {
time_t ts = lastSeen;
- TCHAR stzLastSeen[MAX_PATH];
+ wchar_t stzLastSeen[MAX_PATH];
if (status == ID_STATUS_ONLINE)
- _tcsftime(stzLastSeen, _countof(stzLastSeen), TranslateT("Last online on %x at %X"), localtime(&ts));
+ wcsftime(stzLastSeen, _countof(stzLastSeen), TranslateT("Last online on %x at %X"), localtime(&ts));
else
- _tcsftime(stzLastSeen, _countof(stzLastSeen), denied ? TranslateT("Denied: Last online on %x at %X") : TranslateT("Last seen on %x at %X"), localtime(&ts));
+ wcsftime(stzLastSeen, _countof(stzLastSeen), denied ? TranslateT("Denied: Last online on %x at %X") : TranslateT("Last seen on %x at %X"), localtime(&ts));
ss << stzLastSeen;
}
@@ -162,15 +162,15 @@ void WhatsAppProto::onSendGetPicture(const std::string &jid, const std::vector<u
debugLogA("Updating avatar for jid %s", jid.c_str());
// Save avatar
- std::tstring filename = GetAvatarFileName(hContact);
- FILE *f = _tfopen(filename.c_str(), L"wb");
+ std::wstring filename = GetAvatarFileName(hContact);
+ FILE *f = _wfopen(filename.c_str(), L"wb");
size_t r = fwrite(std::string(data.begin(), data.end()).c_str(), 1, data.size(), f);
fclose(f);
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = hContact;
ai.format = PA_FORMAT_JPEG;
- _tcsncpy_s(ai.filename, filename.c_str(), _TRUNCATE);
+ wcsncpy_s(ai.filename, filename.c_str(), _TRUNCATE);
int ackResult;
if (r > 0) {
@@ -184,7 +184,7 @@ void WhatsAppProto::onSendGetPicture(const std::string &jid, const std::vector<u
}
}
-TCHAR* WhatsAppProto::GetContactDisplayName(const string& jid)
+wchar_t* WhatsAppProto::GetContactDisplayName(const string& jid)
{
MCONTACT hContact = ContactIDToHContact(jid);
return (hContact) ? pcli->pfnGetContactDisplayName(hContact, 0) : L"none";
diff --git a/protocols/WhatsApp/src/dialogs.cpp b/protocols/WhatsApp/src/dialogs.cpp
index b770210dd6..501a09151a 100644
--- a/protocols/WhatsApp/src/dialogs.cpp
+++ b/protocols/WhatsApp/src/dialogs.cpp
@@ -1,9 +1,9 @@
#include "stdafx.h"
-#define szAskSendSms LPGEN("An SMS with registration code will be sent to your mobile phone.\nNotice that you are not able to use the real WhatsApp and this plugin simultaneously!\nContinue?")
-#define szAskCall LPGEN("A call with registration code will be made to your mobile phone.\nNotice that you are not able to use the real WhatsApp and this plugin simultaneously!\nContinue?")
-#define szPasswordSet LPGEN("Your password has been set automatically. You can proceed with login now.")
-#define szSpecifyCode LPGEN("Please correctly specify your registration code received by SMS/Voice.")
+#define szAskSendSms LPGENW("An SMS with registration code will be sent to your mobile phone.\nNotice that you are not able to use the real WhatsApp and this plugin simultaneously!\nContinue?")
+#define szAskCall LPGENW("A call with registration code will be made to your mobile phone.\nNotice that you are not able to use the real WhatsApp and this plugin simultaneously!\nContinue?")
+#define szPasswordSet LPGENW("Your password has been set automatically. You can proceed with login now.")
+#define szSpecifyCode LPGENW("Please correctly specify your registration code received by SMS/Voice.")
class COptionsDlg : public CProtoDlgBase<WhatsAppProto>
{
@@ -52,14 +52,14 @@ public:
void OnRequestVoiceClick(CCtrlButton*)
{
- if (IDYES != MessageBox(GetHwnd(), TranslateT(szAskCall), PRODUCT_NAME, MB_YESNO))
+ if (IDYES != MessageBox(GetHwnd(), TranslateW(szAskCall), PRODUCT_NAME, MB_YESNO))
return;
ptrA cc(m_cc.GetTextA()), number(m_login.GetTextA());
string password;
if (m_proto->Register(REG_STATE_REQ_CODE, string(cc), string(number), "voice", password)) {
if (!password.empty()) {
- MessageBox(GetHwnd(), TranslateT(szPasswordSet), PRODUCT_NAME, MB_ICONWARNING);
+ MessageBox(GetHwnd(), TranslateW(szPasswordSet), PRODUCT_NAME, MB_ICONWARNING);
m_proto->setString(WHATSAPP_KEY_PASS, password.c_str());
}
else {
@@ -73,14 +73,14 @@ public:
void OnRequestSMSClick(CCtrlButton*)
{
- if (IDYES != MessageBox(GetHwnd(), TranslateT(szAskSendSms), PRODUCT_NAME, MB_YESNO))
+ if (IDYES != MessageBox(GetHwnd(), TranslateW(szAskSendSms), PRODUCT_NAME, MB_YESNO))
return;
ptrA cc(m_cc.GetTextA()), number(m_login.GetTextA());
string password;
if (m_proto->Register(REG_STATE_REQ_CODE, string(cc), string(number), "sms", password)) {
if (!password.empty()) {
- MessageBox(GetHwnd(), TranslateT(szPasswordSet), PRODUCT_NAME, MB_ICONWARNING);
+ MessageBox(GetHwnd(), TranslateW(szPasswordSet), PRODUCT_NAME, MB_ICONWARNING);
m_proto->setString(WHATSAPP_KEY_PASS, password.c_str());
}
else {
@@ -95,7 +95,7 @@ public:
void OnRegisterClick(CCtrlButton*)
{
if (GetWindowTextLength(m_pw1.GetHwnd()) != 3 || GetWindowTextLength(m_pw2.GetHwnd()) != 3)
- MessageBox(GetHwnd(), TranslateT(szSpecifyCode), PRODUCT_NAME, MB_ICONEXCLAMATION);
+ MessageBox(GetHwnd(), TranslateW(szSpecifyCode), PRODUCT_NAME, MB_ICONEXCLAMATION);
else {
char code[10];
GetWindowTextA(m_pw1.GetHwnd(), code, 4);
@@ -105,7 +105,7 @@ public:
ptrA cc(m_cc.GetTextA()), number(m_login.GetTextA());
if (m_proto->Register(REG_STATE_REG_CODE, string(cc), string(number), string(code), password)) {
m_proto->setString(WHATSAPP_KEY_PASS, password.c_str());
- MessageBox(GetHwnd(), TranslateT(szPasswordSet), PRODUCT_NAME, MB_ICONWARNING);
+ MessageBox(GetHwnd(), TranslateW(szPasswordSet), PRODUCT_NAME, MB_ICONWARNING);
}
}
m_proto->setByte("CodeRequestDone", 0);
@@ -133,11 +133,11 @@ INT_PTR WhatsAppProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam)
int WhatsAppProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.ptszGroup = LPGENT("Network");
+ odp.pwszGroup = LPGENW("Network");
- odp.ptszTab = LPGENT("Account");
+ odp.pwszTab = LPGENW("Account");
odp.pDialog = new COptionsDlg(this, IDD_OPTIONS);
Options_AddPage(wParam, &odp);
return 0;
diff --git a/protocols/WhatsApp/src/entities.h b/protocols/WhatsApp/src/entities.h
index 657cc82f90..7ed362990e 100644
--- a/protocols/WhatsApp/src/entities.h
+++ b/protocols/WhatsApp/src/entities.h
@@ -14,9 +14,9 @@ struct send_direct
struct input_box
{
- tstring text;
- tstring title;
- tstring defaultValue;
+ wstring text;
+ wstring title;
+ wstring defaultValue;
int limit;
void(__cdecl WhatsAppProto::*thread)(void*);
diff --git a/protocols/WhatsApp/src/main.cpp b/protocols/WhatsApp/src/main.cpp
index 26eea6b01e..f3e7513339 100644
--- a/protocols/WhatsApp/src/main.cpp
+++ b/protocols/WhatsApp/src/main.cpp
@@ -50,7 +50,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC
/////////////////////////////////////////////////////////////////////////////////////////
// Load
-static PROTO_INTERFACE* protoInit(const char *proto_name, const TCHAR *username)
+static PROTO_INTERFACE* protoInit(const char *proto_name, const wchar_t *username)
{
WhatsAppProto *proto = new WhatsAppProto(proto_name, username);
g_Instances.insert(proto);
diff --git a/protocols/WhatsApp/src/media.cpp b/protocols/WhatsApp/src/media.cpp
index c94d5ab6c8..9b3bb6f5ff 100644
--- a/protocols/WhatsApp/src/media.cpp
+++ b/protocols/WhatsApp/src/media.cpp
@@ -1,6 +1,6 @@
#include "stdafx.h"
-HANDLE WhatsAppProto::SendFile(MCONTACT hContact, const TCHAR* desc, TCHAR **ppszFiles) {
+HANDLE WhatsAppProto::SendFile(MCONTACT hContact, const wchar_t* desc, wchar_t **ppszFiles) {
if (!isOnline())
return 0;
@@ -17,7 +17,7 @@ HANDLE WhatsAppProto::SendFile(MCONTACT hContact, const TCHAR* desc, TCHAR **pps
}
// get file size
- FILE *hFile = _tfopen(ppszFiles[0], L"rb");
+ FILE *hFile = _wfopen(ppszFiles[0], L"rb");
if (hFile == NULL) {
debugLogA(__FUNCTION__": cannot open file %s", ppszFiles[0]);
mir_free(name);
@@ -69,7 +69,7 @@ HANDLE WhatsAppProto::SendFile(MCONTACT hContact, const TCHAR* desc, TCHAR **pps
SHA256_CONTEXT sha256;
mir_sha256_init(&sha256);
- FILE *fd = _tfopen(ppszFiles[0], L"rb");
+ FILE *fd = _wfopen(ppszFiles[0], L"rb");
int read = 0;
do {
char buf[1024];
diff --git a/protocols/WhatsApp/src/messages.cpp b/protocols/WhatsApp/src/messages.cpp
index aa48df5444..388b12f309 100644
--- a/protocols/WhatsApp/src/messages.cpp
+++ b/protocols/WhatsApp/src/messages.cpp
@@ -112,7 +112,7 @@ void WhatsAppProto::onMessageStatusUpdate(const FMessage &fmsg)
return;
}
- const TCHAR *ptszBy;
+ const wchar_t *ptszBy;
switch (fmsg.status) {
case FMessage::STATUS_RECEIVED_BY_SERVER: ptszBy = TranslateT("server"); break;
case FMessage::STATUS_RECEIVED_BY_TARGET: ptszBy = pcli->pfnGetContactDisplayName(hContact, 0); break;
@@ -131,7 +131,7 @@ void WhatsAppProto::onMessageStatusUpdate(const FMessage &fmsg)
time_t ts = atol(fmsg.key.id.substr(0, delim).c_str());
- TCHAR ttime[64];
- _tcsftime(ttime, _countof(ttime), L"%X", localtime(&ts));
+ wchar_t ttime[64];
+ wcsftime(ttime, _countof(ttime), L"%X", localtime(&ts));
utils::setStatusMessage(hContact, CMString(FORMAT, TranslateT("Message received: %s by %s"), ttime, ptszBy));
}
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp
index a361ad3e16..56c0d3571e 100644
--- a/protocols/WhatsApp/src/proto.cpp
+++ b/protocols/WhatsApp/src/proto.cpp
@@ -4,15 +4,15 @@
struct SearchParam
{
- SearchParam(const TCHAR *_jid, LONG _id) :
+ SearchParam(const wchar_t *_jid, LONG _id) :
jid(_jid), id(_id)
{}
- std::tstring jid;
+ std::wstring jid;
LONG id;
};
-WhatsAppProto::WhatsAppProto(const char *proto_name, const TCHAR *username)
+WhatsAppProto::WhatsAppProto(const char *proto_name, const wchar_t *username)
: PROTO<WhatsAppProto>(proto_name, username),
m_tszDefaultGroup(getTStringA(WHATSAPP_KEY_DEF_GROUP))
{
@@ -32,7 +32,7 @@ WhatsAppProto::WhatsAppProto(const char *proto_name, const TCHAR *username)
HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &WhatsAppProto::OnBuildStatusMenu);
// Create standard network connection
- TCHAR descr[512];
+ wchar_t descr[512];
mir_sntprintf(descr, TranslateT("%s server connection"), m_tszUserName);
NETLIBUSER nlu = { sizeof(nlu) };
@@ -41,14 +41,14 @@ WhatsAppProto::WhatsAppProto(const char *proto_name, const TCHAR *username)
nlu.ptszDescriptiveName = descr;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
if (m_hNetlibUser == NULL) {
- TCHAR error[200];
+ wchar_t error[200];
mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
MessageBox(NULL, error, L"Miranda NG", MB_OK | MB_ICONERROR);
}
WASocketConnection::initNetwork(m_hNetlibUser);
- m_tszAvatarFolder = std::tstring(VARST(L"%miranda_avatarcache%")) + L"\\" + m_tszUserName;
+ m_tszAvatarFolder = std::wstring(VARST(L"%miranda_avatarcache%")) + L"\\" + m_tszUserName;
DWORD dwAttributes = GetFileAttributes(m_tszAvatarFolder.c_str());
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
CreateDirectoryTreeT(m_tszAvatarFolder.c_str());
@@ -173,10 +173,10 @@ int WhatsAppProto::SetStatus(int new_status)
MCONTACT WhatsAppProto::AddToList(int flags, PROTOSEARCHRESULT *psr)
{
- if (psr->id.t == NULL)
+ if (psr->id.w == NULL)
return NULL;
- std::string phone(T2Utf(psr->id.t));
+ std::string phone(T2Utf(psr->id.w));
std::string jid(phone + "@s.whatsapp.net");
MCONTACT hContact = AddToContactList(jid, phone.c_str());
@@ -197,8 +197,8 @@ void WhatsAppProto::SearchAckThread(void *targ)
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
psr.flags = PSR_TCHAR;
- psr.nick.t = psr.firstName.t = psr.lastName.t = L"";
- psr.id.t = (TCHAR*)param->jid.c_str();
+ psr.nick.w = psr.firstName.w = psr.lastName.w = L"";
+ psr.id.w = (wchar_t*)param->jid.c_str();
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)param->id, (LPARAM)&psr);
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)param->id, 0);
@@ -206,7 +206,7 @@ void WhatsAppProto::SearchAckThread(void *targ)
delete param;
}
-HANDLE WhatsAppProto::SearchBasic(const TCHAR* id)
+HANDLE WhatsAppProto::SearchBasic(const wchar_t* id)
{
if (isOffline())
return 0;
@@ -264,7 +264,7 @@ bool WhatsAppProto::Register(int state, const string &cc, const string &number,
NETLIBHTTPREQUEST* pnlhr = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION,
(WPARAM)WASocketConnection::hNetlibUser, (LPARAM)&nlhr);
- const TCHAR *ptszTitle = TranslateT("Registration");
+ const wchar_t *ptszTitle = TranslateT("Registration");
if (pnlhr == NULL) {
NotifyEvent(ptszTitle, TranslateT("Registration failed. Invalid server response."), NULL, WHATSAPP_EVENT_CLIENT);
return false;
@@ -366,16 +366,16 @@ LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
return DefWindowProc(hwnd, message, wParam, lParam);
};
-void WhatsAppProto::NotifyEvent(const string& title, const string& info, MCONTACT contact, DWORD flags, TCHAR* url)
+void WhatsAppProto::NotifyEvent(const string& title, const string& info, MCONTACT contact, DWORD flags, wchar_t* url)
{
- TCHAR *rawTitle = mir_a2t_cp(title.c_str(), CP_UTF8);
- TCHAR *rawInfo = mir_a2t_cp(info.c_str(), CP_UTF8);
+ wchar_t *rawTitle = mir_a2t_cp(title.c_str(), CP_UTF8);
+ wchar_t *rawInfo = mir_a2t_cp(info.c_str(), CP_UTF8);
NotifyEvent(rawTitle, rawInfo, contact, flags, url);
mir_free(rawTitle);
mir_free(rawInfo);
}
-void WhatsAppProto::NotifyEvent(const TCHAR *title, const TCHAR *info, MCONTACT contact, DWORD flags, TCHAR* szUrl)
+void WhatsAppProto::NotifyEvent(const wchar_t *title, const wchar_t *info, MCONTACT contact, DWORD flags, wchar_t* szUrl)
{
int ret, timeout = 0;
COLORREF colorBack = 0, colorText = 0;
@@ -431,8 +431,8 @@ void WhatsAppProto::NotifyEvent(const TCHAR *title, const TCHAR *info, MCONTACT
err.szProto = m_szModuleName;
err.cbSize = sizeof(err);
err.dwInfoFlags = NIIF_INTERN_TCHAR | niif_flags;
- err.tszInfoTitle = (TCHAR*)title;
- err.tszInfo = (TCHAR*)info;
+ err.tszInfoTitle = (wchar_t*)title;
+ err.tszInfo = (wchar_t*)info;
err.uTimeout = 1000 * timeout;
ret = CallService(MS_CLIST_SYSTRAY_NOTIFY, 0, (LPARAM)& err);
diff --git a/protocols/WhatsApp/src/proto.h b/protocols/WhatsApp/src/proto.h
index 2822dd85d0..04a557f893 100644
--- a/protocols/WhatsApp/src/proto.h
+++ b/protocols/WhatsApp/src/proto.h
@@ -7,13 +7,13 @@ class WASocketConnection;
struct WAChatInfo
{
- WAChatInfo(TCHAR *_jid, TCHAR *_nick) :
+ WAChatInfo(wchar_t *_jid, wchar_t *_nick) :
tszJid(_jid), tszNick(_nick)
{
bActive = false;
}
- map<std::string, std::tstring> m_unsentMsgs;
+ map<std::string, std::wstring> m_unsentMsgs;
ptrT tszJid, tszNick, tszOwner;
bool bActive;
@@ -23,7 +23,7 @@ struct WAChatInfo
class WhatsAppProto : public PROTO<WhatsAppProto>, public WAListener, public WAGroupListener
{
public:
- WhatsAppProto(const char *proto_name, const TCHAR *username);
+ WhatsAppProto(const char *proto_name, const wchar_t *username);
~WhatsAppProto();
inline bool isOnline() const
@@ -44,13 +44,13 @@ public:
virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
- virtual HANDLE __cdecl SearchBasic(const TCHAR* id);
+ virtual HANDLE __cdecl SearchBasic(const wchar_t* id);
virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*);
virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg);
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR*, TCHAR **ppszFiles);
+ virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t*, wchar_t **ppszFiles);
virtual int __cdecl SetStatus(int iNewStatus);
@@ -85,7 +85,7 @@ public:
MCONTACT ContactIDToHContact(const std::string&);
void SetAllContactStatuses(int status, bool reset_client = false);
void UpdateStatusMsg(MCONTACT hContact);
- TCHAR* GetContactDisplayName(const string &jid);
+ wchar_t* GetContactDisplayName(const string &jid);
void RequestFriendship(MCONTACT hContact);
// Group chats ///////////////////////////////////////////////////////////////////////
@@ -98,11 +98,11 @@ public:
void ChatLogMenuHook(WAChatInfo *pInfo, GCHOOK *gch);
void NickListMenuHook(WAChatInfo *pInfo, GCHOOK *gch);
- void AddChatUser(WAChatInfo *pInfo, const TCHAR *ptszJid);
+ void AddChatUser(WAChatInfo *pInfo, const wchar_t *ptszJid);
void EditChatSubject(WAChatInfo *pInfo);
void InviteChatUser(WAChatInfo *pInfo);
- void KickChatUser(WAChatInfo *pInfo, const TCHAR *ptszJid);
- TCHAR* GetChatUserNick(const std::string &jid);
+ void KickChatUser(WAChatInfo *pInfo, const wchar_t *ptszJid);
+ wchar_t* GetChatUserNick(const std::string &jid);
void SetChatAvatar(WAChatInfo *pInfo);
void onGroupMessageReceived(const FMessage &fmsg);
@@ -131,15 +131,15 @@ private:
/// Avatars //////////////////////////////////////////////////////////////////////////
- std::tstring GetAvatarFileName(MCONTACT);
- std::tstring m_tszAvatarFolder;
+ std::wstring GetAvatarFileName(MCONTACT);
+ std::wstring m_tszAvatarFolder;
INT_PTR __cdecl GetAvatarInfo(WPARAM, LPARAM);
INT_PTR __cdecl GetAvatarCaps(WPARAM, LPARAM);
INT_PTR __cdecl GetMyAvatar(WPARAM, LPARAM);
INT_PTR __cdecl SetMyAvatar(WPARAM, LPARAM);
- int InternalSetAvatar(MCONTACT hContact, const char *szJid, const TCHAR *ptszFileName);
+ int InternalSetAvatar(MCONTACT hContact, const char *szJid, const wchar_t *ptszFileName);
// Private data //////////////////////////////////////////////////////////////////////
@@ -196,8 +196,8 @@ protected:
// Information providing /////////////////////////////////////////////////////////////
- void NotifyEvent(const TCHAR *title, const TCHAR *info, MCONTACT contact, DWORD flags, TCHAR *url = NULL);
- void NotifyEvent(const std::string &title, const std::string &info, MCONTACT contact, DWORD flags, TCHAR *url = NULL);
+ void NotifyEvent(const wchar_t *title, const wchar_t *info, MCONTACT contact, DWORD flags, wchar_t *url = NULL);
+ void NotifyEvent(const std::string &title, const std::string &info, MCONTACT contact, DWORD flags, wchar_t *url = NULL);
};
#endif
diff --git a/protocols/WhatsApp/src/utils.cpp b/protocols/WhatsApp/src/utils.cpp
index 35f84bcc1e..71a33dc2fd 100644
--- a/protocols/WhatsApp/src/utils.cpp
+++ b/protocols/WhatsApp/src/utils.cpp
@@ -1,16 +1,16 @@
#include "stdafx.h"
-TCHAR* utils::removeA(TCHAR *str)
+wchar_t* utils::removeA(wchar_t *str)
{
if (str == NULL)
return NULL;
- TCHAR *p = _tcschr(str, '@');
+ wchar_t *p = wcschr(str, '@');
if (p) *p = 0;
return str;
}
-void utils::copyText(HWND hwnd, const TCHAR *text)
+void utils::copyText(HWND hwnd, const wchar_t *text)
{
if (!hwnd || !text) return;
@@ -18,8 +18,8 @@ void utils::copyText(HWND hwnd, const TCHAR *text)
return;
EmptyClipboard();
- HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(mir_tstrlen(text) + 1));
- mir_tstrcpy((TCHAR*)GlobalLock(hMem), text);
+ HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, sizeof(wchar_t)*(mir_tstrlen(text) + 1));
+ mir_tstrcpy((wchar_t*)GlobalLock(hMem), text);
GlobalUnlock(hMem);
SetClipboardData(CF_UNICODETEXT, hMem);
CloseClipboard();
@@ -45,13 +45,13 @@ std::string getLastErrorMsg()
return ret;
}
-void utils::setStatusMessage(MCONTACT hContact, const TCHAR *ptszMessage)
+void utils::setStatusMessage(MCONTACT hContact, const wchar_t *ptszMessage)
{
if (ptszMessage != NULL) {
StatusTextData st = { 0 };
st.cbSize = sizeof(st);
st.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
- _tcsncpy_s(st.tszText, ptszMessage, _TRUNCATE);
+ wcsncpy_s(st.tszText, ptszMessage, _TRUNCATE);
CallService(MS_MSG_SETSTATUSTEXT, hContact, (LPARAM)&st);
}
else CallService(MS_MSG_SETSTATUSTEXT, hContact, NULL);
diff --git a/protocols/WhatsApp/src/utils.h b/protocols/WhatsApp/src/utils.h
index 0e760f5013..333860c1dd 100644
--- a/protocols/WhatsApp/src/utils.h
+++ b/protocols/WhatsApp/src/utils.h
@@ -27,7 +27,7 @@ public:
std::string getLastErrorMsg();
-__forceinline TCHAR* str2t(const std::string &str)
+__forceinline wchar_t* str2t(const std::string &str)
{ return mir_utf8decodeT(str.c_str());
}
@@ -36,10 +36,10 @@ std::vector<std::string> &split(const std::string &s, char delim, std::vector<st
namespace utils
{
- TCHAR* removeA(TCHAR *str);
- void copyText(HWND hwnd, const TCHAR *text);
+ wchar_t* removeA(wchar_t *str);
+ void copyText(HWND hwnd, const wchar_t *text);
- void setStatusMessage(MCONTACT hContact, const TCHAR *ptszMessage);
+ void setStatusMessage(MCONTACT hContact, const wchar_t *ptszMessage);
BYTE* md5string(const BYTE*, int, BYTE* digest);
__forceinline BYTE* md5string(const std::string &str, BYTE* digest)
diff --git a/protocols/Yahoo/src/avatar.cpp b/protocols/Yahoo/src/avatar.cpp
index ec1696c65d..34f68acc0a 100644
--- a/protocols/Yahoo/src/avatar.cpp
+++ b/protocols/Yahoo/src/avatar.cpp
@@ -112,10 +112,10 @@ void __cdecl CYahooProto::send_avt_thread(void *psf)
setByte("AvatarUL", 0);
}
-void CYahooProto::SendAvatar(const TCHAR *szFile)
+void CYahooProto::SendAvatar(const wchar_t *szFile)
{
struct _stat statbuf;
- if (_tstat(szFile, &statbuf) != 0) {
+ if (_wstat(szFile, &statbuf) != 0) {
LOG(("[YAHOO_SendAvatar] Error reading File information?!"));
return;
}
@@ -146,7 +146,7 @@ void __cdecl CYahooProto::recv_avatarthread(void *pavt)
{
avatar_info *avt = (avatar_info*)pavt;
int error = 0;
- TCHAR buf[4096];
+ wchar_t buf[4096];
if (avt == NULL) {
debugLogA("AVT IS NULL!!!");
@@ -241,7 +241,7 @@ void __cdecl CYahooProto::recv_avatarthread(void *pavt)
PROTO_AVATAR_INFORMATION ai;
ai.format = PA_FORMAT_PNG;
ai.hContact = hContact;
- _tcsncpy_s(ai.filename, buf, _TRUNCATE);
+ wcsncpy_s(ai.filename, buf, _TRUNCATE);
if (error)
setDword(hContact, "PictCK", 0);
@@ -295,7 +295,7 @@ void CYahooProto::ext_got_picture(const char*, const char *who, const char *pic_
// NO avatar URL??
if (!getTString("AvatarFile", &dbv)) {
struct _stat statbuf;
- if (_tstat(dbv.ptszVal, &statbuf) != 0) {
+ if (_wstat(dbv.ptszVal, &statbuf) != 0) {
LOG(("[ext_yahoo_got_picture] Avatar File Missing? Can't find file: %s", dbv.ptszVal));
}
else {
@@ -342,10 +342,10 @@ void CYahooProto::ext_got_picture(const char*, const char *who, const char *pic_
return;
}
- TCHAR z[1024];
+ wchar_t z[1024];
GetAvatarFileName(hContact, z, 1024, getByte(hContact, "AvatarType", 0));
- if (getDword(hContact, "PictCK", 0) != cksum || _taccess(z, 0) != 0) {
+ if (getDword(hContact, "PictCK", 0) != cksum || _waccess(z, 0) != 0) {
debugLogA("[ext_yahoo_got_picture] Checksums don't match or avatar file is missing. Current: %d, New: %d",
getDword(hContact, "PictCK", 0), cksum);
@@ -460,7 +460,7 @@ void CYahooProto::ext_got_picture_checksum(const char*, const char *who, int cks
setDword(hContact, "PictCK", cksum);
// Need to delete the Avatar File!!
- TCHAR szFile[MAX_PATH];
+ wchar_t szFile[MAX_PATH];
GetAvatarFileName(hContact, szFile, _countof(szFile) - 1, 0);
DeleteFile(szFile);
@@ -594,11 +594,11 @@ void CYahooProto::request_avatar(const char* who)
else LOG(("Avatar Not Available for: %s Last Check: %ld Current: %ld (Flood Check in Effect)", who, last_chk, cur_time));
}
-void CYahooProto::GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, int cbLen, int type)
+void CYahooProto::GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, int cbLen, int type)
{
int tPathLen = mir_sntprintf(pszDest, cbLen, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
- if (_taccess(pszDest, 0))
+ if (_waccess(pszDest, 0))
CreateDirectoryTreeT(pszDest);
if (hContact != NULL) {
@@ -608,7 +608,7 @@ void CYahooProto::GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, int cbLen
else
tPathLen += mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%S avatar", m_szModuleName);
- _tcsncpy_s((pszDest + tPathLen), (cbLen - tPathLen), (type == 1 ? L".swf" : L".png"), _TRUNCATE);
+ wcsncpy_s((pszDest + tPathLen), (cbLen - tPathLen), (type == 1 ? L".swf" : L".png"), _TRUNCATE);
}
INT_PTR __cdecl CYahooProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
@@ -648,7 +648,7 @@ INT_PTR __cdecl CYahooProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
pai->format = PA_FORMAT_PNG;
debugLogA("[YAHOO_GETAVATARINFO] filename: %s", pai->filename);
- if (_taccess(pai->filename, 0) == 0)
+ if (_waccess(pai->filename, 0) == 0)
return GAIR_SUCCESS;
if ((wParam & GAIF_FORCE) != 0 && pai->hContact != NULL) {
@@ -733,7 +733,7 @@ return=0 on success, else on error
*/
INT_PTR __cdecl CYahooProto::GetMyAvatar(WPARAM wParam, LPARAM lParam)
{
- TCHAR *buffer = (TCHAR*)wParam;
+ wchar_t *buffer = (wchar_t*)wParam;
int size = (int)lParam;
debugLogA("[YahooGetMyAvatar]");
@@ -749,7 +749,7 @@ INT_PTR __cdecl CYahooProto::GetMyAvatar(WPARAM wParam, LPARAM lParam)
if (getDword("AvatarHash", 0)) {
if (!getTString("AvatarFile", &dbv)) {
- if (_taccess(dbv.ptszVal, 0) == 0) {
+ if (_waccess(dbv.ptszVal, 0) == 0) {
mir_tstrncpy(buffer, dbv.ptszVal, size - 1);
buffer[size - 1] = '\0';
@@ -771,8 +771,8 @@ return=0 for sucess
INT_PTR __cdecl CYahooProto::SetMyAvatar(WPARAM, LPARAM lParam)
{
- TCHAR* tszFile = (TCHAR*)lParam;
- TCHAR tszMyFile[MAX_PATH + 1];
+ wchar_t* tszFile = (wchar_t*)lParam;
+ wchar_t tszMyFile[MAX_PATH + 1];
GetAvatarFileName(NULL, tszMyFile, MAX_PATH, 2);
diff --git a/protocols/Yahoo/src/chat.cpp b/protocols/Yahoo/src/chat.cpp
index 105f86f19e..ce59ae92f6 100644
--- a/protocols/Yahoo/src/chat.cpp
+++ b/protocols/Yahoo/src/chat.cpp
@@ -37,7 +37,7 @@ struct InviteChatReqParam
{
char* room;
char* who;
- TCHAR* msg;
+ wchar_t* msg;
CYahooProto* ppro;
InviteChatReqParam(const char* room, const char* who, const char* msg, CYahooProto* ppro)
@@ -51,9 +51,9 @@ INT_PTR CALLBACK InviteToChatDialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
void ext_yahoo_conf_userdecline(int id, const char*, const char *who, const char *room, const char *msg)
{
- TCHAR info[1024];
- TCHAR *whot = mir_utf8decodeT(who);
- TCHAR *msgt = mir_utf8decodeT(msg);
+ wchar_t info[1024];
+ wchar_t *whot = mir_utf8decodeT(who);
+ wchar_t *msgt = mir_utf8decodeT(msg);
mir_sntprintf(info, TranslateT("%s denied invitation with message: %s"), whot, msgt ? msgt : L"");
GETPROTOBYID(id)->ChatEvent(room, who, GC_EVENT_INFORMATION, info);
mir_free(msgt);
@@ -98,7 +98,7 @@ void ext_yahoo_conf_userleave(int id, const char*, const char *who, const char *
void ext_yahoo_conf_message(int id, const char*, const char *who, const char *room, const char *msg, int utf8)
{
- TCHAR *msgt = utf8 ? mir_utf8decodeT(msg) : mir_a2t(msg);
+ wchar_t *msgt = utf8 ? mir_utf8decodeT(msg) : mir_a2t(msg);
GETPROTOBYID(id)->ChatEvent(room, who, GC_EVENT_MESSAGE, msgt);
mir_free(msgt);
}
@@ -150,7 +150,7 @@ void CYahooProto::ChatRegister(void)
void CYahooProto::ChatStart(const char* room)
{
- TCHAR* idt = mir_a2t(room);
+ wchar_t* idt = mir_a2t(room);
GCSESSION gcw = { sizeof(gcw) };
gcw.iType = GCW_CHATROOM;
@@ -178,7 +178,7 @@ void CYahooProto::ChatStart(const char* room)
void CYahooProto::ChatLeave(const char* room)
{
- TCHAR* idt = mir_a2t(room);
+ wchar_t* idt = mir_a2t(room);
GCDEST gcd = { m_szModuleName, idt, GC_EVENT_CONTROL };
GCEVENT gce = { sizeof(gce), &gcd };
@@ -195,13 +195,13 @@ void CYahooProto::ChatLeaveAll(void)
ChatLeave(m_chatrooms[i].name);
}
-void CYahooProto::ChatEvent(const char* room, const char* who, int evt, const TCHAR* msg)
+void CYahooProto::ChatEvent(const char* room, const char* who, int evt, const wchar_t* msg)
{
- TCHAR* idt = mir_a2t(room);
- TCHAR* snt = mir_a2t(who);
+ wchar_t* idt = mir_a2t(room);
+ wchar_t* snt = mir_a2t(who);
MCONTACT hContact = getbuddyH(who);
- TCHAR* nick = hContact ? (TCHAR*)pcli->pfnGetContactDisplayName(WPARAM(hContact), 0) : snt;
+ wchar_t* nick = hContact ? (wchar_t*)pcli->pfnGetContactDisplayName(WPARAM(hContact), 0) : snt;
GCDEST gcd = { m_szModuleName, idt, evt };
GCEVENT gce = { sizeof(gce), &gcd };
@@ -340,7 +340,7 @@ int __cdecl CYahooProto::OnGCMenuHook(WPARAM, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
// Invite to chat dialog
-static void clist_chat_invite_send(MCONTACT hItem, HWND hwndList, YList* &who, char* room, CYahooProto* ppro, TCHAR *msg)
+static void clist_chat_invite_send(MCONTACT hItem, HWND hwndList, YList* &who, char* room, CYahooProto* ppro, wchar_t *msg)
{
bool root = !hItem;
if (root)
@@ -356,7 +356,7 @@ static void clist_chat_invite_send(MCONTACT hItem, HWND hwndList, YList* &who, c
int chk = SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0);
if (chk) {
if (IsHContactInfo(hItem)) {
- TCHAR buf[128] = L"";
+ wchar_t buf[128] = L"";
SendMessage(hwndList, CLM_GETITEMTEXT, (WPARAM)hItem, (LPARAM)buf);
who = y_list_append(who, mir_t2a(buf));
@@ -462,7 +462,7 @@ INT_PTR CALLBACK InviteToChatDialog(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR
switch (LOWORD(wParam)) {
case IDC_ADDSCR:
if (param->ppro->m_bLoggedIn) {
- TCHAR sn[64];
+ wchar_t sn[64];
GetDlgItemText(hwndDlg, IDC_EDITSCR, sn, _countof(sn));
CLCINFOITEM cii = { 0 };
@@ -477,7 +477,7 @@ INT_PTR CALLBACK InviteToChatDialog(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR
case IDOK:
{
- TCHAR msg[1024];
+ wchar_t msg[1024];
GetDlgItemText(hwndDlg, IDC_MSG, msg, _countof(msg));
HWND hwndList = GetDlgItem(hwndDlg, IDC_CCLIST);
@@ -548,7 +548,7 @@ INT_PTR CALLBACK ChatRequestDialog(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
case IDCANCEL:
if (cm) {
- TCHAR msg[1024];
+ wchar_t msg[1024];
GetDlgItemText(hwndDlg, IDC_MSG2, msg, _countof(msg));
yahoo_conference_decline(param->ppro->m_id, NULL, cm->members, param->room, T2Utf(msg));
diff --git a/protocols/Yahoo/src/file_transfer.cpp b/protocols/Yahoo/src/file_transfer.cpp
index d5549b571c..c0620894dd 100644
--- a/protocols/Yahoo/src/file_transfer.cpp
+++ b/protocols/Yahoo/src/file_transfer.cpp
@@ -53,7 +53,7 @@ static y_filetransfer* new_ft(CYahooProto* ppro, int id, MCONTACT hContact, cons
ft->pfts.totalFiles = y_list_length(fs);
- ft->pfts.ptszFiles = (TCHAR**)mir_calloc(ft->pfts.totalFiles * sizeof(TCHAR *));
+ ft->pfts.ptszFiles = (wchar_t**)mir_calloc(ft->pfts.totalFiles * sizeof(wchar_t *));
ft->pfts.totalBytes = 0;
int i = 0;
@@ -67,7 +67,7 @@ static y_filetransfer* new_ft(CYahooProto* ppro, int id, MCONTACT hContact, cons
ft->pfts.currentFileNumber = 0;
yahoo_file_info *fi = (yahoo_file_info*)fs->data;
- ft->pfts.tszCurrentFile = _tcsdup(ft->pfts.ptszFiles[ft->pfts.currentFileNumber]);
+ ft->pfts.tszCurrentFile = wcsdup(ft->pfts.ptszFiles[ft->pfts.currentFileNumber]);
ft->pfts.currentFileSize = fi->filesize;
file_transfers = y_list_prepend(file_transfers, ft);
@@ -258,7 +258,7 @@ static void upload_file(int, INT_PTR fd, int error, void *data)
// need to move to the next file on the list and fill the file information
fi = (yahoo_file_info*)sf->files->data;
- sf->pfts.tszCurrentFile = _tcsdup(sf->pfts.ptszFiles[sf->pfts.currentFileNumber]);
+ sf->pfts.tszCurrentFile = wcsdup(sf->pfts.ptszFiles[sf->pfts.currentFileNumber]);
sf->pfts.currentFileSize = fi->filesize;
sf->pfts.currentFileProgress = 0;
@@ -290,7 +290,7 @@ static void dl_file(int id, INT_PTR fd, int error, const char*, unsigned long si
if (!error) {
HANDLE myhFile;
- TCHAR filefull[MAX_PATH];
+ wchar_t filefull[MAX_PATH];
/*
* We need FULL Path for File Resume to work properly!!!
@@ -299,7 +299,7 @@ static void dl_file(int id, INT_PTR fd, int error, const char*, unsigned long si
*/
mir_sntprintf(filefull, L"%s\\%s", sf->pfts.tszWorkingDir, sf->pfts.tszCurrentFile);
FREE(sf->pfts.tszCurrentFile);
- sf->pfts.tszCurrentFile = _tcsdup(filefull);
+ sf->pfts.tszCurrentFile = wcsdup(filefull);
ResetEvent(sf->hWaitEvent);
@@ -428,7 +428,7 @@ static void dl_file(int id, INT_PTR fd, int error, const char*, unsigned long si
// need to move to the next file on the list and fill the file information
fi = (yahoo_file_info*)sf->files->data;
- sf->pfts.tszCurrentFile = _tcsdup(sf->pfts.ptszFiles[sf->pfts.currentFileNumber]);
+ sf->pfts.tszCurrentFile = wcsdup(sf->pfts.ptszFiles[sf->pfts.currentFileNumber]);
sf->pfts.currentFileSize = fi->filesize;
sf->pfts.currentFileProgress = 0;
@@ -659,7 +659,7 @@ void __cdecl CYahooProto::send_filethread(void *psf)
////////////////////////////////////////////////////////////////////////////////////////
// SendFile - sends a file
-HANDLE __cdecl CYahooProto::SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles)
+HANDLE __cdecl CYahooProto::SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles)
{
LOG(("[YahooSendFile]"));
@@ -674,7 +674,7 @@ HANDLE __cdecl CYahooProto::SendFile(MCONTACT hContact, const TCHAR *szDescripti
int i = 0;
for (; ppszFiles[i] != NULL; i++) {
- if (_tstat(ppszFiles[i], &statbuf) == 0)
+ if (_wstat(ppszFiles[i], &statbuf) == 0)
tFileSize = statbuf.st_size;
yahoo_file_info *fi = y_new(yahoo_file_info, 1);
@@ -712,14 +712,14 @@ HANDLE __cdecl CYahooProto::SendFile(MCONTACT hContact, const TCHAR *szDescripti
////////////////////////////////////////////////////////////////////////////////////////
// FileAllow - starts a file transfer
-HANDLE __cdecl CYahooProto::FileAllow(MCONTACT, HANDLE hTransfer, const TCHAR* szPath)
+HANDLE __cdecl CYahooProto::FileAllow(MCONTACT, HANDLE hTransfer, const wchar_t* szPath)
{
y_filetransfer *ft = (y_filetransfer *)hTransfer;
debugLogA("[YahooFileAllow]");
//LOG(LOG_INFO, "[%s] Requesting file from %s", ft->cookie, ft->user);
- ft->pfts.tszWorkingDir = _tcsdup(szPath);
+ ft->pfts.tszWorkingDir = wcsdup(szPath);
size_t len = mir_tstrlen(ft->pfts.tszWorkingDir) - 1;
if (ft->pfts.tszWorkingDir[len] == '\\')
@@ -763,7 +763,7 @@ int __cdecl CYahooProto::FileCancel(MCONTACT, HANDLE hTransfer)
////////////////////////////////////////////////////////////////////////////////////////
// FileDeny - denies a file transfer
-int __cdecl CYahooProto::FileDeny(MCONTACT, HANDLE hTransfer, const TCHAR*)
+int __cdecl CYahooProto::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t*)
{
/* deny file receive request.. just ignore it! */
y_filetransfer *ft = (y_filetransfer *)hTransfer;
@@ -794,7 +794,7 @@ int __cdecl CYahooProto::FileDeny(MCONTACT, HANDLE hTransfer, const TCHAR*)
////////////////////////////////////////////////////////////////////////////////////////
// FileResume - processes file renaming etc
-int __cdecl CYahooProto::FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename)
+int __cdecl CYahooProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename)
{
y_filetransfer *ft = (y_filetransfer *)hTransfer;
@@ -813,7 +813,7 @@ int __cdecl CYahooProto::FileResume(HANDLE hTransfer, int* action, const TCHAR**
debugLogA("[YahooFileResume] Renamed file!");
FREE(ft->pfts.tszCurrentFile);
- ft->pfts.tszCurrentFile = _tcsdup(*szFilename);
+ ft->pfts.tszCurrentFile = wcsdup(*szFilename);
}
SetEvent(ft->hWaitEvent);
diff --git a/protocols/Yahoo/src/links.cpp b/protocols/Yahoo/src/links.cpp
index 18be749700..c42f3ce9ad 100644
--- a/protocols/Yahoo/src/links.cpp
+++ b/protocols/Yahoo/src/links.cpp
@@ -21,7 +21,7 @@
static HANDLE hServiceParseLink;
-static int SingleHexToDecimal(TCHAR c)
+static int SingleHexToDecimal(wchar_t c)
{
if (c >= '0' && c <= '9') return c - '0';
if (c >= 'a' && c <= 'f') return c - 'a' + 10;
@@ -29,9 +29,9 @@ static int SingleHexToDecimal(TCHAR c)
return -1;
}
-static void url_decode(TCHAR* str)
+static void url_decode(wchar_t* str)
{
- TCHAR* s = str, *d = str;
+ wchar_t* s = str, *d = str;
while (*s) {
if (*s == '%') {
@@ -40,7 +40,7 @@ static void url_decode(TCHAR* str)
int digit2 = SingleHexToDecimal(s[2]);
if (digit2 != -1) {
s += 3;
- *d++ = (TCHAR)((digit1 << 4) | digit2);
+ *d++ = (wchar_t)((digit1 << 4) | digit2);
continue;
}
}
@@ -51,11 +51,11 @@ static void url_decode(TCHAR* str)
*d = 0;
}
-static char* get_buddy(TCHAR ** arg)
+static char* get_buddy(wchar_t ** arg)
{
- TCHAR *buf = *arg;
+ wchar_t *buf = *arg;
- TCHAR *tok = _tcschr(buf, '&'); /* first token */
+ wchar_t *tok = wcschr(buf, '&'); /* first token */
if (tok) *tok = 0;
if (!buf[0]) return NULL;
@@ -74,11 +74,11 @@ static char* get_buddy(TCHAR ** arg)
*/
static INT_PTR ServiceParseYmsgrLink(WPARAM, LPARAM lParam)
{
- TCHAR *arg = (TCHAR*)lParam;
+ wchar_t *arg = (wchar_t*)lParam;
if (arg == NULL) return 1; /* sanity check */
/* skip leading prefix */
- arg = _tcschr(arg, ':');
+ arg = wcschr(arg, ':');
if (arg == NULL) return 1; /* parse failed */
for (++arg; *arg == '/'; ++arg) {}
@@ -95,7 +95,7 @@ static INT_PTR ServiceParseYmsgrLink(WPARAM, LPARAM lParam)
if (!proto) return 1;
/* add a contact to the list */
- if (!_tcsnicmp(arg, L"addfriend?", 10)) {
+ if (!wcsnicmp(arg, L"addfriend?", 10)) {
arg += 10;
char *id = get_buddy(&arg);
@@ -111,7 +111,7 @@ static INT_PTR ServiceParseYmsgrLink(WPARAM, LPARAM lParam)
acs.psr = &psr;
psr.cbSize = sizeof(PROTOSEARCHRESULT);
- psr.id.t = (TCHAR*)id;
+ psr.id.w = (wchar_t*)id;
CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
}
@@ -119,22 +119,22 @@ static INT_PTR ServiceParseYmsgrLink(WPARAM, LPARAM lParam)
return 0;
}
/* send a message to a contact */
- else if (!_tcsnicmp(arg, L"sendim?", 7)) {
+ else if (!wcsnicmp(arg, L"sendim?", 7)) {
arg += 7;
char *id = get_buddy(&arg);
if (!id) return 1;
- TCHAR *msg = NULL;
+ wchar_t *msg = NULL;
while (arg) {
- if (!_tcsnicmp(arg, L"m=", 2)) {
+ if (!wcsnicmp(arg, L"m=", 2)) {
msg = arg + 2;
url_decode(msg);
break;
}
- arg = _tcschr(arg + 1, '&'); /* first token */
+ arg = wcschr(arg + 1, '&'); /* first token */
if (arg) *arg = 0;
}
@@ -146,7 +146,7 @@ static INT_PTR ServiceParseYmsgrLink(WPARAM, LPARAM lParam)
return 0;
}
/* open a chatroom */
- else if (!_tcsnicmp(arg, L"chat?", 5)) {
+ else if (!wcsnicmp(arg, L"chat?", 5)) {
arg += 5;
// char *id = get_buddy(&arg);
diff --git a/protocols/Yahoo/src/main.cpp b/protocols/Yahoo/src/main.cpp
index 18c7f1cdd4..87d254bace 100644
--- a/protocols/Yahoo/src/main.cpp
+++ b/protocols/Yahoo/src/main.cpp
@@ -77,7 +77,7 @@ static int CompareProtos(const CYahooProto* p1, const CYahooProto* p2)
LIST<CYahooProto> g_instances(1, CompareProtos);
-static CYahooProto* yahooProtoInit(const char* pszProtoName, const TCHAR* tszUserName)
+static CYahooProto* yahooProtoInit(const char* pszProtoName, const wchar_t* tszUserName)
{
CYahooProto* ppro = new CYahooProto(pszProtoName, tszUserName);
diff --git a/protocols/Yahoo/src/options.cpp b/protocols/Yahoo/src/options.cpp
index 592f0a455e..321851d965 100644
--- a/protocols/Yahoo/src/options.cpp
+++ b/protocols/Yahoo/src/options.cpp
@@ -360,20 +360,20 @@ int __cdecl CYahooProto::OnOptionsInit(WPARAM wParam, LPARAM)
odp.position = -790000000;
odp.hInstance = hInstance;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_YAHOO);
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.ptszGroup = LPGENT("Network");
- odp.ptszTab = LPGENT("Account");
+ odp.pwszGroup = LPGENW("Network");
+ odp.pwszTab = LPGENW("Account");
odp.pfnDlgProc = DlgProcYahooOpts;
odp.dwInitParam = LPARAM(this);
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Connection");
+ odp.pwszTab = LPGENW("Connection");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_YAHOO_CONNECTION);
odp.pfnDlgProc = DlgProcYahooOptsConn;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Ignore List");
+ odp.pwszTab = LPGENW("Ignore List");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_YAHOO_IGNORE);
odp.pfnDlgProc = DlgProcYahooOptsIgnore;
Options_AddPage(wParam, &odp);
diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp
index c3682e5696..a2610c5f7b 100644
--- a/protocols/Yahoo/src/proto.cpp
+++ b/protocols/Yahoo/src/proto.cpp
@@ -24,7 +24,7 @@
#pragma warning(disable:4355)
-CYahooProto::CYahooProto(const char *aProtoName, const TCHAR *aUserName)
+CYahooProto::CYahooProto(const char *aProtoName, const wchar_t *aUserName)
: PROTO<CYahooProto>(aProtoName, aUserName),
m_bLoggedIn(FALSE),
poll_loop(0),
@@ -35,7 +35,7 @@ CYahooProto::CYahooProto(const char *aProtoName, const TCHAR *aUserName)
logoff_buddies();
- SkinAddNewSoundExT("mail", m_tszUserName, LPGENT("New E-mail available in Inbox"));
+ SkinAddNewSoundExT("mail", m_tszUserName, LPGENW("New E-mail available in Inbox"));
LoadYahooServices();
}
@@ -66,7 +66,7 @@ int CYahooProto::OnModulesLoadedEx(WPARAM, LPARAM)
HookProtoEvent(ME_IDLE_CHANGED, &CYahooProto::OnIdleEvent);
HookProtoEvent(ME_CLIST_PREBUILDCONTACTMENU, &CYahooProto::OnPrebuildContactMenu);
- TCHAR tModuleDescr[100];
+ wchar_t tModuleDescr[100];
mir_sntprintf(tModuleDescr, TranslateT("%s plugin connections"), m_tszUserName);
NETLIBUSER nlu = { 0 };
@@ -113,7 +113,7 @@ MCONTACT CYahooProto::AddToList(int flags, PROTOSEARCHRESULT *psr)
return 0;
}
- char *id = psr->flags & PSR_UNICODE ? mir_utf8encodeW((wchar_t*)psr->id.t) : mir_utf8encode((char*)psr->id.t);
+ char *id = psr->flags & PSR_UNICODE ? mir_utf8encodeW((wchar_t*)psr->id.w) : mir_utf8encode((char*)psr->id.w);
MCONTACT hContact = getbuddyH(id);
if (hContact != NULL) {
if (db_get_b(hContact, "CList", "NotOnList")) {
@@ -217,7 +217,7 @@ int CYahooProto::Authorize(MEVENT hdbe)
////////////////////////////////////////////////////////////////////////////////////////
// AuthDeny - handles the unsuccessful authorization
-int CYahooProto::AuthDeny(MEVENT hdbe, const TCHAR *reason)
+int CYahooProto::AuthDeny(MEVENT hdbe, const wchar_t *reason)
{
debugLogA("[YahooAuthDeny]");
if (!m_bLoggedIn)
@@ -276,7 +276,7 @@ int __cdecl CYahooProto::AuthRecv(MCONTACT hContact, PROTORECVEVENT* pre)
////////////////////////////////////////////////////////////////////////////////////////
// PSS_AUTHREQUEST
-int __cdecl CYahooProto::AuthRequest(MCONTACT hContact, const TCHAR* msg)
+int __cdecl CYahooProto::AuthRequest(MCONTACT hContact, const wchar_t* msg)
{
debugLogA("[YahooSendAuthRequest]");
@@ -539,7 +539,7 @@ HANDLE __cdecl CYahooProto::GetAwayMsg(MCONTACT hContact)
////////////////////////////////////////////////////////////////////////////////////////
// SetAwayMsg - sets the away status message
-int __cdecl CYahooProto::SetAwayMsg(int status, const TCHAR* msg)
+int __cdecl CYahooProto::SetAwayMsg(int status, const wchar_t* msg)
{
char *c = msg && msg[0] ? mir_utf8encodeT(msg) : NULL;
diff --git a/protocols/Yahoo/src/proto.h b/protocols/Yahoo/src/proto.h
index 0f2324ec75..2cfed5b305 100644
--- a/protocols/Yahoo/src/proto.h
+++ b/protocols/Yahoo/src/proto.h
@@ -18,7 +18,7 @@
struct CYahooProto : public PROTO<CYahooProto>
{
- CYahooProto(const char*, const TCHAR*);
+ CYahooProto(const char*, const wchar_t*);
virtual ~CYahooProto();
//====================================================================================
@@ -29,33 +29,33 @@ struct CYahooProto : public PROTO<CYahooProto>
virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent);
virtual int __cdecl Authorize(MEVENT hDbEvent);
- virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR *szReason);
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t *szReason);
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage );
+ virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t *szMessage );
- virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath );
+ virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath );
virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer );
- virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason );
- virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const TCHAR **szFilename );
+ virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szReason );
+ virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const wchar_t **szFilename );
virtual DWORD_PTR __cdecl GetCaps( int type, MCONTACT hContact = NULL);
virtual int __cdecl GetInfo(MCONTACT hContact, int infoType );
- virtual HANDLE __cdecl SearchBasic(const TCHAR *id);
+ virtual HANDLE __cdecl SearchBasic(const wchar_t *id);
virtual HWND __cdecl SearchAdvanced(HWND owner);
virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
virtual int __cdecl RecvFile(MCONTACT hContact, PROTORECVFILET*);
virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*);
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles);
+ virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles);
virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg );
virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode);
virtual int __cdecl SetStatus(int iNewStatus);
virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
- virtual int __cdecl SetAwayMsg( int m_iStatus, const TCHAR *msg);
+ virtual int __cdecl SetAwayMsg( int m_iStatus, const wchar_t *msg);
virtual INT_PTR __cdecl GetMyAwayMsg(WPARAM wParam, LPARAM lParam);
virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
@@ -146,13 +146,13 @@ struct CYahooProto : public PROTO<CYahooProto>
void reset_avatar(MCONTACT hContact);
void request_avatar(const char* who);
- void SendAvatar(const TCHAR *szFile);
- void GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, int cbLen, int type);
+ void SendAvatar(const wchar_t *szFile);
+ void GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, int cbLen, int type);
//====| chat.cpp |====================================================================
void ChatRegister(void);
void ChatStart(const char* room);
- void ChatEvent(const char* room, const char* who, int evt, const TCHAR* msg = NULL);
+ void ChatEvent(const char* room, const char* who, int evt, const wchar_t* msg = NULL);
void ChatLeave(const char* room);
void ChatLeaveAll(void);
@@ -213,9 +213,9 @@ struct CYahooProto : public PROTO<CYahooProto>
DWORD Set_Protocol(MCONTACT hContact, int protocol );
- int ShowNotification(const TCHAR *title, const TCHAR *info, DWORD flags);
- void ShowError(const TCHAR *title, const TCHAR *buff);
- int ShowPopup( const TCHAR* nickname, const TCHAR* msg, const char *szURL );
+ int ShowNotification(const wchar_t *title, const wchar_t *info, DWORD flags);
+ void ShowError(const wchar_t *title, const wchar_t *buff);
+ int ShowPopup( const wchar_t* nickname, const wchar_t* msg, const char *szURL );
bool IsMyContact(MCONTACT hContact);
//====| yahoo.cpp |===================================================================
@@ -257,7 +257,7 @@ struct CYahooProto : public PROTO<CYahooProto>
void ext_login_response(int succ, const char *url);
void ext_login(enum yahoo_status login_mode);
- void AddBuddy(MCONTACT hContact, const char *group, const TCHAR *msg);
+ void AddBuddy(MCONTACT hContact, const char *group, const wchar_t *msg);
void YAHOO_utils_logversion();
diff --git a/protocols/Yahoo/src/search.cpp b/protocols/Yahoo/src/search.cpp
index 9a606c4245..d08a08df66 100644
--- a/protocols/Yahoo/src/search.cpp
+++ b/protocols/Yahoo/src/search.cpp
@@ -22,7 +22,7 @@
void __cdecl CYahooProto::search_simplethread(void *snsearch)
{
- TCHAR *id = (TCHAR *)snsearch;
+ wchar_t *id = (wchar_t *)snsearch;
if (mir_tstrlen(id) < 4) {
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)1, 0);
@@ -30,14 +30,14 @@ void __cdecl CYahooProto::search_simplethread(void *snsearch)
return;
}
- TCHAR *c = _tcschr(id, '@');
+ wchar_t *c = wcschr(id, '@');
if (c) *c = 0;
YAHOO_SEARCH_RESULT psr;
memset(&psr, 0, sizeof(psr));
psr.cbSize = sizeof(psr);
psr.flags = PSR_TCHAR;
- psr.id.t = (TCHAR*)_tcslwr(id);
+ psr.id.w = (wchar_t*)wcslwr(id);
psr.protocol = YAHOO_IM_YAHOO;
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)& psr);
@@ -47,14 +47,14 @@ void __cdecl CYahooProto::search_simplethread(void *snsearch)
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)1, 0);
}
-HANDLE __cdecl CYahooProto::SearchBasic(const TCHAR* nick)
+HANDLE __cdecl CYahooProto::SearchBasic(const wchar_t* nick)
{
LOG(("[YahooBasicSearch] Searching for: %S", nick));
if (!m_bLoggedIn)
return 0;
- ForkThread(&CYahooProto::search_simplethread, _tcsdup(nick));
+ ForkThread(&CYahooProto::search_simplethread, wcsdup(nick));
return (HANDLE)1;
}
@@ -158,7 +158,7 @@ void __cdecl CYahooProto::searchadv_thread(void *pHWND)
{
HWND hwndDlg = (HWND)pHWND;
- TCHAR searchid[128];
+ wchar_t searchid[128];
GetDlgItemText(hwndDlg, IDC_SEARCH_ID, searchid, _countof(searchid));
if (mir_tstrlen(searchid) == 0) {
@@ -171,13 +171,13 @@ void __cdecl CYahooProto::searchadv_thread(void *pHWND)
memset(&psr, 0, sizeof(psr));
psr.cbSize = sizeof(psr);
psr.flags = PSR_UNICODE;
- psr.id.t = _tcslwr(searchid);
+ psr.id.w = wcslwr(searchid);
switch (SendDlgItemMessage(hwndDlg, IDC_SEARCH_PROTOCOL, CB_GETCURSEL, 0, 0)) {
- case 0: psr.firstName.t = L"<Yahoo>"; psr.protocol = YAHOO_IM_YAHOO; break;
- case 1: psr.firstName.t = L"<Lotus Sametime>"; psr.protocol = YAHOO_IM_SAMETIME; break;
- case 2: psr.firstName.t = L"<LCS>"; psr.protocol = YAHOO_IM_LCS; break;
- case 3: psr.firstName.t = L"<Windows Live (MSN)>"; psr.protocol = YAHOO_IM_MSN; break;
+ case 0: psr.firstName.w = L"<Yahoo>"; psr.protocol = YAHOO_IM_YAHOO; break;
+ case 1: psr.firstName.w = L"<Lotus Sametime>"; psr.protocol = YAHOO_IM_SAMETIME; break;
+ case 2: psr.firstName.w = L"<LCS>"; psr.protocol = YAHOO_IM_LCS; break;
+ case 3: psr.firstName.w = L"<Windows Live (MSN)>"; psr.protocol = YAHOO_IM_MSN; break;
}
/*
diff --git a/protocols/Yahoo/src/services.cpp b/protocols/Yahoo/src/services.cpp
index bd171957f6..f5f602139c 100644
--- a/protocols/Yahoo/src/services.cpp
+++ b/protocols/Yahoo/src/services.cpp
@@ -220,7 +220,7 @@ void CYahooProto::OpenURL(const char *url, int autoLogin)
t = yahoo_urlencode(yahoo_get_cookie(m_id, "t"));
u = yahoo_urlencode(url);
mir_snprintf(tUrl,
- "http://msg.edit.yahoo.com/config/reset_cookies?&.y=Y=%s&.t=T=%s&.ver=2&.done=http%%3a//us.rd.yahoo.com/messenger/client/%%3f%s",
+ "http://msg.edit.yahoo.com/config/reset_cookies?&.y=Y=%s&.w=T=%s&.ver=2&.done=http%%3a//us.rd.yahoo.com/messenger/client/%%3f%s",
y, t, u);
FREE(y);
diff --git a/protocols/Yahoo/src/user_info.cpp b/protocols/Yahoo/src/user_info.cpp
index 016053a9ad..4b90a00e41 100644
--- a/protocols/Yahoo/src/user_info.cpp
+++ b/protocols/Yahoo/src/user_info.cpp
@@ -124,7 +124,7 @@ int __cdecl CYahooProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam)
odp.pfnDlgProc = YahooUserInfoDlgProc;
odp.position = -1900000000;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_USER_INFO);
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
UserInfo_AddPage(wParam, &odp);
}
return 0;
diff --git a/protocols/Yahoo/src/util.cpp b/protocols/Yahoo/src/util.cpp
index c4c5e692a2..44584763b6 100644
--- a/protocols/Yahoo/src/util.cpp
+++ b/protocols/Yahoo/src/util.cpp
@@ -105,7 +105,7 @@ static LRESULT CALLBACK PopupWindowProc(HWND hWnd, UINT message, WPARAM wParam,
return DefWindowProc(hWnd, message, wParam, lParam);
}
-int CYahooProto::ShowPopup(const TCHAR* nickname, const TCHAR* msg, const char *szURL)
+int CYahooProto::ShowPopup(const wchar_t* nickname, const wchar_t* msg, const char *szURL)
{
if (!ServiceExists(MS_POPUP_ADDPOPUPT))
return 0;
@@ -127,14 +127,14 @@ int CYahooProto::ShowPopup(const TCHAR* nickname, const TCHAR* msg, const char *
return 1;
}
-int CYahooProto::ShowNotification(const TCHAR *title, const TCHAR *info, DWORD flags)
+int CYahooProto::ShowNotification(const wchar_t *title, const wchar_t *info, DWORD flags)
{
if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) {
MIRANDASYSTRAYNOTIFY err;
err.szProto = m_szModuleName;
err.cbSize = sizeof(err);
- err.tszInfoTitle = (TCHAR*)title;
- err.tszInfo = (TCHAR*)info;
+ err.tszInfoTitle = (wchar_t*)title;
+ err.tszInfo = (wchar_t*)info;
err.dwInfoFlags = flags | NIIF_INTERN_UNICODE;
err.uTimeout = 1000 * 3;
INT_PTR ret = CallService(MS_CLIST_SYSTRAY_NOTIFY, 0, (LPARAM)& err);
@@ -146,7 +146,7 @@ int CYahooProto::ShowNotification(const TCHAR *title, const TCHAR *info, DWORD f
return 0;
}
-void CYahooProto::ShowError(const TCHAR *title, const TCHAR *buff)
+void CYahooProto::ShowError(const wchar_t *title, const wchar_t *buff)
{
if (getByte("ShowErrors", 1))
if (!ShowPopup(title, buff, NULL))
diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp
index 7cb6c76f34..b9aca199e2 100644
--- a/protocols/Yahoo/src/yahoo.cpp
+++ b/protocols/Yahoo/src/yahoo.cpp
@@ -200,7 +200,7 @@ void CYahooProto::logout()
poll_loop = 0;
}
-void CYahooProto::AddBuddy(MCONTACT hContact, const char *group, const TCHAR *msg)
+void CYahooProto::AddBuddy(MCONTACT hContact, const char *group, const wchar_t *msg)
{
/* We adding a buddy to our list.
2 Stages.
@@ -675,8 +675,8 @@ void CYahooProto::ext_rejected(const char *who, const char *msg)
ptrT tszWho(mir_utf8decodeT(who));
ptrT tszMsg(mir_utf8decodeT(msg));
- TCHAR buff[1024];
- mir_sntprintf(buff, TranslateT("%s has rejected your request and sent the following message:"), (TCHAR*)tszWho);
+ wchar_t buff[1024];
+ mir_sntprintf(buff, TranslateT("%s has rejected your request and sent the following message:"), (wchar_t*)tszWho);
MessageBox(NULL, tszMsg, buff, MB_OK | MB_ICONINFORMATION);
}
@@ -923,7 +923,7 @@ void CYahooProto::ext_mail_notify(const char *from, const char *subj, int cnt)
SkinPlaySound("mail");
if (!getByte("DisableYahoomail", 0)) {
- TCHAR z[MAX_SECONDLINE], title[MAX_CONTACTNAME];
+ wchar_t z[MAX_SECONDLINE], title[MAX_CONTACTNAME];
if (from == NULL) {
mir_sntprintf(title, L"%s: %s", m_tszUserName, TranslateT("New Mail"));
@@ -934,7 +934,7 @@ void CYahooProto::ext_mail_notify(const char *from, const char *subj, int cnt)
ptrT tszFrom(mir_utf8decodeT(from));
ptrT tszSubj(mir_utf8decodeT(subj));
- mir_sntprintf(z, TranslateT("From: %s\nSubject: %s"), (TCHAR*)tszFrom, (TCHAR*)tszSubj);
+ mir_sntprintf(z, TranslateT("From: %s\nSubject: %s"), (wchar_t*)tszFrom, (wchar_t*)tszSubj);
}
if (!ShowPopup(title, z, "http://mail.yahoo.com"))
@@ -1046,7 +1046,7 @@ void CYahooProto::ext_got_ping(const char *errormsg)
void CYahooProto::ext_login_response(int succ, const char *url)
{
- TCHAR buff[1024];
+ wchar_t buff[1024];
LOG(("[ext_login_response] succ: %d, url: %s", succ, url));
@@ -1111,34 +1111,34 @@ void CYahooProto::ext_login_response(int succ, const char *url)
void CYahooProto::ext_error(const char *err, int fatal, int num)
{
ptrT tszErr(mir_utf8decodeT(err));
- TCHAR buff[1024];
+ wchar_t buff[1024];
LOG(("[ext_error] Error: fatal: %d, num: %d, err: %s", fatal, num, err));
switch (num) {
case E_UNKNOWN:
- mir_sntprintf(buff, TranslateT("Unknown error %s"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("Unknown error %s"), (wchar_t*)tszErr);
break;
case E_CUSTOM:
- mir_sntprintf(buff, TranslateT("Custom error %s"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("Custom error %s"), (wchar_t*)tszErr);
break;
case E_CONFNOTAVAIL:
- mir_sntprintf(buff, TranslateT("%s is not available for the conference"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("%s is not available for the conference"), (wchar_t*)tszErr);
break;
case E_IGNOREDUP:
- mir_sntprintf(buff, TranslateT("%s is already ignored"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("%s is already ignored"), (wchar_t*)tszErr);
break;
case E_IGNORENONE:
- mir_sntprintf(buff, TranslateT("%s is not in the ignore list"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("%s is not in the ignore list"), (wchar_t*)tszErr);
break;
case E_IGNORECONF:
- mir_sntprintf(buff, TranslateT("%s is in buddy list - cannot ignore"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("%s is in buddy list - cannot ignore"), (wchar_t*)tszErr);
break;
case E_SYSTEM:
- mir_sntprintf(buff, TranslateT("System Error: %s"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("System Error: %s"), (wchar_t*)tszErr);
break;
case E_CONNECTION:
- mir_sntprintf(buff, TranslateT("Server Connection Error: %s"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("Server Connection Error: %s"), (wchar_t*)tszErr);
debugLogA("Error: %S", buff);
return;
}
diff --git a/src/core/stdauth/src/auth.cpp b/src/core/stdauth/src/auth.cpp
index da81b55068..191031062c 100644
--- a/src/core/stdauth/src/auth.cpp
+++ b/src/core/stdauth/src/auth.cpp
@@ -44,7 +44,7 @@ INT_PTR ShowAddedWindow(WPARAM, LPARAM lParam)
static int AuthEventAdded(WPARAM, LPARAM lParam)
{
- TCHAR szTooltip[256];
+ wchar_t szTooltip[256];
MEVENT hDbEvent = (MEVENT)lParam;
DBEVENTINFO dbei = { sizeof(dbei) };
diff --git a/src/core/stdauth/src/authdialogs.cpp b/src/core/stdauth/src/authdialogs.cpp
index 6ce9a9e66f..86f9db4ec4 100644
--- a/src/core/stdauth/src/authdialogs.cpp
+++ b/src/core/stdauth/src/authdialogs.cpp
@@ -55,12 +55,12 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
PROTOACCOUNT* acc = Proto_GetAccount(dbei.szModule);
- TCHAR* lastT = dbei.flags & DBEF_UTF ? Utf8DecodeT(last) : mir_a2t(last);
- TCHAR* firstT = dbei.flags & DBEF_UTF ? Utf8DecodeT(first) : mir_a2t(first);
- TCHAR* nickT = dbei.flags & DBEF_UTF ? Utf8DecodeT(nick) : mir_a2t(nick);
- TCHAR* emailT = dbei.flags & DBEF_UTF ? Utf8DecodeT(email) : mir_a2t(email);
+ wchar_t* lastT = dbei.flags & DBEF_UTF ? Utf8DecodeT(last) : mir_a2t(last);
+ wchar_t* firstT = dbei.flags & DBEF_UTF ? Utf8DecodeT(first) : mir_a2t(first);
+ wchar_t* nickT = dbei.flags & DBEF_UTF ? Utf8DecodeT(nick) : mir_a2t(nick);
+ wchar_t* emailT = dbei.flags & DBEF_UTF ? Utf8DecodeT(email) : mir_a2t(email);
- TCHAR name[128] = L"";
+ wchar_t name[128] = L"";
int off = 0;
if (firstT[0] && lastT[0])
off = mir_sntprintf(name, L"%s %s", firstT, lastT);
@@ -72,12 +72,12 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
if (off)
mir_sntprintf(name + off, _countof(name) - off, L" (%s)", nickT);
else
- _tcsncpy_s(name, nickT, _TRUNCATE);
+ wcsncpy_s(name, nickT, _TRUNCATE);
}
if (!name[0])
- _tcsncpy_s(name, TranslateT("<Unknown>"), _TRUNCATE);
+ wcsncpy_s(name, TranslateT("<Unknown>"), _TRUNCATE);
- TCHAR hdr[256];
+ wchar_t hdr[256];
if (uin && emailT[0])
mir_sntprintf(hdr, TranslateT("%s added you to the contact list\n%u (%s) on %s"), name, uin, emailT, acc->tszAccountName);
else if (uin)
@@ -185,30 +185,30 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
ptrT emailT(dbei.flags & DBEF_UTF ? Utf8DecodeT(email) : mir_a2t(email));
ptrT reasonT(dbei.flags & DBEF_UTF ? Utf8DecodeT(reason) : mir_a2t(reason));
- TCHAR name[128] = L"";
+ wchar_t name[128] = L"";
int off = 0;
if (firstT[0] && lastT[0])
- off = mir_sntprintf(name, L"%s %s", (TCHAR*)firstT, (TCHAR*)lastT);
+ off = mir_sntprintf(name, L"%s %s", (wchar_t*)firstT, (wchar_t*)lastT);
else if (firstT[0])
- off = mir_sntprintf(name, L"%s", (TCHAR*)firstT);
+ off = mir_sntprintf(name, L"%s", (wchar_t*)firstT);
else if (lastT[0])
- off = mir_sntprintf(name, L"%s", (TCHAR*)lastT);
+ off = mir_sntprintf(name, L"%s", (wchar_t*)lastT);
if (mir_tstrlen(nickT)) {
if (off)
- mir_sntprintf(name + off, _countof(name) - off, L" (%s)", (TCHAR*)nickT);
+ mir_sntprintf(name + off, _countof(name) - off, L" (%s)", (wchar_t*)nickT);
else
- _tcsncpy_s(name, nickT, _TRUNCATE);
+ wcsncpy_s(name, nickT, _TRUNCATE);
}
if (!name[0])
- _tcsncpy_s(name, TranslateT("<Unknown>"), _TRUNCATE);
+ wcsncpy_s(name, TranslateT("<Unknown>"), _TRUNCATE);
- TCHAR hdr[256];
+ wchar_t hdr[256];
if (uin && emailT[0])
- mir_sntprintf(hdr, TranslateT("%s requested authorization\n%u (%s) on %s"), name, uin, (TCHAR*)emailT, acc->tszAccountName);
+ mir_sntprintf(hdr, TranslateT("%s requested authorization\n%u (%s) on %s"), name, uin, (wchar_t*)emailT, acc->tszAccountName);
else if (uin)
mir_sntprintf(hdr, TranslateT("%s requested authorization\n%u on %s"), name, uin, acc->tszAccountName);
else
- mir_sntprintf(hdr, TranslateT("%s requested authorization\n%s on %s"), name, emailT[0] ? (TCHAR*)emailT : TranslateT("(Unknown)"), acc->tszAccountName);
+ mir_sntprintf(hdr, TranslateT("%s requested authorization\n%s on %s"), name, emailT[0] ? (wchar_t*)emailT : TranslateT("(Unknown)"), acc->tszAccountName);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, hdr);
SetDlgItemText(hwndDlg, IDC_REASON, reasonT);
@@ -264,7 +264,7 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
db_event_get(hDbEvent, &dbei);
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_DENYREASON))) {
- TCHAR tszReason[256];
+ wchar_t tszReason[256];
GetDlgItemText(hwndDlg, IDC_DENYREASON, tszReason, _countof(tszReason));
CallProtoService(dbei.szModule, PS_AUTHDENY, hDbEvent, (LPARAM)tszReason);
}
diff --git a/src/core/stdauth/src/stdafx.h b/src/core/stdauth/src/stdafx.h
index 06f20fb566..7112db5e94 100644
--- a/src/core/stdauth/src/stdafx.h
+++ b/src/core/stdauth/src/stdafx.h
@@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <commctrl.h>
diff --git a/src/core/stdautoaway/src/autoaway.cpp b/src/core/stdautoaway/src/autoaway.cpp
index 9eb35a7d25..2a490ba693 100644
--- a/src/core/stdautoaway/src/autoaway.cpp
+++ b/src/core/stdautoaway/src/autoaway.cpp
@@ -38,7 +38,7 @@ static int AutoAwaySound(WPARAM, LPARAM)
static void Proto_SetStatus(const char *szProto, unsigned status)
{
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) {
- ptrT awayMsg((TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGW, status, (LPARAM)szProto));
+ ptrT awayMsg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGW, status, (LPARAM)szProto));
CallProtoService(szProto, PS_SETAWAYMSG, status, awayMsg);
}
diff --git a/src/core/stdautoaway/src/stdafx.h b/src/core/stdautoaway/src/stdafx.h
index debc097003..7ac8638151 100644
--- a/src/core/stdautoaway/src/stdafx.h
+++ b/src/core/stdautoaway/src/stdafx.h
@@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <commctrl.h>
diff --git a/src/core/stdaway/src/awaymsg.cpp b/src/core/stdaway/src/awaymsg.cpp
index 2efff40a04..b51b6f4d7a 100644
--- a/src/core/stdaway/src/awaymsg.cpp
+++ b/src/core/stdaway/src/awaymsg.cpp
@@ -54,11 +54,11 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP
dat->hSeq = (HANDLE)ProtoChainSend(dat->hContact, PSS_GETAWAYMSG, 0, 0);
WindowList_Add(hWindowList, hwndDlg, dat->hContact);
{
- TCHAR str[256], format[128];
- TCHAR *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
+ wchar_t str[256], format[128];
+ wchar_t *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
char *szProto = GetContactProto(dat->hContact);
WORD dwStatus = db_get_w(dat->hContact, szProto, "Status", ID_STATUS_OFFLINE);
- TCHAR *status = pcli->pfnGetStatusModeDescription(dwStatus, 0);
+ wchar_t *status = pcli->pfnGetStatusModeDescription(dwStatus, 0);
GetWindowText(hwndDlg, format, _countof(format));
mir_sntprintf(str, format, status, contactName);
@@ -89,7 +89,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP
if (ack->result != ACKRESULT_SUCCESS) break;
if (dat->hAwayMsgEvent && ack->hProcess == dat->hSeq) { UnhookEvent(dat->hAwayMsgEvent); dat->hAwayMsgEvent = NULL; }
- SetDlgItemText(hwndDlg, IDC_MSG, (const TCHAR*)ack->lParam);
+ SetDlgItemText(hwndDlg, IDC_MSG, (const wchar_t*)ack->lParam);
ShowWindow(GetDlgItem(hwndDlg, IDC_RETRIEVING), SW_HIDE);
ShowWindow(GetDlgItem(hwndDlg, IDC_MSG), SW_SHOW);
@@ -140,7 +140,7 @@ static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM)
int status = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGRECV) {
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(status)) {
- TCHAR str[128];
+ wchar_t str[128];
mir_sntprintf(str, TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(status, 0));
Menu_ModifyItem(hAwayMsgMenuItem, str, Skin_LoadProtoIcon(szProto, status), CMIF_NOTOFFLINE);
return 0;
diff --git a/src/core/stdaway/src/sendmsg.cpp b/src/core/stdaway/src/sendmsg.cpp
index c2460a8a34..a3f2968588 100644
--- a/src/core/stdaway/src/sendmsg.cpp
+++ b/src/core/stdaway/src/sendmsg.cpp
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static DWORD protoModeMsgFlags;
static HWND hwndStatusMsg;
-static const TCHAR *GetDefaultMessage(int status)
+static const wchar_t *GetDefaultMessage(int status)
{
switch(status) {
case ID_STATUS_AWAY: return TranslateT("I've been away since %time%.");
@@ -79,7 +79,7 @@ static void SetStatusModeByte(int status, const char *suffix, BYTE value)
db_set_b(NULL, "SRAway", StatusModeToDbSetting(status, suffix), value);
}
-static TCHAR* GetAwayMessage(int statusMode, char *szProto)
+static wchar_t* GetAwayMessage(int statusMode, char *szProto)
{
if (szProto && !(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(statusMode)))
return NULL;
@@ -100,8 +100,8 @@ static TCHAR* GetAwayMessage(int statusMode, char *szProto)
if (dbv.ptszVal[i] != '%')
continue;
- TCHAR substituteStr[128];
- if ( !_tcsnicmp(dbv.ptszVal + i, L"%time%", 6)) {
+ wchar_t substituteStr[128];
+ if ( !wcsnicmp(dbv.ptszVal + i, L"%time%", 6)) {
MIRANDA_IDLE_INFO mii = { sizeof(mii) };
CallService(MS_IDLE_GETIDLEINFO, 0, (LPARAM)&mii);
@@ -117,14 +117,14 @@ static TCHAR* GetAwayMessage(int statusMode, char *szProto)
}
else GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, NULL, NULL, substituteStr, _countof(substituteStr));
}
- else if ( !_tcsnicmp(dbv.ptszVal + i, L"%date%", 6))
+ else if ( !wcsnicmp(dbv.ptszVal + i, L"%date%", 6))
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, substituteStr, _countof(substituteStr));
else continue;
if (mir_tstrlen(substituteStr) > 6)
- dbv.ptszVal = (TCHAR*)mir_realloc(dbv.ptszVal, (mir_tstrlen(dbv.ptszVal) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(TCHAR));
- memmove(dbv.ptszVal + i + mir_tstrlen(substituteStr), dbv.ptszVal + i + 6, (mir_tstrlen(dbv.ptszVal) - i - 5) * sizeof(TCHAR));
- memcpy(dbv.ptszVal+i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
+ dbv.ptszVal = (wchar_t*)mir_realloc(dbv.ptszVal, (mir_tstrlen(dbv.ptszVal) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(wchar_t));
+ memmove(dbv.ptszVal + i + mir_tstrlen(substituteStr), dbv.ptszVal + i + 6, (mir_tstrlen(dbv.ptszVal) - i - 5) * sizeof(wchar_t));
+ memcpy(dbv.ptszVal+i, substituteStr, mir_tstrlen(substituteStr) * sizeof(wchar_t));
}
}
return dbv.ptszVal;
@@ -152,15 +152,15 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar
if (wParam == 127 && GetKeyState(VK_CONTROL) & 0x8000) //ctrl-backspace
{
DWORD start, end;
- TCHAR *text;
+ wchar_t *text;
int textLen;
SendMessage(hwnd, EM_GETSEL, (WPARAM)&end, 0);
SendMessage(hwnd, WM_KEYDOWN, VK_LEFT, 0);
SendMessage(hwnd, EM_GETSEL, (WPARAM)&start, 0);
textLen = GetWindowTextLength(hwnd);
- text = (TCHAR *)alloca(sizeof(TCHAR) * (textLen + 1));
+ text = (wchar_t *)alloca(sizeof(wchar_t) * (textLen + 1));
GetWindowText(hwnd, text, textLen + 1);
- memmove(text + start, text + end, sizeof(TCHAR) * (textLen + 1 - end));
+ memmove(text + start, text + end, sizeof(wchar_t) * (textLen + 1 - end));
SetWindowText(hwnd, text);
SendMessage(hwnd, EM_SETSEL, start, start);
SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), EN_CHANGE), (LPARAM)hwnd);
@@ -171,7 +171,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar
return mir_callNextSubclass(hwnd, MessageEditSubclassProc, msg, wParam, lParam);
}
-void ChangeAllProtoMessages(char *szProto, int statusMode, TCHAR *msg)
+void ChangeAllProtoMessages(char *szProto, int statusMode, wchar_t *msg)
{
if (szProto == NULL) {
int nAccounts;
@@ -194,7 +194,7 @@ struct SetAwayMsgData
{
int statusMode;
int countdown;
- TCHAR okButtonFormat[64];
+ wchar_t okButtonFormat[64];
char *szProto;
HANDLE hPreshutdown;
};
@@ -224,14 +224,14 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
SendDlgItemMessage(hwndDlg, IDC_MSG, EM_LIMITTEXT, 1024, 0);
mir_subclassWindow(GetDlgItem(hwndDlg, IDC_MSG), MessageEditSubclassProc);
{
- TCHAR str[256], format[128];
+ wchar_t str[256], format[128];
GetWindowText(hwndDlg, format, _countof(format));
mir_sntprintf(str, format, pcli->pfnGetStatusModeDescription(dat->statusMode, 0));
SetWindowText(hwndDlg, str);
}
GetDlgItemText(hwndDlg, IDOK, dat->okButtonFormat, _countof(dat->okButtonFormat));
{
- TCHAR *msg = GetAwayMessage(dat->statusMode, dat->szProto);
+ wchar_t *msg = GetAwayMessage(dat->statusMode, dat->szProto);
SetDlgItemText(hwndDlg, IDC_MSG, msg);
mir_free(msg);
}
@@ -246,7 +246,7 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
case WM_TIMER:
if (--dat->countdown >= 0) {
- TCHAR str[64];
+ wchar_t str[64];
mir_sntprintf(str, dat->okButtonFormat, dat->countdown);
SetDlgItemText(hwndDlg, IDOK, str);
}
@@ -258,7 +258,7 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
case WM_CLOSE:
{
- TCHAR *msg = GetAwayMessage(dat->statusMode, dat->szProto);
+ wchar_t *msg = GetAwayMessage(dat->statusMode, dat->szProto);
ChangeAllProtoMessages(dat->szProto, dat->statusMode, msg);
mir_free(msg);
}
@@ -269,7 +269,7 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
switch (LOWORD(wParam)) {
case IDOK:
if (dat->countdown < 0) {
- TCHAR str[1024];
+ wchar_t str[1024];
GetDlgItemText(hwndDlg, IDC_MSG, str, _countof(str));
ChangeAllProtoMessages(dat->szProto, dat->statusMode, str);
db_set_ts(NULL, "SRAway", StatusModeToDbSetting(dat->statusMode, "Msg"), str);
@@ -329,7 +329,7 @@ static int StatusModeChange(WPARAM wParam, LPARAM lParam)
ChangeAllProtoMessages(szProto, statusMode, NULL);
else if (bScreenSaverRunning || GetStatusModeByte(statusMode, "NoDlg", true)) {
- TCHAR *msg = GetAwayMessage(statusMode, szProto);
+ wchar_t *msg = GetAwayMessage(statusMode, szProto);
ChangeAllProtoMessages(szProto, statusMode, msg);
mir_free(msg);
}
@@ -355,7 +355,7 @@ struct AwayMsgInfo
int ignore;
int noDialog;
int usePrevious;
- TCHAR msg[1024];
+ wchar_t msg[1024];
};
struct AwayMsgDlgData
@@ -422,7 +422,7 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam
LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
if (dis->CtlID != IDC_LST_STATUS) break;
- TCHAR buf[128];
+ wchar_t buf[128];
SendDlgItemMessage(hwndDlg, IDC_LST_STATUS, LB_GETTEXT, dis->itemID, (LPARAM)buf);
if (dis->itemState & (ODS_SELECTED | ODS_FOCUS)) {
diff --git a/src/core/stdaway/src/stdafx.h b/src/core/stdaway/src/stdafx.h
index b9f0df09cd..d8bb7b74e3 100644
--- a/src/core/stdaway/src/stdafx.h
+++ b/src/core/stdaway/src/stdafx.h
@@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <commctrl.h>
diff --git a/src/core/stdchat/src/main.cpp b/src/core/stdchat/src/main.cpp
index 28e27f8b5d..430992defb 100644
--- a/src/core/stdchat/src/main.cpp
+++ b/src/core/stdchat/src/main.cpp
@@ -287,30 +287,30 @@ static void RegisterFonts()
{
ColourIDT colourid = { sizeof(colourid) };
strncpy(colourid.dbSettingsGroup, CHAT_MODULE, sizeof(colourid.dbSettingsGroup));
- _tcsncpy(colourid.group, LPGENT("Chat module"), _countof(colourid.group));
+ wcsncpy(colourid.group, LPGENW("Chat module"), _countof(colourid.group));
strncpy(colourid.setting, "ColorLogBG", _countof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Group chat log background"), _countof(colourid.name));
+ wcsncpy(colourid.name, LPGENW("Group chat log background"), _countof(colourid.name));
colourid.defcolour = GetSysColor(COLOR_WINDOW);
ColourRegisterT(&colourid);
strncpy(colourid.setting, "ColorMessageBG", _countof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Message background"), _countof(colourid.name));
+ wcsncpy(colourid.name, LPGENW("Message background"), _countof(colourid.name));
colourid.defcolour = GetSysColor(COLOR_WINDOW);
ColourRegisterT(&colourid);
strncpy(colourid.setting, "ColorNicklistBG", _countof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Nick list background"), _countof(colourid.name));
+ wcsncpy(colourid.name, LPGENW("Nick list background"), _countof(colourid.name));
colourid.defcolour = GetSysColor(COLOR_WINDOW);
ColourRegisterT(&colourid);
strncpy(colourid.setting, "ColorNicklistLines", _countof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Nick list lines"), _countof(colourid.name));
+ wcsncpy(colourid.name, LPGENW("Nick list lines"), _countof(colourid.name));
colourid.defcolour = GetSysColor(COLOR_INACTIVEBORDER);
ColourRegisterT(&colourid);
strncpy(colourid.setting, "ColorNicklistSelectedBG", _countof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Nick list background (selected)"), _countof(colourid.name));
+ wcsncpy(colourid.name, LPGENW("Nick list background (selected)"), _countof(colourid.name));
colourid.defcolour = GetSysColor(COLOR_HIGHLIGHT);
ColourRegisterT(&colourid);
}
@@ -345,7 +345,7 @@ extern "C" __declspec(dllexport) int Load(void)
AddIcons();
RegisterFonts();
- CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENT("Chat module"), FONTMODE_SKIP };
+ CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Chat module"), FONTMODE_SKIP };
mir_getCI(&data);
saveCI = *pci;
diff --git a/src/core/stdchat/src/manager.cpp b/src/core/stdchat/src/manager.cpp
index f0fd3076cc..bc901042e8 100644
--- a/src/core/stdchat/src/manager.cpp
+++ b/src/core/stdchat/src/manager.cpp
@@ -78,7 +78,7 @@ SESSION_INFO* SM_GetNextWindow(SESSION_INFO *si)
// be restored
//---------------------------------------------------
-BOOL TabM_AddTab(const TCHAR *pszID, const char* pszModule)
+BOOL TabM_AddTab(const wchar_t *pszID, const char* pszModule)
{
TABLIST *node = NULL;
if (!pszID || !pszModule)
diff --git a/src/core/stdchat/src/options.cpp b/src/core/stdchat/src/options.cpp
index 1bd3a33c5c..5ce45f72ce 100644
--- a/src/core/stdchat/src/options.cpp
+++ b/src/core/stdchat/src/options.cpp
@@ -23,109 +23,109 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct branch_t
{
- const TCHAR* szDescr;
+ const wchar_t* szDescr;
const char* szDBName;
int iMode;
BYTE bDefault;
};
static const struct branch_t branch0[] = {
- { LPGENT("Use a tabbed interface"), "Tabs", 0, 1 },
- { LPGENT("Close tab on double click"), "TabCloseOnDblClick", 0, 0 },
- { LPGENT("Restore previously open tabs when showing the window"), "TabRestore", 0, 0 },
- { LPGENT("Show tabs at the bottom"), "TabBottom", 0, 0 },
+ { LPGENW("Use a tabbed interface"), "Tabs", 0, 1 },
+ { LPGENW("Close tab on double click"), "TabCloseOnDblClick", 0, 0 },
+ { LPGENW("Restore previously open tabs when showing the window"), "TabRestore", 0, 0 },
+ { LPGENW("Show tabs at the bottom"), "TabBottom", 0, 0 },
};
static const struct branch_t branch1[] = {
- { LPGENT("Send message by pressing the 'Enter' key"), "SendOnEnter", 0, 1 },
- { LPGENT("Send message by pressing the 'Enter' key twice"), "SendOnDblEnter", 0, 0 },
- { LPGENT("Flash window when someone speaks"), "FlashWindow", 0, 0 },
- { LPGENT("Flash window when a word is highlighted"), "FlashWindowHighlight", 0, 1 },
- { LPGENT("Show list of users in the chat room"), "ShowNicklist", 0, 1 },
- { LPGENT("Show button for sending messages"), "ShowSend", 0, 0 },
- { LPGENT("Show buttons for controlling the chat room"), "ShowTopButtons", 0, 1 },
- { LPGENT("Show buttons for formatting the text you are typing"), "ShowFormatButtons", 0, 1 },
- { LPGENT("Show button menus when right clicking the buttons"), "RightClickFilter", 0, 0 },
- { LPGENT("Show new windows cascaded"), "CascadeWindows", 0, 1 },
- { LPGENT("Save the size and position of chat rooms"), "SavePosition", 0, 0 },
- { LPGENT("Show the topic of the room on your contact list (if supported)"), "TopicOnClist", 0, 0 },
- { LPGENT("Do not play sounds when the chat room is focused"), "SoundsFocus", 0, 0 },
- { LPGENT("Do not pop up the window when joining a chat room"), "PopupOnJoin", 0, 0 },
- { LPGENT("Toggle the visible state when double clicking in the contact list"), "ToggleVisibility", 0, 0 },
- { LPGENT("Show contact statuses if protocol supports them"), "ShowContactStatus", 0, 0 },
- { LPGENT("Display contact status icon before user role icon"), "ContactStatusFirst", 0, 0 },
+ { LPGENW("Send message by pressing the 'Enter' key"), "SendOnEnter", 0, 1 },
+ { LPGENW("Send message by pressing the 'Enter' key twice"), "SendOnDblEnter", 0, 0 },
+ { LPGENW("Flash window when someone speaks"), "FlashWindow", 0, 0 },
+ { LPGENW("Flash window when a word is highlighted"), "FlashWindowHighlight", 0, 1 },
+ { LPGENW("Show list of users in the chat room"), "ShowNicklist", 0, 1 },
+ { LPGENW("Show button for sending messages"), "ShowSend", 0, 0 },
+ { LPGENW("Show buttons for controlling the chat room"), "ShowTopButtons", 0, 1 },
+ { LPGENW("Show buttons for formatting the text you are typing"), "ShowFormatButtons", 0, 1 },
+ { LPGENW("Show button menus when right clicking the buttons"), "RightClickFilter", 0, 0 },
+ { LPGENW("Show new windows cascaded"), "CascadeWindows", 0, 1 },
+ { LPGENW("Save the size and position of chat rooms"), "SavePosition", 0, 0 },
+ { LPGENW("Show the topic of the room on your contact list (if supported)"), "TopicOnClist", 0, 0 },
+ { LPGENW("Do not play sounds when the chat room is focused"), "SoundsFocus", 0, 0 },
+ { LPGENW("Do not pop up the window when joining a chat room"), "PopupOnJoin", 0, 0 },
+ { LPGENW("Toggle the visible state when double clicking in the contact list"), "ToggleVisibility", 0, 0 },
+ { LPGENW("Show contact statuses if protocol supports them"), "ShowContactStatus", 0, 0 },
+ { LPGENW("Display contact status icon before user role icon"), "ContactStatusFirst", 0, 0 },
};
static const struct branch_t branch2[] = {
- { LPGENT("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1 },
- { LPGENT("Only prefix with timestamp if it has changed"), "ShowTimeStampIfChanged", 0, 0 },
- { LPGENT("Timestamp has same color as the event"), "TimeStampEventColour", 0, 0 },
- { LPGENT("Indent the second line of a message"), "LogIndentEnabled", 0, 1 },
- { LPGENT("Limit user names in the message log to 20 characters"), "LogLimitNames", 0, 1 },
- { LPGENT("Add ':' to auto-completed user names"), "AddColonToAutoComplete", 0, 1 },
- { LPGENT("Strip colors from messages in the log"), "StripFormatting", 0, 0 },
- { LPGENT("Enable the 'event filter' for new rooms"), "FilterEnabled", 0, 0 }
+ { LPGENW("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1 },
+ { LPGENW("Only prefix with timestamp if it has changed"), "ShowTimeStampIfChanged", 0, 0 },
+ { LPGENW("Timestamp has same color as the event"), "TimeStampEventColour", 0, 0 },
+ { LPGENW("Indent the second line of a message"), "LogIndentEnabled", 0, 1 },
+ { LPGENW("Limit user names in the message log to 20 characters"), "LogLimitNames", 0, 1 },
+ { LPGENW("Add ':' to auto-completed user names"), "AddColonToAutoComplete", 0, 1 },
+ { LPGENW("Strip colors from messages in the log"), "StripFormatting", 0, 0 },
+ { LPGENW("Enable the 'event filter' for new rooms"), "FilterEnabled", 0, 0 }
};
static const struct branch_t branch3[] = {
- { LPGENT("Show topic changes"), "FilterFlags", GC_EVENT_TOPIC, 0 },
- { LPGENT("Show users joining"), "FilterFlags", GC_EVENT_JOIN, 0 },
- { LPGENT("Show users disconnecting"), "FilterFlags", GC_EVENT_QUIT, 0 },
- { LPGENT("Show messages"), "FilterFlags", GC_EVENT_MESSAGE, 1 },
- { LPGENT("Show actions"), "FilterFlags", GC_EVENT_ACTION, 1 },
- { LPGENT("Show users leaving"), "FilterFlags", GC_EVENT_PART, 0 },
- { LPGENT("Show users being kicked"), "FilterFlags", GC_EVENT_KICK, 1 },
- { LPGENT("Show notices"), "FilterFlags", GC_EVENT_NOTICE, 1 },
- { LPGENT("Show users changing name"), "FilterFlags", GC_EVENT_NICK, 0 },
- { LPGENT("Show information messages"), "FilterFlags", GC_EVENT_INFORMATION, 1 },
- { LPGENT("Show status changes of users"), "FilterFlags", GC_EVENT_ADDSTATUS, 0 },
+ { LPGENW("Show topic changes"), "FilterFlags", GC_EVENT_TOPIC, 0 },
+ { LPGENW("Show users joining"), "FilterFlags", GC_EVENT_JOIN, 0 },
+ { LPGENW("Show users disconnecting"), "FilterFlags", GC_EVENT_QUIT, 0 },
+ { LPGENW("Show messages"), "FilterFlags", GC_EVENT_MESSAGE, 1 },
+ { LPGENW("Show actions"), "FilterFlags", GC_EVENT_ACTION, 1 },
+ { LPGENW("Show users leaving"), "FilterFlags", GC_EVENT_PART, 0 },
+ { LPGENW("Show users being kicked"), "FilterFlags", GC_EVENT_KICK, 1 },
+ { LPGENW("Show notices"), "FilterFlags", GC_EVENT_NOTICE, 1 },
+ { LPGENW("Show users changing name"), "FilterFlags", GC_EVENT_NICK, 0 },
+ { LPGENW("Show information messages"), "FilterFlags", GC_EVENT_INFORMATION, 1 },
+ { LPGENW("Show status changes of users"), "FilterFlags", GC_EVENT_ADDSTATUS, 0 },
};
static const struct branch_t branch4[] = {
- { LPGENT("Show icon for topic changes"), "IconFlags", GC_EVENT_TOPIC, 0 },
- { LPGENT("Show icon for users joining"), "IconFlags", GC_EVENT_JOIN, 1 },
- { LPGENT("Show icon for users disconnecting"), "IconFlags", GC_EVENT_QUIT, 0 },
- { LPGENT("Show icon for messages"), "IconFlags", GC_EVENT_MESSAGE, 0 },
- { LPGENT("Show icon for actions"), "IconFlags", GC_EVENT_ACTION, 0 },
- { LPGENT("Show icon for highlights"), "IconFlags", GC_EVENT_HIGHLIGHT, 0 },
- { LPGENT("Show icon for users leaving"), "IconFlags", GC_EVENT_PART, 0 },
- { LPGENT("Show icon for users kicking other user"), "IconFlags", GC_EVENT_KICK, 0 },
- { LPGENT("Show icon for notices"), "IconFlags", GC_EVENT_NOTICE, 0 },
- { LPGENT("Show icon for name changes"), "IconFlags", GC_EVENT_NICK, 0 },
- { LPGENT("Show icon for information messages"), "IconFlags", GC_EVENT_INFORMATION, 0 },
- { LPGENT("Show icon for status changes"), "IconFlags", GC_EVENT_ADDSTATUS, 0 },
+ { LPGENW("Show icon for topic changes"), "IconFlags", GC_EVENT_TOPIC, 0 },
+ { LPGENW("Show icon for users joining"), "IconFlags", GC_EVENT_JOIN, 1 },
+ { LPGENW("Show icon for users disconnecting"), "IconFlags", GC_EVENT_QUIT, 0 },
+ { LPGENW("Show icon for messages"), "IconFlags", GC_EVENT_MESSAGE, 0 },
+ { LPGENW("Show icon for actions"), "IconFlags", GC_EVENT_ACTION, 0 },
+ { LPGENW("Show icon for highlights"), "IconFlags", GC_EVENT_HIGHLIGHT, 0 },
+ { LPGENW("Show icon for users leaving"), "IconFlags", GC_EVENT_PART, 0 },
+ { LPGENW("Show icon for users kicking other user"), "IconFlags", GC_EVENT_KICK, 0 },
+ { LPGENW("Show icon for notices"), "IconFlags", GC_EVENT_NOTICE, 0 },
+ { LPGENW("Show icon for name changes"), "IconFlags", GC_EVENT_NICK, 0 },
+ { LPGENW("Show icon for information messages"), "IconFlags", GC_EVENT_INFORMATION, 0 },
+ { LPGENW("Show icon for status changes"), "IconFlags", GC_EVENT_ADDSTATUS, 0 },
};
static const struct branch_t branch5[] = {
- { LPGENT("Show icons in tray only when the chat room is not active"), "TrayIconInactiveOnly", 0, 1 },
- { LPGENT("Show icon in tray for topic changes"), "TrayIconFlags", GC_EVENT_TOPIC, 0 },
- { LPGENT("Show icon in tray for users joining"), "TrayIconFlags", GC_EVENT_JOIN, 0 },
- { LPGENT("Show icon in tray for users disconnecting"), "TrayIconFlags", GC_EVENT_QUIT, 0 },
- { LPGENT("Show icon in tray for messages"), "TrayIconFlags", GC_EVENT_MESSAGE, 0 },
- { LPGENT("Show icon in tray for actions"), "TrayIconFlags", GC_EVENT_ACTION, 0 },
- { LPGENT("Show icon in tray for highlights"), "TrayIconFlags", GC_EVENT_HIGHLIGHT, 1 },
- { LPGENT("Show icon in tray for users leaving"), "TrayIconFlags", GC_EVENT_PART, 0 },
- { LPGENT("Show icon in tray for users kicking other user"), "TrayIconFlags", GC_EVENT_KICK, 0 },
- { LPGENT("Show icon in tray for notices"), "TrayIconFlags", GC_EVENT_NOTICE, 0 },
- { LPGENT("Show icon in tray for name changes"), "TrayIconFlags", GC_EVENT_NICK, 0 },
- { LPGENT("Show icon in tray for information messages"), "TrayIconFlags", GC_EVENT_INFORMATION, 0 },
- { LPGENT("Show icon in tray for status changes"), "TrayIconFlags", GC_EVENT_ADDSTATUS, 0 },
+ { LPGENW("Show icons in tray only when the chat room is not active"), "TrayIconInactiveOnly", 0, 1 },
+ { LPGENW("Show icon in tray for topic changes"), "TrayIconFlags", GC_EVENT_TOPIC, 0 },
+ { LPGENW("Show icon in tray for users joining"), "TrayIconFlags", GC_EVENT_JOIN, 0 },
+ { LPGENW("Show icon in tray for users disconnecting"), "TrayIconFlags", GC_EVENT_QUIT, 0 },
+ { LPGENW("Show icon in tray for messages"), "TrayIconFlags", GC_EVENT_MESSAGE, 0 },
+ { LPGENW("Show icon in tray for actions"), "TrayIconFlags", GC_EVENT_ACTION, 0 },
+ { LPGENW("Show icon in tray for highlights"), "TrayIconFlags", GC_EVENT_HIGHLIGHT, 1 },
+ { LPGENW("Show icon in tray for users leaving"), "TrayIconFlags", GC_EVENT_PART, 0 },
+ { LPGENW("Show icon in tray for users kicking other user"), "TrayIconFlags", GC_EVENT_KICK, 0 },
+ { LPGENW("Show icon in tray for notices"), "TrayIconFlags", GC_EVENT_NOTICE, 0 },
+ { LPGENW("Show icon in tray for name changes"), "TrayIconFlags", GC_EVENT_NICK, 0 },
+ { LPGENW("Show icon in tray for information messages"), "TrayIconFlags", GC_EVENT_INFORMATION, 0 },
+ { LPGENW("Show icon in tray for status changes"), "TrayIconFlags", GC_EVENT_ADDSTATUS, 0 },
};
static const struct branch_t branch6[] = {
- { LPGENT("Show popups only when the chat room is not active"), "PopupInactiveOnly", 0, 1 },
- { LPGENT("Show popup for topic changes"), "PopupFlags", GC_EVENT_TOPIC, 0 },
- { LPGENT("Show popup for users joining"), "PopupFlags", GC_EVENT_JOIN, 0 },
- { LPGENT("Show popup for users disconnecting"), "PopupFlags", GC_EVENT_QUIT, 0 },
- { LPGENT("Show popup for messages"), "PopupFlags", GC_EVENT_MESSAGE, 0 },
- { LPGENT("Show popup for actions"), "PopupFlags", GC_EVENT_ACTION, 0 },
- { LPGENT("Show popup for highlights"), "PopupFlags", GC_EVENT_HIGHLIGHT, 0 },
- { LPGENT("Show popup for users leaving"), "PopupFlags", GC_EVENT_PART, 0 },
- { LPGENT("Show popup for users kicking other user"), "PopupFlags", GC_EVENT_KICK, 0 },
- { LPGENT("Show popup for notices"), "PopupFlags", GC_EVENT_NOTICE, 0 },
- { LPGENT("Show popup for name changes"), "PopupFlags", GC_EVENT_NICK, 0 },
- { LPGENT("Show popup for information messages"), "PopupFlags", GC_EVENT_INFORMATION, 0 },
- { LPGENT("Show popup for status changes"), "PopupFlags", GC_EVENT_ADDSTATUS, 0 },
+ { LPGENW("Show popups only when the chat room is not active"), "PopupInactiveOnly", 0, 1 },
+ { LPGENW("Show popup for topic changes"), "PopupFlags", GC_EVENT_TOPIC, 0 },
+ { LPGENW("Show popup for users joining"), "PopupFlags", GC_EVENT_JOIN, 0 },
+ { LPGENW("Show popup for users disconnecting"), "PopupFlags", GC_EVENT_QUIT, 0 },
+ { LPGENW("Show popup for messages"), "PopupFlags", GC_EVENT_MESSAGE, 0 },
+ { LPGENW("Show popup for actions"), "PopupFlags", GC_EVENT_ACTION, 0 },
+ { LPGENW("Show popup for highlights"), "PopupFlags", GC_EVENT_HIGHLIGHT, 0 },
+ { LPGENW("Show popup for users leaving"), "PopupFlags", GC_EVENT_PART, 0 },
+ { LPGENW("Show popup for users kicking other user"), "PopupFlags", GC_EVENT_KICK, 0 },
+ { LPGENW("Show popup for notices"), "PopupFlags", GC_EVENT_NOTICE, 0 },
+ { LPGENW("Show popup for name changes"), "PopupFlags", GC_EVENT_NICK, 0 },
+ { LPGENW("Show popup for information messages"), "PopupFlags", GC_EVENT_INFORMATION, 0 },
+ { LPGENW("Show popup for status changes"), "PopupFlags", GC_EVENT_ADDSTATUS, 0 },
};
HTREEITEM hItemB0[_countof(branch0)];
@@ -242,7 +242,7 @@ static void CheckBranches(HWND hwndTree, HTREEITEM hHeading)
static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData)
{
- TCHAR szDir[MAX_PATH];
+ wchar_t szDir[MAX_PATH];
switch (uMsg) {
case BFFM_INITIALIZED:
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, pData);
@@ -320,7 +320,7 @@ HANDLE GetIconHandle(const char *pszIcoLibName)
return IcoLib_GetIconHandle(szTemp);
}
-static void InitSetting(TCHAR** ppPointer, char* pszSetting, TCHAR* pszDefault)
+static void InitSetting(wchar_t** ppPointer, char* pszSetting, wchar_t* pszDefault)
{
DBVARIANT dbv;
if (!db_get_ts(NULL, CHAT_MODULE, pszSetting, &dbv)) {
@@ -484,13 +484,13 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam,
SendDlgItemMessage(hwndDlg, IDC_SPIN4, UDM_SETRANGE, 0, MAKELONG(255, 10));
SendDlgItemMessage(hwndDlg, IDC_SPIN4, UDM_SETPOS, 0, MAKELONG(db_get_b(NULL, CHAT_MODULE, "NicklistRowDist", 12), 0));
{
- TCHAR* pszGroup = NULL;
+ wchar_t* pszGroup = NULL;
InitSetting(&pszGroup, "AddToGroup", L"Chat rooms");
SetDlgItemText(hwndDlg, IDC_GROUP, pszGroup);
mir_free(pszGroup);
}
{
- TCHAR szTemp[MAX_PATH];
+ wchar_t szTemp[MAX_PATH];
PathToRelativeT(g_Settings.pszLogDir, szTemp);
SetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, szTemp);
}
@@ -529,8 +529,8 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam,
case IDC_FONTCHOOSE:
{
- TCHAR szDirectory[MAX_PATH];
- TCHAR szTemp[MAX_PATH];
+ wchar_t szDirectory[MAX_PATH];
+ wchar_t szTemp[MAX_PATH];
BROWSEINFO bi = { 0 };
bi.hwndOwner = hwndDlg;
@@ -561,18 +561,18 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam,
case WM_NOTIFY:
if (((LPNMHDR)lParam)->idFrom == 0 && ((LPNMHDR)lParam)->code == PSN_APPLY) {
- TCHAR * pszText = NULL;
+ wchar_t * pszText = NULL;
int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_HIGHLIGHTWORDS));
if (iLen > 0) {
- TCHAR *ptszText = (TCHAR *)mir_alloc((iLen + 2) * sizeof(TCHAR));
- TCHAR *p2 = NULL;
+ wchar_t *ptszText = (wchar_t *)mir_alloc((iLen + 2) * sizeof(wchar_t));
+ wchar_t *p2 = NULL;
if (ptszText) {
GetDlgItemText(hwndDlg, IDC_HIGHLIGHTWORDS, ptszText, iLen + 1);
- p2 = _tcschr(ptszText, ',');
+ p2 = wcschr(ptszText, ',');
while (p2) {
*p2 = ' ';
- p2 = _tcschr(ptszText, ',');
+ p2 = wcschr(ptszText, ',');
}
db_set_ts(NULL, CHAT_MODULE, "HighlightWords", ptszText);
mir_free(ptszText);
@@ -582,7 +582,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam,
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_LOGDIRECTORY));
if (iLen > 0) {
- pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR));
+ pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, pszText, iLen + 1);
db_set_ts(NULL, CHAT_MODULE, "LogDirectory", pszText);
}
@@ -591,7 +591,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam,
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_LOGTIMESTAMP));
if (iLen > 0) {
- pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR));
+ pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_LOGTIMESTAMP, pszText, iLen + 1);
db_set_ts(NULL, CHAT_MODULE, "LogTimestamp", pszText);
}
@@ -599,7 +599,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam,
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_TIMESTAMP));
if (iLen > 0) {
- pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR));
+ pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_TIMESTAMP, pszText, iLen + 1);
db_set_ts(NULL, CHAT_MODULE, "HeaderTime", pszText);
}
@@ -607,7 +607,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam,
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_INSTAMP));
if (iLen > 0) {
- pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR));
+ pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_INSTAMP, pszText, iLen + 1);
db_set_ts(NULL, CHAT_MODULE, "HeaderIncoming", pszText);
}
@@ -615,7 +615,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam,
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_OUTSTAMP));
if (iLen > 0) {
- pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR));
+ pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_OUTSTAMP, pszText, iLen + 1);
db_set_ts(NULL, CHAT_MODULE, "HeaderOutgoing", pszText);
}
@@ -634,7 +634,7 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam,
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_GROUP));
if (iLen > 0) {
- pszText = (TCHAR *)mir_realloc(pszText, (iLen + 1) * sizeof(TCHAR));
+ pszText = (wchar_t *)mir_realloc(pszText, (iLen + 1) * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_GROUP, pszText, iLen + 1);
db_set_ts(NULL, CHAT_MODULE, "AddToGroup", pszText);
}
diff --git a/src/core/stdchat/src/stdafx.h b/src/core/stdchat/src/stdafx.h
index 5acc72626b..5e27b6b467 100644
--- a/src/core/stdchat/src/stdafx.h
+++ b/src/core/stdchat/src/stdafx.h
@@ -67,7 +67,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct TABLIST
{
- TCHAR *pszID;
+ wchar_t *pszID;
char *pszModule;
TABLIST *next;
};
@@ -135,12 +135,12 @@ void LoadIcons(void);
// log.c
void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, BOOL bRedraw, BOOL bPhaseTwo);
-void ValidateFilename (TCHAR * filename);
+void ValidateFilename (wchar_t * filename);
char* Log_CreateRtfHeader(MODULEINFO * mi);
// window.c
INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
-int GetTextPixelSize( TCHAR* pszText, HFONT hFont, BOOL bWidth);
+int GetTextPixelSize( wchar_t* pszText, HFONT hFont, BOOL bWidth);
SESSION_INFO* SM_GetPrevWindow(SESSION_INFO *si);
SESSION_INFO* SM_GetNextWindow(SESSION_INFO *si);
@@ -158,14 +158,14 @@ void ShowRoom(SESSION_INFO *si, WPARAM wp, BOOL bSetForeground);
int GetColorIndex(const char* pszModule, COLORREF cr);
void CheckColorsInModule(const char* pszModule);
int GetRichTextLength(HWND hwnd);
-UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, TCHAR* pszUID, TCHAR* pszWordText);
+UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, wchar_t* pszUID, wchar_t* pszWordText);
void DestroyGCMenu(HMENU *hMenu, int iIndex);
bool LoadMessageFont(LOGFONT *lf, COLORREF *colour);
// message.c
char* Message_GetFromStream(HWND hwndDlg, SESSION_INFO *si);
-BOOL TabM_AddTab(const TCHAR *pszID, const char* pszModule);
+BOOL TabM_AddTab(const wchar_t *pszID, const char* pszModule);
BOOL TabM_RemoveAll(void);
#pragma comment(lib,"comctl32.lib")
diff --git a/src/core/stdchat/src/tools.cpp b/src/core/stdchat/src/tools.cpp
index 56765958bd..12731649f2 100644
--- a/src/core/stdchat/src/tools.cpp
+++ b/src/core/stdchat/src/tools.cpp
@@ -109,7 +109,7 @@ void CheckColorsInModule(const char* pszModule)
}
}
-UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, TCHAR* pszUID, TCHAR* pszWordText)
+UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, wchar_t* pszUID, wchar_t* pszWordText)
{
HMENU hSubMenu = 0;
*hMenu = GetSubMenu(g_hMenu, iIndex);
@@ -134,7 +134,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO
}
if (pszWordText && pszWordText[0]) {
- TCHAR szMenuText[4096];
+ wchar_t szMenuText[4096];
mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText);
ModifyMenu(*hMenu, 4, MF_STRING | MF_BYPOSITION, 4, szMenuText);
}
@@ -142,7 +142,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO
gcmi.Type = MENU_ON_LOG;
}
else if (iIndex == 0) {
- TCHAR szTemp[50];
+ wchar_t szTemp[50];
if (pszWordText)
mir_sntprintf(szTemp, TranslateT("&Message %s"), pszWordText);
else
@@ -160,7 +160,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO
AppendMenu(*hMenu, MF_SEPARATOR, 0, 0);
for (int i = 0; i < gcmi.nItems; i++) {
- TCHAR* ptszText = TranslateTS(gcmi.Item[i].pszDesc);
+ wchar_t* ptszText = TranslateTS(gcmi.Item[i].pszDesc);
DWORD dwState = gcmi.Item[i].bDisabled ? MF_GRAYED : 0;
if (gcmi.Item[i].uType == MENU_NEWPOPUP) {
@@ -199,12 +199,12 @@ void DestroyGCMenu(HMENU *hMenu, int iIndex)
}
}
-void ValidateFilename(TCHAR *filename)
+void ValidateFilename(wchar_t *filename)
{
- TCHAR *p1 = filename;
- TCHAR szForbidden[] = L"\\/:*?\"<>|";
+ wchar_t *p1 = filename;
+ wchar_t szForbidden[] = L"\\/:*?\"<>|";
while (*p1 != '\0') {
- if (_tcschr(szForbidden, *p1))
+ if (wcschr(szForbidden, *p1))
*p1 = '_';
p1 += 1;
}
diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp
index 7fdbf8f562..bf71ea9f90 100644
--- a/src/core/stdchat/src/window.cpp
+++ b/src/core/stdchat/src/window.cpp
@@ -27,10 +27,10 @@ static HKL hkl = NULL;
struct MESSAGESUBDATA
{
time_t lastEnterTime;
- TCHAR szTabSave[20];
+ wchar_t szTabSave[20];
};
-static TCHAR szTrimString[] = L":;,.!?\'\"><()[]- \r\n";
+static wchar_t szTrimString[] = L":;,.!?\'\"><()[]- \r\n";
static LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
@@ -363,7 +363,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
SendMessage(GetParent(hwnd), GC_SWITCHTAB, 0, (int)wParam - (int)VK_NUMPAD1);
if (wParam == VK_TAB && !isCtrl && !isShift) { //tab-autocomplete
- TCHAR* pszText = NULL;
+ wchar_t* pszText = NULL;
LRESULT lResult = (LRESULT)SendMessage(hwnd, EM_GETSEL, 0, 0);
SendMessage(hwnd, WM_SETREDRAW, FALSE, 0);
@@ -376,7 +376,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
gtl.codepage = CP_ACP;
int iLen = SendMessage(hwnd, EM_GETTEXTLENGTHEX, (WPARAM)&gtl, 0);
if (iLen > 0) {
- pszText = (TCHAR *)mir_alloc(sizeof(TCHAR)*(iLen + 100));
+ pszText = (wchar_t *)mir_alloc(sizeof(wchar_t)*(iLen + 100));
GETTEXTEX gt = { 0 };
gt.cb = iLen + 99;
@@ -392,10 +392,10 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
if (dat->szTabSave[0] == '\0')
mir_tstrncpy(dat->szTabSave, pszText + start, end - start + 1);
- TCHAR *pszSelName = (TCHAR *)mir_alloc(sizeof(TCHAR)*(end - start + 1));
+ wchar_t *pszSelName = (wchar_t *)mir_alloc(sizeof(wchar_t)*(end - start + 1));
mir_tstrncpy(pszSelName, pszText + start, end - start + 1);
- TCHAR *pszName = pci->UM_FindUserAutoComplete(Parentsi->pUsers, dat->szTabSave, pszSelName);
+ wchar_t *pszName = pci->UM_FindUserAutoComplete(Parentsi->pUsers, dat->szTabSave, pszSelName);
if (pszName == NULL) {
pszName = dat->szTabSave;
SendMessage(hwnd, EM_SETSEL, start, end);
@@ -984,13 +984,13 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO *si
ti.uId = 1;
ti.rect = clientRect;
- TCHAR tszBuf[1024]; tszBuf[0] = 0;
+ wchar_t tszBuf[1024]; tszBuf[0] = 0;
USERINFO *ui = pci->SM_GetUserFromIndex(si->ptszID, si->pszModule, currentHovered);
if (ui) {
if (ProtoServiceExists(si->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT)) {
- TCHAR *p = (TCHAR*)CallProtoService(si->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)si->ptszID, (LPARAM)ui->pszUID);
+ wchar_t *p = (wchar_t*)CallProtoService(si->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)si->ptszID, (LPARAM)ui->pszUID);
if (p != NULL) {
- _tcsncpy_s(tszBuf, p, _TRUNCATE);
+ wcsncpy_s(tszBuf, p, _TRUNCATE);
mir_free(p);
}
}
@@ -1170,7 +1170,7 @@ static int RestoreWindowPosition(HWND hwnd, MCONTACT hContact, char * szModule,
return 1;
}
-int GetTextPixelSize(TCHAR* pszText, HFONT hFont, BOOL bWidth)
+int GetTextPixelSize(wchar_t* pszText, HFONT hFont, BOOL bWidth)
{
if (!pszText || !hFont)
return 0;
@@ -1220,7 +1220,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_AUTOURLDETECT, 1, 0);
int mask = (int)SendDlgItemMessage(hwndDlg, IDC_LOG, EM_GETEVENTMASK, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETEVENTMASK, 0, mask | ENM_LINK | ENM_MOUSEEVENTS);
- SendDlgItemMessage(hwndDlg, IDC_LOG, EM_LIMITTEXT, (WPARAM)sizeof(TCHAR) * 0x7FFFFFFF, 0);
+ SendDlgItemMessage(hwndDlg, IDC_LOG, EM_LIMITTEXT, (WPARAM)sizeof(wchar_t) * 0x7FFFFFFF, 0);
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETOLECALLBACK, 0, (LPARAM)& reOleCallback);
si->hwndStatus = CreateWindowEx(0, STATUSCLASSNAME, NULL, WS_CHILD | WS_VISIBLE | SBARS_SIZEGRIP | SBT_TOOLTIPS, 0, 0, 0, 0, hwndDlg, NULL, g_hInst, NULL);
@@ -1311,7 +1311,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
case GC_UPDATETITLE:
{
- TCHAR szTemp[100];
+ wchar_t szTemp[100];
switch (si->iType) {
case GCW_CHATROOM:
mir_sntprintf(szTemp,
@@ -1334,7 +1334,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
case GC_UPDATESTATUSBAR:
{
MODULEINFO *mi = pci->MM_FindModule(si->pszModule);
- TCHAR* ptszDispName = mi->ptszModDispName;
+ wchar_t* ptszDispName = mi->ptszModDispName;
int x = 12;
x += GetTextPixelSize(ptszDispName, (HFONT)SendMessage(si->hwndStatus, WM_GETFONT, 0, 0), TRUE);
x += GetSystemMetrics(SM_CXSMICON);
@@ -1603,7 +1603,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
if (!bFound) { // create a new tab
int insertat;
- TCHAR szTemp[30];
+ wchar_t szTemp[30];
mir_tstrncpy(szTemp, s1->ptszName, 21);
if (mir_tstrlen(s1->ptszName) > 20)
@@ -2170,7 +2170,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
POINT pt;
UINT uID = 0;
HMENU hMenu = 0;
- TCHAR pszWord[4096];
+ wchar_t pszWord[4096];
pt.x = (short)LOWORD(((ENLINK *)lParam)->lParam);
pt.y = (short)HIWORD(((ENLINK *)lParam)->lParam);
@@ -2199,7 +2199,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
tr.lpstrText = pszWord;
long iRes = SendDlgItemMessage(hwndDlg, IDC_LOG, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
if (iRes > 0)
- for (size_t iLen = mir_tstrlen(pszWord) - 1; _tcschr(szTrimString, pszWord[iLen]); iLen--)
+ for (size_t iLen = mir_tstrlen(pszWord) - 1; wcschr(szTrimString, pszWord[iLen]); iLen--)
pszWord[iLen] = 0;
}
@@ -2271,7 +2271,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
TEXTRANGE tr;
tr.chrg = ((ENLINK *)lParam)->chrg;
- tr.lpstrText = (LPTSTR)mir_alloc(sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 1));
+ tr.lpstrText = (LPTSTR)mir_alloc(sizeof(wchar_t)*(tr.chrg.cpMax - tr.chrg.cpMin + 1));
SendMessage(((LPNMHDR)lParam)->hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
if (((ENLINK *)lParam)->msg == WM_RBUTTONDOWN) {
@@ -2298,8 +2298,8 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
if (!OpenClipboard(hwndDlg))
break;
EmptyClipboard();
- hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(mir_tstrlen(tr.lpstrText) + 1));
- mir_tstrcpy((TCHAR*)GlobalLock(hData), tr.lpstrText);
+ hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(wchar_t)*(mir_tstrlen(tr.lpstrText) + 1));
+ mir_tstrcpy((wchar_t*)GlobalLock(hData), tr.lpstrText);
GlobalUnlock(hData);
SetClipboardData(CF_UNICODETEXT, hData);
CloseClipboard();
@@ -2330,7 +2330,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
int item = LOWORD(SendDlgItemMessage(hwndDlg, IDC_LIST, LB_ITEMFROMPOINT, 0, MAKELPARAM(p.x, p.y)));
USERINFO *ui = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, item);
if (ui != NULL) {
- static TCHAR ptszBuf[1024];
+ static wchar_t ptszBuf[1024];
mir_sntprintf(ptszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s",
TranslateT("Nickname"), ui->pszNick,
TranslateT("Unique ID"), ui->pszUID,
@@ -2357,7 +2357,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
LRESULT lResult = (LRESULT)SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_GETSEL, 0, 0);
int start = LOWORD(lResult);
size_t dwNameLenMax = (mir_tstrlen(ui->pszUID) + 3);
- TCHAR* pszName = (TCHAR*)alloca(sizeof(TCHAR) * dwNameLenMax);
+ wchar_t* pszName = (wchar_t*)alloca(sizeof(wchar_t) * dwNameLenMax);
if (start == 0)
mir_sntprintf(pszName, dwNameLenMax, L"%s: ", ui->pszUID);
else
@@ -2446,8 +2446,8 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_HISTORY))) {
MODULEINFO *pInfo = pci->MM_FindModule(si->pszModule);
if (pInfo) {
- TCHAR szFile[MAX_PATH], szName[MAX_PATH], szFolder[MAX_PATH];
- _tcsncpy_s(szName, (pInfo->ptszModDispName ? pInfo->ptszModDispName : _A2T(si->pszModule)), _TRUNCATE);
+ wchar_t szFile[MAX_PATH], szName[MAX_PATH], szFolder[MAX_PATH];
+ wcsncpy_s(szName, (pInfo->ptszModDispName ? pInfo->ptszModDispName : _A2T(si->pszModule)), _TRUNCATE);
ValidateFilename(szName);
mir_sntprintf(szFolder, L"%s\\%s", g_Settings.pszLogDir, szName);
diff --git a/src/core/stdclist/src/clcfonts.cpp b/src/core/stdclist/src/clcfonts.cpp
index 79150a51f4..74c09a7278 100644
--- a/src/core/stdclist/src/clcfonts.cpp
+++ b/src/core/stdclist/src/clcfonts.cpp
@@ -28,19 +28,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct
{
- const TCHAR *tszName;
+ const wchar_t *tszName;
int iMask;
}
static clistFontDescr[] =
{
- { LPGENT("Standard contacts"), FIDF_CLASSGENERAL },
- { LPGENT("Online contacts to whom you have a different visibility"), FIDF_CLASSGENERAL },
- { LPGENT("Offline contacts"), FIDF_CLASSGENERAL },
- { LPGENT("Contacts which are 'not on list'"), FIDF_CLASSGENERAL },
- { LPGENT("Groups"), FIDF_CLASSHEADER },
- { LPGENT("Group member counts"), FIDF_CLASSHEADER },
- { LPGENT("Dividers"), FIDF_CLASSSMALL },
- { LPGENT("Offline contacts to whom you have a different visibility"), FIDF_CLASSGENERAL }
+ { LPGENW("Standard contacts"), FIDF_CLASSGENERAL },
+ { LPGENW("Online contacts to whom you have a different visibility"), FIDF_CLASSGENERAL },
+ { LPGENW("Offline contacts"), FIDF_CLASSGENERAL },
+ { LPGENW("Contacts which are 'not on list'"), FIDF_CLASSGENERAL },
+ { LPGENW("Groups"), FIDF_CLASSHEADER },
+ { LPGENW("Group member counts"), FIDF_CLASSHEADER },
+ { LPGENW("Dividers"), FIDF_CLASSSMALL },
+ { LPGENW("Offline contacts to whom you have a different visibility"), FIDF_CLASSGENERAL }
};
static int FS_FontsChanged(WPARAM, LPARAM)
@@ -54,7 +54,7 @@ void RegisterCListFonts()
FontIDT fontid = { sizeof(fontid) };
fontid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWREREGISTER | FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS;
strncpy(fontid.dbSettingsGroup, "CLC", sizeof(fontid.dbSettingsGroup));
- _tcsncpy(fontid.group, LPGENT("Contact list"), _countof(fontid.group));
+ wcsncpy(fontid.group, LPGENW("Contact list"), _countof(fontid.group));
HDC hdc = GetDC(NULL);
for (int i = 0; i < _countof(clistFontDescr); i++) {
@@ -62,7 +62,7 @@ void RegisterCListFonts()
pcli->pfnGetFontSetting(i, &lf, &fontid.deffontsettings.colour);
lf.lfHeight = -MulDiv(lf.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
- _tcsncpy_s(fontid.deffontsettings.szFace, lf.lfFaceName, _TRUNCATE);
+ wcsncpy_s(fontid.deffontsettings.szFace, lf.lfFaceName, _TRUNCATE);
fontid.deffontsettings.charset = lf.lfCharSet;
fontid.deffontsettings.size = (char)lf.lfHeight;
fontid.deffontsettings.style = (lf.lfWeight >= FW_BOLD ? DBFONTF_BOLD : 0) | (lf.lfItalic ? DBFONTF_ITALIC : 0);
@@ -70,7 +70,7 @@ void RegisterCListFonts()
fontid.flags &= ~FIDF_CLASSMASK;
fontid.flags |= clistFontDescr[i].iMask;
- _tcsncpy(fontid.name, clistFontDescr[i].tszName, _countof(fontid.name));
+ wcsncpy(fontid.name, clistFontDescr[i].tszName, _countof(fontid.name));
char idstr[10];
mir_snprintf(idstr, "Font%d", i);
@@ -87,25 +87,25 @@ void RegisterCListFonts()
strncpy(colourid.dbSettingsGroup, "CLC", sizeof(colourid.dbSettingsGroup));
strncpy(colourid.setting, "BkColour", sizeof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Background"), _countof(colourid.name));
- _tcsncpy(colourid.group, LPGENT("Contact list"), _countof(colourid.group));
+ wcsncpy(colourid.name, LPGENW("Background"), _countof(colourid.name));
+ wcsncpy(colourid.group, LPGENW("Contact list"), _countof(colourid.group));
colourid.defcolour = CLCDEFAULT_BKCOLOUR;
ColourRegisterT(&colourid);
strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Selected text"), _countof(colourid.name));
+ wcsncpy(colourid.name, LPGENW("Selected text"), _countof(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_SELTEXTCOLOUR;
ColourRegisterT(&colourid);
strncpy(colourid.setting, "HotTextColour", sizeof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Hottrack text"), _countof(colourid.name));
+ wcsncpy(colourid.name, LPGENW("Hottrack text"), _countof(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_HOTTEXTCOLOUR;
ColourRegisterT(&colourid);
strncpy(colourid.setting, "QuickSearchColour", sizeof(colourid.setting));
- _tcsncpy(colourid.name, LPGENT("Quicksearch text"), _countof(colourid.name));
+ wcsncpy(colourid.name, LPGENW("Quicksearch text"), _countof(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_QUICKSEARCHCOLOUR;
ColourRegisterT(&colourid);
diff --git a/src/core/stdclist/src/clcopts.cpp b/src/core/stdclist/src/clcopts.cpp
index ef529785e9..53d42c65c3 100644
--- a/src/core/stdclist/src/clcopts.cpp
+++ b/src/core/stdclist/src/clcopts.cpp
@@ -54,36 +54,36 @@ static const checkBoxToStyleEx[] =
struct CheckBoxValues_t
{
DWORD style;
- TCHAR* szDescr;
+ wchar_t* szDescr;
};
static const struct CheckBoxValues_t greyoutValues[] =
{
- { GREYF_UNFOCUS, LPGENT("Not focused") },
- { MODEF_OFFLINE, LPGENT("Offline") },
- { PF2_ONLINE, LPGENT("Online") },
- { PF2_SHORTAWAY, LPGENT("Away") },
- { PF2_LONGAWAY, LPGENT("Not available") },
- { PF2_LIGHTDND, LPGENT("Occupied") },
- { PF2_HEAVYDND, LPGENT("Do not disturb")},
- { PF2_FREECHAT, LPGENT("Free for chat") },
- { PF2_INVISIBLE, LPGENT("Invisible") },
- { PF2_OUTTOLUNCH, LPGENT("Out to lunch") },
- { PF2_ONTHEPHONE, LPGENT("On the phone") }
+ { GREYF_UNFOCUS, LPGENW("Not focused") },
+ { MODEF_OFFLINE, LPGENW("Offline") },
+ { PF2_ONLINE, LPGENW("Online") },
+ { PF2_SHORTAWAY, LPGENW("Away") },
+ { PF2_LONGAWAY, LPGENW("Not available") },
+ { PF2_LIGHTDND, LPGENW("Occupied") },
+ { PF2_HEAVYDND, LPGENW("Do not disturb")},
+ { PF2_FREECHAT, LPGENW("Free for chat") },
+ { PF2_INVISIBLE, LPGENW("Invisible") },
+ { PF2_OUTTOLUNCH, LPGENW("Out to lunch") },
+ { PF2_ONTHEPHONE, LPGENW("On the phone") }
};
static const struct CheckBoxValues_t offlineValues[] =
{
- { MODEF_OFFLINE, LPGENT("Offline") },
- { PF2_ONLINE, LPGENT("Online") },
- { PF2_SHORTAWAY, LPGENT("Away") },
- { PF2_LONGAWAY, LPGENT("Not available") },
- { PF2_LIGHTDND, LPGENT("Occupied") },
- { PF2_HEAVYDND, LPGENT("Do not disturb")},
- { PF2_FREECHAT, LPGENT("Free for chat") },
- { PF2_INVISIBLE, LPGENT("Invisible") },
- { PF2_OUTTOLUNCH, LPGENT("Out to lunch") },
- { PF2_ONTHEPHONE, LPGENT("On the phone") }
+ { MODEF_OFFLINE, LPGENW("Offline") },
+ { PF2_ONLINE, LPGENW("Online") },
+ { PF2_SHORTAWAY, LPGENW("Away") },
+ { PF2_LONGAWAY, LPGENW("Not available") },
+ { PF2_LIGHTDND, LPGENW("Occupied") },
+ { PF2_HEAVYDND, LPGENW("Do not disturb")},
+ { PF2_FREECHAT, LPGENW("Free for chat") },
+ { PF2_INVISIBLE, LPGENW("Invisible") },
+ { PF2_OUTTOLUNCH, LPGENW("Out to lunch") },
+ { PF2_ONTHEPHONE, LPGENW("On the phone") }
};
static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *values, int nValues, DWORD style)
@@ -340,7 +340,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
case WM_COMMAND:
if (LOWORD(wParam) == IDC_BROWSE) {
- TCHAR str[MAX_PATH], filter[512];
+ wchar_t str[MAX_PATH], filter[512];
GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str));
OPENFILENAME ofn = { 0 };
@@ -459,7 +459,7 @@ int ClcModernOptInit(WPARAM wParam, LPARAM)
obj.hInstance = g_hInst;
obj.iSection = MODERNOPT_PAGE_SKINS;
obj.iType = MODERNOPT_TYPE_SUBSECTIONPAGE;
- obj.lptzSubsection = LPGENT("Contact list");
+ obj.lptzSubsection = LPGENW("Contact list");
obj.iBoldControls = iBoldControls;
obj.lpzHelpUrl = "http://wiki.miranda-ng.org/";
diff --git a/src/core/stdclist/src/clcpaint.cpp b/src/core/stdclist/src/clcpaint.cpp
index 3360176522..cb679abd0e 100644
--- a/src/core/stdclist/src/clcpaint.cpp
+++ b/src/core/stdclist/src/clcpaint.cpp
@@ -316,7 +316,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
GetTextExtentPoint32(hdcMem, cc->szText, (int)mir_tstrlen(cc->szText), &textSize);
width = textSize.cx;
- TCHAR *ptszGroupCount = NULL;
+ wchar_t *ptszGroupCount = NULL;
if (cc->type == CLCIT_GROUP) {
ptszGroupCount = pcli->pfnGetGroupCountsText(dat, cc);
if (*ptszGroupCount) {
diff --git a/src/core/stdclist/src/cluiopts.cpp b/src/core/stdclist/src/cluiopts.cpp
index 00f163105c..fdd473a268 100644
--- a/src/core/stdclist/src/cluiopts.cpp
+++ b/src/core/stdclist/src/cluiopts.cpp
@@ -170,7 +170,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
db_set_b(NULL, "CLUI", "ClientAreaDrag", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CLIENTDRAG));
db_set_b(NULL, "CList", "Min2Tray", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY));
{
- TCHAR title[256];
+ wchar_t title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
db_set_ts(NULL, "CList", "TitleText", title);
SetWindowText(pcli->hwndContactList, title);
diff --git a/src/core/stdclist/src/contact.cpp b/src/core/stdclist/src/contact.cpp
index 5e4e5634e2..359419faa3 100644
--- a/src/core/stdclist/src/contact.cpp
+++ b/src/core/stdclist/src/contact.cpp
@@ -24,37 +24,37 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-int g_bSortByStatus, g_bSortByProto;
+int g_bSortByStatus, g_bSortByProto;
-const struct
-{
- int status, order;
-}
-static statusModeOrder[] = {
- { ID_STATUS_OFFLINE, 500 },
- { ID_STATUS_ONLINE, 10 },
- { ID_STATUS_AWAY, 200 },
- { ID_STATUS_DND, 110 },
- { ID_STATUS_NA, 450 },
- { ID_STATUS_OCCUPIED, 100 },
- { ID_STATUS_FREECHAT, 0 },
- { ID_STATUS_INVISIBLE, 20 },
- { ID_STATUS_ONTHEPHONE, 150 },
- { ID_STATUS_OUTTOLUNCH, 425 } };
+const struct
+{
+ int status, order;
+}
+static statusModeOrder[] = {
+ { ID_STATUS_OFFLINE, 500 },
+ { ID_STATUS_ONLINE, 10 },
+ { ID_STATUS_AWAY, 200 },
+ { ID_STATUS_DND, 110 },
+ { ID_STATUS_NA, 450 },
+ { ID_STATUS_OCCUPIED, 100 },
+ { ID_STATUS_FREECHAT, 0 },
+ { ID_STATUS_INVISIBLE, 20 },
+ { ID_STATUS_ONTHEPHONE, 150 },
+ { ID_STATUS_OUTTOLUNCH, 425 } };
-int GetStatusModeOrdering(int statusMode)
-{
- int i;
- for (i = 0; i < _countof(statusModeOrder); i++)
- if (statusModeOrder[i].status == statusMode)
- return statusModeOrder[i].order;
- return 1000;
-}
+int GetStatusModeOrdering(int statusMode)
+{
+ int i;
+ for (i = 0; i < _countof(statusModeOrder); i++)
+ if (statusModeOrder[i].status == statusMode)
+ return statusModeOrder[i].order;
+ return 1000;
+}
int CompareContacts(const ClcContact* c1, const ClcContact* c2)
{
MCONTACT a = c1->hContact, b = c2->hContact;
- TCHAR namea[128], *nameb;
+ wchar_t namea[128], *nameb;
int statusa, statusb;
int rc;
@@ -88,7 +88,7 @@ int CompareContacts(const ClcContact* c1, const ClcContact* c2)
}
nameb = pcli->pfnGetContactDisplayName(a, 0);
- _tcsncpy_s(namea, nameb, _TRUNCATE);
+ wcsncpy_s(namea, nameb, _TRUNCATE);
namea[ _countof(namea)-1 ] = 0;
nameb = pcli->pfnGetContactDisplayName(b, 0);
diff --git a/src/core/stdcrypt/src/stdafx.h b/src/core/stdcrypt/src/stdafx.h
index c6d1bd40d8..a0634867ca 100644
--- a/src/core/stdcrypt/src/stdafx.h
+++ b/src/core/stdcrypt/src/stdafx.h
@@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <commctrl.h>
diff --git a/src/core/stdemail/src/stdafx.h b/src/core/stdemail/src/stdafx.h
index a4873dbf7f..fbb040c50b 100644
--- a/src/core/stdemail/src/stdafx.h
+++ b/src/core/stdemail/src/stdafx.h
@@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <commctrl.h>
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp
index a9f28f51d9..1886a29f1a 100644
--- a/src/core/stdfile/src/file.cpp
+++ b/src/core/stdfile/src/file.cpp
@@ -27,16 +27,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
HANDLE hDlgSucceeded, hDlgCanceled;
-TCHAR* PFTS_StringToTchar(int flags, const TCHAR* s);
-int PFTS_CompareWithTchar(PROTOFILETRANSFERSTATUS* ft, const TCHAR* s, TCHAR *r);
+wchar_t* PFTS_StringToTchar(int flags, const wchar_t* s);
+int PFTS_CompareWithTchar(PROTOFILETRANSFERSTATUS* ft, const wchar_t* s, wchar_t *r);
static HGENMENU hSRFileMenuItem;
-TCHAR* GetContactID(MCONTACT hContact)
+wchar_t* GetContactID(MCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
if (db_get_b(hContact, szProto, "ChatRoom", 0) == 1)
- if (TCHAR *theValue = db_get_tsa(hContact, szProto, "ChatRoomID"))
+ if (wchar_t *theValue = db_get_tsa(hContact, szProto, "ChatRoomID"))
return theValue;
return Contact_GetInfo(CNF_UNIQUEID, hContact, szProto);
@@ -60,7 +60,7 @@ static INT_PTR SendSpecificFiles(WPARAM hContact, LPARAM lParam)
while (ppFiles[count] != NULL)
count++;
- fsd.ppFiles = (const TCHAR**)alloca((count + 1) * sizeof(void*));
+ fsd.ppFiles = (const wchar_t**)alloca((count + 1) * sizeof(void*));
for (int i = 0; i < count; i++)
fsd.ppFiles[i] = mir_a2t(ppFiles[i]);
fsd.ppFiles[count] = NULL;
@@ -75,13 +75,13 @@ static INT_PTR SendSpecificFilesT(WPARAM hContact, LPARAM lParam)
{
FileSendData fsd;
fsd.hContact = hContact;
- fsd.ppFiles = (const TCHAR**)lParam;
+ fsd.ppFiles = (const wchar_t**)lParam;
return (INT_PTR)CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_FILESEND), NULL, DlgProcSendFile, (LPARAM)&fsd);
}
static INT_PTR GetReceivedFilesFolder(WPARAM wParam, LPARAM lParam)
{
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
GetContactReceivedFilesDir(wParam, buf, MAX_PATH, TRUE);
char* dir = mir_t2a(buf);
mir_strncpy((char*)lParam, dir, MAX_PATH);
@@ -107,7 +107,7 @@ void PushFileEvent(MCONTACT hContact, MEVENT hdbe, LPARAM lParam)
else {
SkinPlaySound("RecvFile");
- TCHAR szTooltip[256];
+ wchar_t szTooltip[256];
mir_sntprintf(szTooltip, TranslateT("File from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
cle.ptszTooltip = szTooltip;
@@ -133,7 +133,7 @@ static int FileEventAdded(WPARAM wParam, LPARAM lParam)
return 0;
}
-int SRFile_GetRegValue(HKEY hKeyBase, const TCHAR *szSubKey, const TCHAR *szValue, TCHAR *szOutput, int cbOutput)
+int SRFile_GetRegValue(HKEY hKeyBase, const wchar_t *szSubKey, const wchar_t *szValue, wchar_t *szOutput, int cbOutput)
{
HKEY hKey;
DWORD cbOut = cbOutput;
@@ -150,7 +150,7 @@ int SRFile_GetRegValue(HKEY hKeyBase, const TCHAR *szSubKey, const TCHAR *szValu
return 1;
}
-void GetSensiblyFormattedSize(__int64 size, TCHAR *szOut, int cchOut, int unitsOverride, int appendUnits, int *unitsUsed)
+void GetSensiblyFormattedSize(__int64 size, wchar_t *szOut, int cchOut, int unitsOverride, int appendUnits, int *unitsUsed)
{
if (!unitsOverride) {
if (size < 1000) unitsOverride = UNITS_BYTES;
@@ -173,13 +173,13 @@ void GetSensiblyFormattedSize(__int64 size, TCHAR *szOut, int cchOut, int unitsO
}
// Tripple redirection sucks but is needed to nullify the array pointer
-void FreeFilesMatrix(TCHAR ***files)
+void FreeFilesMatrix(wchar_t ***files)
{
if (*files == NULL)
return;
// Free each filename in the pointer array
- TCHAR **pFile = *files;
+ wchar_t **pFile = *files;
while (*pFile != NULL) {
mir_free(*pFile);
*pFile = NULL;
@@ -206,7 +206,7 @@ void CopyProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANSFE
*dest = *src;
if (src->tszCurrentFile) dest->tszCurrentFile = PFTS_StringToTchar(src->flags, src->tszCurrentFile);
if (src->ptszFiles) {
- dest->ptszFiles = (TCHAR**)mir_alloc(sizeof(TCHAR*)*src->totalFiles);
+ dest->ptszFiles = (wchar_t**)mir_alloc(sizeof(wchar_t*)*src->totalFiles);
for (int i = 0; i < src->totalFiles; i++)
dest->ptszFiles[i] = PFTS_StringToTchar(src->flags, src->ptszFiles[i]);
}
@@ -227,7 +227,7 @@ void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANS
}
if (src->ptszFiles) {
if (!dest->ptszFiles)
- dest->ptszFiles = (TCHAR**)mir_calloc(sizeof(TCHAR*)*src->totalFiles);
+ dest->ptszFiles = (wchar_t**)mir_calloc(sizeof(wchar_t*)*src->totalFiles);
for (int i = 0; i < src->totalFiles; i++)
if (!dest->ptszFiles[i] || !src->ptszFiles[i] || PFTS_CompareWithTchar(src, src->ptszFiles[i], dest->ptszFiles[i])) {
mir_free(dest->ptszFiles[i]);
@@ -336,7 +336,7 @@ INT_PTR FtMgrShowCommand(WPARAM, LPARAM)
INT_PTR openContRecDir(WPARAM hContact, LPARAM)
{
- TCHAR szContRecDir[MAX_PATH];
+ wchar_t szContRecDir[MAX_PATH];
GetContactReceivedFilesDir(hContact, szContRecDir, _countof(szContRecDir), TRUE);
ShellExecute(0, L"open", szContRecDir, 0, 0, SW_SHOW);
return 0;
@@ -344,7 +344,7 @@ INT_PTR openContRecDir(WPARAM hContact, LPARAM)
INT_PTR openRecDir(WPARAM, LPARAM)
{
- TCHAR szContRecDir[MAX_PATH];
+ wchar_t szContRecDir[MAX_PATH];
GetReceivedFilesDir(szContRecDir, _countof(szContRecDir));
ShellExecute(0, L"open", szContRecDir, 0, 0, SW_SHOW);
return 0;
@@ -373,9 +373,9 @@ static INT_PTR Proto_RecvFileT(WPARAM, LPARAM lParam)
if (bUnicode) {
pszFiles = (char**)alloca(pre->fileCount * sizeof(char*));
for (int i = 0; i < pre->fileCount; i++)
- pszFiles[i] = Utf8EncodeT(pre->files.t[i]);
+ pszFiles[i] = Utf8EncodeT(pre->files.w[i]);
- szDescr = Utf8EncodeT(pre->descr.t);
+ szDescr = Utf8EncodeT(pre->descr.w);
}
else {
pszFiles = pre->files.a;
diff --git a/src/core/stdfile/src/file.h b/src/core/stdfile/src/file.h
index d279789ddd..a41d169fae 100644
--- a/src/core/stdfile/src/file.h
+++ b/src/core/stdfile/src/file.h
@@ -40,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct FileSendData
{
MCONTACT hContact;
- const TCHAR **ppFiles;
+ const wchar_t **ppFiles;
};
#define BYTESRECVEDHISTORYCOUNT 10 //the number of bytes recved is sampled once a second and the last 10 are used to get the transfer speed
@@ -51,7 +51,7 @@ struct FileDlgData
MCONTACT hContact;
MEVENT hDbEvent;
HANDLE hNotifyEvent;
- TCHAR **files;
+ wchar_t **files;
int send;
int closeIfFileChooseCancelled;
int resumeBehaviour;
@@ -63,8 +63,8 @@ struct FileDlgData
HANDLE hPreshutdownEvent;
DWORD dwTicks;
- TCHAR szSavePath[MAX_PATH];
- TCHAR szMsg[450], szFilenames[1024];
+ wchar_t szSavePath[MAX_PATH];
+ wchar_t szMsg[450], szFilenames[1024];
HICON hIcon, hIconFolder;
};
@@ -75,21 +75,21 @@ struct FileDlgData
#define UNITS_MBPOINT2 4 // 1024*1024 <= size: "%.2f MB"
#define UNITS_GBPOINT3 5 // 1024*1024*1024 <= size: "%.3f GB"
-void GetSensiblyFormattedSize(__int64 size, TCHAR *szOut, int cchOut, int unitsOverride, int appendUnits, int *unitsUsed);
-void FreeFilesMatrix(TCHAR ***files); //loving that triple indirection
+void GetSensiblyFormattedSize(__int64 size, wchar_t *szOut, int cchOut, int unitsOverride, int appendUnits, int *unitsUsed);
+void FreeFilesMatrix(wchar_t ***files); //loving that triple indirection
void FreeProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *fts);
void CopyProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANSFERSTATUS *src);
void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANSFERSTATUS *src);
-int SRFile_GetRegValue(HKEY hKeyBase, const TCHAR *szSubKey, const TCHAR *szValue, TCHAR *szOutput, int cbOutput);
+int SRFile_GetRegValue(HKEY hKeyBase, const wchar_t *szSubKey, const wchar_t *szValue, wchar_t *szOutput, int cbOutput);
//filesenddlg.c
INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
//filerecv.c
INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-void RemoveInvalidFilenameChars(TCHAR *tszString);
-void RemoveInvalidPathChars(TCHAR *tszString);
-void GetContactReceivedFilesDir(MCONTACT hContact, TCHAR *szDir, int cchDir, BOOL substVars);
-void GetReceivedFilesDir(TCHAR *szDir, int cchDir);
-int BrowseForFolder(HWND hwnd, TCHAR *szPath);
+void RemoveInvalidFilenameChars(wchar_t *tszString);
+void RemoveInvalidPathChars(wchar_t *tszString);
+void GetContactReceivedFilesDir(MCONTACT hContact, wchar_t *szDir, int cchDir, BOOL substVars);
+void GetReceivedFilesDir(wchar_t *szDir, int cchDir);
+int BrowseForFolder(HWND hwnd, wchar_t *szPath);
//fileexistsdlg.c
struct TDlgProcFileExistsParam
{
@@ -117,6 +117,6 @@ HWND FtMgr_AddTransfer(FileDlgData *dat);
void FreeFileDlgData(FileDlgData* dat);
-TCHAR *GetContactID(MCONTACT hContact);
+wchar_t *GetContactID(MCONTACT hContact);
extern HANDLE hDlgSucceeded, hDlgCanceled;
diff --git a/src/core/stdfile/src/fileexistsdlg.cpp b/src/core/stdfile/src/fileexistsdlg.cpp
index a5243ee528..d0650fec8d 100644
--- a/src/core/stdfile/src/fileexistsdlg.cpp
+++ b/src/core/stdfile/src/fileexistsdlg.cpp
@@ -47,7 +47,7 @@ static void SetControlToUnixTime(HWND hwndDlg, UINT idCtrl, time_t unixTime)
#ifndef CMF_EXTENDEDVERBS
#define CMF_EXTENDEDVERBS 0x00000100
#endif
-static void DoAnnoyingShellCommand(HWND hwnd, const TCHAR *szFilename, int cmd, POINT *ptCursor)
+static void DoAnnoyingShellCommand(HWND hwnd, const wchar_t *szFilename, int cmd, POINT *ptCursor)
{
IShellFolder *pDesktopFolder;
if (SHGetDesktopFolder(&pDesktopFolder) == NOERROR) {
@@ -132,7 +132,7 @@ static LRESULT CALLBACK IconCtrlSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
struct loadiconsstartinfo {
HWND hwndDlg;
- TCHAR *szFilename;
+ wchar_t *szFilename;
};
void __cdecl LoadIconsAndTypesThread(void* param)
@@ -141,13 +141,13 @@ void __cdecl LoadIconsAndTypesThread(void* param)
SHFILEINFO fileInfo;
if (SHGetFileInfo(info->szFilename, 0, &fileInfo, sizeof(fileInfo), SHGFI_TYPENAME | SHGFI_ICON | SHGFI_LARGEICON)) {
- TCHAR szExtension[64], szIconFile[MAX_PATH];
+ wchar_t szExtension[64], szIconFile[MAX_PATH];
- TCHAR *pszFilename = _tcsrchr(info->szFilename, '\\');
+ wchar_t *pszFilename = wcsrchr(info->szFilename, '\\');
if (pszFilename == NULL)
pszFilename = info->szFilename;
- TCHAR *pszExtension = _tcsrchr(pszFilename, '.');
+ wchar_t *pszExtension = wcsrchr(pszFilename, '.');
if (pszExtension)
mir_tstrncpy(szExtension, pszExtension + 1, _countof(szExtension));
else {
@@ -164,11 +164,11 @@ void __cdecl LoadIconsAndTypesThread(void* param)
if (!mir_tstrcmp(szExtension, L"EXE"))
SRFile_GetRegValue(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons", L"2", szIconFile, _countof(szIconFile));
else {
- TCHAR szTypeName[MAX_PATH];
+ wchar_t szTypeName[MAX_PATH];
if (SRFile_GetRegValue(HKEY_CLASSES_ROOT, pszExtension, NULL, szTypeName, _countof(szTypeName))) {
mir_tstrcat(szTypeName, L"\\DefaultIcon");
if (SRFile_GetRegValue(HKEY_CLASSES_ROOT, szTypeName, NULL, szIconFile, _countof(szIconFile))) {
- if (_tcsstr(szIconFile, L"%1"))
+ if (wcsstr(szIconFile, L"%1"))
SRFile_GetRegValue(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons", L"0", szIconFile, _countof(szIconFile));
else szIconFile[0] = '\0';
}
@@ -176,10 +176,10 @@ void __cdecl LoadIconsAndTypesThread(void* param)
}
if (szIconFile[0]) {
- TCHAR *pszComma = _tcsrchr(szIconFile, ',');
+ wchar_t *pszComma = wcsrchr(szIconFile, ',');
int iconIndex;
if (pszComma) {
- iconIndex = _ttoi(pszComma + 1);
+ iconIndex = _wtoi(pszComma + 1);
*pszComma = '\0';
}
else
@@ -201,7 +201,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- TCHAR szSize[64];
+ wchar_t szSize[64];
struct _stati64 statbuf;
struct TDlgProcFileExistsParam *dat = (struct TDlgProcFileExistsParam *)lParam;
@@ -219,7 +219,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
mir_subclassWindow(GetDlgItem(hwndDlg, IDC_EXISTINGICON), IconCtrlSubclassProc);
HWND hwndFocus = GetDlgItem(hwndDlg, IDC_RESUME);
- if (_tstati64(fts->tszCurrentFile, &statbuf) == 0) {
+ if (_wstat64(fts->tszCurrentFile, &statbuf) == 0) {
SetControlToUnixTime(hwndDlg, IDC_EXISTINGDATE, statbuf.st_mtime);
GetSensiblyFormattedSize(statbuf.st_size, szSize, _countof(szSize), 0, 1, NULL);
SetDlgItemText(hwndDlg, IDC_EXISTINGSIZE, szSize);
@@ -249,9 +249,9 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
case IDC_OPENFOLDER:
{
- TCHAR szFile[MAX_PATH];
+ wchar_t szFile[MAX_PATH];
mir_tstrncpy(szFile, fts->tszCurrentFile, _countof(szFile));
- TCHAR *pszLastBackslash = _tcsrchr(szFile, '\\');
+ wchar_t *pszLastBackslash = wcsrchr(szFile, '\\');
if (pszLastBackslash)
*pszLastBackslash = '\0';
ShellExecute(hwndDlg, NULL, szFile, NULL, NULL, SW_SHOW);
@@ -280,14 +280,14 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
case IDC_SAVEAS:
{
OPENFILENAME ofn = { 0 };
- TCHAR filter[512], *pfilter;
- TCHAR str[MAX_PATH];
+ wchar_t filter[512], *pfilter;
+ wchar_t str[MAX_PATH];
mir_tstrncpy(str, fts->tszCurrentFile, _countof(str));
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwndDlg;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY;
- _tcsncpy(filter, TranslateT("All files"),_countof(filter)-1);
+ wcsncpy(filter, TranslateT("All files"),_countof(filter)-1);
mir_tstrcat(filter, L" (*)");
pfilter = filter + mir_tstrlen(filter) + 1;
mir_tstrcpy(pfilter, L"*");
diff --git a/src/core/stdfile/src/fileopts.cpp b/src/core/stdfile/src/fileopts.cpp
index c608f7311a..30979c1294 100644
--- a/src/core/stdfile/src/fileopts.cpp
+++ b/src/core/stdfile/src/fileopts.cpp
@@ -30,10 +30,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define VSCAN_CA 4
struct virusscannerinfo {
- const TCHAR *szProductName;
- const TCHAR *szExeRegPath;
- const TCHAR *szExeRegValue;
- const TCHAR *szCommandLine;
+ const wchar_t *szProductName;
+ const wchar_t *szExeRegPath;
+ const wchar_t *szExeRegValue;
+ const wchar_t *szCommandLine;
} virusScanners[] = {
{L"Network Associates/McAfee VirusScan", L"SOFTWARE\\McAfee\\VirusScan", L"Scan32EXE", L"\"%s\" %%f /nosplash /comp /autoscan /autoexit /noboot"},
{L"Dr Solomon's VirusScan (Network Associates)", L"SOFTWARE\\Network Associates\\TVD\\VirusScan\\AVConsol\\General", L"szScannerExe", L"\"%s\" %%f /uinone /noboot /comp /prompt /autoexit"},
@@ -62,7 +62,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
{
SHAutoComplete(GetDlgItem(hwndDlg, IDC_FILEDIR), SHACF_FILESYS_DIRS);
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
GetContactReceivedFilesDir(NULL, str, _countof(str), FALSE);
SetDlgItemText(hwndDlg, IDC_FILEDIR, str);
@@ -78,7 +78,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
CheckDlgButton(hwndDlg, IDC_WARNBEFOREOPENING, db_get_b(NULL, "SRFile", "WarnBeforeOpening", 1) ? BST_CHECKED : BST_UNCHECKED);
for (int i = 0; i < _countof(virusScanners); i++) {
- TCHAR szScanExe[MAX_PATH];
+ wchar_t szScanExe[MAX_PATH];
if (SRFile_GetRegValue(HKEY_LOCAL_MACHINE, virusScanners[i].szExeRegPath, virusScanners[i].szExeRegValue, szScanExe, _countof(szScanExe))) {
int iItem = SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_ADDSTRING, 0, (LPARAM)virusScanners[i].szProductName);
SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_SETITEMDATA, iItem, i);
@@ -121,8 +121,8 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
break;
case M_SCANCMDLINESELCHANGE:
{
- TCHAR str[512];
- TCHAR szScanExe[MAX_PATH];
+ wchar_t str[512];
+ wchar_t szScanExe[MAX_PATH];
int iScanner = SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_GETCURSEL, 0, 0), 0);
if (iScanner >= _countof(virusScanners) || iScanner < 0) break;
str[0] = '\0';
@@ -140,7 +140,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
case IDC_FILEDIRBROWSE:
{
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_FILEDIR, str, _countof(str));
if (BrowseForFolder(hwndDlg, str))
SetDlgItemText(hwndDlg, IDC_FILEDIR, str);
@@ -162,7 +162,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
break;
case IDC_SCANCMDLINEBROWSE:
- TCHAR str[MAX_PATH + 2];
+ wchar_t str[MAX_PATH + 2];
GetDlgItemText(hwndDlg, IDC_SCANCMDLINE, str, _countof(str));
CMString tszFilter;
@@ -177,19 +177,19 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
ofn.lpstrFile = str;
ofn.nMaxFile = _countof(str) - 2;
if (str[0] == '"') {
- TCHAR *pszQuote = _tcschr(str + 1, '"');
+ wchar_t *pszQuote = wcschr(str + 1, '"');
if (pszQuote)
*pszQuote = 0;
- memmove(str, str + 1, (mir_tstrlen(str) * sizeof(TCHAR)));
+ memmove(str, str + 1, (mir_tstrlen(str) * sizeof(wchar_t)));
}
else {
- TCHAR *pszSpace = _tcschr(str, ' ');
+ wchar_t *pszSpace = wcschr(str, ' ');
if (pszSpace) *pszSpace = 0;
}
ofn.nMaxFileTitle = MAX_PATH;
if (!GetOpenFileName(&ofn)) break;
- if (_tcschr(str, ' ') != NULL) {
- memmove(str + 1, str, ((_countof(str) - 2) * sizeof(TCHAR)));
+ if (wcschr(str, ' ') != NULL) {
+ memmove(str + 1, str, ((_countof(str) - 2) * sizeof(wchar_t)));
str[0] = '"';
mir_tstrcat(str, L"\"");
}
@@ -202,7 +202,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- TCHAR str[512];
+ wchar_t str[512];
GetDlgItemText(hwndDlg, IDC_FILEDIR, str, _countof(str));
RemoveInvalidPathChars(str);
db_set_ts(NULL, "SRFile", "RecvFilesDirAdv", str);
diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp
index 3c75d282c0..6df563406d 100644
--- a/src/core/stdfile/src/filerecvdlg.cpp
+++ b/src/core/stdfile/src/filerecvdlg.cpp
@@ -33,14 +33,14 @@ static BOOL CALLBACK ClipSiblingsChildEnumProc(HWND hwnd, LPARAM)
return TRUE;
}
-static void GetLowestExistingDirName(const TCHAR *szTestDir, TCHAR *szExistingDir, int cchExistingDir)
+static void GetLowestExistingDirName(const wchar_t *szTestDir, wchar_t *szExistingDir, int cchExistingDir)
{
DWORD dwAttributes;
- TCHAR *pszLastBackslash;
+ wchar_t *pszLastBackslash;
mir_tstrncpy(szExistingDir, szTestDir, cchExistingDir);
while ((dwAttributes = GetFileAttributes(szExistingDir)) != INVALID_FILE_ATTRIBUTES && !(dwAttributes&FILE_ATTRIBUTE_DIRECTORY)) {
- pszLastBackslash = _tcsrchr(szExistingDir, '\\');
+ pszLastBackslash = wcsrchr(szExistingDir, '\\');
if (pszLastBackslash == NULL) { *szExistingDir = '\0'; break; }
*pszLastBackslash = '\0';
}
@@ -48,27 +48,27 @@ static void GetLowestExistingDirName(const TCHAR *szTestDir, TCHAR *szExistingDi
GetCurrentDirectory(cchExistingDir, szExistingDir);
}
-static const TCHAR InvalidFilenameChars[] = L"\\/:*?\"<>|";
-void RemoveInvalidFilenameChars(TCHAR *tszString)
+static const wchar_t InvalidFilenameChars[] = L"\\/:*?\"<>|";
+void RemoveInvalidFilenameChars(wchar_t *tszString)
{
size_t i;
if (tszString) {
- for (i = _tcscspn(tszString, InvalidFilenameChars); tszString[i]; i+=_tcscspn(tszString+i+1, InvalidFilenameChars)+1)
- tszString[i] = _T('_');
+ for (i = wcscspn(tszString, InvalidFilenameChars); tszString[i]; i+=wcscspn(tszString+i+1, InvalidFilenameChars)+1)
+ tszString[i] = '_';
}
}
-static const TCHAR InvalidPathChars[] = L"*?\"<>|"; // "\/:" are excluded as they are allowed in file path
-void RemoveInvalidPathChars(TCHAR *tszString)
+static const wchar_t InvalidPathChars[] = L"*?\"<>|"; // "\/:" are excluded as they are allowed in file path
+void RemoveInvalidPathChars(wchar_t *tszString)
{
if (tszString)
- for (size_t i = _tcscspn(tszString, InvalidPathChars); tszString[i]; i += _tcscspn(tszString + i + 1, InvalidPathChars) + 1)
- tszString[i] = _T('_');
+ for (size_t i = wcscspn(tszString, InvalidPathChars); tszString[i]; i += wcscspn(tszString + i + 1, InvalidPathChars) + 1)
+ tszString[i] = '_';
}
static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData)
{
- TCHAR szDir[MAX_PATH];
+ wchar_t szDir[MAX_PATH];
switch (uMsg) {
case BFFM_INITIALIZED:
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, pData);
@@ -81,7 +81,7 @@ static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM p
return 0;
}
-int BrowseForFolder(HWND hwnd, TCHAR *szPath)
+int BrowseForFolder(HWND hwnd, wchar_t *szPath)
{
BROWSEINFO bi = { 0 };
bi.hwndOwner = hwnd;
@@ -108,11 +108,11 @@ static REPLACEVARSARRAY sttVarsToReplace[] =
{ NULL, NULL }
};
-static void patchDir(TCHAR *str, size_t strSize)
+static void patchDir(wchar_t *str, size_t strSize)
{
- TCHAR *result = Utils_ReplaceVarsT(str, 0, sttVarsToReplace);
+ wchar_t *result = Utils_ReplaceVarsT(str, 0, sttVarsToReplace);
if (result) {
- _tcsncpy(str, result, strSize);
+ wcsncpy(str, result, strSize);
mir_free(result);
}
@@ -121,13 +121,13 @@ static void patchDir(TCHAR *str, size_t strSize)
mir_tstrcpy(str + len, L"\\");
}
-void GetContactReceivedFilesDir(MCONTACT hContact, TCHAR *szDir, int cchDir, BOOL patchVars)
+void GetContactReceivedFilesDir(MCONTACT hContact, wchar_t *szDir, int cchDir, BOOL patchVars)
{
- TCHAR tszTemp[MAX_PATH];
+ wchar_t tszTemp[MAX_PATH];
ptrT tszRecvPath(db_get_tsa(NULL, "SRFile", "RecvFilesDirAdv"));
if (tszRecvPath)
- _tcsncpy_s(tszTemp, tszRecvPath, _TRUNCATE);
+ wcsncpy_s(tszTemp, tszRecvPath, _TRUNCATE);
else
mir_sntprintf(tszTemp, L"%%mydocuments%%\\%s\\%%userid%%", TranslateT("My received files"));
@@ -135,23 +135,23 @@ void GetContactReceivedFilesDir(MCONTACT hContact, TCHAR *szDir, int cchDir, BOO
hContact = db_mc_tryMeta(hContact);
REPLACEVARSARRAY rvaVarsToReplace[4];
- rvaVarsToReplace[0].key.t = L"nick";
- rvaVarsToReplace[0].value.t = mir_tstrdup((TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0));
- rvaVarsToReplace[1].key.t = L"userid";
- rvaVarsToReplace[1].value.t = GetContactID(hContact);
- rvaVarsToReplace[2].key.t = L"proto";
- rvaVarsToReplace[2].value.t = mir_a2t(GetContactProto(hContact));
- rvaVarsToReplace[3].key.t = NULL;
- rvaVarsToReplace[3].value.t = NULL;
+ rvaVarsToReplace[0].key.w = L"nick";
+ rvaVarsToReplace[0].value.w = mir_tstrdup((wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0));
+ rvaVarsToReplace[1].key.w = L"userid";
+ rvaVarsToReplace[1].value.w = GetContactID(hContact);
+ rvaVarsToReplace[2].key.w = L"proto";
+ rvaVarsToReplace[2].value.w = mir_a2t(GetContactProto(hContact));
+ rvaVarsToReplace[3].key.w = NULL;
+ rvaVarsToReplace[3].value.w = NULL;
for (int i = 0; i < (_countof(rvaVarsToReplace) - 1); i++)
- RemoveInvalidFilenameChars(rvaVarsToReplace[i].value.t);
+ RemoveInvalidFilenameChars(rvaVarsToReplace[i].value.w);
- TCHAR *result = Utils_ReplaceVarsT(tszTemp, hContact, rvaVarsToReplace);
+ wchar_t *result = Utils_ReplaceVarsT(tszTemp, hContact, rvaVarsToReplace);
if (result) {
- _tcsncpy(tszTemp, result, _countof(tszTemp));
+ wcsncpy(tszTemp, result, _countof(tszTemp));
mir_free(result);
for (int i = 0; i < (_countof(rvaVarsToReplace) - 1); i++)
- mir_free(rvaVarsToReplace[i].value.t);
+ mir_free(rvaVarsToReplace[i].value.w);
}
}
@@ -161,13 +161,13 @@ void GetContactReceivedFilesDir(MCONTACT hContact, TCHAR *szDir, int cchDir, BOO
mir_tstrncpy(szDir, tszTemp, cchDir);
}
-void GetReceivedFilesDir(TCHAR *szDir, int cchDir)
+void GetReceivedFilesDir(wchar_t *szDir, int cchDir)
{
- TCHAR tszTemp[MAX_PATH];
+ wchar_t tszTemp[MAX_PATH];
ptrT tszRecvPath(db_get_tsa(NULL, "SRFile", "RecvFilesDirAdv"));
if (tszRecvPath)
- _tcsncpy_s(tszTemp, tszRecvPath, _TRUNCATE);
+ wcsncpy_s(tszTemp, tszRecvPath, _TRUNCATE);
else
mir_sntprintf(tszTemp, L"%%mydocuments%%\\%s\\%%userid%%", TranslateT("My received files"));
@@ -184,7 +184,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- TCHAR szPath[450];
+ wchar_t szPath[450];
CLISTEVENT* cle = (CLISTEVENT*)lParam;
dat = (FileDlgData*)mir_calloc(sizeof(FileDlgData));
@@ -203,7 +203,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
Button_SetIcon_IcoLib(hwndDlg, IDC_HISTORY, SKINICON_OTHER_HISTORY, LPGEN("View user's history"));
Button_SetIcon_IcoLib(hwndDlg, IDC_USERMENU, SKINICON_OTHER_DOWNARROW, LPGEN("User menu"));
- TCHAR *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
+ wchar_t *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
SetDlgItemText(hwndDlg, IDC_FROM, contactName);
GetContactReceivedFilesDir(dat->hContact, szPath, _countof(szPath), TRUE);
SetDlgItemText(hwndDlg, IDC_FILEDIR, szPath);
@@ -243,7 +243,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
}
else DestroyWindow(hwndDlg);
- TCHAR datetimestr[64];
+ wchar_t datetimestr[64];
TimeZone_PrintTimeStamp(NULL, dbei.timestamp, L"t d", datetimestr, _countof(datetimestr), 0);
SetDlgItemText(hwndDlg, IDC_DATE, datetimestr);
@@ -292,7 +292,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
switch (LOWORD(wParam)) {
case IDC_FILEDIRBROWSE:
{
- TCHAR szDirName[MAX_PATH], szExistingDirName[MAX_PATH];
+ wchar_t szDirName[MAX_PATH], szExistingDirName[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_FILEDIR, szDirName, _countof(szDirName));
GetLowestExistingDirName(szDirName, szExistingDirName, _countof(szExistingDirName));
@@ -303,11 +303,11 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case IDOK:
{ //most recently used directories
- TCHAR szRecvDir[MAX_PATH], szDefaultRecvDir[MAX_PATH];
+ wchar_t szRecvDir[MAX_PATH], szDefaultRecvDir[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_FILEDIR, szRecvDir, _countof(szRecvDir));
RemoveInvalidPathChars(szRecvDir);
GetContactReceivedFilesDir(NULL, szDefaultRecvDir, _countof(szDefaultRecvDir), TRUE);
- if (_tcsnicmp(szRecvDir, szDefaultRecvDir, mir_tstrlen(szDefaultRecvDir))) {
+ if (wcsnicmp(szRecvDir, szDefaultRecvDir, mir_tstrlen(szDefaultRecvDir))) {
char idstr[32];
int i;
DBVARIANT dbv;
diff --git a/src/core/stdfile/src/filesenddlg.cpp b/src/core/stdfile/src/filesenddlg.cpp
index 318dcab932..7d1c780807 100644
--- a/src/core/stdfile/src/filesenddlg.cpp
+++ b/src/core/stdfile/src/filesenddlg.cpp
@@ -32,10 +32,10 @@ static void SetFileListAndSizeControls(HWND hwndDlg, FileDlgData *dat)
int fileCount = 0, dirCount = 0, i;
__int64 totalSize = 0;
struct _stati64 statbuf;
- TCHAR str[64];
+ wchar_t str[64];
for (i = 0; dat->files[i]; i++) {
- if (_tstati64(dat->files[i], &statbuf) == 0) {
+ if (_wstat64(dat->files[i], &statbuf) == 0) {
if (statbuf.st_mode & _S_IFDIR)
dirCount++;
else
@@ -47,7 +47,7 @@ static void SetFileListAndSizeControls(HWND hwndDlg, FileDlgData *dat)
GetSensiblyFormattedSize(totalSize, str, _countof(str), 0, 1, NULL);
SetDlgItemText(hwndDlg, IDC_TOTALSIZE, str);
if (i > 1) {
- TCHAR szFormat[32];
+ wchar_t szFormat[32];
if (fileCount && dirCount) {
mir_sntprintf(szFormat, L"%s, %s", TranslateTS(fileCount == 1 ? L"%d file" : L"%d files"), TranslateTS(dirCount == 1 ? L"%d directory" : L"%d directories"));
mir_sntprintf(str, szFormat, fileCount, dirCount);
@@ -67,7 +67,7 @@ static void SetFileListAndSizeControls(HWND hwndDlg, FileDlgData *dat)
EnableWindow(GetDlgItem(hwndDlg, IDOK), fileCount || dirCount);
}
-static void FilenameToFileList(HWND hwndDlg, FileDlgData* dat, const TCHAR *buf)
+static void FilenameToFileList(HWND hwndDlg, FileDlgData* dat, const wchar_t *buf)
{
// Make sure that the file matrix is empty (the user may select files several times)
FreeFilesMatrix(&dat->files);
@@ -79,7 +79,7 @@ static void FilenameToFileList(HWND hwndDlg, FileDlgData* dat, const TCHAR *buf)
// Check if the selection is a directory or a file
if (GetFileAttributes(buf) & FILE_ATTRIBUTE_DIRECTORY) {
- const TCHAR *pBuf;
+ const wchar_t *pBuf;
int nNumberOfFiles = 0;
int nTemp;
@@ -97,7 +97,7 @@ static void FilenameToFileList(HWND hwndDlg, FileDlgData* dat, const TCHAR *buf)
}
// Allocate memory for a pointer array
- if ((dat->files = (TCHAR**)mir_alloc((nNumberOfFiles + 1) * sizeof(TCHAR*))) == NULL)
+ if ((dat->files = (wchar_t**)mir_alloc((nNumberOfFiles + 1) * sizeof(wchar_t*))) == NULL)
return;
// Fill the array
@@ -106,10 +106,10 @@ static void FilenameToFileList(HWND hwndDlg, FileDlgData* dat, const TCHAR *buf)
while (*pBuf) {
// Allocate space for path+filename
size_t cbFileNameLen = mir_tstrlen(pBuf);
- dat->files[nTemp] = (TCHAR*)mir_alloc(sizeof(TCHAR)*(fileOffset + cbFileNameLen + 1));
+ dat->files[nTemp] = (wchar_t*)mir_alloc(sizeof(wchar_t)*(fileOffset + cbFileNameLen + 1));
// Add path to filename and copy into array
- memcpy(dat->files[nTemp], buf, (fileOffset - 1)*sizeof(TCHAR));
+ memcpy(dat->files[nTemp], buf, (fileOffset - 1)*sizeof(wchar_t));
dat->files[nTemp][fileOffset - 1] = '\\';
mir_tstrcpy(dat->files[nTemp] + fileOffset - (buf[fileOffset - 2] == '\\' ? 1 : 0), pBuf);
@@ -122,7 +122,7 @@ static void FilenameToFileList(HWND hwndDlg, FileDlgData* dat, const TCHAR *buf)
}
// ...the selection is a single file
else {
- if ((dat->files = (TCHAR **)mir_alloc(2 * sizeof(TCHAR*))) == NULL) // Leaks when aborted
+ if ((dat->files = (wchar_t **)mir_alloc(2 * sizeof(wchar_t*))) == NULL) // Leaks when aborted
return;
dat->files[0] = mir_tstrdup(buf);
@@ -139,16 +139,16 @@ void __cdecl ChooseFilesThread(void* param)
HWND hwndDlg = (HWND)param;
FileDlgData *dat = (FileDlgData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- TCHAR *buf = (TCHAR*)mir_alloc(sizeof(TCHAR) * 32767);
+ wchar_t *buf = (wchar_t*)mir_alloc(sizeof(wchar_t) * 32767);
if (buf == NULL) {
PostMessage(hwndDlg, M_FILECHOOSEDONE, 0, NULL);
return;
}
- TCHAR filter[128];
+ wchar_t filter[128];
mir_tstrcpy(filter, TranslateT("All files"));
mir_tstrcat(filter, L" (*)");
- TCHAR *pfilter = filter + mir_tstrlen(filter) + 1;
+ wchar_t *pfilter = filter + mir_tstrlen(filter) + 1;
mir_tstrcpy(pfilter, L"*");
pfilter = filter + mir_tstrlen(filter) + 1;
pfilter[0] = '\0';
@@ -228,14 +228,14 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
if (fsd->ppFiles != NULL && fsd->ppFiles[0] != NULL) {
int totalCount, i;
for (totalCount = 0; fsd->ppFiles[totalCount]; totalCount++);
- dat->files = (TCHAR**)mir_alloc(sizeof(TCHAR*)*(totalCount + 1)); // Leaks
+ dat->files = (wchar_t**)mir_alloc(sizeof(wchar_t*)*(totalCount + 1)); // Leaks
for (i = 0; i < totalCount; i++)
dat->files[i] = mir_tstrdup(fsd->ppFiles[i]);
dat->files[totalCount] = NULL;
SetFileListAndSizeControls(hwndDlg, dat);
}
- TCHAR *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
+ wchar_t *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
SetDlgItemText(hwndDlg, IDC_TO, contactName);
ptrT id(Contact_GetInfo(CNF_UNIQUEID, dat->hContact));
@@ -270,8 +270,8 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case M_FILECHOOSEDONE:
if (lParam != 0) {
- FilenameToFileList(hwndDlg, dat, (TCHAR*)lParam);
- mir_free((TCHAR*)lParam);
+ FilenameToFileList(hwndDlg, dat, (wchar_t*)lParam);
+ mir_free((wchar_t*)lParam);
dat->closeIfFileChooseCancelled = 0;
}
else if (dat->closeIfFileChooseCancelled)
diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp
index 036e75068e..7be203e9bb 100644
--- a/src/core/stdfile/src/filexferdlg.cpp
+++ b/src/core/stdfile/src/filexferdlg.cpp
@@ -37,12 +37,12 @@ static int CheckVirusScanned(HWND hwnd, FileDlgData *dat, int i)
#define M_VIRUSSCANDONE (WM_USER+100)
struct virusscanthreadstartinfo {
- TCHAR *szFile;
+ wchar_t *szFile;
int returnCode;
HWND hwndReply;
};
-TCHAR* PFTS_StringToTchar(int flags, const TCHAR* s)
+wchar_t* PFTS_StringToTchar(int flags, const wchar_t* s)
{
if (flags & PFTS_UTF)
return Utf8DecodeW((char*)s);
@@ -51,10 +51,10 @@ TCHAR* PFTS_StringToTchar(int flags, const TCHAR* s)
return mir_a2t((char*)s);
}
-int PFTS_CompareWithTchar(PROTOFILETRANSFERSTATUS *ft, const TCHAR *s, TCHAR *r)
+int PFTS_CompareWithTchar(PROTOFILETRANSFERSTATUS *ft, const wchar_t *s, wchar_t *r)
{
if (ft->flags & PFTS_UTF) {
- TCHAR *ts = Utf8DecodeW((char*)s);
+ wchar_t *ts = Utf8DecodeW((char*)s);
int res = mir_tstrcmp(ts, r);
mir_free(ts);
return res;
@@ -62,7 +62,7 @@ int PFTS_CompareWithTchar(PROTOFILETRANSFERSTATUS *ft, const TCHAR *s, TCHAR *r)
if (ft->flags & PFTS_UNICODE)
return mir_tstrcmp(s, r);
- TCHAR *ts = mir_a2t((char*)s);
+ wchar_t *ts = mir_a2t((char*)s);
int res = mir_tstrcmp(ts, r);
mir_free(ts);
return res;
@@ -99,15 +99,15 @@ static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info)
if (dbv.ptszVal[0]) {
STARTUPINFO si = { 0 };
si.cb = sizeof(si);
- TCHAR *pszReplace = _tcsstr(dbv.ptszVal, L"%f");
- TCHAR szCmdLine[768];
+ wchar_t *pszReplace = wcsstr(dbv.ptszVal, L"%f");
+ wchar_t szCmdLine[768];
if (pszReplace) {
if (info->szFile[mir_tstrlen(info->szFile) - 1] == '\\')
info->szFile[mir_tstrlen(info->szFile) - 1] = '\0';
*pszReplace = 0;
mir_sntprintf(szCmdLine, L"%s\"%s\"%s", dbv.ptszVal, info->szFile, pszReplace + 2);
} else
- _tcsncpy_s(szCmdLine, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(szCmdLine, dbv.ptszVal, _TRUNCATE);
PROCESS_INFORMATION pi;
if (CreateProcess(NULL, szCmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
@@ -125,13 +125,13 @@ static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info)
static void SetFilenameControls(HWND hwndDlg, FileDlgData *dat, PROTOFILETRANSFERSTATUS *fts)
{
- TCHAR msg[MAX_PATH];
- TCHAR *fnbuf = NULL, *fn = NULL;
+ wchar_t msg[MAX_PATH];
+ wchar_t *fnbuf = NULL, *fn = NULL;
SHFILEINFO shfi = { 0 };
if (fts->tszCurrentFile) {
fnbuf = mir_tstrdup(fts->tszCurrentFile);
- if ((fn = _tcsrchr(fnbuf, '\\')) == NULL)
+ if ((fn = wcsrchr(fnbuf, '\\')) == NULL)
fn = fnbuf;
else fn++;
}
@@ -166,7 +166,7 @@ static void SetFilenameControls(HWND hwndDlg, FileDlgData *dat, PROTOFILETRANSFE
}
enum { FTS_TEXT, FTS_PROGRESS, FTS_OPEN };
-static void SetFtStatus(HWND hwndDlg, TCHAR *text, int mode)
+static void SetFtStatus(HWND hwndDlg, wchar_t *text, int mode)
{
SetDlgItemText(hwndDlg, IDC_STATUS, TranslateTS(text));
SetDlgItemText(hwndDlg, IDC_TRANSFERCOMPLETED, TranslateTS(text));
@@ -237,7 +237,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
if (db_mc_isMeta(dat->hContact))
dat->hContact = db_mc_getMostOnline(dat->hContact);
dat->fs = (HANDLE)ProtoChainSend(dat->hContact, PSS_FILE, (WPARAM)dat->szMsg, (LPARAM)dat->files);
- SetFtStatus(hwndDlg, LPGENT("Request sent, waiting for acceptance..."), FTS_TEXT);
+ SetFtStatus(hwndDlg, LPGENW("Request sent, waiting for acceptance..."), FTS_TEXT);
SetOpenFileButtonStyle(GetDlgItem(hwndDlg, IDC_OPENFILE), 1);
dat->waitingForAcceptance = 1;
// hide "open" button since it may cause potential access violations...
@@ -250,12 +250,12 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
dat->transferStatus.tszWorkingDir = mir_tstrdup(dat->szSavePath);
if (db_get_b(dat->hContact, "CList", "NotOnList", 0)) dat->resumeBehaviour = FILERESUME_ASK;
else dat->resumeBehaviour = db_get_b(NULL, "SRFile", "IfExists", FILERESUME_ASK);
- SetFtStatus(hwndDlg, LPGENT("Waiting for connection..."), FTS_TEXT);
+ SetFtStatus(hwndDlg, LPGENW("Waiting for connection..."), FTS_TEXT);
}
/* check we actually got an fs handle back from the protocol */
if (!dat->fs) {
- SetFtStatus(hwndDlg, LPGENT("Unable to initiate transfer."), FTS_TEXT);
+ SetFtStatus(hwndDlg, LPGENW("Unable to initiate transfer."), FTS_TEXT);
dat->waitingForAcceptance = 0;
}
{
@@ -301,7 +301,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
dat->bytesRecvedHistorySize++;
{
- TCHAR szSpeed[32], szTime[32], szDisplay[96];
+ wchar_t szSpeed[32], szTime[32], szDisplay[96];
SYSTEMTIME st;
ULARGE_INTEGER li;
FILETIME ft;
@@ -372,10 +372,10 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case IDC_OPENFOLDER:
{
- TCHAR *path = dat->transferStatus.tszWorkingDir;
+ wchar_t *path = dat->transferStatus.tszWorkingDir;
if (!path || !path[0]) {
- path = NEWTSTR_ALLOCA(dat->transferStatus.tszCurrentFile);
- TCHAR *p = _tcsrchr(path, '\\'); if (p) *p = 0;
+ path = NEWWSTR_ALLOCA(dat->transferStatus.tszCurrentFile);
+ wchar_t *p = wcsrchr(path, '\\'); if (p) *p = 0;
}
if (path) ShellExecute(NULL, L"open", path, NULL, NULL, SW_SHOW);
@@ -383,7 +383,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
break;
case IDC_OPENFILE:
- TCHAR **files;
+ wchar_t **files;
if (dat->send) {
if (dat->files == NULL)
files = dat->transferStatus.ptszFiles;
@@ -398,7 +398,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
if (files && *files) {
int limit;
- TCHAR *pszFilename, *pszNewFileName;
+ wchar_t *pszFilename, *pszNewFileName;
if (dat->send)
limit = dat->transferStatus.totalFiles;
@@ -407,7 +407,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
// Loop over all transfered files and add them to the menu
for (int i = 0; i < limit; i++) {
- pszFilename = _tcsrchr(files[i], '\\');
+ pszFilename = wcsrchr(files[i], '\\');
if (pszFilename == NULL)
pszFilename = files[i];
else
@@ -416,8 +416,8 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
if (pszFilename) {
size_t cbFileNameLen = mir_tstrlen(pszFilename);
- pszNewFileName = (TCHAR*)mir_alloc(cbFileNameLen * 2 * sizeof(TCHAR));
- TCHAR *p = pszNewFileName;
+ pszNewFileName = (wchar_t*)mir_alloc(cbFileNameLen * 2 * sizeof(wchar_t));
+ wchar_t *p = pszNewFileName;
for (size_t pszlen = 0; pszlen < cbFileNameLen; pszlen++) {
*p++ = pszFilename[pszlen];
if (pszFilename[pszlen] == '&')
@@ -438,10 +438,10 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
DestroyMenu(hMenu);
if (ret == 1) {
- TCHAR *path = dat->transferStatus.tszWorkingDir;
+ wchar_t *path = dat->transferStatus.tszWorkingDir;
if (!path || !path[0]) {
- path = NEWTSTR_ALLOCA(dat->transferStatus.tszCurrentFile);
- TCHAR *p = _tcsrchr(path, '\\');
+ path = NEWWSTR_ALLOCA(dat->transferStatus.tszCurrentFile);
+ wchar_t *p = wcsrchr(path, '\\');
if (p)
*p = 0;
}
@@ -457,7 +457,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
EnableWindow(hwndDlg, TRUE);
{
PROTOFILERESUME *pfr = (PROTOFILERESUME*)lParam;
- TCHAR *szOriginalFilename = (TCHAR*)wParam;
+ wchar_t *szOriginalFilename = (wchar_t*)wParam;
char *szProto = GetContactProto(dat->hContact);
switch (pfr->action) {
@@ -476,15 +476,15 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case FILERESUME_RENAMEALL:
pfr->action = FILERESUME_RENAME;
{
- TCHAR *pszExtension, *pszFilename;
- if ((pszFilename = _tcsrchr(szOriginalFilename, '\\')) == NULL) pszFilename = szOriginalFilename;
- if ((pszExtension = _tcsrchr(pszFilename + 1, '.')) == NULL) pszExtension = pszFilename + mir_tstrlen(pszFilename);
- if (pfr->szFilename) mir_free((TCHAR*)pfr->szFilename);
+ wchar_t *pszExtension, *pszFilename;
+ if ((pszFilename = wcsrchr(szOriginalFilename, '\\')) == NULL) pszFilename = szOriginalFilename;
+ if ((pszExtension = wcsrchr(pszFilename + 1, '.')) == NULL) pszExtension = pszFilename + mir_tstrlen(pszFilename);
+ if (pfr->szFilename) mir_free((wchar_t*)pfr->szFilename);
size_t size = (pszExtension - szOriginalFilename) + 21 + mir_tstrlen(pszExtension);
- pfr->szFilename = (TCHAR*)mir_alloc(sizeof(TCHAR)*size);
+ pfr->szFilename = (wchar_t*)mir_alloc(sizeof(wchar_t)*size);
for (int i = 1;; i++) {
- mir_sntprintf((TCHAR*)pfr->szFilename, size, L"%.*s (%u)%s", pszExtension - szOriginalFilename, szOriginalFilename, i, pszExtension);
- if (_taccess(pfr->szFilename, 0) != 0)
+ mir_sntprintf((wchar_t*)pfr->szFilename, size, L"%.*s (%u)%s", pszExtension - szOriginalFilename, szOriginalFilename, i, pszExtension);
+ if (_waccess(pfr->szFilename, 0) != 0)
break;
}
}
@@ -510,14 +510,14 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
}
switch (ack->result) {
- case ACKRESULT_SENTREQUEST: SetFtStatus(hwndDlg, LPGENT("Decision sent"), FTS_TEXT); break;
- case ACKRESULT_CONNECTING: SetFtStatus(hwndDlg, LPGENT("Connecting..."), FTS_TEXT); break;
- case ACKRESULT_CONNECTPROXY: SetFtStatus(hwndDlg, LPGENT("Connecting to proxy..."), FTS_TEXT); break;
- case ACKRESULT_CONNECTED: SetFtStatus(hwndDlg, LPGENT("Connected"), FTS_TEXT); break;
- case ACKRESULT_LISTENING: SetFtStatus(hwndDlg, LPGENT("Waiting for connection..."), FTS_TEXT); break;
- case ACKRESULT_INITIALISING: SetFtStatus(hwndDlg, LPGENT("Initializing..."), FTS_TEXT); break;
+ case ACKRESULT_SENTREQUEST: SetFtStatus(hwndDlg, LPGENW("Decision sent"), FTS_TEXT); break;
+ case ACKRESULT_CONNECTING: SetFtStatus(hwndDlg, LPGENW("Connecting..."), FTS_TEXT); break;
+ case ACKRESULT_CONNECTPROXY: SetFtStatus(hwndDlg, LPGENW("Connecting to proxy..."), FTS_TEXT); break;
+ case ACKRESULT_CONNECTED: SetFtStatus(hwndDlg, LPGENW("Connected"), FTS_TEXT); break;
+ case ACKRESULT_LISTENING: SetFtStatus(hwndDlg, LPGENW("Waiting for connection..."), FTS_TEXT); break;
+ case ACKRESULT_INITIALISING: SetFtStatus(hwndDlg, LPGENW("Initializing..."), FTS_TEXT); break;
case ACKRESULT_NEXTFILE:
- SetFtStatus(hwndDlg, LPGENT("Moving to next file..."), FTS_TEXT);
+ SetFtStatus(hwndDlg, LPGENW("Moving to next file..."), FTS_TEXT);
SetDlgItemTextA(hwndDlg, IDC_FILENAME, "");
if (dat->transferStatus.currentFileNumber == 1 && dat->transferStatus.totalFiles > 1 && !dat->send)
SetOpenFileButtonStyle(GetDlgItem(hwndDlg, IDC_OPENFILE), 1);
@@ -540,10 +540,10 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
{
PROTOFILETRANSFERSTATUS *fts = &dat->transferStatus;
SetFilenameControls(hwndDlg, dat, fts);
- if (_taccess(fts->tszCurrentFile, 0))
+ if (_waccess(fts->tszCurrentFile, 0))
break;
- SetFtStatus(hwndDlg, LPGENT("File already exists"), FTS_TEXT);
+ SetFtStatus(hwndDlg, LPGENW("File already exists"), FTS_TEXT);
if (dat->resumeBehaviour == FILERESUME_ASK) {
TDlgProcFileExistsParam param = { hwndDlg, fts };
ShowWindow(hwndDlg, SW_SHOWNORMAL);
@@ -563,7 +563,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case ACKRESULT_DATA:
{
PROTOFILETRANSFERSTATUS *fts = (PROTOFILETRANSFERSTATUS*)ack->lParam;
- TCHAR str[64], str2[64], szSizeDone[32], szSizeTotal[32];//, *contactName;
+ wchar_t str[64], str2[64], szSizeDone[32], szSizeTotal[32];//, *contactName;
if (dat->fileVirusScanned == NULL)
dat->fileVirusScanned = (int*)mir_calloc(sizeof(int) * fts->totalFiles);
@@ -571,7 +571,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
// This needs to be here - otherwise we get holes in the files array
if (!dat->send) {
if (dat->files == NULL)
- dat->files = (TCHAR**)mir_calloc((fts->totalFiles + 1) * sizeof(TCHAR*));
+ dat->files = (wchar_t**)mir_calloc((fts->totalFiles + 1) * sizeof(wchar_t*));
if (fts->currentFileNumber < fts->totalFiles && dat->files[fts->currentFileNumber] == NULL)
dat->files[fts->currentFileNumber] = PFTS_StringToTchar(fts->flags, fts->tszCurrentFile);
}
@@ -587,7 +587,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
bool firstTime = false;
if ((GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_ALLFILESPROGRESS), GWL_STYLE) & WS_VISIBLE) == 0) {
- SetFtStatus(hwndDlg, (fts->flags & PFTS_SENDING) ? LPGENT("Sending...") : LPGENT("Receiving..."), FTS_PROGRESS);
+ SetFtStatus(hwndDlg, (fts->flags & PFTS_SENDING) ? LPGENW("Sending...") : LPGENW("Receiving..."), FTS_PROGRESS);
SetFilenameControls(hwndDlg, dat, fts);
firstTime = true;
}
@@ -626,18 +626,18 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
if (ack->result == ACKRESULT_DENIED) {
dat->fs = NULL; /* protocol will free structure */
SkinPlaySound("FileDenied");
- SetFtStatus(hwndDlg, LPGENT("File transfer denied"), FTS_TEXT);
+ SetFtStatus(hwndDlg, LPGENW("File transfer denied"), FTS_TEXT);
}
else if (ack->result == ACKRESULT_FAILED) {
dat->fs = NULL; /* protocol will free structure */
SkinPlaySound("FileFailed");
- SetFtStatus(hwndDlg, LPGENT("File transfer failed"), FTS_TEXT);
+ SetFtStatus(hwndDlg, LPGENW("File transfer failed"), FTS_TEXT);
}
else {
SkinPlaySound("FileDone");
if (dat->send) {
dat->fs = NULL; /* protocol will free structure */
- SetFtStatus(hwndDlg, LPGENT("Transfer completed."), FTS_TEXT);
+ SetFtStatus(hwndDlg, LPGENW("Transfer completed."), FTS_TEXT);
DBEVENTINFO dbei = { 0 };
FillSendData(dat, dbei);
@@ -649,8 +649,8 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
else {
SetFtStatus(hwndDlg,
(dat->transferStatus.totalFiles == 1) ?
- LPGENT("Transfer completed, open file.") :
- LPGENT("Transfer completed, open folder."),
+ LPGENW("Transfer completed, open file.") :
+ LPGENW("Transfer completed, open folder."),
FTS_OPEN);
int useScanner = db_get_b(NULL, "SRFile", "UseScanner", VIRUSSCAN_DISABLE);
@@ -671,7 +671,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
vstsi->szFile = mir_tstrdup(dat->transferStatus.tszWorkingDir);
vstsi->returnCode = -1;
}
- SetFtStatus(hwndDlg, LPGENT("Scanning for viruses..."), FTS_TEXT);
+ SetFtStatus(hwndDlg, LPGENW("Scanning for viruses..."), FTS_TEXT);
if (vstsi)
mir_forkthread((void(*)(void*))RunVirusScannerThread, vstsi);
}
@@ -705,7 +705,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
}
if (done) {
dat->fs = NULL; /* protocol will free structure */
- SetFtStatus(hwndDlg, LPGENT("Transfer and virus scan complete"), FTS_TEXT);
+ SetFtStatus(hwndDlg, LPGENW("Transfer and virus scan complete"), FTS_TEXT);
}
}
break;
diff --git a/src/core/stdfile/src/stdafx.h b/src/core/stdfile/src/stdafx.h
index 4be0919b51..0bb8cc54f6 100644
--- a/src/core/stdfile/src/stdafx.h
+++ b/src/core/stdfile/src/stdafx.h
@@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <commctrl.h>
diff --git a/src/core/stdhelp/src/about.cpp b/src/core/stdhelp/src/about.cpp
index 7ef45cf054..5fca697ade 100644
--- a/src/core/stdhelp/src/about.cpp
+++ b/src/core/stdhelp/src/about.cpp
@@ -32,7 +32,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- { TCHAR filename[MAX_PATH], *productCopyright;
+ { wchar_t filename[MAX_PATH], *productCopyright;
DWORD unused;
DWORD verInfoSize;
UINT blockSize;
@@ -50,7 +50,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
char productVersion[56];
CallService(MS_SYSTEM_GETVERSIONTEXT, _countof(productVersion), (LPARAM)productVersion);
- TCHAR str[64];
+ wchar_t str[64];
mir_sntprintf(str, STR_VERSION_FORMAT, productVersion);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, str);
}
@@ -65,7 +65,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
char* pszMsgt = (char*)alloca(ResSize + 1);
memcpy(pszMsgt, pszMsg, ResSize); pszMsgt[ResSize] = 0;
- TCHAR *ptszMsg;
+ wchar_t *ptszMsg;
if (ResSize >=3 && pszMsgt[0] == '\xef' && pszMsgt[1] == '\xbb' && pszMsgt[2] == '\xbf')
ptszMsg = Utf8DecodeT(pszMsgt + 3);
else
diff --git a/src/core/stdhelp/src/help.cpp b/src/core/stdhelp/src/help.cpp
index 25b53757ea..a72cce44af 100644
--- a/src/core/stdhelp/src/help.cpp
+++ b/src/core/stdhelp/src/help.cpp
@@ -74,7 +74,7 @@ int LoadHelpModule(void)
CreateServiceFunction("Help/BugCommand", BugCommand);
CMenuItem mi;
- mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("&Help"), 2000090000);
+ mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("&Help"), 2000090000);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "8824ECA5-6942-46D7-9D07-1BA600E0D02E");
SET_UID(mi, 0xf3ebf1fa, 0x587c, 0x494d, 0xbd, 0x33, 0x7f, 0x88, 0xb3, 0x61, 0x1e, 0xd3);
diff --git a/src/core/stdhelp/src/stdafx.h b/src/core/stdhelp/src/stdafx.h
index 04c94e8013..4d3797d0df 100644
--- a/src/core/stdhelp/src/stdafx.h
+++ b/src/core/stdhelp/src/stdafx.h
@@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <commctrl.h>
diff --git a/src/core/stdidle/src/stdafx.h b/src/core/stdidle/src/stdafx.h
index e85df5960c..69d89218cc 100644
--- a/src/core/stdidle/src/stdafx.h
+++ b/src/core/stdidle/src/stdafx.h
@@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <commctrl.h>
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index 26e30e224b..79822ad339 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -53,7 +53,7 @@ static void NotifyLocalWinEvent(MCONTACT hContact, HWND hwnd, unsigned int type)
}
}
-static int RTL_Detect(const TCHAR *ptszText)
+static int RTL_Detect(const wchar_t *ptszText)
{
int iLen = (int)mir_tstrlen(ptszText);
WORD *infoTypeC2 = (WORD*)alloca(sizeof(WORD)* (iLen + 2));
@@ -66,7 +66,7 @@ static int RTL_Detect(const TCHAR *ptszText)
return 0;
}
-int SendMessageDirect(const TCHAR *szMsg, MCONTACT hContact, char*)
+int SendMessageDirect(const wchar_t *szMsg, MCONTACT hContact, char*)
{
if (hContact == NULL)
return NULL;
@@ -87,15 +87,15 @@ int SendMessageDirect(const TCHAR *szMsg, MCONTACT hContact, char*)
return sendId;
}
-static void AddToFileList(TCHAR ***pppFiles, int *totalCount, const TCHAR* szFilename)
+static void AddToFileList(wchar_t ***pppFiles, int *totalCount, const wchar_t* szFilename)
{
- *pppFiles = (TCHAR**)mir_realloc(*pppFiles, (++*totalCount + 1)*sizeof(TCHAR*));
+ *pppFiles = (wchar_t**)mir_realloc(*pppFiles, (++*totalCount + 1)*sizeof(wchar_t*));
(*pppFiles)[*totalCount] = NULL;
(*pppFiles)[*totalCount - 1] = mir_tstrdup(szFilename);
if (GetFileAttributes(szFilename) & FILE_ATTRIBUTE_DIRECTORY) {
WIN32_FIND_DATA fd;
- TCHAR szPath[MAX_PATH];
+ wchar_t szPath[MAX_PATH];
mir_sntprintf(szPath, L"%s\\*", szFilename);
HANDLE hFind = FindFirstFile(szPath, &fd);
if (hFind != INVALID_HANDLE_VALUE) {
@@ -119,7 +119,7 @@ static void ShowMultipleControls(HWND hwndDlg, const UINT * controls, int cContr
static void UpdateReadChars(HWND hwndDlg, HWND hwndStatus)
{
if (hwndStatus && (g_dat.flags & SMF_SHOWREADCHAR)) {
- TCHAR buf[32];
+ wchar_t buf[32];
int len = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE));
mir_sntprintf(buf, L"%d", len);
@@ -133,7 +133,7 @@ static void ShowTime(SrmmWindowData *dat)
SYSTEMTIME st;
GetSystemTime(&st);
if (dat->wMinute != st.wMinute) {
- TCHAR buf[32];
+ wchar_t buf[32];
unsigned i = (g_dat.flags & SMF_SHOWREADCHAR) ? 2 : 1;
TimeZone_PrintDateTime(dat->hTimeZone, L"t", buf, _countof(buf), 0);
@@ -206,7 +206,7 @@ struct MsgEditSubclassData
DWORD lastEnterTime;
};
-static void SetEditorText(HWND hwnd, const TCHAR* txt)
+static void SetEditorText(HWND hwnd, const wchar_t* txt)
{
SetWindowText(hwnd, txt);
SendMessage(hwnd, EM_SETSEL, -1, -1);
@@ -488,7 +488,7 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *
HWND h = GetDlgItem(hwndDlg, IDC_NAME);
int len = GetWindowTextLength(h);
if (len > 0) {
- TCHAR buf[256];
+ wchar_t buf[256];
GetWindowText(h, buf, _countof(buf));
HDC hdc = GetDC(h);
@@ -624,7 +624,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
int len;
if (newData->isWchar)
- SetDlgItemText(hwndDlg, IDC_MESSAGE, (TCHAR*)newData->szInitialText);
+ SetDlgItemText(hwndDlg, IDC_MESSAGE, (wchar_t*)newData->szInitialText);
else
SetDlgItemTextA(hwndDlg, IDC_MESSAGE, newData->szInitialText);
len = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE));
@@ -687,7 +687,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_LIMITTEXT, (WPARAM)nMax, 0);
// get around a lame bug in the Windows template resource code where richedits are limited to 0x7FFF
- SendDlgItemMessage(hwndDlg, IDC_LOG, EM_LIMITTEXT, (WPARAM) sizeof(TCHAR) * 0x7FFFFFFF, 0);
+ SendDlgItemMessage(hwndDlg, IDC_LOG, EM_LIMITTEXT, (WPARAM) sizeof(wchar_t) * 0x7FFFFFFF, 0);
}
mir_subclassWindow(GetDlgItem(hwndDlg, IDC_MESSAGE), MessageEditSubclassProc);
@@ -828,10 +828,10 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
if (!(CallProtoService(dat->szProto, PS_GETCAPS, PFLAGNUM_1, 0)&PF1_FILESEND)) break;
if (dat->wStatus == ID_STATUS_OFFLINE) break;
if (dat->hContact != NULL) {
- TCHAR szFilename[MAX_PATH];
+ wchar_t szFilename[MAX_PATH];
HDROP hDrop = (HDROP)wParam;
int fileCount = DragQueryFile(hDrop, -1, NULL, 0), totalCount = 0, i;
- TCHAR** ppFiles = NULL;
+ wchar_t** ppFiles = NULL;
for (i = 0; i < fileCount; i++) {
DragQueryFile(hDrop, i, szFilename, _countof(szFilename));
AddToFileList(&ppFiles, &totalCount, szFilename);
@@ -921,8 +921,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
ptrT id(Contact_GetInfo(CNF_UNIQUEID, dat->hContact, dat->szProto));
if (id != NULL && OpenClipboard(hwndDlg)) {
EmptyClipboard();
- HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, mir_tstrlen(id) * sizeof(TCHAR)+1);
- mir_tstrcpy((TCHAR*)GlobalLock(hData), id);
+ HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, mir_tstrlen(id) * sizeof(wchar_t)+1);
+ mir_tstrcpy((wchar_t*)GlobalLock(hData), id);
GlobalUnlock(hData);
SetClipboardData(CF_UNICODETEXT, hData);
CloseClipboard();
@@ -935,7 +935,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
break;
if (dat->lastMessage) {
- TCHAR date[64], time[64], fmt[128];
+ wchar_t date[64], time[64], fmt[128];
TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"d", date, _countof(date), 0);
TimeZone_PrintTimeStamp(NULL, dat->lastMessage, L"t", time, _countof(time), 0);
mir_sntprintf(fmt, TranslateT("Last message received on %s at %s."), date, time);
@@ -1000,17 +1000,17 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
case DM_UPDATETITLE:
{
- TCHAR newtitle[256];
+ wchar_t newtitle[256];
if (dat->hContact && dat->szProto) {
int statusIcon = db_get_b(NULL, SRMMMOD, SRMSGSET_STATUSICON, SRMSGDEFSET_STATUSICON);
dat->wStatus = db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE);
- TCHAR *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
+ wchar_t *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
ptrT id(Contact_GetInfo(CNF_DISPLAYUID, dat->hContact, dat->szProto));
SetDlgItemText(hwndDlg, IDC_NAME, (id) ? id : contactName);
- TCHAR *szStatus = pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE), 0);
+ wchar_t *szStatus = pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE), 0);
if (statusIcon)
mir_sntprintf(newtitle, L"%s - %s", contactName, TranslateT("Message session"));
else
@@ -1028,7 +1028,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
else
mir_tstrncpy(newtitle, TranslateT("Message session"), _countof(newtitle));
- TCHAR oldtitle[256];
+ wchar_t oldtitle[256];
GetWindowText(hwndDlg, oldtitle, _countof(oldtitle));
if (mir_tstrcmp(newtitle, oldtitle)) { //swt() flickers even if the title hasn't actually changed
SetWindowText(hwndDlg, newtitle);
@@ -1254,8 +1254,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
}
else {
if (dat->nTypeSecs) {
- TCHAR szBuf[256];
- TCHAR* szContactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
+ wchar_t szBuf[256];
+ wchar_t* szContactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
HICON hTyping = Skin_LoadIcon(SKINICON_OTHER_TYPING);
mir_sntprintf(szBuf, TranslateT("%s is typing a message..."), szContactName);
@@ -1341,7 +1341,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
case IDOK:
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDOK))) {
int bufSize = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE)) + 1;
- TCHAR *temp = (TCHAR*)alloca(bufSize * sizeof(TCHAR));
+ wchar_t *temp = (wchar_t*)alloca(bufSize * sizeof(wchar_t));
GetDlgItemText(hwndDlg, IDC_MESSAGE, temp, bufSize);
if (!temp[0])
break;
@@ -1522,11 +1522,11 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
TEXTRANGE tr;
tr.chrg = ((ENLINK *)lParam)->chrg;
- tr.lpstrText = (TCHAR*)_alloca((tr.chrg.cpMax - tr.chrg.cpMin + 8) * sizeof(TCHAR));
+ tr.lpstrText = (wchar_t*)_alloca((tr.chrg.cpMax - tr.chrg.cpMin + 8) * sizeof(wchar_t));
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_GETTEXTRANGE, 0, (LPARAM)& tr);
- if (_tcschr(tr.lpstrText, '@') != NULL && _tcschr(tr.lpstrText, ':') == NULL && _tcschr(tr.lpstrText, '/') == NULL) {
- memmove(tr.lpstrText + 7, tr.lpstrText, (tr.chrg.cpMax - tr.chrg.cpMin + 1) * sizeof(TCHAR));
- memcpy(tr.lpstrText, L"mailto:", 7 * sizeof(TCHAR));
+ if (wcschr(tr.lpstrText, '@') != NULL && wcschr(tr.lpstrText, ':') == NULL && wcschr(tr.lpstrText, '/') == NULL) {
+ memmove(tr.lpstrText + 7, tr.lpstrText, (tr.chrg.cpMax - tr.chrg.cpMin + 1) * sizeof(wchar_t));
+ memcpy(tr.lpstrText, L"mailto:", 7 * sizeof(wchar_t));
}
if (((ENLINK *)lParam)->msg == WM_RBUTTONDOWN) {
@@ -1546,8 +1546,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
case IDM_COPYLINK:
if (OpenClipboard(hwndDlg)) {
EmptyClipboard();
- HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(tr.lpstrText) + 1) * sizeof(TCHAR));
- mir_tstrcpy((TCHAR*)GlobalLock(hData), tr.lpstrText);
+ HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(tr.lpstrText) + 1) * sizeof(wchar_t));
+ mir_tstrcpy((wchar_t*)GlobalLock(hData), tr.lpstrText);
GlobalUnlock(hData);
SetClipboardData(CF_UNICODETEXT, hData);
CloseClipboard();
@@ -1586,7 +1586,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
// save string from the editor
if (dat->hContact) {
int len = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE)) + 1;
- TCHAR *msg = (TCHAR*)alloca(sizeof(TCHAR)*len);
+ wchar_t *msg = (wchar_t*)alloca(sizeof(wchar_t)*len);
GetDlgItemText(hwndDlg, IDC_MESSAGE, msg, len);
if (msg[0])
db_set_ts(dat->hContact, SRMSGMOD, DBSAVEDMSG, msg);
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp
index c40c4eb27f..62ab631a35 100644
--- a/src/core/stdmsg/src/msglog.cpp
+++ b/src/core/stdmsg/src/msglog.cpp
@@ -50,10 +50,10 @@ struct LogStreamData
static int logPixelSY;
static char szSep2[40], szSep2_RTL[50];
-static const TCHAR *bbcodes[] = { L"[b]", L"[i]", L"[u]", L"[s]", L"[/b]", L"[/i]", L"[/u]", L"[/s]" };
+static const wchar_t *bbcodes[] = { L"[b]", L"[i]", L"[u]", L"[s]", L"[/b]", L"[/i]", L"[/u]", L"[/s]" };
static const char *bbcodefmt[] = { "\\b ", "\\i ", "\\ul ", "\\strike ", "\\b0 ", "\\i0 ", "\\ul0 ", "\\strike0 " };
-static void AppendPlainUnicode(CMStringA &buf, const TCHAR *str)
+static void AppendPlainUnicode(CMStringA &buf, const wchar_t *str)
{
for (; *str; str++) {
if (*str < 128)
@@ -63,7 +63,7 @@ static void AppendPlainUnicode(CMStringA &buf, const TCHAR *str)
}
}
-static void AppendToBufferWithRTF(CMStringA &buf, const TCHAR *line)
+static void AppendToBufferWithRTF(CMStringA &buf, const wchar_t *line)
{
if (line == NULL)
return;
@@ -90,7 +90,7 @@ static void AppendToBufferWithRTF(CMStringA &buf, const TCHAR *line)
for (i = 0; i < _countof(bbcodes); ++i) {
if (line[1] == bbcodes[i][1]) {
size_t lenb = mir_tstrlen(bbcodes[i]);
- if (!_tcsnicmp(line, bbcodes[i], lenb)) {
+ if (!wcsnicmp(line, bbcodes[i], lenb)) {
buf.Append(bbcodefmt[i]);
line += lenb - 1;
found = 1;
@@ -99,15 +99,15 @@ static void AppendToBufferWithRTF(CMStringA &buf, const TCHAR *line)
}
}
if (!found) {
- if (!_tcsnicmp(line, L"[url", 4)) {
- const TCHAR* tag = _tcschr(line + 4, ']');
+ if (!wcsnicmp(line, L"[url", 4)) {
+ const wchar_t* tag = wcschr(line + 4, ']');
if (tag) {
- const TCHAR *tagu = (line[4] == '=') ? line + 5 : tag + 1;
- const TCHAR *tage = _tcsstr(tag, L"[/url]");
- if (!tage) tage = _tcsstr(tag, L"[/URL]");
+ const wchar_t *tagu = (line[4] == '=') ? line + 5 : tag + 1;
+ const wchar_t *tage = wcsstr(tag, L"[/url]");
+ if (!tage) tage = wcsstr(tag, L"[/URL]");
if (tage) {
- *(TCHAR*)tag = 0;
- *(TCHAR*)tage = 0;
+ *(wchar_t*)tag = 0;
+ *(wchar_t*)tage = 0;
buf.Append("{\\field{\\*\\fldinst HYPERLINK \"");
AppendPlainUnicode(buf, tagu);
buf.Append("\"}{\\fldrslt ");
@@ -118,14 +118,14 @@ static void AppendToBufferWithRTF(CMStringA &buf, const TCHAR *line)
}
}
}
- else if (!_tcsnicmp(line, L"[color=", 7)) {
- const TCHAR* tag = _tcschr(line + 7, ']');
+ else if (!wcsnicmp(line, L"[color=", 7)) {
+ const wchar_t* tag = wcschr(line + 7, ']');
if (tag) {
line = tag;
found = 1;
}
}
- else if (!_tcsnicmp(line, L"[/color]", 8)) {
+ else if (!wcsnicmp(line, L"[/color]", 8)) {
line += 7;
found = 1;
}
@@ -254,8 +254,8 @@ static char* CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, MEVENT
}
if (g_dat.flags & SMF_SHOWTIME) {
- const TCHAR* szFormat;
- TCHAR str[64];
+ const wchar_t* szFormat;
+ wchar_t str[64];
if (g_dat.flags & SMF_SHOWSECS)
szFormat = g_dat.flags & SMF_SHOWDATE ? L"d s" : L"s";
@@ -270,11 +270,11 @@ static char* CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, MEVENT
}
if (!(g_dat.flags & SMF_HIDENAMES) && dbei.eventType != EVENTTYPE_JABBER_CHATSTATES && dbei.eventType != EVENTTYPE_JABBER_PRESENCE) {
- TCHAR *szName;
+ wchar_t *szName;
if (dbei.flags & DBEF_SENT) {
- if (TCHAR *p = Contact_GetInfo(CNF_DISPLAY, NULL, dbei.szModule))
- szName = NEWTSTR_ALLOCA(p);
+ if (wchar_t *p = Contact_GetInfo(CNF_DISPLAY, NULL, dbei.szModule))
+ szName = NEWWSTR_ALLOCA(p);
else
szName = TranslateT("Me");
}
@@ -288,13 +288,13 @@ static char* CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, MEVENT
if (showColon)
buffer.AppendFormat("%s :", SetToStyle(dbei.flags & DBEF_SENT ? MSGFONTID_MYCOLON : MSGFONTID_YOURCOLON));
- TCHAR *msg, *szName;
+ wchar_t *msg, *szName;
switch (dbei.eventType) {
case EVENTTYPE_JABBER_CHATSTATES:
case EVENTTYPE_JABBER_PRESENCE:
if (dbei.flags & DBEF_SENT) {
- if (TCHAR *p = Contact_GetInfo(CNF_DISPLAY, NULL, dbei.szModule)) {
- szName = NEWTSTR_ALLOCA(p);
+ if (wchar_t *p = Contact_GetInfo(CNF_DISPLAY, NULL, dbei.szModule)) {
+ szName = NEWWSTR_ALLOCA(p);
mir_free(p);
}
else szName = L"";
diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp
index b14d0ec51b..52bfb5f630 100644
--- a/src/core/stdmsg/src/msgoptions.cpp
+++ b/src/core/stdmsg/src/msgoptions.cpp
@@ -26,27 +26,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct FontOptionsList
{
- const TCHAR* szDescr;
+ const wchar_t* szDescr;
COLORREF defColour;
- const TCHAR* szDefFace;
+ const wchar_t* szDefFace;
BYTE defStyle;
char defSize;
}
static const fontOptionsList[] =
{
- { LPGENT("Outgoing messages"), RGB(106, 106, 106), L"Arial", 0, -12},
- { LPGENT("Incoming messages"), RGB(0, 0, 0), L"Arial", 0, -12},
- { LPGENT("Outgoing name"), RGB(89, 89, 89), L"Arial", DBFONTF_BOLD, -12},
- { LPGENT("Outgoing time"), RGB(0, 0, 0), L"Terminal", DBFONTF_BOLD, -9},
- { LPGENT("Outgoing colon"), RGB(89, 89, 89), L"Arial", 0, -11},
- { LPGENT("Incoming name"), RGB(215, 0, 0), L"Arial", DBFONTF_BOLD, -12},
- { LPGENT("Incoming time"), RGB(0, 0, 0), L"Terminal", DBFONTF_BOLD, -9},
- { LPGENT("Incoming colon"), RGB(215, 0, 0), L"Arial", 0, -11},
- { LPGENT("Message area"), RGB(0, 0, 0), L"Arial", 0, -12},
- { LPGENT("Other events"), RGB(90, 90, 160), L"Arial", 0, -12},
+ { LPGENW("Outgoing messages"), RGB(106, 106, 106), L"Arial", 0, -12},
+ { LPGENW("Incoming messages"), RGB(0, 0, 0), L"Arial", 0, -12},
+ { LPGENW("Outgoing name"), RGB(89, 89, 89), L"Arial", DBFONTF_BOLD, -12},
+ { LPGENW("Outgoing time"), RGB(0, 0, 0), L"Terminal", DBFONTF_BOLD, -9},
+ { LPGENW("Outgoing colon"), RGB(89, 89, 89), L"Arial", 0, -11},
+ { LPGENW("Incoming name"), RGB(215, 0, 0), L"Arial", DBFONTF_BOLD, -12},
+ { LPGENW("Incoming time"), RGB(0, 0, 0), L"Terminal", DBFONTF_BOLD, -9},
+ { LPGENW("Incoming colon"), RGB(215, 0, 0), L"Arial", 0, -11},
+ { LPGENW("Message area"), RGB(0, 0, 0), L"Arial", 0, -12},
+ { LPGENW("Other events"), RGB(90, 90, 160), L"Arial", 0, -12},
};
-static BYTE MsgDlgGetFontDefaultCharset(const TCHAR*)
+static BYTE MsgDlgGetFontDefaultCharset(const wchar_t*)
{
return DEFAULT_CHARSET;
}
@@ -82,7 +82,7 @@ bool LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour)
DBVARIANT dbv;
if (db_get_ts(NULL, SRMMMOD, str, &dbv))
- _tcsncpy(lf->lfFaceName, fontOptionsList[i].szDefFace, _countof(lf->lfFaceName)-1);
+ wcsncpy(lf->lfFaceName, fontOptionsList[i].szDefFace, _countof(lf->lfFaceName)-1);
else {
mir_tstrncpy(lf->lfFaceName, dbv.ptszVal, _countof(lf->lfFaceName));
db_free(&dbv);
@@ -101,8 +101,8 @@ void RegisterSRMMFonts(void)
fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID;
for (int i = 0; i < _countof(fontOptionsList); i++) {
strncpy_s(fontid.dbSettingsGroup, SRMMMOD, _TRUNCATE);
- _tcsncpy_s(fontid.group, LPGENT("Message log"), _TRUNCATE);
- _tcsncpy_s(fontid.name, fontOptionsList[i].szDescr, _TRUNCATE);
+ wcsncpy_s(fontid.group, LPGENW("Message log"), _TRUNCATE);
+ wcsncpy_s(fontid.name, fontOptionsList[i].szDescr, _TRUNCATE);
mir_snprintf(idstr, "SRMFont%d", i);
strncpy_s(fontid.prefix, idstr, _TRUNCATE);
fontid.order = i;
@@ -113,10 +113,10 @@ void RegisterSRMMFonts(void)
fontid.deffontsettings.colour = fontOptionsList[i].defColour;
fontid.deffontsettings.size = fontOptionsList[i].defSize;
fontid.deffontsettings.style = fontOptionsList[i].defStyle;
- _tcsncpy_s(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _TRUNCATE);
+ wcsncpy_s(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _TRUNCATE);
fontid.deffontsettings.charset = MsgDlgGetFontDefaultCharset(fontOptionsList[i].szDefFace);
- _tcsncpy_s(fontid.backgroundGroup, LPGENT("Message log"), _TRUNCATE);
- _tcsncpy_s(fontid.backgroundName, LPGENT("Background"), _TRUNCATE);
+ wcsncpy_s(fontid.backgroundGroup, LPGENW("Message log"), _TRUNCATE);
+ wcsncpy_s(fontid.backgroundName, LPGENW("Background"), _TRUNCATE);
FontRegisterT(&fontid);
}
@@ -124,8 +124,8 @@ void RegisterSRMMFonts(void)
strncpy_s(colourid.dbSettingsGroup, SRMMMOD, _TRUNCATE);
strncpy_s(colourid.setting, SRMSGSET_BKGCOLOUR, _TRUNCATE);
colourid.defcolour = SRMSGDEFSET_BKGCOLOUR;
- _tcsncpy_s(colourid.name, LPGENT("Background"), _TRUNCATE);
- _tcsncpy_s(colourid.group, LPGENT("Message log"), _TRUNCATE);
+ wcsncpy_s(colourid.name, LPGENW("Background"), _TRUNCATE);
+ wcsncpy_s(colourid.group, LPGENW("Message log"), _TRUNCATE);
ColourRegisterT(&colourid);
}
@@ -134,20 +134,20 @@ void RegisterSRMMFonts(void)
struct CheckBoxValues_t
{
DWORD style;
- TCHAR* szDescr;
+ wchar_t* szDescr;
}
statusValues[] =
{
- { MODEF_OFFLINE, LPGENT("Offline") },
- { PF2_ONLINE, LPGENT("Online") },
- { PF2_SHORTAWAY, LPGENT("Away") },
- { PF2_LONGAWAY, LPGENT("Not available") },
- { PF2_LIGHTDND, LPGENT("Occupied") },
- { PF2_HEAVYDND, LPGENT("Do not disturb") },
- { PF2_FREECHAT, LPGENT("Free for chat") },
- { PF2_INVISIBLE, LPGENT("Invisible") },
- { PF2_OUTTOLUNCH, LPGENT("Out to lunch") },
- { PF2_ONTHEPHONE, LPGENT("On the phone") }
+ { MODEF_OFFLINE, LPGENW("Offline") },
+ { PF2_ONLINE, LPGENW("Online") },
+ { PF2_SHORTAWAY, LPGENW("Away") },
+ { PF2_LONGAWAY, LPGENW("Not available") },
+ { PF2_LIGHTDND, LPGENW("Occupied") },
+ { PF2_HEAVYDND, LPGENW("Do not disturb") },
+ { PF2_FREECHAT, LPGENW("Free for chat") },
+ { PF2_INVISIBLE, LPGENW("Invisible") },
+ { PF2_OUTTOLUNCH, LPGENW("Out to lunch") },
+ { PF2_ONTHEPHONE, LPGENW("On the phone") }
};
static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *values, int nValues, DWORD style)
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp
index 7c9952c0ee..2b67cb4590 100644
--- a/src/core/stdmsg/src/msgs.cpp
+++ b/src/core/stdmsg/src/msgs.cpp
@@ -88,7 +88,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam)
return 0;
}
- TCHAR toolTip[256];
+ wchar_t toolTip[256];
mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
CLISTEVENT cle = {};
@@ -166,7 +166,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam)
if (hwnd)
SendMessage(hwnd, DM_TYPING, 0, lParam);
else if (lParam && (g_dat.flags & SMF_SHOWTYPINGTRAY)) {
- TCHAR szTip[256];
+ wchar_t szTip[256];
mir_sntprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0));
if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && !(g_dat.flags & SMF_SHOWTYPINGCLIST)) {
@@ -271,7 +271,7 @@ static void RestoreUnreadMessageAlerts(void)
}
}
- TCHAR toolTip[256];
+ wchar_t toolTip[256];
CLISTEVENT cle = {};
cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
@@ -402,7 +402,7 @@ static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam)
return 0;
}
-static TCHAR tszError[] = LPGENT("Miranda could not load the built-in message module, msftedit.dll is missing. Press 'Yes' to continue loading Miranda.");
+static wchar_t tszError[] = LPGENW("Miranda could not load the built-in message module, msftedit.dll is missing. Press 'Yes' to continue loading Miranda.");
int LoadSendRecvMessageModule(void)
{
diff --git a/src/core/stdmsg/src/msgs.h b/src/core/stdmsg/src/msgs.h
index ac5c99a003..c034551fa9 100644
--- a/src/core/stdmsg/src/msgs.h
+++ b/src/core/stdmsg/src/msgs.h
@@ -65,7 +65,7 @@ struct SrmmWindowData : public MZeroedObject
WORD wStatus;
WORD wOldStatus;
int cmdListInd;
- LIST<TCHAR> cmdList;
+ LIST<wchar_t> cmdList;
bool bIsAutoRTL, bIsMeta;
WORD wMinute;
@@ -126,7 +126,7 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
int DbEventIsForMsgWindow(DBEVENTINFO *dbei);
int DbEventIsShown(DBEVENTINFO *dbei);
void StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAppend);
-int SendMessageDirect(const TCHAR *szMsg, MCONTACT hContact, char *szProto);
+int SendMessageDirect(const wchar_t *szMsg, MCONTACT hContact, char *szProto);
INT_PTR SendMessageCmd(MCONTACT hContact, char *msg, int isWchar);
void LoadMsgLogIcons(void);
diff --git a/src/core/stdssl/src/netlibssl.cpp b/src/core/stdssl/src/netlibssl.cpp
index d59c92c0ec..af0c2632e1 100644
--- a/src/core/stdssl/src/netlibssl.cpp
+++ b/src/core/stdssl/src/netlibssl.cpp
@@ -60,26 +60,26 @@ struct SslHandle
static void ReportSslError(SECURITY_STATUS scRet, int line, bool = false)
{
- TCHAR szMsgBuf[256];
+ wchar_t szMsgBuf[256];
switch (scRet) {
case 0:
case ERROR_NOT_READY:
return;
case SEC_E_INVALID_TOKEN:
- _tcsncpy_s(szMsgBuf, TranslateT("Client cannot decode host message. Possible causes: host does not support SSL or requires not existing security package"), _TRUNCATE);
+ wcsncpy_s(szMsgBuf, TranslateT("Client cannot decode host message. Possible causes: host does not support SSL or requires not existing security package"), _TRUNCATE);
break;
case CERT_E_CN_NO_MATCH:
case SEC_E_WRONG_PRINCIPAL:
- _tcsncpy_s(szMsgBuf, TranslateT("Host we are connecting to is not the one certificate was issued for"), _TRUNCATE);
+ wcsncpy_s(szMsgBuf, TranslateT("Host we are connecting to is not the one certificate was issued for"), _TRUNCATE);
break;
default:
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, scRet, LANG_USER_DEFAULT, szMsgBuf, _countof(szMsgBuf), NULL);
}
- TCHAR szMsgBuf2[512];
+ wchar_t szMsgBuf2[512];
mir_sntprintf(szMsgBuf2, L"SSL connection failure (%x %u): %s", scRet, line, szMsgBuf);
char* szMsg = Utf8EncodeT(szMsgBuf2);
diff --git a/src/core/stduihist/src/history.cpp b/src/core/stduihist/src/history.cpp
index 6b4815309f..88acd91328 100644
--- a/src/core/stduihist/src/history.cpp
+++ b/src/core/stduihist/src/history.cpp
@@ -37,15 +37,15 @@ static HGENMENU hContactMenu = 0;
/////////////////////////////////////////////////////////////////////////////////////////
// Fills the events list
-static void GetMessageDescription(DBEVENTINFO *dbei, TCHAR* buf, int cbBuf)
+static void GetMessageDescription(DBEVENTINFO *dbei, wchar_t* buf, int cbBuf)
{
- TCHAR *msg = DbGetEventTextT(dbei, CP_ACP);
- _tcsncpy(buf, msg ? msg : TranslateT("Invalid message"), cbBuf);
+ wchar_t *msg = DbGetEventTextT(dbei, CP_ACP);
+ wcsncpy(buf, msg ? msg : TranslateT("Invalid message"), cbBuf);
buf[ cbBuf-1 ] = 0;
mir_free(msg);
}
-static void GetUrlDescription(DBEVENTINFO *dbei, TCHAR* buf, int cbBuf)
+static void GetUrlDescription(DBEVENTINFO *dbei, wchar_t* buf, int cbBuf)
{
int len = dbei->cbBlob;
if (len >= cbBuf)
@@ -58,7 +58,7 @@ static void GetUrlDescription(DBEVENTINFO *dbei, TCHAR* buf, int cbBuf)
mir_tstrcat(buf, L"\r\n");
}
-static void GetFileDescription(DBEVENTINFO *dbei, TCHAR* buf, int cbBuf)
+static void GetFileDescription(DBEVENTINFO *dbei, wchar_t* buf, int cbBuf)
{
int len = dbei->cbBlob - sizeof(DWORD);
if (len >= cbBuf)
@@ -71,7 +71,7 @@ static void GetFileDescription(DBEVENTINFO *dbei, TCHAR* buf, int cbBuf)
mir_tstrcat(buf, L"\r\n");
}
-static void GetObjectDescription(DBEVENTINFO *dbei, TCHAR* str, int cbStr)
+static void GetObjectDescription(DBEVENTINFO *dbei, wchar_t* str, int cbStr)
{
switch(dbei->eventType) {
case EVENTTYPE_MESSAGE:
@@ -94,9 +94,9 @@ static void GetObjectDescription(DBEVENTINFO *dbei, TCHAR* str, int cbStr)
*str = 0;
} }
-static void GetObjectSummary(DBEVENTINFO *dbei, TCHAR* str, int cbStr)
+static void GetObjectSummary(DBEVENTINFO *dbei, wchar_t* str, int cbStr)
{
- TCHAR* pszSrc, *pszTmp = NULL;
+ wchar_t* pszSrc, *pszTmp = NULL;
switch(dbei->eventType) {
case EVENTTYPE_MESSAGE:
@@ -125,7 +125,7 @@ static void GetObjectSummary(DBEVENTINFO *dbei, TCHAR* str, int cbStr)
return;
}
- _tcsncpy(str, (const TCHAR*)pszSrc, cbStr);
+ wcsncpy(str, (const wchar_t*)pszSrc, cbStr);
str[cbStr-1] = 0;
mir_free(pszTmp);
}
@@ -161,7 +161,7 @@ static void FillHistoryThread(void* param)
dbei.cbBlob = oldBlobSize;
db_event_get(hDbEvent, &dbei);
- TCHAR str[200], eventText[256], strdatetime[64];
+ wchar_t str[200], eventText[256], strdatetime[64];
GetObjectSummary(&dbei, str, _countof(str));
if (str[0]) {
TimeZone_PrintTimeStamp(NULL, dbei.timestamp, L"d t", strdatetime, _countof(strdatetime), 0);
@@ -206,7 +206,7 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP
WindowList_Add(hWindowList, hwndDlg, hContact);
Utils_RestoreWindowPosition(hwndDlg, hContact, "History", "");
{
- TCHAR* contactName, str[200];
+ wchar_t* contactName, str[200];
contactName = pcli->pfnGetContactDisplayName(hContact, 0);
mir_sntprintf(str, TranslateT("History for %s"), contactName);
SetWindowText(hwndDlg, str);
@@ -278,7 +278,7 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if ((int)dbei.cbBlob != -1) {
dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob);
if (db_event_get(hDbEvent, &dbei) == 0) {
- TCHAR str[8192];
+ wchar_t str[8192];
GetObjectDescription(&dbei, str, _countof(str));
if (str[0])
SetDlgItemText(hwndDlg, IDC_EDIT, str);
@@ -316,11 +316,11 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP
dbei.cbBlob = oldBlobSize;
db_event_get(hDbEvent, &dbei);
- TCHAR str[1024];
+ wchar_t str[1024];
GetObjectDescription(&dbei, str, _countof(str));
if (str[0]) {
CharUpperBuff(str, (int)mir_tstrlen(str));
- if (_tcsstr(str, (const TCHAR*)lParam) != NULL) {
+ if (wcsstr(str, (const wchar_t*)lParam) != NULL) {
SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETCURSEL, index, 0);
SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_LIST, LBN_SELCHANGE), 0);
break;
@@ -349,7 +349,7 @@ static INT_PTR CALLBACK DlgProcHistoryFind(HWND hwndDlg, UINT msg, WPARAM wParam
return TRUE;
case IDOK://find Next
- TCHAR str[128];
+ wchar_t str[128];
HWND hwndParent = (HWND)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
GetDlgItemText(hwndDlg, IDC_FINDWHAT, str, _countof(str));
CharUpperBuff(str, (int)mir_tstrlen(str));
diff --git a/src/core/stduihist/src/stdafx.h b/src/core/stduihist/src/stdafx.h
index 59f8cd87a8..084712b5f3 100644
--- a/src/core/stduihist/src/stdafx.h
+++ b/src/core/stduihist/src/stdafx.h
@@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <commctrl.h>
diff --git a/src/core/stduserinfo/src/contactinfo.cpp b/src/core/stduserinfo/src/contactinfo.cpp
index 1fc523b3ea..a125be13ef 100644
--- a/src/core/stduserinfo/src/contactinfo.cpp
+++ b/src/core/stduserinfo/src/contactinfo.cpp
@@ -171,7 +171,7 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar
return FALSE;
}
-static int IsOverEmail(HWND hwndDlg, TCHAR* szEmail, int cchEmail)
+static int IsOverEmail(HWND hwndDlg, wchar_t* szEmail, int cchEmail)
{
HWND hwndEmails = GetDlgItem(hwndDlg, IDC_EMAILS);
@@ -190,7 +190,7 @@ static int IsOverEmail(HWND hwndDlg, TCHAR* szEmail, int cchEmail)
ListView_GetSubItemRect(hwndEmails, hti.iItem, 1, LVIR_LABEL, &rc);
- TCHAR szText[256]; szText[0] = 0;
+ wchar_t szText[256]; szText[0] = 0;
ListView_GetItemText(hwndEmails, hti.iItem, 1, szText, _countof(szText));
HDC hdc = GetDC(hwndEmails);
@@ -264,7 +264,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
ListView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_EMAILS));
char idstr[33];
- TCHAR idstr2[33];
+ wchar_t idstr2[33];
DBVARIANT dbv;
LVITEM lvi;
@@ -400,7 +400,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
ListView_GetSubItemRect(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, LVIR_LABEL, &rc);
if (nm->iSubItem == 1 && nm->nmcd.hdr.idFrom == IDC_EMAILS) {
HFONT hoFont;
- TCHAR szText[256] = { 0 };
+ wchar_t szText[256] = { 0 };
ListView_GetItemText(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, szText, _countof(szText));
hoFont = (HFONT)SelectObject(nm->nmcd.hdc, hEmailFont);
SetTextColor(nm->nmcd.hdc, RGB(0, 0, 255));
@@ -416,7 +416,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
else if (nm->iSubItem > 1 && nm->nmcd.lItemlParam != -1 && nm->nmcd.lItemlParam != -2) {
static int iconResources[3] = { SKINICON_OTHER_RENAME, SKINICON_OTHER_DELETE };
if (nm->iSubItem == 2 && nm->nmcd.hdr.idFrom == IDC_PHONES) {
- TCHAR szText[2];
+ wchar_t szText[2];
ListView_GetItemText(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, szText, _countof(szText));
if (szText[0]) hIcon = Skin_LoadIcon(SKINICON_OTHER_SMS);
}
@@ -436,9 +436,9 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
char *szIdTemplate = (nm->hdr.idFrom == IDC_PHONES) ? "MyPhone%d" : "Mye-mail%d";
- TCHAR szEmail[256];
+ wchar_t szEmail[256];
if (IsOverEmail(hwndDlg, szEmail, _countof(szEmail))) {
- TCHAR szExec[264];
+ wchar_t szExec[264];
mir_sntprintf(szExec, L"mailto:%s", szEmail);
ShellExecute(hwndDlg, L"open", szExec, NULL, NULL, SW_SHOW);
break;
diff --git a/src/core/stduserinfo/src/stdafx.h b/src/core/stduserinfo/src/stdafx.h
index 9136d69408..4a07eca120 100644
--- a/src/core/stduserinfo/src/stdafx.h
+++ b/src/core/stduserinfo/src/stdafx.h
@@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <uxtheme.h>
diff --git a/src/core/stduserinfo/src/stdinfo.cpp b/src/core/stduserinfo/src/stdinfo.cpp
index 4b93ab8cd1..100ea132d8 100644
--- a/src/core/stduserinfo/src/stdinfo.cpp
+++ b/src/core/stduserinfo/src/stdinfo.cpp
@@ -44,7 +44,7 @@ static int Proto_GetContactInfoSetting(MCONTACT hContact, const char *szProto, c
return CallProtoService(szProto, PS_GETINFOSETTING, hContact, (LPARAM)&cgs);
}
-static TCHAR* Proto_GetContactInfoSettingStr(bool proto_service, MCONTACT hContact, const char *szModule, const char *szSetting)
+static wchar_t* Proto_GetContactInfoSettingStr(bool proto_service, MCONTACT hContact, const char *szModule, const char *szSetting)
{
if (!proto_service)
return db_get_tsa(hContact, szModule, szSetting);
@@ -61,7 +61,7 @@ static TCHAR* Proto_GetContactInfoSettingStr(bool proto_service, MCONTACT hConta
static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule, char *szSetting, int special)
{
char str[80], *pstr = NULL;
- TCHAR *ptstr = NULL;
+ wchar_t *ptstr = NULL;
char *szProto = GetContactProto(hContact);
bool proto_service = szProto && (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_INFOSETTINGSVC);
@@ -253,7 +253,7 @@ static INT_PTR CALLBACK SummaryDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
break;
case IDC_EMAIL:
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_EMAIL))) {
- TCHAR szExec[264], szEmail[256];
+ wchar_t szExec[264], szEmail[256];
GetDlgItemText(hwndDlg, IDC_EMAIL, szEmail, _countof(szEmail));
mir_sntprintf(szExec, L"mailto:%s", szEmail);
ShellExecute(hwndDlg, L"open", szExec, NULL, NULL, SW_SHOW);
@@ -282,7 +282,7 @@ static INT_PTR CALLBACK LocationDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
{
MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (hContact != NULL) {
- TCHAR szTime[80];
+ wchar_t szTime[80];
if (printDateTimeByContact(hContact, L"s", szTime, _countof(szTime), TZF_KNOWNONLY)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_LOCALTIME), FALSE);
SetDlgItemText(hwndDlg, IDC_LOCALTIME, TranslateT("<not specified>"));
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp
index 9e3d50ddda..0de846052e 100644
--- a/src/core/stduserinfo/src/userinfo.cpp
+++ b/src/core/stduserinfo/src/userinfo.cpp
@@ -46,7 +46,7 @@ struct DetailsPageData
HWND hwnd;
HTREEITEM hItem;
int changed, hLangpack;
- TCHAR *ptszTitle, *ptszTab;
+ wchar_t *ptszTitle, *ptszTab;
};
struct DetailsData
@@ -60,24 +60,24 @@ struct DetailsData
DetailsPageData *opd;
RECT rcDisplay, rcDisplayTab;
int updateAnimFrame;
- TCHAR szUpdating[64];
+ wchar_t szUpdating[64];
int *infosUpdated;
};
-TCHAR* getTitle(OPTIONSDIALOGPAGE *p)
+wchar_t* getTitle(OPTIONSDIALOGPAGE *p)
{
- return (p->flags & ODPF_DONTTRANSLATE) ? p->ptszTitle : TranslateTH(p->hLangpack, p->ptszTitle);
+ return (p->flags & ODPF_DONTTRANSLATE) ? p->pwszTitle : TranslateTH(p->hLangpack, p->pwszTitle);
}
-TCHAR* getTab(OPTIONSDIALOGPAGE *p)
+wchar_t* getTab(OPTIONSDIALOGPAGE *p)
{
- return (p->flags & ODPF_DONTTRANSLATE) ? p->ptszTab : TranslateTH(p->hLangpack, p->ptszTab);
+ return (p->flags & ODPF_DONTTRANSLATE) ? p->pwszTab : TranslateTH(p->hLangpack, p->pwszTab);
}
static int PageSortProc(OPTIONSDIALOGPAGE *item1, OPTIONSDIALOGPAGE *item2)
{
int res;
- TCHAR *s1 = getTitle(item1), *s2 = getTitle(item2);
+ wchar_t *s1 = getTitle(item1), *s2 = getTitle(item2);
if (!mir_tstrcmp(s1, TranslateT("Summary"))) return -1;
if (!mir_tstrcmp(s2, TranslateT("Summary"))) return 1;
if (res = mir_tstrcmp(s1, s2)) return res;
@@ -115,7 +115,7 @@ static INT_PTR ShowDetailsDialogCommand(WPARAM wParam, LPARAM)
psh.hwndParent = NULL;
psh.nPages = opi.pageCount;
psh.pStartPage = 0;
- psh.pszCaption = (TCHAR*)wParam; //more abuses of structure: this is hContact
+ psh.pszCaption = (wchar_t*)wParam; //more abuses of structure: this is hContact
psh.ppsp = (PROPSHEETPAGE*)opi.odp; //blatent misuse of the structure, but what the hell
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_DETAILS), NULL, DlgProcDetails, (LPARAM)&psh);
@@ -147,12 +147,12 @@ static INT_PTR AddDetailsPage(WPARAM wParam, LPARAM lParam)
dst->pszTemplate = ((DWORD_PTR)odp->pszTemplate & 0xFFFF0000) ? mir_strdup(odp->pszTemplate) : odp->pszTemplate;
if (odp->flags & ODPF_UNICODE) {
- dst->ptszTitle = (odp->ptszTitle == 0) ? NULL : mir_wstrdup(odp->ptszTitle);
- dst->ptszTab = (!(odp->flags & ODPF_USERINFOTAB) || !odp->ptszTab) ? NULL : mir_wstrdup(odp->ptszTab);
+ dst->pwszTitle = (odp->pwszTitle == 0) ? NULL : mir_wstrdup(odp->pwszTitle);
+ dst->pwszTab = (!(odp->flags & ODPF_USERINFOTAB) || !odp->pwszTab) ? NULL : mir_wstrdup(odp->pwszTab);
}
else {
- dst->ptszTitle = mir_a2t(odp->pszTitle);
- dst->ptszTab = (!(odp->flags & ODPF_USERINFOTAB) || !odp->pszTab) ? NULL : mir_a2t(odp->pszTab);
+ dst->pwszTitle = mir_a2t(odp->pszTitle);
+ dst->pwszTab = (!(odp->flags & ODPF_USERINFOTAB) || !odp->pszTab) ? NULL : mir_a2t(odp->pszTab);
}
dst->hLangpack = odp->hLangpack;
@@ -248,7 +248,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
WindowList_Add(hWindowList, hwndDlg, dat->hContact);
//////////////////////////////////////////////////////////////////////
- TCHAR *name, oldTitle[256], newTitle[256];
+ wchar_t *name, oldTitle[256], newTitle[256];
if (dat->hContact == NULL)
name = TranslateT("Owner");
else
@@ -269,7 +269,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
LPTSTR ptszLastTab;
DBVARIANT dbv;
if (!db_get_ts(NULL, "UserInfo", "LastTab", &dbv)) {
- ptszLastTab = NEWTSTR_ALLOCA(dbv.ptszVal);
+ ptszLastTab = NEWWSTR_ALLOCA(dbv.ptszVal);
db_free(&dbv);
}
else ptszLastTab = NULL;
@@ -289,8 +289,8 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
p.dlgParam = odp[i].dwInitParam;
p.hInst = odp[i].hInstance;
- p.ptszTitle = odp[i].ptszTitle;
- p.ptszTab = odp[i].ptszTab;
+ p.ptszTitle = odp[i].pwszTitle;
+ p.ptszTab = odp[i].pwszTab;
p.hLangpack = odp[i].hLangpack;
if (i && p.ptszTab && !mir_tstrcmp(dat->opd[i - 1].ptszTitle, p.ptszTitle)) {
@@ -354,7 +354,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
return TRUE;
case WM_TIMER:
- TCHAR str[128];
+ wchar_t str[128];
mir_sntprintf(str, L"%.*s%s%.*s", dat->updateAnimFrame % 10, L".........", dat->szUpdating, dat->updateAnimFrame % 10, L".........");
SetDlgItemText(hwndDlg, IDC_UPDATING, str);
if (++dat->updateAnimFrame == UPDATEANIMFRAMES)
@@ -580,7 +580,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
break;
case WM_DESTROY:
- TCHAR name[128];
+ wchar_t name[128];
TVITEM tvi;
tvi.mask = TVIF_TEXT;
tvi.hItem = dat->opd[dat->currentPage].hItem;
diff --git a/src/core/stduseronline/src/stdafx.h b/src/core/stduseronline/src/stdafx.h
index 10177ae864..2fda33718c 100644
--- a/src/core/stduseronline/src/stdafx.h
+++ b/src/core/stduseronline/src/stdafx.h
@@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <tchar.h>
#include <winsock2.h>
#include <shlobj.h>
#include <commctrl.h>
diff --git a/src/core/stduseronline/src/useronline.cpp b/src/core/stduseronline/src/useronline.cpp
index 20ba0e68cf..6106fd64a4 100644
--- a/src/core/stduseronline/src/useronline.cpp
+++ b/src/core/stduseronline/src/useronline.cpp
@@ -57,7 +57,7 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam)
DWORD ticked = db_get_dw(NULL, "UserOnline", cws->szModule, GetTickCount());
// only play the sound (or show event) if this event happens at least 10 secs after the proto went from offline
if (GetTickCount() - ticked > (1000*10)) {
- TCHAR tooltip[256];
+ wchar_t tooltip[256];
mir_sntprintf(tooltip, TranslateT("%s is online"), pcli->pfnGetContactDisplayName(hContact, 0));
CLISTEVENT cle = {};
diff --git a/src/mir_app/src/BaseExtraIcon.cpp b/src/mir_app/src/BaseExtraIcon.cpp
index 2ff3beaf3f..1aa6b40057 100644
--- a/src/mir_app/src/BaseExtraIcon.cpp
+++ b/src/mir_app/src/BaseExtraIcon.cpp
@@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA.
#include "extraicons.h"
-BaseExtraIcon::BaseExtraIcon(int id, const char *name, const TCHAR *description, const char *descIcon, MIRANDAHOOKPARAM OnClick, LPARAM param) :
+BaseExtraIcon::BaseExtraIcon(int id, const char *name, const wchar_t *description, const char *descIcon, MIRANDAHOOKPARAM OnClick, LPARAM param) :
ExtraIcon(name),
m_id(id),
m_OnClick(OnClick),
@@ -48,12 +48,12 @@ int BaseExtraIcon::getID() const
return m_id;
}
-const TCHAR* BaseExtraIcon::getDescription() const
+const wchar_t* BaseExtraIcon::getDescription() const
{
return m_tszDescription;
}
-void BaseExtraIcon::setDescription(const TCHAR *desc)
+void BaseExtraIcon::setDescription(const wchar_t *desc)
{
m_tszDescription = mir_tstrdup(desc);
}
diff --git a/src/mir_app/src/CallbackExtraIcon.cpp b/src/mir_app/src/CallbackExtraIcon.cpp
index bad538c5ab..ddf8fbffa7 100644
--- a/src/mir_app/src/CallbackExtraIcon.cpp
+++ b/src/mir_app/src/CallbackExtraIcon.cpp
@@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA.
#include "extraicons.h"
-CallbackExtraIcon::CallbackExtraIcon(int _id, const char *_name, const TCHAR *_description, const char *_descIcon,
+CallbackExtraIcon::CallbackExtraIcon(int _id, const char *_name, const wchar_t *_description, const char *_descIcon,
MIRANDAHOOK _RebuildIcons, MIRANDAHOOK _ApplyIcon, MIRANDAHOOKPARAM _OnClick, LPARAM _param) :
BaseExtraIcon(_id, _name, _description, _descIcon, _OnClick, _param),
m_pfnRebuildIcons(_RebuildIcons), m_pfnApplyIcon(_ApplyIcon), m_needToRebuild(true)
diff --git a/src/mir_app/src/ExtraIcon.h b/src/mir_app/src/ExtraIcon.h
index 3d00bf5a04..7b701c11c9 100644
--- a/src/mir_app/src/ExtraIcon.h
+++ b/src/mir_app/src/ExtraIcon.h
@@ -43,7 +43,7 @@ public:
virtual void storeIcon(MCONTACT, void*) {};
virtual const char *getName() const;
- virtual const TCHAR *getDescription() const = 0;
+ virtual const wchar_t *getDescription() const = 0;
virtual const char *getDescIcon() const = 0;
virtual int getType() const = 0;
@@ -72,12 +72,12 @@ protected:
class BaseExtraIcon : public ExtraIcon
{
public:
- BaseExtraIcon(int id, const char *name, const TCHAR *description, const char *descIcon, MIRANDAHOOKPARAM OnClick, LPARAM param);
+ BaseExtraIcon(int id, const char *name, const wchar_t *description, const char *descIcon, MIRANDAHOOKPARAM OnClick, LPARAM param);
virtual ~BaseExtraIcon();
virtual int getID() const;
- virtual const TCHAR *getDescription() const;
- virtual void setDescription(const TCHAR *desc);
+ virtual const wchar_t *getDescription() const;
+ virtual void setDescription(const wchar_t *desc);
virtual const char *getDescIcon() const;
virtual void setDescIcon(const char *icon);
virtual int getType() const =0;
@@ -101,7 +101,7 @@ protected:
class CallbackExtraIcon : public BaseExtraIcon
{
public:
- CallbackExtraIcon(int id, const char *name, const TCHAR *description, const char *descIcon,
+ CallbackExtraIcon(int id, const char *name, const wchar_t *description, const char *descIcon,
MIRANDAHOOK RebuildIcons, MIRANDAHOOK ApplyIcon, MIRANDAHOOKPARAM OnClick, LPARAM param);
virtual ~CallbackExtraIcon();
@@ -126,7 +126,7 @@ private:
class IcolibExtraIcon : public BaseExtraIcon
{
public:
- IcolibExtraIcon(int id, const char *name, const TCHAR *description, const char *descIcon, MIRANDAHOOKPARAM OnClick, LPARAM param);
+ IcolibExtraIcon(int id, const char *name, const wchar_t *description, const char *descIcon, MIRANDAHOOKPARAM OnClick, LPARAM param);
virtual ~IcolibExtraIcon();
virtual int getType() const;
@@ -158,7 +158,7 @@ public:
virtual int setIcon(int id, MCONTACT hContact, HANDLE icon);
virtual int setIconByName(int id, MCONTACT hContact, const char *icon);
- virtual const TCHAR* getDescription() const;
+ virtual const wchar_t* getDescription() const;
virtual const char* getDescIcon() const;
virtual int getType() const;
diff --git a/src/mir_app/src/ExtraIconGroup.cpp b/src/mir_app/src/ExtraIconGroup.cpp
index 5031889689..6ed364f50b 100644
--- a/src/mir_app/src/ExtraIconGroup.cpp
+++ b/src/mir_app/src/ExtraIconGroup.cpp
@@ -188,7 +188,7 @@ int ExtraIconGroup::internalSetIcon(int id, MCONTACT hContact, void *value, bool
return ret;
}
-const TCHAR* ExtraIconGroup::getDescription() const
+const wchar_t* ExtraIconGroup::getDescription() const
{
return m_tszDescription;
}
diff --git a/src/mir_app/src/FontOptions.cpp b/src/mir_app/src/FontOptions.cpp
index 55653f7dbc..ef20702b7a 100644
--- a/src/mir_app/src/FontOptions.cpp
+++ b/src/mir_app/src/FontOptions.cpp
@@ -131,9 +131,9 @@ static void WriteLine(FILE *out, const char pszText[])
fputc('\n', out);
}
-static BOOL ExportSettings(HWND hwndDlg, const TCHAR *filename, OBJLIST<FontInternal>& flist, OBJLIST<ColourInternal>& clist, OBJLIST<EffectInternal>& elist)
+static BOOL ExportSettings(HWND hwndDlg, const wchar_t *filename, OBJLIST<FontInternal>& flist, OBJLIST<ColourInternal>& clist, OBJLIST<EffectInternal>& elist)
{
- FILE *out = _tfopen(filename, L"w");
+ FILE *out = _wfopen(filename, L"w");
if (out == NULL) {
MessageBox(hwndDlg, filename, TranslateT("Failed to create file"), MB_ICONWARNING | MB_OK);
return FALSE;
@@ -253,7 +253,7 @@ struct FSUIListItemData
int effect_id;
};
-static BOOL sttFsuiBindColourIdToFonts(HWND hwndList, const TCHAR *name, const TCHAR *backgroundGroup, const TCHAR *backgroundName, int colourId)
+static BOOL sttFsuiBindColourIdToFonts(HWND hwndList, const wchar_t *name, const wchar_t *backgroundGroup, const wchar_t *backgroundName, int colourId)
{
BOOL res = FALSE;
for (int i = SendMessage(hwndList, LB_GETCOUNT, 0, 0); i--;) {
@@ -276,7 +276,7 @@ static BOOL sttFsuiBindColourIdToFonts(HWND hwndList, const TCHAR *name, const T
return res;
}
-static bool sttFsuiBindEffectIdToFonts(HWND hwndList, const TCHAR *name, int effectId)
+static bool sttFsuiBindEffectIdToFonts(HWND hwndList, const wchar_t *name, int effectId)
{
for (int i = SendMessage(hwndList, LB_GETCOUNT, 0, 0); i--;) {
FSUIListItemData *itemData = (FSUIListItemData *)SendMessage(hwndList, LB_GETITEMDATA, i, 0);
@@ -293,10 +293,10 @@ static bool sttFsuiBindEffectIdToFonts(HWND hwndList, const TCHAR *name, int eff
return false;
}
-static HTREEITEM sttFindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TCHAR *name)
+static HTREEITEM sttFindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const wchar_t *name)
{
TVITEM tvi = { 0 };
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
if (hItem)
tvi.hItem = TreeView_GetChild(hwndTree, hItem);
@@ -321,10 +321,10 @@ static HTREEITEM sttFindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TC
return NULL;
}
-static void sttFsuiCreateSettingsTreeNode(HWND hwndTree, const TCHAR *groupName, int _hLang)
+static void sttFsuiCreateSettingsTreeNode(HWND hwndTree, const wchar_t *groupName, int _hLang)
{
- TCHAR itemName[1024];
- TCHAR* sectionName;
+ wchar_t itemName[1024];
+ wchar_t* sectionName;
int sectionLevel = 0;
HTREEITEM hSection = NULL;
@@ -333,11 +333,11 @@ static void sttFsuiCreateSettingsTreeNode(HWND hwndTree, const TCHAR *groupName,
while (sectionName) {
// allow multi-level tree
- TCHAR* pItemName = sectionName;
+ wchar_t* pItemName = sectionName;
HTREEITEM hItem;
// one level deeper
- if (sectionName = _tcschr(sectionName, '/'))
+ if (sectionName = wcschr(sectionName, '/'))
*sectionName = 0;
pItemName = TranslateTH(_hLang, pItemName);
@@ -436,7 +436,7 @@ static void ShowEffectButton(HWND hwndDlg, BOOL bShow)
ShowWindow(GetDlgItem(hwndDlg, IDC_EFFECT_STATIC), bShow ? SW_SHOW : SW_HIDE);
}
-TCHAR* ModernEffectNames[] = { LPGENT("<none>"), LPGENT("Shadow at left"), LPGENT("Shadow at right"), LPGENT("Outline"), LPGENT("Outline smooth"), LPGENT("Smooth bump"), LPGENT("Contour thin"), LPGENT("Contour heavy") };
+wchar_t* ModernEffectNames[] = { LPGENW("<none>"), LPGENW("Shadow at left"), LPGENW("Shadow at right"), LPGENW("Outline"), LPGENW("Outline smooth"), LPGENW("Smooth bump"), LPGENW("Contour thin"), LPGENW("Contour heavy") };
static INT_PTR CALLBACK ChooseEffectDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
@@ -600,7 +600,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
tvi.mask = TVIF_HANDLE | TVIF_PARAM;
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_FONTGROUP), &tvi);
treeItem = (TreeItem *)tvi.lParam;
- TCHAR *group_buff = treeItem->groupName;
+ wchar_t *group_buff = treeItem->groupName;
sttFreeListItems(GetDlgItem(hwndDlg, IDC_FONTLIST));
SendDlgItemMessage(hwndDlg, IDC_FONTLIST, LB_RESETCONTENT, 0, 0);
@@ -612,7 +612,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
for (int fontId = 0; fontId < font_id_list_w2.getCount(); fontId++) {
FontInternal &F = font_id_list_w2[fontId];
- if (!_tcsncmp(F.group, group_buff, 64)) {
+ if (!wcsncmp(F.group, group_buff, 64)) {
FSUIListItemData *itemData = (FSUIListItemData*)mir_alloc(sizeof(FSUIListItemData));
itemData->colour_id = -1;
itemData->effect_id = -1;
@@ -629,7 +629,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
for (int colourId = 0; colourId < colour_id_list_w2.getCount(); colourId++) {
ColourInternal &C = colour_id_list_w2[colourId];
- if (!_tcsncmp(C.group, group_buff, 64)) {
+ if (!wcsncmp(C.group, group_buff, 64)) {
if (!sttFsuiBindColourIdToFonts(GetDlgItem(hwndDlg, IDC_FONTLIST), C.name, C.group, C.name, colourId)) {
FSUIListItemData *itemData = (FSUIListItemData*)mir_alloc(sizeof(FSUIListItemData));
itemData->colour_id = colourId;
@@ -649,7 +649,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
for (int effectId = 0; effectId < effect_id_list_w2.getCount(); effectId++) {
EffectInternal& E = effect_id_list_w2[effectId];
- if (!_tcsncmp(E.group, group_buff, 64)) {
+ if (!wcsncmp(E.group, group_buff, 64)) {
if (!sttFsuiBindEffectIdToFonts(GetDlgItem(hwndDlg, IDC_FONTLIST), E.name, effectId)) {
FSUIListItemData *itemData = (FSUIListItemData*)mir_alloc(sizeof(FSUIListItemData));
itemData->effect_id = effectId;
@@ -689,7 +689,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
HFONT hFont = NULL, hoFont = NULL;
BOOL bIsFont = FALSE;
- TCHAR *itemName = NULL;
+ wchar_t *itemName = NULL;
if (itemData->font_id >= 0) {
int iItem = itemData->font_id;
bIsFont = TRUE;
@@ -728,7 +728,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
COLORREF clBack = (COLORREF)-1;
COLORREF clText = GetSysColor(COLOR_WINDOWTEXT);
BOOL bIsFont = FALSE;
- TCHAR *itemName = NULL;
+ wchar_t *itemName = NULL;
FSUIListItemData *itemData = (FSUIListItemData *)dis->itemData;
FONTEFFECT * pEffect = NULL;
@@ -960,7 +960,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
F1.value.size = (char)lf.lfHeight;
F1.value.style = (lf.lfWeight >= FW_BOLD ? DBFONTF_BOLD : 0) | (lf.lfItalic ? DBFONTF_ITALIC : 0) | (lf.lfUnderline ? DBFONTF_UNDERLINE : 0) | (lf.lfStrikeOut ? DBFONTF_STRIKEOUT : 0);
F1.value.charset = lf.lfCharSet;
- _tcsncpy_s(F1.value.szFace, lf.lfFaceName, _TRUNCATE);
+ wcsncpy_s(F1.value.szFace, lf.lfFaceName, _TRUNCATE);
MEASUREITEMSTRUCT mis = { 0 };
mis.CtlID = IDC_FONTLIST;
@@ -1074,7 +1074,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
case IDC_BTN_EXPORT:
{
- TCHAR fname_buff[MAX_PATH], filter[MAX_PATH];
+ wchar_t fname_buff[MAX_PATH], filter[MAX_PATH];
mir_sntprintf(filter, L"%s (*.ini)%c*.ini%c%s (*.txt)%c*.TXT%c%s (*.*)%c*.*%c", TranslateT("Configuration files"), 0, 0, TranslateT("Text files"), 0, 0, TranslateT("All files"), 0, 0);
OPENFILENAME ofn = { 0 };
@@ -1298,7 +1298,7 @@ static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wPar
pf->value.size = (char)lf.lfHeight;
pf->value.style = (lf.lfWeight >= FW_BOLD ? DBFONTF_BOLD : 0) | (lf.lfItalic ? DBFONTF_ITALIC : 0) | (lf.lfUnderline ? DBFONTF_UNDERLINE : 0) | (lf.lfStrikeOut ? DBFONTF_STRIKEOUT : 0);
pf->value.charset = lf.lfCharSet;
- _tcsncpy_s(pf->value.szFace, lf.lfFaceName, _TRUNCATE);
+ wcsncpy_s(pf->value.szFace, lf.lfFaceName, _TRUNCATE);
InvalidateRect(GetDlgItem(hwndDlg, IDC_PREVIEWHEADER), NULL, TRUE);
InvalidateRect(GetDlgItem(hwndDlg, IDC_PREVIEWGENERAL), NULL, TRUE);
@@ -1355,7 +1355,7 @@ int FontsModernOptInit(WPARAM wParam, LPARAM)
obj.iSection = MODERNOPT_PAGE_SKINS;
obj.iType = MODERNOPT_TYPE_SUBSECTIONPAGE;
obj.iBoldControls = iBoldControls;
- obj.lptzSubsection = LPGENT("Fonts");
+ obj.lptzSubsection = LPGENW("Fonts");
obj.lpzClassicGroup = "Customize";
obj.lpzClassicPage = "Fonts";
obj.lpzHelpUrl = "http://wiki.miranda-ng.org/";
diff --git a/src/mir_app/src/FontService.cpp b/src/mir_app/src/FontService.cpp
index 21790e4369..6e1d678965 100644
--- a/src/mir_app/src/FontService.cpp
+++ b/src/mir_app/src/FontService.cpp
@@ -97,19 +97,19 @@ int LoadFontserviceModule(void)
// create generic fonts
FontIDT fontid = { sizeof(fontid) };
strncpy(fontid.dbSettingsGroup, "Fonts", sizeof(fontid.dbSettingsGroup));
- _tcsncpy_s(fontid.group, LPGENT("General"), _TRUNCATE);
+ wcsncpy_s(fontid.group, LPGENW("General"), _TRUNCATE);
- _tcsncpy_s(fontid.name, LPGENT("Headers"), _TRUNCATE);
+ wcsncpy_s(fontid.name, LPGENW("Headers"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSHEADER;
strncpy(fontid.prefix, "Header", _countof(fontid.prefix));
FontRegisterT(&fontid);
- _tcsncpy_s(fontid.name, LPGENT("Generic text"), _TRUNCATE);
+ wcsncpy_s(fontid.name, LPGENW("Generic text"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSGENERAL;
strncpy(fontid.prefix, "Generic", _countof(fontid.prefix));
FontRegisterT(&fontid);
- _tcsncpy_s(fontid.name, LPGENT("Small text"), _TRUNCATE);
+ wcsncpy_s(fontid.name, LPGENW("Small text"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSSMALL;
strncpy(fontid.prefix, "Small", _countof(fontid.prefix));
FontRegisterT(&fontid);
diff --git a/src/mir_app/src/FontService.h b/src/mir_app/src/FontService.h
index d530c311d7..9a1ea0c9d0 100644
--- a/src/mir_app/src/FontService.h
+++ b/src/mir_app/src/FontService.h
@@ -31,7 +31,7 @@ struct FontInternal : public FontIDT
FontSettingsT value;
int hLangpack;
- __inline TCHAR* getName() const { return TranslateTH(hLangpack, name); }
+ __inline wchar_t* getName() const { return TranslateTH(hLangpack, name); }
__inline bool isHeader() const
{
@@ -39,7 +39,7 @@ struct FontInternal : public FontIDT
return true;
if ((flags & FIDF_CLASSMASK) == 0)
- if (_tcsstr(name, L"Incoming nick") || _tcsstr(name, L"Outgoing nick") || _tcsstr(name, L"Incoming timestamp") || _tcsstr(name, L"Outgoing timestamp"))
+ if (wcsstr(name, L"Incoming nick") || wcsstr(name, L"Outgoing nick") || wcsstr(name, L"Incoming timestamp") || wcsstr(name, L"Outgoing timestamp"))
return true;
return false;
}
@@ -47,7 +47,7 @@ struct FontInternal : public FontIDT
struct ColourInternal : public ColourIDT
{
- __inline TCHAR* getName() const { return TranslateTH(hLangpack, name); }
+ __inline wchar_t* getName() const { return TranslateTH(hLangpack, name); }
COLORREF value;
int hLangpack;
@@ -55,7 +55,7 @@ struct ColourInternal : public ColourIDT
struct EffectInternal : public EffectIDT
{
- __inline TCHAR* getName() const { return TranslateTH(hLangpack, name); }
+ __inline wchar_t* getName() const { return TranslateTH(hLangpack, name); }
int hLangpack;
};
@@ -66,7 +66,7 @@ struct EffectInternal : public EffectIDT
typedef struct
{
char *paramName;
- TCHAR *groupName;
+ wchar_t *groupName;
}
TreeItem;
diff --git a/src/mir_app/src/IcoLib.h b/src/mir_app/src/IcoLib.h
index 67e1ea779c..2d8932e406 100644
--- a/src/mir_app/src/IcoLib.h
+++ b/src/mir_app/src/IcoLib.h
@@ -37,7 +37,7 @@ struct SectionItem : public MZeroedObject
struct IconSourceFile
{
int ref_count;
- TCHAR file[MAX_PATH];
+ wchar_t file[MAX_PATH];
};
struct IconSourceItemKey
@@ -78,7 +78,7 @@ struct IcolibItem : public MZeroedObject
char* name;
SectionItem* section;
int orderID;
- TCHAR* description;
+ wchar_t* description;
IconSourceFile* default_file;
int default_indx;
int cx, cy;
@@ -88,12 +88,12 @@ struct IcolibItem : public MZeroedObject
IconSourceItem* source_big;
IconSourceItem* default_icon;
- TCHAR* temp_file;
+ wchar_t* temp_file;
HICON temp_icon;
BOOL temp_reset;
__inline ~IcolibItem() { clear(); }
- __inline TCHAR* getDescr() const { return TranslateTH(hLangpack, description); }
+ __inline wchar_t* getDescr() const { return TranslateTH(hLangpack, description); }
void clear();
};
@@ -104,7 +104,7 @@ UINT _ExtractIconEx(LPCTSTR lpszFile, int iconIndex, int cxIcon, int cyIcon, HIC
void __fastcall SafeDestroyIcon(HICON &icon);
-IconSourceItem* GetIconSourceItem(const TCHAR* file, int indx, int cxIcon, int cyIcon);
+IconSourceItem* GetIconSourceItem(const wchar_t* file, int indx, int cxIcon, int cyIcon);
IcolibItem* IcoLib_FindHIcon(HICON hIcon, bool &big);
IcolibItem* IcoLib_FindIcon(const char* pszIconName);
diff --git a/src/mir_app/src/IcolibExtraIcon.cpp b/src/mir_app/src/IcolibExtraIcon.cpp
index 2ee93720e4..3ce8671e50 100644
--- a/src/mir_app/src/IcolibExtraIcon.cpp
+++ b/src/mir_app/src/IcolibExtraIcon.cpp
@@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA.
#include "IcoLib.h"
-IcolibExtraIcon::IcolibExtraIcon(int _id, const char *_name, const TCHAR *_description, const char *_descIcon,
+IcolibExtraIcon::IcolibExtraIcon(int _id, const char *_name, const wchar_t *_description, const char *_descIcon,
MIRANDAHOOKPARAM _OnClick, LPARAM _param) :
BaseExtraIcon(_id, _name, _description, _descIcon, _OnClick, _param)
{
diff --git a/src/mir_app/src/addcontact.cpp b/src/mir_app/src/addcontact.cpp
index 34d314ef62..e9a729541f 100644
--- a/src/mir_app/src/addcontact.cpp
+++ b/src/mir_app/src/addcontact.cpp
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-static TCHAR* sttDecodeString(DWORD dwFlags, MAllStrings &src)
+static wchar_t* sttDecodeString(DWORD dwFlags, MAllStrings &src)
{
if (dwFlags & PSR_UNICODE)
return mir_u2t(src.w);
@@ -77,7 +77,7 @@ public:
}
MCONTACT hContact;
- TCHAR *szName = NULL, *tmpStr = NULL;
+ wchar_t *szName = NULL, *tmpStr = NULL;
if (m_acs.handleType == HANDLE_CONTACT)
szName = cli.pfnGetContactDisplayName(hContact = m_acs.hContact, 0);
else {
@@ -121,7 +121,7 @@ public:
int groupSel = 0;
ptrT tszGroup(db_get_tsa(hContact, "CList", "Group"));
- TCHAR *grpName;
+ wchar_t *grpName;
for (int groupId = 1; (grpName = Clist_GroupGetName(groupId, NULL)) != NULL; groupId++) {
int id = m_group.AddString(grpName, groupId);
if (!mir_tstrcmpi(tszGroup, grpName))
diff --git a/src/mir_app/src/button.cpp b/src/mir_app/src/button.cpp
index d831d1b4d3..f687df9c8b 100644
--- a/src/mir_app/src/button.cpp
+++ b/src/mir_app/src/button.cpp
@@ -203,7 +203,7 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint)
HFONT hOldFont = (HFONT)SelectObject(hdcMem, ctl->hFont);
SIZE sz;
- TCHAR szText[MAX_PATH];
+ wchar_t szText[MAX_PATH];
GetWindowText(ctl->hwnd, szText, _countof(szText));
GetTextExtentPoint32(hdcMem, szText, (int)mir_tstrlen(szText), &sz);
int xOffset = (rcClient.right - rcClient.left - sz.cx)/2;
@@ -307,7 +307,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
case WM_SETTEXT:
bct->cHot = 0;
if (lParam != 0) {
- TCHAR *tmp = (TCHAR*)lParam;
+ wchar_t *tmp = (wchar_t*)lParam;
while (*tmp) {
if (*tmp == '&' && *(tmp+1)) {
bct->cHot = _tolower(*(tmp+1));
@@ -486,7 +486,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
ti.uFlags = TTF_IDISHWND|TTF_SUBCLASS;
ti.uId = (UINT_PTR)bct->hwnd;
if (lParam & BATF_UNICODE)
- ti.lpszText = mir_wstrdup(TranslateW((WCHAR*)wParam));
+ ti.lpszText = mir_wstrdup(TranslateTS((WCHAR*)wParam));
else
ti.lpszText = Langpack_PcharToTchar((char*)wParam);
if (bct->pAccPropServices) {
diff --git a/src/mir_app/src/chat.h b/src/mir_app/src/chat.h
index 26bd0710de..7f493c3bcf 100644
--- a/src/mir_app/src/chat.h
+++ b/src/mir_app/src/chat.h
@@ -38,7 +38,7 @@ struct GCPTRS
extern HGENMENU hJoinMenuItem, hLeaveMenuItem;
extern GlobalLogSettingsBase *g_Settings;
extern int g_cbSession, g_cbModuleInfo, g_iFontMode, g_iChatLang;
-extern TCHAR *g_szFontGroup;
+extern wchar_t *g_szFontGroup;
extern mir_cs cs;
extern char* pLogIconBmpBits[14];
@@ -47,17 +47,17 @@ extern size_t logIconBmpSize[14];
// log.c
void LoadMsgLogBitmaps(void);
void FreeMsgLogBitmaps(void);
-void ValidateFilename (TCHAR *filename);
-TCHAR* MakeTimeStamp(TCHAR *pszStamp, time_t time);
-TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime);
+void ValidateFilename (wchar_t *filename);
+wchar_t* MakeTimeStamp(wchar_t *pszStamp, time_t time);
+wchar_t* GetChatLogsFilename(SESSION_INFO *si, time_t tTime);
char* Log_CreateRtfHeader(MODULEINFO *mi);
char* Log_CreateRTF(LOGSTREAMDATA *streamData);
char* Log_SetStyle(int style);
// clist.c
-BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, TCHAR* fmt, ...);
-MCONTACT AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDisplayName, int iType);
-MCONTACT FindRoom(const char *pszModule, const TCHAR *pszRoom);
+BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, wchar_t* fmt, ...);
+MCONTACT AddRoom(const char *pszModule, const wchar_t *pszRoom, const wchar_t *pszDisplayName, int iType);
+MCONTACT FindRoom(const char *pszModule, const wchar_t *pszRoom);
BOOL SetAllOffline(BOOL bHide, const char *pszModule);
BOOL SetOffline(MCONTACT hContact, BOOL bHide);
@@ -87,24 +87,24 @@ int LoadChatModule(void);
void UnloadChatModule(void);
// tools.c
-int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors);
-int GetTextPixelSize(TCHAR* pszText, HFONT hFont, BOOL bWidth);
-TCHAR *RemoveFormatting(const TCHAR* pszText);
+int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors);
+int GetTextPixelSize(wchar_t* pszText, HFONT hFont, BOOL bWidth);
+wchar_t *RemoveFormatting(const wchar_t* pszText);
BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight, int bManyFix);
int GetColorIndex(const char *pszModule, COLORREF cr);
void CheckColorsInModule(const char *pszModule);
int GetRichTextLength(HWND hwnd);
BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *pszText);
-UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, TCHAR* pszUID, TCHAR* pszWordText);
+UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *si, wchar_t* pszUID, wchar_t* pszWordText);
void DestroyGCMenu(HMENU *hMenu, int iIndex);
-BOOL DoEventHookAsync(HWND hwnd, const TCHAR *pszID, const char *pszModule, int iType, const TCHAR* pszUID, const TCHAR* pszText, INT_PTR dwItem);
-BOOL DoEventHook(const TCHAR *pszID, const char *pszModule, int iType, const TCHAR *pszUID, const TCHAR* pszText, INT_PTR dwItem);
+BOOL DoEventHookAsync(HWND hwnd, const wchar_t *pszID, const char *pszModule, int iType, const wchar_t* pszUID, const wchar_t* pszText, INT_PTR dwItem);
+BOOL DoEventHook(const wchar_t *pszID, const char *pszModule, int iType, const wchar_t *pszUID, const wchar_t* pszText, INT_PTR dwItem);
BOOL IsEventSupported(int eventType);
BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce);
BOOL DoTrayIcon(SESSION_INFO *si, GCEVENT *gce);
BOOL DoPopup(SESSION_INFO *si, GCEVENT *gce);
-int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR* pszRoomName, COLORREF crBkg, const TCHAR* fmt, ...);
+int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, wchar_t* pszRoomName, COLORREF crBkg, const wchar_t* fmt, ...);
-const TCHAR* my_strstri(const TCHAR* s1, const TCHAR* s2);
+const wchar_t* my_strstri(const wchar_t* s1, const wchar_t* s2);
#pragma comment(lib,"comctl32.lib")
diff --git a/src/mir_app/src/chat_clist.cpp b/src/mir_app/src/chat_clist.cpp
index 1c47006d0b..755904e390 100644
--- a/src/mir_app/src/chat_clist.cpp
+++ b/src/mir_app/src/chat_clist.cpp
@@ -22,12 +22,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "chat.h"
-MCONTACT AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDisplayName, int iType)
+MCONTACT AddRoom(const char *pszModule, const wchar_t *pszRoom, const wchar_t *pszDisplayName, int iType)
{
- TCHAR pszGroup[50]; *pszGroup = '\0';
+ wchar_t pszGroup[50]; *pszGroup = '\0';
ptrT groupName(db_get_tsa(NULL, CHAT_MODULE, "AddToGroup"));
if (groupName)
- _tcsncpy_s(pszGroup, groupName, _TRUNCATE);
+ wcsncpy_s(pszGroup, groupName, _TRUNCATE);
else
mir_tstrcpy(pszGroup, L"Chat rooms");
@@ -176,12 +176,12 @@ int PrebuildContactMenu(WPARAM hContact, LPARAM)
if (db_get_w(hContact, szProto, "Status", 0) == ID_STATUS_OFFLINE) {
if (ProtoServiceExists(szProto, PS_JOINCHAT)) {
bEnabledJoin = true;
- Menu_ModifyItem(hJoinMenuItem, LPGENT("&Join chat"));
+ Menu_ModifyItem(hJoinMenuItem, LPGENW("&Join chat"));
}
}
else {
bEnabledJoin = true;
- Menu_ModifyItem(hJoinMenuItem, LPGENT("&Open chat window"));
+ Menu_ModifyItem(hJoinMenuItem, LPGENW("&Open chat window"));
}
}
bEnabledLeave = ProtoServiceExists(szProto, PS_LEAVECHAT) != 0;
@@ -198,9 +198,9 @@ INT_PTR PrebuildContactMenuSvc(WPARAM wParam, LPARAM lParam)
return PrebuildContactMenu(wParam, lParam);
}
-BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, TCHAR* fmt, ...)
+BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, wchar_t* fmt, ...)
{
- TCHAR szBuf[4096];
+ wchar_t szBuf[4096];
if (!fmt || !fmt[0] || mir_tstrlen(fmt) > 2000)
return FALSE;
@@ -229,7 +229,7 @@ BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, TCHAR* fm
return TRUE;
}
-MCONTACT FindRoom(const char *pszModule, const TCHAR *pszRoom)
+MCONTACT FindRoom(const char *pszModule, const wchar_t *pszRoom)
{
for (MCONTACT hContact = db_find_first(pszModule); hContact; hContact = db_find_next(hContact, pszModule)) {
if (!db_get_b(hContact, pszModule, "ChatRoom", 0))
diff --git a/src/mir_app/src/chat_log.cpp b/src/mir_app/src/chat_log.cpp
index ac2a9ba75e..590ceb0f9d 100644
--- a/src/mir_app/src/chat_log.cpp
+++ b/src/mir_app/src/chat_log.cpp
@@ -104,11 +104,11 @@ static void Log_Append(char *&buffer, size_t &cbBufferEnd, size_t &cbBufferAlloc
cbBufferEnd += charsDone;
}
-static int Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, char *&buffer, size_t &cbBufferEnd, size_t &cbBufferAlloced, const TCHAR *fmt, ...)
+static int Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, char *&buffer, size_t &cbBufferEnd, size_t &cbBufferAlloced, const wchar_t *fmt, ...)
{
va_list va;
int lineLen, textCharsCount = 0;
- TCHAR* line = (TCHAR*)alloca(8001 * sizeof(TCHAR));
+ wchar_t* line = (wchar_t*)alloca(8001 * sizeof(wchar_t));
va_start(va, fmt);
lineLen = mir_vsntprintf(line, 8000, fmt, va);
@@ -150,14 +150,14 @@ static int Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, char *&buff
line += 2;
else if (line[1] != '\0' && line[2] != '\0') {
- TCHAR szTemp3[3], c = *line;
+ wchar_t szTemp3[3], c = *line;
int col;
szTemp3[0] = line[1];
szTemp3[1] = line[2];
szTemp3[2] = '\0';
line += 2;
- col = _ttoi(szTemp3);
+ col = _wtoi(szTemp3);
col += (OPTIONS_FONTCOUNT + 1);
mir_snprintf(szTemp, (c == 'c') ? "\\cf%u " : "\\highlight%u ", col);
}
@@ -222,8 +222,8 @@ static int Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, char *&buff
static void AddEventToBuffer(char *&buffer, size_t &bufferEnd, size_t &bufferAlloced, LOGSTREAMDATA *streamData)
{
- TCHAR szTemp[512], szTemp2[512];
- TCHAR* pszNick = NULL;
+ wchar_t szTemp[512], szTemp2[512];
+ wchar_t* pszNick = NULL;
if (streamData->lin->ptszNick) {
if (g_Settings->bLogLimitNames && mir_tstrlen(streamData->lin->ptszNick) > 20) {
mir_tstrncpy(szTemp2, streamData->lin->ptszNick, 20);
@@ -234,7 +234,7 @@ static void AddEventToBuffer(char *&buffer, size_t &bufferEnd, size_t &bufferAll
if (streamData->lin->ptszUserInfo)
mir_sntprintf(szTemp, L"%s (%s)", szTemp2, streamData->lin->ptszUserInfo);
else
- _tcsncpy_s(szTemp, szTemp2, _TRUNCATE);
+ wcsncpy_s(szTemp, szTemp2, _TRUNCATE);
pszNick = szTemp;
}
@@ -312,11 +312,11 @@ static void AddEventToBuffer(char *&buffer, size_t &bufferEnd, size_t &bufferAll
}
}
-TCHAR* MakeTimeStamp(TCHAR *pszStamp, time_t time)
+wchar_t* MakeTimeStamp(wchar_t *pszStamp, time_t time)
{
- static TCHAR szTime[30];
- if (!_tcsftime(szTime, _countof(szTime)-1, pszStamp, localtime(&time)))
- _tcsncpy_s(szTime, TranslateT("<invalid>"), _TRUNCATE);
+ static wchar_t szTime[30];
+ if (!wcsftime(szTime, _countof(szTime)-1, pszStamp, localtime(&time)))
+ wcsncpy_s(szTime, TranslateT("<invalid>"), _TRUNCATE);
return szTime;
}
@@ -380,7 +380,7 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData)
//insert timestamp
if (g_Settings->bShowTime) {
- TCHAR szTimeStamp[30], szOldTimeStamp[30];
+ wchar_t szTimeStamp[30], szOldTimeStamp[30];
mir_tstrncpy(szTimeStamp, MakeTimeStamp(g_Settings->pszTimeStamp, lin->time), 30);
mir_tstrncpy(szOldTimeStamp, MakeTimeStamp(g_Settings->pszTimeStamp, streamData->si->LastTime), 30);
@@ -393,11 +393,11 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData)
// Insert the nick
if (lin->ptszNick && lin->iType == GC_EVENT_MESSAGE) {
- TCHAR pszTemp[300], *p1;
+ wchar_t pszTemp[300], *p1;
Log_Append(buffer, bufferEnd, bufferAlloced, "%s ", Log_SetStyle(lin->bIsMe ? 2 : 1));
mir_tstrncpy(pszTemp, lin->bIsMe ? g_Settings->pszOutgoingNick : g_Settings->pszIncomingNick, 299);
- p1 = _tcsstr(pszTemp, L"%n");
+ p1 = wcsstr(pszTemp, L"%n");
if (p1)
p1[1] = 's';
diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp
index c2bc66db1a..0e3a3bf276 100644
--- a/src/mir_app/src/chat_manager.cpp
+++ b/src/mir_app/src/chat_manager.cpp
@@ -38,7 +38,7 @@ static void SetActiveSessionEx(SESSION_INFO *si)
}
}
-static void SetActiveSession(const TCHAR *pszID, const char *pszModule)
+static void SetActiveSession(const wchar_t *pszID, const char *pszModule)
{
SESSION_INFO *si = chatApi.SM_FindSession(pszID, pszModule);
if (si)
@@ -60,7 +60,7 @@ static SESSION_INFO* GetActiveSession(void)
// Keeps track of all sessions and its windows
//---------------------------------------------------
-static SESSION_INFO* SM_AddSession(const TCHAR *pszID, const char *pszModule)
+static SESSION_INFO* SM_AddSession(const wchar_t *pszID, const char *pszModule)
{
if (!pszID || !pszModule)
return NULL;
@@ -114,7 +114,7 @@ static void SM_FreeSession(SESSION_INFO *si)
mir_free(si);
}
-static int SM_RemoveSession(const TCHAR *pszID, const char *pszModule, BOOL removeContact)
+static int SM_RemoveSession(const wchar_t *pszID, const char *pszModule, BOOL removeContact)
{
if (!pszModule)
return FALSE;
@@ -156,7 +156,7 @@ static int SM_RemoveSession(const TCHAR *pszID, const char *pszModule, BOOL remo
return FALSE;
}
-static SESSION_INFO* SM_FindSession(const TCHAR *pszID, const char *pszModule)
+static SESSION_INFO* SM_FindSession(const wchar_t *pszID, const char *pszModule)
{
if (!pszID || !pszModule)
return NULL;
@@ -168,7 +168,7 @@ static SESSION_INFO* SM_FindSession(const TCHAR *pszID, const char *pszModule)
return NULL;
}
-static BOOL SM_SetOffline(const TCHAR *pszID, const char *pszModule)
+static BOOL SM_SetOffline(const wchar_t *pszID, const char *pszModule)
{
if (!pszModule)
return FALSE;
@@ -190,7 +190,7 @@ static BOOL SM_SetOffline(const TCHAR *pszID, const char *pszModule)
return TRUE;
}
-static BOOL SM_SetStatusEx(const TCHAR *pszID, const char *pszModule, const TCHAR* pszText, int flags)
+static BOOL SM_SetStatusEx(const wchar_t *pszID, const char *pszModule, const wchar_t* pszText, int flags)
{
if (!pszModule)
return FALSE;
@@ -248,7 +248,7 @@ static BOOL SM_AddEventToAllMatchingUID(GCEVENT *gce)
return 0;
}
-static BOOL SM_AddEvent(const TCHAR *pszID, const char *pszModule, GCEVENT *gce, BOOL bIsHighlighted)
+static BOOL SM_AddEvent(const wchar_t *pszID, const char *pszModule, GCEVENT *gce, BOOL bIsHighlighted)
{
SESSION_INFO *p = SM_FindSession(pszID, pszModule);
if (p == NULL)
@@ -276,7 +276,7 @@ static BOOL SM_AddEvent(const TCHAR *pszID, const char *pszModule, GCEVENT *gce,
return TRUE;
}
-static USERINFO* SM_AddUser(const TCHAR *pszID, const char *pszModule, const TCHAR *pszUID, const TCHAR *pszNick, WORD wStatus)
+static USERINFO* SM_AddUser(const wchar_t *pszID, const char *pszModule, const wchar_t *pszUID, const wchar_t *pszNick, WORD wStatus)
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -289,7 +289,7 @@ static USERINFO* SM_AddUser(const TCHAR *pszID, const char *pszModule, const TCH
return p;
}
-static BOOL SM_MoveUser(const TCHAR *pszID, const char *pszModule, const TCHAR *pszUID)
+static BOOL SM_MoveUser(const wchar_t *pszID, const char *pszModule, const wchar_t *pszUID)
{
if (!pszUID)
return FALSE;
@@ -302,7 +302,7 @@ static BOOL SM_MoveUser(const TCHAR *pszID, const char *pszModule, const TCHAR *
return TRUE;
}
-static BOOL SM_RemoveUser(const TCHAR *pszID, const char *pszModule, const TCHAR *pszUID)
+static BOOL SM_RemoveUser(const wchar_t *pszID, const char *pszModule, const wchar_t *pszUID)
{
if (!pszModule || !pszUID)
return FALSE;
@@ -332,13 +332,13 @@ static BOOL SM_RemoveUser(const TCHAR *pszID, const char *pszModule, const TCHAR
return 0;
}
-static USERINFO* SM_GetUserFromIndex(const TCHAR *pszID, const char *pszModule, int index)
+static USERINFO* SM_GetUserFromIndex(const wchar_t *pszID, const char *pszModule, int index)
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
return (si == NULL) ? NULL : chatApi.UM_FindUserFromIndex(si->pUsers, index);
}
-STATUSINFO* SM_AddStatus(const TCHAR *pszID, const char *pszModule, const TCHAR *pszStatus)
+STATUSINFO* SM_AddStatus(const wchar_t *pszID, const char *pszModule, const wchar_t *pszStatus)
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -352,7 +352,7 @@ STATUSINFO* SM_AddStatus(const TCHAR *pszID, const char *pszModule, const TCHAR
return ti;
}
-static BOOL SM_GiveStatus(const TCHAR *pszID, const char *pszModule, const TCHAR *pszUID, const TCHAR *pszStatus)
+static BOOL SM_GiveStatus(const wchar_t *pszID, const char *pszModule, const wchar_t *pszUID, const wchar_t *pszStatus)
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -367,7 +367,7 @@ static BOOL SM_GiveStatus(const TCHAR *pszID, const char *pszModule, const TCHAR
return TRUE;
}
-static BOOL SM_SetContactStatus(const TCHAR *pszID, const char *pszModule, const TCHAR *pszUID, WORD wStatus)
+static BOOL SM_SetContactStatus(const wchar_t *pszID, const char *pszModule, const wchar_t *pszUID, WORD wStatus)
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -382,7 +382,7 @@ static BOOL SM_SetContactStatus(const TCHAR *pszID, const char *pszModule, const
return TRUE;
}
-static BOOL SM_TakeStatus(const TCHAR *pszID, const char *pszModule, const TCHAR *pszUID, const TCHAR *pszStatus)
+static BOOL SM_TakeStatus(const wchar_t *pszID, const char *pszModule, const wchar_t *pszUID, const wchar_t *pszStatus)
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -397,7 +397,7 @@ static BOOL SM_TakeStatus(const TCHAR *pszID, const char *pszModule, const TCHAR
return TRUE;
}
-static LRESULT SM_SendMessage(const TCHAR *pszID, const char *pszModule, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT SM_SendMessage(const wchar_t *pszID, const char *pszModule, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (pszModule == NULL)
return 0;
@@ -417,7 +417,7 @@ static LRESULT SM_SendMessage(const TCHAR *pszID, const char *pszModule, UINT ms
return 0;
}
-static BOOL SM_PostMessage(const TCHAR *pszID, const char *pszModule, UINT msg, WPARAM wParam, LPARAM lParam)
+static BOOL SM_PostMessage(const wchar_t *pszID, const char *pszModule, UINT msg, WPARAM wParam, LPARAM lParam)
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -444,7 +444,7 @@ static BOOL SM_BroadcastMessage(const char *pszModule, UINT msg, WPARAM wParam,
return TRUE;
}
-static BOOL SM_SetStatus(const TCHAR *pszID, const char *pszModule, int wStatus)
+static BOOL SM_SetStatus(const wchar_t *pszID, const char *pszModule, int wStatus)
{
if (!pszModule)
return FALSE;
@@ -470,7 +470,7 @@ static BOOL SM_SetStatus(const TCHAR *pszID, const char *pszModule, int wStatus)
return TRUE;
}
-static BOOL SM_SendUserMessage(const TCHAR *pszID, const char *pszModule, const TCHAR* pszText)
+static BOOL SM_SendUserMessage(const wchar_t *pszID, const char *pszModule, const wchar_t* pszText)
{
if (!pszModule || !pszText)
return FALSE;
@@ -487,7 +487,7 @@ static BOOL SM_SendUserMessage(const TCHAR *pszID, const char *pszModule, const
return TRUE;
}
-static BOOL SM_ChangeUID(const TCHAR *pszID, const char *pszModule, const TCHAR *pszUID, const TCHAR* pszNewUID)
+static BOOL SM_ChangeUID(const wchar_t *pszID, const char *pszModule, const wchar_t *pszUID, const wchar_t* pszNewUID)
{
if (!pszModule)
return FALSE;
@@ -505,7 +505,7 @@ static BOOL SM_ChangeUID(const TCHAR *pszID, const char *pszModule, const TCHAR
return TRUE;
}
-static BOOL SM_ChangeNick(const TCHAR *pszID, const char *pszModule, GCEVENT *gce)
+static BOOL SM_ChangeNick(const wchar_t *pszID, const char *pszModule, GCEVENT *gce)
{
if (!pszModule)
return FALSE;
@@ -556,7 +556,7 @@ static BOOL SM_RemoveAll(void)
return TRUE;
}
-static void SM_AddCommand(const TCHAR *pszID, const char *pszModule, const char* lpNewCommand)
+static void SM_AddCommand(const wchar_t *pszID, const char *pszModule, const char* lpNewCommand)
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -591,7 +591,7 @@ static void SM_AddCommand(const TCHAR *pszID, const char *pszModule, const char*
}
}
-static char* SM_GetPrevCommand(const TCHAR *pszID, const char *pszModule) // get previous command. returns NULL if previous command does not exist. current command remains as it was.
+static char* SM_GetPrevCommand(const wchar_t *pszID, const char *pszModule) // get previous command. returns NULL if previous command does not exist. current command remains as it was.
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -610,7 +610,7 @@ static char* SM_GetPrevCommand(const TCHAR *pszID, const char *pszModule) // get
return (pPrevCmd) ? pPrevCmd->lpCommand : NULL;
}
-static char* SM_GetNextCommand(const TCHAR *pszID, const char *pszModule) // get next command. returns NULL if next command does not exist. current command becomes NULL (a prev command after this one will get you the last command)
+static char* SM_GetNextCommand(const wchar_t *pszID, const char *pszModule) // get next command. returns NULL if next command does not exist. current command becomes NULL (a prev command after this one will get you the last command)
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -787,7 +787,7 @@ static BOOL MM_RemoveAll(void)
// per window nicklist that is available
//---------------------------------------------------
-static STATUSINFO* TM_AddStatus(STATUSINFO **ppStatusList, const TCHAR *pszStatus, int *iCount)
+static STATUSINFO* TM_AddStatus(STATUSINFO **ppStatusList, const wchar_t *pszStatus, int *iCount)
{
if (!ppStatusList || !pszStatus)
return NULL;
@@ -816,7 +816,7 @@ static STATUSINFO* TM_AddStatus(STATUSINFO **ppStatusList, const TCHAR *pszStatu
return FALSE;
}
-static STATUSINFO* TM_FindStatus(STATUSINFO *pStatusList, const TCHAR *pszStatus)
+static STATUSINFO* TM_FindStatus(STATUSINFO *pStatusList, const wchar_t *pszStatus)
{
if (!pStatusList || !pszStatus)
return NULL;
@@ -828,7 +828,7 @@ static STATUSINFO* TM_FindStatus(STATUSINFO *pStatusList, const TCHAR *pszStatus
return 0;
}
-static WORD TM_StringToWord(STATUSINFO *pStatusList, const TCHAR *pszStatus)
+static WORD TM_StringToWord(STATUSINFO *pStatusList, const wchar_t *pszStatus)
{
if (!pStatusList || !pszStatus)
return 0;
@@ -843,7 +843,7 @@ static WORD TM_StringToWord(STATUSINFO *pStatusList, const TCHAR *pszStatus)
return 0;
}
-static TCHAR* TM_WordToString(STATUSINFO *pStatusList, WORD Status)
+static wchar_t* TM_WordToString(STATUSINFO *pStatusList, WORD Status)
{
if (!pStatusList)
return NULL;
@@ -882,7 +882,7 @@ static BOOL TM_RemoveAll(STATUSINFO **ppStatusList)
// in a window nicklist
//---------------------------------------------------
-static int UM_CompareItem(USERINFO *u1, const TCHAR *pszNick, WORD wStatus)
+static int UM_CompareItem(USERINFO *u1, const wchar_t *pszNick, WORD wStatus)
{
WORD dw1 = u1->Status;
WORD dw2 = wStatus;
@@ -901,7 +901,7 @@ static int UM_CompareItem(USERINFO *u1, const TCHAR *pszNick, WORD wStatus)
return mir_tstrcmpi(u1->pszNick, pszNick);
}
-static USERINFO* UM_SortUser(USERINFO **ppUserList, const TCHAR *pszUID)
+static USERINFO* UM_SortUser(USERINFO **ppUserList, const wchar_t *pszUID)
{
USERINFO *ui = *ppUserList, *pLast = NULL;
if (!ui || !pszUID)
@@ -947,7 +947,7 @@ static USERINFO* UM_SortUser(USERINFO **ppUserList, const TCHAR *pszUID)
return node;
}
-USERINFO* UM_AddUser(STATUSINFO *pStatusList, USERINFO **ppUserList, const TCHAR *pszUID, const TCHAR *pszNick, WORD wStatus)
+USERINFO* UM_AddUser(STATUSINFO *pStatusList, USERINFO **ppUserList, const wchar_t *pszUID, const wchar_t *pszNick, WORD wStatus)
{
if (pStatusList == NULL || ppUserList == NULL || pszNick == NULL)
return NULL;
@@ -980,7 +980,7 @@ USERINFO* UM_AddUser(STATUSINFO *pStatusList, USERINFO **ppUserList, const TCHAR
return node;
}
-static USERINFO* UM_FindUser(USERINFO *pUserList, const TCHAR *pszUID)
+static USERINFO* UM_FindUser(USERINFO *pUserList, const wchar_t *pszUID)
{
if (!pUserList || !pszUID)
return NULL;
@@ -1006,7 +1006,7 @@ static USERINFO* UM_FindUserFromIndex(USERINFO *pUserList, int index)
return NULL;
}
-static USERINFO* UM_GiveStatus(USERINFO *pUserList, const TCHAR *pszUID, WORD status)
+static USERINFO* UM_GiveStatus(USERINFO *pUserList, const wchar_t *pszUID, WORD status)
{
USERINFO *ui = UM_FindUser(pUserList, pszUID);
if (ui == NULL)
@@ -1016,7 +1016,7 @@ static USERINFO* UM_GiveStatus(USERINFO *pUserList, const TCHAR *pszUID, WORD st
return ui;
}
-static USERINFO* UM_SetContactStatus(USERINFO *pUserList, const TCHAR *pszUID, WORD status)
+static USERINFO* UM_SetContactStatus(USERINFO *pUserList, const wchar_t *pszUID, WORD status)
{
USERINFO *ui = UM_FindUser(pUserList, pszUID);
if (ui == NULL)
@@ -1026,7 +1026,7 @@ static USERINFO* UM_SetContactStatus(USERINFO *pUserList, const TCHAR *pszUID, W
return ui;
}
-static BOOL UM_SetStatusEx(USERINFO *pUserList, const TCHAR* pszText, int flags)
+static BOOL UM_SetStatusEx(USERINFO *pUserList, const wchar_t* pszText, int flags)
{
int bOnlyMe = (flags & GC_SSE_ONLYLISTED) != 0, bSetStatus = (flags & GC_SSE_ONLINE) != 0;
char cDelimiter = (flags & GC_SSE_TABDELIMITED) ? '\t' : ' ';
@@ -1036,7 +1036,7 @@ static BOOL UM_SetStatusEx(USERINFO *pUserList, const TCHAR* pszText, int flags)
ui->iStatusEx = 0;
if (pszText != NULL) {
- TCHAR *s = (TCHAR *)_tcsstr(pszText, ui->pszUID);
+ wchar_t *s = (wchar_t *)wcsstr(pszText, ui->pszUID);
if (s) {
ui->iStatusEx = 0;
if (s == pszText || s[-1] == cDelimiter) {
@@ -1050,7 +1050,7 @@ static BOOL UM_SetStatusEx(USERINFO *pUserList, const TCHAR* pszText, int flags)
return TRUE;
}
-static USERINFO* UM_TakeStatus(USERINFO *pUserList, const TCHAR *pszUID, WORD status)
+static USERINFO* UM_TakeStatus(USERINFO *pUserList, const wchar_t *pszUID, WORD status)
{
USERINFO *ui = UM_FindUser(pUserList, pszUID);
if (ui == NULL)
@@ -1060,12 +1060,12 @@ static USERINFO* UM_TakeStatus(USERINFO *pUserList, const TCHAR *pszUID, WORD st
return ui;
}
-static TCHAR* UM_FindUserAutoComplete(USERINFO *pUserList, const TCHAR* pszOriginal, const TCHAR* pszCurrent)
+static wchar_t* UM_FindUserAutoComplete(USERINFO *pUserList, const wchar_t* pszOriginal, const wchar_t* pszCurrent)
{
if (!pUserList || !pszOriginal || !pszCurrent)
return NULL;
- TCHAR *pszName = NULL;
+ wchar_t *pszName = NULL;
for (USERINFO *ui = pUserList; ui != NULL; ui = ui->next)
if (ui->pszNick && my_strstri(ui->pszNick, pszOriginal) == ui->pszNick)
if (mir_tstrcmpi(ui->pszNick, pszCurrent) > 0 && (!pszName || mir_tstrcmpi(ui->pszNick, pszName) < 0))
@@ -1074,7 +1074,7 @@ static TCHAR* UM_FindUserAutoComplete(USERINFO *pUserList, const TCHAR* pszOrigi
return pszName;
}
-static BOOL UM_RemoveUser(USERINFO **ppUserList, const TCHAR *pszUID)
+static BOOL UM_RemoveUser(USERINFO **ppUserList, const wchar_t *pszUID)
{
if (!ppUserList || !pszUID)
return FALSE;
diff --git a/src/mir_app/src/chat_opts.cpp b/src/mir_app/src/chat_opts.cpp
index 238cc43008..0acccfbd2c 100644
--- a/src/mir_app/src/chat_opts.cpp
+++ b/src/mir_app/src/chat_opts.cpp
@@ -28,7 +28,7 @@ extern SESSION_INFO g_TabSession;
GlobalLogSettingsBase *g_Settings;
int g_cbSession, g_cbModuleInfo, g_iFontMode, g_iChatLang;
-TCHAR *g_szFontGroup;
+wchar_t *g_szFontGroup;
#define FONTF_BOLD 1
#define FONTF_ITALIC 2
@@ -47,26 +47,26 @@ static LOGFONT lfDefault;
static FontOptionsList fontOptionsList[] =
{
- { LPGENT("Timestamp"), RGB(50, 50, 240), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Others nicknames"), RGB(0, 0, 192), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
- { LPGENT("Your nickname"), RGB(0, 0, 192), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
- { LPGENT("User has joined"), RGB(90, 160, 90), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("User has left"), RGB(160, 160, 90), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("User has disconnected"), RGB(160, 90, 90), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("User kicked ..."), RGB(100, 100, 100), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("User is now known as ..."), RGB(90, 90, 160), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Notice from user"), RGB(160, 130, 60), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Incoming message"), RGB(90, 90, 90), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Outgoing message"), RGB(90, 90, 90), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("The topic is ..."), RGB(70, 70, 160), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Information messages"), RGB(130, 130, 195), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("User enables status for ..."), RGB(70, 150, 70), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("User disables status for ..."), RGB(150, 70, 70), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Action message"), RGB(160, 90, 160), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Highlighted message"), RGB(180, 150, 80), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Timestamp"), RGB(50, 50, 240), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Others nicknames"), RGB(0, 0, 192), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
+ { LPGENW("Your nickname"), RGB(0, 0, 192), lfDefault.lfFaceName, DEFAULT_CHARSET, FONTF_BOLD, -12 },
+ { LPGENW("User has joined"), RGB(90, 160, 90), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("User has left"), RGB(160, 160, 90), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("User has disconnected"), RGB(160, 90, 90), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("User kicked ..."), RGB(100, 100, 100), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("User is now known as ..."), RGB(90, 90, 160), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Notice from user"), RGB(160, 130, 60), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Incoming message"), RGB(90, 90, 90), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Outgoing message"), RGB(90, 90, 90), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("The topic is ..."), RGB(70, 70, 160), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Information messages"), RGB(130, 130, 195), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("User enables status for ..."), RGB(70, 150, 70), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("User disables status for ..."), RGB(150, 70, 70), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Action message"), RGB(160, 90, 160), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Highlighted message"), RGB(180, 150, 80), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
{ L"", 0, lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Nick list members (online)"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Nick list members (away)"), RGB(170, 170, 170), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }
+ { LPGENW("Nick list members (online)"), RGB(0, 0, 0), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 },
+ { LPGENW("Nick list members (away)"), RGB(170, 170, 170), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }
};
static void LoadColors()
@@ -124,7 +124,7 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour)
if (tszFace == NULL)
mir_tstrcpy(lf->lfFaceName, FO.szDefFace);
else
- _tcsncpy_s(lf->lfFaceName, tszFace, _TRUNCATE);
+ wcsncpy_s(lf->lfFaceName, tszFace, _TRUNCATE);
}
}
@@ -136,13 +136,13 @@ void RegisterFonts(void)
FontIDT fontid = { sizeof(fontid) };
fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID | FIDF_NEEDRESTART;
- _tcsncpy_s(fontid.backgroundGroup, g_szFontGroup, _TRUNCATE);
- _tcsncpy_s(fontid.group, g_szFontGroup, _TRUNCATE);
+ wcsncpy_s(fontid.backgroundGroup, g_szFontGroup, _TRUNCATE);
+ wcsncpy_s(fontid.group, g_szFontGroup, _TRUNCATE);
for (int i = 0; i < _countof(fontOptionsList); i++, index++) {
FontOptionsList &FO = fontOptionsList[i];
strncpy_s(fontid.dbSettingsGroup, CHATFONT_MODULE, _TRUNCATE);
- _tcsncpy_s(fontid.name, FO.szDescr, _TRUNCATE);
+ wcsncpy_s(fontid.name, FO.szDescr, _TRUNCATE);
mir_snprintf(fontid.prefix, "Font%d", index);
fontid.order = index;
@@ -150,28 +150,28 @@ void RegisterFonts(void)
switch (i) {
case 18:
case 19:
- _tcsncpy_s(fontid.backgroundName, LPGENT("Nick list background"), _TRUNCATE);
+ wcsncpy_s(fontid.backgroundName, LPGENW("Nick list background"), _TRUNCATE);
break;
case 17:
if (g_iFontMode == FONTMODE_SKIP)
continue;
if (g_iFontMode == FONTMODE_USE) {
- _tcsncpy_s(fontid.name, LPGENT("Message typing area"), _TRUNCATE);
- _tcsncpy_s(fontid.backgroundName, LPGENT("Message background"), _TRUNCATE);
+ wcsncpy_s(fontid.name, LPGENW("Message typing area"), _TRUNCATE);
+ wcsncpy_s(fontid.backgroundName, LPGENW("Message background"), _TRUNCATE);
FO.defColour = RGB(0, 0, 40);
break;
}
- _tcsncpy_s(fontid.name, LPGENT("Chat log symbols (Webdings)"), _TRUNCATE);
+ wcsncpy_s(fontid.name, LPGENW("Chat log symbols (Webdings)"), _TRUNCATE);
FO.szDefFace = L"Webdings";
FO.defColour = RGB(170, 170, 170);
FO.defCharset = SYMBOL_CHARSET;
// fall through
default:
- _tcsncpy_s(fontid.backgroundName, LPGENT("Group chat log background"), _TRUNCATE);
+ wcsncpy_s(fontid.backgroundName, LPGENW("Group chat log background"), _TRUNCATE);
break;
}
- _tcsncpy_s(fontid.deffontsettings.szFace, FO.szDefFace, _TRUNCATE);
+ wcsncpy_s(fontid.deffontsettings.szFace, FO.szDefFace, _TRUNCATE);
fontid.deffontsettings.charset = FO.defCharset;
fontid.deffontsettings.colour = FO.defColour;
fontid.deffontsettings.size = FO.defSize;
@@ -189,7 +189,7 @@ HICON LoadIconEx(char* pszIcoLibName, bool big)
return IcoLib_GetIcon(szTemp, big);
}
-static void InitSetting(TCHAR** ppPointer, char* pszSetting, TCHAR* pszDefault)
+static void InitSetting(wchar_t** ppPointer, char* pszSetting, wchar_t* pszDefault)
{
DBVARIANT dbv;
if (!db_get_ts(NULL, CHAT_MODULE, pszSetting, &dbv)) {
@@ -292,7 +292,7 @@ void SetIndentSize()
else g_Settings->LogTextIndent = 0;
}
-int GetTextPixelSize(TCHAR* pszText, HFONT hFont, BOOL bWidth)
+int GetTextPixelSize(wchar_t* pszText, HFONT hFont, BOOL bWidth)
{
if (!pszText || !hFont)
return 0;
diff --git a/src/mir_app/src/chat_rtf.cpp b/src/mir_app/src/chat_rtf.cpp
index d4382834b0..e2cf0addef 100644
--- a/src/mir_app/src/chat_rtf.cpp
+++ b/src/mir_app/src/chat_rtf.cpp
@@ -28,31 +28,31 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// convert rich edit code to bbcode (if wanted). Otherwise, strip all RTF formatting
// tags and return plain text
-static TCHAR tszRtfBreaks[] = L" \\\n\r";
+static wchar_t tszRtfBreaks[] = L" \\\n\r";
static void CreateColorMap(CMString &Text, int iCount, COLORREF *pSrc, int *pDst)
{
- const TCHAR *pszText = Text;
+ const wchar_t *pszText = Text;
int iIndex = 1;
- static const TCHAR *lpszFmt = L"\\red%[^ \x5b\\]\\green%[^ \x5b\\]\\blue%[^ \x5b;];";
- TCHAR szRed[10], szGreen[10], szBlue[10];
+ static const wchar_t *lpszFmt = L"\\red%[^ \x5b\\]\\green%[^ \x5b\\]\\blue%[^ \x5b;];";
+ wchar_t szRed[10], szGreen[10], szBlue[10];
- const TCHAR *p1 = _tcsstr(pszText, L"\\colortbl");
+ const wchar_t *p1 = wcsstr(pszText, L"\\colortbl");
if (!p1)
return;
- const TCHAR *pEnd = _tcschr(p1, '}');
+ const wchar_t *pEnd = wcschr(p1, '}');
- const TCHAR *p2 = _tcsstr(p1, L"\\red");
+ const wchar_t *p2 = wcsstr(p1, L"\\red");
for (int i = 0; i < iCount; i++)
pDst[i] = -1;
while (p2 && p2 < pEnd) {
- if (_stscanf(p2, lpszFmt, &szRed, &szGreen, &szBlue) > 0) {
+ if (swscanf(p2, lpszFmt, &szRed, &szGreen, &szBlue) > 0) {
for (int i = 0; i < iCount; i++) {
- if (pSrc[i] == RGB(_ttoi(szRed), _ttoi(szGreen), _ttoi(szBlue)))
+ if (pSrc[i] == RGB(_wtoi(szRed), _wtoi(szGreen), _wtoi(szBlue)))
pDst[i] = iIndex;
}
}
@@ -60,7 +60,7 @@ static void CreateColorMap(CMString &Text, int iCount, COLORREF *pSrc, int *pDst
p1 = p2;
p1++;
- p2 = _tcsstr(p1, L"\\red");
+ p2 = wcsstr(p1, L"\\red");
}
}
@@ -96,7 +96,7 @@ int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors)
CMString res;
// iterate through all characters, if rtf control character found then take action
- for (const TCHAR *p = pszText.GetString() + idx; *p;) {
+ for (const wchar_t *p = pszText.GetString() + idx; *p;) {
switch (*p) {
case '\\':
if (p[1] == '\\' || p[1] == '{' || p[1] == '}') { // escaped characters
@@ -108,79 +108,79 @@ int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors)
p += 2; break;
}
- if (!_tcsncmp(p, L"\\cf", 3)) { // foreground color
- int iCol = _ttoi(p + 3);
+ if (!wcsncmp(p, L"\\cf", 3)) { // foreground color
+ int iCol = _wtoi(p + 3);
int iInd = GetRtfIndex(iCol, iNumColors, pIndex);
bInsideColor = iInd > 0;
}
- else if (!_tcsncmp(p, L"\\highlight", 10)) { //background color
- TCHAR szTemp[20];
- int iCol = _ttoi(p + 10);
+ else if (!wcsncmp(p, L"\\highlight", 10)) { //background color
+ wchar_t szTemp[20];
+ int iCol = _wtoi(p + 10);
mir_sntprintf(szTemp, L"%d", iCol);
}
- else if (!_tcsncmp(p, L"\\line", 5)) { // soft line break;
+ else if (!wcsncmp(p, L"\\line", 5)) { // soft line break;
res.AppendChar('\n');
}
- else if (!_tcsncmp(p, L"\\endash", 7)) {
+ else if (!wcsncmp(p, L"\\endash", 7)) {
res.AppendChar(0x2013);
}
- else if (!_tcsncmp(p, L"\\emdash", 7)) {
+ else if (!wcsncmp(p, L"\\emdash", 7)) {
res.AppendChar(0x2014);
}
- else if (!_tcsncmp(p, L"\\bullet", 7)) {
+ else if (!wcsncmp(p, L"\\bullet", 7)) {
res.AppendChar(0x2022);
}
- else if (!_tcsncmp(p, L"\\ldblquote", 10)) {
+ else if (!wcsncmp(p, L"\\ldblquote", 10)) {
res.AppendChar(0x201C);
}
- else if (!_tcsncmp(p, L"\\rdblquote", 10)) {
+ else if (!wcsncmp(p, L"\\rdblquote", 10)) {
res.AppendChar(0x201D);
}
- else if (!_tcsncmp(p, L"\\lquote", 7)) {
+ else if (!wcsncmp(p, L"\\lquote", 7)) {
res.AppendChar(0x2018);
}
- else if (!_tcsncmp(p, L"\\rquote", 7)) {
+ else if (!wcsncmp(p, L"\\rquote", 7)) {
res.AppendChar(0x2019);
}
- else if (!_tcsncmp(p, L"\\b", 2)) { //bold
+ else if (!wcsncmp(p, L"\\b", 2)) { //bold
res.Append((p[2] != '0') ? L"[b]" : L"[/b]");
}
- else if (!_tcsncmp(p, L"\\i", 2)) { // italics
+ else if (!wcsncmp(p, L"\\i", 2)) { // italics
res.Append((p[2] != '0') ? L"[i]" : L"[/i]");
}
- else if (!_tcsncmp(p, L"\\strike", 7)) { // strike-out
+ else if (!wcsncmp(p, L"\\strike", 7)) { // strike-out
res.Append((p[7] != '0') ? L"[s]" : L"[/s]");
}
- else if (!_tcsncmp(p, L"\\ul", 3)) { // underlined
- if (p[3] == 0 || _tcschr(tszRtfBreaks, p[3])) {
+ else if (!wcsncmp(p, L"\\ul", 3)) { // underlined
+ if (p[3] == 0 || wcschr(tszRtfBreaks, p[3])) {
res.Append(L"[u]");
bInsideUl = true;
}
- else if (!_tcsnccmp(p + 3, L"none", 4)) {
+ else if (!wcsncmp(p + 3, L"none", 4)) {
if (bInsideUl)
res.Append(L"[/u]");
bInsideUl = false;
}
}
- else if (!_tcsncmp(p, L"\\tab", 4)) { // tab
+ else if (!wcsncmp(p, L"\\tab", 4)) { // tab
res.AppendChar('\t');
}
else if (p[1] == '\'') { // special character
if (p[2] != ' ' && p[2] != '\\') {
- TCHAR tmp[10], *t = tmp;
+ wchar_t tmp[10], *t = tmp;
*t++ = p[2];
if (p[3] != ' ' && p[3] != '\\')
*t++ = p[3];
*t = 0;
// convert string containing char in hex format to int.
- TCHAR *stoppedHere;
- res.AppendChar(_tcstol(tmp, &stoppedHere, 16));
+ wchar_t *stoppedHere;
+ res.AppendChar(wcstol(tmp, &stoppedHere, 16));
}
}
p++; // skip initial slash
- p += _tcscspn(p, tszRtfBreaks);
+ p += wcscspn(p, tszRtfBreaks);
if (*p == ' ')
p++;
break;
diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp
index 3d50d2c559..6a00cde117 100644
--- a/src/mir_app/src/chat_svc.cpp
+++ b/src/mir_app/src/chat_svc.cpp
@@ -248,11 +248,11 @@ static INT_PTR Service_NewChat(WPARAM, LPARAM lParam)
si->bBGSet = TRUE;
}
- TCHAR szTemp[256];
+ wchar_t szTemp[256];
if (si->iType == GCW_SERVER)
mir_sntprintf(szTemp, L"Server: %s", si->ptszName);
else
- _tcsncpy_s(szTemp, si->ptszName, _TRUNCATE);
+ wcsncpy_s(szTemp, si->ptszName, _TRUNCATE);
si->hContact = chatApi.AddRoom(gcw->pszModule, gcw->ptszID, szTemp, si->iType);
db_set_s(si->hContact, si->pszModule, "Topic", "");
db_unset(si->hContact, "CList", "StatusMsg");
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp
index 4f822f1779..3e18186f85 100644
--- a/src/mir_app/src/chat_tools.cpp
+++ b/src/mir_app/src/chat_tools.cpp
@@ -36,14 +36,14 @@ int GetRichTextLength(HWND hwnd)
/////////////////////////////////////////////////////////////////////////////////////////
-TCHAR* RemoveFormatting(const TCHAR *pszWord)
+wchar_t* RemoveFormatting(const wchar_t *pszWord)
{
- static TCHAR szTemp[10000];
+ static wchar_t szTemp[10000];
if (pszWord == NULL)
return NULL;
- TCHAR *d = szTemp;
+ wchar_t *d = szTemp;
size_t cbLen = mir_tstrlen(pszWord);
if (cbLen > _countof(szTemp))
cbLen = _countof(szTemp)-1;
@@ -163,9 +163,9 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
return DefWindowProc(hWnd, message, wParam, lParam);
}
-int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char *pszProtoName, TCHAR*, COLORREF crBkg, const TCHAR *fmt, ...)
+int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char *pszProtoName, wchar_t*, COLORREF crBkg, const wchar_t *fmt, ...)
{
- static TCHAR szBuf[4 * 1024];
+ static wchar_t szBuf[4 * 1024];
if (!fmt || fmt[0] == 0 || mir_tstrlen(fmt) > 2000)
return 0;
@@ -400,18 +400,18 @@ void CheckColorsInModule(const char *pszModule)
}
}
-const TCHAR* my_strstri(const TCHAR* s1, const TCHAR* s2)
+const wchar_t* my_strstri(const wchar_t* s1, const wchar_t* s2)
{
int i, j, k;
for (i = 0; s1[i]; i++)
- for (j = i, k = 0; _totlower(s1[j]) == _totlower(s2[k]); j++, k++)
+ for (j = i, k = 0; towlower(s1[j]) == towlower(s2[k]); j++, k++)
if (!s2[k + 1])
return s1 + i;
return NULL;
}
-static TCHAR szTrimString[] = L":,.!?;\'>)";
+static wchar_t szTrimString[] = L":,.!?;\'>)";
BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *gce)
{
@@ -421,7 +421,7 @@ BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *gce)
if (gce->ptszText == NULL)
return FALSE;
- TCHAR *buf = RemoveFormatting(NEWTSTR_ALLOCA(gce->ptszText));
+ wchar_t *buf = RemoveFormatting(NEWWSTR_ALLOCA(gce->ptszText));
int iStart = 0;
CMString tszHighlightWords(g_Settings->pszHighlightWords);
@@ -439,7 +439,7 @@ BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *gce)
tszToken = '*' + tszToken + '*';
// time to get the next/first word in the incoming text string
- for (const TCHAR *p = buf; *p != '\0'; p += _tcscspn(p, L" ")) {
+ for (const wchar_t *p = buf; *p != '\0'; p += wcscspn(p, L" ")) {
p += _tcsspn(p, L" ");
// compare the words, using wildcards
@@ -453,29 +453,29 @@ BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *gce)
BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
{
- TCHAR szBuffer[4096];
- TCHAR szLine[4096];
- TCHAR p = '\0';
+ wchar_t szBuffer[4096];
+ wchar_t szLine[4096];
+ wchar_t p = '\0';
szBuffer[0] = '\0';
GetChatLogsFilename(si, gce->time);
BOOL bFileJustCreated = !PathFileExists(si->pszLogFileName);
- TCHAR tszFolder[MAX_PATH];
- _tcsncpy_s(tszFolder, si->pszLogFileName, _TRUNCATE);
+ wchar_t tszFolder[MAX_PATH];
+ wcsncpy_s(tszFolder, si->pszLogFileName, _TRUNCATE);
PathRemoveFileSpec(tszFolder);
if (!PathIsDirectory(tszFolder))
CreateDirectoryTreeT(tszFolder);
- TCHAR szTime[100];
+ wchar_t szTime[100];
mir_tstrncpy(szTime, chatApi.MakeTimeStamp(g_Settings->pszTimeStampLog, gce->time), 99);
- FILE *hFile = _tfopen(si->pszLogFileName, L"ab+");
+ FILE *hFile = _wfopen(si->pszLogFileName, L"ab+");
if (hFile == NULL)
return FALSE;
- TCHAR szTemp[512], szTemp2[512];
- TCHAR* pszNick = NULL;
+ wchar_t szTemp[512], szTemp2[512];
+ wchar_t* pszNick = NULL;
if (bFileJustCreated)
fputws((const wchar_t*)"\377\376", hFile); //UTF-16 LE BOM == FF FE
if (gce->ptszNick) {
@@ -488,7 +488,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
if (gce->ptszUserInfo)
mir_sntprintf(szTemp, L"%s (%s)", szTemp2, gce->ptszUserInfo);
else
- _tcsncpy_s(szTemp, szTemp2, _TRUNCATE);
+ wcsncpy_s(szTemp, szTemp2, _TRUNCATE);
pszNick = szTemp;
}
@@ -545,7 +545,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
break;
case GC_EVENT_INFORMATION:
p = '!';
- _tcsncpy_s(szBuffer, chatApi.RemoveFormatting(gce->ptszText), _TRUNCATE);
+ wcsncpy_s(szBuffer, chatApi.RemoveFormatting(gce->ptszText), _TRUNCATE);
break;
case GC_EVENT_ADDSTATUS:
p = '+';
@@ -565,7 +565,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
mir_sntprintf(szLine, L"%s %s\r\n", szTime, szBuffer);
if (szLine[0]) {
- _fputts(szLine, hFile);
+ fputws(szLine, hFile);
if (g_Settings->LoggingLimit > 0) {
fseek(hFile, 0, SEEK_END);
@@ -576,21 +576,21 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
if (dwSize > trimlimit) {
time_t now = time(0);
- TCHAR tszTimestamp[20];
- _tcsftime(tszTimestamp, 20, L"%Y%m%d-%H%M%S", _localtime32((__time32_t *)&now));
+ wchar_t tszTimestamp[20];
+ wcsftime(tszTimestamp, 20, L"%Y%m%d-%H%M%S", _localtime32((__time32_t *)&now));
tszTimestamp[19] = 0;
// max size reached, rotate the log
// move old logs to /archived sub folder just inside the log root folder.
// add a time stamp to the file name.
- TCHAR tszDrive[_MAX_DRIVE], tszDir[_MAX_DIR], tszName[_MAX_FNAME], tszExt[_MAX_EXT];
- _tsplitpath(si->pszLogFileName, tszDrive, tszDir, tszName, tszExt);
+ wchar_t tszDrive[_MAX_DRIVE], tszDir[_MAX_DIR], tszName[_MAX_FNAME], tszExt[_MAX_EXT];
+ _wsplitpath(si->pszLogFileName, tszDrive, tszDir, tszName, tszExt);
- TCHAR tszNewPath[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20];
+ wchar_t tszNewPath[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20];
mir_sntprintf(tszNewPath, L"%s%sarchived\\", tszDrive, tszDir);
CreateDirectoryTreeT(tszNewPath);
- TCHAR tszNewName[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20];
+ wchar_t tszNewName[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20];
mir_sntprintf(tszNewName, L"%s%s-%s%s", tszNewPath, tszName, tszTimestamp, tszExt);
fclose(hFile);
hFile = 0;
@@ -606,7 +606,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
return TRUE;
}
-BOOL DoEventHookAsync(HWND hwnd, const TCHAR *pszID, const char *pszModule, int iType, const TCHAR* pszUID, const TCHAR* pszText, INT_PTR dwItem)
+BOOL DoEventHookAsync(HWND hwnd, const wchar_t *pszID, const char *pszModule, int iType, const wchar_t* pszUID, const wchar_t* pszText, INT_PTR dwItem)
{
SESSION_INFO *si = chatApi.SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -626,7 +626,7 @@ BOOL DoEventHookAsync(HWND hwnd, const TCHAR *pszID, const char *pszModule, int
return TRUE;
}
-BOOL DoEventHook(const TCHAR *pszID, const char *pszModule, int iType, const TCHAR *pszUID, const TCHAR* pszText, INT_PTR dwItem)
+BOOL DoEventHook(const wchar_t *pszID, const char *pszModule, int iType, const wchar_t *pszUID, const wchar_t* pszText, INT_PTR dwItem)
{
SESSION_INFO *si = chatApi.SM_FindSession(pszID, pszModule);
if (si == NULL)
@@ -676,75 +676,75 @@ BOOL IsEventSupported(int eventType)
return FALSE;
}
-void ValidateFilename(TCHAR *filename)
+void ValidateFilename(wchar_t *filename)
{
- TCHAR *p1 = filename;
- TCHAR szForbidden[] = L"\\/:*?\"<>|";
+ wchar_t *p1 = filename;
+ wchar_t szForbidden[] = L"\\/:*?\"<>|";
while (*p1 != '\0') {
- if (_tcschr(szForbidden, *p1))
+ if (wcschr(szForbidden, *p1))
*p1 = '_';
p1 += 1;
}
}
-static TCHAR tszOldTimeStamp[30];
+static wchar_t tszOldTimeStamp[30];
-TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime)
+wchar_t* GetChatLogsFilename(SESSION_INFO *si, time_t tTime)
{
if (!tTime)
time(&tTime);
// check whether relevant parts of the timestamp have changed and
// we have to reparse the filename
- TCHAR *tszNow = chatApi.MakeTimeStamp(L"%a%d%m%Y", tTime); // once a day
+ wchar_t *tszNow = chatApi.MakeTimeStamp(L"%a%d%m%Y", tTime); // once a day
if (mir_tstrcmp(tszOldTimeStamp, tszNow)) {
- _tcsncpy_s(tszOldTimeStamp, tszNow, _TRUNCATE);
+ wcsncpy_s(tszOldTimeStamp, tszNow, _TRUNCATE);
*si->pszLogFileName = 0;
}
if (si->pszLogFileName[0] == 0) {
REPLACEVARSARRAY rva[11];
- rva[0].key.t = L"d";
- rva[0].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%#d", tTime));
+ rva[0].key.w = L"d";
+ rva[0].value.w = mir_tstrdup(chatApi.MakeTimeStamp(L"%#d", tTime));
// day 01-31
- rva[1].key.t = L"dd";
- rva[1].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%d", tTime));
+ rva[1].key.w = L"dd";
+ rva[1].value.w = mir_tstrdup(chatApi.MakeTimeStamp(L"%d", tTime));
// month 1-12
- rva[2].key.t = L"m";
- rva[2].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%#m", tTime));
+ rva[2].key.w = L"m";
+ rva[2].value.w = mir_tstrdup(chatApi.MakeTimeStamp(L"%#m", tTime));
// month 01-12
- rva[3].key.t = L"mm";
- rva[3].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%m", tTime));
+ rva[3].key.w = L"mm";
+ rva[3].value.w = mir_tstrdup(chatApi.MakeTimeStamp(L"%m", tTime));
// month text short
- rva[4].key.t = L"mon";
- rva[4].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%b", tTime));
+ rva[4].key.w = L"mon";
+ rva[4].value.w = mir_tstrdup(chatApi.MakeTimeStamp(L"%b", tTime));
// month text
- rva[5].key.t = L"month";
- rva[5].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%B", tTime));
+ rva[5].key.w = L"month";
+ rva[5].value.w = mir_tstrdup(chatApi.MakeTimeStamp(L"%B", tTime));
// year 01-99
- rva[6].key.t = L"yy";
- rva[6].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%y", tTime));
+ rva[6].key.w = L"yy";
+ rva[6].value.w = mir_tstrdup(chatApi.MakeTimeStamp(L"%y", tTime));
// year 1901-9999
- rva[7].key.t = L"yyyy";
- rva[7].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%Y", tTime));
+ rva[7].key.w = L"yyyy";
+ rva[7].value.w = mir_tstrdup(chatApi.MakeTimeStamp(L"%Y", tTime));
// weekday short
- rva[8].key.t = L"wday";
- rva[8].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%a", tTime));
+ rva[8].key.w = L"wday";
+ rva[8].value.w = mir_tstrdup(chatApi.MakeTimeStamp(L"%a", tTime));
// weekday
- rva[9].key.t = L"weekday";
- rva[9].value.t = mir_tstrdup(chatApi.MakeTimeStamp(L"%A", tTime));
+ rva[9].key.w = L"weekday";
+ rva[9].value.w = mir_tstrdup(chatApi.MakeTimeStamp(L"%A", tTime));
// end of array
- rva[10].key.t = NULL;
- rva[10].value.t = NULL;
+ rva[10].key.w = NULL;
+ rva[10].value.w = NULL;
- TCHAR tszTemp[MAX_PATH], *ptszVarPath;
+ wchar_t tszTemp[MAX_PATH], *ptszVarPath;
if (g_Settings->pszLogDir[mir_tstrlen(g_Settings->pszLogDir) - 1] == '\\') {
mir_sntprintf(tszTemp, L"%s%s", g_Settings->pszLogDir, L"%userid%.log");
ptszVarPath = tszTemp;
}
else ptszVarPath = g_Settings->pszLogDir;
- TCHAR *tszParsedName = Utils_ReplaceVarsT(ptszVarPath, si->hContact, rva);
+ wchar_t *tszParsedName = Utils_ReplaceVarsT(ptszVarPath, si->hContact, rva);
if (chatApi.OnGetLogName)
chatApi.OnGetLogName(si, tszParsedName);
else
@@ -752,11 +752,11 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime)
mir_free(tszParsedName);
for (int i = 0; i < _countof(rva); i++)
- mir_free(rva[i].value.t);
+ mir_free(rva[i].value.w);
- for (TCHAR *p = si->pszLogFileName + 2; *p; ++p)
+ for (wchar_t *p = si->pszLogFileName + 2; *p; ++p)
if (*p == ':' || *p == '*' || *p == '?' || *p == '"' || *p == '<' || *p == '>' || *p == '|')
- *p = _T('_');
+ *p = '_';
}
return si->pszLogFileName;
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp
index e4ef46e543..dbc1974660 100644
--- a/src/mir_app/src/clc.cpp
+++ b/src/mir_app/src/clc.cpp
@@ -781,8 +781,8 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam
SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)& nm);
}
else {
- TCHAR szNew[2];
- szNew[0] = (TCHAR)wParam;
+ wchar_t szNew[2];
+ szNew[0] = (wchar_t)wParam;
szNew[1] = '\0';
if (mir_tstrlen(dat->szQuickSearch) >= _countof(dat->szQuickSearch) - 1) {
MessageBeep(MB_OK);
@@ -1110,7 +1110,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam
if (contacto->type == CLCIT_CONTACT) //dropee is a contact
CallService(MS_CLIST_CONTACTCHANGEGROUP, (WPARAM)contacto->hContact, contactn->groupId);
else if (contacto->type == CLCIT_GROUP) { //dropee is a group
- TCHAR szNewName[120];
+ wchar_t szNewName[120];
mir_sntprintf(szNewName, L"%s\\%s", Clist_GroupGetName(contactn->groupId, NULL), contacto->szText);
Clist_GroupRename(contacto->groupId, szNewName);
}
@@ -1149,7 +1149,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam
if (!group->parent)
break;
if (contact->type == CLCIT_GROUP) { //dropee is a group
- TCHAR szNewName[120];
+ wchar_t szNewName[120];
mir_tstrncpy(szNewName, contact->szText, _countof(szNewName));
Clist_GroupRename(contact->groupId, szNewName);
}
diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h
index 4695cd9b58..3783f8ba2f 100644
--- a/src/mir_app/src/clc.h
+++ b/src/mir_app/src/clc.h
@@ -50,10 +50,10 @@ int fnFindItem(HWND hwnd, struct ClcData *dat, DWORD dwItem, ClcContact **contac
int fnGetRowByIndex(struct ClcData *dat, int testindex, ClcContact **contact, ClcGroup **subgroup);
/* clcitems.c */
-ClcGroup* fnAddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers);
+ClcGroup* fnAddGroup(HWND hwnd, struct ClcData *dat, const wchar_t *szName, DWORD flags, int groupId, int calcTotalMembers);
ClcGroup* fnRemoveItemFromGroup(HWND hwnd, ClcGroup *group, ClcContact *contact, int updateTotalCount);
-ClcContact* fnAddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText);
+ClcContact* fnAddInfoItemToGroup(ClcGroup *group, int flags, const wchar_t *pszText);
ClcContact* fnAddItemToGroup(ClcGroup *group, int iAboveItem);
ClcContact* fnAddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hContact);
@@ -72,14 +72,14 @@ int fnGetContactHiddenStatus(MCONTACT hContact, char *szProto, ClcData *dat);
LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
/* clcutils.c */
-TCHAR* fnGetGroupCountsText(struct ClcData *dat, ClcContact *contact);
+wchar_t* fnGetGroupCountsText(struct ClcData *dat, ClcContact *contact);
int fnHitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **contact, ClcGroup **group, DWORD * flags);
void fnScrollTo(HWND hwnd, struct ClcData *dat, int desty, int noSmooth);
void fnEnsureVisible(HWND hwnd, struct ClcData *dat, int iItem, int partialOk);
void fnRecalcScrollBar(HWND hwnd, struct ClcData *dat);
void fnSetGroupExpand(HWND hwnd, struct ClcData *dat, ClcGroup *group, int newState);
void fnDoSelectionDefaultAction(HWND hwnd, struct ClcData *dat);
-int fnFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int prefixOk);
+int fnFindRowByText(HWND hwnd, struct ClcData *dat, const wchar_t *text, int prefixOk);
void fnEndRename(HWND hwnd, struct ClcData *dat, int save);
void fnDeleteFromContactList(HWND hwnd, struct ClcData *dat);
void fnBeginRenameSelection(HWND hwnd, struct ClcData *dat);
@@ -122,7 +122,7 @@ void RebuildMenuOrder(void);
INT_PTR MenuProcessCommand(WPARAM wParam, LPARAM lParam);
/* clistsettings.c */
-TCHAR* fnGetContactDisplayName(MCONTACT hContact, int mode);
+wchar_t* fnGetContactDisplayName(MCONTACT hContact, int mode);
void fnGetDefaultFontSetting(int i, LOGFONT* lf, COLORREF * colour);
void fnInvalidateDisplayNameCacheEntry(MCONTACT hContact);
@@ -151,7 +151,7 @@ int fnGetContactIcon(MCONTACT hContact);
int fnIconFromStatusMode(const char *szProto, int status, MCONTACT hContact);
int fnShowHide(WPARAM wParam, LPARAM lParam);
HICON fnGetIconFromStatusMode(MCONTACT hContact, const char *szProto, int status);
-TCHAR* fnGetStatusModeDescription(int wParam, int lParam);
+wchar_t* fnGetStatusModeDescription(int wParam, int lParam);
int fnGetWindowVisibleState(HWND hWnd, int iStepX, int iStepY);
/* clisttray.c */
@@ -164,17 +164,17 @@ int fnTrayIconAdd(HWND hwnd, const char *szProto, const char *szIconProto, in
int fnTrayIconDestroy(HWND hwnd);
void fnTrayIconIconsChanged(void);
int fnTrayIconInit(HWND hwnd);
-TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto);
+wchar_t* fnTrayIconMakeTooltip(const wchar_t *szPrefix, const char *szProto);
int fnTrayIconPauseAutoHide(WPARAM wParam, LPARAM lParam);
INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam);
void fnTrayIconRemove(HWND hwnd, const char *szProto);
int fnTrayIconSetBaseInfo(HICON hIcon, const char *szPreferredProto);
void fnTrayIconSetToBase(char *szPreferredProto);
void fnTrayIconTaskbarCreated(HWND hwnd);
-int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPreferredProto, int isBase);
+int fnTrayIconUpdate(HICON hNewIcon, const wchar_t *szNewTip, const char *szPreferredProto, int isBase);
void fnTrayIconUpdateBase(const char *szChangedProto);
int fnTrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCount);
-void fnTrayIconUpdateWithImageList(int iImage, const TCHAR *szNewTip, char *szPreferredProto);
+void fnTrayIconUpdateWithImageList(int iImage, const wchar_t *szNewTip, char *szPreferredProto);
VOID CALLBACK fnTrayCycleTimerProc(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime);
diff --git a/src/mir_app/src/clcfiledrop.cpp b/src/mir_app/src/clcfiledrop.cpp
index 382512016c..8739ae5b86 100644
--- a/src/mir_app/src/clcfiledrop.cpp
+++ b/src/mir_app/src/clcfiledrop.cpp
@@ -140,14 +140,14 @@ HRESULT CDropTarget::DragOver(DWORD /*grfKeyState*/, POINTL pt, DWORD * pdwEffec
HRESULT CDropTarget::DragEnter(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
{
HWND hwnd;
- TCHAR szWindowClass[64];
+ wchar_t szWindowClass[64];
POINT shortPt;
shortPt.x = pt.x;
shortPt.y = pt.y;
hwnd = WindowFromPoint(shortPt);
GetClassName(hwnd, szWindowClass, _countof(szWindowClass));
- if (!mir_tstrcmp(szWindowClass, _T(CLISTCONTROL_CLASS))) {
+ if (!mir_tstrcmp(szWindowClass, CLISTCONTROL_CLASSW)) {
hwndCurrentDrag = hwnd;
ClcData *dat = (ClcData *) GetWindowLongPtr(hwndCurrentDrag, 0);
originalSelection = dat->selection;
@@ -172,15 +172,15 @@ HRESULT CDropTarget::DragLeave(void)
return S_OK;
}
-static void AddToFileList(TCHAR ***pppFiles, int *totalCount, const TCHAR *szFilename)
+static void AddToFileList(wchar_t ***pppFiles, int *totalCount, const wchar_t *szFilename)
{
- *pppFiles = (TCHAR **) mir_realloc(*pppFiles, (++*totalCount + 1) * sizeof(TCHAR *));
+ *pppFiles = (wchar_t **) mir_realloc(*pppFiles, (++*totalCount + 1) * sizeof(wchar_t *));
(*pppFiles)[*totalCount] = NULL;
(*pppFiles)[*totalCount - 1] = mir_tstrdup(szFilename);
if (GetFileAttributes(szFilename) & FILE_ATTRIBUTE_DIRECTORY) {
WIN32_FIND_DATA fd;
HANDLE hFind;
- TCHAR szPath[MAX_PATH];
+ wchar_t szPath[MAX_PATH];
mir_tstrcpy(szPath, szFilename);
mir_tstrcat(szPath, L"\\*");
if (hFind = FindFirstFile(szPath, &fd)) {
@@ -218,8 +218,8 @@ HRESULT CDropTarget::Drop(IDataObject * pDataObj, DWORD /*fKeyState*/, POINTL pt
ScreenToClient(hwndCurrentDrag, &shortPt);
MCONTACT hContact = HContactFromPoint(hwndCurrentDrag, dat, shortPt.x, shortPt.y, NULL);
if (hContact != NULL) {
- TCHAR **ppFiles = NULL;
- TCHAR szFilename[MAX_PATH];
+ wchar_t **ppFiles = NULL;
+ wchar_t szFilename[MAX_PATH];
int fileCount, totalCount = 0, i;
fileCount = DragQueryFile(hDrop, -1, NULL, 0);
diff --git a/src/mir_app/src/clcitems.cpp b/src/mir_app/src/clcitems.cpp
index c53da45fbe..f21811c4f6 100644
--- a/src/mir_app/src/clcitems.cpp
+++ b/src/mir_app/src/clcitems.cpp
@@ -38,16 +38,16 @@ ClcContact* fnAddItemToGroup(ClcGroup *group, int iAboveItem)
return newItem;
}
-ClcGroup* fnAddGroup(HWND hwnd, ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers)
+ClcGroup* fnAddGroup(HWND hwnd, ClcData *dat, const wchar_t *szName, DWORD flags, int groupId, int calcTotalMembers)
{
dat->bNeedsResort = true;
if (!(GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_USEGROUPS))
return &dat->list;
ClcGroup *group = &dat->list;
- TCHAR *pNextField = NEWTSTR_ALLOCA(szName);
+ wchar_t *pNextField = NEWWSTR_ALLOCA(szName);
do {
- TCHAR *pBackslash = _tcschr(pNextField, '\\'), *pThisField = pNextField;
+ wchar_t *pBackslash = wcschr(pNextField, '\\'), *pThisField = pNextField;
if (pBackslash == NULL) {
pNextField = NULL;
}
@@ -137,7 +137,7 @@ void fnFreeGroup(ClcGroup *group)
}
static int iInfoItemUniqueHandle = 0;
-ClcContact* fnAddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText)
+ClcContact* fnAddInfoItemToGroup(ClcGroup *group, int flags, const wchar_t *pszText)
{
int i = 0;
@@ -235,7 +235,7 @@ void fnAddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int updateTo
if (checkHideOffline && cli.pfnIsHiddenMode(dat, status)) {
for (i = 1;; i++) {
- TCHAR *szGroupName = Clist_GroupGetName(i, &groupFlags);
+ wchar_t *szGroupName = Clist_GroupGetName(i, &groupFlags);
if (szGroupName == NULL)
return;
@@ -246,7 +246,7 @@ void fnAddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int updateTo
return;
}
for (i = 1;; i++) {
- TCHAR *szGroupName = Clist_GroupGetName(i, &groupFlags);
+ wchar_t *szGroupName = Clist_GroupGetName(i, &groupFlags);
if (szGroupName == NULL)
return;
@@ -254,7 +254,7 @@ void fnAddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int updateTo
break;
size_t len = mir_tstrlen(szGroupName);
- if (!_tcsncmp(szGroupName, tszGroup, len) && tszGroup[len] == '\\')
+ if (!wcsncmp(szGroupName, tszGroup, len) && tszGroup[len] == '\\')
cli.pfnAddGroup(hwnd, dat, szGroupName, groupFlags, i, 1);
}
group = cli.pfnAddGroup(hwnd, dat, tszGroup, groupFlags, i, 1);
@@ -323,7 +323,7 @@ void fnDeleteItemFromTree(HWND hwnd, MCONTACT hItem)
ClcContact *cc = group->cl[i];
if (cc->type == CLCIT_GROUP) {
size_t len = mir_tstrlen(cc->szText);
- if (!_tcsncmp(cc->szText, dbv.ptszVal + nameOffset, len) &&
+ if (!wcsncmp(cc->szText, dbv.ptszVal + nameOffset, len) &&
(dbv.ptszVal[nameOffset + len] == '\\' || dbv.ptszVal[nameOffset + len] == '\0')) {
group->totalMembers--;
if (dbv.ptszVal[nameOffset + len] == '\0')
@@ -336,10 +336,10 @@ void fnDeleteItemFromTree(HWND hwnd, MCONTACT hItem)
else cli.pfnRemoveItemFromGroup(hwnd, group, contact, 1);
}
-int fnGetContactHiddenStatus(MCONTACT hContact, char*, ClcData*)
-{
- return db_get_b(hContact, "CList", "Hidden", 0);
-}
+int fnGetContactHiddenStatus(MCONTACT hContact, char*, ClcData*)
+{
+ return db_get_b(hContact, "CList", "Hidden", 0);
+}
void fnRebuildEntireList(HWND hwnd, ClcData *dat)
{
@@ -353,7 +353,7 @@ void fnRebuildEntireList(HWND hwnd, ClcData *dat)
for (int i = 1;; i++) {
DWORD groupFlags;
- TCHAR *szGroupName = Clist_GroupGetName(i, &groupFlags);
+ wchar_t *szGroupName = Clist_GroupGetName(i, &groupFlags);
if (szGroupName == NULL)
break;
cli.pfnAddGroup(hwnd, dat, szGroupName, groupFlags, i, 0);
@@ -378,11 +378,11 @@ void fnRebuildEntireList(HWND hwnd, ClcData *dat)
group->totalMembers++;
if (dat->bFilterSearch && dat->szQuickSearch[0] != '\0') {
- TCHAR *name = cli.pfnGetContactDisplayName(hContact, 0);
- TCHAR *lowered_name = CharLowerW(NEWTSTR_ALLOCA(name));
- TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch));
+ wchar_t *name = cli.pfnGetContactDisplayName(hContact, 0);
+ wchar_t *lowered_name = CharLowerW(NEWWSTR_ALLOCA(name));
+ wchar_t *lowered_search = CharLowerW(NEWWSTR_ALLOCA(dat->szQuickSearch));
- if (_tcsstr(lowered_name, lowered_search))
+ if (wcsstr(lowered_name, lowered_search))
cli.pfnAddContactToGroup(dat, group, hContact);
}
else if (!(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline)) {
diff --git a/src/mir_app/src/clcmsgs.cpp b/src/mir_app/src/clcmsgs.cpp
index bd9bd1a4b7..8859699db4 100644
--- a/src/mir_app/src/clcmsgs.cpp
+++ b/src/mir_app/src/clcmsgs.cpp
@@ -43,7 +43,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar
case CLM_ADDGROUP:
{
DWORD groupFlags;
- TCHAR *szName = Clist_GroupGetName(wParam, &groupFlags);
+ wchar_t *szName = Clist_GroupGetName(wParam, &groupFlags);
if (szName == NULL)
break;
cli.pfnAddGroup(hwnd, dat, szName, groupFlags, wParam, 0);
@@ -171,13 +171,13 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar
return dat->groupIndent;
case CLM_GETISEARCHSTRING:
- mir_tstrcpy((TCHAR*)lParam, dat->szQuickSearch);
+ mir_tstrcpy((wchar_t*)lParam, dat->szQuickSearch);
return mir_tstrlen(dat->szQuickSearch);
case CLM_GETITEMTEXT:
if (!cli.pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
return 0;
- mir_tstrcpy((TCHAR*)lParam, contact->szText);
+ mir_tstrcpy((wchar_t*)lParam, contact->szText);
return mir_tstrlen(contact->szText);
case CLM_GETITEMTYPE:
@@ -398,7 +398,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar
case CLM_SETITEMTEXT:
if (!cli.pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
break;
- mir_tstrncpy(contact->szText, (TCHAR*)lParam, _countof(contact->szText));
+ mir_tstrncpy(contact->szText, (wchar_t*)lParam, _countof(contact->szText));
cli.pfnSortCLC(hwnd, dat, 1);
cli.pfnInvalidateRect(hwnd, NULL, FALSE);
break;
diff --git a/src/mir_app/src/clcutils.cpp b/src/mir_app/src/clcutils.cpp
index fdeae935e2..a01f99e3d0 100644
--- a/src/mir_app/src/clcutils.cpp
+++ b/src/mir_app/src/clcutils.cpp
@@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern HANDLE hHideInfoTipEvent;
-TCHAR* fnGetGroupCountsText(ClcData *dat, ClcContact *contact)
+wchar_t* fnGetGroupCountsText(ClcData *dat, ClcContact *contact)
{
if (contact->type != CLCIT_GROUP || !(dat->exStyle & CLS_EX_SHOWGROUPCOUNTS))
return L"";
@@ -62,7 +62,7 @@ TCHAR* fnGetGroupCountsText(ClcData *dat, ClcContact *contact)
if (onlineCount == 0 && dat->exStyle & CLS_EX_HIDECOUNTSWHENEMPTY)
return L"";
- static TCHAR szName[32];
+ static wchar_t szName[32];
mir_sntprintf(szName, L"(%u/%u)", onlineCount, totalCount);
return szName;
}
@@ -171,7 +171,7 @@ int fnHitTest(HWND hwnd, ClcData *dat, int testx, int testy, ClcContact **contac
GetTextExtentPoint32(hdc, hitcontact->szText, (int)mir_tstrlen(hitcontact->szText), &textSize);
int width = textSize.cx;
if (hitcontact->type == CLCIT_GROUP) {
- TCHAR *szCounts;
+ wchar_t *szCounts;
szCounts = cli.pfnGetGroupCountsText(dat, hitcontact);
if (szCounts[0]) {
GetTextExtentPoint32(hdc, L" ", 1, &textSize);
@@ -360,7 +360,7 @@ void fnDoSelectionDefaultAction(HWND hwnd, ClcData *dat)
CallService(MS_CLIST_CONTACTDOUBLECLICKED, (WPARAM)contact->hContact, 0);
}
-int fnFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk)
+int fnFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk)
{
ClcGroup *group = &dat->list;
size_t testlen = mir_tstrlen(text);
@@ -378,11 +378,11 @@ int fnFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk)
if (cc->type != CLCIT_DIVIDER) {
bool show;
if (dat->bFilterSearch) {
- TCHAR *lowered_szText = CharLowerW(NEWTSTR_ALLOCA(cc->szText));
- TCHAR *lowered_text = CharLowerW(NEWTSTR_ALLOCA(text));
- show = _tcsstr(lowered_szText, lowered_text) != NULL;
+ wchar_t *lowered_szText = CharLowerW(NEWWSTR_ALLOCA(cc->szText));
+ wchar_t *lowered_text = CharLowerW(NEWWSTR_ALLOCA(text));
+ show = wcsstr(lowered_szText, lowered_text) != NULL;
}
- else show = ((prefixOk && !_tcsnicmp(text, cc->szText, testlen)) || (!prefixOk && !mir_tstrcmpi(text, cc->szText)));
+ else show = ((prefixOk && !wcsnicmp(text, cc->szText, testlen)) || (!prefixOk && !mir_tstrcmpi(text, cc->szText)));
if (show) {
ClcGroup *contactGroup = group;
@@ -412,15 +412,15 @@ void fnEndRename(HWND, ClcData *dat, int save)
dat->hwndRenameEdit = NULL;
if (save) {
- TCHAR text[120]; text[0] = 0;
+ wchar_t text[120]; text[0] = 0;
GetWindowText(hwndEdit, text, _countof(text));
ClcContact *contact;
if (cli.pfnGetRowByIndex(dat, dat->selection, &contact, NULL) != -1) {
- if (mir_tstrcmp(contact->szText, text) && !_tcsstr(text, L"\\")) {
+ if (mir_tstrcmp(contact->szText, text) && !wcsstr(text, L"\\")) {
if (contact->type == CLCIT_GROUP) {
if (contact->group->parent && contact->group->parent->parent) {
- TCHAR szFullName[256];
+ wchar_t szFullName[256];
mir_sntprintf(szFullName, L"%s\\%s",
Clist_GroupGetName(contact->group->parent->groupId, NULL), text);
Clist_GroupRename(contact->groupId, szFullName);
@@ -430,7 +430,7 @@ void fnEndRename(HWND, ClcData *dat, int save)
}
else if (contact->type == CLCIT_CONTACT) {
cli.pfnInvalidateDisplayNameCacheEntry(contact->hContact);
- TCHAR* otherName = cli.pfnGetContactDisplayName(contact->hContact, GCDNF_NOMYHANDLE);
+ wchar_t* otherName = cli.pfnGetContactDisplayName(contact->hContact, GCDNF_NOMYHANDLE);
if (!text[0] || !mir_tstrcmp(otherName, text))
db_unset(contact->hContact, "CList", "MyHandle");
else
diff --git a/src/mir_app/src/clistcore.cpp b/src/mir_app/src/clistcore.cpp
index 9d9607e7c8..ed68859386 100644
--- a/src/mir_app/src/clistcore.cpp
+++ b/src/mir_app/src/clistcore.cpp
@@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
CLIST_INTERFACE cli = { 0 };
-static TCHAR szTip[MAX_TIP_SIZE+1];
+static wchar_t szTip[MAX_TIP_SIZE+1];
int LoadContactListModule2(void);
int LoadCLCModule(void);
diff --git a/src/mir_app/src/clistgroups.cpp b/src/mir_app/src/clistgroups.cpp
index 720c4d0001..2a5e5194ca 100644
--- a/src/mir_app/src/clistgroups.cpp
+++ b/src/mir_app/src/clistgroups.cpp
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct CGroupInternal
{
- CGroupInternal(int _id, const TCHAR *_name) :
+ CGroupInternal(int _id, const wchar_t *_name) :
groupId(_id),
groupName(mir_tstrdup(_name))
{}
@@ -37,7 +37,7 @@ struct CGroupInternal
}
int groupId;
- TCHAR *groupName;
+ wchar_t *groupName;
void save()
{
@@ -79,16 +79,16 @@ static mir_cs csGroups;
/////////////////////////////////////////////////////////////////////////////////////////
-static int GroupNameExists(const TCHAR *ptszGroupName, int skipGroup)
+static int GroupNameExists(const wchar_t *ptszGroupName, int skipGroup)
{
if (ptszGroupName == 0)
return 0;
- TCHAR str[256];
- _tcsncpy_s(str + 1, _countof(str) - 1, ptszGroupName, _TRUNCATE);
+ wchar_t str[256];
+ wcsncpy_s(str + 1, _countof(str) - 1, ptszGroupName, _TRUNCATE);
CGroupInternal *tmp = (CGroupInternal*)_alloca(sizeof(CGroupInternal));
- tmp->groupName = (TCHAR*)str;
+ tmp->groupName = (wchar_t*)str;
if (tmp = arByName.find(tmp))
return (skipGroup == tmp->groupId) ? 0 : tmp->groupId + 1;
return 0;
@@ -101,11 +101,11 @@ MIR_APP_DLL(MGROUP) Clist_GroupExists(LPCTSTR ptszGroupName)
/////////////////////////////////////////////////////////////////////////////////////////
-static INT_PTR CreateGroupInternal(MGROUP hParent, const TCHAR *ptszName)
+static INT_PTR CreateGroupInternal(MGROUP hParent, const wchar_t *ptszName)
{
- TCHAR newBaseName[127], newName[128];
+ wchar_t newBaseName[127], newName[128];
- const TCHAR *grpName = ptszName ? ptszName : TranslateT("New group");
+ const wchar_t *grpName = ptszName ? ptszName : TranslateT("New group");
if (hParent) {
CGroupInternal *tmp = arByIds.find(hParent-1);
if (tmp == NULL)
@@ -113,7 +113,7 @@ static INT_PTR CreateGroupInternal(MGROUP hParent, const TCHAR *ptszName)
mir_sntprintf(newBaseName, L"%s\\%s", tmp->groupName+1, grpName);
}
- else _tcsncpy_s(newBaseName, grpName, _TRUNCATE);
+ else wcsncpy_s(newBaseName, grpName, _TRUNCATE);
mir_tstrncpy(newName + 1, newBaseName, _countof(newName) - 1);
if (ptszName) {
@@ -150,8 +150,8 @@ MIR_APP_DLL(MGROUP) Clist_GroupCreate(MGROUP hParent, LPCTSTR ptszGroupName)
if (ptszGroupName == NULL || ptszGroupName[0] == '\0' || ptszGroupName[0] == '\\')
return 0;
- TCHAR *tszName = NEWTSTR_ALLOCA(ptszGroupName);
- for (TCHAR *p = tszName; *p; p++) {
+ wchar_t *tszName = NEWWSTR_ALLOCA(ptszGroupName);
+ for (wchar_t *p = tszName; *p; p++) {
if (*p == '\\') {
*p = '\0';
CreateGroupInternal(hParent, tszName);
@@ -163,7 +163,7 @@ MIR_APP_DLL(MGROUP) Clist_GroupCreate(MGROUP hParent, LPCTSTR ptszGroupName)
/////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(TCHAR*) Clist_GroupGetName(MGROUP hGroup, DWORD *pdwFlags)
+MIR_APP_DLL(wchar_t*) Clist_GroupGetName(MGROUP hGroup, DWORD *pdwFlags)
{
CGroupInternal *p = arByIds.find(hGroup-1);
if (p == NULL)
@@ -184,7 +184,7 @@ MIR_APP_DLL(int) Clist_GroupDelete(MGROUP hGroup)
return 1;
if (db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT)) {
- TCHAR szQuestion[256 + 100];
+ wchar_t szQuestion[256 + 100];
mir_sntprintf(szQuestion, TranslateT("Are you sure you want to delete group '%s'? This operation cannot be undone."), pGroup->groupName+1);
if (MessageBox(cli.hwndContactList, szQuestion, TranslateT("Delete group"), MB_YESNO | MB_ICONQUESTION) == IDNO)
return 1;
@@ -194,9 +194,9 @@ MIR_APP_DLL(int) Clist_GroupDelete(MGROUP hGroup)
// must remove setting from all child contacts too
// children are demoted to the next group up, not deleted.
- TCHAR *szNewParent = NEWTSTR_ALLOCA(pGroup->groupName+1);
+ wchar_t *szNewParent = NEWWSTR_ALLOCA(pGroup->groupName+1);
{
- TCHAR *pszLastBackslash = _tcsrchr(szNewParent, '\\');
+ wchar_t *pszLastBackslash = wcsrchr(szNewParent, '\\');
if (pszLastBackslash)
pszLastBackslash[0] = '\0';
else
@@ -237,12 +237,12 @@ MIR_APP_DLL(int) Clist_GroupDelete(MGROUP hGroup)
db_unset(NULL, "CListGroups", idstr);
// rename subgroups
- TCHAR szNewName[256];
+ wchar_t szNewName[256];
size_t len = mir_tstrlen(pGroup->groupName+1);
for (int i = 0; i < arByIds.getCount(); i++) {
CGroupInternal *p = arByIds[i];
- if (!_tcsncmp(pGroup->groupName+1, p->groupName+1, len) && p->groupName[len+1] == '\\' && _tcschr(p->groupName + len + 2, '\\') == NULL) {
+ if (!wcsncmp(pGroup->groupName+1, p->groupName+1, len) && p->groupName[len+1] == '\\' && wcschr(p->groupName + len + 2, '\\') == NULL) {
if (szNewParent[0])
mir_sntprintf(szNewName, L"%s\\%s", szNewParent, p->groupName + len + 2);
else
@@ -315,7 +315,7 @@ MIR_APP_DLL(int) Clist_GroupMoveBefore(MGROUP hGroup, MGROUP hGroupBefore)
/////////////////////////////////////////////////////////////////////////////////////////
-static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move)
+static int RenameGroupWithMove(int groupId, const wchar_t *szName, int move)
{
if (GroupNameExists(szName, groupId)) {
MessageBox(NULL, TranslateT("You already have a group with that name. Please enter a unique name for the group."), TranslateT("Rename group"), MB_ICONERROR | MB_OK);
@@ -327,9 +327,9 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move)
return 0;
// do the change
- TCHAR *oldName = NEWTSTR_ALLOCA(pGroup->groupName+1);
+ wchar_t *oldName = NEWWSTR_ALLOCA(pGroup->groupName+1);
- TCHAR str[256];
+ wchar_t str[256];
str[0] = pGroup->groupName[0];
mir_tstrncpy(str + 1, szName, _countof(str) - 1);
@@ -352,8 +352,8 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move)
continue;
CGroupInternal *p = arByIds[i];
- if (!_tcsncmp(p->groupName+1, oldName, len) && p->groupName[len+1] == '\\' && _tcschr(p->groupName + len + 2, '\\') == NULL) {
- TCHAR szNewName[256];
+ if (!wcsncmp(p->groupName+1, oldName, len) && p->groupName[len+1] == '\\' && wcschr(p->groupName + len + 2, '\\') == NULL) {
+ wchar_t szNewName[256];
mir_sntprintf(szNewName, L"%s\\%s", szName, p->groupName + len + 2);
RenameGroupWithMove(i, szNewName, 0); // luckily, child groups will never need reordering
}
@@ -361,8 +361,8 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move)
// finally must make sure it's after any parent items
if (move) {
- _tcsncpy_s(str, szName, _TRUNCATE);
- TCHAR *pszLastBackslash = _tcsrchr(str, '\\');
+ wcsncpy_s(str, szName, _TRUNCATE);
+ wchar_t *pszLastBackslash = wcsrchr(str, '\\');
if (pszLastBackslash != NULL) {
*pszLastBackslash = '\0';
for (int i = 0; i < arByIds.getCount(); i++) {
@@ -377,12 +377,12 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move)
Clist_BroadcastAsync(CLM_AUTOREBUILD, 0, 0);
}
- const CLISTGROUPCHANGE grpChg = { sizeof(grpChg), oldName, (TCHAR*)szName };
+ const CLISTGROUPCHANGE grpChg = { sizeof(grpChg), oldName, (wchar_t*)szName };
NotifyEventHooks(hGroupChangeEvent, 0, (LPARAM)&grpChg);
return 0;
}
-MIR_APP_DLL(int) Clist_GroupRename(MGROUP hGroup, const TCHAR *ptszNewName)
+MIR_APP_DLL(int) Clist_GroupRename(MGROUP hGroup, const wchar_t *ptszNewName)
{
return 0 != RenameGroupWithMove(hGroup-1, ptszNewName, 1);
}
@@ -432,15 +432,15 @@ MIR_APP_DLL(HMENU) Clist_GroupBuildMenu()
HMENU hRootMenu = CreateMenu();
for (int i = 0; i < arByIds.getCount(); i++) {
- const TCHAR *pNextField = arByIds[i]->groupName + 1;
+ const wchar_t *pNextField = arByIds[i]->groupName + 1;
HMENU hThisMenu = hRootMenu;
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
- TCHAR szThisField[128], szThisMenuItem[128];
+ wchar_t szThisField[128], szThisMenuItem[128];
do {
- const TCHAR *pBackslash = _tcschr(pNextField, '\\');
+ const wchar_t *pBackslash = wcschr(pNextField, '\\');
if (pBackslash == NULL) {
mir_tstrncpy(szThisField, pNextField, _countof(szThisField));
pNextField = NULL;
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp
index 1e39d397c6..894ef43e35 100644
--- a/src/mir_app/src/clistmod.cpp
+++ b/src/mir_app/src/clistmod.cpp
@@ -53,54 +53,54 @@ struct ProtoIconIndex
OBJLIST<ProtoIconIndex> protoIconIndex(5);
-TCHAR* fnGetStatusModeDescription(int mode, int flags)
+wchar_t* fnGetStatusModeDescription(int mode, int flags)
{
- static TCHAR szMode[64];
- TCHAR* descr;
+ static wchar_t szMode[64];
+ wchar_t* descr;
int noPrefixReqd = 0;
switch (mode) {
case ID_STATUS_OFFLINE:
- descr = LPGENT("Offline");
+ descr = LPGENW("Offline");
noPrefixReqd = 1;
break;
case ID_STATUS_CONNECTING:
- descr = LPGENT("Connecting");
+ descr = LPGENW("Connecting");
noPrefixReqd = 1;
break;
case ID_STATUS_ONLINE:
- descr = LPGENT("Online");
+ descr = LPGENW("Online");
noPrefixReqd = 1;
break;
case ID_STATUS_AWAY:
- descr = LPGENT("Away");
+ descr = LPGENW("Away");
break;
case ID_STATUS_DND:
- descr = LPGENT("Do not disturb");
+ descr = LPGENW("Do not disturb");
break;
case ID_STATUS_NA:
- descr = LPGENT("Not available");
+ descr = LPGENW("Not available");
break;
case ID_STATUS_OCCUPIED:
- descr = LPGENT("Occupied");
+ descr = LPGENW("Occupied");
break;
case ID_STATUS_FREECHAT:
- descr = LPGENT("Free for chat");
+ descr = LPGENW("Free for chat");
break;
case ID_STATUS_INVISIBLE:
- descr = LPGENT("Invisible");
+ descr = LPGENW("Invisible");
break;
case ID_STATUS_OUTTOLUNCH:
- descr = LPGENT("Out to lunch");
+ descr = LPGENW("Out to lunch");
break;
case ID_STATUS_ONTHEPHONE:
- descr = LPGENT("On the phone");
+ descr = LPGENW("On the phone");
break;
case ID_STATUS_IDLE:
- descr = LPGENT("Idle");
+ descr = LPGENW("Idle");
break;
default:
if (IsStatusConnecting(mode)) {
- const TCHAR* connFmt = LPGENT("Connecting (attempt %d)");
+ const wchar_t* connFmt = LPGENW("Connecting (attempt %d)");
mir_sntprintf(szMode, (flags & GSMDF_UNTRANSLATED) ? connFmt : TranslateTS(connFmt), mode - ID_STATUS_CONNECTING + 1);
return szMode;
}
diff --git a/src/mir_app/src/clistsettings.cpp b/src/mir_app/src/clistsettings.cpp
index 1732c9943a..2130672307 100644
--- a/src/mir_app/src/clistsettings.cpp
+++ b/src/mir_app/src/clistsettings.cpp
@@ -100,7 +100,7 @@ void fnInvalidateDisplayNameCacheEntry(MCONTACT hContact)
}
}
-TCHAR* fnGetContactDisplayName(MCONTACT hContact, int mode)
+wchar_t* fnGetContactDisplayName(MCONTACT hContact, int mode)
{
if (hContact == NULL)
return TranslateT("(Unknown contact)");
@@ -123,7 +123,7 @@ TCHAR* fnGetContactDisplayName(MCONTACT hContact, int mode)
ProtoChainSend(hContact, PSS_GETINFO, SGIF_MINIMAL, 0);
- TCHAR *buffer = TranslateT("(Unknown contact)");
+ wchar_t *buffer = TranslateT("(Unknown contact)");
return (cacheEntry == NULL) ? mir_tstrdup(buffer) : buffer;
}
@@ -146,7 +146,7 @@ int ContactDeleted(WPARAM hContact, LPARAM)
/////////////////////////////////////////////////////////////////////////////////////////
-static void Dbwcs2tstr(DBCONTACTWRITESETTING *cws, TCHAR* &pStr)
+static void Dbwcs2tstr(DBCONTACTWRITESETTING *cws, wchar_t* &pStr)
{
mir_free(pStr);
diff --git a/src/mir_app/src/clisttray.cpp b/src/mir_app/src/clisttray.cpp
index abb54f5c9b..dd6ea4cc32 100644
--- a/src/mir_app/src/clisttray.cpp
+++ b/src/mir_app/src/clisttray.cpp
@@ -44,10 +44,10 @@ static bool hasTips()
static bool fTrayInited;
-static TCHAR* sttGetXStatus(const char *szProto)
+static wchar_t* sttGetXStatus(const char *szProto)
{
if (CallProtoServiceInt(NULL, szProto, PS_GETSTATUS, 0, 0) > ID_STATUS_OFFLINE) {
- TCHAR tszStatus[512];
+ wchar_t tszStatus[512];
CUSTOM_STATUS cs = { sizeof(cs) };
cs.flags = CSSF_MASK_MESSAGE | CSSF_TCHAR;
cs.ptszMessage = tszStatus;
@@ -59,7 +59,7 @@ static TCHAR* sttGetXStatus(const char *szProto)
}
static HICON lastTaskBarIcon;
-static void SetTaskBarIcon(const HICON hIcon, const TCHAR *szNewTip)
+static void SetTaskBarIcon(const HICON hIcon, const wchar_t *szNewTip)
{
if (pTaskbarInterface) {
pTaskbarInterface->SetOverlayIcon(cli.hwndContactList, hIcon, szNewTip);
@@ -67,12 +67,12 @@ static void SetTaskBarIcon(const HICON hIcon, const TCHAR *szNewTip)
}
}
-TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto)
+wchar_t* fnTrayIconMakeTooltip(const wchar_t *szPrefix, const char *szProto)
{
initcheck NULL;
mir_cslock lck(trayLockCS);
- TCHAR *szSeparator = L"\n";
+ wchar_t *szSeparator = L"\n";
if (szProto == NULL) {
if (accounts.getCount() == 0)
@@ -85,7 +85,7 @@ TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto)
if (szPrefix && szPrefix[0]) {
if (!db_get_b(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT)) {
- _tcsncpy_s(cli.szTip, MAX_TIP_SIZE, szPrefix, _TRUNCATE);
+ wcsncpy_s(cli.szTip, MAX_TIP_SIZE, szPrefix, _TRUNCATE);
return cli.szTip;
}
tszTip.Append(szPrefix);
@@ -100,7 +100,7 @@ TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto)
if (!cli.pfnGetProtocolVisibility(pa->szModuleName))
continue;
- TCHAR *szStatus = cli.pfnGetStatusModeDescription(CallProtoServiceInt(NULL, pa->szModuleName, PS_GETSTATUS, 0, 0), 0);
+ wchar_t *szStatus = cli.pfnGetStatusModeDescription(CallProtoServiceInt(NULL, pa->szModuleName, PS_GETSTATUS, 0, 0), 0);
if (!szStatus)
continue;
@@ -119,13 +119,13 @@ TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto)
else tszTip.AppendFormat(L"%s %s", pa->tszAccountName, szStatus);
}
- _tcsncpy_s(cli.szTip, MAX_TIP_SIZE, tszTip, _TRUNCATE);
+ wcsncpy_s(cli.szTip, MAX_TIP_SIZE, tszTip, _TRUNCATE);
}
else {
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (pa != NULL) {
ptrT ProtoXStatus(sttGetXStatus(szProto));
- TCHAR *szStatus = cli.pfnGetStatusModeDescription(CallProtoServiceInt(NULL, szProto, PS_GETSTATUS, 0, 0), 0);
+ wchar_t *szStatus = cli.pfnGetStatusModeDescription(CallProtoServiceInt(NULL, szProto, PS_GETSTATUS, 0, 0), 0);
if (szPrefix && szPrefix[0]) {
if (db_get_b(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT)) {
if (hasTips()) {
@@ -314,7 +314,7 @@ static VOID CALLBACK RefreshTimerProc(HWND, UINT, UINT_PTR, DWORD)
cli.pfnTrayIconUpdateBase(accounts[i]->szModuleName);
}
-int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPreferredProto, int isBase)
+int fnTrayIconUpdate(HICON hNewIcon, const wchar_t *szNewTip, const char *szPreferredProto, int isBase)
{
initcheck - 1;
mir_cslock lck(trayLockCS);
@@ -426,7 +426,7 @@ int fnTrayIconSetBaseInfo(HICON hIcon, const char *szPreferredProto)
goto LBL_Error;
}
-void fnTrayIconUpdateWithImageList(int iImage, const TCHAR *szNewTip, char *szPreferredProto)
+void fnTrayIconUpdateWithImageList(int iImage, const wchar_t *szNewTip, char *szPreferredProto)
{
HICON hIcon = ImageList_GetIcon(hCListImages, iImage, ILD_NORMAL);
cli.pfnTrayIconUpdate(hIcon, szNewTip, szPreferredProto, 0);
@@ -616,7 +616,7 @@ static void CALLBACK TrayToolTipTimerProc(HWND hwnd, UINT, UINT_PTR id, DWORD)
POINT pt;
GetCursorPos(&pt);
if (abs(pt.x - tray_hover_pos.x) <= TOOLTIP_TOLERANCE && abs(pt.y - tray_hover_pos.y) <= TOOLTIP_TOLERANCE) {
- TCHAR* szTipCur = cli.szTip;
+ wchar_t* szTipCur = cli.szTip;
{
int n = s_LastHoverIconID - 100;
if (n >= 0 && n < cli.trayIconCount)
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp
index 3ba4cbc915..717849c38e 100644
--- a/src/mir_app/src/clui.cpp
+++ b/src/mir_app/src/clui.cpp
@@ -89,10 +89,10 @@ static HGENMENU hRenameMenuItem;
static int MenuItem_PreBuild(WPARAM, LPARAM)
{
- TCHAR cls[128];
+ wchar_t cls[128];
HWND hwndClist = GetFocus();
GetClassName(hwndClist, cls, _countof(cls));
- hwndClist = (!mir_tstrcmp(_T(CLISTCONTROL_CLASS), cls)) ? hwndClist : cli.hwndContactList;
+ hwndClist = (!mir_tstrcmp(CLISTCONTROL_CLASSW, cls)) ? hwndClist : cli.hwndContactList;
HANDLE hItem = (HANDLE)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
Menu_ShowItem(hRenameMenuItem, hItem != 0);
return 0;
@@ -100,11 +100,11 @@ static int MenuItem_PreBuild(WPARAM, LPARAM)
static INT_PTR MenuItem_RenameContact(WPARAM, LPARAM)
{
- TCHAR cls[128];
+ wchar_t cls[128];
HWND hwndClist = GetFocus();
GetClassName(hwndClist, cls, _countof(cls));
// worst case scenario, the rename is sent to the main contact list
- hwndClist = (!mir_tstrcmp(_T(CLISTCONTROL_CLASS), cls)) ? hwndClist : cli.hwndContactList;
+ hwndClist = (!mir_tstrcmp(CLISTCONTROL_CLASSW, cls)) ? hwndClist : cli.hwndContactList;
HANDLE hItem = (HANDLE)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
if (hItem) {
SetFocus(hwndClist);
@@ -125,7 +125,7 @@ static INT_PTR CALLBACK AskForConfirmationDlgProc(HWND hWnd, UINT msg, WPARAM wP
lf.lfWeight = FW_BOLD;
SendDlgItemMessage(hWnd, IDC_TOPLINE, WM_SETFONT, (WPARAM)CreateFontIndirect(&lf), 0);
- TCHAR szFormat[256], szFinal[256];
+ wchar_t szFormat[256], szFinal[256];
GetDlgItemText(hWnd, IDC_TOPLINE, szFormat, _countof(szFormat));
mir_sntprintf(szFinal, szFormat, cli.pfnGetContactDisplayName(lParam, 0));
SetDlgItemText(hWnd, IDC_TOPLINE, szFinal);
@@ -240,7 +240,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
int LoadCLUIModule(void)
{
DBVARIANT dbv;
- TCHAR titleText[256];
+ wchar_t titleText[256];
uMsgProcessProfile = RegisterWindowMessage(L"Miranda::ProcessProfile");
cli.pfnLoadCluiGlobalOpts();
@@ -259,7 +259,7 @@ int LoadCLUIModule(void)
wndclass.cbWndExtra = sizeof(void *);
wndclass.hInstance = cli.hInst;
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
- wndclass.lpszClassName = _T(CLISTCONTROL_CLASS);
+ wndclass.lpszClassName = CLISTCONTROL_CLASSW;
RegisterClassEx(&wndclass);
memset(&wndclass, 0, sizeof(wndclass));
@@ -410,7 +410,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
static int noRecurse = 0;
if (msg == uMsgProcessProfile) {
- TCHAR profile[MAX_PATH];
+ wchar_t profile[MAX_PATH];
if (GlobalGetAtomName((ATOM)wParam, profile, _countof(profile))) {
int rc = mir_tstrcmpi(profile, VARST(L"%miranda_userdata%\\%miranda_profilename%.dat")) == 0;
ReplyMessage(rc);
@@ -460,7 +460,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
return FALSE;
case M_CREATECLC:
- cli.hwndContactTree = CreateWindow(_T(CLISTCONTROL_CLASS), L"",
+ cli.hwndContactTree = CreateWindow(CLISTCONTROL_CLASSW, L"",
WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN
| CLS_CONTACTLIST
| (db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0)
@@ -764,7 +764,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
NMCLISTCONTROL *nmc = (NMCLISTCONTROL*)lParam;
switch (((LPNMHDR)lParam)->code) {
case CLN_EXPANDED:
- Clist_GroupSetExpanded((MGROUP)nmc->hItem, nmc->action);
+ Clist_GroupSetExpanded(UINT_PTR(nmc->hItem), nmc->action);
return FALSE;
case CLN_DRAGGING:
@@ -992,7 +992,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
x += 2;
if (showOpts & 2) {
PROTOACCOUNT *pa;
- TCHAR tszName[64];
+ wchar_t tszName[64];
if ((pa = Proto_GetAccount(szProto)) != NULL)
mir_sntprintf(tszName, L"%s ", pa->tszAccountName);
else
@@ -1003,7 +1003,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
x += textSize.cx;
}
if (showOpts & 4) {
- TCHAR* szStatus = cli.pfnGetStatusModeDescription(status, 0);
+ wchar_t* szStatus = cli.pfnGetStatusModeDescription(status, 0);
if (!szStatus)
szStatus = L"";
GetTextExtentPoint32(dis->hDC, szStatus, (int)mir_tstrlen(szStatus), &textSize);
diff --git a/src/mir_app/src/cluiservices.cpp b/src/mir_app/src/cluiservices.cpp
index 8163c22124..148a9bd5e7 100644
--- a/src/mir_app/src/cluiservices.cpp
+++ b/src/mir_app/src/cluiservices.cpp
@@ -30,9 +30,9 @@ EXTERN_C MIR_APP_DLL(void) Clist_GroupAdded(MGROUP hGroup)
// CLC does this automatically unless it's a new group
HWND hwndFocus = GetFocus();
- TCHAR szFocusClass[64];
+ wchar_t szFocusClass[64];
GetClassName(hwndFocus, szFocusClass, _countof(szFocusClass));
- if (!mir_tstrcmp(szFocusClass, _T(CLISTCONTROL_CLASS))) {
+ if (!mir_tstrcmp(szFocusClass, CLISTCONTROL_CLASSW)) {
HANDLE hItem = (HANDLE)SendMessage(hwndFocus, CLM_FINDGROUP, hGroup, 0);
if (hItem)
SendMessage(hwndFocus, CLM_EDITLABEL, (WPARAM)hItem, 0);
@@ -111,7 +111,7 @@ void fnCluiProtocolStatusChanged(int, const char*)
if (showOpts & 1)
x += g_IconWidth;
if (showOpts & 2) {
- TCHAR tszName[64];
+ wchar_t tszName[64];
PROTOACCOUNT *pa = Proto_GetAccount(cli.menuProtos[i].szProto);
if (pa)
mir_sntprintf(tszName, L"%s ", pa->tszAccountName);
@@ -125,7 +125,7 @@ void fnCluiProtocolStatusChanged(int, const char*)
x += GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
}
if (showOpts & 4) {
- TCHAR* modeDescr = cli.pfnGetStatusModeDescription(CallProtoServiceInt(NULL, cli.menuProtos[i].szProto, PS_GETSTATUS, 0, 0), 0);
+ wchar_t* modeDescr = cli.pfnGetStatusModeDescription(CallProtoServiceInt(NULL, cli.menuProtos[i].szProto, PS_GETSTATUS, 0, 0), 0);
GetTextExtentPoint32(hdc, modeDescr, (int)mir_tstrlen(modeDescr), &textSize);
x += textSize.cx;
x += GetSystemMetrics(SM_CXBORDER) * 4; // The SB panel doesnt allocate enough room
diff --git a/src/mir_app/src/contacts.cpp b/src/mir_app/src/contacts.cpp
index 5e6a6bc52b..07d319dd2d 100644
--- a/src/mir_app/src/contacts.cpp
+++ b/src/mir_app/src/contacts.cpp
@@ -25,17 +25,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
#define NAMEORDERCOUNT 9
-static TCHAR* nameOrderDescr[ NAMEORDERCOUNT ] =
+static wchar_t* nameOrderDescr[ NAMEORDERCOUNT ] =
{
- LPGENT("My custom name (not movable)"),
- LPGENT("Nick"),
- LPGENT("FirstName"),
- LPGENT("E-mail"),
- LPGENT("LastName"),
- LPGENT("Username"),
- LPGENT("FirstName LastName"),
- LPGENT("LastName FirstName"),
- LPGENT("'(Unknown contact)' (not movable)")
+ LPGENW("My custom name (not movable)"),
+ LPGENW("Nick"),
+ LPGENW("FirstName"),
+ LPGENW("E-mail"),
+ LPGENW("LastName"),
+ LPGENW("Username"),
+ LPGENW("FirstName LastName"),
+ LPGENW("LastName FirstName"),
+ LPGENW("'(Unknown contact)' (not movable)")
};
BYTE nameOrder[NAMEORDERCOUNT];
@@ -54,7 +54,7 @@ static int GetDatabaseString(MCONTACT hContact, const char *szProto, const char
return db_get_ws(hContact, szProto, szSetting, dbv);
}
-static TCHAR* ProcessDatabaseValueDefault(MCONTACT hContact, const char *szProto, const char *szSetting)
+static wchar_t* ProcessDatabaseValueDefault(MCONTACT hContact, const char *szProto, const char *szSetting)
{
DBVARIANT dbv;
if (!GetDatabaseString(hContact, szProto, szSetting, &dbv)) {
@@ -71,21 +71,21 @@ static TCHAR* ProcessDatabaseValueDefault(MCONTACT hContact, const char *szProto
if (db_get(hContact, szProto, szSetting, &dbv))
return NULL;
- TCHAR buf[40];
+ wchar_t buf[40];
switch (dbv.type) {
case DBVT_BYTE:
- return mir_tstrdup(_itot(dbv.bVal, buf, 10));
+ return mir_tstrdup(_itow(dbv.bVal, buf, 10));
case DBVT_WORD:
- return mir_tstrdup(_itot(dbv.wVal, buf, 10));
+ return mir_tstrdup(_itow(dbv.wVal, buf, 10));
case DBVT_DWORD:
- return mir_tstrdup(_itot(dbv.dVal, buf, 10));
+ return mir_tstrdup(_itow(dbv.dVal, buf, 10));
}
db_free(&dbv);
return NULL;
}
-MIR_APP_DLL(TCHAR*) Contact_GetInfo(int type, MCONTACT hContact, const char *szProto)
+MIR_APP_DLL(wchar_t*) Contact_GetInfo(int type, MCONTACT hContact, const char *szProto)
{
if (hContact == NULL && szProto == NULL)
return NULL;
@@ -96,7 +96,7 @@ MIR_APP_DLL(TCHAR*) Contact_GetInfo(int type, MCONTACT hContact, const char *szP
return NULL;
char *uid;
- TCHAR *res;
+ wchar_t *res;
DBVARIANT dbv;
switch (type) {
case CNF_FIRSTNAME: return ProcessDatabaseValueDefault(hContact, szProto, "FirstName");
@@ -179,8 +179,8 @@ MIR_APP_DLL(TCHAR*) Contact_GetInfo(int type, MCONTACT hContact, const char *szP
case CNF_UNIQUEID:
if (db_mc_isMeta(hContact)) {
- TCHAR buf[40];
- _itot(hContact, buf, 10);
+ wchar_t buf[40];
+ _itow(hContact, buf, 10);
return mir_tstrdup(buf);
}
diff --git a/src/mir_app/src/database.cpp b/src/mir_app/src/database.cpp
index 6fa2ae5bf0..a0a9257b87 100644
--- a/src/mir_app/src/database.cpp
+++ b/src/mir_app/src/database.cpp
@@ -27,52 +27,52 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// contains the location of mirandaboot.ini
bool g_bDbCreated;
-TCHAR g_profileDir[MAX_PATH], g_profileName[MAX_PATH], g_shortProfileName[MAX_PATH];
-TCHAR* g_defaultProfile;
+wchar_t g_profileDir[MAX_PATH], g_profileName[MAX_PATH], g_shortProfileName[MAX_PATH];
+wchar_t* g_defaultProfile;
void EnsureCheckerLoaded(bool);
void LoadDatabaseServices();
-bool fileExist(const TCHAR *fname)
+bool fileExist(const wchar_t *fname)
{
if (*fname == 0)
return false;
- FILE *fp = _tfopen(fname, L"r+");
+ FILE *fp = _wfopen(fname, L"r+");
bool res = (fp != NULL);
if (fp) fclose(fp);
return res;
}
-static void fillProfileName(const TCHAR* ptszFileName)
+static void fillProfileName(const wchar_t* ptszFileName)
{
- const TCHAR* p = _tcsrchr(ptszFileName, '\\');
+ const wchar_t* p = wcsrchr(ptszFileName, '\\');
if (p == NULL)
p = ptszFileName;
else
p++;
- _tcsncpy_s(g_profileName, p, _TRUNCATE);
+ wcsncpy_s(g_profileName, p, _TRUNCATE);
- _tcsncpy_s(g_shortProfileName, p, _TRUNCATE);
- TCHAR *pos = _tcsrchr(g_shortProfileName, '.');
+ wcsncpy_s(g_shortProfileName, p, _TRUNCATE);
+ wchar_t *pos = wcsrchr(g_shortProfileName, '.');
if (mir_tstrcmpi(pos, L".dat") == 0)
*pos = 0;
}
-bool IsInsideRootDir(TCHAR* profiledir, bool exact)
+bool IsInsideRootDir(wchar_t* profiledir, bool exact)
{
VARST pfd(L"%miranda_path%");
if (exact)
return mir_tstrcmpi(profiledir, pfd) == 0;
- return _tcsnicmp(profiledir, pfd, mir_tstrlen(pfd)) == 0;
+ return wcsnicmp(profiledir, pfd, mir_tstrlen(pfd)) == 0;
}
// returns 1 if the profile path was returned, without trailing slash
-int getProfilePath(TCHAR *buf, size_t)
+int getProfilePath(wchar_t *buf, size_t)
{
- TCHAR profiledir[MAX_PATH];
+ wchar_t profiledir[MAX_PATH];
GetPrivateProfileString(L"Database", L"ProfileDir", L"", profiledir, _countof(profiledir), mirandabootini);
if (profiledir[0] == 0)
@@ -87,7 +87,7 @@ int getProfilePath(TCHAR *buf, size_t)
}
// returns 1 if *.dat spec is matched
-int isValidProfileName(const TCHAR *name)
+int isValidProfileName(const wchar_t *name)
{
size_t len = mir_tstrlen(name) - 4;
return len > 0 && mir_tstrcmpi(&name[len], L".dat") == 0;
@@ -96,7 +96,7 @@ int isValidProfileName(const TCHAR *name)
// returns 1 if the profile manager should be shown
static bool showProfileManager(void)
{
- TCHAR Mgr[32];
+ wchar_t Mgr[32];
// is control pressed?
if (GetAsyncKeyState(VK_CONTROL) & 0x8000)
return 1;
@@ -106,19 +106,19 @@ static bool showProfileManager(void)
return (mir_tstrcmpi(Mgr, L"yes") == 0);
}
-bool shouldAutoCreate(TCHAR *szProfile)
+bool shouldAutoCreate(wchar_t *szProfile)
{
if (szProfile[0] == 0)
return false;
- TCHAR ac[32];
+ wchar_t ac[32];
GetPrivateProfileString(L"Database", L"AutoCreate", L"", ac, _countof(ac), mirandabootini);
return mir_tstrcmpi(ac, L"yes") == 0;
}
-static void getDefaultProfile(TCHAR *szProfile, size_t cch)
+static void getDefaultProfile(wchar_t *szProfile, size_t cch)
{
- TCHAR defaultProfile[MAX_PATH];
+ wchar_t defaultProfile[MAX_PATH];
GetPrivateProfileString(L"Database", L"DefaultProfile", L"", defaultProfile, _countof(defaultProfile), mirandabootini);
if (defaultProfile[0] == 0)
@@ -126,37 +126,37 @@ static void getDefaultProfile(TCHAR *szProfile, size_t cch)
VARST res(defaultProfile);
if (res)
- mir_sntprintf(szProfile, cch, L"%s\\%s\\%s%s", g_profileDir, (TCHAR*)res, (TCHAR*)res, isValidProfileName(res) ? L"" : L".dat");
+ mir_sntprintf(szProfile, cch, L"%s\\%s\\%s%s", g_profileDir, (wchar_t*)res, (wchar_t*)res, isValidProfileName(res) ? L"" : L".dat");
else
szProfile[0] = 0;
}
// returns 1 if something that looks like a profile is there
-static void loadProfileByShortName(const TCHAR* src, TCHAR *szProfile, size_t cch)
+static void loadProfileByShortName(const wchar_t* src, wchar_t *szProfile, size_t cch)
{
- TCHAR buf[MAX_PATH];
- _tcsncpy_s(buf, src, _TRUNCATE);
+ wchar_t buf[MAX_PATH];
+ wcsncpy_s(buf, src, _TRUNCATE);
- TCHAR *p = _tcsrchr(buf, '\\'); if (p) ++p; else p = buf;
+ wchar_t *p = wcsrchr(buf, '\\'); if (p) ++p; else p = buf;
if (!isValidProfileName(buf) && *p)
mir_tstrcat(buf, L".dat");
- TCHAR profileName[MAX_PATH], newProfileDir[MAX_PATH];
- _tcsncpy_s(profileName, p, _TRUNCATE);
+ wchar_t profileName[MAX_PATH], newProfileDir[MAX_PATH];
+ wcsncpy_s(profileName, p, _TRUNCATE);
if (!isValidProfileName(profileName) && *p)
mir_tstrcat(profileName, L".dat");
- _tcsncpy_s(profileName, p, _TRUNCATE);
- p = _tcsrchr(profileName, '.'); if (p) *p = 0;
+ wcsncpy_s(profileName, p, _TRUNCATE);
+ p = wcsrchr(profileName, '.'); if (p) *p = 0;
mir_sntprintf(newProfileDir, cch, L"%s\\%s\\", g_profileDir, profileName);
PathToAbsoluteT(buf, szProfile, newProfileDir);
- if (_tcschr(buf, '\\')) {
- _tcsncpy_s(g_profileDir, szProfile, _TRUNCATE);
+ if (wcschr(buf, '\\')) {
+ wcsncpy_s(g_profileDir, szProfile, _TRUNCATE);
if (profileName[0]) {
- p = _tcsrchr(g_profileDir, '\\'); *p = 0;
- p = _tcsrchr(g_profileDir, '\\');
+ p = wcsrchr(g_profileDir, '\\'); *p = 0;
+ p = wcsrchr(g_profileDir, '\\');
if (p && mir_tstrcmpi(p + 1, profileName) == 0)
*p = 0;
}
@@ -164,14 +164,14 @@ static void loadProfileByShortName(const TCHAR* src, TCHAR *szProfile, size_t cc
}
}
-void getProfileCmdLine(TCHAR *szProfile, size_t cch)
+void getProfileCmdLine(wchar_t *szProfile, size_t cch)
{
LPCTSTR ptszProfileName = CmdLine_GetOption(L"profile");
if (ptszProfileName != NULL)
loadProfileByShortName(ptszProfileName, szProfile, cch);
}
-void getProfileDefault(TCHAR *szProfile, size_t cch)
+void getProfileDefault(wchar_t *szProfile, size_t cch)
{
if (g_defaultProfile != NULL) {
loadProfileByShortName(g_defaultProfile, szProfile, cch);
@@ -180,35 +180,35 @@ void getProfileDefault(TCHAR *szProfile, size_t cch)
}
// move profile from profile subdir
-static void moveProfileDirProfiles(TCHAR *profiledir, BOOL isRootDir = TRUE)
+static void moveProfileDirProfiles(wchar_t *profiledir, BOOL isRootDir = TRUE)
{
- TCHAR pfd[MAX_PATH];
+ wchar_t pfd[MAX_PATH];
if (isRootDir)
- _tcsncpy_s(pfd, VARST(L"%miranda_path%\\*.dat"), _TRUNCATE);
+ wcsncpy_s(pfd, VARST(L"%miranda_path%\\*.dat"), _TRUNCATE);
else
mir_sntprintf(pfd, L"%s\\*.dat", profiledir);
WIN32_FIND_DATA ffd;
HANDLE hFind = FindFirstFile(pfd, &ffd);
if (hFind != INVALID_HANDLE_VALUE) {
- TCHAR *c = _tcsrchr(pfd, '\\'); if (c) *c = 0;
+ wchar_t *c = wcsrchr(pfd, '\\'); if (c) *c = 0;
do {
- TCHAR path[MAX_PATH], path2[MAX_PATH];
- TCHAR* profile = mir_tstrdup(ffd.cFileName);
- c = _tcsrchr(profile, '.'); if (c) *c = 0;
+ wchar_t path[MAX_PATH], path2[MAX_PATH];
+ wchar_t* profile = mir_tstrdup(ffd.cFileName);
+ c = wcsrchr(profile, '.'); if (c) *c = 0;
mir_sntprintf(path, L"%s\\%s", pfd, ffd.cFileName);
mir_sntprintf(path2, L"%s\\%s", profiledir, profile);
CreateDirectoryTreeT(path2);
mir_sntprintf(path2, L"%s\\%s\\%s", profiledir, profile, ffd.cFileName);
- if (_taccess(path2, 0) == 0) {
- TCHAR buf[512];
+ if (_waccess(path2, 0) == 0) {
+ wchar_t buf[512];
mir_sntprintf(buf,
TranslateT("Miranda is trying to upgrade your profile structure.\nIt cannot move profile %s to the new location %s\nBecause profile with this name already exists. Please resolve the issue manually."),
path, path2);
MessageBox(NULL, buf, L"Miranda NG", MB_ICONERROR | MB_OK);
}
else if (MoveFile(path, path2) == 0) {
- TCHAR buf[512];
+ wchar_t buf[512];
mir_sntprintf(buf,
TranslateT("Miranda is trying to upgrade your profile structure.\nIt cannot move profile %s to the new location %s automatically\nMost likely this is due to insufficient privileges. Please move profile manually."),
path, path2);
@@ -223,7 +223,7 @@ static void moveProfileDirProfiles(TCHAR *profiledir, BOOL isRootDir = TRUE)
}
// returns 1 if a single profile (full path) is found within the profile dir
-static int getProfile1(TCHAR *szProfile, size_t cch, TCHAR *profiledir, BOOL * noProfiles)
+static int getProfile1(wchar_t *szProfile, size_t cch, wchar_t *profiledir, BOOL * noProfiles)
{
int found = 0;
@@ -232,14 +232,14 @@ static int getProfile1(TCHAR *szProfile, size_t cch, TCHAR *profiledir, BOOL * n
moveProfileDirProfiles(profiledir, FALSE);
bool bNoDefaultProfile = (*szProfile == 0);
- bool reqfd = !bNoDefaultProfile && (_taccess(szProfile, 0) == 0 || shouldAutoCreate(szProfile));
+ bool reqfd = !bNoDefaultProfile && (_waccess(szProfile, 0) == 0 || shouldAutoCreate(szProfile));
bool bShowProfileManager = showProfileManager();
if (reqfd)
found++;
if (bShowProfileManager || !reqfd) {
- TCHAR searchspec[MAX_PATH];
+ wchar_t searchspec[MAX_PATH];
mir_sntprintf(searchspec, L"%s\\*.*", profiledir);
WIN32_FIND_DATA ffd;
@@ -250,16 +250,16 @@ static int getProfile1(TCHAR *szProfile, size_t cch, TCHAR *profiledir, BOOL * n
if (!(ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || !mir_tstrcmp(ffd.cFileName, L".") || !mir_tstrcmp(ffd.cFileName, L".."))
continue;
- TCHAR newProfile[MAX_PATH];
+ wchar_t newProfile[MAX_PATH];
mir_sntprintf(newProfile, L"%s\\%s\\%s.dat", profiledir, ffd.cFileName, ffd.cFileName);
- if (_taccess(newProfile, 0) != 0)
+ if (_waccess(newProfile, 0) != 0)
continue;
switch (touchDatabase(newProfile, NULL)) {
case 0:
case EGROKPRF_OBSOLETE:
if (++found == 1 && bNoDefaultProfile)
- _tcsncpy_s(szProfile, cch, newProfile, _TRUNCATE);
+ wcsncpy_s(szProfile, cch, newProfile, _TRUNCATE);
break;
}
} while (FindNextFile(hFind, &ffd));
@@ -279,12 +279,12 @@ static int getProfile1(TCHAR *szProfile, size_t cch, TCHAR *profiledir, BOOL * n
}
// returns 1 if a default profile should be selected instead of showing the manager.
-static int getProfileAutoRun(TCHAR *szProfile)
+static int getProfileAutoRun(wchar_t *szProfile)
{
if (*szProfile == 0)
return false;
- TCHAR Mgr[32];
+ wchar_t Mgr[32];
GetPrivateProfileString(L"Database", L"ShowProfileMgr", L"", Mgr, _countof(Mgr), mirandabootini);
if (mir_tstrcmpi(Mgr, L"never"))
return 0;
@@ -293,7 +293,7 @@ static int getProfileAutoRun(TCHAR *szProfile)
}
// returns 1 if a profile was selected
-static int getProfile(TCHAR *szProfile, size_t cch)
+static int getProfile(wchar_t *szProfile, size_t cch)
{
getProfilePath(g_profileDir, _countof(g_profileDir));
if (IsInsideRootDir(g_profileDir, true))
@@ -307,7 +307,7 @@ static int getProfile(TCHAR *szProfile, size_t cch)
if (IsInsideRootDir(g_profileDir, true)) {
MessageBox(NULL,
TranslateT("Profile cannot be placed into Miranda root folder.\nPlease move Miranda profile to some other location."),
- LPGENT("Miranda NG"), MB_ICONERROR | MB_OK);
+ LPGENW("Miranda NG"), MB_ICONERROR | MB_OK);
return 0;
}
@@ -334,14 +334,14 @@ LBL_Show:
goto LBL_Show;
}
-// carefully converts a file name from TCHAR* to char*
-char* makeFileName(const TCHAR* tszOriginalName)
+// carefully converts a file name from wchar_t* to char*
+char* makeFileName(const wchar_t* tszOriginalName)
{
char *szResult = NULL;
char *szFileName = mir_t2a(tszOriginalName);
- TCHAR *tszFileName = mir_a2t(szFileName);
+ wchar_t *tszFileName = mir_a2t(szFileName);
if (mir_tstrcmp(tszOriginalName, tszFileName)) {
- TCHAR tszProfile[MAX_PATH];
+ wchar_t tszProfile[MAX_PATH];
if (GetShortPathName(tszOriginalName, tszProfile, MAX_PATH) != 0)
szResult = mir_t2a(tszProfile);
}
@@ -355,7 +355,7 @@ char* makeFileName(const TCHAR* tszOriginalName)
return szResult;
}
-int touchDatabase(const TCHAR *tszProfile, DATABASELINK **dblink)
+int touchDatabase(const wchar_t *tszProfile, DATABASELINK **dblink)
{
for (int i = arDbPlugins.getCount() - 1; i >= 0; i--) {
DATABASELINK *p = arDbPlugins[i];
@@ -378,7 +378,7 @@ int touchDatabase(const TCHAR *tszProfile, DATABASELINK **dblink)
}
// enumerate all plugins that had valid DatabasePluginInfo()
-int tryOpenDatabase(const TCHAR *tszProfile)
+int tryOpenDatabase(const wchar_t *tszProfile)
{
for (int i = arDbPlugins.getCount() - 1; i >= 0; i--) {
DATABASELINK *p = arDbPlugins[i];
@@ -417,9 +417,9 @@ int tryOpenDatabase(const TCHAR *tszProfile)
}
// enumerate all plugins that had valid DatabasePluginInfo()
-static int tryCreateDatabase(const TCHAR *ptszProfile)
+static int tryCreateDatabase(const wchar_t *ptszProfile)
{
- TCHAR *tszProfile = NEWTSTR_ALLOCA(ptszProfile);
+ wchar_t *tszProfile = NEWWSTR_ALLOCA(ptszProfile);
CreatePathToFileT(tszProfile);
for (int i = 0; i < arDbPlugins.getCount(); i++) {
@@ -443,7 +443,7 @@ static int tryCreateDatabase(const TCHAR *ptszProfile)
typedef struct
{
- TCHAR *profile;
+ wchar_t *profile;
UINT msg;
ATOM aPath;
int found;
@@ -451,7 +451,7 @@ typedef struct
static BOOL CALLBACK EnumMirandaWindows(HWND hwnd, LPARAM lParam)
{
- TCHAR classname[256];
+ wchar_t classname[256];
ENUMMIRANDAWINDOW *x = (ENUMMIRANDAWINDOW *)lParam;
DWORD_PTR res = 0;
if (GetClassName(hwnd, classname, _countof(classname)) && mir_tstrcmp(L"Miranda", classname) == 0) {
@@ -463,7 +463,7 @@ static BOOL CALLBACK EnumMirandaWindows(HWND hwnd, LPARAM lParam)
return TRUE;
}
-static int FindMirandaForProfile(TCHAR *szProfile)
+static int FindMirandaForProfile(wchar_t *szProfile)
{
ENUMMIRANDAWINDOW x = { 0 };
x.profile = szProfile;
@@ -474,14 +474,14 @@ static int FindMirandaForProfile(TCHAR *szProfile)
return x.found;
}
-static TCHAR tszNoDrivers[] = LPGENT("Miranda is unable to open '%s' because you do not have any profile plugins installed.\nYou need to install dbx_mmap.dll");
-static TCHAR tszUnknownFormat[] = LPGENT("Miranda was unable to open '%s', it's in an unknown format.\nThis profile might also be damaged, please run DbChecker which should be installed.");
-static TCHAR tszProfileLocked[] = LPGENT("Miranda was unable to open '%s'\nIt's inaccessible or used by other application or Miranda instance");
-static TCHAR tszNoSuitableDriver[] = LPGENT("Miranda was unable to open '%s'\nThere is no suitable database driver installed");
+static wchar_t tszNoDrivers[] = LPGENW("Miranda is unable to open '%s' because you do not have any profile plugins installed.\nYou need to install dbx_mmap.dll");
+static wchar_t tszUnknownFormat[] = LPGENW("Miranda was unable to open '%s', it's in an unknown format.\nThis profile might also be damaged, please run DbChecker which should be installed.");
+static wchar_t tszProfileLocked[] = LPGENW("Miranda was unable to open '%s'\nIt's inaccessible or used by other application or Miranda instance");
+static wchar_t tszNoSuitableDriver[] = LPGENW("Miranda was unable to open '%s'\nThere is no suitable database driver installed");
int LoadDatabaseModule(void)
{
- TCHAR szProfile[MAX_PATH];
+ wchar_t szProfile[MAX_PATH];
PathToAbsoluteT(L".", szProfile);
_tchdir(szProfile);
szProfile[0] = 0;
@@ -492,7 +492,7 @@ int LoadDatabaseModule(void)
if (!getProfile(szProfile, _countof(szProfile)))
return 1;
- TCHAR *ptszFileName = _tcsrchr(szProfile, '\\');
+ wchar_t *ptszFileName = wcsrchr(szProfile, '\\');
ptszFileName = (ptszFileName) ? ptszFileName + 1 : szProfile;
if (arDbPlugins.getCount() == 0) {
@@ -507,7 +507,7 @@ int LoadDatabaseModule(void)
int rc;
do {
retry = false;
- if (_taccess(szProfile, 0) && shouldAutoCreate(szProfile))
+ if (_waccess(szProfile, 0) && shouldAutoCreate(szProfile))
rc = tryCreateDatabase(szProfile);
else
rc = tryOpenDatabase(szProfile);
diff --git a/src/mir_app/src/dbini.cpp b/src/mir_app/src/dbini.cpp
index 855c624fce..77a42d8db6 100644
--- a/src/mir_app/src/dbini.cpp
+++ b/src/mir_app/src/dbini.cpp
@@ -33,18 +33,18 @@ static INT_PTR CALLBACK InstallIniDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
switch (message) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- SetDlgItemText(hwndDlg, IDC_ININAME, (TCHAR*)lParam);
+ SetDlgItemText(hwndDlg, IDC_ININAME, (wchar_t*)lParam);
{
- TCHAR szSecurity[11];
- const TCHAR *pszSecurityInfo;
+ wchar_t szSecurity[11];
+ const wchar_t *pszSecurityInfo;
GetPrivateProfileString(L"AutoExec", L"Warn", L"notsafe", szSecurity, _countof(szSecurity), mirandabootini);
if (!mir_tstrcmpi(szSecurity, L"all"))
- pszSecurityInfo = LPGENT("Security systems to prevent malicious changes are in place and you will be warned before every change that is made.");
+ pszSecurityInfo = LPGENW("Security systems to prevent malicious changes are in place and you will be warned before every change that is made.");
else if (!mir_tstrcmpi(szSecurity, L"onlyunsafe"))
- pszSecurityInfo = LPGENT("Security systems to prevent malicious changes are in place and you will be warned before changes that are known to be unsafe.");
+ pszSecurityInfo = LPGENW("Security systems to prevent malicious changes are in place and you will be warned before changes that are known to be unsafe.");
else if (!mir_tstrcmpi(szSecurity, L"none"))
- pszSecurityInfo = LPGENT("Security systems to prevent malicious changes have been disabled. You will receive no further warnings.");
+ pszSecurityInfo = LPGENW("Security systems to prevent malicious changes have been disabled. You will receive no further warnings.");
else pszSecurityInfo = NULL;
if (pszSecurityInfo) SetDlgItemText(hwndDlg, IDC_SECURITYINFO, TranslateTS(pszSecurityInfo));
}
@@ -54,7 +54,7 @@ static INT_PTR CALLBACK InstallIniDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
switch (LOWORD(wParam)) {
case IDC_VIEWINI:
{
- TCHAR szPath[MAX_PATH];
+ wchar_t szPath[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_ININAME, szPath, _countof(szPath));
ShellExecute(hwndDlg, L"open", szPath, NULL, NULL, SW_SHOW);
}
@@ -90,7 +90,7 @@ static bool IsInSpaceSeparatedList(const char *szWord, const char *szList)
}
struct warnSettingChangeInfo_t {
- TCHAR *szIniPath;
+ wchar_t *szIniPath;
char *szSection;
char *szSafeSections;
char *szUnsafeSections;
@@ -107,7 +107,7 @@ static INT_PTR CALLBACK WarnIniChangeDlgProc(HWND hwndDlg, UINT message, WPARAM
case WM_INITDIALOG:
{
char szSettingName[256];
- const TCHAR *pszSecurityInfo;
+ const wchar_t *pszSecurityInfo;
warnInfo = (warnSettingChangeInfo_t*)lParam;
TranslateDialogDefault(hwndDlg);
SetDlgItemText(hwndDlg, IDC_ININAME, warnInfo->szIniPath);
@@ -117,11 +117,11 @@ static INT_PTR CALLBACK WarnIniChangeDlgProc(HWND hwndDlg, UINT message, WPARAM
SetDlgItemTextA(hwndDlg, IDC_SETTINGNAME, szSettingName);
SetDlgItemTextA(hwndDlg, IDC_NEWVALUE, warnInfo->szValue);
if (IsInSpaceSeparatedList(warnInfo->szSection, warnInfo->szSafeSections))
- pszSecurityInfo = LPGENT("This change is known to be safe.");
+ pszSecurityInfo = LPGENW("This change is known to be safe.");
else if (IsInSpaceSeparatedList(warnInfo->szSection, warnInfo->szUnsafeSections))
- pszSecurityInfo = LPGENT("This change is known to be potentially hazardous.");
+ pszSecurityInfo = LPGENW("This change is known to be potentially hazardous.");
else
- pszSecurityInfo = LPGENT("This change is not known to be safe.");
+ pszSecurityInfo = LPGENW("This change is not known to be safe.");
SetDlgItemText(hwndDlg, IDC_SECURITYINFO, TranslateTS(pszSecurityInfo));
}
return TRUE;
@@ -144,13 +144,13 @@ static INT_PTR CALLBACK WarnIniChangeDlgProc(HWND hwndDlg, UINT message, WPARAM
static INT_PTR CALLBACK IniImportDoneDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
- TCHAR szIniPath[MAX_PATH];
+ wchar_t szIniPath[MAX_PATH];
switch (message) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- SetDlgItemText(hwndDlg, IDC_ININAME, (TCHAR*)lParam);
- SetDlgItemText(hwndDlg, IDC_NEWNAME, (TCHAR*)lParam);
+ SetDlgItemText(hwndDlg, IDC_ININAME, (wchar_t*)lParam);
+ SetDlgItemText(hwndDlg, IDC_NEWNAME, (wchar_t*)lParam);
return TRUE;
case WM_COMMAND:
@@ -173,7 +173,7 @@ static INT_PTR CALLBACK IniImportDoneDlgProc(HWND hwndDlg, UINT message, WPARAM
EndDialog(hwndDlg, LOWORD(wParam));
break;
case IDC_MOVE:
- TCHAR szNewPath[MAX_PATH];
+ wchar_t szNewPath[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_NEWNAME, szNewPath, _countof(szNewPath));
MoveFile(szIniPath, szNewPath);
EndDialog(hwndDlg, LOWORD(wParam));
@@ -230,9 +230,9 @@ static int EnumSettingsForDeletion(const char *szSetting, LPARAM param)
return 0;
}
-static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsafeSections, int secur, bool secFN)
+static void ProcessIniFile(wchar_t* szIniPath, char *szSafeSections, char *szUnsafeSections, int secur, bool secFN)
{
- FILE *fp = _tfopen(szIniPath, L"rt");
+ FILE *fp = _wfopen(szIniPath, L"rt");
if (fp == NULL)
return;
@@ -423,7 +423,7 @@ LBL_NewLine:
}
break;
default:
- TCHAR buf[250];
+ wchar_t buf[250];
mir_sntprintf(buf, TranslateT("Invalid setting type for '%s'. The first character of every value must be b, w, d, l, s, e, u, g, h or n."), _A2T(szName));
MessageBox(NULL, buf, TranslateT("Install database settings"), MB_ICONWARNING | MB_OK);
break;
@@ -434,8 +434,8 @@ LBL_NewLine:
static void DoAutoExec(void)
{
- TCHAR szUse[7], szIniPath[MAX_PATH], szFindPath[MAX_PATH];
- TCHAR buf[2048], szSecurity[11], szOverrideSecurityFilename[MAX_PATH], szOnCreateFilename[MAX_PATH];
+ wchar_t szUse[7], szIniPath[MAX_PATH], szFindPath[MAX_PATH];
+ wchar_t buf[2048], szSecurity[11], szOverrideSecurityFilename[MAX_PATH], szOnCreateFilename[MAX_PATH];
GetPrivateProfileString(L"AutoExec", L"Use", L"prompt", szUse, _countof(szUse), mirandabootini);
if (!mir_tstrcmpi(szUse, L"no")) return;
@@ -466,7 +466,7 @@ static void DoAutoExec(void)
if (hFind == INVALID_HANDLE_VALUE)
return;
- TCHAR *str2 = _tcsrchr(szFindPath, '\\');
+ wchar_t *str2 = wcsrchr(szFindPath, '\\');
if (str2 == NULL)
szFindPath[0] = 0;
else
@@ -487,7 +487,7 @@ static void DoAutoExec(void)
if (secFN)
DeleteFile(szIniPath);
else {
- TCHAR szOnCompletion[8];
+ wchar_t szOnCompletion[8];
GetPrivateProfileString(L"AutoExec", L"OnCompletion", L"recycle", szOnCompletion, _countof(szOnCompletion), mirandabootini);
if (!mir_tstrcmpi(szOnCompletion, L"delete"))
DeleteFile(szIniPath);
@@ -500,7 +500,7 @@ static void DoAutoExec(void)
SHFileOperation(&shfo);
}
else if (!mir_tstrcmpi(szOnCompletion, L"rename")) {
- TCHAR szRenamePrefix[MAX_PATH], szNewPath[MAX_PATH];
+ wchar_t szRenamePrefix[MAX_PATH], szNewPath[MAX_PATH];
GetPrivateProfileString(L"AutoExec", L"RenamePrefix", L"done_", szRenamePrefix, _countof(szRenamePrefix), mirandabootini);
mir_tstrcpy(szNewPath, szFindPath);
mir_tstrcat(szNewPath, szRenamePrefix);
@@ -536,7 +536,7 @@ int InitIni(void)
CreateServiceFunction("DB/Ini/ImportFile", ImportINI);
DoAutoExec();
- TCHAR szMirandaDir[MAX_PATH];
+ wchar_t szMirandaDir[MAX_PATH];
PathToAbsoluteT(L".", szMirandaDir);
hIniChangeNotification = FindFirstChangeNotification(szMirandaDir, 0, FILE_NOTIFY_CHANGE_FILE_NAME);
if (hIniChangeNotification != INVALID_HANDLE_VALUE) {
diff --git a/src/mir_app/src/dbintf.cpp b/src/mir_app/src/dbintf.cpp
index 5a95326330..dca13b96f3 100644
--- a/src/mir_app/src/dbintf.cpp
+++ b/src/mir_app/src/dbintf.cpp
@@ -106,7 +106,7 @@ static INT_PTR srvRegisterPlugin(WPARAM, LPARAM lParam)
static INT_PTR srvFindPlugin(WPARAM, LPARAM lParam)
{
for (int i = arDbPlugins.getCount() - 1; i >= 0; i--) {
- int error = arDbPlugins[i]->grokHeader((TCHAR*)lParam);
+ int error = arDbPlugins[i]->grokHeader((wchar_t*)lParam);
if (error == ERROR_SUCCESS || error == EGROKPRF_OBSOLETE)
return (INT_PTR)arDbPlugins[i];
}
diff --git a/src/mir_app/src/dbutils.cpp b/src/mir_app/src/dbutils.cpp
index d7a958004f..8408eaf2b8 100644
--- a/src/mir_app/src/dbutils.cpp
+++ b/src/mir_app/src/dbutils.cpp
@@ -83,7 +83,7 @@ static INT_PTR DbEventTypeGet(WPARAM wParam, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
-static TCHAR* getEventString(DBEVENTINFO *dbei, LPSTR &buf)
+static wchar_t* getEventString(DBEVENTINFO *dbei, LPSTR &buf)
{
LPSTR in = buf;
buf += mir_strlen(buf) + 1;
@@ -323,8 +323,8 @@ static INT_PTR GetProfileNameW(WPARAM wParam, LPARAM lParam)
static INT_PTR SetDefaultProfile(WPARAM wParam, LPARAM)
{
- extern TCHAR* g_defaultProfile;
- replaceStrT(g_defaultProfile, (TCHAR*)wParam);
+ extern wchar_t* g_defaultProfile;
+ replaceStrT(g_defaultProfile, (wchar_t*)wParam);
return 0;
}
diff --git a/src/mir_app/src/descbutton.cpp b/src/mir_app/src/descbutton.cpp
index 332a2f064f..c45e5fc226 100644
--- a/src/mir_app/src/descbutton.cpp
+++ b/src/mir_app/src/descbutton.cpp
@@ -43,8 +43,8 @@ struct MDescButtonCtrl
HWND hwnd;
BOOL bSharedIcon;
HICON hIcon;
- TCHAR *lpzTitle;
- TCHAR *lpzDescription;
+ wchar_t *lpzTitle;
+ wchar_t *lpzDescription;
// UI info
BOOL bMouseInside;
diff --git a/src/mir_app/src/dll_sniffer.cpp b/src/mir_app/src/dll_sniffer.cpp
index b68b3101d1..e32cbcce07 100644
--- a/src/mir_app/src/dll_sniffer.cpp
+++ b/src/mir_app/src/dll_sniffer.cpp
@@ -34,7 +34,7 @@ static IMAGE_SECTION_HEADER *getSectionByRVA(IMAGE_SECTION_HEADER *pISH, int nSe
return NULL;
}
-MUUID* GetPluginInterfaces(const TCHAR* ptszFileName, bool& bIsPlugin)
+MUUID* GetPluginInterfaces(const wchar_t* ptszFileName, bool& bIsPlugin)
{
bIsPlugin = false;
diff --git a/src/mir_app/src/enterstring.cpp b/src/mir_app/src/enterstring.cpp
index 09503a08d8..884166c7a9 100644
--- a/src/mir_app/src/enterstring.cpp
+++ b/src/mir_app/src/enterstring.cpp
@@ -68,7 +68,7 @@ static void ComboLoadRecentStrings(HWND hwndDlg, EnterStringFormParam *pForm)
static void ComboAddRecentString(HWND hwndDlg, EnterStringFormParam *pForm)
{
- TCHAR *string = pForm->ptszResult;
+ wchar_t *string = pForm->ptszResult;
if (!string || !*string)
return;
@@ -141,7 +141,7 @@ static INT_PTR CALLBACK sttEnterStringDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
if (params->timeout > 0) {
SetTimer(hwndDlg, 1001, 1000, NULL);
- TCHAR buf[128];
+ wchar_t buf[128];
mir_sntprintf(buf, TranslateT("OK (%d)"), params->timeout);
SetDlgItemText(hwndDlg, IDOK, buf);
}
@@ -160,7 +160,7 @@ static INT_PTR CALLBACK sttEnterStringDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
break;
case 1001:
- TCHAR buf[128];
+ wchar_t buf[128];
mir_sntprintf(buf, TranslateT("OK (%d)"), --params->timeout);
SetDlgItemText(hwndDlg, IDOK, buf);
@@ -196,7 +196,7 @@ static INT_PTR CALLBACK sttEnterStringDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
TEXTRANGE tr;
tr.chrg = param->chrg;
- tr.lpstrText = (TCHAR *)mir_alloc(sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 2));
+ tr.lpstrText = (wchar_t *)mir_alloc(sizeof(wchar_t)*(tr.chrg.cpMax - tr.chrg.cpMin + 2));
SendMessage(param->nmhdr.hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
Utils_OpenUrlT(tr.lpstrText);
@@ -231,7 +231,7 @@ static INT_PTR CALLBACK sttEnterStringDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
case IDOK:
HWND hWnd = GetDlgItem(hwndDlg, params->idcControl);
int len = GetWindowTextLength(hWnd)+1;
- params->ptszResult = (LPTSTR)mir_alloc(sizeof(TCHAR)*len);
+ params->ptszResult = (LPTSTR)mir_alloc(sizeof(wchar_t)*len);
GetWindowText(hWnd, params->ptszResult, len);
if ((params->type == ESF_COMBO) && params->szDataPrefix && params->recentCount)
diff --git a/src/mir_app/src/extraicons.cpp b/src/mir_app/src/extraicons.cpp
index 03efd88a84..6acbca19fc 100644
--- a/src/mir_app/src/extraicons.cpp
+++ b/src/mir_app/src/extraicons.cpp
@@ -395,7 +395,7 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterCallback(const char *name, const
return 0;
ptrT tszDesc(mir_a2t(description));
- TCHAR *desc = TranslateTH(_hLang, tszDesc);
+ wchar_t *desc = TranslateTH(_hLang, tszDesc);
int id = registeredExtraIcons.getCount() + 1;
BaseExtraIcon *extra = new CallbackExtraIcon(id, name, desc, descIcon == NULL ? "" : descIcon, RebuildIcons, ApplyIcon, OnClick, onClickParam);
@@ -410,7 +410,7 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterIcolib(const char *name, const ch
return 0;
ptrT tszDesc(mir_a2t(description));
- TCHAR *desc = TranslateTH(_hLang, tszDesc);
+ wchar_t *desc = TranslateTH(_hLang, tszDesc);
BaseExtraIcon *extra = GetExtraIconByName(name);
if (extra != NULL) {
diff --git a/src/mir_app/src/filter.cpp b/src/mir_app/src/filter.cpp
index 1470314864..f6d685fca3 100644
--- a/src/mir_app/src/filter.cpp
+++ b/src/mir_app/src/filter.cpp
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
CPageList filterStrings(1);
-void AddFilterString(const PageHash key, TCHAR *data)
+void AddFilterString(const PageHash key, wchar_t *data)
{
if (ContainsFilterString(key, data)) return;
@@ -44,7 +44,7 @@ void ClearFilterStrings()
filterStrings.destroy();
}
-BOOL ContainsFilterString(const PageHash key, TCHAR *data)
+BOOL ContainsFilterString(const PageHash key, wchar_t *data)
{
CPageKeywords* values = filterStrings[key];
return (values) ? values->ContainsString(data) : FALSE;
@@ -53,7 +53,7 @@ BOOL ContainsFilterString(const PageHash key, TCHAR *data)
void AddTreeViewNodes(HWND hWndDlg, PageHash key, HTREEITEM root)
{
if (root) {
- TCHAR title[2048] = {0};
+ wchar_t title[2048] = {0};
TVITEM item = {0};
item.mask = TVIF_TEXT;
@@ -77,12 +77,12 @@ void AddTreeViewNodes(HWND hWndDlg, PageHash key, HTREEITEM root)
void AddDialogString(HWND hWndDlg, const PageHash key)
{
- TCHAR title[2048];
+ wchar_t title[2048];
GetWindowText(hWndDlg, title, _countof(title));
if (mir_tstrlen(title) > 0)
AddFilterString(key, title);
- TCHAR szClass[64];
+ wchar_t szClass[64];
GetClassName(hWndDlg, szClass, _countof(szClass));
if (mir_tstrcmpi(szClass, L"SysTreeView32") == 0) {
@@ -143,7 +143,7 @@ static BOOL CALLBACK GetDialogStringsCallback(HWND hWnd, LPARAM lParam)
return TRUE;
}
-void GetDialogStrings(int enableKeywordFiltering, const PageHash key, TCHAR *pluginName, HWND hWnd, TCHAR *group, TCHAR *title, TCHAR *tab, TCHAR *name)
+void GetDialogStrings(int enableKeywordFiltering, const PageHash key, wchar_t *pluginName, HWND hWnd, wchar_t *group, wchar_t *title, wchar_t *tab, wchar_t *name)
{
AddFilterString(key, pluginName); //add the plugin name as keyword
if (group) AddFilterString(key, group);
diff --git a/src/mir_app/src/filter.h b/src/mir_app/src/filter.h
index bb35912a40..3c20fcfc69 100644
--- a/src/mir_app/src/filter.h
+++ b/src/mir_app/src/filter.h
@@ -29,23 +29,23 @@ extern HANDLE hOptionsInitialize;
typedef DWORD PageHash;
-void AddFilterString(const PageHash key, const TCHAR *data);
-BOOL ContainsFilterString(const PageHash key, TCHAR *data);
+void AddFilterString(const PageHash key, const wchar_t *data);
+BOOL ContainsFilterString(const PageHash key, wchar_t *data);
void ClearFilterStrings();
-void GetDialogStrings(int enableKeywordFiltering, const PageHash key, TCHAR *pluginName, HWND hWnd, TCHAR *group, TCHAR *title, TCHAR *tab, TCHAR *name);
+void GetDialogStrings(int enableKeywordFiltering, const PageHash key, wchar_t *pluginName, HWND hWnd, wchar_t *group, wchar_t *title, wchar_t *tab, wchar_t *name);
-_inline TCHAR *_tcslwr_locale(TCHAR *buf)
+_inline wchar_t *_tcslwr_locale(wchar_t *buf)
{
LCMapString(Langpack_GetDefaultLocale() , LCMAP_LOWERCASE, buf, (int)mir_tstrlen(buf), buf, (int)mir_tstrlen(buf));
return buf;
}
-typedef LIST<TCHAR> KeywordList;
+typedef LIST<wchar_t> KeywordList;
class CPageKeywords
{
PageHash _pageHashKey;
KeywordList _pageKeyWords;
- static int _KeyWordsSortFunc(const TCHAR* p1, const TCHAR* p2) { return mir_tstrcmp(p1, p2); };
+ static int _KeyWordsSortFunc(const wchar_t* p1, const wchar_t* p2) { return mir_tstrcmp(p1, p2); };
public:
CPageKeywords(PageHash pageHashKey) : _pageHashKey(pageHashKey), _pageKeyWords(1, _KeyWordsSortFunc) {};
@@ -55,19 +55,19 @@ public:
mir_free(_pageKeyWords[j]);
};
- void AddKeyWord(TCHAR *ptKeyWord)
+ void AddKeyWord(wchar_t *ptKeyWord)
{
- TCHAR *plwrWord = _tcslwr_locale(mir_tstrdup(ptKeyWord));
+ wchar_t *plwrWord = _tcslwr_locale(mir_tstrdup(ptKeyWord));
if (_pageKeyWords.getIndex(plwrWord) == -1)
_pageKeyWords.insert(plwrWord);
else
mir_free(plwrWord);
};
- BOOL ContainsString(TCHAR *data)
+ BOOL ContainsString(wchar_t *data)
{
for (int i=0; i < _pageKeyWords.getCount(); i++)
- if (_tcsstr(_pageKeyWords[i], data))
+ if (wcsstr(_pageKeyWords[i], data))
return TRUE;
return FALSE;
}
diff --git a/src/mir_app/src/findadd.cpp b/src/mir_app/src/findadd.cpp
index 0cad9fcd93..a6c1f98520 100644
--- a/src/mir_app/src/findadd.cpp
+++ b/src/mir_app/src/findadd.cpp
@@ -291,7 +291,7 @@ static void CheckSearchTypeRadioButton(HWND hwndDlg, int idControl)
#define sttErrMsg TranslateT("You haven't filled in the search field. Please enter a search term and try again.")
#define sttErrTitle TranslateT("Search")
-static void SetListItemText(HWND hwndList, int idx, int col, TCHAR *szText)
+static void SetListItemText(HWND hwndList, int idx, int col, wchar_t *szText)
{
if (szText == NULL || *szText == 0)
szText = TranslateT("<not specified>");
@@ -299,7 +299,7 @@ static void SetListItemText(HWND hwndList, int idx, int col, TCHAR *szText)
ListView_SetItemText(hwndList, idx, col, szText);
}
-static TCHAR* sttDecodeString(DWORD dwFlags, MAllStrings &src)
+static wchar_t* sttDecodeString(DWORD dwFlags, MAllStrings &src)
{
if (dwFlags & PSR_UNICODE)
return mir_u2t(src.w);
@@ -326,7 +326,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
dat->iLastColumnSortIndex = 1;
dat->bSortAscending = 1;
SendDlgItemMessage(hwndDlg, IDC_MOREOPTIONS, BUTTONSETARROW, 1, 0);
- SendDlgItemMessage(hwndDlg, IDOK, BUTTONADDTOOLTIP, (WPARAM)LPGENT("Ctrl+Search add contact"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDOK, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Ctrl+Search add contact"), BATF_TCHAR);
ListView_SetExtendedListViewStyle(hwndList, LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP);
@@ -363,10 +363,10 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SendDlgItemMessage(hwndDlg, IDC_STATUSBAR, SB_SETTEXT, 1 | SBT_OWNERDRAW, 0);
SetStatusBarSearchInfo(GetDlgItem(hwndDlg, IDC_STATUSBAR), dat);
- TCHAR *szProto = NULL;
+ wchar_t *szProto = NULL;
ptrT tszLast(db_get_tsa(NULL, "FindAdd", "LastSearched"));
if (tszLast)
- szProto = NEWTSTR_ALLOCA(tszLast);
+ szProto = NEWWSTR_ALLOCA(tszLast);
int i, index = 0, cbwidth = 0, netProtoCount = 0;
for (i = 0; i < accounts.getCount(); i++) {
@@ -687,7 +687,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (IsDlgButtonChecked(hwndDlg, IDC_BYCUSTOM))
BeginSearch(hwndDlg, dat, szProto, PS_SEARCHBYADVANCED, PF1_EXTSEARCHUI, dat->hwndTinySearch);
else if (IsDlgButtonChecked(hwndDlg, IDC_BYPROTOID)) {
- TCHAR str[256];
+ wchar_t str[256];
GetDlgItemText(hwndDlg, IDC_PROTOID, str, _countof(str));
rtrimt(str);
if (str[0] == 0)
@@ -696,7 +696,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
BeginSearch(hwndDlg, dat, szProto, PS_BASICSEARCH, PF1_BASICSEARCH, str);
}
else if (IsDlgButtonChecked(hwndDlg, IDC_BYEMAIL)) {
- TCHAR str[256];
+ wchar_t str[256];
GetDlgItemText(hwndDlg, IDC_EMAIL, str, _countof(str));
rtrimt(str);
if (str[0] == 0)
@@ -705,7 +705,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
BeginSearch(hwndDlg, dat, szProto, PS_SEARCHBYEMAIL, PF1_SEARCHBYEMAIL, str);
}
else if (IsDlgButtonChecked(hwndDlg, IDC_BYNAME)) {
- TCHAR nick[256], first[256], last[256];
+ wchar_t nick[256], first[256], last[256];
PROTOSEARCHBYNAME psbn;
GetDlgItemText(hwndDlg, IDC_NAMENICK, nick, _countof(nick));
GetDlgItemText(hwndDlg, IDC_NAMEFIRST, first, _countof(first));
@@ -758,7 +758,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
acs.psr = &lsr->psr;
}
else {
- TCHAR str[256];
+ wchar_t str[256];
GetDlgItemText(hwndDlg, IDC_PROTOID, str, _countof(str));
if (*rtrimt(str) == 0)
break;
@@ -766,7 +766,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
psr.flags = PSR_TCHAR;
- psr.id.t = str;
+ psr.id.w = str;
acs.psr = &psr;
acs.szProto = (char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA,
@@ -864,11 +864,11 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
memcpy(&lsr->psr, psr, psr->cbSize);
/* Next block is not needed but behavior will be kept */
- lsr->psr.id.t = sttDecodeString(psr->flags, psr->id);
- lsr->psr.nick.t = sttDecodeString(psr->flags, psr->nick);
- lsr->psr.firstName.t = sttDecodeString(psr->flags, psr->firstName);
- lsr->psr.lastName.t = sttDecodeString(psr->flags, psr->lastName);
- lsr->psr.email.t = sttDecodeString(psr->flags, psr->email);
+ lsr->psr.id.w = sttDecodeString(psr->flags, psr->id);
+ lsr->psr.nick.w = sttDecodeString(psr->flags, psr->nick);
+ lsr->psr.firstName.w = sttDecodeString(psr->flags, psr->firstName);
+ lsr->psr.lastName.w = sttDecodeString(psr->flags, psr->lastName);
+ lsr->psr.email.w = sttDecodeString(psr->flags, psr->email);
lsr->psr.flags = psr->flags & ~PSR_UNICODE | PSR_TCHAR;
LVITEM lvi = { 0 };
@@ -904,11 +904,11 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
dat->bFlexSearchResult = FALSE;
memcpy(&lsr->psr, psr, psr->cbSize);
- lsr->psr.nick.t = sttDecodeString(psr->flags, psr->nick);
- lsr->psr.firstName.t = sttDecodeString(psr->flags, psr->firstName);
- lsr->psr.lastName.t = sttDecodeString(psr->flags, psr->lastName);
- lsr->psr.email.t = sttDecodeString(psr->flags, psr->email);
- lsr->psr.id.t = sttDecodeString(psr->flags, psr->id);
+ lsr->psr.nick.w = sttDecodeString(psr->flags, psr->nick);
+ lsr->psr.firstName.w = sttDecodeString(psr->flags, psr->firstName);
+ lsr->psr.lastName.w = sttDecodeString(psr->flags, psr->lastName);
+ lsr->psr.email.w = sttDecodeString(psr->flags, psr->email);
+ lsr->psr.id.w = sttDecodeString(psr->flags, psr->id);
lsr->psr.flags = psr->flags & ~PSR_UNICODE | PSR_TCHAR;
LVITEM lvi = { 0 };
@@ -928,11 +928,11 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
int iItem = ListView_InsertItem(hwndList, &lvi);
- SetListItemText(hwndList, iItem, 1, lsr->psr.id.t);
- SetListItemText(hwndList, iItem, 2, lsr->psr.nick.t);
- SetListItemText(hwndList, iItem, 3, lsr->psr.firstName.t);
- SetListItemText(hwndList, iItem, 4, lsr->psr.lastName.t);
- SetListItemText(hwndList, iItem, 5, lsr->psr.email.t);
+ SetListItemText(hwndList, iItem, 1, lsr->psr.id.w);
+ SetListItemText(hwndList, iItem, 2, lsr->psr.nick.w);
+ SetListItemText(hwndList, iItem, 3, lsr->psr.firstName.w);
+ SetListItemText(hwndList, iItem, 4, lsr->psr.lastName.w);
+ SetListItemText(hwndList, iItem, 5, lsr->psr.email.w);
SetStatusBarResultInfo(hwndDlg);
}
}
@@ -944,7 +944,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case WM_DESTROY:
int len = SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETLBTEXTLEN, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), 0);
- TCHAR *szProto = (TCHAR*)alloca(sizeof(TCHAR)*(len + 1));
+ wchar_t *szProto = (wchar_t*)alloca(sizeof(wchar_t)*(len + 1));
if (szProto != NULL) {
*szProto = '\0';
SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETLBTEXT, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), (LPARAM)szProto);
diff --git a/src/mir_app/src/genmenu.h b/src/mir_app/src/genmenu.h
index 2baed199d1..da3dc168c4 100644
--- a/src/mir_app/src/genmenu.h
+++ b/src/mir_app/src/genmenu.h
@@ -49,7 +49,7 @@ struct TMO_IntMenuItem
int iconId; // icon index in the section's image list
TMO_MenuItem mi; // user-defined data
char* pszUniqName; // unique name
- TCHAR* ptszCustomName;
+ wchar_t* ptszCustomName;
HANDLE hIcolibItem; // handle of iconlib item
HBITMAP hBmp;
int originalPosition; // !!!!!!!!!!!!!!!!!!!!!!!!
@@ -72,7 +72,7 @@ struct TIntMenuObject : public MZeroedObject
int id;
char *pszName;
- TCHAR *ptszDisplayName;
+ wchar_t *ptszDisplayName;
//ExecService
//LPARAM lParam;//owner data
diff --git a/src/mir_app/src/headerbar.cpp b/src/mir_app/src/headerbar.cpp
index 1230ca922f..b8c8651ff2 100644
--- a/src/mir_app/src/headerbar.cpp
+++ b/src/mir_app/src/headerbar.cpp
@@ -132,10 +132,10 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit)
PAINTSTRUCT ps;
int titleLength = GetWindowTextLength(hwndDlg) + 1;
- TCHAR *szTitle = (TCHAR *)mir_alloc(sizeof(TCHAR) * titleLength);
+ wchar_t *szTitle = (wchar_t *)mir_alloc(sizeof(wchar_t) * titleLength);
GetWindowText(hwndDlg, szTitle, titleLength);
- TCHAR *szSubTitle = _tcschr(szTitle, _T('\n'));
+ wchar_t *szSubTitle = wcschr(szTitle, '\n');
if (szSubTitle)
*szSubTitle++ = 0;
diff --git a/src/mir_app/src/hotkey_opts.cpp b/src/mir_app/src/hotkey_opts.cpp
index cec2a06d5f..22e7443376 100644
--- a/src/mir_app/src/hotkey_opts.cpp
+++ b/src/mir_app/src/hotkey_opts.cpp
@@ -26,9 +26,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_hotkeys.h>
#include "skin.h"
-static TCHAR* sttHokeyVkToName(WORD vkKey)
+static wchar_t* sttHokeyVkToName(WORD vkKey)
{
- static TCHAR buf[256] = { 0 };
+ static wchar_t buf[256] = { 0 };
DWORD code = MapVirtualKey(vkKey, 0) << 16;
switch (vkKey) {
@@ -99,7 +99,7 @@ static TCHAR* sttHokeyVkToName(WORD vkKey)
return buf;
}
-void HotkeyToName(TCHAR *buf, int size, BYTE shift, BYTE key)
+void HotkeyToName(wchar_t *buf, int size, BYTE shift, BYTE key)
{
mir_sntprintf(buf, size, L"%s%s%s%s%s",
(shift & HOTKEYF_CONTROL) ? TranslateT("Ctrl + ") : L"",
@@ -124,7 +124,7 @@ static LRESULT CALLBACK sttHotkeyEditProc(HWND hwnd, UINT msg, WPARAM wParam, LP
case HKM_SETHOTKEY:
{
- TCHAR buf[256] = { 0 };
+ wchar_t buf[256] = { 0 };
data->key = (BYTE)LOWORD(wParam);
data->shift = (BYTE)HIWORD(wParam);
HotkeyToName(buf, _countof(buf), data->shift, data->key);
@@ -151,11 +151,11 @@ static LRESULT CALLBACK sttHotkeyEditProc(HWND hwnd, UINT msg, WPARAM wParam, LP
case WM_KEYUP:
case WM_SYSKEYUP:
{
- TCHAR buf[256] = { 0 };
+ wchar_t buf[256] = { 0 };
BYTE shift = 0;
BYTE key = wParam;
- TCHAR *name = sttHokeyVkToName(key);
+ wchar_t *name = sttHokeyVkToName(key);
if (!*name || !bKeyDown)
key = 0;
@@ -206,7 +206,7 @@ enum { COL_NAME, COL_TYPE, COL_KEY, COL_RESET, COL_ADDREMOVE };
static void sttOptionsSetupItem(HWND hwndList, int idx, THotkeyItem *item)
{
- TCHAR buf[256];
+ wchar_t buf[256];
LVITEM lvi = { 0 };
lvi.iItem = idx;
@@ -261,7 +261,7 @@ static void sttOptionsDeleteHotkey(HWND hwndList, int idx, THotkeyItem *item)
static int CALLBACK sttOptionsSortList(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
- TCHAR title1[256] = { 0 }, title2[256] = { 0 };
+ wchar_t title1[256] = { 0 }, title2[256] = { 0 };
THotkeyItem *item1 = NULL, *item2 = NULL;
LVITEM lvi = { 0 };
int res;
@@ -447,7 +447,7 @@ static void sttOptionsStartEdit(HWND hwndDlg, HWND hwndHotkey)
}
}
-static void sttOptionsDrawTextChunk(HDC hdc, TCHAR *text, RECT *rc)
+static void sttOptionsDrawTextChunk(HDC hdc, wchar_t *text, RECT *rc)
{
DrawText(hdc, text, -1, rc, DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER | DT_WORD_ELLIPSIS);
@@ -520,7 +520,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
{
/* load group states */
int count = ListView_GetItemCount(hwndHotkey);
- TCHAR buf[128];
+ wchar_t buf[128];
LVITEM lvi = { 0 };
lvi.pszText = buf;
lvi.cchTextMax = _countof(buf);
@@ -891,7 +891,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
else if (!item) {
- TCHAR buf[256];
+ wchar_t buf[256];
LVITEM lvi = { 0 };
lvi.mask = LVIF_TEXT;
lvi.iItem = param->iItem;
@@ -949,7 +949,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
case CDDS_SUBITEM | CDDS_ITEMPREPAINT:
{
THotkeyItem *item;
- TCHAR buf[256];
+ wchar_t buf[256];
LVITEM lvi = { 0 };
lvi.mask = LVIF_TEXT | LVIF_PARAM;
lvi.iItem = param->nmcd.dwItemSpec;
@@ -1008,7 +1008,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
KillTimer(hwndDlg, 1024);
- TCHAR buf[128];
+ wchar_t buf[128];
LVITEM lvi = { 0 };
lvi.pszText = buf;
lvi.cchTextMax = _countof(buf);
diff --git a/src/mir_app/src/hotkeys.cpp b/src/mir_app/src/hotkeys.cpp
index 6d3946840d..9a1a844f89 100644
--- a/src/mir_app/src/hotkeys.cpp
+++ b/src/mir_app/src/hotkeys.cpp
@@ -250,7 +250,7 @@ static INT_PTR svcHotkeyUnregister(WPARAM, LPARAM lParam)
static INT_PTR svcHotkeyCheck(WPARAM wParam, LPARAM lParam)
{
MSG *msg = (MSG *)wParam;
- TCHAR *pszSection = mir_a2t((char *)lParam);
+ wchar_t *pszSection = mir_a2t((char *)lParam);
if ((msg->message == WM_KEYDOWN) || (msg->message == WM_SYSKEYDOWN)) {
int i;
diff --git a/src/mir_app/src/icolib.cpp b/src/mir_app/src/icolib.cpp
index ec21467e84..45c2e33b27 100644
--- a/src/mir_app/src/icolib.cpp
+++ b/src/mir_app/src/icolib.cpp
@@ -74,7 +74,7 @@ void __fastcall SafeDestroyIcon(HICON &hIcon)
// Helper functions to manage Icon resources
-static IconSourceFile* IconSourceFile_Get(const TCHAR *file, bool isPath)
+static IconSourceFile* IconSourceFile_Get(const wchar_t *file, bool isPath)
{
if (!file)
return NULL;
@@ -83,7 +83,7 @@ static IconSourceFile* IconSourceFile_Get(const TCHAR *file, bool isPath)
if (isPath)
PathToAbsoluteT(file, key.file); /// TODO: convert path to long - eliminate duplicate items
else
- _tcsncpy_s(key.file, file, _TRUNCATE);
+ wcsncpy_s(key.file, file, _TRUNCATE);
IconSourceFile *p = iconSourceFileList.find(&key);
if (p != NULL) {
@@ -92,10 +92,10 @@ static IconSourceFile* IconSourceFile_Get(const TCHAR *file, bool isPath)
}
// store only needed number of chars
- size_t cbLen = _tcslen(key.file) + 1;
- p = (IconSourceFile*)mir_alloc(sizeof(int) + sizeof(TCHAR)*cbLen);
+ size_t cbLen = wcslen(key.file) + 1;
+ p = (IconSourceFile*)mir_alloc(sizeof(int) + sizeof(wchar_t)*cbLen);
p->ref_count = 1;
- _tcsncpy_s(p->file, cbLen, key.file, _TRUNCATE);
+ wcsncpy_s(p->file, cbLen, key.file, _TRUNCATE);
iconSourceFileList.insert(p);
return p;
}
@@ -311,7 +311,7 @@ int IconSourceItem::compare(const IconSourceItem *p1, const IconSourceItem *p2)
return (p1->key.file > p2->key.file) ? 1 : -1;
}
-IconSourceItem* GetIconSourceItem(const TCHAR *file, int indx, int cxIcon, int cyIcon)
+IconSourceItem* GetIconSourceItem(const wchar_t *file, int indx, int cxIcon, int cyIcon)
{
if (!file)
return NULL;
@@ -330,20 +330,20 @@ IconSourceItem* GetIconSourceItem(const TCHAR *file, int indx, int cxIcon, int c
return newItem;
}
-IconSourceItem* GetIconSourceItemFromPath(const TCHAR *path, int cxIcon, int cyIcon)
+IconSourceItem* GetIconSourceItemFromPath(const wchar_t *path, int cxIcon, int cyIcon)
{
if (!path)
return NULL;
- TCHAR file[MAX_PATH];
+ wchar_t file[MAX_PATH];
mir_tstrncpy(file, path, _countof(file));
- TCHAR *comma = _tcsrchr(file, ',');
+ wchar_t *comma = wcsrchr(file, ',');
int n;
if (!comma)
n = 0;
else {
- n = _ttoi(comma + 1);
+ n = _wtoi(comma + 1);
*comma = 0;
}
return GetIconSourceItem(file, n, cxIcon, cyIcon);
@@ -351,7 +351,7 @@ IconSourceItem* GetIconSourceItemFromPath(const TCHAR *path, int cxIcon, int cyI
IconSourceItem* CreateStaticIconSourceItem(int cxIcon, int cyIcon)
{
- TCHAR tszName[100];
+ wchar_t tszName[100];
mir_sntprintf(tszName, L"*StaticIcon_%d", iStaticCount++);
IconSourceItemKey key = { IconSourceFile_Get(tszName, false), 0, cxIcon, cyIcon };
@@ -379,7 +379,7 @@ int IconSourceItem::release()
/////////////////////////////////////////////////////////////////////////////////////////
// Service functions
-static SectionItem* IcoLib_AddSection(TCHAR *sectionName, BOOL create_new)
+static SectionItem* IcoLib_AddSection(wchar_t *sectionName, BOOL create_new)
{
if (!sectionName)
return NULL;
@@ -669,7 +669,7 @@ HICON IconItem_GetIcon(HANDLE hIcoLib, bool big)
if (source == NULL) {
ptrT tszCustomPath(db_get_tsa(NULL, "SkinIcons", item->name));
if (tszCustomPath != NULL) {
- TCHAR tszFullPath[MAX_PATH];
+ wchar_t tszFullPath[MAX_PATH];
PathToAbsoluteT(tszCustomPath, tszFullPath);
int cx = item->cx ? item->cx : (big ? g_iIconX : g_iIconSX);
int cy = item->cy ? item->cy : (big ? g_iIconY : g_iIconSY);
diff --git a/src/mir_app/src/keyboard.cpp b/src/mir_app/src/keyboard.cpp
index 576e239747..e71b72c9c9 100644
--- a/src/mir_app/src/keyboard.cpp
+++ b/src/mir_app/src/keyboard.cpp
@@ -54,35 +54,35 @@ int InitClistHotKeys(void)
HOTKEYDESC shk = { sizeof(shk) };
shk.dwFlags = HKD_TCHAR;
- shk.ptszDescription = LPGENT("Show/Hide contact list");
+ shk.ptszDescription = LPGENW("Show/Hide contact list");
shk.pszName = "ShowHide";
shk.ptszSection = L"Main";
shk.pszService = "CLIST/HK/SHOWHIDE";
shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'A');
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENT("Read message");
+ shk.ptszDescription = LPGENW("Read message");
shk.pszName = "ReadMessage";
shk.ptszSection = L"Main";
shk.pszService = "CLIST/HK/Read";
shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'I');
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENT("Open Options page");
+ shk.ptszDescription = LPGENW("Open Options page");
shk.pszName = "ShowOptions";
shk.ptszSection = L"Main";
shk.pszService = "CLIST/HK/Opts";
shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'O') | HKF_MIRANDA_LOCAL;
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENT("Open logging options");
+ shk.ptszDescription = LPGENW("Open logging options");
shk.pszName = "ShowLogOptions";
shk.ptszSection = L"Main";
shk.pszService = "Netlib/Log/Win";
shk.DefHotKey = 0;
Hotkey_Register(&shk);
- shk.ptszDescription = LPGENT("Open 'Find user' dialog");
+ shk.ptszDescription = LPGENW("Open 'Find user' dialog");
shk.pszName = "FindUsers";
shk.ptszSection = L"Main";
shk.pszService = "FindAdd/FindAddCommand";
diff --git a/src/mir_app/src/langpack.cpp b/src/mir_app/src/langpack.cpp
index c418707a34..020bc0e46f 100644
--- a/src/mir_app/src/langpack.cpp
+++ b/src/mir_app/src/langpack.cpp
@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
#include "langpack.h"
-MIR_CORE_DLL(int) LoadLangPackDescr(const TCHAR *szLangPack, LANGPACK_INFO *lpInfo);
+MIR_CORE_DLL(int) LoadLangPackDescr(const wchar_t *szLangPack, LANGPACK_INFO *lpInfo);
BOOL EnumLangpacks(ENUM_PACKS_CALLBACK callback, WPARAM wParam, LPARAM lParam)
{
@@ -36,7 +36,7 @@ BOOL EnumLangpacks(ENUM_PACKS_CALLBACK callback, WPARAM wParam, LPARAM lParam)
/* language folder */
ptrT langpack(db_get_tsa(NULL, "Langpack", "Current"));
- TCHAR tszFullPath[MAX_PATH];
+ wchar_t tszFullPath[MAX_PATH];
PathToAbsoluteT(L"\\Languages\\langpack_*.txt", tszFullPath);
BOOL fPackFound = FALSE;
diff --git a/src/mir_app/src/langpack.h b/src/mir_app/src/langpack.h
index 1d9c226ce5..ddc1cb904d 100644
--- a/src/mir_app/src/langpack.h
+++ b/src/mir_app/src/langpack.h
@@ -42,13 +42,13 @@ static INT_PTR srvGetPluginLangpack(WPARAM wParam, LPARAM lParam);
/* Langpack Info */
struct LANGPACK_INFO
{
- TCHAR tszLanguage[64];
+ wchar_t tszLanguage[64];
LCID Locale;
WORD codepage;
CMStringA szAuthors, szAuthorEmail, szLastModifiedUsing;
FILETIME ftFileDate;
- TCHAR tszFileName[MAX_PATH]; /* just the file name itself */
- TCHAR tszFullPath[MAX_PATH]; /* full path to the langpack */
+ wchar_t tszFileName[MAX_PATH]; /* just the file name itself */
+ wchar_t tszFullPath[MAX_PATH]; /* full path to the langpack */
BYTE flags; /* see LPIF_* flags */
};
diff --git a/src/mir_app/src/lpopts.cpp b/src/mir_app/src/lpopts.cpp
index d34dc23152..6166ec692a 100644
--- a/src/mir_app/src/lpopts.cpp
+++ b/src/mir_app/src/lpopts.cpp
@@ -34,18 +34,18 @@ static void DisplayPackInfo(HWND hwndDlg, const LANGPACK_INFO *pack)
{
/* locale string */
if (!(pack->flags & LPF_NOLOCALE)) {
- TCHAR szLocaleName[256], szLanguageName[128], szContryName[128];
+ wchar_t szLocaleName[256], szLanguageName[128], szContryName[128];
if (!GetLocaleInfo(pack->Locale, WINVER >= _WIN32_WINNT_WIN7 ? LOCALE_SENGLISHLANGUAGENAME : LOCALE_SENGLANGUAGE, szLanguageName, _countof(szLanguageName)))
- szLanguageName[0] = _T('\0');
+ szLanguageName[0] = '\0';
if (!GetLocaleInfo(pack->Locale, WINVER >= _WIN32_WINNT_WIN7 ? LOCALE_SENGLISHCOUNTRYNAME : LOCALE_SENGCOUNTRY, szContryName, _countof(szContryName)))
- szContryName[0] = _T('\0');
+ szContryName[0] = '\0';
/* add some note if its incompatible */
if (szLanguageName[0] && szContryName[0]) {
mir_sntprintf(szLocaleName, L"%s (%s)", TranslateTS(szLanguageName), TranslateTS(szContryName));
if (!IsValidLocale(pack->Locale, LCID_INSTALLED)) {
- TCHAR *pszIncompat;
+ wchar_t *pszIncompat;
pszIncompat = TranslateT("(incompatible)");
szLocaleName[_countof(szLocaleName) - mir_tstrlen(pszIncompat) - 1] = 0;
mir_tstrcat(mir_tstrcat(szLocaleName, L" "), pszIncompat);
@@ -58,7 +58,7 @@ static void DisplayPackInfo(HWND hwndDlg, const LANGPACK_INFO *pack)
/* file date */
SYSTEMTIME stFileDate;
- TCHAR szDate[128]; szDate[0] = 0;
+ wchar_t szDate[128]; szDate[0] = 0;
if (FileTimeToSystemTime(&pack->ftFileDate, &stFileDate))
GetDateFormat(Langpack_GetDefaultLocale(), DATE_SHORTDATE, &stFileDate, NULL, szDate, _countof(szDate));
SetDlgItemText(hwndDlg, IDC_LANGDATE, szDate);
@@ -76,7 +76,7 @@ static BOOL InsertPackItemEnumProc(LANGPACK_INFO *pack, WPARAM wParam, LPARAM)
*pack2 = *pack;
/* insert */
- TCHAR tszName[512];
+ wchar_t tszName[512];
mir_sntprintf(tszName, L"%s [%s]",
TranslateTS(pack->tszLanguage),
pack->flags & LPF_DEFAULT ? TranslateT("built-in") : pack->tszFileName);
@@ -160,7 +160,7 @@ INT_PTR CALLBACK DlgLangpackOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
case WM_NOTIFY:
if (LPNMHDR(lParam)->code == PSN_APPLY) {
- TCHAR tszPath[MAX_PATH]; tszPath[0] = 0;
+ wchar_t tszPath[MAX_PATH]; tszPath[0] = 0;
int idx = ComboBox_GetCurSel(hwndList);
int count = ComboBox_GetCount(hwndList);
for (int i = 0; i < count; i++) {
diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp
index cfd1447b66..9d2109c4d3 100644
--- a/src/mir_app/src/menu_clist.cpp
+++ b/src/mir_app/src/menu_clist.cpp
@@ -153,7 +153,7 @@ static int RecursiveDeleteMenu(HMENU hMenu)
struct MainMenuExecParam
{
char *szServiceName;
- TCHAR *szMenuName;
+ wchar_t *szMenuName;
TMO_IntMenuItem *pimi;
};
@@ -176,7 +176,7 @@ MIR_APP_DLL(HGENMENU) Menu_AddMainMenuItem(TMO_MenuItem *pmi)
//we need just one parametr.
mmep->szServiceName = mir_strdup(pmi->pszService);
- mmep->szMenuName = pmi->name.t;
+ mmep->szMenuName = pmi->name.w;
TMO_IntMenuItem *pimi = Menu_AddItem(hMainMenuObject, pmi, mmep);
if (pimi == NULL)
@@ -190,7 +190,7 @@ MIR_APP_DLL(HGENMENU) Menu_AddMainMenuItem(TMO_MenuItem *pmi)
if (pmi->pszService)
name = pmi->pszService;
else if (pmi->flags & CMIF_UNICODE) {
- name = mir_t2a(pmi->name.t);
+ name = mir_t2a(pmi->name.w);
needFree = true;
}
else name = pmi->name.a;
@@ -259,9 +259,9 @@ MIR_APP_DLL(HGENMENU) Menu_AddContactMenuItem(TMO_MenuItem *pmi, const char *psz
mir_snprintf(buf, "%s/%s", pszProto, (pmi->pszService) ? pmi->pszService : "");
Menu_ConfigureItem(pimi, MCI_OPT_UNIQUENAME, buf);
}
- else if (pmi->name.t) {
+ else if (pmi->name.w) {
if (pmi->flags & CMIF_UNICODE)
- mir_snprintf(buf, "%s/NoService/%S", pszProto, pmi->name.t);
+ mir_snprintf(buf, "%s/NoService/%S", pszProto, pmi->name.w);
else
mir_snprintf(buf, "%s/NoService/%s", pszProto, pmi->name.a);
Menu_ConfigureItem(pimi, MCI_OPT_UNIQUENAME, buf);
@@ -381,7 +381,7 @@ MIR_APP_DLL(HGENMENU) Menu_AddStatusMenuItem(TMO_MenuItem *pmi, const char *pszP
smep->hMenuItem = pimi;
char buf[MAX_PATH + 64];
- char *p = (pRoot) ? mir_t2a(pRoot->mi.name.t) : NULL;
+ char *p = (pRoot) ? mir_t2a(pRoot->mi.name.w) : NULL;
mir_snprintf(buf, "%s/%s", (p) ? p : "", pmi->pszService ? pmi->pszService : "");
mir_free(p);
@@ -467,13 +467,13 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM)
if (reset || check) {
TMO_IntMenuItem *timiParent = MO_GetIntMenuItem(pimi->mi.root);
if (timiParent) {
- LPTSTR ptszName = TranslateTH(pimi->mi.hLangpack, pimi->mi.hIcolibItem ? pimi->mi.name.t : LPGENT("Custom status"));
+ LPTSTR ptszName = TranslateTH(pimi->mi.hLangpack, pimi->mi.hIcolibItem ? pimi->mi.name.w : LPGENW("Custom status"));
timiParent = MO_GetIntMenuItem(pimi->mi.root);
MenuItemData it = {};
if (FindMenuHandleByGlobalID(hStatusMenu, timiParent, &it)) {
- TCHAR d[100];
+ wchar_t d[100];
GetMenuString(it.OwnerMenu, it.position, d, _countof(d), MF_BYPOSITION);
MENUITEMINFO mii = {};
@@ -517,7 +517,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM)
if (smep)
prot = smep->szProto;
else {
- char *prn = mir_u2a(pimi->mi.name.t);
+ char *prn = mir_u2a(pimi->mi.name.w);
prot = NEWSTR_ALLOCA(prn);
if (prn) mir_free(prn);
}
@@ -580,7 +580,7 @@ INT_PTR StatusMenuExecService(WPARAM wParam, LPARAM)
return 0;
TMO_IntMenuItem *root = (TMO_IntMenuItem*)pimi->mi.root;
- TCHAR buf[256], *ptszName;
+ wchar_t buf[256], *ptszName;
if (bIsLocked) {
pimi->mi.flags |= CMIF_CHECKED;
if (cli.bDisplayLocked) {
@@ -593,8 +593,8 @@ INT_PTR StatusMenuExecService(WPARAM wParam, LPARAM)
ptszName = acc->tszAccountName;
pimi->mi.flags &= ~CMIF_CHECKED;
}
- replaceStrT(pimi->mi.name.t, ptszName);
- replaceStrT(root->mi.name.t, ptszName);
+ replaceStrT(pimi->mi.name.w, ptszName);
+ replaceStrT(root->mi.name.w, ptszName);
if (cli.hwndStatus)
InvalidateRect(cli.hwndStatus, NULL, TRUE);
@@ -812,7 +812,7 @@ void RebuildMenuOrder(void)
DWORD flags = pa->ppro->GetCaps(PFLAGNUM_2, 0) & ~pa->ppro->GetCaps(PFLAGNUM_5, 0);
HICON ic;
- TCHAR tbuf[256];
+ wchar_t tbuf[256];
// adding root
CMenuItem mi;
@@ -822,9 +822,9 @@ void RebuildMenuOrder(void)
if (Proto_IsAccountLocked(pa) && cli.bDisplayLocked) {
mir_sntprintf(tbuf, TranslateT("%s (locked)"), pa->tszAccountName);
- mi.name.t = tbuf;
+ mi.name.w = tbuf;
}
- else mi.name.t = pa->tszAccountName;
+ else mi.name.w = pa->tszAccountName;
// owner data
StatusMenuExecParam *smep = (StatusMenuExecParam*)mir_calloc(sizeof(StatusMenuExecParam));
@@ -846,13 +846,13 @@ void RebuildMenuOrder(void)
if ((mi.flags & CMIF_CHECKED) && cli.bDisplayLocked) {
mir_sntprintf(tbuf, TranslateT("%s (locked)"), pa->tszAccountName);
- mi.name.t = tbuf;
+ mi.name.w = tbuf;
}
- else mi.name.t = pa->tszAccountName;
+ else mi.name.w = pa->tszAccountName;
TMO_IntMenuItem *pimi = Menu_AddItem(hStatusMenuObject, &mi, smep);
smep->pimi = pimi;
- Menu_ModifyItem(pimi, mi.name.t, mi.hIcon, mi.flags);
+ Menu_ModifyItem(pimi, mi.name.w, mi.hIcon, mi.flags);
cli.menuProtos = (MenuProto*)mir_realloc(cli.menuProtos, sizeof(MenuProto)*(cli.menuProtoCount + 1));
memset(&(cli.menuProtos[cli.menuProtoCount]), 0, sizeof(MenuProto));
@@ -878,7 +878,7 @@ void RebuildMenuOrder(void)
mi.flags |= CMIF_CHECKED;
mi.root = rootmenu;
mi.position = pos++;
- mi.name.t = cli.pfnGetStatusModeDescription(statusModeList[j], GSMDF_UNTRANSLATED);
+ mi.name.w = cli.pfnGetStatusModeDescription(statusModeList[j], GSMDF_UNTRANSLATED);
mi.hIcon = Skin_LoadProtoIcon(pa->szModuleName, statusModeList[j]);
// owner data
@@ -925,11 +925,11 @@ void RebuildMenuOrder(void)
StatusMenuExecParam *smep = (StatusMenuExecParam*)mir_calloc(sizeof(StatusMenuExecParam));
smep->status = statusModeList[j];
{
- TCHAR buf[256], hotkeyName[100];
+ wchar_t buf[256], hotkeyName[100];
WORD hotKey = GetHotkeyValue(statusHotkeys[j]);
HotkeyToName(hotkeyName, _countof(hotkeyName), HIBYTE(hotKey), LOBYTE(hotKey));
mir_sntprintf(buf, L"%s\t%s", cli.pfnGetStatusModeDescription(statusModeList[j], 0), hotkeyName);
- mi.name.t = buf;
+ mi.name.w = buf;
hStatusMainMenuHandles[j] = Menu_AddItem(hStatusMenuObject, &mi, smep);
hStatusMainMenuHandles[j]->hotKey = hotKey;
@@ -955,7 +955,7 @@ static int sttRebuildHotkeys(WPARAM, LPARAM)
if (hStatusMainMenuHandles[j] == NULL)
continue;
- TCHAR buf[256], hotkeyName[100];
+ wchar_t buf[256], hotkeyName[100];
WORD hotKey = GetHotkeyValue(statusHotkeys[j]);
HotkeyToName(hotkeyName, _countof(hotkeyName), HIBYTE(hotKey), LOBYTE(hotKey));
mir_sntprintf(buf, L"%s\t%s", cli.pfnGetStatusModeDescription(statusModeList[j], 0), hotkeyName);
diff --git a/src/mir_app/src/menu_options.cpp b/src/mir_app/src/menu_options.cpp
index 6245ae2a13..6d7ba2bc0f 100644
--- a/src/mir_app/src/menu_options.cpp
+++ b/src/mir_app/src/menu_options.cpp
@@ -62,7 +62,7 @@ class CGenMenuOptionsPage : public CDlgBase
{
int iInitMenuValue;
- TCHAR idstr[100];
+ wchar_t idstr[100];
void SaveTreeInternal(MenuItemOptData *pParent, HTREEITEM hRootItem, const char *szModule)
{
@@ -90,7 +90,7 @@ class CGenMenuOptionsPage : public CDlgBase
bin2hex(&pimi->mi.uid, sizeof(pimi->mi.uid), menuItemName);
int visible = tvi.iImage != 0;
- TCHAR *ptszCustomName;
+ wchar_t *ptszCustomName;
if (iod->name != NULL && iod->defname != NULL && mir_tstrcmp(iod->name, iod->defname) != 0)
ptszCustomName = iod->name;
else
@@ -401,7 +401,7 @@ public:
MenuItemOptData *PD = new MenuItemOptData();
PD->id = -1;
- PD->name = mir_tstrdup(pimi->mi.name.t);
+ PD->name = mir_tstrdup(pimi->mi.name.w);
PD->pos = pimi->mi.position;
PD->pimi = pimi;
@@ -437,7 +437,7 @@ public:
m_menuItems.GetItem(&tvi);
MenuItemOptData *iod = (MenuItemOptData *)tvi.lParam;
- if (iod->name && _tcsstr(iod->name, STR_SEPARATOR))
+ if (iod->name && wcsstr(iod->name, STR_SEPARATOR))
return;
iod->name = mir_tstrdup(iod->defname);
@@ -461,7 +461,7 @@ public:
m_menuItems.GetItem(&tvi);
MenuItemOptData *iod = (MenuItemOptData *)tvi.lParam;
- if (iod->name && _tcsstr(iod->name, STR_SEPARATOR))
+ if (iod->name && wcsstr(iod->name, STR_SEPARATOR))
return;
iod->name = m_customName.GetText();
@@ -501,7 +501,7 @@ public:
return;
MenuItemOptData *iod = (MenuItemOptData *)tvi.lParam;
- if (iod->name && _tcsstr(iod->name, STR_SEPARATOR))
+ if (iod->name && wcsstr(iod->name, STR_SEPARATOR))
return;
m_customName.SetText(iod->name);
diff --git a/src/mir_app/src/menu_utils.cpp b/src/mir_app/src/menu_utils.cpp
index b03cec352a..91cb530e13 100644
--- a/src/mir_app/src/menu_utils.cpp
+++ b/src/mir_app/src/menu_utils.cpp
@@ -40,7 +40,7 @@ static void DumpMenuItem(TMO_IntMenuItem* pParent, int level = 0)
temp[level] = 0;
for (TMO_IntMenuItem *pimi = pParent; pimi != NULL; pimi = pimi->next) {
- Netlib_Logf(NULL, "%sMenu item %08p [%08p]: %S", temp, pimi, pimi->mi.root, pimi->mi.name.t);
+ Netlib_Logf(NULL, "%sMenu item %08p [%08p]: %S", temp, pimi, pimi->mi.root, pimi->mi.name.w);
TMO_IntMenuItem *submenu = pimi->submenu.first;
if (submenu)
@@ -76,9 +76,9 @@ TIntMenuObject* GetMenuObjbyId(int id)
LPTSTR GetMenuItemText(TMO_IntMenuItem *pimi)
{
if (pimi->mi.flags & CMIF_KEEPUNTRANSLATED)
- return pimi->mi.name.t;
+ return pimi->mi.name.w;
- return TranslateTH(pimi->mi.hLangpack, pimi->mi.name.t);
+ return TranslateTH(pimi->mi.hLangpack, pimi->mi.name.w);
}
///////////////////////////////////////////////////////////////////////////////
@@ -239,7 +239,7 @@ MIR_APP_DLL(HGENMENU) Menu_GetProtocolRoot(PROTO_INTERFACE *pThis)
// create protocol root in the main menu
CMenuItem mi;
- mi.name.t = pThis->m_tszUserName;
+ mi.name.w = pThis->m_tszUserName;
mi.position = 500090000;
mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.hIcolibItem = pThis->m_hProtoIcon;
@@ -331,7 +331,7 @@ MIR_APP_DLL(void) Menu_SetChecked(HGENMENU hMenuItem, bool bSet)
/////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(int) Menu_ModifyItem(HGENMENU hMenuItem, const TCHAR *ptszName, HANDLE hIcolib, int iFlags)
+MIR_APP_DLL(int) Menu_ModifyItem(HGENMENU hMenuItem, const wchar_t *ptszName, HANDLE hIcolib, int iFlags)
{
if (!bIsGenMenuInited)
return -1;
@@ -343,7 +343,7 @@ MIR_APP_DLL(int) Menu_ModifyItem(HGENMENU hMenuItem, const TCHAR *ptszName, HAND
return -1;
if (ptszName != NULL)
- replaceStrT(pimi->mi.name.t, ptszName);
+ replaceStrT(pimi->mi.name.w, ptszName);
if (iFlags != -1) {
Menu_SetItemFlags(hMenuItem, true, iFlags);
@@ -666,8 +666,8 @@ static int GetNextObjectMenuItemId()
static int FindRoot(TMO_IntMenuItem *pimi, void *param)
{
- if (pimi->mi.name.t != NULL)
- if (pimi->submenu.first && !mir_tstrcmp(pimi->mi.name.t, (TCHAR*)param))
+ if (pimi->mi.name.w != NULL)
+ if (pimi->submenu.first && !mir_tstrcmp(pimi->mi.name.w, (wchar_t*)param))
return TRUE;
return FALSE;
@@ -688,7 +688,7 @@ MIR_APP_DLL(HGENMENU) Menu_CreateRoot(int hMenuObject, LPCTSTR ptszName, int pos
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = hIcoLib;
mi.hLangpack = _hLang;
- mi.name.t = (TCHAR*)ptszName;
+ mi.name.w = (wchar_t*)ptszName;
mi.position = position;
return Menu_AddItem(hMenuObject, &mi, NULL);
}
@@ -718,9 +718,9 @@ MIR_APP_DLL(HGENMENU) Menu_AddItem(int hMenuObject, TMO_MenuItem *pmi, void *pUs
p->pUserData = pUserData;
if (pmi->flags & CMIF_UNICODE)
- p->mi.name.t = mir_tstrdup(pmi->name.t);
+ p->mi.name.w = mir_tstrdup(pmi->name.w);
else
- p->mi.name.t = mir_a2u(pmi->name.a);
+ p->mi.name.w = mir_a2u(pmi->name.a);
if (pmi->hIcon != NULL && !bIconsDisabled) {
HANDLE hIcolibItem = IcoLib_IsManaged(pmi->hIcon);
@@ -861,9 +861,9 @@ static int sttReadOldItem(TMO_IntMenuItem *pmi, void *szModule)
if (pmi->pszUniqName)
mir_snprintf(menuItemName, "{%s}", pmi->pszUniqName);
else if (pmi->mi.flags & CMIF_UNICODE)
- mir_snprintf(menuItemName, "{%s}", (char*)_T2A(pmi->mi.name.t));
+ mir_snprintf(menuItemName, "{%s}", (char*)_T2A(pmi->mi.name.w));
else
- mir_snprintf(menuItemName, "{%s}", pmi->mi.name.t);
+ mir_snprintf(menuItemName, "{%s}", pmi->mi.name.w);
// check if it visible
mir_snprintf(szSetting, "%s_visible", menuItemName);
@@ -873,9 +873,9 @@ static int sttReadOldItem(TMO_IntMenuItem *pmi, void *szModule)
else
pmi->mi.flags |= CMIF_HIDDEN;
- // mi.name.t
+ // mi.name.w
mir_snprintf(szSetting, "%s_name", menuItemName);
- TCHAR *tszCustomName = db_get_tsa(NULL, (char*)szModule, szSetting);
+ wchar_t *tszCustomName = db_get_tsa(NULL, (char*)szModule, szSetting);
if (tszCustomName != NULL) {
mir_free(pmi->ptszCustomName);
pmi->ptszCustomName = tszCustomName;
@@ -898,7 +898,7 @@ static int sttDumpItem(TMO_IntMenuItem *pmi, void *szModule)
bin2hex(&pmi->mi.uid, sizeof(pmi->mi.uid), menuItemName);
int bVisible = (pmi->mi.flags & CMIF_HIDDEN) == 0;
- const TCHAR *ptszName = (pmi->ptszCustomName != NULL) ? pmi->ptszCustomName : L"";
+ const wchar_t *ptszName = (pmi->ptszCustomName != NULL) ? pmi->ptszCustomName : L"";
char szRootUid[33];
if (pmi->mi.root == NULL)
@@ -993,17 +993,17 @@ int Menu_LoadFromDatabase(TMO_IntMenuItem *pimi, void *szModule)
if (szValue == NULL)
return 0;
- TCHAR *ptszToken = szValue, *pDelim = _tcschr(szValue, ';');
+ wchar_t *ptszToken = szValue, *pDelim = wcschr(szValue, ';');
int bVisible = true, pos = 0;
- TCHAR tszCustomName[201]; tszCustomName[0] = 0;
+ wchar_t tszCustomName[201]; tszCustomName[0] = 0;
MUUID customRoot = {};
for (int i = 0; i < 4; i++) {
if (pDelim)
*pDelim = 0;
switch (i) {
- case 0: bVisible = _ttoi(ptszToken); break;
- case 1: pos = _ttoi(ptszToken); break;
+ case 0: bVisible = _wtoi(ptszToken); break;
+ case 1: pos = _wtoi(ptszToken); break;
case 2:
hex2binT(ptszToken, &customRoot, sizeof(customRoot));
if (customRoot == pimi->mi.uid) // prevent a loop
@@ -1012,9 +1012,9 @@ int Menu_LoadFromDatabase(TMO_IntMenuItem *pimi, void *szModule)
}
ptszToken = pDelim + 1;
- if ((pDelim = _tcschr(ptszToken, ';')) == NULL) {
+ if ((pDelim = wcschr(ptszToken, ';')) == NULL) {
if (i == 2 && *ptszToken != 0)
- _tcsncpy_s(tszCustomName, ptszToken, _TRUNCATE);
+ wcsncpy_s(tszCustomName, ptszToken, _TRUNCATE);
break;
}
}
@@ -1118,7 +1118,7 @@ static HMENU BuildRecursiveMenu(HMENU hMenu, TMO_IntMenuItem *pRootMenu, WPARAM
if (pmi->mi.flags & CMIF_DEFAULT)
mii.fState |= MFS_DEFAULT;
- mii.dwTypeData = (pmi->ptszCustomName) ? pmi->ptszCustomName : mi->name.t;
+ mii.dwTypeData = (pmi->ptszCustomName) ? pmi->ptszCustomName : mi->name.w;
// it's a submenu
if (pmi->submenu.first) {
@@ -1127,7 +1127,7 @@ static HMENU BuildRecursiveMenu(HMENU hMenu, TMO_IntMenuItem *pRootMenu, WPARAM
#ifdef PUTPOSITIONSONMENU
if (GetKeyState(VK_CONTROL) & 0x8000) {
- TCHAR str[256];
+ wchar_t str[256];
mir_sntprintf(str, L"%s (%d, id %x)", mi->name.a, mi->position, mii.dwItemData);
mii.dwTypeData = str;
}
@@ -1141,7 +1141,7 @@ static HMENU BuildRecursiveMenu(HMENU hMenu, TMO_IntMenuItem *pRootMenu, WPARAM
#ifdef PUTPOSITIONSONMENU
if (GetKeyState(VK_CONTROL) & 0x8000) {
- TCHAR str[256];
+ wchar_t str[256];
mir_sntprintf(str, L"%s (%d, id %x)", mi->name.a, mi->position, mii.dwItemData);
mii.dwTypeData = str;
}
@@ -1214,14 +1214,14 @@ int OnIconLibChanges(WPARAM, LPARAM)
static int MO_RegisterIcon(TMO_IntMenuItem *pmi, void*)
{
- TCHAR *descr = GetMenuItemText(pmi);
+ wchar_t *descr = GetMenuItemText(pmi);
if (!descr || pmi->hIcolibItem != NULL || pmi->mi.uid == miid_last)
return FALSE;
HICON hIcon = ImageList_GetIcon(pmi->parent->m_hMenuIcons, pmi->iconId, 0);
- TCHAR sectionName[256];
- mir_sntprintf(sectionName, LPGENT("Menu icons") L"/%s", TranslateTS(pmi->parent->ptszDisplayName));
+ wchar_t sectionName[256];
+ mir_sntprintf(sectionName, LPGENW("Menu icons") L"/%s", TranslateTS(pmi->parent->ptszDisplayName));
char iconame[256], uname[100];
bin2hex(&pmi->mi.uid, sizeof(pmi->mi.uid), uname);
@@ -1229,13 +1229,13 @@ static int MO_RegisterIcon(TMO_IntMenuItem *pmi, void*)
// remove '&'
if (descr) {
- descr = NEWTSTR_ALLOCA(descr);
+ descr = NEWWSTR_ALLOCA(descr);
- for (TCHAR *p = descr; *p; p++) {
- if ((p = _tcschr(p, '&')) == NULL)
+ for (wchar_t *p = descr; *p; p++) {
+ if ((p = wcschr(p, '&')) == NULL)
break;
- memmove(p, p + 1, sizeof(TCHAR)*(mir_tstrlen(p + 1) + 1));
+ memmove(p, p + 1, sizeof(wchar_t)*(mir_tstrlen(p + 1) + 1));
if (*p == '\0')
p++;
}
@@ -1243,9 +1243,9 @@ static int MO_RegisterIcon(TMO_IntMenuItem *pmi, void*)
SKINICONDESC sid = { 0 };
sid.flags = SIDF_TCHAR;
- sid.section.t = sectionName;
+ sid.section.w = sectionName;
sid.pszName = iconame;
- sid.description.t = descr;
+ sid.description.w = descr;
sid.hDefaultIcon = hIcon;
pmi->hIcolibItem = IcoLib_AddIcon(&sid, 0);
@@ -1351,7 +1351,7 @@ void TIntMenuObject::freeItem(TMO_IntMenuItem *p)
CallService(FreeService, (WPARAM)p, (LPARAM)p->pUserData);
p->signature = 0;
- mir_free(p->mi.name.t);
+ mir_free(p->mi.name.w);
mir_free(p->pszUniqName);
mir_free(p->ptszCustomName);
if (p->hBmp) DeleteObject(p->hBmp);
diff --git a/src/mir_app/src/meta_addto.cpp b/src/mir_app/src/meta_addto.cpp
index e51af79104..19a59644f5 100644
--- a/src/mir_app/src/meta_addto.cpp
+++ b/src/mir_app/src/meta_addto.cpp
@@ -50,7 +50,7 @@ static int FillList(HWND list, BOOL sort)
continue;
// get contact display name from clist
- TCHAR *swzContactDisplayName = cli.pfnGetContactDisplayName(hMetaUser, 0);
+ wchar_t *swzContactDisplayName = cli.pfnGetContactDisplayName(hMetaUser, 0);
// don't insert huge strings that we have to compare with later
if (mir_tstrlen(swzContactDisplayName) > 1023)
swzContactDisplayName[1024] = 0;
@@ -58,7 +58,7 @@ static int FillList(HWND list, BOOL sort)
int pos = -1;
if (sort) {
for (pos = 0; pos < i; pos++) {
- TCHAR buff[1024];
+ wchar_t buff[1024];
SendMessage(list, LB_GETTEXT, pos, (LPARAM)buff);
if (mir_tstrcmp(buff, swzContactDisplayName) > 0)
break;
@@ -100,7 +100,7 @@ static int BuildList(HWND list, BOOL sort)
* @return TRUE if the dialog processed the message, FALSE if it did not.
*/
-#define szConvMsg LPGEN("Either there is no metacontact in the database (in this case you should first convert a contact into one)\n\
+#define szConvMsg LPGENW("Either there is no metacontact in the database (in this case you should first convert a contact into one)\n\
or there is none that can host this contact.\n\
Another solution could be to convert this contact into a new metacontact.\n\nConvert this contact into a new metacontact?")
@@ -141,19 +141,19 @@ static INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wPa
CheckDlgButton(hwndDlg, IDC_ONLYAVAIL, BST_CHECKED); // Initially checked; display all metacontacts is only an option
// Besides, we can check if there is at least one metacontact to add the contact to.
if (BuildList(GetDlgItem(hwndDlg, IDC_METALIST), FALSE) <= 0) {
- if (MessageBox(hwndDlg, TranslateT(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
+ if (MessageBox(hwndDlg, TranslateTS(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
Meta_Convert(lParam, 0);
DestroyWindow(hwndDlg);
return TRUE;
}
else {
// get contact display name from clist
- TCHAR *ptszCDN = cli.pfnGetContactDisplayName(lParam, 0);
+ wchar_t *ptszCDN = cli.pfnGetContactDisplayName(lParam, 0);
if (!ptszCDN)
ptszCDN = TranslateT("a contact");
// ... and set it to the Window title.
- TCHAR buf[256];
+ wchar_t buf[256];
mir_sntprintf(buf, TranslateT("Adding %s..."), ptszCDN);
SetWindowText(hwndDlg, buf);
}
@@ -187,7 +187,7 @@ static INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wPa
case IDC_CHK_SRT:
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_METALIST), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_METALIST), GWL_STYLE) ^ LBS_SORT);
if (BuildList(GetDlgItem(hwndDlg, IDC_METALIST), IsDlgButtonChecked(hwndDlg, IDC_CHK_SRT) ? TRUE : FALSE) <= 0) {
- if (MessageBox(hwndDlg, TranslateT(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
+ if (MessageBox(hwndDlg, TranslateTS(szConvMsg), TranslateT("No suitable metacontact found"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1) == IDYES)
Meta_Convert(lParam, 0);
DestroyWindow(hwndDlg);
return TRUE;
diff --git a/src/mir_app/src/meta_edit.cpp b/src/mir_app/src/meta_edit.cpp
index 376c431a73..ecb690d268 100644
--- a/src/mir_app/src/meta_edit.cpp
+++ b/src/mir_app/src/meta_edit.cpp
@@ -42,7 +42,7 @@ static g_data; // global CHANGES structure
static void FillContactList(HWND hList)
{
- TCHAR buff[256];
+ wchar_t buff[256];
SendMessage(hList, LVM_DELETEALLITEMS, 0, 0);
@@ -52,7 +52,7 @@ static void FillContactList(HWND hList)
for (int i = 0; i < g_data.num_contacts; i++) {
LvItem.iItem = i;
- TCHAR *ptszCDN = cli.pfnGetContactDisplayName(g_data.hContact[i], 0);
+ wchar_t *ptszCDN = cli.pfnGetContactDisplayName(g_data.hContact[i], 0);
if (ptszCDN == NULL)
ptszCDN = TranslateT("(Unknown contact)");
@@ -71,19 +71,19 @@ static void FillContactList(HWND hList)
if (!db_get(g_data.hContact[i], szProto, szField, &dbv)) {
switch (dbv.type) {
case DBVT_ASCIIZ:
- _tcsncpy_s(buff, _A2T(dbv.pszVal), _TRUNCATE);
+ wcsncpy_s(buff, _A2T(dbv.pszVal), _TRUNCATE);
break;
case DBVT_WCHAR:
- _tcsncpy_s(buff, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(buff, dbv.ptszVal, _TRUNCATE);
break;
case DBVT_BYTE:
- _itot(dbv.bVal, buff, 10);
+ _itow(dbv.bVal, buff, 10);
break;
case DBVT_WORD:
- _itot(dbv.wVal, buff, 10);
+ _itow(dbv.wVal, buff, 10);
break;
case DBVT_DWORD:
- _itot(dbv.dVal, buff, 10);
+ _itow(dbv.dVal, buff, 10);
break;
default:
buff[0] = 0;
@@ -96,7 +96,7 @@ static void FillContactList(HWND hList)
SendMessage(hList, LVM_SETITEM, 0, (LPARAM)&LvItem); // Enter text to SubItems
LvItem.iSubItem = 2; // protocol
- _tcsncpy_s(buff, (pa == NULL) ? _A2T(szProto) : pa->tszAccountName, _TRUNCATE);
+ wcsncpy_s(buff, (pa == NULL) ? _A2T(szProto) : pa->tszAccountName, _TRUNCATE);
ListView_SetItem(hList, &LvItem);
}
else {
@@ -167,7 +167,7 @@ static void ApplyChanges()
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = g_data.hMeta;
ai.format = PA_FORMAT_UNKNOWN;
- _tcsncpy_s(ai.filename, L"X", _TRUNCATE);
+ wcsncpy_s(ai.filename, L"X", _TRUNCATE);
if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS)
db_set_ts(g_data.hMeta, "ContactPhoto", "File", ai.filename);
}
@@ -270,7 +270,7 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara
case WMU_SETTITLE:
{
- TCHAR *ptszCDN = cli.pfnGetContactDisplayName(lParam, 0);
+ wchar_t *ptszCDN = cli.pfnGetContactDisplayName(lParam, 0);
if (ptszCDN == NULL)
ptszCDN = TranslateT("(Unknown contact)");
@@ -304,7 +304,7 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara
switch (LOWORD(wParam)) {
case IDC_VALIDATE: // Apply changes, if there is still one contact attached to the metacontact.
if (g_data.num_contacts == 0) { // Otherwise, delete the metacontact.
- if (IDYES == MessageBox(hwndDlg, TranslateT(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) {
+ if (IDYES == MessageBox(hwndDlg, TranslateTS(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) {
Meta_Delete(g_data.hMeta, 0);
DestroyWindow(hwndDlg);
}
@@ -319,7 +319,7 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara
case IDOK:
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_VALIDATE))) { // If there are changes that could be made,
if (g_data.num_contacts == 0) { // do the work that would have be done if the 'Apply' button was clicked.
- if (IDYES == MessageBox(hwndDlg, TranslateT(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) {
+ if (IDYES == MessageBox(hwndDlg, TranslateTS(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1)) {
Meta_Delete(g_data.hMeta, 0);
DestroyWindow(hwndDlg);
}
diff --git a/src/mir_app/src/meta_menu.cpp b/src/mir_app/src/meta_menu.cpp
index 54f41af521..2f7693ae90 100644
--- a/src/mir_app/src/meta_menu.cpp
+++ b/src/mir_app/src/meta_menu.cpp
@@ -164,7 +164,7 @@ void Meta_RemoveContactNumber(DBCachedContact *ccMeta, int number, bool bUpdateI
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = ccMeta->contactID;
ai.format = PA_FORMAT_UNKNOWN;
- _tcsncpy_s(ai.filename, L"X", _TRUNCATE);
+ wcsncpy_s(ai.filename, L"X", _TRUNCATE);
if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS)
db_set_ts(ccMeta->contactID, "ContactPhoto", "File", ai.filename);
@@ -207,7 +207,7 @@ INT_PTR Meta_Delete(WPARAM hContact, LPARAM bSkipQuestion)
return 2;
if (cc->nSubs == 1) {
- if (IDYES == MessageBox(0, TranslateT(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1))
+ if (IDYES == MessageBox(0, TranslateTS(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1))
Meta_Delete(cc->contactID, 1);
return 0;
@@ -263,7 +263,7 @@ int Meta_ModifyMenu(WPARAM hMeta, LPARAM)
Menu_ShowItem(hMenuDefault, false);
Menu_ShowItem(hMenuDelete, false);
- Menu_ModifyItem(hMenuDelete, LPGENT("Remove from metacontact"));
+ Menu_ModifyItem(hMenuDelete, LPGENW("Remove from metacontact"));
// show subcontact menu items
CMString tszNick;
@@ -311,7 +311,7 @@ int Meta_ModifyMenu(WPARAM hMeta, LPARAM)
if (cc->IsSub()) {
Menu_ShowItem(hMenuDefault, true);
- Menu_ModifyItem(hMenuDelete, LPGENT("Remove from metacontact"));
+ Menu_ModifyItem(hMenuDelete, LPGENW("Remove from metacontact"));
Menu_ShowItem(hMenuDelete, true);
Menu_ShowItem(hMenuAdd, false);
@@ -342,9 +342,9 @@ INT_PTR Meta_OnOff(WPARAM, LPARAM)
bool bToggled = !db_mc_isEnabled();
db_set_b(0, META_PROTO, "Enabled", bToggled);
if (bToggled)
- Menu_ModifyItem(hMenuOnOff, LPGENT("Toggle metacontacts off"), Meta_GetIconHandle(I_MENU));
+ Menu_ModifyItem(hMenuOnOff, LPGENW("Toggle metacontacts off"), Meta_GetIconHandle(I_MENU));
else
- Menu_ModifyItem(hMenuOnOff, LPGENT("Toggle metacontacts on"), Meta_GetIconHandle(I_MENUOFF));
+ Menu_ModifyItem(hMenuOnOff, LPGENW("Toggle metacontacts on"), Meta_GetIconHandle(I_MENUOFF));
db_mc_enable(bToggled);
Meta_HideMetaContacts(!bToggled);
@@ -427,7 +427,7 @@ void InitMenus()
if (!db_mc_isEnabled()) {
// modify main menu item
- Menu_ModifyItem(hMenuOnOff, LPGENT("Toggle metacontacts on"), Meta_GetIconHandle(I_MENUOFF));
+ Menu_ModifyItem(hMenuOnOff, LPGENW("Toggle metacontacts on"), Meta_GetIconHandle(I_MENUOFF));
Meta_HideMetaContacts(true);
}
else {
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp
index 4961d73f12..99d31ad899 100644
--- a/src/mir_app/src/meta_services.cpp
+++ b/src/mir_app/src/meta_services.cpp
@@ -446,7 +446,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam)
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = ccMeta->contactID;
ai.format = PA_FORMAT_UNKNOWN;
- _tcsncpy_s(ai.filename, L"X", _TRUNCATE);
+ wcsncpy_s(ai.filename, L"X", _TRUNCATE);
if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS)
db_set_ts(ccMeta->contactID, "ContactPhoto", "File", ai.filename);
}
@@ -654,7 +654,7 @@ int Meta_ModulesLoaded(WPARAM, LPARAM)
StatusIconData sid = { sizeof(sid) };
sid.szModule = META_PROTO;
sid.flags = MBF_TCHAR;
- sid.tszTooltip = LPGENT("Select metacontact");
+ sid.tszTooltip = LPGENW("Select metacontact");
sid.hIcon = Skin_LoadProtoIcon(META_PROTO, ID_STATUS_ONLINE);
Srmm_AddIcon(&sid);
return 0;
@@ -796,7 +796,7 @@ INT_PTR Meta_GetInfo(WPARAM, LPARAM lParam)
PROTO_AVATAR_INFORMATION ai;
ai.hContact = ccs->hContact;
ai.format = PA_FORMAT_UNKNOWN;
- _tcsncpy_s(ai.filename, L"X", _TRUNCATE);
+ wcsncpy_s(ai.filename, L"X", _TRUNCATE);
if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS)
db_set_ts(ccs->hContact, "ContactPhoto", "File", ai.filename);
diff --git a/src/mir_app/src/meta_utils.cpp b/src/mir_app/src/meta_utils.cpp
index 99e307af66..ddf0937972 100644
--- a/src/mir_app/src/meta_utils.cpp
+++ b/src/mir_app/src/meta_utils.cpp
@@ -140,7 +140,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default)
// write status string
mir_snprintf(buffer, "StatusString%d", ccDest->nSubs);
- TCHAR *szStatus = cli.pfnGetStatusModeDescription(status, 0);
+ wchar_t *szStatus = cli.pfnGetStatusModeDescription(status, 0);
db_set_ts(hMeta, META_PROTO, buffer, szStatus);
// Write the link in the contact
@@ -170,7 +170,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default)
PROTO_AVATAR_INFORMATION ai;
ai.hContact = hMeta;
ai.format = PA_FORMAT_UNKNOWN;
- _tcsncpy_s(ai.filename, L"X", _TRUNCATE);
+ wcsncpy_s(ai.filename, L"X", _TRUNCATE);
if (CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&ai) == GAIR_SUCCESS)
db_set_ts(hMeta, "ContactPhoto", "File", ai.filename);
@@ -438,7 +438,7 @@ int Meta_CopyContactNick(DBCachedContact *ccMeta, MCONTACT hContact)
}
}
else if (options.clist_contact_name == CNNT_DISPLAYNAME) {
- TCHAR *name = cli.pfnGetContactDisplayName(hContact, 0);
+ wchar_t *name = cli.pfnGetContactDisplayName(hContact, 0);
if (name && mir_tstrcmp(name, TranslateT("(Unknown contact)")) != 0) {
db_set_ts(ccMeta->contactID, META_PROTO, "Nick", name);
return 0;
diff --git a/src/mir_app/src/metacontacts.h b/src/mir_app/src/metacontacts.h
index e0a3210c2e..c47b419729 100644
--- a/src/mir_app/src/metacontacts.h
+++ b/src/mir_app/src/metacontacts.h
@@ -124,6 +124,6 @@ extern POINT menuMousePoint;
#ifndef MS_CLUI_GETVERSION
#define MS_CLUI_GETVERSION "CLUI/GetVersion"
-#define szDelMsg LPGEN("You are going to remove all the contacts associated with this metacontact.\nThis will delete the metacontact.\n\nProceed anyway?")
+#define szDelMsg LPGENW("You are going to remove all the contacts associated with this metacontact.\nThis will delete the metacontact.\n\nProceed anyway?")
#endif
diff --git a/src/mir_app/src/miranda.cpp b/src/mir_app/src/miranda.cpp
index 12886122d8..f09b54e83c 100644
--- a/src/mir_app/src/miranda.cpp
+++ b/src/mir_app/src/miranda.cpp
@@ -179,7 +179,7 @@ INT_PTR CheckRestart()
{
LPCTSTR tszPID = CmdLine_GetOption(L"restart");
if (tszPID) {
- HANDLE hProcess = OpenProcess(SYNCHRONIZE, FALSE, _ttol(tszPID));
+ HANDLE hProcess = OpenProcess(SYNCHRONIZE, FALSE, _wtol(tszPID));
if (hProcess) {
INT_PTR result = DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_WAITRESTART), NULL, WaitForProcessDlgProc, (LPARAM)hProcess);
CloseHandle(hProcess);
@@ -324,7 +324,7 @@ static INT_PTR OkToExit(WPARAM, LPARAM)
static INT_PTR GetMirandaVersion(WPARAM, LPARAM)
{
- TCHAR filename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
GetModuleFileName(g_hInst, filename, _countof(filename));
DWORD unused, verInfoSize = GetFileVersionInfoSize(filename, &unused);
@@ -343,7 +343,7 @@ static INT_PTR GetMirandaVersion(WPARAM, LPARAM)
static INT_PTR GetMirandaFileVersion(WPARAM, LPARAM lParam)
{
- TCHAR filename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
GetModuleFileName(g_hInst, filename, _countof(filename));
DWORD unused, verInfoSize = GetFileVersionInfoSize(filename, &unused);
@@ -364,7 +364,7 @@ static INT_PTR GetMirandaFileVersion(WPARAM, LPARAM lParam)
static INT_PTR GetMirandaVersionText(WPARAM wParam, LPARAM lParam)
{
- TCHAR filename[MAX_PATH], *productVersion;
+ wchar_t filename[MAX_PATH], *productVersion;
GetModuleFileName(g_hInst, filename, _countof(filename));
DWORD unused, verInfoSize = GetFileVersionInfoSize(filename, &unused);
diff --git a/src/mir_app/src/miranda.h b/src/mir_app/src/miranda.h
index 0a46080262..c83fa8e4bf 100644
--- a/src/mir_app/src/miranda.h
+++ b/src/mir_app/src/miranda.h
@@ -64,7 +64,7 @@ void UninitIni(void);
extern HINSTANCE g_hInst;
extern DWORD hMainThreadId;
extern HANDLE hOkToExitEvent, hModulesLoadedEvent, hevLoadModule, hevUnloadModule;
-extern TCHAR mirandabootini[MAX_PATH];
+extern wchar_t mirandabootini[MAX_PATH];
/**** newplugins.cpp *******************************************************************/
@@ -92,7 +92,7 @@ __forceinline char* Utf8DecodeA(const char* src)
/**** options.cpp **********************************************************************/
-HTREEITEM FindNamedTreeItemAtRoot(HWND hwndTree, const TCHAR* name);
+HTREEITEM FindNamedTreeItemAtRoot(HWND hwndTree, const wchar_t* name);
/**** skinicons.cpp ********************************************************************/
@@ -137,7 +137,7 @@ extern LIST<PROTOCOLDESCRIPTOR> protos;
INT_PTR ProtoCallService(LPCSTR szModule, const char *szService, WPARAM wParam, LPARAM lParam);
-PROTOACCOUNT* Proto_CreateAccount(const char *szModuleName, const char *szBaseProto, const TCHAR *tszAccountName);
+PROTOACCOUNT* Proto_CreateAccount(const char *szModuleName, const char *szBaseProto, const wchar_t *tszAccountName);
PROTOACCOUNT* __fastcall Proto_GetAccount(MCONTACT hContact);
@@ -160,7 +160,7 @@ INT_PTR stubChainRecv(WPARAM, LPARAM);
/**** utils.cpp ************************************************************************/
-void HotkeyToName(TCHAR *buf, int size, BYTE shift, BYTE key);
+void HotkeyToName(wchar_t *buf, int size, BYTE shift, BYTE key);
WORD GetHotkeyValue(INT_PTR idHotkey);
HBITMAP ConvertIconToBitmap(HIMAGELIST hIml, int iconId);
diff --git a/src/mir_app/src/movetogroup.cpp b/src/mir_app/src/movetogroup.cpp
index 59f34959ee..318be7e4d9 100644
--- a/src/mir_app/src/movetogroup.cpp
+++ b/src/mir_app/src/movetogroup.cpp
@@ -31,10 +31,10 @@ static LIST<HANDLE> lphGroupsItems(5);
struct GroupItemSort
{
- TCHAR* name;
+ wchar_t* name;
int position;
- GroupItemSort(TCHAR* pname, int pos)
+ GroupItemSort(wchar_t* pname, int pos)
: name(mir_tstrdup(pname)), position(pos)
{
}
@@ -47,13 +47,13 @@ struct GroupItemSort
}
};
-static TCHAR* PrepareGroupName(TCHAR* str)
+static wchar_t* PrepareGroupName(wchar_t* str)
{
- TCHAR* p = _tcschr(str, '&'), *d;
+ wchar_t* p = wcschr(str, '&'), *d;
if (p == NULL)
return mir_tstrdup(str);
- d = p = (TCHAR*)mir_alloc(sizeof(TCHAR)*(2 * mir_tstrlen(str) + 1));
+ d = p = (wchar_t*)mir_alloc(sizeof(wchar_t)*(2 * mir_tstrlen(str) + 1));
while (*str) {
if (*str == '&')
*d++ = '&';
@@ -64,12 +64,12 @@ static TCHAR* PrepareGroupName(TCHAR* str)
return p;
}
-static void AddGroupItem(HGENMENU hRoot, TCHAR* name, int pos, WPARAM param, bool checked)
+static void AddGroupItem(HGENMENU hRoot, wchar_t* name, int pos, WPARAM param, bool checked)
{
CMenuItem mi;
mi.root = hRoot;
mi.position = pos;
- mi.name.t = PrepareGroupName(name);
+ mi.name.w = PrepareGroupName(name);
mi.flags = CMIF_SYSTEM | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
if (checked)
mi.flags |= CMIF_CHECKED;
@@ -78,7 +78,7 @@ static void AddGroupItem(HGENMENU hRoot, TCHAR* name, int pos, WPARAM param, boo
Menu_ConfigureItem(result, MCI_OPT_EXECPARAM, param);
lphGroupsItems.insert((HANDLE*)result);
- mir_free(mi.name.t);
+ mir_free(mi.name.w);
}
// service
diff --git a/src/mir_app/src/netlib.h b/src/mir_app/src/netlib.h
index f653de6f8f..0332a61a2a 100644
--- a/src/mir_app/src/netlib.h
+++ b/src/mir_app/src/netlib.h
@@ -283,9 +283,9 @@ void NetlibUPnPDestroy(void);
//netlibsecurity.c
void NetlibSecurityInit(void);
void NetlibDestroySecurityProvider(HANDLE hSecurity);
-HANDLE NetlibInitSecurityProvider(const TCHAR* szProvider, const TCHAR* szPrincipal);
+HANDLE NetlibInitSecurityProvider(const wchar_t* szProvider, const wchar_t* szPrincipal);
HANDLE NetlibInitSecurityProvider(const char* szProvider, const char* szPrincipal);
-char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, const TCHAR* login, const TCHAR* psw,
+char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, const wchar_t* login, const wchar_t* psw,
bool http, unsigned& complete);
static __inline INT_PTR NLSend(NetlibConnection *nlc, const char *buf, int len, int flags) {
diff --git a/src/mir_app/src/netliblog.cpp b/src/mir_app/src/netliblog.cpp
index b65e7f1d0a..7afeb86917 100644
--- a/src/mir_app/src/netliblog.cpp
+++ b/src/mir_app/src/netliblog.cpp
@@ -68,7 +68,7 @@ static void InitLog()
if (mir_tstrlen(szBuf)) {
logOptions.tszUserFile = szBuf.get();
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
PathToAbsoluteT(VARST(szBuf), path);
logOptions.tszFile = path;
}
@@ -78,20 +78,20 @@ static void InitLog()
}
if (logOptions.toFile)
- hLogger = mir_createLog("Netlib", LPGENT("Standard Netlib log"), logOptions.tszFile, 0);
+ hLogger = mir_createLog("Netlib", LPGENW("Standard Netlib log"), logOptions.tszFile, 0);
}
-static const TCHAR* szTimeFormats[] =
+static const wchar_t* szTimeFormats[] =
{
- LPGENT("No times"),
- LPGENT("Standard hh:mm:ss times"),
- LPGENT("Times in milliseconds"),
- LPGENT("Times in microseconds")
+ LPGENW("No times"),
+ LPGENW("Standard hh:mm:ss times"),
+ LPGENW("Times in milliseconds"),
+ LPGENW("Times in microseconds")
};
static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
switch (message) {
case WM_INITDIALOG:
@@ -147,7 +147,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
if ((HWND)lParam == GetFocus())
CheckDlgButton(hwndDlg, IDC_TOFILE, BST_CHECKED);
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
GetWindowText((HWND)lParam, path, _countof(path));
PathToAbsoluteT(VARST(path), path);
@@ -159,7 +159,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
case IDC_RUNATSTARTBROWSE:
GetWindowText(GetWindow((HWND)lParam, GW_HWNDPREV), str, _countof(str));
{
- TCHAR filter[200];
+ wchar_t filter[200];
mir_sntprintf(filter, L"%s (*)%c*%c", TranslateT("All files"), 0, 0);
OPENFILENAME ofn = { 0 };
@@ -182,8 +182,8 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
else if (!GetOpenFileName(&ofn))
return 1;
- if (LOWORD(wParam) == IDC_RUNATSTARTBROWSE && _tcschr(str, ' ') != NULL) {
- memmove(str + 1, str, ((_countof(str) - 2) * sizeof(TCHAR)));
+ if (LOWORD(wParam) == IDC_RUNATSTARTBROWSE && wcschr(str, ' ') != NULL) {
+ memmove(str + 1, str, ((_countof(str) - 2) * sizeof(wchar_t)));
str[0] = '"';
mir_tstrcat(str, L"\"");
}
diff --git a/src/mir_app/src/netlibopts.cpp b/src/mir_app/src/netlibopts.cpp
index 1423761260..ffdde641fd 100644
--- a/src/mir_app/src/netlibopts.cpp
+++ b/src/mir_app/src/netlibopts.cpp
@@ -67,7 +67,7 @@ static const UINT specifyPortsControls[] = {
IDC_PORTSRANGE,
IDC_STATIC52};
-static const TCHAR* szProxyTypes[] = {LPGENT("<mixed>"), L"SOCKS4", L"SOCKS5", L"HTTP", L"HTTPS", L"Internet Explorer"};
+static const wchar_t* szProxyTypes[] = {LPGENW("<mixed>"), L"SOCKS4", L"SOCKS5", L"HTTP", L"HTTPS", L"Internet Explorer"};
static const WORD oftenProxyPorts[] = {1080, 1080, 1080, 8080, 8080, 8080};
#define M_REFRESHALL (WM_USER+100)
@@ -338,7 +338,7 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
case M_REFRESHENABLING:
- TCHAR str[80];
+ wchar_t str[80];
{
int selectedProxyType = SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_GETCURSEL, 0, 0), 0);
mir_sntprintf(str, TranslateT("(often %d)"), oftenProxyPorts[selectedProxyType]);
diff --git a/src/mir_app/src/netlibsecurity.cpp b/src/mir_app/src/netlibsecurity.cpp
index 24d095ec00..981a2b4dcd 100644
--- a/src/mir_app/src/netlibsecurity.cpp
+++ b/src/mir_app/src/netlibsecurity.cpp
@@ -35,8 +35,8 @@ struct NtlmHandleType
{
CtxtHandle hClientContext;
CredHandle hClientCredential;
- TCHAR* szProvider;
- TCHAR* szPrincipal;
+ wchar_t* szProvider;
+ wchar_t* szPrincipal;
unsigned cbMaxToken;
bool hasDomain;
};
@@ -73,7 +73,7 @@ static void ReportSecError(SECURITY_STATUS scRet, int line)
NetlibLogf(NULL, "Security error 0x%x on line %u (%s)", scRet, line, szMsgBuf);
}
-HANDLE NetlibInitSecurityProvider(const TCHAR* szProvider, const TCHAR* szPrincipal)
+HANDLE NetlibInitSecurityProvider(const wchar_t* szProvider, const wchar_t* szPrincipal)
{
HANDLE hSecurity = NULL;
@@ -91,7 +91,7 @@ HANDLE NetlibInitSecurityProvider(const TCHAR* szProvider, const TCHAR* szPrinci
PSecPkgInfo ntlmSecurityPackageInfo;
bool isGSSAPI = mir_tstrcmpi(szProvider, L"GSSAPI") == 0;
- const TCHAR *szProviderC = isGSSAPI ? L"Kerberos" : szProvider;
+ const wchar_t *szProviderC = isGSSAPI ? L"Kerberos" : szProvider;
SECURITY_STATUS sc = QuerySecurityPackageInfo((LPTSTR)szProviderC, &ntlmSecurityPackageInfo);
if (sc == SEC_E_OK) {
NtlmHandleType* hNtlm;
@@ -201,7 +201,7 @@ char* CompleteGssapi(HANDLE hSecurity, unsigned char *szChallenge, unsigned chls
return mir_base64_encode(response, ressz);
}
-char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, const TCHAR* login, const TCHAR* psw, bool http, unsigned& complete)
+char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, const wchar_t* login, const wchar_t* psw, bool http, unsigned& complete)
{
if (hSecurity == NULL || ntlmCnt == 0)
return NULL;
@@ -215,7 +215,7 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge,
NtlmHandleType* hNtlm = (NtlmHandleType*)hSecurity;
if (mir_tstrcmpi(hNtlm->szProvider, L"Basic")) {
bool isGSSAPI = mir_tstrcmpi(hNtlm->szProvider, L"GSSAPI") == 0;
- TCHAR *szProvider = isGSSAPI ? (TCHAR*)L"Kerberos" : hNtlm->szProvider;
+ wchar_t *szProvider = isGSSAPI ? (wchar_t*)L"Kerberos" : hNtlm->szProvider;
bool hasChallenge = szChallenge != NULL && szChallenge[0] != '\0';
if (hasChallenge) {
unsigned tokenLen;
@@ -252,9 +252,9 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge,
if (domainLen) {
size_t newLoginLen = mir_tstrlen(login) + domainLen + 1;
- TCHAR *newLogin = (TCHAR*)alloca(newLoginLen * sizeof(TCHAR));
+ wchar_t *newLogin = (wchar_t*)alloca(newLoginLen * sizeof(wchar_t));
- _tcsncpy(newLogin, domainName, domainLen);
+ wcsncpy(newLogin, domainName, domainLen);
newLogin[domainLen] = '\\';
mir_tstrcpy(newLogin + domainLen + 1, login);
@@ -277,8 +277,8 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge,
NetlibLogf(NULL, "Security login requested, user: %S pssw: %s", login, psw ? "(exist)" : "(no psw)");
- const TCHAR* loginName = login;
- const TCHAR* domainName = _tcschr(login, '\\');
+ const wchar_t* loginName = login;
+ const wchar_t* domainName = wcschr(login, '\\');
size_t domainLen = 0;
size_t loginLen = mir_tstrlen(loginName);
if (domainName != NULL) {
@@ -287,7 +287,7 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge,
domainLen = domainName - login;
domainName = login;
}
- else if ((domainName = _tcschr(login, '@')) != NULL) {
+ else if ((domainName = wcschr(login, '@')) != NULL) {
loginName = login;
loginLen = domainName - login;
domainLen = mir_tstrlen(++domainName);
diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp
index 6b187cc73f..1e1bb4c995 100644
--- a/src/mir_app/src/newplugins.cpp
+++ b/src/mir_app/src/newplugins.cpp
@@ -61,7 +61,7 @@ MUUID miid_ssl = MIID_SSL;
static BOOL bModuleInitialized = FALSE;
-TCHAR mirandabootini[MAX_PATH];
+wchar_t mirandabootini[MAX_PATH];
static DWORD mirandaVersion;
static int sttFakeID = -100;
static HANDLE hPluginListHeap = NULL;
@@ -256,7 +256,7 @@ static int checkPI(BASIC_PLUGIN_INFO* bpi, PLUGININFOEX* pi)
return TRUE;
}
-int checkAPI(TCHAR* plugin, BASIC_PLUGIN_INFO* bpi, DWORD dwMirVer, int checkTypeAPI)
+int checkAPI(wchar_t* plugin, BASIC_PLUGIN_INFO* bpi, DWORD dwMirVer, int checkTypeAPI)
{
HINSTANCE h = LoadLibrary(plugin);
if (h == NULL)
@@ -370,9 +370,9 @@ int Plugin_UnloadDyn(pluginEntry *p)
}
// returns true if the given file is <anything>.dll exactly
-static int valid_library_name(TCHAR *name)
+static int valid_library_name(wchar_t *name)
{
- TCHAR *dot = _tcsrchr(name, '.');
+ wchar_t *dot = wcsrchr(name, '.');
if (dot != NULL && mir_tstrcmpi(dot + 1, L"dll") == 0)
if (dot[4] == 0)
return 1;
@@ -383,12 +383,12 @@ static int valid_library_name(TCHAR *name)
void enumPlugins(SCAN_PLUGINS_CALLBACK cb, WPARAM wParam, LPARAM lParam)
{
// get miranda's exe path
- TCHAR exe[MAX_PATH];
+ wchar_t exe[MAX_PATH];
GetModuleFileName(NULL, exe, _countof(exe));
- TCHAR *p = _tcsrchr(exe, '\\'); if (p) *p = 0;
+ wchar_t *p = wcsrchr(exe, '\\'); if (p) *p = 0;
// create the search filter
- TCHAR search[MAX_PATH];
+ wchar_t search[MAX_PATH];
mir_sntprintf(search, L"%s\\Plugins\\*.dll", exe);
// FFFN will return filenames for things like dot dll+ or dot dllx
@@ -404,15 +404,15 @@ void enumPlugins(SCAN_PLUGINS_CALLBACK cb, WPARAM wParam, LPARAM lParam)
FindClose(hFind);
}
-pluginEntry* OpenPlugin(TCHAR *tszFileName, TCHAR *dir, TCHAR *path)
+pluginEntry* OpenPlugin(wchar_t *tszFileName, wchar_t *dir, wchar_t *path)
{
pluginEntry *p = (pluginEntry*)HeapAlloc(hPluginListHeap, HEAP_NO_SERIALIZE | HEAP_ZERO_MEMORY, sizeof(pluginEntry));
- _tcsncpy_s(p->pluginname, tszFileName, _TRUNCATE);
+ wcsncpy_s(p->pluginname, tszFileName, _TRUNCATE);
// add it to the list anyway
pluginList.insert(p);
- TCHAR tszFullPath[MAX_PATH];
+ wchar_t tszFullPath[MAX_PATH];
mir_sntprintf(tszFullPath, L"%s\\%s\\%s", path, dir, tszFileName);
// map dll into the memory and check its exports
@@ -471,17 +471,17 @@ pluginEntry* OpenPlugin(TCHAR *tszFileName, TCHAR *dir, TCHAR *path)
return p;
}
-void SetPluginOnWhiteList(const TCHAR* pluginname, int allow)
+void SetPluginOnWhiteList(const wchar_t* pluginname, int allow)
{
db_set_b(NULL, PLUGINDISABLELIST, _strlwr(_T2A(pluginname)), allow == 0);
}
// returns 1 if the plugin should be enabled within this profile, filename is always lower case
-int isPluginOnWhiteList(const TCHAR* pluginname)
+int isPluginOnWhiteList(const wchar_t* pluginname)
{
int rc = db_get_b(NULL, PLUGINDISABLELIST, _strlwr(_T2A(pluginname)), 0);
if (rc != 0 && askAboutIgnoredPlugins) {
- TCHAR buf[256];
+ wchar_t buf[256];
mir_sntprintf(buf, TranslateT("'%s' is disabled, re-enable?"), pluginname);
if (MessageBox(NULL, buf, TranslateT("Re-enable Miranda plugin?"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
SetPluginOnWhiteList(pluginname, 1);
@@ -494,9 +494,9 @@ int isPluginOnWhiteList(const TCHAR* pluginname)
bool TryLoadPlugin(pluginEntry *p, bool bDynamic)
{
- TCHAR exe[MAX_PATH], tszFullPath[MAX_PATH];
+ wchar_t exe[MAX_PATH], tszFullPath[MAX_PATH];
GetModuleFileName(NULL, exe, _countof(exe));
- TCHAR* slice = _tcsrchr(exe, '\\');
+ wchar_t* slice = wcsrchr(exe, '\\');
if (slice)
*slice = 0;
@@ -557,13 +557,13 @@ bool TryLoadPlugin(pluginEntry *p, bool bDynamic)
/////////////////////////////////////////////////////////////////////////////////////////
// Core plugins support
-static TCHAR tszCoreErr[] = LPGENT("Core plugin '%s' cannot be loaded or missing. Miranda will exit now");
+static wchar_t tszCoreErr[] = LPGENW("Core plugin '%s' cannot be loaded or missing. Miranda will exit now");
bool LoadCorePlugin(MuuidReplacement &mr)
{
- TCHAR exe[MAX_PATH], tszPlugName[MAX_PATH];
+ wchar_t exe[MAX_PATH], tszPlugName[MAX_PATH];
GetModuleFileName(NULL, exe, _countof(exe));
- TCHAR *p = _tcsrchr(exe, '\\'); if (p) *p = 0;
+ wchar_t *p = wcsrchr(exe, '\\'); if (p) *p = 0;
mir_sntprintf(tszPlugName, L"%s.dll", mr.stdplugname);
pluginEntry* pPlug = OpenPlugin(tszPlugName, L"Core", exe);
@@ -594,7 +594,7 @@ LBL_Error:
/////////////////////////////////////////////////////////////////////////////////////////
// Contact list plugins support
-static bool loadClistModule(TCHAR* exe, pluginEntry *p)
+static bool loadClistModule(wchar_t* exe, pluginEntry *p)
{
BASIC_PLUGIN_INFO bpi;
if (checkAPI(exe, &bpi, mirandaVersion, CHECKAPI_CLIST)) {
@@ -614,9 +614,9 @@ static bool loadClistModule(TCHAR* exe, pluginEntry *p)
return false;
}
-static pluginEntry* getCListModule(TCHAR *exe)
+static pluginEntry* getCListModule(wchar_t *exe)
{
- TCHAR tszFullPath[MAX_PATH];
+ wchar_t tszFullPath[MAX_PATH];
for (int i = 0; i < clistPlugins.getCount(); i++) {
pluginEntry *p = clistPlugins[i];
@@ -638,7 +638,7 @@ static pluginEntry* getCListModule(TCHAR *exe)
return NULL;
}
-int UnloadPlugin(TCHAR* buf, int bufLen)
+int UnloadPlugin(wchar_t* buf, int bufLen)
{
for (int i = pluginList.getCount() - 1; i >= 0; i--) {
pluginEntry *p = pluginList[i];
@@ -689,7 +689,7 @@ int LoadDefaultServiceModePlugin()
size_t cbLen = mir_tstrlen(param);
for (int i = 0; i < servicePlugins.getCount(); i++) {
pluginEntry *p = servicePlugins[i];
- if (!_tcsnicmp(p->pluginname, param, cbLen)) {
+ if (!wcsnicmp(p->pluginname, param, cbLen)) {
int res = LaunchServicePlugin(p);
if (res == SERVICE_ONLYDB) // load it later
serviceModePlugin = p;
@@ -772,9 +772,9 @@ void UnloadNewPlugins(void)
int LoadNewPluginsModule(void)
{
// make full path to the plugin
- TCHAR exe[MAX_PATH], fullPath[MAX_PATH];
+ wchar_t exe[MAX_PATH], fullPath[MAX_PATH];
GetModuleFileName(NULL, exe, _countof(exe));
- TCHAR *slice = _tcsrchr(exe, '\\');
+ wchar_t *slice = wcsrchr(exe, '\\');
if (slice)
*slice = 0;
@@ -834,7 +834,7 @@ int LoadNewPluginsModule(void)
// Plugins module initialization
// called before anything real is loaded, incl. database
-static BOOL scanPluginsDir(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM)
+static BOOL scanPluginsDir(WIN32_FIND_DATA *fd, wchar_t *path, WPARAM, LPARAM)
{
pluginEntry *p = OpenPlugin(fd->cFileName, L"Plugins", path);
if (!(p->pclass & PCLASS_FAILED)) {
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp
index 61d1d81b16..f26424a933 100644
--- a/src/mir_app/src/options.cpp
+++ b/src/mir_app/src/options.cpp
@@ -28,8 +28,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define FILTER_TIMEOUT_TIMER 10012
-#define ALL_MODULES_FILTER LPGEN("<all modules>")
-#define CORE_MODULES_FILTER LPGEN("<core modules>")
+#define ALL_MODULES_FILTER LPGENW("<all modules>")
+#define CORE_MODULES_FILTER LPGENW("<core modules>")
int LangpackOptionsInit(WPARAM, LPARAM);
@@ -92,17 +92,17 @@ struct OptionsPageData : public MZeroedObject
hLangpack = src->hLangpack;
if (src->flags & ODPF_UNICODE)
- ptszTitle = mir_tstrdup(src->ptszTitle);
+ ptszTitle = mir_tstrdup(src->pwszTitle);
else
ptszTitle = mir_a2t(src->pszTitle);
if (src->flags & ODPF_UNICODE)
- ptszGroup = mir_tstrdup(src->ptszGroup);
+ ptszGroup = mir_tstrdup(src->pwszGroup);
else
ptszGroup = mir_a2t(src->pszGroup);
if (src->flags & ODPF_UNICODE)
- ptszTab = mir_tstrdup(src->ptszTab);
+ ptszTab = mir_tstrdup(src->pwszTab);
else
ptszTab = mir_a2t(src->pszTab);
}
@@ -115,7 +115,7 @@ struct OptionsPageData : public MZeroedObject
CDlgBase *pDialog;
int hLangpack;
- ptrT ptszTitle, ptszGroup, ptszTab;
+ ptrW ptszTitle, ptszGroup, ptszTab;
HTREEITEM hTreeItem;
int changed;
int height;
@@ -126,7 +126,7 @@ struct OptionsPageData : public MZeroedObject
__forceinline HWND getHwnd() const { return pDialog->GetHwnd(); }
__forceinline HINSTANCE getInst() const { return pDialog->GetInst(); }
- __forceinline TCHAR* getString(TCHAR *ptszStr)
+ __forceinline wchar_t* getString(wchar_t *ptszStr)
{
if (flags & ODPF_DONTTRANSLATE)
return ptszStr;
@@ -146,7 +146,7 @@ struct OptionsDlgData : public MZeroedObject
RECT rcDisplay;
RECT rcTab;
HFONT hBoldFont;
- TCHAR szFilterString[1024];
+ wchar_t szFilterString[1024];
HANDLE hPluginLoad, hPluginUnload;
OptionsPageData* getCurrent() const
@@ -154,9 +154,9 @@ struct OptionsDlgData : public MZeroedObject
}
};
-HTREEITEM FindNamedTreeItemAtRoot(HWND hwndTree, const TCHAR* name)
+HTREEITEM FindNamedTreeItemAtRoot(HWND hwndTree, const wchar_t* name)
{
- TCHAR str[128];
+ wchar_t str[128];
TVITEM tvi;
tvi.mask = TVIF_TEXT;
tvi.pszText = str;
@@ -172,9 +172,9 @@ HTREEITEM FindNamedTreeItemAtRoot(HWND hwndTree, const TCHAR* name)
return NULL;
}
-static HTREEITEM FindNamedTreeItemAtChildren(HWND hwndTree, HTREEITEM hItem, const TCHAR* name)
+static HTREEITEM FindNamedTreeItemAtChildren(HWND hwndTree, HTREEITEM hItem, const wchar_t* name)
{
- TCHAR str[128];
+ wchar_t str[128];
TVITEM tvi;
tvi.mask = TVIF_TEXT;
tvi.pszText = str;
@@ -192,7 +192,7 @@ static HTREEITEM FindNamedTreeItemAtChildren(HWND hwndTree, HTREEITEM hItem, con
static BOOL CALLBACK BoldGroupTitlesEnumChildren(HWND hwnd, LPARAM lParam)
{
- TCHAR szClass[64];
+ wchar_t szClass[64];
GetClassName(hwnd, szClass, _countof(szClass));
if (!mir_tstrcmp(szClass, L"Button") && (GetWindowLongPtr(hwnd, GWL_STYLE) & 0x0F) == BS_GROUPBOX)
@@ -230,17 +230,17 @@ static void ThemeDialogBackground(HWND hwnd, BOOL tabbed)
EnableThemeDialogTexture(hwnd, (tabbed ? ETDT_ENABLE : ETDT_DISABLE) | ETDT_USETABTEXTURE);
}
-static TCHAR* GetPluginName(HINSTANCE hInstance, TCHAR *buffer, int size)
+static wchar_t* GetPluginName(HINSTANCE hInstance, wchar_t *buffer, int size)
{
- TCHAR tszModuleName[MAX_PATH];
+ wchar_t tszModuleName[MAX_PATH];
GetModuleFileName(hInstance, tszModuleName, _countof(tszModuleName));
- TCHAR *dllName = _tcsrchr(tszModuleName, '\\');
+ wchar_t *dllName = wcsrchr(tszModuleName, '\\');
if (!dllName)
dllName = tszModuleName;
else
dllName++;
- _tcsncpy_s(buffer, size, dllName, _TRUNCATE);
+ wcsncpy_s(buffer, size, dllName, _TRUNCATE);
return buffer;
}
@@ -270,7 +270,7 @@ static void FindFilterStrings(int enableKeywordFiltering, int current, HWND hWnd
DWORD key = GetPluginPageHash(page); // get the plugin page hash
- TCHAR pluginName[MAX_PATH];
+ wchar_t pluginName[MAX_PATH];
char *temp = GetPluginNameByInstance(page->getInst());
GetDialogStrings(enableKeywordFiltering, key, GetPluginName(page->getInst(), pluginName, _countof(pluginName)), hWnd, page->ptszGroup, page->ptszTitle, page->ptszTab, _A2T(temp));
@@ -278,7 +278,7 @@ static void FindFilterStrings(int enableKeywordFiltering, int current, HWND hWnd
DestroyWindow(hWnd); // destroy the page, we're done with it
}
-static int MatchesFilter(const OptionsPageData *page, TCHAR *szFilterString)
+static int MatchesFilter(const OptionsPageData *page, wchar_t *szFilterString)
{
return ContainsFilterString(GetPluginPageHash(page), szFilterString);
}
@@ -297,7 +297,7 @@ static LRESULT CALLBACK OptionsFilterSubclassProc(HWND hWnd, UINT message, WPARA
PAINTSTRUCT paint;
HDC hdc = (message == WM_PAINT) ? BeginPaint(hWnd, &paint) : (HDC)wParam;
- TCHAR buf[255];
+ wchar_t buf[255];
if (bSearchState == 1 && FilterLoadProgress < 100 && FilterLoadProgress > 0)
mir_sntprintf(buf, TranslateT("Loading... %d%%"), FilterLoadProgress);
else
@@ -481,9 +481,9 @@ static void FillFilterCombo(HWND hDlg, OptionsDlgData* dat)
HINSTANCE *KnownInstances = (HINSTANCE*)alloca(sizeof(HINSTANCE)*dat->arOpd.getCount());
int countKnownInst = 0;
SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_RESETCONTENT, 0, 0);
- int index = SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_ADDSTRING, 0, (LPARAM)TranslateT(ALL_MODULES_FILTER));
+ int index = SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_ADDSTRING, 0, (LPARAM)ALL_MODULES_FILTER);
SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_SETITEMDATA, (WPARAM)index, 0);
- index = SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_ADDSTRING, 0, (LPARAM)TranslateT(CORE_MODULES_FILTER));
+ index = SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_ADDSTRING, 0, (LPARAM)CORE_MODULES_FILTER);
SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_SETITEMDATA, (WPARAM)index, (LPARAM)g_hInst);
for (int i = 0; i < dat->arOpd.getCount(); i++) {
@@ -504,11 +504,11 @@ static void FillFilterCombo(HWND hDlg, OptionsDlgData* dat)
KnownInstances[countKnownInst] = inst;
countKnownInst++;
- TCHAR tszModuleName[MAX_PATH];
+ wchar_t tszModuleName[MAX_PATH];
GetModuleFileName(inst, tszModuleName, _countof(tszModuleName));
- TCHAR *dllName = mir_a2t(GetPluginNameByInstance(inst));
- if (!dllName) dllName = mir_tstrdup(_tcsrchr(tszModuleName, _T('\\')));
+ wchar_t *dllName = mir_a2t(GetPluginNameByInstance(inst));
+ if (!dllName) dllName = mir_tstrdup(wcsrchr(tszModuleName, '\\'));
if (!dllName) dllName = mir_tstrdup(tszModuleName);
if (dllName) {
index = SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT)CB_ADDSTRING, 0, (LPARAM)dllName);
@@ -527,33 +527,33 @@ static void RebuildPageTree(HWND hdlg, OptionsDlgData *dat)
// if filter string is set to all modules then make the filter string empty (this will return all modules)
BOOL bRemoveFocusFromFilter = FALSE;
- if (mir_tstrcmp(dat->szFilterString, TranslateT(ALL_MODULES_FILTER)) == 0) {
+ if (mir_tstrcmp(dat->szFilterString, ALL_MODULES_FILTER) == 0) {
dat->szFilterString[0] = 0;
bRemoveFocusFromFilter = TRUE;
}
// if filter string is set to core modules replace it with the name of the executable (this will return all core modules)
- else if (mir_tstrcmp(dat->szFilterString, TranslateT(CORE_MODULES_FILTER)) == 0) {
+ else if (mir_tstrcmp(dat->szFilterString, CORE_MODULES_FILTER) == 0) {
// replace string with process name - that will show core settings
- TCHAR szFileName[300];
+ wchar_t szFileName[300];
GetModuleFileName(g_hInst, szFileName, _countof(szFileName));
- TCHAR *pos = _tcsrchr(szFileName, _T('\\'));
+ wchar_t *pos = wcsrchr(szFileName, '\\');
if (pos)
pos++;
else
pos = szFileName;
- _tcsncpy_s(dat->szFilterString, pos, _TRUNCATE);
+ wcsncpy_s(dat->szFilterString, pos, _TRUNCATE);
}
else {
int sel = SendDlgItemMessage(hdlg, IDC_KEYWORD_FILTER, (UINT)CB_GETCURSEL, 0, 0);
if (sel != -1) {
HINSTANCE hinst = (HINSTANCE)SendDlgItemMessage(hdlg, IDC_KEYWORD_FILTER, (UINT)CB_GETITEMDATA, sel, 0);
- TCHAR szFileName[300];
+ wchar_t szFileName[300];
GetModuleFileName(hinst, szFileName, _countof(szFileName));
- TCHAR *pos = _tcsrchr(szFileName, _T('\\'));
+ wchar_t *pos = wcsrchr(szFileName, '\\');
if (pos) pos++;
else pos = szFileName;
- _tcsncpy_s(dat->szFilterString, pos, _TRUNCATE);
+ wcsncpy_s(dat->szFilterString, pos, _TRUNCATE);
}
}
@@ -588,9 +588,9 @@ static void RebuildPageTree(HWND hdlg, OptionsDlgData *dat)
continue;
opd = dat->arOpd[i];
- TCHAR *ptszGroup = TranslateTH(opd->hLangpack, opd->ptszGroup);
- TCHAR *ptszTitle = opd->getString(opd->ptszTitle), *useTitle;
- TCHAR *ptszTab = TranslateTH(opd->hLangpack, opd->ptszTab);
+ wchar_t *ptszGroup = TranslateTH(opd->hLangpack, opd->ptszGroup);
+ wchar_t *ptszTitle = opd->getString(opd->ptszTitle), *useTitle;
+ wchar_t *ptszTab = TranslateTH(opd->hLangpack, opd->ptszTab);
tvis.hParent = NULL;
useTitle = ptszTitle;
@@ -823,8 +823,8 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L
else
dat->arOpd.insert(opd);
- if (!mir_tstrcmp(lastPage, odp->ptszTitle) && !mir_tstrcmp(lastGroup, odp->ptszGroup))
- if ((ood->pszTab == NULL && dat->currentPage == -1) || !mir_tstrcmp(lastTab, odp->ptszTab))
+ if (!mir_tstrcmp(lastPage, odp->pwszTitle) && !mir_tstrcmp(lastGroup, odp->pwszGroup))
+ if ((ood->pszTab == NULL && dat->currentPage == -1) || !mir_tstrcmp(lastTab, odp->pwszTab))
dat->currentPage = (int)i;
}
@@ -1147,7 +1147,7 @@ void OpenAccountOptions(PROTOACCOUNT *pa)
if (opi.pageCount == 0)
return;
- TCHAR tszTitle[100];
+ wchar_t tszTitle[100];
mir_sntprintf(tszTitle, TranslateT("%s options"), pa->tszAccountName);
OPENOPTIONSDIALOG ood = { sizeof(ood) };
@@ -1254,29 +1254,29 @@ static INT_PTR AddOptionsPage(WPARAM wParam, LPARAM lParam)
dst = opi->odp + opi->pageCount;
memcpy(dst, odp, sizeof(OPTIONSDIALOGPAGE));
- if (odp->ptszTitle != NULL) {
+ if (odp->pwszTitle != NULL) {
if (odp->flags & ODPF_UNICODE)
- dst->ptszTitle = mir_wstrdup(odp->ptszTitle);
+ dst->pwszTitle = mir_wstrdup(odp->pwszTitle);
else {
- dst->ptszTitle = mir_a2u(odp->pszTitle);
+ dst->pwszTitle = mir_a2u(odp->pszTitle);
dst->flags |= ODPF_UNICODE;
}
}
- if (odp->ptszGroup != NULL) {
+ if (odp->pwszGroup != NULL) {
if (odp->flags & ODPF_UNICODE)
- dst->ptszGroup = mir_wstrdup(odp->ptszGroup);
+ dst->pwszGroup = mir_wstrdup(odp->pwszGroup);
else {
- dst->ptszGroup = mir_a2t(odp->pszGroup);
+ dst->pwszGroup = mir_a2t(odp->pszGroup);
dst->flags |= ODPF_UNICODE;
}
}
- if (odp->ptszTab != NULL) {
+ if (odp->pwszTab != NULL) {
if (odp->flags & ODPF_UNICODE)
- dst->ptszTab = mir_wstrdup(odp->ptszTab);
+ dst->pwszTab = mir_wstrdup(odp->pwszTab);
else {
- dst->ptszTab = mir_a2t(odp->pszTab);
+ dst->pwszTab = mir_a2t(odp->pszTab);
dst->flags |= ODPF_UNICODE;
}
}
diff --git a/src/mir_app/src/options_ei.cpp b/src/mir_app/src/options_ei.cpp
index ff8d2861c1..fb6f3778dd 100644
--- a/src/mir_app/src/options_ei.cpp
+++ b/src/mir_app/src/options_ei.cpp
@@ -131,7 +131,7 @@ class CExtraIconOptsDlg : public CDlgBase
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.iSelectedImage = tvis.item.iImage = img;
tvis.item.lParam = (LPARAM)ids;
- tvis.item.pszText = (TCHAR*)desc.c_str();
+ tvis.item.pszText = (wchar_t*)desc.c_str();
tvis.item.state = INDEXTOSTATEIMAGEMASK(selected ? 2 : 1);
return m_tree.InsertItem(&tvis);
}
diff --git a/src/mir_app/src/path.cpp b/src/mir_app/src/path.cpp
index 96cc60358a..2dc0860a35 100644
--- a/src/mir_app/src/path.cpp
+++ b/src/mir_app/src/path.cpp
@@ -27,12 +27,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../../../plugins/ExternalAPI/m_folders.h"
-extern TCHAR g_profileDir[MAX_PATH], g_shortProfileName[MAX_PATH];
+extern wchar_t g_profileDir[MAX_PATH], g_shortProfileName[MAX_PATH];
static HANDLE hAvatarFolder;
-static TCHAR tszAvatarRoot[MAX_PATH];
+static wchar_t tszAvatarRoot[MAX_PATH];
-TCHAR* GetContactID(MCONTACT hContact)
+wchar_t* GetContactID(MCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
if (db_get_b(hContact, szProto, "ChatRoom", 0) == 1)
@@ -51,7 +51,7 @@ static __forceinline int _xcsncmp(const char *s1, const char *s2, size_t n) { re
static __forceinline size_t _xcslen(const char *s1) { return strlen(s1); }
static __forceinline char *_xcscpy(char *s1, const char *s2) { return strcpy(s1, s2); }
static __forceinline char *_xcsncpy(char *s1, const char *s2, size_t n) { return strncpy(s1, s2, n); }
-static __forceinline const char *_xstrselect(const char*, const char *s1, TCHAR*) { return s1; }
+static __forceinline const char *_xstrselect(const char*, const char *s1, wchar_t*) { return s1; }
static __forceinline char *_itox(char*, int a) { return itoa(a, (char *)mir_alloc(sizeof(char)*20), 10); }
static __forceinline char *mir_a2x(const char*, const char *s) { return mir_strdup(s); }
@@ -62,7 +62,7 @@ static __forceinline char *GetContactNickX(const char*, MCONTACT hContact)
static __forceinline char *GetContactIDX(const char*, MCONTACT hContact)
{
- TCHAR *id = GetContactID(hContact);
+ wchar_t *id = GetContactID(hContact);
char* res = mir_t2a(id);
mir_free(id);
return res;
@@ -114,12 +114,12 @@ static __forceinline char *GetProfileNameX(const char*)
static __forceinline char* GetPathVarX(const char*, int code)
{
- TCHAR szFullPath[MAX_PATH];
+ wchar_t szFullPath[MAX_PATH];
switch(code) {
case 1:
if (hAvatarFolder != NULL)
- _tcsncpy_s(szFullPath, tszAvatarRoot, _TRUNCATE);
+ wcsncpy_s(szFullPath, tszAvatarRoot, _TRUNCATE);
else
mir_sntprintf(szFullPath, L"%s\\%s\\AvatarCache", g_profileDir, g_shortProfileName);
break;
@@ -133,77 +133,77 @@ static __forceinline char* GetPathVarX(const char*, int code)
return makeFileName(szFullPath);
}
-static __forceinline int _xcscmp(const TCHAR *s1, const TCHAR *s2) { return _tcscmp(s1, s2); }
-static __forceinline int _xcsncmp(const TCHAR *s1, const TCHAR *s2, size_t n) { return _tcsncmp(s1, s2, n); }
-static __forceinline size_t _xcslen(const TCHAR *s1) { return _tcslen(s1); }
-static __forceinline TCHAR* _xcscpy(TCHAR *s1, const TCHAR *s2) { return _tcscpy(s1, s2); }
-static __forceinline TCHAR* _xcsncpy(TCHAR *s1, const TCHAR *s2, size_t n) { return _tcsncpy(s1, s2, n); }
-static __forceinline const TCHAR* _xstrselect(const TCHAR*, const char*, const TCHAR *s2) { return s2; }
-static __forceinline TCHAR* _itox(TCHAR *, int a) { return _itot(a, (TCHAR *)mir_alloc(sizeof(TCHAR)*20), 10); }
-static __forceinline TCHAR* mir_a2x(const TCHAR *, const char *s) { return mir_a2t(s); }
+static __forceinline int _xcscmp(const wchar_t *s1, const wchar_t *s2) { return _tcscmp(s1, s2); }
+static __forceinline int _xcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n) { return wcsncmp(s1, s2, n); }
+static __forceinline size_t _xcslen(const wchar_t *s1) { return wcslen(s1); }
+static __forceinline wchar_t* _xcscpy(wchar_t *s1, const wchar_t *s2) { return wcscpy(s1, s2); }
+static __forceinline wchar_t* _xcsncpy(wchar_t *s1, const wchar_t *s2, size_t n) { return wcsncpy(s1, s2, n); }
+static __forceinline const wchar_t* _xstrselect(const wchar_t*, const char*, const wchar_t *s2) { return s2; }
+static __forceinline wchar_t* _itox(wchar_t *, int a) { return _itow(a, (wchar_t *)mir_alloc(sizeof(wchar_t)*20), 10); }
+static __forceinline wchar_t* mir_a2x(const wchar_t *, const char *s) { return mir_a2t(s); }
-static __forceinline TCHAR* GetContactNickX(const TCHAR*, MCONTACT hContact)
+static __forceinline wchar_t* GetContactNickX(const wchar_t*, MCONTACT hContact)
{
return mir_tstrdup(cli.pfnGetContactDisplayName(hContact, 0));
}
-static __forceinline TCHAR* GetContactIDX(const TCHAR*, MCONTACT hContact)
+static __forceinline wchar_t* GetContactIDX(const wchar_t*, MCONTACT hContact)
{
return GetContactID(hContact);
}
-static __forceinline TCHAR* GetEnvironmentVariableX(const TCHAR *variable)
+static __forceinline wchar_t* GetEnvironmentVariableX(const wchar_t *variable)
{
- TCHAR result[512];
+ wchar_t result[512];
if (GetEnvironmentVariable(variable, result, _countof(result)))
return mir_tstrdup(result);
return NULL;
}
-static __forceinline TCHAR* SHGetSpecialFolderPathX(int iCSIDL, TCHAR*)
+static __forceinline wchar_t* SHGetSpecialFolderPathX(int iCSIDL, wchar_t*)
{
- TCHAR result[512];
+ wchar_t result[512];
if (SHGetSpecialFolderPath(NULL, result, iCSIDL, FALSE))
return mir_tstrdup(result);
return NULL;
}
-static __forceinline TCHAR* GetProfileDirX(const TCHAR*)
+static __forceinline wchar_t* GetProfileDirX(const wchar_t*)
{
return mir_tstrdup(g_profileDir);
}
-static __forceinline TCHAR* GetModulePathX(const TCHAR*, HMODULE hModule)
+static __forceinline wchar_t* GetModulePathX(const wchar_t*, HMODULE hModule)
{
- TCHAR result[MAX_PATH];
+ wchar_t result[MAX_PATH];
GetModuleFileName(hModule, result, _countof(result));
- TCHAR* str = _tcsrchr(result, '\\');
+ wchar_t* str = wcsrchr(result, '\\');
if (str) *str = 0;
return mir_tstrdup(result);
}
-static __forceinline TCHAR* GetUserNameX(const TCHAR*)
+static __forceinline wchar_t* GetUserNameX(const wchar_t*)
{
- TCHAR result[128];
+ wchar_t result[128];
DWORD size = _countof(result);
if (GetUserName(result, &size))
return mir_tstrdup(result);
return NULL;
}
-static __forceinline TCHAR* GetProfileNameX(const TCHAR*)
+static __forceinline wchar_t* GetProfileNameX(const wchar_t*)
{
return mir_tstrdup(g_shortProfileName);
}
-static __forceinline TCHAR* GetPathVarX(const TCHAR*, int code)
+static __forceinline wchar_t* GetPathVarX(const wchar_t*, int code)
{
- TCHAR szFullPath[MAX_PATH];
+ wchar_t szFullPath[MAX_PATH];
switch(code) {
case 1:
if (hAvatarFolder != NULL)
- _tcsncpy_s(szFullPath, tszAvatarRoot, _TRUNCATE);
+ wcsncpy_s(szFullPath, tszAvatarRoot, _TRUNCATE);
else
mir_sntprintf(szFullPath, L"%s\\%s\\AvatarCache", g_profileDir, g_shortProfileName);
break;
@@ -366,9 +366,9 @@ static int OnFoldersChanged(WPARAM, LPARAM)
{
mir_sntprintf(tszAvatarRoot, L"%s\\%s\\AvatarCache", g_profileDir, g_shortProfileName);
- TCHAR tmpVar[MAX_PATH];
+ wchar_t tmpVar[MAX_PATH];
if (!FoldersGetCustomPathT(hAvatarFolder, tmpVar, _countof(tmpVar), tszAvatarRoot))
- _tcsncpy_s(tszAvatarRoot, tmpVar, _TRUNCATE);
+ wcsncpy_s(tszAvatarRoot, tmpVar, _TRUNCATE);
return 0;
}
@@ -376,9 +376,9 @@ void InitPathVar()
{
mir_sntprintf(tszAvatarRoot, L"%s\\%s\\AvatarCache", g_profileDir, g_shortProfileName);
if (hAvatarFolder = FoldersRegisterCustomPathT( LPGEN("Avatars"), LPGEN("Avatars root folder"), tszAvatarRoot)) {
- TCHAR tmpVar[MAX_PATH];
+ wchar_t tmpVar[MAX_PATH];
if (!FoldersGetCustomPathT(hAvatarFolder, tmpVar, _countof(tmpVar), tszAvatarRoot))
- _tcsncpy_s(tszAvatarRoot, tmpVar, _TRUNCATE);
+ wcsncpy_s(tszAvatarRoot, tmpVar, _TRUNCATE);
HookEvent(ME_FOLDERS_PATH_CHANGED, OnFoldersChanged);
}
}
diff --git a/src/mir_app/src/pluginopts.cpp b/src/mir_app/src/pluginopts.cpp
index eda32700e3..757a0318c1 100644
--- a/src/mir_app/src/pluginopts.cpp
+++ b/src/mir_app/src/pluginopts.cpp
@@ -40,7 +40,7 @@ static UINT_PTR timerID;
struct PluginListItemData
{
- TCHAR fileName[MAX_PATH];
+ wchar_t fileName[MAX_PATH];
HINSTANCE hInst;
int flags, stdPlugin;
char* author;
@@ -58,9 +58,9 @@ static int sttSortPlugins(const PluginListItemData *p1, const PluginListItemData
static LIST<PluginListItemData> arPluginList(10, sttSortPlugins);
-static BOOL dialogListPlugins(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM lParam)
+static BOOL dialogListPlugins(WIN32_FIND_DATA *fd, wchar_t *path, WPARAM, LPARAM lParam)
{
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
mir_sntprintf(buf, L"%s\\Plugins\\%s", path, fd->cFileName);
HINSTANCE hInst = GetModuleHandle(buf);
@@ -85,7 +85,7 @@ static BOOL dialogListPlugins(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM l
}
CharLower(fd->cFileName);
- _tcsncpy_s(dat->fileName, fd->cFileName, _TRUNCATE);
+ wcsncpy_s(dat->fileName, fd->cFileName, _TRUNCATE);
HWND hwndList = (HWND)lParam;
@@ -121,7 +121,7 @@ static BOOL dialogListPlugins(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM l
else
memset(&dat->uuid, 0, sizeof(dat->uuid));
- TCHAR *shortNameT = mir_a2t(pi.pluginInfo->shortName);
+ wchar_t *shortNameT = mir_a2t(pi.pluginInfo->shortName);
// column 3: plugin short name
if (shortNameT) {
ListView_SetItemText(hwndList, iRow, 2, shortNameT);
@@ -183,9 +183,9 @@ static void RemoveAllItems(HWND hwnd)
static bool LoadPluginDynamically(PluginListItemData *dat)
{
- TCHAR exe[MAX_PATH];
+ wchar_t exe[MAX_PATH];
GetModuleFileName(NULL, exe, _countof(exe));
- TCHAR *p = _tcsrchr(exe, '\\'); if (p) *p = 0;
+ wchar_t *p = wcsrchr(exe, '\\'); if (p) *p = 0;
pluginEntry* pPlug = OpenPlugin(dat->fileName, L"Plugins", exe);
if (pPlug->pclass & PCLASS_FAILED) {
@@ -230,7 +230,7 @@ static LRESULT CALLBACK PluginListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LP
for (int i = 0; i < arPluginList.getCount(); i++) {
PluginListItemData *p = arPluginList[i];
- if (!_tcsnicmp(szFilter, p->fileName, szFilter.GetLength())) {
+ if (!wcsnicmp(szFilter, p->fileName, szFilter.GetLength())) {
LVFINDINFO lvfi;
lvfi.flags = LVFI_PARAM;
lvfi.lParam = (LPARAM)p;
@@ -302,7 +302,7 @@ static int CALLBACK SortPlugins(WPARAM i1, LPARAM i2, LPARAM)
return mir_tstrcmp(p1->fileName, p2->fileName);
}
-static TCHAR *latin2t(const char *p)
+static wchar_t *latin2t(const char *p)
{
if (p == NULL)
return mir_tstrdup(L"");
@@ -423,7 +423,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
if (ListView_GetItem(hwndList, &lvi)) {
PluginListItemData *dat = (PluginListItemData*)lvi.lParam;
- TCHAR buf[1024];
+ wchar_t buf[1024];
ListView_GetItemText(hwndList, hdr->iItem, 2, buf, _countof(buf));
SetDlgItemText(hwndDlg, IDC_PLUGININFOFRAME, sel ? buf : L"");
@@ -454,12 +454,12 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
if (hdr->hdr.code == PSN_APPLY) {
bool needRestart = false;
- TCHAR bufRestart[1024];
+ wchar_t bufRestart[1024];
int bufLen = mir_sntprintf(bufRestart, L"%s\n", TranslateT("Miranda NG must be restarted to apply changes for these plugins:"));
HWND hwndList = GetDlgItem(hwndDlg, IDC_PLUGLIST);
for (int iRow = 0; iRow != -1;) {
- TCHAR buf[1024];
+ wchar_t buf[1024];
ListView_GetItemText(hwndList, iRow, 1, buf, _countof(buf));
int iState = ListView_GetItemState(hwndList, iRow, LVIS_STATEIMAGEMASK);
SetPluginOnWhiteList(buf, (iState & 0x2000) ? 1 : 0);
diff --git a/src/mir_app/src/plugins.h b/src/mir_app/src/plugins.h
index 44d7a18ddd..89f26a67f1 100644
--- a/src/mir_app/src/plugins.h
+++ b/src/mir_app/src/plugins.h
@@ -41,7 +41,7 @@ struct BASIC_PLUGIN_INFO
struct pluginEntry
{
- TCHAR pluginname[64];
+ wchar_t pluginname[64];
unsigned int pclass; // PCLASS_*
int hLangpack;
BASIC_PLUGIN_INFO bpi;
@@ -54,30 +54,30 @@ int PluginOptionsInit(WPARAM, LPARAM);
void LoadPluginOptions();
void UnloadPluginOptions();
-int isPluginOnWhiteList(const TCHAR* pluginname);
-void SetPluginOnWhiteList(const TCHAR* pluginname, int allow);
+int isPluginOnWhiteList(const wchar_t* pluginname);
+void SetPluginOnWhiteList(const wchar_t* pluginname, int allow);
int getDefaultPluginIdx(const MUUID& muuid);
bool hasMuuid(const BASIC_PLUGIN_INFO&, const MUUID&);
bool hasMuuid(const MUUID* pFirst, const MUUID&);
-int checkAPI(TCHAR* plugin, BASIC_PLUGIN_INFO* bpi, DWORD mirandaVersion, int checkTypeAPI);
+int checkAPI(wchar_t* plugin, BASIC_PLUGIN_INFO* bpi, DWORD mirandaVersion, int checkTypeAPI);
-pluginEntry* OpenPlugin(TCHAR *tszFileName, TCHAR *dir, TCHAR *path);
+pluginEntry* OpenPlugin(wchar_t *tszFileName, wchar_t *dir, wchar_t *path);
bool TryLoadPlugin(pluginEntry *p, bool bDynamic);
void Plugin_Uninit(pluginEntry *p);
int Plugin_UnloadDyn(pluginEntry *p);
-typedef BOOL (*SCAN_PLUGINS_CALLBACK) (WIN32_FIND_DATA * fd, TCHAR *path, WPARAM wParam, LPARAM lParam);
+typedef BOOL (*SCAN_PLUGINS_CALLBACK) (WIN32_FIND_DATA * fd, wchar_t *path, WPARAM wParam, LPARAM lParam);
void enumPlugins(SCAN_PLUGINS_CALLBACK cb, WPARAM wParam, LPARAM lParam);
struct MuuidReplacement
{
MUUID uuid; // default interface plugin
- TCHAR* stdplugname;
+ wchar_t* stdplugname;
pluginEntry* pImpl; // replacement plugin
};
bool LoadCorePlugin( MuuidReplacement& );
-MUUID* GetPluginInterfaces(const TCHAR* ptszFileName, bool& bIsPlugin); \ No newline at end of file
+MUUID* GetPluginInterfaces(const wchar_t* ptszFileName, bool& bIsPlugin);
diff --git a/src/mir_app/src/profilemanager.cpp b/src/mir_app/src/profilemanager.cpp
index 9ab844d821..38465b5165 100644
--- a/src/mir_app/src/profilemanager.cpp
+++ b/src/mir_app/src/profilemanager.cpp
@@ -35,17 +35,17 @@ void EnsureCheckerLoaded(bool);
#define WM_INPUTCHANGED (WM_USER + 0x3000)
#define WM_FOCUSTEXTBOX (WM_USER + 0x3001)
-typedef BOOL (__cdecl *ENUMPROFILECALLBACK) (TCHAR *tszFullPath, TCHAR *profile, LPARAM lParam);
+typedef BOOL (__cdecl *ENUMPROFILECALLBACK) (wchar_t *tszFullPath, wchar_t *profile, LPARAM lParam);
void SetServiceModePlugin(pluginEntry *p);
/////////////////////////////////////////////////////////////////////////////////////////
// Profile creator
-static int findProfiles(TCHAR *szProfileDir, ENUMPROFILECALLBACK callback, LPARAM lParam)
+static int findProfiles(wchar_t *szProfileDir, ENUMPROFILECALLBACK callback, LPARAM lParam)
{
// find in Miranda NG profile subfolders
- TCHAR searchspec[MAX_PATH];
+ wchar_t searchspec[MAX_PATH];
mir_sntprintf(searchspec, L"%s\\*.*", szProfileDir);
WIN32_FIND_DATA ffd;
@@ -56,9 +56,9 @@ static int findProfiles(TCHAR *szProfileDir, ENUMPROFILECALLBACK callback, LPARA
do {
// find all subfolders except "." and ".."
if ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && mir_tstrcmp(ffd.cFileName, L".") && mir_tstrcmp(ffd.cFileName, L"..")) {
- TCHAR buf[MAX_PATH], profile[MAX_PATH];
+ wchar_t buf[MAX_PATH], profile[MAX_PATH];
mir_sntprintf(buf, L"%s\\%s\\%s.dat", szProfileDir, ffd.cFileName, ffd.cFileName);
- if (_taccess(buf, 0) == 0) {
+ if (_waccess(buf, 0) == 0) {
mir_sntprintf(profile, L"%s.dat", ffd.cFileName);
if (!callback(buf, profile, lParam))
break;
@@ -74,7 +74,7 @@ static int findProfiles(TCHAR *szProfileDir, ENUMPROFILECALLBACK callback, LPARA
static LRESULT CALLBACK ProfileNameValidate(HWND edit, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (msg == WM_CHAR) {
- if (_tcschr(L".?/\\#' ", (TCHAR)wParam) != 0)
+ if (wcschr(L".?/\\#' ", (wchar_t)wParam) != 0)
return 0;
PostMessage(GetParent(edit), WM_INPUTCHANGED, 0, 0);
}
@@ -86,14 +86,14 @@ class CCreateProfileDlg : public CDlgBase
CCtrlButton &m_btnOk;
PROFILEMANAGERDATA *m_pd;
- int CreateProfile(TCHAR *profile, DATABASELINK *link)
+ int CreateProfile(wchar_t *profile, DATABASELINK *link)
{
- TCHAR buf[256];
+ wchar_t buf[256];
int err = 0;
// check if the file already exists
- TCHAR *file = _tcsrchr(profile, '\\');
+ wchar_t *file = wcsrchr(profile, '\\');
if (file) file++;
- if (_taccess(profile, 0) == 0) {
+ if (_waccess(profile, 0) == 0) {
// file already exists!
mir_sntprintf(buf,
TranslateT("The profile '%s' already exists. Do you want to move it to the Recycle Bin?\n\nWARNING: The profile will be deleted if Recycle Bin is disabled.\nWARNING: A profile may contain confidential information and should be properly deleted."),
@@ -165,13 +165,13 @@ public:
mir_subclassWindow(m_profileName.GetHwnd(), ProfileNameValidate);
// decide if there is a default profile name given in the INI and if it should be used
- if (m_pd->noProfiles || (shouldAutoCreate(m_pd->ptszProfile) && _taccess(m_pd->ptszProfile, 0))) {
- TCHAR *profile = _tcsrchr(m_pd->ptszProfile, '\\');
+ if (m_pd->noProfiles || (shouldAutoCreate(m_pd->ptszProfile) && _waccess(m_pd->ptszProfile, 0))) {
+ wchar_t *profile = wcsrchr(m_pd->ptszProfile, '\\');
if (profile) ++profile;
else profile = m_pd->ptszProfile;
- TCHAR *p = _tcsrchr(profile, '.');
- TCHAR c = 0;
+ wchar_t *p = wcsrchr(profile, '.');
+ wchar_t c = 0;
if (p) { c = *p; *p = 0; }
m_profileName.SetText(profile);
@@ -239,24 +239,24 @@ class CChooseProfileDlg : public CDlgBase
struct ProfileEnumData
{
- ProfileEnumData(CCtrlListView &_list, TCHAR *_profile) :
+ ProfileEnumData(CCtrlListView &_list, wchar_t *_profile) :
list(_list),
szProfile(_profile)
{}
CCtrlListView &list;
- TCHAR* szProfile;
+ wchar_t* szProfile;
};
- static BOOL EnumProfilesForList(TCHAR *tszFullPath, TCHAR *profile, LPARAM lParam)
+ static BOOL EnumProfilesForList(wchar_t *tszFullPath, wchar_t *profile, LPARAM lParam)
{
ProfileEnumData *ped = (ProfileEnumData*)lParam;
CCtrlListView &list = ped->list;
- TCHAR sizeBuf[64];
+ wchar_t sizeBuf[64];
bool bFileLocked = true;
- TCHAR *p = _tcsrchr(profile, '.');
+ wchar_t *p = wcsrchr(profile, '.');
mir_tstrcpy(sizeBuf, L"0 KB");
if (p != NULL) *p = 0;
@@ -266,7 +266,7 @@ class CChooseProfileDlg : public CDlgBase
item.iItem = 0;
struct _stat statbuf;
- if (_tstat(tszFullPath, &statbuf) == 0) {
+ if (_wstat(tszFullPath, &statbuf) == 0) {
if (statbuf.st_size > 1000000) {
mir_sntprintf(sizeBuf, L"%.3lf", (double)statbuf.st_size / 1048576.0);
mir_tstrcpy(sizeBuf + 5, L" MB");
@@ -314,7 +314,7 @@ class CChooseProfileDlg : public CDlgBase
if (iItem < 0)
return;
- TCHAR profile[MAX_PATH], fullName[MAX_PATH];
+ wchar_t profile[MAX_PATH], fullName[MAX_PATH];
LVITEM item = { 0 };
item.mask = LVIF_TEXT | LVIF_IMAGE;
item.iItem = iItem;
@@ -332,7 +332,7 @@ class CChooseProfileDlg : public CDlgBase
if (iItem < 0)
return;
- TCHAR profile[MAX_PATH], profilef[MAX_PATH * 2];
+ wchar_t profile[MAX_PATH], profilef[MAX_PATH * 2];
LVITEM item = { 0 };
item.mask = LVIF_TEXT;
@@ -360,7 +360,7 @@ class CChooseProfileDlg : public CDlgBase
{
m_btnOk.Enable(m_profileList.GetSelectedCount() == 1);
- TCHAR profile[MAX_PATH];
+ wchar_t profile[MAX_PATH];
LVITEM item = { 0 };
item.mask = LVIF_TEXT | LVIF_IMAGE;
item.iItem = m_profileList.GetNextItem(-1, LVNI_SELECTED | LVNI_ALL);
@@ -386,12 +386,12 @@ class CChooseProfileDlg : public CDlgBase
// profile is placed in "profile_name" subfolder
- TCHAR tmpPath[MAX_PATH];
+ wchar_t tmpPath[MAX_PATH];
mir_sntprintf(tmpPath, L"%s\\%s.dat", m_pd->ptszProfileDir, profile);
- if (_taccess(tmpPath, 2))
+ if (_waccess(tmpPath, 2))
mir_sntprintf(m_pd->ptszProfile, MAX_PATH, L"%s\\%s\\%s.dat", m_pd->ptszProfileDir, profile, profile);
else
- _tcsncpy_s(m_pd->ptszProfile, MAX_PATH, tmpPath, _TRUNCATE);
+ wcsncpy_s(m_pd->ptszProfile, MAX_PATH, tmpPath, _TRUNCATE);
}
void ExecuteMenu(LPARAM lParam)
@@ -521,12 +521,12 @@ public:
void list_OnGetTip(CCtrlListView::TEventInfo *evt)
{
if (auto pTip = evt->nmlvit) {
- TCHAR profilename[MAX_PATH], tszFullPath[MAX_PATH];
+ wchar_t profilename[MAX_PATH], tszFullPath[MAX_PATH];
struct _stat statbuf;
m_profileList.GetItemText(pTip->iItem, 0, profilename, _countof(profilename));
mir_sntprintf(tszFullPath, L"%s\\%s\\%s.dat", m_pd->ptszProfileDir, profilename, profilename);
- _tstat(tszFullPath, &statbuf);
- mir_sntprintf(pTip->pszText, pTip->cchTextMax, L"%s\n%s: %s\n%s: %s", tszFullPath, TranslateT("Created"), rtrimt(NEWTSTR_ALLOCA(_tctime(&statbuf.st_ctime))), TranslateT("Modified"), rtrimt(NEWTSTR_ALLOCA(_tctime(&statbuf.st_mtime))));
+ _wstat(tszFullPath, &statbuf);
+ mir_sntprintf(pTip->pszText, pTip->cchTextMax, L"%s\n%s: %s\n%s: %s", tszFullPath, TranslateT("Created"), rtrimt(NEWWSTR_ALLOCA(_wctime(&statbuf.st_ctime))), TranslateT("Modified"), rtrimt(NEWWSTR_ALLOCA(_wctime(&statbuf.st_mtime))));
}
}
@@ -591,8 +591,8 @@ public:
{
m_btnOk.OnClick = Callback(this, &CProfileManager::onOk);
- m_tab.AddPage(LPGENT("My profiles"), NULL, new CChooseProfileDlg(m_btnOk, m_pd));
- m_tab.AddPage(LPGENT("New profile"), NULL, new CCreateProfileDlg(m_btnOk, m_pd));
+ m_tab.AddPage(LPGENW("My profiles"), NULL, new CChooseProfileDlg(m_btnOk, m_pd));
+ m_tab.AddPage(LPGENW("New profile"), NULL, new CCreateProfileDlg(m_btnOk, m_pd));
}
virtual void OnInitDialog()
diff --git a/src/mir_app/src/profilemanager.h b/src/mir_app/src/profilemanager.h
index 63b521c1b3..5ec6e9fcd1 100644
--- a/src/mir_app/src/profilemanager.h
+++ b/src/mir_app/src/profilemanager.h
@@ -24,8 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct PROFILEMANAGERDATA
{
- TCHAR *ptszProfile; // in/out
- TCHAR *ptszProfileDir; // in/out
+ wchar_t *ptszProfile; // in/out
+ wchar_t *ptszProfileDir; // in/out
BOOL noProfiles; // in
BOOL bRun; // out
@@ -33,13 +33,13 @@ struct PROFILEMANAGERDATA
DATABASELINK *dblink; // out
};
-char* makeFileName(const TCHAR *tszOriginalName);
-int touchDatabase(const TCHAR *tszProfile, DATABASELINK **pDblink);
+char* makeFileName(const wchar_t *tszOriginalName);
+int touchDatabase(const wchar_t *tszProfile, DATABASELINK **pDblink);
int getProfileManager(PROFILEMANAGERDATA *pd);
-int getProfilePath(TCHAR *buf, size_t cch);
-int isValidProfileName(const TCHAR *name);
-bool fileExist(const TCHAR *fname);
-bool shouldAutoCreate(TCHAR *szProfile);
+int getProfilePath(wchar_t *buf, size_t cch);
+int isValidProfileName(const wchar_t *name);
+bool fileExist(const wchar_t *fname);
+bool shouldAutoCreate(wchar_t *szProfile);
-extern TCHAR g_profileDir[MAX_PATH], g_profileName[MAX_PATH], g_shortProfileName[MAX_PATH];
+extern wchar_t g_profileDir[MAX_PATH], g_profileName[MAX_PATH], g_shortProfileName[MAX_PATH];
extern bool g_bDbCreated;
diff --git a/src/mir_app/src/proto_internal.cpp b/src/mir_app/src/proto_internal.cpp
index cf885f54f3..d64e64bd97 100644
--- a/src/mir_app/src/proto_internal.cpp
+++ b/src/mir_app/src/proto_internal.cpp
@@ -24,15 +24,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-char** __fastcall Proto_FilesMatrixA(TCHAR **files);
+char** __fastcall Proto_FilesMatrixA(wchar_t **files);
-void FreeFilesMatrix(TCHAR ***files)
+void FreeFilesMatrix(wchar_t ***files)
{
if (*files == NULL)
return;
// Free each filename in the pointer array
- TCHAR **pFile = *files;
+ wchar_t **pFile = *files;
while (*pFile != NULL) {
mir_free(*pFile);
*pFile = NULL;
@@ -61,7 +61,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return (int)ProtoCallService(m_szModuleName, PS_AUTHALLOW, (WPARAM)hDbEvent, 0);
}
- int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR *szReason)
+ int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t *szReason)
{
if (m_iVersion > 1)
return (int)ProtoCallService(m_szModuleName, PS_AUTHDENY, hDbEvent, (LPARAM)szReason);
@@ -75,7 +75,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return (int)ProtoCallService(m_szModuleName, PSR_AUTH, 0, (LPARAM)&ccs);
}
- int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage)
+ int __cdecl AuthRequest(MCONTACT hContact, const wchar_t *szMessage)
{
CCSDATA ccs = { hContact, PSS_AUTHREQUEST, 0, (LPARAM)szMessage };
if (m_iVersion > 1)
@@ -87,7 +87,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return res;
}
- HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath)
+ HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath)
{
CCSDATA ccs = { hContact, PSS_FILEALLOW, (WPARAM)hTransfer, (LPARAM)szPath };
if (m_iVersion > 1)
@@ -105,7 +105,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return (int)ProtoCallService(m_szModuleName, PSS_FILECANCEL, 0, (LPARAM)&ccs);
}
- int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason)
+ int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason)
{
CCSDATA ccs = { hContact, PSS_FILEDENY, (WPARAM)hTransfer, (LPARAM)szReason };
if (m_iVersion > 1)
@@ -117,16 +117,16 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return res;
}
- int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename)
+ int __cdecl FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename)
{
PROTOFILERESUME pfr = { *action, *szFilename };
if (m_iVersion > 1)
return (int)ProtoCallService(m_szModuleName, PS_FILERESUME, (WPARAM)hTransfer, (LPARAM)&pfr);
- pfr.szFilename = (TCHAR*)mir_t2a(pfr.szFilename);
+ pfr.szFilename = (wchar_t*)mir_t2a(pfr.szFilename);
int res = (int)ProtoCallService(m_szModuleName, PS_FILERESUME, (WPARAM)hTransfer, (LPARAM)&pfr);
- mir_free((TCHAR*)*szFilename);
- *action = pfr.action; *szFilename = (TCHAR*)pfr.szFilename;
+ mir_free((wchar_t*)*szFilename);
+ *action = pfr.action; *szFilename = (wchar_t*)pfr.szFilename;
return res;
}
@@ -147,7 +147,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return ProtoCallService(m_szModuleName, PSS_GETINFO, 0, (LPARAM)&ccs);
}
- HANDLE __cdecl SearchBasic(const TCHAR* id)
+ HANDLE __cdecl SearchBasic(const wchar_t* id)
{
if (m_iVersion > 1)
return (HANDLE)ProtoCallService(m_szModuleName, PS_BASICSEARCH, 0, (LPARAM)id);
@@ -155,19 +155,19 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return (HANDLE)ProtoCallService(m_szModuleName, PS_BASICSEARCH, 0, _T2A(id));
}
- HANDLE __cdecl SearchByEmail(const TCHAR* email)
+ HANDLE __cdecl SearchByEmail(const wchar_t* email)
{
if (m_iVersion > 1)
return (HANDLE)ProtoCallService(m_szModuleName, PS_SEARCHBYEMAIL, 0, (LPARAM)email);
return (HANDLE)ProtoCallService(m_szModuleName, PS_SEARCHBYEMAIL, 0, _T2A(email));
}
- HANDLE __cdecl SearchByName(const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName)
+ HANDLE __cdecl SearchByName(const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName)
{
PROTOSEARCHBYNAME psn;
- psn.pszNick = (TCHAR*)mir_t2a(nick);
- psn.pszFirstName = (TCHAR*)mir_t2a(firstName);
- psn.pszLastName = (TCHAR*)mir_t2a(lastName);
+ psn.pszNick = (wchar_t*)mir_t2a(nick);
+ psn.pszFirstName = (wchar_t*)mir_t2a(firstName);
+ psn.pszLastName = (wchar_t*)mir_t2a(lastName);
HANDLE res = (HANDLE)ProtoCallService(m_szModuleName, PS_SEARCHBYNAME, 0, (LPARAM)&psn);
mir_free(psn.pszNick);
mir_free(psn.pszFirstName);
@@ -216,7 +216,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return (int)ProtoCallService(m_szModuleName, PSS_CONTACTS, 0, (LPARAM)&ccs);
}
- HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles)
+ HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles)
{
CCSDATA ccs = { hContact, PSS_FILE, (WPARAM)szDescription, (LPARAM)ppszFiles };
@@ -226,7 +226,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
ccs.wParam = (WPARAM)mir_t2a(szDescription);
ccs.lParam = (LPARAM)Proto_FilesMatrixA(ppszFiles);
HANDLE res = (HANDLE)ProtoCallService(m_szModuleName, PSS_FILE, 0, (LPARAM)&ccs);
- if (res == 0) FreeFilesMatrix((TCHAR***)&ccs.lParam);
+ if (res == 0) FreeFilesMatrix((wchar_t***)&ccs.lParam);
mir_free((char*)ccs.wParam);
return res;
}
@@ -266,7 +266,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return (int)ProtoCallService(m_szModuleName, PSR_AWAYMSG, 0, (LPARAM)&ccs);
}
- int __cdecl SetAwayMsg(int iStatus, const TCHAR *msg)
+ int __cdecl SetAwayMsg(int iStatus, const wchar_t *msg)
{
if (m_iVersion > 1)
return (int)ProtoCallService(m_szModuleName, PS_SETAWAYMSG, iStatus, (LPARAM)msg);
diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp
index 096fdf0ed0..751af269c0 100644
--- a/src/mir_app/src/proto_opts.cpp
+++ b/src/mir_app/src/proto_opts.cpp
@@ -56,9 +56,9 @@ static HWND hAccMgr = NULL;
extern HANDLE hAccListChanged;
-int UnloadPlugin(TCHAR* buf, int bufLen);
+int UnloadPlugin(wchar_t* buf, int bufLen);
-PROTOACCOUNT* Proto_CreateAccount(const char *szModuleName, const char *szBaseProto, const TCHAR *tszAccountName)
+PROTOACCOUNT* Proto_CreateAccount(const char *szModuleName, const char *szBaseProto, const wchar_t *tszAccountName)
{
PROTOACCOUNT *pa = (PROTOACCOUNT*)mir_calloc(sizeof(PROTOACCOUNT));
if (pa == NULL)
@@ -123,7 +123,7 @@ static bool OnCreateAccount(HWND hwndDlg)
AccFormDlgParam* param = (AccFormDlgParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
PROTOACCOUNT *pa = param->pa;
- TCHAR tszAccName[256];
+ wchar_t tszAccName[256];
GetDlgItemText(hwndDlg, IDC_ACCNAME, tszAccName, _countof(tszAccName));
rtrimt(tszAccName);
if (tszAccName[0] == 0) {
@@ -142,13 +142,13 @@ static bool OnCreateAccount(HWND hwndDlg)
if (param->action == PRAC_UPGRADED) {
BOOL oldProto = pa->bOldProto;
- TCHAR szPlugin[MAX_PATH];
+ wchar_t szPlugin[MAX_PATH];
mir_sntprintf(szPlugin, L"%s.dll", _A2T(pa->szProtoName));
int idx = accounts.getIndex(pa);
UnloadAccount(pa, false, false);
accounts.remove(idx);
if (oldProto && UnloadPlugin(szPlugin, _countof(szPlugin))) {
- TCHAR szNewName[MAX_PATH];
+ wchar_t szNewName[MAX_PATH];
mir_sntprintf(szNewName, L"%s~", szPlugin);
MoveFile(szPlugin, szNewName);
}
@@ -199,7 +199,7 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam
if (param->action == PRAC_ADDED) // new account
SetWindowText(hwndDlg, TranslateT("Create new account"));
else {
- TCHAR str[200];
+ wchar_t str[200];
if (param->action == PRAC_CHANGED) { // update
EnableWindow(GetDlgItem(hwndDlg, IDC_PROTOTYPECOMBO), FALSE);
mir_sntprintf(str, L"%s: %s", TranslateT("Editing account"), param->pa->tszAccountName);
@@ -280,7 +280,7 @@ static LRESULT CALLBACK sttEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
case WM_KILLFOCUS:
int length = GetWindowTextLength(hwnd) + 1;
- TCHAR *str = (TCHAR*)mir_alloc(sizeof(TCHAR) * length);
+ wchar_t *str = (wchar_t*)mir_alloc(sizeof(wchar_t) * length);
GetWindowText(hwnd, str, length);
SendMessage(GetParent(GetParent(hwnd)), WM_COMMAND, MAKEWPARAM(GetWindowLongPtr(GetParent(hwnd), GWL_ID), LBN_MY_RENAME), (LPARAM)str);
DestroyWindow(hwnd);
@@ -605,7 +605,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
int length = SendDlgItemMessage(hwndDlg, IDC_ACCLIST, LB_GETTEXTLEN, lps->itemID, 0);
int size = max(length + 1, 256);
- TCHAR *text = (TCHAR *)_alloca(sizeof(TCHAR) * size);
+ wchar_t *text = (wchar_t *)_alloca(sizeof(wchar_t) * size);
SendDlgItemMessage(hwndDlg, IDC_ACCLIST, LB_GETTEXT, lps->itemID, (LPARAM)text);
SelectObject(lps->hDC, dat->hfntTitle);
@@ -770,7 +770,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
else {
DWORD dwStatus = CallProtoServiceInt(NULL, pa->szModuleName, PS_GETSTATUS, 0, 0);
if (dwStatus >= ID_STATUS_ONLINE) {
- TCHAR buf[200];
+ wchar_t buf[200];
mir_sntprintf(buf, TranslateT("Account %s is being disabled"), pa->tszAccountName);
if (IDNO == ::MessageBox(hwndDlg,
TranslateT("Account is online. Disable account?"),
@@ -795,7 +795,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
pa = (PROTOACCOUNT *)ListBox_GetItemData(hwndList, iItem);
if (pa) {
mir_free(pa->tszAccountName);
- pa->tszAccountName = (TCHAR*)lParam;
+ pa->tszAccountName = (wchar_t*)lParam;
WriteDbAccounts();
NotifyEventHooks(hAccListChanged, PRAC_CHANGED, (LPARAM)pa);
@@ -808,7 +808,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
RedrawWindow(hwndList, NULL, NULL, RDW_INVALIDATE);
}
- else mir_free((TCHAR*)lParam);
+ else mir_free((wchar_t*)lParam);
}
break;
@@ -830,7 +830,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
idx = ListBox_GetCurSel(hwndList);
if (idx != -1) {
pa = (PROTOACCOUNT*)ListBox_GetItemData(hwndList, idx);
- TCHAR buf[200];
+ wchar_t buf[200];
mir_sntprintf(buf, TranslateT("Account %s is being deleted"), pa->tszAccountName);
if (pa->bOldProto) {
MessageBox(hwndDlg, TranslateT("You need to disable plugin to delete this account"), buf, MB_ICONERROR | MB_OK);
diff --git a/src/mir_app/src/proto_ui.cpp b/src/mir_app/src/proto_ui.cpp
index ed0ac48b16..38ee85161b 100644
--- a/src/mir_app/src/proto_ui.cpp
+++ b/src/mir_app/src/proto_ui.cpp
@@ -48,7 +48,7 @@ void CProtoIntDlgBase::CreateLink(CCtrlData& ctrl, char *szSetting, BYTE type, D
ctrl.CreateDbLink(m_proto_interface->m_szModuleName, szSetting, type, iValue);
}
-void CProtoIntDlgBase::CreateLink(CCtrlData& ctrl, const char *szSetting, TCHAR *szValue)
+void CProtoIntDlgBase::CreateLink(CCtrlData& ctrl, const char *szSetting, wchar_t *szValue)
{
ctrl.CreateDbLink(m_proto_interface->m_szModuleName, szSetting, szValue);
}
@@ -57,7 +57,7 @@ void CProtoIntDlgBase::OnProtoRefresh(WPARAM, LPARAM) {}
void CProtoIntDlgBase::OnProtoActivate(WPARAM, LPARAM) {}
void CProtoIntDlgBase::OnProtoCheckOnline(WPARAM, LPARAM) {}
-void CProtoIntDlgBase::SetStatusText(const TCHAR *statusText)
+void CProtoIntDlgBase::SetStatusText(const wchar_t *statusText)
{
if (m_hwndStatus)
SendMessage(m_hwndStatus, SB_SETTEXT, 0, (LPARAM)statusText);
@@ -86,8 +86,8 @@ INT_PTR CProtoIntDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
case WM_SETTEXT:
if (m_show_label && IsWindowUnicode(m_hwnd)) {
- TCHAR *szTitle = (TCHAR *)lParam;
- if (!_tcsstr(szTitle, m_proto_interface->m_tszUserName)) {
+ wchar_t *szTitle = (wchar_t *)lParam;
+ if (!wcsstr(szTitle, m_proto_interface->m_tszUserName)) {
UpdateProtoTitle(szTitle);
return TRUE;
}
@@ -122,13 +122,13 @@ INT_PTR CProtoIntDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
return CSuper::DlgProc(msg, wParam, lParam);
}
-void CProtoIntDlgBase::UpdateProtoTitle(const TCHAR *szText)
+void CProtoIntDlgBase::UpdateProtoTitle(const wchar_t *szText)
{
if (!m_show_label)
return;
int curLength;
- const TCHAR *curText;
+ const wchar_t *curText;
if (szText) {
curText = szText;
@@ -136,14 +136,14 @@ void CProtoIntDlgBase::UpdateProtoTitle(const TCHAR *szText)
}
else {
curLength = GetWindowTextLength(m_hwnd) + 1;
- TCHAR *tmp = (TCHAR *)_alloca(curLength * sizeof(TCHAR));
+ wchar_t *tmp = (wchar_t *)_alloca(curLength * sizeof(wchar_t));
GetWindowText(m_hwnd, tmp, curLength);
curText = tmp;
}
- if (!_tcsstr(curText, m_proto_interface->m_tszUserName)) {
+ if (!wcsstr(curText, m_proto_interface->m_tszUserName)) {
size_t length = curLength + mir_tstrlen(m_proto_interface->m_tszUserName) + 256;
- TCHAR *text = (TCHAR *)_alloca(length * sizeof(TCHAR));
+ wchar_t *text = (wchar_t *)_alloca(length * sizeof(wchar_t));
mir_sntprintf(text, length, L"%s [%s: %s]", curText, TranslateT("Account"), m_proto_interface->m_tszUserName);
SetWindowText(m_hwnd, text);
}
diff --git a/src/mir_app/src/proto_utils.cpp b/src/mir_app/src/proto_utils.cpp
index 3274381078..24af3b02c1 100644
--- a/src/mir_app/src/proto_utils.cpp
+++ b/src/mir_app/src/proto_utils.cpp
@@ -172,12 +172,12 @@ MIR_APP_DLL(LPCTSTR) ProtoGetAvatarExtension(int format)
return L"";
}
-MIR_APP_DLL(int) ProtoGetAvatarFormat(const TCHAR *ptszFileName)
+MIR_APP_DLL(int) ProtoGetAvatarFormat(const wchar_t *ptszFileName)
{
if (ptszFileName == NULL)
return PA_FORMAT_UNKNOWN;
- const TCHAR *ptszExt = _tcsrchr(ptszFileName, '.');
+ const wchar_t *ptszExt = wcsrchr(ptszFileName, '.');
if (ptszExt == NULL)
return PA_FORMAT_UNKNOWN;
@@ -205,7 +205,7 @@ MIR_APP_DLL(int) ProtoGetAvatarFormat(const TCHAR *ptszFileName)
return PA_FORMAT_UNKNOWN;
}
-MIR_APP_DLL(int) ProtoGetBufferFormat(const void *pBuffer, const TCHAR **ptszExtension)
+MIR_APP_DLL(int) ProtoGetBufferFormat(const void *pBuffer, const wchar_t **ptszExtension)
{
if (!memcmp(pBuffer, "\x89PNG", 4)) {
if (ptszExtension) *ptszExtension = L".png";
@@ -236,7 +236,7 @@ MIR_APP_DLL(int) ProtoGetBufferFormat(const void *pBuffer, const TCHAR **ptszExt
return PA_FORMAT_UNKNOWN;
}
-MIR_APP_DLL(int) ProtoGetAvatarFileFormat(const TCHAR *ptszFileName)
+MIR_APP_DLL(int) ProtoGetAvatarFileFormat(const wchar_t *ptszFileName)
{
HANDLE hFile = CreateFile(ptszFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
@@ -268,7 +268,7 @@ int PROTO_INTERFACE::Authorize(MEVENT)
return 1; // error
}
-int PROTO_INTERFACE::AuthDeny(MEVENT, const TCHAR*)
+int PROTO_INTERFACE::AuthDeny(MEVENT, const wchar_t*)
{
return 1; // error
}
@@ -278,12 +278,12 @@ int PROTO_INTERFACE::AuthRecv(MCONTACT, PROTORECVEVENT*)
return 1; // error
}
-int PROTO_INTERFACE::AuthRequest(MCONTACT, const TCHAR*)
+int PROTO_INTERFACE::AuthRequest(MCONTACT, const wchar_t*)
{
return 1; // error
}
-HANDLE PROTO_INTERFACE::FileAllow(MCONTACT, HANDLE, const TCHAR*)
+HANDLE PROTO_INTERFACE::FileAllow(MCONTACT, HANDLE, const wchar_t*)
{
return NULL; // error
}
@@ -293,12 +293,12 @@ int PROTO_INTERFACE::FileCancel(MCONTACT, HANDLE)
return 1; // error
}
-int PROTO_INTERFACE::FileDeny(MCONTACT, HANDLE, const TCHAR*)
+int PROTO_INTERFACE::FileDeny(MCONTACT, HANDLE, const wchar_t*)
{
return 1; // error
}
-int PROTO_INTERFACE::FileResume(HANDLE, int*, const TCHAR**)
+int PROTO_INTERFACE::FileResume(HANDLE, int*, const wchar_t**)
{
return 1; // error
}
@@ -313,17 +313,17 @@ int PROTO_INTERFACE::GetInfo(MCONTACT, int)
return 1; // error
}
-HANDLE PROTO_INTERFACE::SearchBasic(const TCHAR*)
+HANDLE PROTO_INTERFACE::SearchBasic(const wchar_t*)
{
return NULL; // error
}
-HANDLE PROTO_INTERFACE::SearchByEmail(const TCHAR*)
+HANDLE PROTO_INTERFACE::SearchByEmail(const wchar_t*)
{
return NULL; // error
}
-HANDLE PROTO_INTERFACE::SearchByName(const TCHAR*, const TCHAR*, const TCHAR*)
+HANDLE PROTO_INTERFACE::SearchByName(const wchar_t*, const wchar_t*, const wchar_t*)
{
return NULL; // error
}
@@ -364,7 +364,7 @@ int PROTO_INTERFACE::SendContacts(MCONTACT, int, int, MCONTACT*)
return 1; // error
}
-HANDLE PROTO_INTERFACE::SendFile(MCONTACT, const TCHAR*, TCHAR**)
+HANDLE PROTO_INTERFACE::SendFile(MCONTACT, const wchar_t*, wchar_t**)
{
return NULL; // error
}
@@ -399,7 +399,7 @@ int PROTO_INTERFACE::RecvAwayMsg(MCONTACT, int, PROTORECVEVENT*)
return 1; // error
}
-int PROTO_INTERFACE::SetAwayMsg(int, const TCHAR*)
+int PROTO_INTERFACE::SetAwayMsg(int, const wchar_t*)
{
return 1; // error
}
diff --git a/src/mir_app/src/protocols.cpp b/src/mir_app/src/protocols.cpp
index d162d38878..e06034833e 100644
--- a/src/mir_app/src/protocols.cpp
+++ b/src/mir_app/src/protocols.cpp
@@ -93,9 +93,9 @@ LIST<PROTOCOLDESCRIPTOR> filters(10, CompareProtos);
//------------------------------------------------------------------------------------
-void FreeFilesMatrix(TCHAR ***files);
+void FreeFilesMatrix(wchar_t ***files);
-static PROTO_INTERFACE* defInitProto(const char* szModule, const TCHAR*)
+static PROTO_INTERFACE* defInitProto(const char* szModule, const wchar_t*)
{
return AddDefaultAccount(szModule);
}
@@ -244,7 +244,7 @@ static INT_PTR Proto_ContactIsTyping(WPARAM wParam, LPARAM lParam)
void Proto_SetStatus(const char *szProto, unsigned status)
{
if (CallProtoServiceInt(NULL, szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) {
- ptrT tszAwayMsg((TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGT, status, (LPARAM)szProto));
+ ptrT tszAwayMsg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, status, (LPARAM)szProto));
CallProtoServiceInt(NULL, szProto, PS_SETAWAYMSG, status, tszAwayMsg);
}
CallProtoServiceInt(NULL, szProto, PS_SETSTATUS, status, 0);
@@ -382,22 +382,22 @@ INT_PTR CallProtoServiceInt(MCONTACT hContact, const char *szModule, const char
case 1: return (INT_PTR)ppi->AddToList(wParam, (PROTOSEARCHRESULT*)lParam);
case 2: return (INT_PTR)ppi->AddToListByEvent(LOWORD(wParam), HIWORD(wParam), (MEVENT)lParam);
case 3: return (INT_PTR)ppi->Authorize((MEVENT)wParam);
- case 4: return (INT_PTR)ppi->AuthDeny((MEVENT)wParam, (TCHAR*)lParam);
+ case 4: return (INT_PTR)ppi->AuthDeny((MEVENT)wParam, (wchar_t*)lParam);
case 5: return (INT_PTR)ppi->AuthRecv(hContact, (PROTORECVEVENT*)lParam);
- case 6: return (INT_PTR)ppi->AuthRequest(hContact, (TCHAR*)lParam);
- case 8: return (INT_PTR)ppi->FileAllow(hContact, (HANDLE)wParam, (TCHAR*)lParam);
+ case 6: return (INT_PTR)ppi->AuthRequest(hContact, (wchar_t*)lParam);
+ case 8: return (INT_PTR)ppi->FileAllow(hContact, (HANDLE)wParam, (wchar_t*)lParam);
case 9: return (INT_PTR)ppi->FileCancel(hContact, (HANDLE)wParam);
- case 10: return (INT_PTR)ppi->FileDeny(hContact, (HANDLE)wParam, (TCHAR*)lParam);
+ case 10: return (INT_PTR)ppi->FileDeny(hContact, (HANDLE)wParam, (wchar_t*)lParam);
case 11: {
PROTOFILERESUME *pfr = (PROTOFILERESUME*)lParam;
- return (INT_PTR)ppi->FileResume((HANDLE)wParam, &pfr->action, (const TCHAR**)&pfr->szFilename);
+ return (INT_PTR)ppi->FileResume((HANDLE)wParam, &pfr->action, (const wchar_t**)&pfr->szFilename);
}
case 12: return (INT_PTR)ppi->GetCaps(wParam, lParam);
case 13: return (INT_PTR)Proto_GetIcon(ppi, wParam);
case 14: return (INT_PTR)ppi->GetInfo(hContact, wParam);
- case 15: return (INT_PTR)ppi->SearchBasic((TCHAR*)lParam);
- case 16: return (INT_PTR)ppi->SearchByEmail((TCHAR*)lParam);
+ case 15: return (INT_PTR)ppi->SearchBasic((wchar_t*)lParam);
+ case 16: return (INT_PTR)ppi->SearchByEmail((wchar_t*)lParam);
case 17: {
PROTOSEARCHBYNAME* psbn = (PROTOSEARCHBYNAME*)lParam;
return (INT_PTR)ppi->SearchByName(psbn->pszNick, psbn->pszFirstName, psbn->pszLastName);
@@ -409,14 +409,14 @@ INT_PTR CallProtoServiceInt(MCONTACT hContact, const char *szModule, const char
case 22: return (INT_PTR)ppi->RecvMsg(hContact, (PROTORECVEVENT*)lParam);
case 23: return (INT_PTR)ppi->RecvUrl(hContact, (PROTORECVEVENT*)lParam);
case 24: return (INT_PTR)ppi->SendContacts(hContact, LOWORD(wParam), HIWORD(wParam), (MCONTACT*)lParam);
- case 25: return (INT_PTR)ppi->SendFile(hContact, (TCHAR*)wParam, (TCHAR**)lParam);
+ case 25: return (INT_PTR)ppi->SendFile(hContact, (wchar_t*)wParam, (wchar_t**)lParam);
case 26: return (INT_PTR)ppi->SendMsg(hContact, wParam, (const char*)lParam);
case 27: return (INT_PTR)ppi->SendUrl(hContact, wParam, (const char*)lParam);
case 28: return (INT_PTR)ppi->SetApparentMode(hContact, wParam);
case 29: return (INT_PTR)ppi->SetStatus(wParam);
case 30: return (INT_PTR)ppi->GetAwayMsg(hContact);
case 31: return (INT_PTR)ppi->RecvAwayMsg(hContact, wParam, (PROTORECVEVENT*)lParam);
- case 33: return (INT_PTR)ppi->SetAwayMsg(wParam, (TCHAR*)lParam);
+ case 33: return (INT_PTR)ppi->SetAwayMsg(wParam, (wchar_t*)lParam);
case 34: return (INT_PTR)ppi->UserIsTyping(wParam, lParam);
case 35: mir_strncpy((char*)lParam, ppi->m_szModuleName, wParam); return 0;
case 36:
diff --git a/src/mir_app/src/searchresults.cpp b/src/mir_app/src/searchresults.cpp
index 3aa2455e7a..8db9de005d 100644
--- a/src/mir_app/src/searchresults.cpp
+++ b/src/mir_app/src/searchresults.cpp
@@ -54,7 +54,7 @@ void SaveColumnSizes(HWND hwndResults)
db_set_b(NULL, "FindAdd", "SortAscending", (BYTE)dat->bSortAscending);
}
-static const TCHAR *szColumnNames[] = { NULL, NULL, L"Nick", L"First Name", L"Last Name", L"E-mail" };
+static const wchar_t *szColumnNames[] = { NULL, NULL, L"Nick", L"First Name", L"Last Name", L"E-mail" };
static int defaultColumnSizes[] = { 0, 90, 100, 100, 100, 2000 };
void LoadColumnSizes(HWND hwndResults, const char *szProto)
{
@@ -139,19 +139,19 @@ int CALLBACK SearchResultsCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lPa
case COLUMNID_PROTO:
return mir_strcmp(lsr1->szProto, lsr2->szProto)*sortMultiplier;
case COLUMNID_HANDLE:
- return mir_tstrcmpi(lsr1->psr.id.t, lsr2->psr.id.t)*sortMultiplier;
+ return mir_tstrcmpi(lsr1->psr.id.w, lsr2->psr.id.w)*sortMultiplier;
case COLUMNID_NICK:
- return mir_tstrcmpi(lsr1->psr.nick.t, lsr2->psr.nick.t)*sortMultiplier;
+ return mir_tstrcmpi(lsr1->psr.nick.w, lsr2->psr.nick.w)*sortMultiplier;
case COLUMNID_FIRST:
- return mir_tstrcmpi(lsr1->psr.firstName.t, lsr2->psr.firstName.t)*sortMultiplier;
+ return mir_tstrcmpi(lsr1->psr.firstName.w, lsr2->psr.firstName.w)*sortMultiplier;
case COLUMNID_LAST:
- return mir_tstrcmpi(lsr1->psr.lastName.t, lsr2->psr.lastName.t)*sortMultiplier;
+ return mir_tstrcmpi(lsr1->psr.lastName.w, lsr2->psr.lastName.w)*sortMultiplier;
case COLUMNID_EMAIL:
- return mir_tstrcmpi(lsr1->psr.email.t, lsr2->psr.email.t)*sortMultiplier;
+ return mir_tstrcmpi(lsr1->psr.email.w, lsr2->psr.email.w)*sortMultiplier;
}
}
else {
- TCHAR szText1[100], szText2[100];
+ wchar_t szText1[100], szText2[100];
ListView_GetItemText(hList, (int)lParam1, sortCol, szText1, _countof(szText1));
ListView_GetItemText(hList, (int)lParam2, sortCol, szText2, _countof(szText2));
return mir_tstrcmpi(szText1, szText2)*sortMultiplier;
@@ -167,11 +167,11 @@ void FreeSearchResults(HWND hwndResults)
ListView_GetItem(hwndResults, &lvi);
ListSearchResult *lsr = (ListSearchResult*)lvi.lParam;
if (lsr == NULL) continue;
- mir_free(lsr->psr.id.t);
- mir_free(lsr->psr.email.t);
- mir_free(lsr->psr.nick.t);
- mir_free(lsr->psr.firstName.t);
- mir_free(lsr->psr.lastName.t);
+ mir_free(lsr->psr.id.w);
+ mir_free(lsr->psr.email.w);
+ mir_free(lsr->psr.nick.w);
+ mir_free(lsr->psr.firstName.w);
+ mir_free(lsr->psr.lastName.w);
mir_free(lsr);
}
ListView_DeleteAllItems(hwndResults);
@@ -181,9 +181,9 @@ void FreeSearchResults(HWND hwndResults)
// on its own thread
static void BeginSearchFailed(void *arg)
{
- TCHAR buf[128];
+ wchar_t buf[128];
if (arg != NULL) {
- const TCHAR *protoName = (TCHAR*)arg;
+ const wchar_t *protoName = (wchar_t*)arg;
mir_sntprintf(buf,
TranslateT("Could not start a search on '%s', there was a problem - is %s connected?"),
protoName, protoName);
diff --git a/src/mir_app/src/services.cpp b/src/mir_app/src/services.cpp
index 08eaadbbff..4453ce3c83 100644
--- a/src/mir_app/src/services.cpp
+++ b/src/mir_app/src/services.cpp
@@ -144,7 +144,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT *lf, COLORR
int retval = 0;
ptrT tszGroup(db_get_tsa(NULL, settings_group, idstr));
if (tszGroup != NULL)
- _tcsncpy_s(lf->lfFaceName, tszGroup, _TRUNCATE);
+ wcsncpy_s(lf->lfFaceName, tszGroup, _TRUNCATE);
else
retval = 1;
@@ -200,7 +200,7 @@ int CreateFromFontSettings(FontSettingsT *fs, LOGFONT *lf)
{
GetDefaultFontSetting(lf, 0);
- _tcsncpy_s(lf->lfFaceName, fs->szFace, _TRUNCATE);
+ wcsncpy_s(lf->lfFaceName, fs->szFace, _TRUNCATE);
lf->lfWidth = lf->lfEscapement = lf->lfOrientation = 0;
lf->lfWeight = fs->style & DBFONTF_BOLD ? FW_BOLD : FW_NORMAL;
@@ -232,7 +232,7 @@ void UpdateFontSettings(FontIDW *font_id, FontSettingsT *fontsettings)
fontsettings->size = (char)lf.lfHeight;
fontsettings->charset = lf.lfCharSet;
fontsettings->colour = colour;
- _tcsncpy_s(fontsettings->szFace, lf.lfFaceName, _TRUNCATE);
+ wcsncpy_s(fontsettings->szFace, lf.lfFaceName, _TRUNCATE);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -292,7 +292,7 @@ static INT_PTR sttGetFontWorker(FontIDW *font_id, LOGFONT *lf)
for (int i = 0; i < font_id_list.getCount(); i++) {
FontInternal& F = font_id_list[i];
- if (!_tcsncmp(F.name, font_id->name, _countof(F.name)) && !_tcsncmp(F.group, font_id->group, _countof(F.group))) {
+ if (!wcsncmp(F.name, font_id->name, _countof(F.name)) && !wcsncmp(F.group, font_id->group, _countof(F.group))) {
if (GetFontSettingFromDB(F.dbSettingsGroup, F.prefix, lf, &colour, F.flags) && (F.flags & FIDF_DEFAULTVALID)) {
CreateFromFontSettings(&F.deffontsettings, lf);
colour = F.deffontsettings.colour;
@@ -477,7 +477,7 @@ static INT_PTR sttGetEffectWorker(EffectIDW *effect_id, FONTEFFECT *effect)
{
for (int i = 0; i < effect_id_list.getCount(); i++) {
EffectInternal& E = effect_id_list[i];
- if (!_tcsncmp(E.name, effect_id->name, _countof(E.name)) && !_tcsncmp(E.group, effect_id->group, _countof(E.group))) {
+ if (!wcsncmp(E.name, effect_id->name, _countof(E.name)) && !wcsncmp(E.group, effect_id->group, _countof(E.group))) {
FONTEFFECT temp;
UpdateEffectSettings(effect_id, &temp);
diff --git a/src/mir_app/src/skin.h b/src/mir_app/src/skin.h
index 7ce5fbdc36..121169f8c3 100644
--- a/src/mir_app/src/skin.h
+++ b/src/mir_app/src/skin.h
@@ -38,7 +38,7 @@ struct THotkeyItem
{
THotkeyType type;
char *pszService, *pszName; // pszName is valid _only_ for "root" hotkeys
- TCHAR *ptszSection, *ptszDescription;
+ wchar_t *ptszSection, *ptszDescription;
LPARAM lParam;
WORD DefHotkey, Hotkey;
bool Enabled;
@@ -56,8 +56,8 @@ struct THotkeyItem
bool UnregisterHotkey; // valid only during WM_APP message in options UI, used to remove unregistered hotkeys from options
- __inline TCHAR* getSection() const { return TranslateTH(hLangpack, ptszSection); }
- __inline TCHAR* getDescr() const { return TranslateTH(hLangpack, ptszDescription); }
+ __inline wchar_t* getSection() const { return TranslateTH(hLangpack, ptszSection); }
+ __inline wchar_t* getDescr() const { return TranslateTH(hLangpack, ptszDescription); }
};
extern LIST<THotkeyItem> hotkeys;
diff --git a/src/mir_app/src/skin2opts.cpp b/src/mir_app/src/skin2opts.cpp
index b8563f05ec..feb5795b0d 100644
--- a/src/mir_app/src/skin2opts.cpp
+++ b/src/mir_app/src/skin2opts.cpp
@@ -39,10 +39,10 @@ struct IcoLibOptsData
/////////////////////////////////////////////////////////////////////////////////////////
-static HICON ExtractIconFromPath(const TCHAR *path, int cxIcon, int cyIcon)
+static HICON ExtractIconFromPath(const wchar_t *path, int cxIcon, int cyIcon)
{
- TCHAR *comma;
- TCHAR file[MAX_PATH], fileFull[MAX_PATH];
+ wchar_t *comma;
+ wchar_t file[MAX_PATH], fileFull[MAX_PATH];
int n;
HICON hIcon;
@@ -50,11 +50,11 @@ static HICON ExtractIconFromPath(const TCHAR *path, int cxIcon, int cyIcon)
return (HICON)NULL;
mir_tstrncpy(file, path, _countof(file));
- comma = _tcsrchr(file, ',');
+ comma = wcsrchr(file, ',');
if (!comma)
n = 0;
else {
- n = _ttoi(comma + 1);
+ n = _wtoi(comma + 1);
*comma = 0;
}
PathToAbsoluteT(file, fileFull);
@@ -110,14 +110,14 @@ HICON IconItem_GetIcon_Preview(IcolibItem* item)
/////////////////////////////////////////////////////////////////////////////////////////
// IcoLib GUI service routines
-static void __fastcall MySetCursor(TCHAR* nCursor)
+static void __fastcall MySetCursor(wchar_t* nCursor)
{
SetCursor(LoadCursor(NULL, nCursor));
}
-static void LoadSectionIcons(TCHAR *filename, SectionItem* sectionActive)
+static void LoadSectionIcons(wchar_t *filename, SectionItem* sectionActive)
{
- TCHAR path[MAX_PATH];
+ wchar_t path[MAX_PATH];
mir_sntprintf(path, L"%s,", filename);
size_t suffIndx = mir_tstrlen(path);
@@ -127,7 +127,7 @@ static void LoadSectionIcons(TCHAR *filename, SectionItem* sectionActive)
IcolibItem *item = iconList[indx];
if (item->default_file && item->section == sectionActive) {
- _itot(item->default_indx, path + suffIndx, 10);
+ _itow(item->default_indx, path + suffIndx, 10);
HICON hIcon = ExtractIconFromPath(path, item->cx, item->cy);
if (!hIcon)
continue;
@@ -142,7 +142,7 @@ static void LoadSectionIcons(TCHAR *filename, SectionItem* sectionActive)
}
}
-void LoadSubIcons(HWND htv, TCHAR *filename, HTREEITEM hItem)
+void LoadSubIcons(HWND htv, wchar_t *filename, HTREEITEM hItem)
{
TVITEM tvi;
tvi.mask = TVIF_HANDLE | TVIF_PARAM;
@@ -220,10 +220,10 @@ static int OpenPopupMenu(HWND hwndDlg)
return cmd;
}
-static TCHAR* OpenFileDlg(HWND hParent, const TCHAR* szFile, BOOL bAll)
+static wchar_t* OpenFileDlg(HWND hParent, const wchar_t* szFile, BOOL bAll)
{
OPENFILENAME ofn = { 0 };
- TCHAR filter[512], *pfilter, file[MAX_PATH * 2];
+ wchar_t filter[512], *pfilter, file[MAX_PATH * 2];
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hParent;
@@ -302,10 +302,10 @@ void DoIconsChanged(HWND hwndDlg)
}
}
-static HTREEITEM FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TCHAR *name)
+static HTREEITEM FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const wchar_t *name)
{
TVITEM tvi = { 0 };
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
if (hItem)
tvi.hItem = TreeView_GetChild(hwndTree, hItem);
@@ -397,7 +397,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
HIMAGELIST hIml = ListView_GetImageList(hPreview, LVSIL_NORMAL);
ImageList_RemoveAll(hIml);
- TCHAR filename[MAX_PATH], caption[64];
+ wchar_t filename[MAX_PATH], caption[64];
GetDlgItemText(hwndDlg, IDC_ICONSET, filename, _countof(filename));
{
RECT rcPreview, rcGroup;
@@ -407,7 +407,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
//SetWindowPos(hPreview, 0, 0, 0, rcPreview.right-rcPreview.left, rcGroup.bottom-rcPreview.top, SWP_NOZORDER|SWP_NOMOVE);
}
- if (_taccess(filename, 0) != 0) {
+ if (_waccess(filename, 0) != 0) {
MySetCursor(IDC_ARROW);
break;
}
@@ -437,7 +437,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
switch (LOWORD(wParam)) {
case IDC_BROWSE:
{
- TCHAR str[MAX_PATH], *file;
+ wchar_t str[MAX_PATH], *file;
GetDlgItemText(hwndDlg, IDC_ICONSET, str, _countof(str));
if (!(file = OpenFileDlg(GetParent(hwndDlg), str, TRUE)))
break;
@@ -512,7 +512,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
ImageList_EndDrag();
dragging = 0;
if (dropHiLite != -1) {
- TCHAR path[MAX_PATH], fullPath[MAX_PATH], filename[MAX_PATH];
+ wchar_t path[MAX_PATH], fullPath[MAX_PATH], filename[MAX_PATH];
LVITEM lvi;
GetDlgItemText(hwndDlg, IDC_ICONSET, fullPath, _countof(fullPath));
@@ -655,7 +655,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
{
HWND hwndTree = GetDlgItem(hwndDlg, IDC_CATEGORYLIST);
int indx;
- TCHAR itemName[1024];
+ wchar_t itemName[1024];
HTREEITEM hSection;
if (!hwndTree) break;
@@ -664,7 +664,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
TreeView_DeleteAllItems(hwndTree);
for (indx = 0; indx < sectionList.getCount(); indx++) {
- TCHAR* sectionName;
+ wchar_t* sectionName;
int sectionLevel = 0;
hSection = NULL;
@@ -673,10 +673,10 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
while (sectionName) {
// allow multi-level tree
- TCHAR* pItemName = sectionName;
+ wchar_t* pItemName = sectionName;
HTREEITEM hItem;
- if (sectionName = _tcschr(sectionName, '/')) {
+ if (sectionName = wcschr(sectionName, '/')) {
// one level deeper
*sectionName = 0;
}
@@ -809,7 +809,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
IcolibItem *item = iconList[lvi.lParam];
SafeDestroyIcon(item->temp_icon);
- TCHAR *path = (TCHAR*)lParam;
+ wchar_t *path = (wchar_t*)lParam;
replaceStrT(item->temp_file, path);
item->temp_icon = (HICON)ExtractIconFromPath(path, item->cx, item->cy);
item->temp_reset = FALSE;
@@ -828,12 +828,12 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
break;
}
else if (LOWORD(wParam) == IDC_LOADICONS) {
- TCHAR filetmp[1] = { 0 };
- TCHAR *file;
+ wchar_t filetmp[1] = { 0 };
+ wchar_t *file;
if (file = OpenFileDlg(hwndDlg, filetmp, FALSE)) {
HWND htv = GetDlgItem(hwndDlg, IDC_CATEGORYLIST);
- TCHAR filename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
PathToRelativeT(file, filename);
mir_free(file);
@@ -932,7 +932,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
if (lvi.lParam < iconList.getCount()) {
IcolibItem *item = iconList[lvi.lParam];
if (item->temp_file)
- _tcsncpy_s(pInfoTip->pszText, pInfoTip->cchTextMax, item->temp_file, _TRUNCATE);
+ wcsncpy_s(pInfoTip->pszText, pInfoTip->cchTextMax, item->temp_file, _TRUNCATE);
else if (item->default_file)
mir_sntprintf(pInfoTip->pszText, pInfoTip->cchTextMax, L"%s, %d", item->default_file->file, item->default_indx);
}
diff --git a/src/mir_app/src/skinicons.cpp b/src/mir_app/src/skinicons.cpp
index 858ccabc22..e50dba78e5 100644
--- a/src/mir_app/src/skinicons.cpp
+++ b/src/mir_app/src/skinicons.cpp
@@ -129,7 +129,7 @@ static HICON LoadSmallIconShared(HINSTANCE hInstance, LPCTSTR lpIconName)
// load small icon (not shared) it IS NEED to be destroyed
static HICON LoadSmallIcon(HINSTANCE hInstance, LPCTSTR lpIconName)
{
- TCHAR filename[MAX_PATH];
+ wchar_t filename[MAX_PATH];
if (GetModuleFileName(hInstance, filename, MAX_PATH) == 0)
return NULL;
@@ -273,35 +273,35 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big)
if (hIcon == NULL && (caps2 == 0 || (caps2 & statusIcons[statusIndx].pf2))) {
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (pa) {
- TCHAR szPath[MAX_PATH], szFullPath[MAX_PATH], *str;
+ wchar_t szPath[MAX_PATH], szFullPath[MAX_PATH], *str;
GetModuleFileName(NULL, szPath, _countof(szPath));
// Queried protocol isn't in list, adding
- TCHAR tszSection[MAX_PATH];
+ wchar_t tszSection[MAX_PATH];
mir_sntprintf(tszSection, _T(PROTOCOLS_PREFIX)L"/%s", pa->tszAccountName);
SKINICONDESC sid = { 0 };
- sid.section.t = tszSection;
+ sid.section.w = tszSection;
sid.flags = SIDF_ALL_TCHAR;
- str = _tcsrchr(szPath, '\\');
+ str = wcsrchr(szPath, '\\');
if (str != NULL)
*str = 0;
mir_sntprintf(szFullPath, L"%s\\Icons\\proto_%S.dll", szPath, pa->szProtoName);
if (GetFileAttributes(szFullPath) != INVALID_FILE_ATTRIBUTES)
- sid.defaultFile.t = szFullPath;
+ sid.defaultFile.w = szFullPath;
else {
mir_sntprintf(szFullPath, L"%s\\Plugins\\%S.dll", szPath, szProto);
if (int(ExtractIconEx(szFullPath, statusIcons[statusIndx].resource_id, NULL, &hIcon, 1)) > 0) {
DestroyIcon(hIcon);
- sid.defaultFile.t = szFullPath;
+ sid.defaultFile.w = szFullPath;
hIcon = NULL;
}
if (sid.defaultFile.a == NULL) {
if (str != NULL)
*str = '\\';
- sid.defaultFile.t = szPath;
+ sid.defaultFile.w = szPath;
}
}
@@ -317,7 +317,7 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big)
// format: core_%s%d
mir_snprintf(iconName, "%s%s%d", statusIconsFmt, szProto, i);
sid.pszName = iconName;
- sid.description.t = cli.pfnGetStatusModeDescription(statusIcons[i].id, 0);
+ sid.description.w = cli.pfnGetStatusModeDescription(statusIcons[i].id, 0);
sid.iDefaultIndex = statusIcons[i].resource_id;
IcoLib_AddIcon(&sid, 0);
}
@@ -379,12 +379,12 @@ MIR_APP_DLL(HICON) Skin_LoadIcon(int idx, bool big)
int LoadSkinIcons(void)
{
- TCHAR modulePath[MAX_PATH];
+ wchar_t modulePath[MAX_PATH];
GetModuleFileName(g_hInst, modulePath, _countof(modulePath));
char iconName[MAX_PATH];
SKINICONDESC sid = { 0 };
- sid.defaultFile.t = modulePath;
+ sid.defaultFile.w = modulePath;
sid.flags = SIDF_PATH_TCHAR;
sid.pszName = iconName;
diff --git a/src/mir_app/src/sounds.cpp b/src/mir_app/src/sounds.cpp
index abda0e43fd..acdf34d5b9 100644
--- a/src/mir_app/src/sounds.cpp
+++ b/src/mir_app/src/sounds.cpp
@@ -29,13 +29,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct SoundItem
{
char* name;
- TCHAR* ptszSection;
- TCHAR* ptszDescription;
- TCHAR* ptszTempFile;
+ wchar_t* ptszSection;
+ wchar_t* ptszDescription;
+ wchar_t* ptszTempFile;
int hLangpack;
- __inline TCHAR* getSection() const { return TranslateTH(hLangpack, ptszSection); }
- __inline TCHAR* getDescr() const { return TranslateTH(hLangpack, ptszDescription); }
+ __inline wchar_t* getSection() const { return TranslateTH(hLangpack, ptszSection); }
+ __inline wchar_t* getDescr() const { return TranslateTH(hLangpack, ptszDescription); }
__inline void clear(void)
{
@@ -83,7 +83,7 @@ static INT_PTR ServiceSkinAddNewSound(WPARAM wParam, LPARAM lParam)
item->hLangpack = (int)wParam;
arSounds.insert(item);
- TCHAR* ptszDefaultFile;
+ wchar_t* ptszDefaultFile;
if (ssd->dwFlags & SSDF_UNICODE) {
item->ptszDescription = mir_tstrdup(ssd->ptszDescription);
item->ptszSection = mir_tstrdup((ssd->pszSection != NULL) ? ssd->ptszSection : L"Other");
@@ -109,7 +109,7 @@ static INT_PTR ServiceSkinAddNewSound(WPARAM wParam, LPARAM lParam)
static int SkinPlaySoundDefault(WPARAM wParam, LPARAM lParam)
{
- TCHAR* pszFile = (TCHAR*) lParam;
+ wchar_t* pszFile = (wchar_t*) lParam;
if (pszFile && (db_get_b(NULL, "Skin", "UseSound", 0) || (int)wParam == 1))
PlaySound(pszFile, NULL, SND_ASYNC | SND_FILENAME | SND_NOSTOP);
@@ -118,11 +118,11 @@ static int SkinPlaySoundDefault(WPARAM wParam, LPARAM lParam)
static INT_PTR ServiceSkinPlaySoundFile(WPARAM, LPARAM lParam)
{
- TCHAR *ptszFileName = (TCHAR*)lParam;
+ wchar_t *ptszFileName = (wchar_t*)lParam;
if (ptszFileName == NULL)
return 1;
- TCHAR tszFull[MAX_PATH];
+ wchar_t tszFull[MAX_PATH];
PathToAbsoluteT(ptszFileName, tszFull);
NotifyEventHooks(hPlayEvent, 0, (LPARAM)tszFull);
return 0;
@@ -266,7 +266,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
else {
DBVARIANT dbv;
if (!db_get_ts(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
- TCHAR szPathFull[MAX_PATH];
+ wchar_t szPathFull[MAX_PATH];
PathToAbsoluteT(dbv.ptszVal, szPathFull);
NotifyEventHooks(hPlayEvent, 1, (LPARAM)szPathFull);
db_free(&dbv);
@@ -290,9 +290,9 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
SoundItem& snd = arSounds[tvi.lParam];
- TCHAR str[MAX_PATH], strFull[MAX_PATH], strdir[MAX_PATH], filter[MAX_PATH];
+ wchar_t str[MAX_PATH], strFull[MAX_PATH], strdir[MAX_PATH], filter[MAX_PATH];
if (snd.ptszTempFile)
- _tcsncpy_s(strFull, snd.ptszTempFile, _TRUNCATE);
+ wcsncpy_s(strFull, snd.ptszTempFile, _TRUNCATE);
else {
if (db_get_b(NULL, "SkinSoundsOff", snd.name, 0) == 0) {
DBVARIANT dbv;
@@ -301,7 +301,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
db_free(&dbv);
} } }
- _tcsncpy_s(strFull, (snd.ptszTempFile ? snd.ptszTempFile : L""), _TRUNCATE);
+ wcsncpy_s(strFull, (snd.ptszTempFile ? snd.ptszTempFile : L""), _TRUNCATE);
PathToAbsoluteT(strFull, strdir);
OPENFILENAME ofn;
@@ -315,7 +315,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
ofn.hInstance = NULL;
ofn.lpstrFilter = filter;
- TCHAR* slash = _tcsrchr(strdir, '\\');
+ wchar_t* slash = wcsrchr(strdir, '\\');
if (slash) {
*slash = 0;
ofn.lpstrInitialDir = strdir;
@@ -387,7 +387,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
if (tvi.lParam == -1)
SendMessage(hwndDlg, DM_HIDEPANE, 0, 0);
else {
- TCHAR buf[256];
+ wchar_t buf[256];
mir_sntprintf(buf, L"%s: %s", arSounds[tvi.lParam].getSection(), arSounds[tvi.lParam].getDescr());
SetDlgItemText(hwndDlg, IDC_NAMEVAL, buf);
if (arSounds[tvi.lParam].ptszTempFile)
diff --git a/src/mir_app/src/srmm_statusicon.cpp b/src/mir_app/src/srmm_statusicon.cpp
index e46a071c74..eeb76f9b13 100644
--- a/src/mir_app/src/srmm_statusicon.cpp
+++ b/src/mir_app/src/srmm_statusicon.cpp
@@ -42,7 +42,7 @@ struct StatusIconChild : public MZeroedObject
MCONTACT hContact;
HICON hIcon, hIconDisabled;
int flags;
- TCHAR *tszTooltip;
+ wchar_t *tszTooltip;
};
struct StatusIconMain : public MZeroedObject
diff --git a/src/mir_app/src/xmlApi.cpp b/src/mir_app/src/xmlApi.cpp
index ffa87f4f79..df2af6656a 100644
--- a/src/mir_app/src/xmlApi.cpp
+++ b/src/mir_app/src/xmlApi.cpp
@@ -182,8 +182,8 @@ MIR_APP_DLL(void) xmlAddAttr(HXML _n, LPCTSTR attrName, LPCTSTR attrValue)
MIR_APP_DLL(void) xmlAddAttrInt(HXML _n, LPCTSTR attrName, int attrValue)
{
- TCHAR buf[40];
- _itot(attrValue, buf, 10);
+ wchar_t buf[40];
+ _itow(attrValue, buf, 10);
XMLNode(_n).addAttribute(attrName, buf);
}
diff --git a/src/mir_app/src/xmlParser.cpp b/src/mir_app/src/xmlParser.cpp
index 9e79495845..9817e0fce5 100644
--- a/src/mir_app/src/xmlParser.cpp
+++ b/src/mir_app/src/xmlParser.cpp
@@ -1100,7 +1100,7 @@ XMLNode::XMLNode(XMLNodeData *pParent, XMLSTR lpszName, char isDeclaration)
d->lpszNS = NULL;
if (lpszName && pParent && pParent->lpszName && !pParent->isDeclaration) {
- TCHAR* p = _tcschr(lpszName, ':');
+ wchar_t* p = wcschr(lpszName, ':');
if (p) {
*p = 0;
d->lpszNS = d->lpszName;
@@ -1197,7 +1197,7 @@ XMLAttribute *XMLNode::addAttribute_priv(int memoryIncrease, XMLSTR lpszName, XM
pAttr->lpszValue = lpszValuev;
d->nAttribute++;
- TCHAR* p = _tcschr(lpszName, ':');
+ wchar_t* p = wcschr(lpszName, ':');
if (p)
if (!mir_tstrcmp(p+1, d->lpszNS) || (d->pParent && !mir_tstrcmp(p+1, d->pParent->lpszNS)))
*p = 0;
@@ -1541,7 +1541,7 @@ LBL_Error:
#endif
}
else {
- const TCHAR* p = _tcschr(lpszTemp, ':');
+ const wchar_t* p = wcschr(lpszTemp, ':');
if (!p)
goto LBL_Error;
diff --git a/src/mir_app/src/xmlParser.h b/src/mir_app/src/xmlParser.h
index aa9bf91a88..6433d00191 100644
--- a/src/mir_app/src/xmlParser.h
+++ b/src/mir_app/src/xmlParser.h
@@ -121,15 +121,11 @@
#undef _XMLWIDECHAR
#endif
-#ifdef _XMLWINDOWS
-#include <tchar.h>
-#else
#define XMLDLLENTRY
#ifndef XML_NO_WIDE_CHAR
#include <wchar.h> // to have 'wcsrtombs' for ANSI version
// to have 'mbsrtowcs' for WIDECHAR version
#endif
-#endif
// Some common types for char set portable code
#ifdef _XMLWIDECHAR
diff --git a/src/mir_core/src/bitmaps.cpp b/src/mir_core/src/bitmaps.cpp
index c997a61a93..c7aab86736 100644
--- a/src/mir_core/src/bitmaps.cpp
+++ b/src/mir_core/src/bitmaps.cpp
@@ -25,11 +25,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_imgsrvc.h>
-MIR_CORE_DLL(HBITMAP) Bitmap_Load(const TCHAR *ptszFileName)
+MIR_CORE_DLL(HBITMAP) Bitmap_Load(const wchar_t *ptszFileName)
{
- TCHAR szFilename[MAX_PATH];
+ wchar_t szFilename[MAX_PATH];
if (!PathToAbsoluteT(ptszFileName, szFilename))
- _tcsncpy_s(szFilename, ptszFileName, _TRUNCATE);
+ wcsncpy_s(szFilename, ptszFileName, _TRUNCATE);
if (!ServiceExists(MS_IMG_LOAD))
return NULL;
@@ -37,7 +37,7 @@ MIR_CORE_DLL(HBITMAP) Bitmap_Load(const TCHAR *ptszFileName)
return (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)szFilename, IMGL_TCHAR);
}
-MIR_CORE_DLL(void) Bitmap_GetFilter(TCHAR *dest, size_t destLen)
+MIR_CORE_DLL(void) Bitmap_GetFilter(wchar_t *dest, size_t destLen)
{
if (dest == NULL)
return;
diff --git a/src/mir_core/src/cmdline.cpp b/src/mir_core/src/cmdline.cpp
index 4896cdf347..c90eb11767 100644
--- a/src/mir_core/src/cmdline.cpp
+++ b/src/mir_core/src/cmdline.cpp
@@ -59,8 +59,8 @@ MIR_CORE_DLL(void) CmdLine_Parse(LPTSTR ptszCmdLine)
}
else continue; // skip a text that isn't an option
- TCHAR *pOptionName = p+1;
- if ((p = _tcspbrk(pOptionName, L" \t=:")) == NULL) { // no more text in string
+ wchar_t *pOptionName = p+1;
+ if ((p = wcspbrk(pOptionName, L" \t=:")) == NULL) { // no more text in string
arParams.insert(new CmdLineParam(pOptionName, L""));
break;
}
@@ -74,14 +74,14 @@ MIR_CORE_DLL(void) CmdLine_Parse(LPTSTR ptszCmdLine)
// parameter with value
*p = 0;
arParams.insert(new CmdLineParam(pOptionName, ++p));
- if ((p = _tcspbrk(p, L" \t")) == NULL) // no more text in string
+ if ((p = wcspbrk(p, L" \t")) == NULL) // no more text in string
break;
p--; // the cycle will wipe this space automatically
}
}
-MIR_CORE_DLL(LPCTSTR) CmdLine_GetOption(const TCHAR* ptszParameter)
+MIR_CORE_DLL(LPCTSTR) CmdLine_GetOption(const wchar_t* ptszParameter)
{
CmdLineParam tmp(ptszParameter, 0);
int idx = arParams.getIndex(&tmp);
diff --git a/src/mir_core/src/hyperlink.cpp b/src/mir_core/src/hyperlink.cpp
index cf4b9475f5..8c9390f4c7 100644
--- a/src/mir_core/src/hyperlink.cpp
+++ b/src/mir_core/src/hyperlink.cpp
@@ -157,7 +157,7 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
case WM_CREATE:
case HLK_MEASURETEXT:
- TCHAR szText[256];
+ wchar_t szText[256];
if (!GetWindowText(hwnd, szText, _countof(szText))) return 0;
lParam = (LPARAM)szText;
/* fall thru */
@@ -172,7 +172,7 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
if (dat->hEnableFont != NULL) hPrevFont = (HFONT)SelectObject(hdc, dat->hEnableFont);
if (dat->hEnableFont == NULL || hPrevFont != NULL) { /* select failed? */
SIZE textSize;
- if (GetTextExtentPoint32(hdc, (TCHAR*)lParam, (int)mir_tstrlen((TCHAR*)lParam), &textSize)) {
+ if (GetTextExtentPoint32(hdc, (wchar_t*)lParam, (int)mir_tstrlen((wchar_t*)lParam), &textSize)) {
if (GetClientRect(hwnd, &rc)) {
dat->rcText.top = 0;
dat->rcText.bottom = dat->rcText.top + textSize.cy;
diff --git a/src/mir_core/src/icons.cpp b/src/mir_core/src/icons.cpp
index 4e6b613f51..9b2ee4a65c 100644
--- a/src/mir_core/src/icons.cpp
+++ b/src/mir_core/src/icons.cpp
@@ -25,11 +25,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char *szSection, IconItem *pIcons, size_t iCount, char *prefix, int _hLang)
{
- TCHAR szFile[MAX_PATH];
+ wchar_t szFile[MAX_PATH];
GetModuleFileName(hInst, szFile, MAX_PATH);
SKINICONDESC sid = { 0 };
- sid.defaultFile.t = szFile;
+ sid.defaultFile.w = szFile;
sid.section.a = (char*)szSection;
sid.flags = SIDF_PATH_TCHAR;
@@ -48,14 +48,14 @@ MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char *szSection, IconIte
}
}
-MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const TCHAR *szSection, IconItemT *pIcons, size_t iCount, char *prefix, int _hLang)
+MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const wchar_t *szSection, IconItemT *pIcons, size_t iCount, char *prefix, int _hLang)
{
- TCHAR szFile[MAX_PATH];
+ wchar_t szFile[MAX_PATH];
GetModuleFileName(hInst, szFile, MAX_PATH);
SKINICONDESC sid = { 0 };
- sid.defaultFile.t = szFile;
- sid.section.t = (TCHAR*)szSection;
+ sid.defaultFile.w = szFile;
+ sid.section.w = (wchar_t*)szSection;
sid.flags = SIDF_ALL_TCHAR;
for (unsigned i = 0; i < iCount; i++) {
@@ -67,7 +67,7 @@ MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const TCHAR *szSection, IconI
else sid.pszName = pIcons[i].szName;
sid.cx = sid.cy = pIcons[i].size;
- sid.description.t = pIcons[i].tszDescr;
+ sid.description.w = pIcons[i].tszDescr;
sid.iDefaultIndex = -pIcons[i].defIconID;
pIcons[i].hIcolib = IcoLib_AddIcon(&sid, _hLang);
}
diff --git a/src/mir_core/src/langpack.cpp b/src/mir_core/src/langpack.cpp
index 348719b1a0..757345cefe 100644
--- a/src/mir_core/src/langpack.cpp
+++ b/src/mir_core/src/langpack.cpp
@@ -49,7 +49,7 @@ struct LangPackEntry
};
static LANGPACK_INFO langPack;
-static TCHAR g_tszRoot[MAX_PATH];
+static wchar_t g_tszRoot[MAX_PATH];
static LangPackEntry *g_pEntries;
static int g_entryCount, g_entriesAlloced;
@@ -215,15 +215,15 @@ static void LoadLangPackFile(FILE *fp, char *line)
strlwr(line);
if (!memcmp(line + 1, "include", 7)) {
- TCHAR tszFileName[MAX_PATH];
- TCHAR *p = _tcsrchr(langPack.tszFullPath, '\\');
+ wchar_t tszFileName[MAX_PATH];
+ wchar_t *p = wcsrchr(langPack.tszFullPath, '\\');
if (p)
*p = 0;
mir_sntprintf(tszFileName, L"%s\\%S", langPack.tszFullPath, ltrim(line + 9));
if (p)
*p = '\\';
- FILE *fpNew = _tfopen(tszFileName, L"r");
+ FILE *fpNew = _wfopen(tszFileName, L"r");
if (fpNew) {
line[0] = 0;
fgets(line, LANGPACK_BUF_SIZE, fpNew);
@@ -364,25 +364,25 @@ static int LoadLangDescr(LANGPACK_INFO &lpinfo, FILE *fp, char *line, int &start
MultiByteToWideChar(lpinfo.codepage, 0, szLanguage, -1, lpinfo.tszLanguage, _countof(lpinfo.tszLanguage));
if (!lpinfo.tszLanguage[0] && (lpinfo.Locale == 0) || !GetLocaleInfo(lpinfo.Locale, LOCALE_SENGLANGUAGE, lpinfo.tszLanguage, _countof(lpinfo.tszLanguage))) {
- TCHAR *p = _tcschr(lpinfo.tszFileName, '_');
- _tcsncpy_s(lpinfo.tszLanguage, ((p != NULL) ? (p + 1) : lpinfo.tszFileName), _TRUNCATE);
- p = _tcsrchr(lpinfo.tszLanguage, _T('.'));
+ wchar_t *p = wcschr(lpinfo.tszFileName, '_');
+ wcsncpy_s(lpinfo.tszLanguage, ((p != NULL) ? (p + 1) : lpinfo.tszFileName), _TRUNCATE);
+ p = wcsrchr(lpinfo.tszLanguage, '.');
if (p != NULL) *p = '\0';
}
return 0;
}
-MIR_CORE_DLL(int) LoadLangPack(const TCHAR *ptszLangPack)
+MIR_CORE_DLL(int) LoadLangPack(const wchar_t *ptszLangPack)
{
if (ptszLangPack == NULL || !mir_tstrcmpi(ptszLangPack, L""))
return 1;
// ensure that a lang's name is a full file name
- TCHAR tszFullPath[MAX_PATH];
+ wchar_t tszFullPath[MAX_PATH];
if (!PathIsAbsoluteT(ptszLangPack))
mir_sntprintf(tszFullPath, L"%s\\%s", g_tszRoot, ptszLangPack);
else
- _tcsncpy_s(tszFullPath, ptszLangPack, _TRUNCATE);
+ wcsncpy_s(tszFullPath, ptszLangPack, _TRUNCATE);
// this lang is already loaded? nothing to do then
if (!mir_tstrcmp(tszFullPath, langPack.tszFullPath))
@@ -398,12 +398,12 @@ MIR_CORE_DLL(int) LoadLangPack(const TCHAR *ptszLangPack)
return 3;
// copy the full file name and extract a file name from it
- _tcsncpy_s(langPack.tszFullPath, tszFullPath, _TRUNCATE);
- TCHAR *p = _tcsrchr(langPack.tszFullPath, '\\');
- _tcsncpy_s(langPack.tszFileName, (p == NULL) ? tszFullPath : p + 1, _TRUNCATE);
+ wcsncpy_s(langPack.tszFullPath, tszFullPath, _TRUNCATE);
+ wchar_t *p = wcsrchr(langPack.tszFullPath, '\\');
+ wcsncpy_s(langPack.tszFileName, (p == NULL) ? tszFullPath : p + 1, _TRUNCATE);
CharLower(langPack.tszFileName);
- FILE *fp = _tfopen(tszFullPath, L"rt");
+ FILE *fp = _wfopen(tszFullPath, L"rt");
if (fp == NULL)
return 1;
@@ -425,17 +425,17 @@ MIR_CORE_DLL(int) LoadLangPack(const TCHAR *ptszLangPack)
return 0;
}
-MIR_CORE_DLL(int) LoadLangPackDescr(const TCHAR *ptszLangPack, LANGPACK_INFO *lpInfo)
+MIR_CORE_DLL(int) LoadLangPackDescr(const wchar_t *ptszLangPack, LANGPACK_INFO *lpInfo)
{
if (lpInfo == NULL)
return 1;
- _tcsncpy_s(lpInfo->tszFullPath, ptszLangPack, _TRUNCATE);
- TCHAR *p = _tcsrchr(lpInfo->tszFullPath, '\\');
- _tcsncpy_s(lpInfo->tszFileName, (p == NULL) ? ptszLangPack : p+1, _TRUNCATE);
+ wcsncpy_s(lpInfo->tszFullPath, ptszLangPack, _TRUNCATE);
+ wchar_t *p = wcsrchr(lpInfo->tszFullPath, '\\');
+ wcsncpy_s(lpInfo->tszFileName, (p == NULL) ? ptszLangPack : p+1, _TRUNCATE);
CharLower(lpInfo->tszFileName);
- FILE *fp = _tfopen(ptszLangPack, L"rt");
+ FILE *fp = _wfopen(ptszLangPack, L"rt");
if (fp == NULL)
return 1;
@@ -494,16 +494,16 @@ MIR_CORE_DLL(int) Langpack_GetDefaultLocale()
return (langPack.Locale == 0) ? LOCALE_USER_DEFAULT : langPack.Locale;
}
-MIR_CORE_DLL(TCHAR*) Langpack_PcharToTchar(const char *pszStr)
+MIR_CORE_DLL(wchar_t*) Langpack_PcharToTchar(const char *pszStr)
{
if (pszStr == NULL)
return NULL;
int len = (int)strlen(pszStr);
- TCHAR *result = (TCHAR*)alloca((len + 1)*sizeof(TCHAR));
+ wchar_t *result = (wchar_t*)alloca((len + 1)*sizeof(wchar_t));
MultiByteToWideChar(Langpack_GetDefaultCodePage(), 0, pszStr, -1, result, len);
result[len] = 0;
- return mir_wstrdup(TranslateW(result));
+ return mir_wstrdup(TranslateTS(result));
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -526,14 +526,14 @@ MIR_CORE_DLL(void) TranslateMenu_LP(HMENU hMenu, int _hLangpack)
mii.cbSize = sizeof(mii);
for (int i = GetMenuItemCount(hMenu) - 1; i >= 0; i--) {
- TCHAR str[256];
+ wchar_t str[256];
mii.fMask = MIIM_TYPE | MIIM_SUBMENU;
- mii.dwTypeData = (TCHAR*)str;
+ mii.dwTypeData = (wchar_t*)str;
mii.cch = _countof(str);
GetMenuItemInfo(hMenu, i, TRUE, &mii);
if (mii.cch && mii.dwTypeData) {
- TCHAR *result = (TCHAR*)LangPackTranslateString(uuid, (const char*)mii.dwTypeData, TRUE);
+ wchar_t *result = (wchar_t*)LangPackTranslateString(uuid, (const char*)mii.dwTypeData, TRUE);
if (result != mii.dwTypeData) {
mii.dwTypeData = result;
mii.fMask = MIIM_TYPE;
@@ -548,10 +548,10 @@ MIR_CORE_DLL(void) TranslateMenu_LP(HMENU hMenu, int _hLangpack)
static void TranslateWindow(MUUID *pUuid, HWND hwnd)
{
- TCHAR title[2048];
+ wchar_t title[2048];
GetWindowText(hwnd, title, _countof(title));
- TCHAR *result = (TCHAR*)LangPackTranslateString(pUuid, (const char*)title, TRUE);
+ wchar_t *result = (wchar_t*)LangPackTranslateString(pUuid, (const char*)title, TRUE);
if (result != title)
SetWindowText(hwnd, result);
}
@@ -561,7 +561,7 @@ static BOOL CALLBACK TranslateDialogEnumProc(HWND hwnd, LPARAM lParam)
int _hLangpack = (int)lParam;
MUUID *uuid = Langpack_LookupUuid(_hLangpack);
- TCHAR szClass[32];
+ wchar_t szClass[32];
GetClassName(hwnd, szClass, _countof(szClass));
if (!mir_tstrcmpi(szClass, L"static") || !mir_tstrcmpi(szClass, L"hyperlink") || !mir_tstrcmpi(szClass, L"button") || !mir_tstrcmpi(szClass, L"MButtonClass") || !mir_tstrcmpi(szClass, L"MHeaderbarCtrl"))
TranslateWindow(uuid, hwnd);
@@ -633,11 +633,11 @@ void GetDefaultLang()
{
// calculate the langpacks' root
PathToAbsoluteT(L"\\Languages", g_tszRoot);
- if (_taccess(g_tszRoot, 0) != 0) // directory Languages exists
+ if (_waccess(g_tszRoot, 0) != 0) // directory Languages exists
PathToAbsoluteT(L".", g_tszRoot);
// look into mirandaboot.ini
- TCHAR tszPath[MAX_PATH], tszLangName[256];
+ wchar_t tszPath[MAX_PATH], tszLangName[256];
PathToAbsoluteT(L"\\mirandaboot.ini", tszPath);
GetPrivateProfileString(L"Language", L"DefaultLanguage", L"", tszLangName, _countof(tszLangName), tszPath);
if (tszLangName[0]) {
@@ -653,7 +653,7 @@ void GetDefaultLang()
// try to load langpack that matches UserDefaultUILanguage
if (GetLocaleInfo(MAKELCID(GetUserDefaultUILanguage(), SORT_DEFAULT), LOCALE_SENGLANGUAGE, tszLangName, _countof(tszLangName))) {
- mir_sntprintf(tszPath, L"langpack_%s.txt", _tcslwr(tszLangName));
+ mir_sntprintf(tszPath, L"langpack_%s.txt", wcslwr(tszLangName));
if (!LoadLangPack(tszPath)) {
db_set_ts(NULL, "Langpack", "Current", tszPath);
return;
@@ -691,10 +691,10 @@ MIR_CORE_DLL(void) mir_getLP(const PLUGININFOEX *pInfo, int *_hLang)
/////////////////////////////////////////////////////////////////////////////////////////
-MIR_CORE_DLL(void) ReloadLangpack(TCHAR *pszStr)
+MIR_CORE_DLL(void) ReloadLangpack(wchar_t *pszStr)
{
if (pszStr == NULL)
- pszStr = NEWTSTR_ALLOCA(langPack.tszFileName);
+ pszStr = NEWWSTR_ALLOCA(langPack.tszFileName);
UnloadLangPackModule();
LoadLangPack(pszStr);
@@ -705,7 +705,7 @@ MIR_CORE_DLL(void) ReloadLangpack(TCHAR *pszStr)
static INT_PTR srvReloadLangpack(WPARAM, LPARAM lParam)
{
- ReloadLangpack((TCHAR*)lParam);
+ ReloadLangpack((wchar_t*)lParam);
return 0;
}
diff --git a/src/mir_core/src/logger.cpp b/src/mir_core/src/logger.cpp
index 27b9f58e18..3711d26fa6 100644
--- a/src/mir_core/src/logger.cpp
+++ b/src/mir_core/src/logger.cpp
@@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct Logger
{
- Logger(const char* pszName, const TCHAR *ptszDescr, const TCHAR *ptszFilename, unsigned options) :
+ Logger(const char* pszName, const wchar_t *ptszDescr, const wchar_t *ptszFilename, unsigned options) :
m_name(mir_strdup(pszName)),
m_descr(mir_tstrdup(ptszDescr)),
m_fileName(mir_tstrdup(ptszFilename)),
@@ -93,7 +93,7 @@ void CheckLogs()
////////////////////////////////////////////////////////////////////////////////////////////////
-MIR_CORE_DLL(HANDLE) mir_createLog(const char* pszName, const TCHAR *ptszDescr, const TCHAR *ptszFile, unsigned options)
+MIR_CORE_DLL(HANDLE) mir_createLog(const char* pszName, const wchar_t *ptszDescr, const wchar_t *ptszFile, unsigned options)
{
if (ptszFile == NULL)
return NULL;
@@ -108,10 +108,10 @@ MIR_CORE_DLL(HANDLE) mir_createLog(const char* pszName, const TCHAR *ptszDescr,
return &arLoggers[idx];
}
- FILE *fp = _tfopen(ptszFile, L"ab");
+ FILE *fp = _wfopen(ptszFile, L"ab");
if (fp == NULL) {
- TCHAR tszPath[MAX_PATH];
- _tcsncpy_s(tszPath, ptszFile, _TRUNCATE);
+ wchar_t tszPath[MAX_PATH];
+ wcsncpy_s(tszPath, ptszFile, _TRUNCATE);
CreatePathToFileT(tszPath);
}
else fclose(fp);
@@ -149,7 +149,7 @@ MIR_C_CORE_DLL(int) mir_writeLogA(HANDLE hLogger, const char *format, ...)
mir_cslock lck(p->m_cs);
if (p->m_out == NULL)
- if ((p->m_out = _tfopen(p->m_fileName, L"ab")) == NULL)
+ if ((p->m_out = _wfopen(p->m_fileName, L"ab")) == NULL)
return 2;
va_list args;
@@ -171,7 +171,7 @@ MIR_C_CORE_DLL(int) mir_writeLogW(HANDLE hLogger, const WCHAR *format, ...)
mir_cslock lck(p->m_cs);
if (p->m_out == NULL)
- if ((p->m_out = _tfopen(p->m_fileName, L"ab")) == NULL)
+ if ((p->m_out = _wfopen(p->m_fileName, L"ab")) == NULL)
return 2;
va_list args;
@@ -195,7 +195,7 @@ MIR_CORE_DLL(int) mir_writeLogVA(HANDLE hLogger, const char *format, va_list arg
mir_cslock lck(p->m_cs);
if (p->m_out == NULL)
- if ((p->m_out = _tfopen(p->m_fileName, L"ab")) == NULL)
+ if ((p->m_out = _wfopen(p->m_fileName, L"ab")) == NULL)
return 2;
vfprintf(p->m_out, format, args);
@@ -214,7 +214,7 @@ MIR_CORE_DLL(int) mir_writeLogVW(HANDLE hLogger, const WCHAR *format, va_list ar
mir_cslock lck(p->m_cs);
if (p->m_out == NULL)
- if ((p->m_out = _tfopen(p->m_fileName, L"ab")) == NULL)
+ if ((p->m_out = _wfopen(p->m_fileName, L"ab")) == NULL)
return 2;
vfwprintf(p->m_out, format, args);
diff --git a/src/mir_core/src/miranda.cpp b/src/mir_core/src/miranda.cpp
index 514aaa4306..055244596f 100644
--- a/src/mir_core/src/miranda.cpp
+++ b/src/mir_core/src/miranda.cpp
@@ -50,15 +50,15 @@ DWORD mir_tls = 0;
static INT_PTR RestartMiranda(WPARAM wParam, LPARAM lParam)
{
- TCHAR mirandaPath[MAX_PATH], cmdLine[MAX_PATH];
+ wchar_t mirandaPath[MAX_PATH], cmdLine[MAX_PATH];
if (lParam)
- _tcsncpy_s(mirandaPath, (const TCHAR*)lParam, _TRUNCATE);
+ wcsncpy_s(mirandaPath, (const wchar_t*)lParam, _TRUNCATE);
else
GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath));
if (wParam) {
VARST profilename(L"%miranda_profilename%");
- mir_sntprintf(cmdLine, L"\"%s\" /restart:%d /profile=%s", mirandaPath, GetCurrentProcessId(), (TCHAR*)profilename);
+ mir_sntprintf(cmdLine, L"\"%s\" /restart:%d /profile=%s", mirandaPath, GetCurrentProcessId(), (wchar_t*)profilename);
}
else mir_sntprintf(cmdLine, L"\"%s\" /restart:%d", mirandaPath, GetCurrentProcessId());
diff --git a/src/mir_core/src/miranda.h b/src/mir_core/src/miranda.h
index 8e03d253c6..b7fe4c7607 100644
--- a/src/mir_core/src/miranda.h
+++ b/src/mir_core/src/miranda.h
@@ -86,7 +86,7 @@ extern LIST<HINSTANCE__> pluginListAddr;
// langpack.cpp
char* LangPackTranslateString(MUUID* pUuid, const char *szEnglish, const int W);
-TCHAR* LangPackTranslateStringT(int hLangpack, const TCHAR* tszEnglish);
+wchar_t* LangPackTranslateStringT(int hLangpack, const wchar_t* tszEnglish);
/////////////////////////////////////////////////////////////////////////////////////////
// threads.cpp
diff --git a/src/mir_core/src/openurl.cpp b/src/mir_core/src/openurl.cpp
index 084bba84a7..d75baaa2a3 100644
--- a/src/mir_core/src/openurl.cpp
+++ b/src/mir_core/src/openurl.cpp
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct TOpenUrlInfo
{
- TOpenUrlInfo(TCHAR *_url, int _bNew) :
+ TOpenUrlInfo(wchar_t *_url, int _bNew) :
szUrl(_url),
newWindow(_bNew)
{}
@@ -46,10 +46,10 @@ static void OpenURLThread(void *arg)
tszUrl.Format(L"file:///%s", hUrlInfo->szUrl);
else {
int i;
- for (i = 0; _istalpha(hUrlInfo->szUrl[i]); i++);
+ for (i = 0; iswalpha(hUrlInfo->szUrl[i]); i++);
if (hUrlInfo->szUrl[i] == ':')
tszUrl = hUrlInfo->szUrl;
- else if (!_tcsnicmp(hUrlInfo->szUrl, L"ftp.", 4))
+ else if (!wcsnicmp(hUrlInfo->szUrl, L"ftp.", 4))
tszUrl.Format(L"ftp://%s", hUrlInfo->szUrl);
else
tszUrl.Format(L"http://%s", hUrlInfo->szUrl);
diff --git a/src/mir_core/src/timezones.cpp b/src/mir_core/src/timezones.cpp
index 38281b123f..c832bd2d42 100644
--- a/src/mir_core/src/timezones.cpp
+++ b/src/mir_core/src/timezones.cpp
@@ -46,7 +46,7 @@ struct MIM_TIMEZONE
unsigned hash;
int offset;
- TCHAR tszName[MIM_TZ_NAMELEN]; // windows name for the time zone
+ wchar_t tszName[MIM_TZ_NAMELEN]; // windows name for the time zone
wchar_t szDisplay[MIM_TZ_DISPLAYLEN]; // more descriptive display name (that's what usually appears in dialogs)
// every hour should be sufficient.
TIME_ZONE_INFORMATION tzi;
@@ -82,13 +82,13 @@ mir_time FileTimeToUnixTime(LPFILETIME pft)
return (mir_time)(ll / 10000000);
}
-void FormatTime(const SYSTEMTIME *st, const TCHAR *szFormat, TCHAR *szDest, size_t cbDest)
+void FormatTime(const SYSTEMTIME *st, const wchar_t *szFormat, wchar_t *szDest, size_t cbDest)
{
if (szDest == NULL || cbDest == 0) return;
CMString tszTemp;
- for (const TCHAR* pFormat = szFormat; *pFormat; ++pFormat) {
+ for (const wchar_t* pFormat = szFormat; *pFormat; ++pFormat) {
DWORD fmt = 0;
bool date = false, iso = false;
switch (*pFormat) {
@@ -126,7 +126,7 @@ void FormatTime(const SYSTEMTIME *st, const TCHAR *szFormat, TCHAR *szDest, size
continue;
}
- TCHAR dateTimeStr[64];
+ wchar_t dateTimeStr[64];
if (iso)
tszTemp.AppendFormat(L"%d-%02d-%02dT%02d:%02d:%02dZ", st->wYear, st->wMonth, st->wDay, st->wHour, st->wMinute, st->wSecond);
else if (date) {
@@ -139,7 +139,7 @@ void FormatTime(const SYSTEMTIME *st, const TCHAR *szFormat, TCHAR *szDest, size
}
}
- _tcsncpy_s(szDest, cbDest, tszTemp, _TRUNCATE);
+ wcsncpy_s(szDest, cbDest, tszTemp, _TRUNCATE);
}
MIR_CORE_DLL(int) TimeZone_GetTimeZoneTime(HANDLE hTZ, SYSTEMTIME *st)
@@ -379,7 +379,7 @@ static const ListMessages* GetListMessages(HWND hWnd, DWORD dwFlags)
return NULL;
if (!(dwFlags & (TZF_PLF_CB | TZF_PLF_LB))) {
- TCHAR tszClassName[128];
+ wchar_t tszClassName[128];
GetClassName(hWnd, tszClassName, _countof(tszClassName));
if (!mir_tstrcmpi(tszClassName, L"COMBOBOX"))
dwFlags |= TZF_PLF_CB;
@@ -475,7 +475,7 @@ MIR_CORE_DLL(DWORD) TimeZone_ToLocal(DWORD timeVal)
MIR_CORE_DLL(char*) TimeZone_ToString(mir_time timeVal, const char *szFormat, char *szDest, size_t cchDest)
{
- TCHAR *szTemp = (TCHAR*)alloca(cchDest*sizeof(TCHAR));
+ wchar_t *szTemp = (wchar_t*)alloca(cchDest*sizeof(wchar_t));
TimeZone_PrintTimeStamp(NULL, timeVal, _A2T(szFormat), szTemp, cchDest, 0);
WideCharToMultiByte(CP_ACP, 0, szTemp, -1, szDest, (int)cchDest, NULL, NULL);
return szDest;
@@ -489,11 +489,11 @@ MIR_CORE_DLL(wchar_t*) TimeZone_ToStringW(mir_time timeVal, const wchar_t *wszFo
///////////////////////////////////////////////////////////////////////////////
-void GetLocalizedString(HKEY hSubKey, const TCHAR *szName, wchar_t *szBuf, DWORD cbLen)
+void GetLocalizedString(HKEY hSubKey, const wchar_t *szName, wchar_t *szBuf, DWORD cbLen)
{
DWORD dwLength = cbLen * sizeof(wchar_t);
RegQueryValueEx(hSubKey, szName, NULL, NULL, (unsigned char *)szBuf, &dwLength);
- szBuf[min(dwLength / sizeof(TCHAR), cbLen - 1)] = 0;
+ szBuf[min(dwLength / sizeof(wchar_t), cbLen - 1)] = 0;
}
void RecalculateTime(void)
@@ -506,8 +506,8 @@ void RecalculateTime(void)
DYNAMIC_TIME_ZONE_INFORMATION dtzi;
if (pfnGetDynamicTimeZoneInformation && pfnGetDynamicTimeZoneInformation(&dtzi) != TIME_ZONE_ID_INVALID) {
- TCHAR *myTzKey = mir_u2t(dtzi.TimeZoneKeyName);
- _tcsncpy_s(myInfo.myTZ.tszName, myTzKey, _TRUNCATE);
+ wchar_t *myTzKey = mir_u2t(dtzi.TimeZoneKeyName);
+ wcsncpy_s(myInfo.myTZ.tszName, myTzKey, _TRUNCATE);
mir_free(myTzKey);
found = true;
}
@@ -519,7 +519,7 @@ void RecalculateTime(void)
if (!found) {
if (!mir_wstrcmp(tz.tzi.StandardName, myInfo.myTZ.tzi.StandardName) || !mir_wstrcmp(tz.tzi.DaylightName, myInfo.myTZ.tzi.DaylightName)) {
- _tcsncpy_s(myInfo.myTZ.tszName, tz.tszName, _TRUNCATE);
+ wcsncpy_s(myInfo.myTZ.tszName, tz.tszName, _TRUNCATE);
found = true;
}
}
@@ -531,7 +531,7 @@ void InitTimeZones(void)
REG_TZI_FORMAT tzi;
HKEY hKey;
- const TCHAR *tszKey = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones";
+ const wchar_t *tszKey = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones";
/*
* use GetDynamicTimeZoneInformation() on Vista+ - this will return a structure with
@@ -544,7 +544,7 @@ void InitTimeZones(void)
if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, tszKey, 0, KEY_ENUMERATE_SUB_KEYS, &hKey)) {
DWORD dwIndex = 0;
HKEY hSubKey;
- TCHAR tszName[MIM_TZ_NAMELEN];
+ wchar_t tszName[MIM_TZ_NAMELEN];
DWORD dwSize = _countof(tszName);
while (ERROR_NO_MORE_ITEMS != RegEnumKeyEx(hKey, dwIndex++, tszName, &dwSize, NULL, NULL, 0, NULL)) {
diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp
index 0860e797f9..03065d06d2 100644
--- a/src/mir_core/src/ui_utils.cpp
+++ b/src/mir_core/src/ui_utils.cpp
@@ -84,7 +84,7 @@ void CDlgBase::NotifyChange(void)
SendMessage(m_hwndParent, PSM_CHANGED, (WPARAM)m_hwnd, 0);
}
-void CDlgBase::SetCaption(const TCHAR *ptszCaption)
+void CDlgBase::SetCaption(const wchar_t *ptszCaption)
{
if (m_hwnd && ptszCaption)
SetWindowText(m_hwnd, ptszCaption);
@@ -310,7 +310,7 @@ void CCtrlCombo::OnApply()
if (GetDataType() == DBVT_TCHAR) {
int len = GetWindowTextLength(m_hwnd) + 1;
- TCHAR *buf = (TCHAR *)_alloca(sizeof(TCHAR) * len);
+ wchar_t *buf = (wchar_t *)_alloca(sizeof(wchar_t) * len);
GetWindowText(m_hwnd, buf, len);
SaveText(buf);
}
@@ -327,7 +327,7 @@ void CCtrlCombo::OnReset()
SetInt(LoadInt());
}
-int CCtrlCombo::AddString(const TCHAR *text, LPARAM data)
+int CCtrlCombo::AddString(const wchar_t *text, LPARAM data)
{
int iItem = SendMessage(m_hwnd, CB_ADDSTRING, 0, (LPARAM)text);
if (data)
@@ -347,7 +347,7 @@ void CCtrlCombo::DeleteString(int index)
{ SendMessage(m_hwnd, CB_DELETESTRING, index, 0);
}
-int CCtrlCombo::FindString(const TCHAR *str, int index, bool exact)
+int CCtrlCombo::FindString(const wchar_t *str, int index, bool exact)
{ return SendMessage(m_hwnd, exact?CB_FINDSTRINGEXACT:CB_FINDSTRING, index, (LPARAM)str);
}
@@ -371,22 +371,22 @@ LPARAM CCtrlCombo::GetItemData(int index)
{ return SendMessage(m_hwnd, CB_GETITEMDATA, index, 0);
}
-TCHAR* CCtrlCombo::GetItemText(int index)
+wchar_t* CCtrlCombo::GetItemText(int index)
{
- TCHAR *result = (TCHAR *)mir_alloc(sizeof(TCHAR) * (SendMessage(m_hwnd, CB_GETLBTEXTLEN, index, 0) + 1));
+ wchar_t *result = (wchar_t *)mir_alloc(sizeof(wchar_t) * (SendMessage(m_hwnd, CB_GETLBTEXTLEN, index, 0) + 1));
SendMessage(m_hwnd, CB_GETLBTEXT, index, (LPARAM)result);
return result;
}
-TCHAR* CCtrlCombo::GetItemText(int index, TCHAR *buf, int size)
+wchar_t* CCtrlCombo::GetItemText(int index, wchar_t *buf, int size)
{
- TCHAR *result = (TCHAR *)_alloca(sizeof(TCHAR) * (SendMessage(m_hwnd, CB_GETLBTEXTLEN, index, 0) + 1));
+ wchar_t *result = (wchar_t *)_alloca(sizeof(wchar_t) * (SendMessage(m_hwnd, CB_GETLBTEXTLEN, index, 0) + 1));
SendMessage(m_hwnd, CB_GETLBTEXT, index, (LPARAM)result);
mir_tstrncpy(buf, result, size);
return buf;
}
-int CCtrlCombo::InsertString(TCHAR *text, int pos, LPARAM data)
+int CCtrlCombo::InsertString(wchar_t *text, int pos, LPARAM data)
{
int iItem = SendMessage(m_hwnd, CB_INSERTSTRING, pos, (LPARAM)text);
SendMessage(m_hwnd, CB_SETITEMDATA, iItem, data);
@@ -397,7 +397,7 @@ void CCtrlCombo::ResetContent()
{ SendMessage(m_hwnd, CB_RESETCONTENT, 0, 0);
}
-int CCtrlCombo::SelectString(TCHAR *str)
+int CCtrlCombo::SelectString(wchar_t *str)
{ return SendMessage(m_hwnd, CB_SELECTSTRING, 0, (LPARAM)str);
}
@@ -430,7 +430,7 @@ BOOL CCtrlListBox::OnCommand(HWND, WORD, WORD idCode)
return TRUE;
}
-int CCtrlListBox::AddString(TCHAR *text, LPARAM data)
+int CCtrlListBox::AddString(wchar_t *text, LPARAM data)
{
int iItem = SendMessage(m_hwnd, LB_ADDSTRING, 0, (LPARAM)text);
SendMessage(m_hwnd, LB_SETITEMDATA, iItem, data);
@@ -441,7 +441,7 @@ void CCtrlListBox::DeleteString(int index)
{ SendMessage(m_hwnd, LB_DELETESTRING, index, 0);
}
-int CCtrlListBox::FindString(TCHAR *str, int index, bool exact)
+int CCtrlListBox::FindString(wchar_t *str, int index, bool exact)
{ return SendMessage(m_hwnd, exact?LB_FINDSTRINGEXACT:LB_FINDSTRING, index, (LPARAM)str);
}
@@ -457,16 +457,16 @@ LPARAM CCtrlListBox::GetItemData(int index)
{ return SendMessage(m_hwnd, LB_GETITEMDATA, index, 0);
}
-TCHAR* CCtrlListBox::GetItemText(int index)
+wchar_t* CCtrlListBox::GetItemText(int index)
{
- TCHAR *result = (TCHAR *)mir_alloc(sizeof(TCHAR) * (SendMessage(m_hwnd, LB_GETTEXTLEN, index, 0) + 1));
+ wchar_t *result = (wchar_t *)mir_alloc(sizeof(wchar_t) * (SendMessage(m_hwnd, LB_GETTEXTLEN, index, 0) + 1));
SendMessage(m_hwnd, LB_GETTEXT, index, (LPARAM)result);
return result;
}
-TCHAR* CCtrlListBox::GetItemText(int index, TCHAR *buf, int size)
+wchar_t* CCtrlListBox::GetItemText(int index, wchar_t *buf, int size)
{
- TCHAR *result = (TCHAR *)_alloca(sizeof(TCHAR) * (SendMessage(m_hwnd, LB_GETTEXTLEN, index, 0) + 1));
+ wchar_t *result = (wchar_t *)_alloca(sizeof(wchar_t) * (SendMessage(m_hwnd, LB_GETTEXTLEN, index, 0) + 1));
SendMessage(m_hwnd, LB_GETTEXT, index, (LPARAM)result);
mir_tstrncpy(buf, result, size);
return buf;
@@ -495,7 +495,7 @@ int* CCtrlListBox::GetSelItems()
return result;
}
-int CCtrlListBox::InsertString(TCHAR *text, int pos, LPARAM data)
+int CCtrlListBox::InsertString(wchar_t *text, int pos, LPARAM data)
{
int iItem = SendMessage(m_hwnd, CB_INSERTSTRING, pos, (LPARAM)text);
SendMessage(m_hwnd, CB_SETITEMDATA, iItem, data);
@@ -506,7 +506,7 @@ void CCtrlListBox::ResetContent()
{ SendMessage(m_hwnd, LB_RESETCONTENT, 0, 0);
}
-int CCtrlListBox::SelectString(TCHAR *str)
+int CCtrlListBox::SelectString(wchar_t *str)
{ return SendMessage(m_hwnd, LB_SELECTSTRING, 0, (LPARAM)str);
}
@@ -575,7 +575,7 @@ void CCtrlEdit::OnApply()
if (GetDataType() == DBVT_TCHAR) {
int len = GetWindowTextLength(m_hwnd) + 1;
- TCHAR *buf = (TCHAR *)_alloca(sizeof(TCHAR) * len);
+ wchar_t *buf = (wchar_t *)_alloca(sizeof(wchar_t) * len);
GetWindowText(m_hwnd, buf, len);
SaveText(buf);
}
@@ -617,7 +617,7 @@ void CCtrlData::CreateDbLink(const char* szModuleName, const char* szSetting, BY
m_dbLink = new CDbLink(szModuleName, szSetting, type, iValue);
}
-void CCtrlData::CreateDbLink(const char* szModuleName, const char* szSetting, TCHAR* szValue)
+void CCtrlData::CreateDbLink(const char* szModuleName, const char* szSetting, wchar_t* szValue)
{
m_dbLink = new CDbLink(szModuleName, szSetting, DBVT_TCHAR, szValue);
}
@@ -949,7 +949,7 @@ HIMAGELIST CCtrlListView::CreateImageList(int iImageList)
return hIml;
}
-void CCtrlListView::AddColumn(int iSubItem, TCHAR *name, int cx)
+void CCtrlListView::AddColumn(int iSubItem, wchar_t *name, int cx)
{
LVCOLUMN lvc;
lvc.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
@@ -960,7 +960,7 @@ void CCtrlListView::AddColumn(int iSubItem, TCHAR *name, int cx)
InsertColumn(iSubItem, &lvc);
}
-void CCtrlListView::AddGroup(int iGroupId, TCHAR *name)
+void CCtrlListView::AddGroup(int iGroupId, wchar_t *name)
{
LVGROUP lvg = { 0 };
lvg.cbSize = sizeof(lvg);
@@ -971,7 +971,7 @@ void CCtrlListView::AddGroup(int iGroupId, TCHAR *name)
InsertGroup(-1, &lvg);
}
-int CCtrlListView::AddItem(TCHAR *text, int iIcon, LPARAM lParam, int iGroupId)
+int CCtrlListView::AddItem(wchar_t *text, int iIcon, LPARAM lParam, int iGroupId)
{
LVITEM lvi = { 0 };
lvi.mask = LVIF_PARAM | LVIF_TEXT | LVIF_IMAGE;
@@ -987,7 +987,7 @@ int CCtrlListView::AddItem(TCHAR *text, int iIcon, LPARAM lParam, int iGroupId)
return InsertItem(&lvi);
}
-void CCtrlListView::SetItem(int iItem, int iSubItem, TCHAR *text, int iIcon)
+void CCtrlListView::SetItem(int iItem, int iSubItem, wchar_t *text, int iIcon)
{
LVITEM lvi = { 0 };
lvi.mask = LVIF_TEXT;
@@ -1300,7 +1300,7 @@ void CCtrlListView::SetItemPosition32(int iItem, int x, int y)
void CCtrlListView::SetItemState(int i, UINT state, UINT mask)
{ ListView_SetItemState(m_hwnd, i, state, mask);
}
-void CCtrlListView::SetItemText(int i, int iSubItem, TCHAR *pszText)
+void CCtrlListView::SetItemText(int i, int iSubItem, wchar_t *pszText)
{ ListView_SetItemText(m_hwnd, i, iSubItem, pszText);
}
COLORREF CCtrlListView::SetOutlineColor(COLORREF color)
@@ -1391,7 +1391,7 @@ HTREEITEM CCtrlTreeView::MoveItemAbove(HTREEITEM hItem, HTREEITEM hInsertAfter,
if (hItem == hInsertAfter)
return hItem;
- TCHAR name[128];
+ wchar_t name[128];
TVINSERTSTRUCT tvis = { 0 };
tvis.itemex.mask = (UINT)-1;
tvis.itemex.pszText = name;
@@ -1630,7 +1630,7 @@ void CCtrlTreeView::InvertCheck(HTREEITEM hItem)
void CCtrlTreeView::TranslateItem(HTREEITEM hItem)
{
TVITEMEX tvi;
- TCHAR buf[128];
+ wchar_t buf[128];
GetItem(hItem, &tvi, buf, _countof(buf));
tvi.pszText = TranslateTS(tvi.pszText);
SetItem(&tvi);
@@ -1660,10 +1660,10 @@ void CCtrlTreeView::TranslateTree()
}
}
-HTREEITEM CCtrlTreeView::FindNamedItem(HTREEITEM hItem, const TCHAR *name)
+HTREEITEM CCtrlTreeView::FindNamedItem(HTREEITEM hItem, const wchar_t *name)
{
TVITEMEX tvi = { 0 };
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
if (hItem)
tvi.hItem = GetChild(hItem);
@@ -1696,7 +1696,7 @@ void CCtrlTreeView::GetItem(HTREEITEM hItem, TVITEMEX *tvi)
GetItem(tvi);
}
-void CCtrlTreeView::GetItem(HTREEITEM hItem, TVITEMEX *tvi, TCHAR *szText, int iTextLength)
+void CCtrlTreeView::GetItem(HTREEITEM hItem, TVITEMEX *tvi, wchar_t *szText, int iTextLength)
{
memset(tvi, 0, sizeof(*tvi));
tvi->mask = TVIF_CHILDREN | TVIF_HANDLE | TVIF_IMAGE | TVIF_INTEGRAL | TVIF_PARAM | TVIF_SELECTEDIMAGE | TVIF_STATE | TVIF_TEXT;
@@ -2134,7 +2134,7 @@ LRESULT CCtrlPages::CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam)
return CSuper::CustomWndProc(msg, wParam, lParam);
}
-void CCtrlPages::AddPage(TCHAR *ptszName, HICON hIcon, CDlgBase *pDlg)
+void CCtrlPages::AddPage(wchar_t *ptszName, HICON hIcon, CDlgBase *pDlg)
{
TPageInfo *info = new TPageInfo;
info->m_pDlg = pDlg;
@@ -2359,7 +2359,7 @@ LRESULT CCtrlBase::SendMsg(UINT Msg, WPARAM wParam, LPARAM lParam)
return ::SendMessage(m_hwnd, Msg, wParam, lParam);
}
-void CCtrlBase::SetText(const TCHAR *text)
+void CCtrlBase::SetText(const wchar_t *text)
{
::SetWindowText(m_hwnd, text);
}
@@ -2371,15 +2371,15 @@ void CCtrlBase::SetTextA(const char *text)
void CCtrlBase::SetInt(int value)
{
- TCHAR buf[32] = { 0 };
+ wchar_t buf[32] = { 0 };
mir_sntprintf(buf, L"%d", value);
SetWindowText(m_hwnd, buf);
}
-TCHAR* CCtrlBase::GetText()
+wchar_t* CCtrlBase::GetText()
{
int length = GetWindowTextLength(m_hwnd) + 1;
- TCHAR *result = (TCHAR *)mir_alloc(length * sizeof(TCHAR));
+ wchar_t *result = (wchar_t *)mir_alloc(length * sizeof(wchar_t));
GetWindowText(m_hwnd, result, length);
return result;
}
@@ -2392,7 +2392,7 @@ char* CCtrlBase::GetTextA()
return result;
}
-TCHAR* CCtrlBase::GetText(TCHAR *buf, int size)
+wchar_t* CCtrlBase::GetText(wchar_t *buf, int size)
{
GetWindowText(m_hwnd, buf, size);
buf[size - 1] = 0;
@@ -2409,9 +2409,9 @@ char* CCtrlBase::GetTextA(char *buf, int size)
int CCtrlBase::GetInt()
{
int length = GetWindowTextLength(m_hwnd) + 1;
- TCHAR *result = (TCHAR *)_alloca(length * sizeof(TCHAR));
+ wchar_t *result = (wchar_t *)_alloca(length * sizeof(wchar_t));
GetWindowText(m_hwnd, result, length);
- return _ttoi(result);
+ return _wtoi(result);
}
LRESULT CCtrlBase::CustomWndProc(UINT, WPARAM, LPARAM)
@@ -2464,7 +2464,7 @@ CDbLink::CDbLink(const char *szModule, const char *szSetting, BYTE type, DWORD i
dbv.type = DBVT_DELETED;
}
-CDbLink::CDbLink(const char *szModule, const char *szSetting, BYTE type, TCHAR *szValue)
+CDbLink::CDbLink(const char *szModule, const char *szSetting, BYTE type, wchar_t *szValue)
: CDataLink(type)
{
m_szModule = mir_strdup(szModule);
@@ -2501,7 +2501,7 @@ void CDbLink::SaveInt(DWORD value)
}
}
-TCHAR* CDbLink::LoadText()
+wchar_t* CDbLink::LoadText()
{
if (dbv.type != DBVT_DELETED) db_free(&dbv);
if (!db_get_ts(NULL, m_szModule, m_szSetting, &dbv)) {
@@ -2514,7 +2514,7 @@ TCHAR* CDbLink::LoadText()
return m_szDefault;
}
-void CDbLink::SaveText(TCHAR *value)
+void CDbLink::SaveText(wchar_t *value)
{
db_set_ts(NULL, m_szModule, m_szSetting, value);
}
diff --git a/src/mir_core/src/utils.cpp b/src/mir_core/src/utils.cpp
index f6bac7c121..da473a9a5b 100644
--- a/src/mir_core/src/utils.cpp
+++ b/src/mir_core/src/utils.cpp
@@ -62,7 +62,7 @@ MIR_CORE_DLL(WCHAR*) rtrimw(WCHAR *str)
if (str == NULL)
return NULL;
- WCHAR *p = _tcschr(str, 0);
+ WCHAR *p = wcschr(str, 0);
while (--p >= str) {
switch (*p) {
case ' ': case '\t': case '\n': case '\r':
diff --git a/src/mir_core/src/winver.cpp b/src/mir_core/src/winver.cpp
index cdda5b55cc..8484f8ef71 100644
--- a/src/mir_core/src/winver.cpp
+++ b/src/mir_core/src/winver.cpp
@@ -69,7 +69,7 @@ MIR_CORE_DLL(BOOL) IsFullScreen()
// check foregroundwindow
HWND hWnd = GetForegroundWindow();
if (hWnd && hWnd != hWndDesktop && hWnd != hWndShell) {
- TCHAR tszClassName[128] = L"";
+ wchar_t tszClassName[128] = L"";
GetClassName(hWnd, tszClassName, _countof(tszClassName));
if (_tcscmp(tszClassName, L"WorkerW")) {
RECT rect, rectw, recti;
@@ -93,7 +93,7 @@ MIR_CORE_DLL(BOOL) IsWorkstationLocked(void)
if (hDesk == NULL)
return true;
- TCHAR tszName[100];
+ wchar_t tszName[100];
DWORD cbName;
BOOL bLocked = (!GetUserObjectInformation(hDesk, UOI_NAME, tszName, _countof(tszName), &cbName) || mir_tstrcmpi(tszName, L"default") != 0);
CloseDesktop(hDesk);
@@ -198,7 +198,7 @@ MIR_CORE_DLL(BOOL) IsScreenSaverRunning(void)
typedef BOOL(WINAPI *PGPI)(DWORD, DWORD, DWORD, DWORD, PDWORD);
typedef LPCSTR(WINAPI *WGV)(void);
-MIR_CORE_DLL(BOOL) GetOSDisplayString(TCHAR *buf, size_t bufSize)
+MIR_CORE_DLL(BOOL) GetOSDisplayString(wchar_t *buf, size_t bufSize)
{
if (buf == NULL || bufSize == 0)
return 0;
diff --git a/src/miranda32/src/miranda.cpp b/src/miranda32/src/miranda.cpp
index d8c1b60ad2..165f9ff1ed 100644
--- a/src/miranda32/src/miranda.cpp
+++ b/src/miranda32/src/miranda.cpp
@@ -26,12 +26,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
typedef int (WINAPI *pfnMain)(LPTSTR);
-int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR cmdLine, int)
+int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR cmdLine, int)
{
- TCHAR tszPath[MAX_PATH];
+ wchar_t tszPath[MAX_PATH];
GetModuleFileName(hInstance, tszPath, _countof(tszPath));
- TCHAR *p = _tcsrchr(tszPath, '\\');
+ wchar_t *p = wcsrchr(tszPath, '\\');
if (p == NULL)
return 4;
@@ -39,13 +39,13 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR cmdLine, int)
p[1] = 0;
SetCurrentDirectory(tszPath);
- _tcsncat_s(tszPath, L"libs", _TRUNCATE);
- DWORD cbPath = (DWORD)_tcslen(tszPath);
+ wcsncat_s(tszPath, L"libs", _TRUNCATE);
+ DWORD cbPath = (DWORD)wcslen(tszPath);
DWORD cbSize = GetEnvironmentVariable(L"PATH", NULL, 0);
- TCHAR *ptszVal = new TCHAR[cbSize + MAX_PATH + 2];
- _tcscpy(ptszVal, tszPath);
- _tcscat(ptszVal, L";");
+ wchar_t *ptszVal = new wchar_t[cbSize + MAX_PATH + 2];
+ wcscpy(ptszVal, tszPath);
+ wcscat(ptszVal, L";");
GetEnvironmentVariable(L"PATH", ptszVal + cbPath + 1, cbSize);
SetEnvironmentVariable(L"PATH", ptszVal);
diff --git a/src/miranda32/src/stdafx.h b/src/miranda32/src/stdafx.h
index 56433df124..030e0539b5 100644
--- a/src/miranda32/src/stdafx.h
+++ b/src/miranda32/src/stdafx.h
@@ -23,5 +23,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <windows.h>
-
-#include <tchar.h>
diff --git a/utils/mir_buffer.h b/utils/mir_buffer.h
index 584ca12149..25ea5a0516 100644
--- a/utils/mir_buffer.h
+++ b/utils/mir_buffer.h
@@ -435,7 +435,7 @@ class Buffer
};
-static void ReplaceVars(Buffer<TCHAR> *buffer, MCONTACT hContact, TCHAR **variables, int numVariables)
+static void ReplaceVars(Buffer<wchar_t> *buffer, MCONTACT hContact, wchar_t **variables, int numVariables)
{
if (buffer->len < 3)
return;
@@ -445,25 +445,25 @@ static void ReplaceVars(Buffer<TCHAR> *buffer, MCONTACT hContact, TCHAR **variab
for(size_t i = buffer->len - 1; i > 0; i--)
{
- if (buffer->str[i] == _T('%'))
+ if (buffer->str[i] == '%')
{
// Find previous
size_t j;
- for(j = i - 1; j > 0 && ((buffer->str[j] >= _T('a') && buffer->str[j] <= _T('z'))
- || (buffer->str[j] >= _T('A') && buffer->str[j] <= _T('Z'))
- || buffer->str[j] == _T('-')
- || buffer->str[j] == _T('_')); j--) ;
+ for(j = i - 1; j > 0 && ((buffer->str[j] >= 'a' && buffer->str[j] <= 'z')
+ || (buffer->str[j] >= 'A' && buffer->str[j] <= 'Z')
+ || buffer->str[j] == '-'
+ || buffer->str[j] == '_'); j--) ;
- if (buffer->str[j] == _T('%'))
+ if (buffer->str[j] == '%')
{
size_t foundLen = i - j + 1;
- if (foundLen == 9 && _tcsncmp(&buffer->str[j], L"%contact%", 9) == 0)
+ if (foundLen == 9 && wcsncmp(&buffer->str[j], L"%contact%", 9) == 0)
{
buffer->replace(j, i + 1, pcli->pfnGetContactDisplayName(hContact, 0));
}
- else if (foundLen == 6 && _tcsncmp(&buffer->str[j], L"%date%", 6) == 0)
+ else if (foundLen == 6 && wcsncmp(&buffer->str[j], L"%date%", 6) == 0)
{
- TCHAR tmp[128];
+ wchar_t tmp[128];
TimeZone_ToStringT(time(NULL), L"d s", tmp, _countof(tmp));
buffer->replace(j, i + 1, tmp);
}
@@ -472,7 +472,7 @@ static void ReplaceVars(Buffer<TCHAR> *buffer, MCONTACT hContact, TCHAR **variab
for(int k = 0; k < numVariables; k += 2)
{
size_t len = mir_tstrlen(variables[k]);
- if (foundLen == len + 2 && _tcsncmp(&buffer->str[j]+1, variables[k], len) == 0)
+ if (foundLen == len + 2 && wcsncmp(&buffer->str[j]+1, variables[k], len) == 0)
{
buffer->replace(j, i + 1, variables[k + 1]);
break;
@@ -485,21 +485,21 @@ static void ReplaceVars(Buffer<TCHAR> *buffer, MCONTACT hContact, TCHAR **variab
if (i == 0)
break;
}
- else if (buffer->str[i] == _T('\\') && i+1 <= buffer->len-1 && buffer->str[i+1] == _T('n'))
+ else if (buffer->str[i] == '\\' && i+1 <= buffer->len-1 && buffer->str[i+1] == 'n')
{
- buffer->str[i] = _T('\r');
- buffer->str[i+1] = _T('\n');
+ buffer->str[i] = '\r';
+ buffer->str[i+1] = '\n';
}
}
}
-static void ReplaceTemplate(Buffer<TCHAR> *out, MCONTACT hContact, TCHAR *templ, TCHAR **vars, int numVars)
+static void ReplaceTemplate(Buffer<wchar_t> *out, MCONTACT hContact, wchar_t *templ, wchar_t **vars, int numVars)
{
if (ServiceExists(MS_VARS_FORMATSTRING))
{
- TCHAR *tmp = variables_parse_ex(templ, NULL, hContact, vars, numVars);
+ wchar_t *tmp = variables_parse_ex(templ, NULL, hContact, vars, numVars);
if (tmp != NULL)
{
out->append(tmp);
diff --git a/utils/mir_fonts.cpp b/utils/mir_fonts.cpp
index 0ef14e3c6d..410f936fa3 100644
--- a/utils/mir_fonts.cpp
+++ b/utils/mir_fonts.cpp
@@ -6,7 +6,7 @@
#include "mir_fonts.h"
-int FontService_RegisterFont(const char *pszDbModule, const char *pszDbName, const TCHAR *pszSection, const TCHAR *pszDescription, const TCHAR *pszBackgroundGroup, const TCHAR *pszBackgroundName, int position, BOOL bAllowEffects, LOGFONT *plfDefault, COLORREF clrDefault)
+int FontService_RegisterFont(const char *pszDbModule, const char *pszDbName, const wchar_t *pszSection, const wchar_t *pszDescription, const wchar_t *pszBackgroundGroup, const wchar_t *pszBackgroundName, int position, BOOL bAllowEffects, LOGFONT *plfDefault, COLORREF clrDefault)
{
FontIDT fid = { 0 };
fid.cbSize = sizeof(fid);
@@ -34,7 +34,7 @@ int FontService_RegisterFont(const char *pszDbModule, const char *pszDbName, con
return 0;
}
-int FontService_GetFont(const TCHAR *pszSection, const TCHAR *pszDescription, COLORREF *pclr, LOGFONT *plf)
+int FontService_GetFont(const wchar_t *pszSection, const wchar_t *pszDescription, COLORREF *pclr, LOGFONT *plf)
{
FontIDT fid = { 0 };
mir_tstrncpy(fid.group, pszSection, _countof(fid.group)); /* buffer sfae */
@@ -43,7 +43,7 @@ int FontService_GetFont(const TCHAR *pszSection, const TCHAR *pszDescription, CO
return (int)*pclr == -1;
}
-int FontService_RegisterColor(const char *pszDbModule, const char *pszDbName, const TCHAR *pszSection, const TCHAR *pszDescription, COLORREF clrDefault)
+int FontService_RegisterColor(const char *pszDbModule, const char *pszDbName, const wchar_t *pszSection, const wchar_t *pszDescription, COLORREF clrDefault)
{
ColourIDT cid = { 0 };
cid.cbSize = sizeof(cid);
@@ -56,12 +56,12 @@ int FontService_RegisterColor(const char *pszDbModule, const char *pszDbName, co
return 0;
}
-int FontService_GetColor(const TCHAR *pszSection, const TCHAR *pszDescription, COLORREF *pclr)
+int FontService_GetColor(const wchar_t *pszSection, const wchar_t *pszDescription, COLORREF *pclr)
{
ColourIDT cid = { 0 };
cid.cbSize = sizeof(cid);
- _tcsncpy_s(cid.group, pszSection, _TRUNCATE);
- _tcsncpy_s(cid.name, pszDescription, _TRUNCATE);
+ wcsncpy_s(cid.group, pszSection, _TRUNCATE);
+ wcsncpy_s(cid.name, pszDescription, _TRUNCATE);
*pclr = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, 0);
return (int)*pclr == -1;
}
diff --git a/utils/mir_options.cpp b/utils/mir_options.cpp
index afdc407708..90bf27c3e8 100644
--- a/utils/mir_options.cpp
+++ b/utils/mir_options.cpp
@@ -20,7 +20,6 @@ Boston, MA 02111-1307, USA.
#include <windows.h>
#include <commctrl.h>
#include <stdio.h>
-#include <tchar.h>
#include <newpluginapi.h>
#include <m_database.h>
@@ -32,11 +31,11 @@ Boston, MA 02111-1307, USA.
#include "mir_options.h"
-static TCHAR* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* setting, TCHAR* out, size_t len, TCHAR *def)
+static wchar_t* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* setting, wchar_t* out, size_t len, wchar_t *def)
{
DBVARIANT dbv = { 0 };
- out[0] = _T('\0');
+ out[0] = '\0';
if (!db_get_ts(hContact, module, setting, &dbv)) {
mir_tstrncpy(out, dbv.ptszVal, (int)len);
@@ -51,42 +50,42 @@ static TCHAR* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char
}
-static TCHAR dbPath[MAX_PATH] = { 0 }; // database profile path (read at startup only)
+static wchar_t dbPath[MAX_PATH] = { 0 }; // database profile path (read at startup only)
-static int PathIsAbsolute(const TCHAR *path)
+static int PathIsAbsolute(const wchar_t *path)
{
if (!path || !(mir_tstrlen(path) > 2))
return 0;
- if ((path[1] == _T(':') && path[2] == _T('\\')) || (path[0] == _T('\\') && path[1] == _T('\\')))
+ if ((path[1] == ':' && path[2] == '\\') || (path[0] == '\\' && path[1] == '\\'))
return 1;
return 0;
}
-static void PathToRelative(TCHAR *pOut, size_t outSize, const TCHAR *pSrc)
+static void PathToRelative(wchar_t *pOut, size_t outSize, const wchar_t *pSrc)
{
if (!PathIsAbsolute(pSrc))
mir_tstrncpy(pOut, pSrc, (int)outSize);
else {
- if (dbPath[0] == _T('\0')) {
+ if (dbPath[0] == '\0') {
char tmp[1024];
CallService(MS_DB_GETPROFILEPATH, _countof(tmp), (LPARAM)tmp);
mir_sntprintf(dbPath, L"%S\\", tmp);
}
size_t len = mir_tstrlen(dbPath);
- if (!_tcsnicmp(pSrc, dbPath, len))
+ if (!wcsnicmp(pSrc, dbPath, len))
len = 0;
mir_tstrncpy(pOut, pSrc + len, outSize);
}
}
-static void PathToAbsolute(TCHAR *pOut, size_t outSize, const TCHAR *pSrc)
+static void PathToAbsolute(wchar_t *pOut, size_t outSize, const wchar_t *pSrc)
{
if (PathIsAbsolute(pSrc) || !isalnum(pSrc[0]))
mir_tstrncpy(pOut, pSrc, (int)outSize);
else {
- if (dbPath[0] == _T('\0')) {
+ if (dbPath[0] == '\0') {
char tmp[1024];
CallService(MS_DB_GETPROFILEPATH, _countof(tmp), (LPARAM)tmp);
mir_sntprintf(dbPath, L"%S\\", tmp);
@@ -101,7 +100,7 @@ static void LoadOpt(OptPageControl *ctrl, char *module)
if (ctrl->var == NULL)
return;
- TCHAR tmp[1024];
+ wchar_t tmp[1024];
switch (ctrl->type) {
case CONTROL_CHECKBOX:
*((BYTE *)ctrl->var) = db_get_b(NULL, module, ctrl->setting, ctrl->dwDefValue);
@@ -127,7 +126,7 @@ static void LoadOpt(OptPageControl *ctrl, char *module)
break;
case CONTROL_TEXT:
- MyDBGetContactSettingTString(NULL, module, ctrl->setting, ((TCHAR *)ctrl->var), min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), ctrl->tszDefValue == NULL ? NULL : TranslateTS(ctrl->tszDefValue));
+ MyDBGetContactSettingTString(NULL, module, ctrl->setting, ((wchar_t *)ctrl->var), min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), ctrl->tszDefValue == NULL ? NULL : TranslateTS(ctrl->tszDefValue));
break;
case CONTROL_INT:
@@ -136,12 +135,12 @@ static void LoadOpt(OptPageControl *ctrl, char *module)
case CONTROL_FILE:
MyDBGetContactSettingTString(NULL, module, ctrl->setting, tmp, 1024, ctrl->tszDefValue == NULL ? NULL : ctrl->tszDefValue);
- PathToAbsolute(((TCHAR *)ctrl->var), min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), tmp);
+ PathToAbsolute(((wchar_t *)ctrl->var), min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), tmp);
break;
case CONTROL_COMBO_TEXT:
case CONTROL_COMBO_ITEMDATA:
- MyDBGetContactSettingTString(NULL, module, ctrl->setting, ((TCHAR *)ctrl->var), min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), ctrl->tszDefValue == NULL ? NULL : TranslateTS(ctrl->tszDefValue));
+ MyDBGetContactSettingTString(NULL, module, ctrl->setting, ((wchar_t *)ctrl->var), min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), ctrl->tszDefValue == NULL ? NULL : TranslateTS(ctrl->tszDefValue));
break;
}
}
@@ -154,7 +153,7 @@ void LoadOpts(OptPageControl *controls, int controlsSize, char *module)
INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, char *module, HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TCHAR tmp[1024];
+ wchar_t tmp[1024];
switch (msg) {
case WM_INITDIALOG:
@@ -249,7 +248,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha
case CONTROL_FILE:
MyDBGetContactSettingTString(NULL, module, ctrl->setting, tmp, 1024, ctrl->tszDefValue == NULL ? NULL : ctrl->tszDefValue);
{
- TCHAR abs[1024];
+ wchar_t abs[1024];
PathToAbsolute(abs, 1024, tmp);
SetDlgItemText(hwndDlg, ctrl->nID, abs);
}
@@ -267,7 +266,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha
int count = SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETCOUNT, 0, 0);
int k;
for (k = 0; k < count; k++) {
- TCHAR *id = (TCHAR *)SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETITEMDATA, (WPARAM)k, 0);
+ wchar_t *id = (wchar_t *)SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETITEMDATA, (WPARAM)k, 0);
if (mir_tstrcmp(id, tmp) == 0)
break;
}
@@ -378,7 +377,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha
case CONTROL_FILE:
GetDlgItemText(hwndDlg, ctrl->nID, tmp, _countof(tmp));
{
- TCHAR rel[1024];
+ wchar_t rel[1024];
PathToRelative(rel, 1024, tmp);
db_set_ts(NULL, module, ctrl->setting, rel);
}
@@ -391,7 +390,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha
case CONTROL_COMBO_ITEMDATA:
int sel = SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETCURSEL, 0, 0);
- db_set_ts(NULL, module, ctrl->setting, (TCHAR *)SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETITEMDATA, (WPARAM)sel, 0));
+ db_set_ts(NULL, module, ctrl->setting, (wchar_t *)SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETITEMDATA, (WPARAM)sel, 0));
break;
}
diff --git a/utils/mir_options.h b/utils/mir_options.h
index 7c2634e9eb..937eb71366 100644
--- a/utils/mir_options.h
+++ b/utils/mir_options.h
@@ -46,7 +46,7 @@ typedef struct {
char *setting;
union {
ULONG_PTR dwDefValue;
- TCHAR *tszDefValue;
+ wchar_t *tszDefValue;
char *szDefValue;
};
union {
diff --git a/utils/mir_smileys.cpp b/utils/mir_smileys.cpp
index a337b5b2f1..f3d5168a81 100644
--- a/utils/mir_smileys.cpp
+++ b/utils/mir_smileys.cpp
@@ -27,7 +27,6 @@ Boston, MA 02111-1307, USA.
#include <m_database.h>
#include <commctrl.h>
#include <m_skin_eng.h>
-#include <tchar.h>
// Prototypes
@@ -53,10 +52,10 @@ typedef struct
}
TextPiece;
-SortedList * ReplaceSmileys(const TCHAR *text, int text_size, const char *protocol, int *max_smiley_height);
-void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SortedList *plText, UINT uTextFormat, int max_smiley_height);
+SortedList * ReplaceSmileys(const wchar_t *text, int text_size, const char *protocol, int *max_smiley_height);
+void DrawTextSmiley(HDC hdcMem, RECT free_rc, const wchar_t *szText, int len, SortedList *plText, UINT uTextFormat, int max_smiley_height);
void DestroySmileyList(SortedList* p_list);
-SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SortedList *plText, UINT uTextFormat, int max_smiley_height);
+SIZE GetTextSize(HDC hdcMem, const wchar_t *szText, SortedList *plText, UINT uTextFormat, int max_smiley_height);
// Functions
@@ -77,7 +76,7 @@ int InitContactListSmileys()
return 0;
}
-SmileysParseInfo Smileys_PreParse(const TCHAR* lpString, int nCount, const char *protocol)
+SmileysParseInfo Smileys_PreParse(const wchar_t* lpString, int nCount, const char *protocol)
{
SmileysParseInfo info = (SmileysParseInfo)mir_calloc(sizeof(_SmileysParseInfo));
@@ -207,7 +206,7 @@ int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT
-SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SortedList *plText, UINT uTextFormat, int max_smiley_height)
+SIZE GetTextSize(HDC hdcMem, const wchar_t *szText, SortedList *plText, UINT uTextFormat, int max_smiley_height)
{
SIZE text_size;
@@ -257,7 +256,7 @@ SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SortedList *plText, UINT uText
return text_size;
}
-void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SortedList *plText, UINT uTextFormat, int max_smiley_height)
+void DrawTextSmiley(HDC hdcMem, RECT free_rc, const wchar_t *szText, int len, SortedList *plText, UINT uTextFormat, int max_smiley_height)
{
if (szText == NULL)
return;
@@ -388,7 +387,7 @@ void DestroySmileyList(SortedList* p_list)
// Generete the list of smileys / text to be drawn
-SortedList * ReplaceSmileys(const TCHAR *text, int text_size, const char *protocol, int *max_smiley_height)
+SortedList * ReplaceSmileys(const wchar_t *text, int text_size, const char *protocol, int *max_smiley_height)
{
*max_smiley_height = 0;
@@ -398,7 +397,7 @@ SortedList * ReplaceSmileys(const TCHAR *text, int text_size, const char *protoc
// Parse it!
SMADD_BATCHPARSE2 sp = { sizeof(sp) };
sp.Protocolname = protocol;
- sp.str = (TCHAR*)text;
+ sp.str = (wchar_t*)text;
sp.flag = SAFL_TCHAR;
SMADD_BATCHPARSERES *spres = (SMADD_BATCHPARSERES *)CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&sp);
if (spres == NULL)
@@ -408,12 +407,12 @@ SortedList * ReplaceSmileys(const TCHAR *text, int text_size, const char *protoc
// Lets add smileys
SortedList *plText = List_Create(0, 10);
- const TCHAR *next_text_pos = text;
- const TCHAR *last_text_pos = _tcsninc(text, text_size);
+ const wchar_t *next_text_pos = text;
+ const wchar_t *last_text_pos = _tcsninc(text, text_size);
for (unsigned int i = 0; i < sp.numSmileys; i++) {
- TCHAR* start = _tcsninc(text, spres[i].startChar);
- TCHAR* end = _tcsninc(start, spres[i].size);
+ wchar_t* start = _tcsninc(text, spres[i].startChar);
+ wchar_t* end = _tcsninc(start, spres[i].size);
if (spres[i].hIcon != NULL) { // For defective smileypacks
// Add text
diff --git a/utils/std_string_utils.cpp b/utils/std_string_utils.cpp
index 5991106b45..7a1e6b61b9 100644
--- a/utils/std_string_utils.cpp
+++ b/utils/std_string_utils.cpp
@@ -112,11 +112,11 @@ void utils::text::replace_all(std::string* data, const std::string &from, const
}
}
-void utils::text::treplace_all(std::tstring* data, const std::tstring &from, const std::tstring &to)
+void utils::text::treplace_all(std::wstring* data, const std::wstring &from, const std::wstring &to)
{
- std::tstring::size_type position = 0;
+ std::wstring::size_type position = 0;
- while ((position = data->find(from, position)) != std::tstring::npos)
+ while ((position = data->find(from, position)) != std::wstring::npos)
{
data->replace(position, from.size(), to);
position++;
@@ -379,19 +379,19 @@ std::string utils::text::source_get_form_data(std::string* data, boolean hiddenO
return values;
}
-std::tstring utils::text::prepare_name(const std::tstring &name, bool withSurnameLetter)
+std::wstring utils::text::prepare_name(const std::wstring &name, bool withSurnameLetter)
{
- std::tstring::size_type pos = name.find(L" ");
- if (pos == std::tstring::npos)
+ std::wstring::size_type pos = name.find(L" ");
+ if (pos == std::wstring::npos)
return name;
- std::tstring result = name.substr(0, pos);
+ std::wstring result = name.substr(0, pos);
if (withSurnameLetter) {
pos = name.rfind(L" ") + 1; // we're sure there is some space in name so we can do +1 safely
if (pos < name.length())
- result += L" " + name.substr(pos, 1) + std::tstring(L".");
+ result += L" " + name.substr(pos, 1) + std::wstring(L".");
}
return result;
diff --git a/utils/std_string_utils.h b/utils/std_string_utils.h
index af03718385..d9c1b4923a 100644
--- a/utils/std_string_utils.h
+++ b/utils/std_string_utils.h
@@ -63,7 +63,7 @@ namespace utils
{
void replace_first(std::string* data, const std::string &from, const std::string &to);
void replace_all(std::string* data, const std::string &from, const std::string &to);
- void treplace_all(std::tstring* data, const std::tstring &from, const std::tstring &to);
+ void treplace_all(std::wstring* data, const std::wstring &from, const std::wstring &to);
unsigned int count_all(std::string* data, const std::string &term);
std::string html_entities_decode(std::string data);
std::string remove_html(const std::string &data);
@@ -75,7 +75,7 @@ namespace utils
std::string rand_string(int len, const char *chars = "0123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz", unsigned int *number = NULL);
void explode(std::string str, const std::string &separator, std::vector<std::string>* results);
void append_ordinal(unsigned long value, std::string* data);
- std::tstring prepare_name(const std::tstring &name, bool withSurnameLetter);
+ std::wstring prepare_name(const std::wstring &name, bool withSurnameLetter);
};
namespace conversion
diff --git a/utils/utf8_helpers.h b/utils/utf8_helpers.h
index 4928f04557..34ebfd5104 100644
--- a/utils/utf8_helpers.h
+++ b/utils/utf8_helpers.h
@@ -131,7 +131,7 @@ public:
throw L"Could not convert string to ACP";
}
- tchar = (TCHAR *) mir_alloc(size * sizeof(char));
+ tchar = (wchar_t *) mir_alloc(size * sizeof(char));
if (tchar == NULL)
{
mir_free(tmp);
@@ -151,30 +151,30 @@ public:
mir_free(tchar);
}
- TCHAR *detach()
+ wchar_t *detach()
{
- TCHAR *ret = tchar;
+ wchar_t *ret = tchar;
tchar = NULL;
return ret;
}
- TCHAR * get() const
+ wchar_t * get() const
{
return tchar;
}
- operator TCHAR *() const
+ operator wchar_t *() const
{
return tchar;
}
- TCHAR & operator[](int pos)
+ wchar_t & operator[](int pos)
{
return tchar[pos];
}
private:
- TCHAR *tchar;
+ wchar_t *tchar;
};
@@ -206,38 +206,38 @@ public:
#endif
}
- TCHAR *detach()
+ wchar_t *detach()
{
#ifdef UNICODE
- TCHAR *ret = tchar;
+ wchar_t *ret = tchar;
#else
- TCHAR *ret = (tchar == NULL ? NULL : mir_strdup(tchar));
+ wchar_t *ret = (tchar == NULL ? NULL : mir_strdup(tchar));
#endif
tchar = NULL;
return ret;
}
- const TCHAR * get() const
+ const wchar_t * get() const
{
return tchar;
}
- operator const TCHAR *() const
+ operator const wchar_t *() const
{
return tchar;
}
- const TCHAR & operator[](int pos) const
+ const wchar_t & operator[](int pos) const
{
return tchar[pos];
}
private:
#ifdef UNICODE
- TCHAR *tchar;
+ wchar_t *tchar;
#else
- const TCHAR *tchar;
+ const wchar_t *tchar;
#endif
};
@@ -270,38 +270,38 @@ public:
#endif
}
- TCHAR *detach()
+ wchar_t *detach()
{
#ifdef UNICODE
- TCHAR *ret = (tchar == NULL ? NULL : mir_wstrdup(tchar));
+ wchar_t *ret = (tchar == NULL ? NULL : mir_wstrdup(tchar));
#else
- TCHAR *ret = tchar;
+ wchar_t *ret = tchar;
#endif
tchar = NULL;
return ret;
}
- const TCHAR * get() const
+ const wchar_t * get() const
{
return tchar;
}
- operator const TCHAR *() const
+ operator const wchar_t *() const
{
return tchar;
}
- const TCHAR & operator[](int pos) const
+ const wchar_t & operator[](int pos) const
{
return tchar[pos];
}
private:
#ifdef UNICODE
- const TCHAR *tchar;
+ const wchar_t *tchar;
#else
- TCHAR *tchar;
+ wchar_t *tchar;
#endif
};
@@ -357,7 +357,7 @@ private:
class TcharToChar
{
public:
- TcharToChar(const TCHAR *str) : val(NULL)
+ TcharToChar(const wchar_t *str) : val(NULL)
{
if (str == NULL)
return;
@@ -421,7 +421,7 @@ private:
class TcharToWchar
{
public:
- TcharToWchar(const TCHAR *str) : val(NULL)
+ TcharToWchar(const wchar_t *str) : val(NULL)
{
if (str == NULL)
return;
@@ -534,7 +534,7 @@ public:
return ret;
}
- operator const TCHAR *()
+ operator const wchar_t *()
{
#ifdef UNICODE
@@ -569,7 +569,7 @@ private:
#ifndef UNICODE
- TCHAR *tchar;
+ wchar_t *tchar;
void freeTchar()
{