├── .gitattributes ├── .gitignore ├── .travis.yml ├── README.md ├── Release ├── .reset_portable.cmd ├── T-Clock Help.rtf ├── digital-7 (mono).ttf ├── digital-7.txt └── waves │ ├── Alarm.pcb │ ├── Alarm.wav │ ├── Bigben.wav │ ├── Blip.wav │ ├── Buzzer.wav │ ├── ChurchBell.wav │ ├── Clock.wav │ ├── ClockChimes.wav │ ├── Cuckoo.wav │ ├── SOS.pcb │ ├── Sync.wav │ ├── Timer.wav │ ├── beep.pcb │ ├── demo.pcb │ ├── gong.wav │ ├── hourlybass.pcb │ ├── misslebeep.wav │ ├── misslebeep3.wav │ ├── telephone.pcb │ ├── terror.pcb │ └── ufofly.wav └── src ├── Calendar ├── DeskCalendar.c ├── calendar.ico └── resource.rc ├── Clock ├── BounceWind.c ├── Clock.ico ├── ExitWindows.c ├── JackRussel.bmp ├── PLAY.ico ├── PageHotKey.c ├── PageMisc.c ├── PageMouse.c ├── PageQuicky.c ├── PageQuickyMenu.c ├── SNTP.c ├── StopWatch.c ├── alarm.c ├── alarmday.c ├── del.ico ├── main.c ├── menu.c ├── mouse.c ├── pageabout.c ├── pagealarm.c ├── pagecolor.c ├── pageformat.c ├── propsheet.c ├── settings.c ├── soundselect.c ├── stop.ico ├── tClock.rc ├── tclock.h ├── timer.c ├── version.rc └── version64.rc ├── DLL ├── DLL.def ├── Tclock.c ├── clock_api.c ├── clock_color.c ├── clock_internal.h ├── clock_utils.c ├── font.c ├── format.c ├── main.c ├── tcdll.h ├── version.rc └── version64.rc ├── To-Do List.txt ├── common ├── .coverity_model.c ├── AutoVersion.exe ├── HaveSetTimePerms.c ├── autoversion.cpp ├── calendar.inc ├── clock.c ├── clock.h ├── control_extensions.c ├── control_extensions.h ├── getopt_tools.c ├── getopt_tools.h ├── globals.h ├── icons │ ├── about.xml │ ├── arrow-refresh-small.ico │ ├── arrow-refresh.ico │ ├── cog.ico │ ├── license.txt │ ├── stoic.ico │ ├── white-tiger.ico │ └── xmas_stoic.ico ├── manifest.xml ├── messagebox_custom.c ├── messagebox_custom.h ├── newapi.c ├── newapi.h ├── resource.h ├── utl.c ├── utl.h ├── utl_logging.h ├── version.h ├── win2k_compat.c └── win2k_compat.h ├── compile.bat ├── options ├── main.c ├── resource.h ├── resource.rc ├── update.c └── update.h ├── sign-n-zip.bat ├── version └── ~ide ├── .colorgccrc ├── Makefile ├── cbp2make.bat ├── cbp2make.cfg ├── gcc-autoversion.cbp ├── gcc-autoversion.make ├── gcc-calendar.cbp ├── gcc-calendar.make ├── gcc-clock.cbp ├── gcc-clock.make ├── gcc-dll.cbp ├── gcc-dll.make ├── gcc-options.cbp ├── gcc-options.make ├── gcc.workspace ├── lib32 └── libwinhttp.a ├── lib64 └── libwinhttp.a ├── linux-autoversion.make ├── linux-calendar.make ├── linux-clock.make ├── linux-dll.make ├── linux-options.make ├── makex ├── msbuild-sdk7.1-x86.cmd ├── msbuild-sdk7.1-x86_64.cmd ├── msvc-cb-autoversion.cbp ├── msvc-cb-calendar.cbp ├── msvc-cb-clock.cbp ├── msvc-cb-dll.cbp ├── msvc-cb-options.cbp ├── msvc-cb.workspace ├── msvc-common.props ├── msvc-vs-autoversion.vcxproj ├── msvc-vs-calendar.vcxproj ├── msvc-vs-clock.vcxproj ├── msvc-vs-dll.vcxproj ├── msvc-vs-options.vcxproj ├── msvc-vs.sln └── tool ├── colorgcc └── warn_summary /.gitattributes: -------------------------------------------------------------------------------- 1 | *.sln text eol=crlf 2 | *.vcxproj text eol=crlf 3 | *.vcxproj.filters text eol=crlf 4 | *.props text eol=crlf 5 | *.txt text eol=crlf 6 | *.cmd text eol=crlf 7 | *.bat text eol=lf 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Thumbs.db 2 | *.obj 3 | *.exe 4 | *.dll 5 | *.pdb 6 | *.user 7 | *.aps 8 | *.pch 9 | *.ipch 10 | *.vspscc 11 | *_i.c 12 | *_p.c 13 | *.ncb 14 | *.suo 15 | *.sln.docstates 16 | *.tlb 17 | *.tlh 18 | *.bak 19 | *.cache 20 | *.ilk 21 | *.log 22 | [Bb]in 23 | [Dd]ebug*/ 24 | *.lib 25 | *.sbr 26 | obj/ 27 | _ReSharper*/ 28 | [Tt]est[Rr]esult* 29 | .local/ 30 | *.sdf 31 | 32 | .obj*/ 33 | !Release/waves/* 34 | !Release/*.rtf 35 | *.exp 36 | */Win32/Debug/ 37 | */Win32/Release/ 38 | */x64/Debug/ 39 | */x64/Release/ 40 | */cov-int 41 | T-Clock*.zip 42 | T-Clock*.7z 43 | *.layout 44 | *.save 45 | *.depend 46 | *log.html 47 | *.lnk 48 | *Results.xml 49 | 50 | _* 51 | Static/ 52 | *.[0-9].* 53 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: c 3 | 4 | sudo: false 5 | 6 | cache: ccache 7 | 8 | env: 9 | global: 10 | - TRAVIS_COMMIT_MSG="${TRAVIS_COMMIT_MSG:-$(git log --format=%B --no-merges -n1)}" 11 | #- CCACHE=ccache 12 | # Coverity hack to disable Coverity by default unless [ci coverity] was specified in commit message 13 | - TRAVIS_PULL_REQUEST="$((echo $TRAVIS_PULL_REQUEST | grep -q 'false' && echo $TRAVIS_COMMIT_MSG | grep -qE '\[ci (scan|cov(erity)?)\]') && echo -n false || echo -n true)" 14 | - secure: "DEXcC9CT8pneavqbNgiAtq1v59E3KZn2AlLYdfhzRa6W2k5lr7yyf+21rCczK1YvMt9hjGkKMMTthU/huHF774t/LK0IEtXAh+HjdiQpRQhiYl7jGT4SD5fSfkMlIwGUtLJixp8I5ny8W/OOCiOf1ARpHyPd1K55WuUyaIwCl6k=" 15 | - secure: "GkMTrWzbkV4fxji32DtCwvUELBWSHKo9GKzuqL4JdVUpvYraLVT/jMfRKMdceUcE+a88l0ZL6CXqLz/aA8qp6ULY5MXxgCMmrPYqzewpjbvtvoxcedrsu9wue3kpe2MzgGz7yg5/Kf0Rj8ejMLa1ZSyAa9TlCody5pIzRVJAPMk=" 16 | # certificate for tag releases 17 | - secure: nEd22lqGEnA0FSLfsoS/NwTWTqYcAPUMjM5QyJDkxWm1jXb3AScfQKhoLV+Mb1TbZIOpCQNHFUx2mVMCHQyRtx3MlkDiNyFwt9D5VWiF8tNWUS4hX0XHI6NnW5UYqqGtuXZNwNvWBIJqDhOJH6fkUfD+fjG3ANKSQX1K+Of3PZY= 18 | - secure: NQbryvM0ff6ZncpyslLT3uoa2IeOUDDj4FWLJj0vmIz7GSE9Ja7INUsJ6HUu0QmsqfgnJ8/TSIje0hLz7OGQLhcVXCGMIYjeUIUPA4kVV8KnQonFHOI4R5F+7VO93EW29LYcvfGojuInAP4y9mxqKoQcMEsx9ImCl6QvUf/+WaM= 19 | 20 | addons: 21 | apt: 22 | packages: 23 | # travis default: sudo aptitude install git git-svn ruby rubygems ruby-json 24 | # travis setup: sudo aptitude install gcc-multilib g++-multilib binutils-mingw-w64-i686 gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-x86-64 gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 p7zip-full autoconf libcurl4-openssl-dev 25 | # 32bit gcc (for AutoVersion) 26 | - gcc-multilib 27 | - g++-multilib 28 | # 32bit MinGW 29 | - binutils-mingw-w64-i686 30 | - gcc-mingw-w64-i686 31 | - g++-mingw-w64-i686 32 | # 64bit MinGW 33 | - binutils-mingw-w64-x86-64 34 | - gcc-mingw-w64-x86-64 35 | - g++-mingw-w64-x86-64 36 | # tag release 37 | - p7zip-full 38 | - autoconf 39 | - libcurl4-openssl-dev 40 | # testing 41 | #- wine 42 | coverity_scan: 43 | project: 44 | name: White-Tiger/T-Clock 45 | description: Build submitted via Travis CI 46 | notification_email: 47 | secure: Guqbi+ipUVfFpkJZsyrzMqmVqFA6dJKnhGau/FB/RcvLWRZD6hdArZlECRe9gQHjTg82gPOqwMjOmLlDQjWEXUua93E3dxTAAkiHVyweocKF2W7bAqhVKD6FB1bwcpA7CV/n5InvqfvFnhp/4J3kyb9qRFGPjaWcUiw7z4fFuqk= 48 | build_command_prepend: | 49 | which ccache 50 | which i686-w64-mingw32-gcc 51 | cov-configure --compiler=i686-w64-mingw32-gcc --comptype=gcc --template 52 | cov-configure --compiler=x86_64-w64-mingw32-gcc --comptype=gcc --template 53 | ccache --clear 54 | ./compile.bat clean 55 | build_command: . compile.bat 56 | branch_pattern: ".*" 57 | 58 | deploy: 59 | provider: releases 60 | api_key: 61 | secure: SxspqObGcVCG8bpDS/aHtAYSl30mAiTWl+KcpWBET1rTwqOnnVSU/G86ylFMURpvXams8IT8+ld3m7uqINwnhwmzmIXtdECVI9LKgD7T1cgaZyK03TMzRfnXsW4EnpjVYnfwuYnioom3LH2FdBR3zLJuyxSq8OSrrkSFJ7BqQxM= 62 | file_glob: true 63 | file: 64 | - Release/T-Clock*.7z 65 | - Release/T-Clock*.zip 66 | skip_cleanup: true 67 | on: 68 | tags: true 69 | 70 | before_script: # also before Coverity 71 | - pushd src 72 | script: 73 | - . compile.bat 74 | after_success: 75 | - ./sign-n-zip.bat 76 | - popd 77 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | T-Clock Redux 2 | ============== 3 | GCC(MinGW-w64) [![Build Status](https://travis-ci.org/White-Tiger/T-Clock.svg?branch=yg-master)](https://travis-ci.org/White-Tiger/T-Clock) [![Coverity Status](https://scan.coverity.com/projects/3794/badge.svg)](https://scan.coverity.com/projects/white-tiger-t-clock) MSVC [![Build status](https://ci.appveyor.com/api/projects/status/b3qehrl4c8naisx4?svg=true)](https://ci.appveyor.com/project/White-Tiger/t-clock) (click picture below for full size) 4 | ![clockshowcase](https://cloud.githubusercontent.com/assets/1467733/4608572/71b48156-5283-11e4-960f-b0415b5b7cec.png) 5 | **T-Clock Redux** is an enhanced fork of [Stoic Joker's T-Clock 2010](http://www.stoicjoker.com/TClock/) 6 | with ISO week number support, bug fixes and the ability to use Windows' default calendar and tooltips. 7 | 8 | T-Clock *(called TClock)*, originally written by Kazubon in the early 90's, was a popular classic that was on the edge of extinction when Windows started going 64bit. ... Stoic Joker simply chose not to let that happen. And now it's up to us to continue their efforts. 9 | 10 | If you don't mind to read lots of text, and want to know more about T-Clock and its history: [check this page out!](http://web.archive.org/web/20160202023839/http://greggdeselms.com/tclock.html) *(thanks Gregg)* 11 | 12 | 13 | ### Downloads *(binaries)* 14 | * [![all releases](https://img.shields.io/badge/ALL-RELEASES-brightgreen.svg?logo=github&style=flat-square) ![](https://img.shields.io/github/downloads/White-Tiger/T-Clock/total.svg?style=flat-square)](//github.com/White-Tiger/T-Clock/releases) 15 | * [![stable](https://img.shields.io/github/release/White-Tiger/T-Clock.svg?label=STABLE&logo=github&style=flat-square) ![](https://img.shields.io/github/downloads/White-Tiger/T-Clock/latest/total.svg?style=flat-square) ![](https://img.shields.io/github/release-date/White-Tiger/T-Clock.svg?style=flat-square)](//github.com/White-Tiger/T-Clock/releases/latest) 16 | * [![beta](https://img.shields.io/github/release/White-Tiger/T-Clock/all.svg?label=BETA&logo=github&style=flat-square) ![](https://img.shields.io/github/downloads-pre/White-Tiger/T-Clock/latest/total.svg?style=flat-square) ![](https://img.shields.io/github/release-date-pre/White-Tiger/T-Clock.svg?style=flat-square)](//github.com/White-Tiger/T-Clock/releases) 17 | * [![nightly](https://img.shields.io/badge/NIGHTLY-for_testing_only-ff69b4.svg?logo=travis&style=flat-square) ![](https://img.shields.io/github/commits-since/White-Tiger/T-Clock/latest.svg?style=flat-square) ![](https://img.shields.io/github/last-commit/White-Tiger/T-Clock.svg?style=flat-square)](//drive.google.com/open?id=1m18Jb-eZya6to3NsXUlZeC2ITjXdM7IU) 18 | 19 | #### Differences to Stoic Joker's T-Clock 2010 [Build 95/98](http://www.donationcoder.com/forum/index.php?topic=21944.0) 20 | - [x] + supports Win10 with 1st-Anniversary update *(v2.4.1)* 21 | - [x] + Unicode support *(v2.4.1)* 22 | - [x] * improved file structure 23 | - [x] + ISO-8601 week number support *(Wi)* 24 | - [x] + original Windows calendar and tooltip usable 25 | - [x] + support for clocks on every additional taskbar on Win8+ 26 | - [x] + system/user dependent default colors 27 | - [x] + clock text angle freely adjustable 28 | - [x] + live update of clock text related changes *(see what happens as you change it and before you apply it)* 29 | - [x] + clock text always automatically centered 30 | - [x] + right mouse click can be customized 31 | - [x] + mouse button 4 and 5 supported 32 | - [x] * improved taskbar support such as horizontal vs vertical and size 33 | - [x] + calendar hides on 2nd click if opened before *(autohide must be enabled, Windows default behavior)* 34 | - [x] + custom calendar can now show X past months, additional improvements 35 | - [x] + extended right-click menu with more Windows like behavior 36 | *(hold down CTRL or SHIFT to get "Run ..." and "Exit Explorer" items)* 37 | - [x] + simplified mouse click preferences page 38 | - [x] + default configuration with Windows like behavior and clock with line-break on Vista+ *(easier for first-time users)* 39 | - [x] + more mouse commands / customization 40 | - [x] + overall improved settings dialog *(so many changes.. can't name them all)* 41 | - [x] * improved Stopwatch *(hotkeys, export, stats)* 42 | - [x] * improved drag&drop support 43 | - [x] ! some bugfixes 44 | - [x] * some minor and major rewrites and changes 45 | - [x] ! can be compiled with MinGW/GCC *(allows more people to work on it and also fixed bugs)* 46 | - [x] ! fixed clock text transparency issues on Vista+ 47 | - [x] + portable mode using .ini files as configuration storage *(v2.4.0)* 48 | - [x] + inbuild update checker *(v2.4.0)* 49 | - [ ] + enhanced time format editor incl. realtime preview *tbd* 50 | - [ ] + ability to use different timezones on modifiers *tbd* 51 | - [ ] + LClock formating options such as different fonts and positions for time and date *tbd* 52 | - [ ] + working timezone identifiers *tbd* 53 | - [ ] + multilingual version? *tbd* 54 | - [ ] + resource usage % format option (CPU,RAM maybe GPU) *tbd* 55 | - [ ] + improved time synchronization incl. autorun at startup (requires admin rights for "install") *tbd* 56 | - [ ] + mouseover customization, for example different time format, color, border or even current weather *tbd* 57 | - [ ] + switching clock text, eg. every 2 seconds another one *tbd* 58 | - [ ] + multiple clock text presets? eg. switch between them on mouse click *tbd* 59 | - [ ] + maybe current sun state picture as clock background (plugin) *tbd* 60 | - [ ] + improved hotkey support *tbd* 61 | 62 | ### Requirements 63 | * Windows 2000+ *(up to Windows 10 as of 2014)* 64 | 65 | ### What's that `_vc2010` build? 66 | * As of 2018, all new releases will be build with GCC instead of the Visual C++ 2010 compiler. 67 | So the previously known `_static` builds are used instead and for compatibility reasons, 68 | `_vc2010` archives will still use the old compiler and are meant for advanced users. 69 | * Requires: [Microsoft Visual C++ 2010 Redistributable](http://microsoft.com/en-us/download/details.aspx?id=26999) (install **both** 32bit `vcredist_x86` + 64bit `vcredist_x64` **on 64bit** OS) 70 | 71 | ### Support 72 | * [Forum](http://donationcoder.com/forum/?board=324) 73 | * [Issue Tracker](//github.com/White-Tiger/T-Clock/issues) 74 | * or via email from T-Clock's about screen *(just click on it)* 75 | 76 | ### License 77 | * GPLv2 ? *(license is currently unknown, needs further research)* 78 | ~~~~ 79 | -------------------------------------------------------------------------------- /Release/.reset_portable.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | pushd %~dp0 3 | ( set/P="" T-Clock.ini 4 | echo T-Clock.ini created, portable mode active 5 | popd & echo anykey to exit & cmd /C "pause>nul" 6 | -------------------------------------------------------------------------------- /Release/digital-7 (mono).ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/Release/digital-7 (mono).ttf -------------------------------------------------------------------------------- /Release/digital-7.txt: -------------------------------------------------------------------------------- 1 | this font is from: 2 | http://www.styleseven.com/php/get_product.php?product=Digital-7 3 | just install it by double-clicking and then click on "Install" (or copy to C:\WINDOWS\Fonts) 4 | you'll need to enable it in T-Clock though... 5 | Settings->Clock Text, and select font 6 | -------------------------------------------------------------------------------- /Release/waves/Alarm.pcb: -------------------------------------------------------------------------------- 1 | 100,1800 2 | 100,1800 3 | 100,1800 4 | 100,1800 5 | 400,-1 6 | 100,1800 7 | 100,1800 8 | 100,1800 9 | 100,1800 10 | 400,-1 11 | -------------------------------------------------------------------------------- /Release/waves/Alarm.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/Release/waves/Alarm.wav -------------------------------------------------------------------------------- /Release/waves/Bigben.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/Release/waves/Bigben.wav -------------------------------------------------------------------------------- /Release/waves/Blip.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/Release/waves/Blip.wav -------------------------------------------------------------------------------- /Release/waves/Buzzer.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/Release/waves/Buzzer.wav -------------------------------------------------------------------------------- /Release/waves/ChurchBell.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/Release/waves/ChurchBell.wav -------------------------------------------------------------------------------- /Release/waves/Clock.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/Release/waves/Clock.wav -------------------------------------------------------------------------------- /Release/waves/ClockChimes.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/Release/waves/ClockChimes.wav -------------------------------------------------------------------------------- /Release/waves/Cuckoo.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/Release/waves/Cuckoo.wav -------------------------------------------------------------------------------- /Release/waves/SOS.pcb: -------------------------------------------------------------------------------- 1 | 150,500 2 | 150,500 3 | 150,500 4 | 150,-1 5 | 450,500 6 | 450,500 7 | 450,500 8 | 50,-1 9 | 150,500 10 | 150,500 11 | 150,500 12 | 900,-1 13 | -------------------------------------------------------------------------------- /Release/waves/Sync.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/Release/waves/Sync.wav -------------------------------------------------------------------------------- /Release/waves/Timer.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/Release/waves/Timer.wav -------------------------------------------------------------------------------- /Release/waves/beep.pcb: -------------------------------------------------------------------------------- 1 | 400,1000 2 | 400,-1 3 | 200,1000 4 | 200,1100 5 | 400,-1 6 | 400,1000 7 | 400,-1 8 | 200,1000 9 | 200,1100 10 | 2000,-1 11 | 400,1000 12 | 400,-1 13 | 200,1000 14 | 200,1100 15 | 400,-1 16 | 400,1000 17 | 400,-1 18 | 200,1000 19 | 200,1100 20 | 400,-1 21 | 400,1000 22 | 400,-1 23 | 200,1000 24 | 200,1100 25 | 2000,-1 26 | -------------------------------------------------------------------------------- /Release/waves/demo.pcb: -------------------------------------------------------------------------------- 1 | 100, 400 2 | 100, -1 3 | 100, 500 4 | 100, -1 5 | 100, 600 6 | 100, -1 7 | 100, 500 8 | 100, -1 9 | 100, 400 10 | 500, -1 11 | -------------------------------------------------------------------------------- /Release/waves/gong.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/Release/waves/gong.wav -------------------------------------------------------------------------------- /Release/waves/hourlybass.pcb: -------------------------------------------------------------------------------- 1 | 200,60 2 | 200,60 3 | 400,-1 4 | -------------------------------------------------------------------------------- /Release/waves/misslebeep.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/Release/waves/misslebeep.wav -------------------------------------------------------------------------------- /Release/waves/misslebeep3.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/Release/waves/misslebeep3.wav -------------------------------------------------------------------------------- /Release/waves/telephone.pcb: -------------------------------------------------------------------------------- 1 | 1200,400 2 | 2400,-1 3 | 1200,400 4 | 2400,-1 5 | 1200,400 6 | 2400,-1 7 | 1200,400 8 | 2400,-1 9 | 1200,400 10 | 1000,-1 11 | 400,400 12 | 400,400 13 | 400,400 14 | 400,400 15 | 400,400 16 | 400,400 17 | 400,400 18 | -------------------------------------------------------------------------------- /Release/waves/terror.pcb: -------------------------------------------------------------------------------- 1 | 400,1100 2 | 400,1160 3 | 400,1100 4 | 400,1160 5 | 400,1100 6 | 400,1160 7 | 190,1100 8 | 190,1160 9 | 190,1100 10 | 190,1160 11 | 190,1100 12 | 190,1160 13 | 190,1100 14 | 190,1160 15 | 190,1100 16 | 190,1160 17 | 90,1100 18 | 90,1160 19 | 90,1100 20 | 90,1160 21 | 90,1100 22 | 90,1160 23 | 90,1100 24 | 90,1160 25 | 90,1100 26 | 90,1160 27 | 90,1100 28 | 90,1160 29 | 400,1100 30 | 400,-1 31 | 400,1100 32 | 400,-1 33 | 400,1100 34 | 400,-1 35 | 1200,1100 36 | -------------------------------------------------------------------------------- /Release/waves/ufofly.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/Release/waves/ufofly.wav -------------------------------------------------------------------------------- /src/Calendar/calendar.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/src/Calendar/calendar.ico -------------------------------------------------------------------------------- /src/Calendar/resource.rc: -------------------------------------------------------------------------------- 1 | // Generated by ResEdit 1.5.11 2 | // Copyright (C) 2006-2012 3 | // http://www.resedit.net 4 | 5 | #include 6 | #include 7 | #include 8 | #include "../common/resource.h" 9 | #include "../common/version.h" 10 | 11 | 12 | 13 | // 14 | // Icon resources 15 | // 16 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL 17 | IDI_MAIN ICON "calendar.ico" 18 | 19 | 20 | 21 | // 22 | // Version Information resources 23 | // 24 | VS_VERSION_INFO VERSIONINFO 25 | FILEVERSION VER_RC_REVISION 26 | PRODUCTVERSION VER_RC_REVISION 27 | FILEFLAGSMASK 0x3fL 28 | #ifdef _DEBUG 29 | FILEFLAGS VS_FF_DEBUG 30 | #else 31 | FILEFLAGS 0x0L 32 | #endif 33 | FILEOS 0x40004L 34 | FILETYPE 0x1L 35 | FILESUBTYPE 0x0L 36 | { 37 | BLOCK "StringFileInfo" 38 | { 39 | BLOCK "000004b0" 40 | { 41 | VALUE "Comments", "" 42 | VALUE "CompanyName", "-" 43 | VALUE "FileDescription", "T-Clock Calendar" 44 | VALUE "FileVersion", VER_SHORT " #" STR(VER_REVISION) 45 | VALUE "InternalName", "XPCalendar.exe" 46 | VALUE "OriginalFilename", "XPCalendar.exe" 47 | VALUE "ProductName", "T-Clock Redux" 48 | VALUE "ProductVersion", VER_SHORT " #" STR(VER_REVISION) 49 | } 50 | } 51 | BLOCK "VarFileInfo" 52 | { 53 | VALUE "Translation", 0x0, 1200 54 | } 55 | } 56 | 57 | 58 | 59 | // 60 | // Manifest resources 61 | // 62 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL 63 | 1 RT_MANIFEST "../common/manifest.xml" 64 | -------------------------------------------------------------------------------- /src/Clock/Clock.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/src/Clock/Clock.ico -------------------------------------------------------------------------------- /src/Clock/ExitWindows.c: -------------------------------------------------------------------------------- 1 | #include "tclock.h" 2 | 3 | static int GetShutdownPrivilege() 4 | { 5 | HANDLE hToken; 6 | TOKEN_PRIVILEGES tkp; 7 | if(OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY, &hToken)) { 8 | LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &tkp.Privileges[0].Luid); 9 | tkp.PrivilegeCount = 1; 10 | tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; 11 | AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, NULL, NULL); 12 | return GetLastError() == ERROR_SUCCESS; 13 | } 14 | return 0; 15 | } 16 | 17 | int WindowsExit(int ewx_type) 18 | { 19 | if(ewx_type == EWX_LOGOFF || GetShutdownPrivilege()) 20 | return ExitWindowsEx(ewx_type | EWX_FORCEIFHUNG, 0); 21 | return 0; 22 | } 23 | 24 | int WindowsSleep(int standby) 25 | { 26 | if(GetShutdownPrivilege()) 27 | return SetSystemPowerState(standby, 0); // Win2k reports ERROR_NOT_SUPPORTED 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /src/Clock/JackRussel.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/src/Clock/JackRussel.bmp -------------------------------------------------------------------------------- /src/Clock/PLAY.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/src/Clock/PLAY.ico -------------------------------------------------------------------------------- /src/Clock/PageQuicky.c: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // PageQuicky.c - Stoic Joker 2006 ======================================== 3 | //============================================================================== 4 | #include "tclock.h" 5 | //------------------------------------------------------------------------------ 6 | /* Modified by Stoic Joker: Sunday, 03/14/2010 @ 10:48:18AM */ 7 | 8 | void AddListBoxRows(HWND); 9 | static void OnInit(HWND hDlg); 10 | static void OnApply(HWND hDlg); 11 | 12 | INT_PTR CALLBACK Page_QuickyMenu(HWND, UINT, WPARAM, LPARAM); // PageQuickyMenu.c 13 | 14 | #define SendPSChanged(hDlg) SendMessage(GetParent(hDlg),PSM_CHANGED,(WPARAM)(hDlg),0) 15 | //================================================================================================ 16 | //----------------------------------------+++--> Dialog Procedure for Quicky Menus Dialog Messages: 17 | INT_PTR CALLBACK Page_Quicky(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) //----+++--> 18 | { 19 | switch(message) { 20 | case WM_INITDIALOG:{ 21 | wchar_t szText[TNY_BUFF]; 22 | LVCOLUMN lvCol; 23 | int iCol = 0; 24 | 25 | lvCol.pszText = szText; 26 | 27 | OnInit(hDlg); 28 | ListView_SetExtendedListViewStyle(GetDlgItem(hDlg,IDC_QMEN_LIST), LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_DOUBLEBUFFER); 29 | SetXPWindowTheme(GetDlgItem(hDlg,IDC_QMEN_LIST), L"Explorer", NULL); 30 | 31 | lvCol.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; // Load the Column Headers. 32 | for(iCol = IDS_LIST_TASKNAME; iCol <= IDS_LIST_TASKSWITCHES; iCol++) { 33 | lvCol.iSubItem = iCol; // From the String Table 34 | if(iCol == IDS_LIST_TASKNAME) { 35 | lvCol.cx = 100; // Set Column Width in Pixels 36 | lvCol.fmt = LVCFMT_LEFT; // left-aligned column 37 | } else if(iCol == IDS_LIST_TASKTARGET) { 38 | lvCol.cx = 220; // Set Column Width in Pixels 39 | lvCol.fmt = LVCFMT_LEFT; // left-aligned column 40 | } else if(iCol == IDS_LIST_TASKSWITCHES) { 41 | lvCol.cx = 105; // Set Column Width in Pixels 42 | lvCol.fmt = LVCFMT_LEFT; // left-aligned column 43 | } 44 | LoadString(0, iCol, lvCol.pszText, _countof(szText)); // <-- String Loads Here. 45 | ListView_InsertColumn(GetDlgItem(hDlg,IDC_QMEN_LIST), iCol, &lvCol); // <- Now It's a Column Header 46 | } 47 | AddListBoxRows(GetDlgItem(hDlg,IDC_QMEN_LIST)); 48 | return TRUE;} 49 | 50 | case WM_COMMAND: { 51 | WORD id, code; 52 | id = LOWORD(wParam); 53 | code = HIWORD(wParam); 54 | if((IDC_QMEN_EXITWIN <= id && id <= IDC_QMEN_DISPLAY) && 55 | ((code == BST_CHECKED) || (code == BST_UNCHECKED))) { 56 | SendPSChanged(hDlg); 57 | } 58 | if(id == IDM_QMEM_REFRESH) { 59 | AddListBoxRows(GetDlgItem(hDlg,IDC_QMEN_LIST)); 60 | } 61 | return TRUE;} 62 | case WM_NOTIFY: { 63 | NMHDR* noti=(NMHDR*)lParam; 64 | if(noti->code == PSN_APPLY) { 65 | OnApply(hDlg); 66 | }else if(noti->code == LVN_KEYDOWN) { 67 | NMLVKEYDOWN* key=(NMLVKEYDOWN*)noti; 68 | int item=ListView_GetNextItem(GetDlgItem(hDlg,IDC_QMEN_LIST),-1,LVNI_SELECTED); 69 | int i; 70 | if(key->wVKey!=VK_SPACE || item==-1) 71 | return TRUE; 72 | for(i=IDC_QMEN_GROUP1; i<=IDC_QMEN_LIST; ++i) { 73 | ShowDlgItem(hDlg,i,0); 74 | } 75 | CreateDialogParam(0, MAKEINTRESOURCE(IDD_QUICKY_ADD), hDlg, Page_QuickyMenu, item); // initializes and kills itself 76 | }else if(noti->code == NM_DBLCLK) { 77 | NMITEMACTIVATE* itm=(NMITEMACTIVATE*)noti; 78 | int i; 79 | if(itm->iItem==-1) 80 | return TRUE; 81 | for(i=IDC_QMEN_GROUP1; i<=IDC_QMEN_LIST; ++i) { 82 | ShowDlgItem(hDlg,i,0); 83 | } 84 | CreateDialogParam(0, MAKEINTRESOURCE(IDD_QUICKY_ADD), hDlg, Page_QuickyMenu, itm->iItem); // initializes and kills itself 85 | } 86 | return TRUE;} 87 | } 88 | return FALSE; 89 | } 90 | /*-------------------------------------------------- 91 | ---------- Initialize Quicky Menu Options Dialog Box 92 | --------------------------------------------------*/ 93 | static void OnInit(HWND hDlg) /*---------------*/ 94 | { 95 | CheckDlgButton(hDlg, IDC_QMEN_AUDIO, api.GetInt(L"QuickyMenu", L"AudioProperties", TRUE)); 96 | CheckDlgButton(hDlg, IDC_QMEN_DISPLAY, api.GetInt(L"QuickyMenu", L"DisplayProperties", TRUE)); 97 | CheckDlgButton(hDlg, IDC_QMEN_EXITWIN, api.GetInt(L"QuickyMenu", L"ExitWindows", TRUE)); 98 | CheckDlgButton(hDlg, IDC_QMEN_LAUNCH, api.GetInt(L"QuickyMenu", L"QuickyMenu", TRUE)); 99 | CheckDlgButton(hDlg, IDC_QMEN_NET, api.GetInt(L"QuickyMenu", L"NetworkDrives", TRUE)); 100 | 101 | } 102 | /*-------------------------------------------------- 103 | --------------------- When "Apply" Button is Clicked 104 | --------------------------------------------------*/ 105 | void OnApply(HWND hDlg) /*---------------------*/ 106 | { 107 | api.SetInt(L"QuickyMenu", L"DisplayProperties", IsDlgButtonChecked(hDlg, IDC_QMEN_DISPLAY)); 108 | api.SetInt(L"QuickyMenu", L"AudioProperties", IsDlgButtonChecked(hDlg, IDC_QMEN_AUDIO)); 109 | api.SetInt(L"QuickyMenu", L"NetworkDrives", IsDlgButtonChecked(hDlg, IDC_QMEN_NET)); 110 | api.SetInt(L"QuickyMenu", L"ExitWindows", IsDlgButtonChecked(hDlg, IDC_QMEN_EXITWIN)); 111 | api.SetInt(L"QuickyMenu", L"QuickyMenu", IsDlgButtonChecked(hDlg, IDC_QMEN_LAUNCH)); 112 | } 113 | //================================================================================================ 114 | //------------------------------+++--> Populate ListView Control With Currently Configured Options: 115 | void AddListBoxRows(HWND hList) //--------------------------------------------------------+++--> 116 | { 117 | LVITEM lvItem; 118 | wchar_t key[TNY_BUFF]; 119 | int offset = 9; 120 | int idx; 121 | ListView_DeleteAllItems(hList); // Clear ListView Control (Refresh Function) 122 | 123 | memcpy(key, L"MenuItem-", offset*sizeof(wchar_t)); 124 | for(idx=12; idx--; ) { 125 | wchar_t szValue[LRG_BUFF]; 126 | lvItem.mask = LVIF_TEXT; 127 | lvItem.iItem = 0; 128 | lvItem.pszText = szValue; 129 | lvItem.iSubItem = 0; 130 | offset = 9 + wsprintf(key+9, FMT("%i"), idx); 131 | wcscpy(key+offset, L"-Text"); 132 | api.GetStr(L"QuickyMenu\\MenuItems", key, szValue, _countof(szValue), L"-"); 133 | ListView_InsertItem(hList, &lvItem); 134 | 135 | lvItem.iSubItem = 1; 136 | wcscpy(key+offset, L"-Target"); 137 | api.GetStr(L"QuickyMenu\\MenuItems", key, szValue, _countof(szValue), L""); 138 | ListView_SetItem(hList, &lvItem); 139 | 140 | lvItem.iSubItem = 2; 141 | wcscpy(key+offset, L"-Switches"); 142 | api.GetStr(L"QuickyMenu\\MenuItems", key, szValue, _countof(szValue), L""); 143 | ListView_SetItem(hList, &lvItem); 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /src/Clock/PageQuickyMenu.c: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // PageQuickyMenu.c - Stoic Joker 2006 ==================================== 3 | //============================================================================== 4 | #include "tclock.h" 5 | //------------------------------------------------------------------------------ 6 | /* Modified by Stoic Joker: Sunday, 03/14/2010 @ 10:48:18AM */ 7 | 8 | void BrowseForTargetFile(HWND); 9 | void DeleteMenuItem(HWND); 10 | void SaveNewMenuOptions(HWND hDlg); 11 | 12 | #define SendPSChanged(hDlg) SendMessage(GetParent(hDlg), PSM_CHANGED, (WPARAM)(hDlg), 0) 13 | /*------------------------------------------------- 14 | End edit and go back to Quicky-list 15 | -------------------------------------------------*/ 16 | void EndQuickyEdit(HWND hDlg) 17 | { 18 | HWND hParent=GetParent(hDlg); 19 | int i; 20 | for(i=IDC_QMEN_GROUP1; i<=IDC_QMEN_LIST; ++i) { 21 | ShowDlgItem(hParent,i,1); 22 | } 23 | SendMessage(hParent,WM_COMMAND,IDM_QMEM_REFRESH,0); 24 | SetFocus(GetDlgItem(hParent,IDC_QMEN_LIST)); 25 | DestroyWindow(hDlg); 26 | } 27 | //=============================================================================================== 28 | //----------------------------------+++--> Dialog Procedure for Menu Item Details Dialog Messages: 29 | INT_PTR CALLBACK Page_QuickyMenu(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) //-++--> 30 | { 31 | (void)lParam; 32 | switch(message) { 33 | case WM_INITDIALOG:{ 34 | wchar_t tmp[LRG_BUFF]; 35 | int idx = (int)lParam; 36 | HWND hParent = GetParent(hDlg); 37 | SetWindowLongPtr(hDlg, GWLP_USERDATA, idx); 38 | wsprintf(tmp, FMT("Item #%i"), idx+1); 39 | SetDlgItemText(hDlg, IDC_MID_TASKNUM, tmp); 40 | ListView_GetItemText(GetDlgItem(hParent,IDC_QMEN_LIST), idx, 1, tmp, _countof(tmp)); 41 | SetDlgItemText(hDlg, IDC_MID_TARGET, tmp); 42 | if(!tmp[0]){ // new item 43 | EnableDlgItem(hDlg, IDC_MID_DELETE, 0); 44 | }else 45 | ListView_GetItemText(GetDlgItem(hParent,IDC_QMEN_LIST), idx, 0, tmp, _countof(tmp)); 46 | SetDlgItemText(hDlg, IDC_MID_MENUTEXT, tmp); 47 | ListView_GetItemText(GetDlgItem(hParent,IDC_QMEN_LIST), idx, 2, tmp, _countof(tmp)); 48 | SetDlgItemText(hDlg, IDC_MID_SWITCHES, tmp); 49 | SetFocus(GetDlgItem(hDlg,IDC_MID_MENUTEXT)); 50 | return TRUE;} 51 | case WM_COMMAND: 52 | switch(LOWORD(wParam)){ 53 | case IDC_MID_TARGETSEL: 54 | BrowseForTargetFile(hDlg); 55 | break; 56 | case IDC_MID_SAVE: 57 | SaveNewMenuOptions(hDlg); 58 | break; 59 | case IDC_MID_DELETE: 60 | DeleteMenuItem(hDlg); 61 | /* fall through */ 62 | case IDC_MID_CANCEL: 63 | EndQuickyEdit(hDlg); 64 | } 65 | return TRUE; 66 | } 67 | return FALSE; 68 | } 69 | /*------------------------------------------------------------- 70 | Save the New Menu Item Options - From the Menu Item Details Tab 71 | -------------------------------------------------------------*/ 72 | void SaveNewMenuOptions(HWND hDlg) 73 | { 74 | /// @note : on next backward incompatible change, also change how we store QuickyMenu 75 | wchar_t key[TNY_BUFF]; 76 | int offset = 9; 77 | wchar_t szmText[TNY_BUFF]; 78 | wchar_t szmTarget[LRG_BUFF]; 79 | wchar_t szmSwitches[LRG_BUFF]; 80 | GetDlgItemText(hDlg, IDC_MID_MENUTEXT, szmText, _countof(szmText)); 81 | GetDlgItemText(hDlg, IDC_MID_TARGET, szmTarget, _countof(szmTarget)); 82 | GetDlgItemText(hDlg, IDC_MID_SWITCHES, szmSwitches, _countof(szmSwitches)); 83 | memcpy(key, L"MenuItem-", offset*sizeof(wchar_t)); 84 | offset += wsprintf(key+offset, FMT("%li"), GetWindowLong(hDlg,GWLP_USERDATA)); 85 | if((wcslen(szmText)) && (wcslen(szmTarget))) { 86 | api.SetInt(L"QuickyMenu\\MenuItems", key, 1); 87 | 88 | wcscpy(key+offset, L"-Text"); 89 | api.SetStr(L"QuickyMenu\\MenuItems", key, szmText); 90 | 91 | wcscpy(key+offset, L"-Target"); 92 | api.SetStr(L"QuickyMenu\\MenuItems", key, szmTarget); 93 | 94 | wcscpy(key+offset, L"-Switches"); 95 | api.SetStr(L"QuickyMenu\\MenuItems", key, szmSwitches); 96 | 97 | EndQuickyEdit(hDlg); 98 | } else { 99 | DeleteMenuItem(hDlg); 100 | wsprintf(szmSwitches, FMT("%s%s"), 101 | (!wcslen(szmText)?L"* Menu text can't be empty!\n":L""), 102 | (!wcslen(szmTarget)?L"* Target file must be filled!":L"")); 103 | MessageBox(0, szmSwitches, L"ERROR: Missing Information!", MB_OK|MB_ICONERROR|MB_SETFOREGROUND); 104 | } 105 | } 106 | /*--------------------------------------------------------------------------- 107 | -------------- DELETE a Menu Item - From the ListBox Control and the Registry 108 | ---------------------------------------------------------------------------*/ 109 | void DeleteMenuItem(HWND hDlg) 110 | { 111 | wchar_t key[TNY_BUFF]; 112 | int offset=9; 113 | memcpy(key, L"MenuItem-", offset * sizeof key[0]); 114 | offset += wsprintf(key+offset, FMT("%li"), GetWindowLong(hDlg,GWLP_USERDATA)); 115 | api.DelValue(L"QuickyMenu\\MenuItems", key); 116 | 117 | wcscpy(key+offset, L"-Text"); 118 | api.DelValue(L"QuickyMenu\\MenuItems", key); 119 | 120 | wcscpy(key+offset, L"-Target"); 121 | api.DelValue(L"QuickyMenu\\MenuItems", key); 122 | 123 | wcscpy(key+offset, L"-Switches"); 124 | api.DelValue(L"QuickyMenu\\MenuItems", key); 125 | } 126 | //================================================================================================ 127 | //-------------------------------------//------+++--> Browse to the Quicky Menu Item's Target File: 128 | void BrowseForTargetFile(HWND hBft) //----------------------------------------------------+++--> 129 | { 130 | wchar_t szFile[MAX_PATH]; 131 | 132 | if(SelectMyFile(hBft, L"Program Files (*.exe)\0*.exe\0" L"All Files (*.*)\0*.*\0", 0, NULL, szFile)) { 133 | SetDlgItemText(hBft, IDC_MID_TARGET, szFile); 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /src/Clock/alarmday.c: -------------------------------------------------------------------------------- 1 | /*------------------------------------------- 2 | alarmday.c - Kazubon 1999 3 | dialog to set days for alarm 4 | ---------------------------------------------*/ 5 | #include "tclock.h" 6 | 7 | INT_PTR CALLBACK Window_AlarmDaySelectDlg(HWND, UINT, WPARAM, LPARAM); 8 | static void OnInit(HWND hDlg, unsigned days); 9 | static void OnOK(HWND hDlg); 10 | static void OnEveryDay(HWND hDlg); 11 | 12 | //=================================================* 13 | // ----------------------------- Create Dialog Window 14 | //===================================================* 15 | int ChooseAlarmDay(HWND hDlg, unsigned days) 16 | { 17 | return (unsigned)DialogBoxParam(0, MAKEINTRESOURCE(IDD_ALARMDAY), hDlg, Window_AlarmDaySelectDlg, days); 18 | } 19 | //=================================================* 20 | // --------------------------------- Dialog Procedure 21 | //===================================================* 22 | INT_PTR CALLBACK Window_AlarmDaySelectDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) 23 | { 24 | (void)lParam; 25 | switch(message) { 26 | case WM_INITDIALOG: 27 | OnInit(hDlg,(unsigned)lParam); 28 | return TRUE; 29 | 30 | case WM_COMMAND: { 31 | WORD id = LOWORD(wParam); 32 | switch(id) { 33 | case IDC_ALARMDAY0: 34 | OnEveryDay(hDlg); 35 | break; 36 | case IDOK: 37 | OnOK(hDlg); 38 | break; 39 | case IDCANCEL: 40 | EndDialog(hDlg, 0); 41 | } 42 | return TRUE; 43 | } 44 | } 45 | return FALSE; 46 | } 47 | //=================================================* 48 | // ------------------------------- Initialize Dialog 49 | //===================================================* 50 | void OnInit(HWND hDlg, unsigned days) 51 | { 52 | int day, flag; 53 | wchar_t str[80]; 54 | flag = 1; 55 | for(day=0; day<7; ++day) { 56 | GetLocaleInfo(MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 57 | LOCALE_SDAYNAME1+day, str, _countof(str)); 58 | SetDlgItemText(hDlg, IDC_ALARMDAY1+day, str); 59 | if(days & flag) 60 | CheckDlgButton(hDlg, IDC_ALARMDAY1+day, 1); 61 | flag <<= 1; 62 | } 63 | 64 | if(!days || days == DAYF_EVERYDAY_BITMASK) { 65 | CheckDlgButton(hDlg, IDC_ALARMDAY0, 1); 66 | OnEveryDay(hDlg); 67 | } 68 | } 69 | //=================================================* 70 | // ------------ Retrieve Settings When OK is Clicked 71 | //===================================================* 72 | void OnOK(HWND hDlg) 73 | { 74 | int ret=0; 75 | int i, dflag=1; 76 | for(i=0; i<7; ++i) { 77 | if(IsDlgButtonChecked(hDlg, IDC_ALARMDAY1 + i)) 78 | ret|=dflag; 79 | dflag<<=1; 80 | } 81 | if(!ret) 82 | ret = DAYF_EVERYDAY_BITMASK; 83 | EndDialog(hDlg,ret|ALARMDAY_OKFLAG); 84 | } 85 | //=================================================* 86 | // ------------------------ If Every Day is Selected 87 | //===================================================* 88 | void OnEveryDay(HWND hDlg) 89 | { 90 | int i; 91 | 92 | if(IsDlgButtonChecked(hDlg, IDC_ALARMDAY0)) { 93 | for(i = 0; i < 7; i++) { 94 | CheckDlgButton(hDlg, IDC_ALARMDAY1 + i, TRUE); 95 | EnableDlgItem(hDlg, IDC_ALARMDAY1+i, FALSE); 96 | } 97 | } else { 98 | for(i = 0; i < 7; i++) { 99 | CheckDlgButton(hDlg, IDC_ALARMDAY1 + i, FALSE); 100 | EnableDlgItem(hDlg, IDC_ALARMDAY1+i, TRUE); 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /src/Clock/del.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/src/Clock/del.ico -------------------------------------------------------------------------------- /src/Clock/mouse.c: -------------------------------------------------------------------------------- 1 | /*------------------------------------------- 2 | mouse.c - KAZUBON 1997-2001 3 | mouse operation 4 | ---------------------------------------------*/ 5 | // Last Modified by Stoic Joker: Sunday, 01/09/2011 @ 4:34:56pm 6 | #include "tclock.h" 7 | static const char m_click_max = 2; 8 | 9 | typedef enum MouseButton { 10 | NONE = -1, 11 | LEFT, 12 | RIGHT, 13 | MIDDLE, 14 | X1, 15 | X2, 16 | } MouseButton; 17 | 18 | static MouseButton m_click_button = NONE; ///< current \c MouseButton \sa MouseButton 19 | static int m_click = 0; 20 | static UINT m_doubleclick_time = 0; 21 | 22 | static int GetMouseFuncNum(MouseButton button, int nclick) { 23 | wchar_t entry[3]; 24 | entry[0] = '0' + (char)button; 25 | entry[1] = '0' + (char)nclick; 26 | entry[2] = '\0'; 27 | return api.GetInt(REG_MOUSE, entry, 0); 28 | } 29 | 30 | /*------------------------------------------------------------ 31 | when the clock clicked 32 | 33 | registry format 34 | name value 35 | 03 3 left button triple click -> Minimize All 36 | 32 100 x-1 button double click -> Run Notepad 37 | 32File C:\Windows\notepad.exe 38 | --------------------------------------------------------------*/ 39 | void OnMouseMsg(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) 40 | { 41 | int is_down = 0; 42 | MouseButton button; ///< one of \c MouseButton \sa MouseButton 43 | int iter; 44 | 45 | (void)lParam; 46 | 47 | switch(message) { 48 | case WM_LBUTTONDOWN: case WM_LBUTTONDBLCLK: case WM_LBUTTONUP: 49 | button = LEFT; break; 50 | case WM_RBUTTONDOWN: case WM_RBUTTONDBLCLK: case WM_RBUTTONUP: 51 | button = RIGHT; break; 52 | case WM_MBUTTONDOWN: case WM_MBUTTONDBLCLK: case WM_MBUTTONUP: 53 | button = MIDDLE; break; 54 | case WM_XBUTTONDOWN: case WM_XBUTTONDBLCLK: case WM_XBUTTONUP: 55 | button = (HIWORD(wParam) == XBUTTON1 ? X1 : X2); break; 56 | default: return; 57 | } 58 | 59 | switch(message) { 60 | case WM_LBUTTONDOWN: 61 | case WM_RBUTTONDOWN: 62 | case WM_MBUTTONDOWN: 63 | case WM_XBUTTONDOWN: 64 | case WM_LBUTTONDBLCLK: 65 | case WM_RBUTTONDBLCLK: 66 | case WM_MBUTTONDBLCLK: 67 | case WM_XBUTTONDBLCLK: 68 | if(m_click_button != button) 69 | m_click = 0; 70 | m_click_button = button; 71 | is_down = 1; 72 | break; 73 | case WM_LBUTTONUP: 74 | case WM_RBUTTONUP: 75 | case WM_MBUTTONUP: 76 | case WM_XBUTTONUP: 77 | if(m_click_button != button){ 78 | m_click_button = NONE; 79 | m_click = 0; 80 | m_doubleclick_time = 0; 81 | return; 82 | } 83 | break; 84 | } 85 | if(!m_doubleclick_time) 86 | m_doubleclick_time = GetDoubleClickTime(); // get current mouse double click speed 87 | 88 | if(is_down) { // click not counted yet (normally we could remove this code and only handle OnUp, but Calendar doesn't hide properly otherwise) 89 | int n_func = GetMouseFuncNum(button, m_click+1); 90 | if(n_func) { // can we execute this click? 91 | for(iter=m_click+2; iter<=m_click_max; ++iter) { // loop thru possible clicks 92 | if(GetMouseFuncNum(button,iter)) 93 | return; // if there's a mouse function set, wait for timeout or more clicks 94 | } 95 | if(n_func == MOUSEFUNC_SHOWCALENDER){ // calendar only on down, others on up 96 | ++m_click; 97 | OnTimerMouse(hwnd); // execute now, no more clicks expected 98 | } 99 | } 100 | return; 101 | } 102 | if(GetMouseFuncNum(button,++m_click)){ 103 | int waitable = 0; 104 | for(iter=m_click+1; iter<=m_click_max; ++iter) { 105 | if(GetMouseFuncNum(button,iter)){ 106 | ++waitable; 107 | break; 108 | } 109 | } 110 | if(!waitable){ // execute now! (should never happen btw.. as of now OnDown executes in that case) 111 | OnTimerMouse(hwnd); 112 | return; 113 | } 114 | } else if(button == RIGHT && api.GetStr(L"Format",L"Format",NULL,0,NULL) == -1) { 115 | // fallback in case config is empty and read-only 116 | OnContextMenu(hwnd, NULL, -1, -1); 117 | return; 118 | } 119 | SetTimer(hwnd, IDTIMER_MOUSE, m_doubleclick_time, 0); 120 | } 121 | 122 | /*-------------------------------------------------- 123 | ----------------------------- Execute Mouse Function 124 | --------------------------------------------------*/ 125 | void OnTimerMouse(HWND hwnd) 126 | { 127 | int func = GetMouseFuncNum(m_click_button, m_click); 128 | wchar_t entry[3+4], data[MAX_PATH]; 129 | KillTimer(hwnd, IDTIMER_MOUSE); 130 | switch(func){ 131 | case MOUSEFUNC_MENU: 132 | OnContextMenu(hwnd, NULL, -1, -1); 133 | break; 134 | case MOUSEFUNC_TIMER: 135 | DialogTimer(0); 136 | break; 137 | case MOUSEFUNC_SHOWCALENDER: 138 | ToggleCalendar(0); 139 | break; 140 | case MOUSEFUNC_SHOWPROPERTY: 141 | MyPropertySheet(-1); 142 | break; 143 | case MOUSEFUNC_CLIPBOARD: 144 | PostMessage(g_hwndClock, CLOCKM_COPY, 0, MAKEWPARAM(m_click_button,m_click)); 145 | break; 146 | case MOUSEFUNC_SCREENSAVER: 147 | SendMessage(GetDesktopWindow(), WM_SYSCOMMAND, SC_SCREENSAVE, 0); 148 | break; 149 | case MOUSEFUNC_EXEC: 150 | entry[0] = '0' + (char)m_click_button; 151 | entry[1] = '0' + (char)m_click; 152 | memcpy(entry+2, L"Clip", 5*sizeof(wchar_t)); 153 | api.GetStr(REG_MOUSE, entry, data, _countof(data), L""); 154 | if(data[0]) 155 | api.ExecFile(data, g_hwndClock); 156 | break; 157 | default: 158 | PostMessage(g_hwndTClockMain, WM_COMMAND, func, 0); 159 | } 160 | m_click_button = NONE; 161 | m_click = 0; 162 | } 163 | -------------------------------------------------------------------------------- /src/Clock/propsheet.c: -------------------------------------------------------------------------------- 1 | /*------------------------------------------- 2 | propsheet.c - Kazubon 1997-2001 3 | show "Options for T-Clock" 4 | ---------------------------------------------*/ 5 | // Modified by Stoic Joker: Monday, 03/22/2010 @ 7:32:29pm 6 | #include "tclock.h" 7 | 8 | #define IDC_TAB 0x3020 9 | #define ID_APPLY_NOW 0x3021 10 | #define ID_WIZBACK 0x3023 11 | #define ID_WIZNEXT 0x3024 12 | #define ID_WIZFINISH 0x3025 13 | 14 | static int CALLBACK PropSheetProc(HWND hDlg, UINT uMsg, LPARAM lParam); 15 | static LRESULT CALLBACK Window_PropertySheet_Hooked(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); 16 | 17 | // dialog procedures of each page 18 | INT_PTR CALLBACK Page_About(HWND, UINT, WPARAM, LPARAM); 19 | INT_PTR CALLBACK Page_Alarm(HWND, UINT, WPARAM, LPARAM); 20 | INT_PTR CALLBACK Page_Mouse(HWND, UINT, WPARAM, LPARAM); 21 | INT_PTR CALLBACK Page_Color(HWND, UINT, WPARAM, LPARAM); 22 | INT_PTR CALLBACK Page_Quicky(HWND, UINT, WPARAM, LPARAM); 23 | INT_PTR CALLBACK Page_Format(HWND, UINT, WPARAM, LPARAM); 24 | INT_PTR CALLBACK Page_HotKey(HWND, UINT, WPARAM, LPARAM); 25 | INT_PTR CALLBACK Page_Misc(HWND, UINT, WPARAM, LPARAM); 26 | 27 | static WNDPROC m_oldWndProc; // to save default window procedure 28 | static int m_startpage = 0; // page to open first 29 | 30 | char g_bApplyTaskbar = 0; 31 | char g_bApplyClock = 0; 32 | //char g_bApplyClear = 0; 33 | 34 | //================================================================================================ 35 | //----------------------------//-----------------------+++--> Show the (Tab Dialog) Property Sheet: 36 | void MyPropertySheet(int page) //---------------------------------------------------------+++--> 37 | { 38 | static const DLGPROC PageProc[]={ 39 | Page_About, Page_Alarm, 40 | Page_Color, Page_Format, Page_Mouse, 41 | Page_Quicky, 42 | Page_HotKey, Page_Misc, 43 | }; 44 | if(!g_hwndSheet || (g_hwndSheet != (HWND)(intptr_t)1 && !IsWindow(g_hwndSheet))) { 45 | #define PROPERTY_NUM _countof(PageProc) 46 | PROPSHEETPAGE psp[PROPERTY_NUM] = {{0}}; 47 | PROPSHEETHEADER psh = {sizeof(PROPSHEETHEADER)}; 48 | int i; 49 | static_assert((GROUP_PAGE_END-GROUP_PAGE+1) == PROPERTY_NUM); 50 | // Allocate Clean Memory for Each Page 51 | for(i=0; i Property Sheet Callback Procedure: 76 | int CALLBACK PropSheetProc(HWND hDlg, UINT uMsg, LPARAM lParam) //-----------------------+++--> 77 | { 78 | (void)lParam; 79 | if(uMsg == PSCB_INITIALIZED) { 80 | // subclass the window 81 | m_oldWndProc = SubclassWindow(hDlg, Window_PropertySheet_Hooked); 82 | } 83 | return 0; 84 | } 85 | /*-------------------------------------------------------- 86 | window procedure of subclassed property sheet 87 | ---------------------------------------------------------*/ 88 | LRESULT CALLBACK Window_PropertySheet_Hooked(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) 89 | { 90 | switch(message){ 91 | case WM_DESTROY: 92 | g_hwndSheet = NULL; 93 | m_startpage=(int)SendMessage((HWND)SendMessage(hwnd,PSM_GETTABCONTROL,0,0),TCM_GETCURSEL,0,0); 94 | if(m_startpage<0) m_startpage = 0; 95 | if(g_bApplyClock) { 96 | g_bApplyClock = 0; 97 | PostMessage(g_hwndClock, CLOCKM_REFRESHCLOCK, 0, 0); 98 | } 99 | if(g_bApplyTaskbar) { 100 | g_bApplyTaskbar = 0; 101 | PostMessage(g_hwndClock, CLOCKM_REFRESHTASKBAR, 0, 0); 102 | } 103 | if(g_hDlgTimer && IsWindow(g_hDlgTimer)) 104 | SendMessage(g_hDlgTimer,WM_CLOSE,0,0); 105 | #ifndef _DEBUG 106 | EmptyWorkingSet(GetCurrentProcess()); 107 | #endif 108 | break; 109 | case WM_ACTIVATE: 110 | WM_ActivateTopmost(hwnd, wParam, lParam); 111 | break; 112 | case WM_COMMAND:{ 113 | LRESULT ret=CallWindowProc(m_oldWndProc, hwnd, message, wParam, lParam); 114 | switch(LOWORD(wParam)){ 115 | case ID_APPLY_NOW: 116 | /// apply settings if applicable 117 | if(!IsWindowEnabled((HWND)lParam)){ // ID_APPLY_NOW disabled, settings applied 118 | if(g_bApplyClock) { 119 | g_bApplyClock = 0; 120 | PostMessage(g_hwndClock, CLOCKM_REFRESHCLOCK, 0, 0); 121 | } 122 | if(g_bApplyTaskbar) { 123 | g_bApplyTaskbar = 0; 124 | PostMessage(g_hwndClock, CLOCKM_REFRESHTASKBAR, 0, 0); 125 | } 126 | } 127 | break; 128 | case IDOK: 129 | case IDCANCEL: 130 | /// close property sheet (normally we'll have to check for !PropSheet_GetCurrentPageHwnd() and do DestroyWindow() for modeless sheets 131 | DestroyWindow(hwnd); 132 | break; 133 | } 134 | return ret;} 135 | case WM_SYSCOMMAND:// close by "x" button 136 | if((wParam & 0xfff0) == SC_CLOSE) 137 | PostMessage(hwnd, WM_COMMAND, IDCANCEL, 0); // WM_CLOSE also cancels 138 | break; 139 | } 140 | return CallWindowProc(m_oldWndProc, hwnd, message, wParam, lParam); 141 | } 142 | 143 | /*------------------------------------------------ 144 | select file 145 | --------------------------------------------------*/ 146 | BOOL SelectMyFile(HWND hDlg, const wchar_t* filter, DWORD filter_index, const wchar_t* deffile, wchar_t retfile[MAX_PATH]) 147 | { 148 | wchar_t initdir[MAX_PATH]; 149 | OPENFILENAME ofn = {sizeof(ofn)}; 150 | 151 | memcpy(initdir, api.root, api.root_size); 152 | if(deffile && deffile[0]) { 153 | WIN32_FIND_DATA fd; 154 | HANDLE hfind; 155 | hfind = FindFirstFile(deffile, &fd); 156 | if(hfind != INVALID_HANDLE_VALUE) { 157 | FindClose(hfind); 158 | wcsncpy_s(initdir, _countof(initdir), deffile, _TRUNCATE); 159 | del_title(initdir); 160 | } 161 | } 162 | 163 | retfile[0] = '\0'; 164 | ofn.hwndOwner = hDlg; 165 | ofn.hInstance = g_instance; 166 | ofn.lpstrFilter = filter; 167 | ofn.nFilterIndex = filter_index; 168 | ofn.lpstrFile = retfile; 169 | ofn.nMaxFile = MAX_PATH; 170 | ofn.lpstrInitialDir = initdir; 171 | ofn.Flags = OFN_NOCHANGEDIR | OFN_HIDEREADONLY | OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_NODEREFERENCELINKS; // even with OFN_NOCHANGEDIR set, the working directory might be ultimately NOT restored.. (happens on Windows 10) 172 | 173 | return GetOpenFileName(&ofn); 174 | } 175 | -------------------------------------------------------------------------------- /src/Clock/soundselect.c: -------------------------------------------------------------------------------- 1 | /*------------------------------------------- 2 | soundselect.c - KAZUBON 1997-2001 3 | select a sound file with "Open" dialog 4 | ---------------------------------------------*/ 5 | // Last Modified by Stoic Joker: Sunday, 03/13/2011 @ 11:54:05am 6 | #include "tclock.h" 7 | 8 | void ComboBoxArray_AddSoundFiles(HWND boxes[], int num) 9 | { 10 | int i; 11 | wchar_t search[MAX_PATH]; 12 | HANDLE hFind; 13 | WIN32_FIND_DATA FindFileData; 14 | memcpy(search, api.root, api.root_size); 15 | wcscpy(search+api.root_len, L"/waves/*"); 16 | for(i=0; i"); 18 | if((hFind=FindFirstFile(search, &FindFileData)) != INVALID_HANDLE_VALUE) { 19 | do{ 20 | if(!(FindFileData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) { // only files (also ignores . and ..) 21 | for(i=0; i 12 | #ifndef IDC_STATIC 13 | # define IDC_STATIC (-1) 14 | #endif 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | #undef APSTUDIO_READONLY_SYMBOLS 18 | 19 | ///////////////////////////////////////////////////////////////////////////// 20 | // English (U.S.) resources 21 | 22 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 23 | #ifdef _WIN32 24 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 25 | #pragma code_page(1252) 26 | #endif //_WIN32 27 | 28 | ///////////////////////////////////////////////////////////////////////////// 29 | // 30 | // Version 31 | // 32 | 33 | VS_VERSION_INFO VERSIONINFO 34 | FILEVERSION VER_RC_REVISION 35 | PRODUCTVERSION VER_RC_REVISION 36 | FILEFLAGSMASK 0x3fL 37 | #ifdef _DEBUG 38 | FILEFLAGS VS_FF_DEBUG 39 | #else 40 | FILEFLAGS 0x0L 41 | #endif 42 | FILEOS 0x40004L 43 | FILETYPE 0x1L 44 | FILESUBTYPE 0x0L 45 | BEGIN 46 | BLOCK "StringFileInfo" 47 | BEGIN 48 | BLOCK "000004b0" 49 | BEGIN 50 | VALUE "Comments", "SystemTray Clock Utility" 51 | VALUE "CompanyName", "-" 52 | VALUE "FileDescription", "T-Clock Redux" 53 | VALUE "FileVersion", VER_SHORT " #" STR(VER_REVISION) 54 | VALUE "InternalName", "Clock.exe" 55 | VALUE "OriginalFilename", "Clock.exe" 56 | VALUE "ProductName", "T-Clock Redux" 57 | VALUE "ProductVersion", VER_SHORT " #" STR(VER_REVISION) 58 | END 59 | END 60 | BLOCK "VarFileInfo" 61 | BEGIN 62 | VALUE "Translation", 0x0, 1200 63 | END 64 | END 65 | 66 | // 67 | // Manifest resources 68 | // 69 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL 70 | 1 RT_MANIFEST "../common/manifest.xml" 71 | 72 | 73 | #ifdef APSTUDIO_INVOKED 74 | ///////////////////////////////////////////////////////////////////////////// 75 | // 76 | // TEXTINCLUDE 77 | // 78 | 79 | 1 TEXTINCLUDE 80 | BEGIN 81 | "resource.h\0" 82 | END 83 | 84 | 3 TEXTINCLUDE 85 | BEGIN 86 | "\r\0" 87 | END 88 | 89 | 2 TEXTINCLUDE 90 | BEGIN 91 | "#include ""afxres.h""\r\0" 92 | END 93 | 94 | #endif // APSTUDIO_INVOKED 95 | 96 | #endif // English (U.S.) resources 97 | ///////////////////////////////////////////////////////////////////////////// 98 | 99 | 100 | 101 | #ifndef APSTUDIO_INVOKED 102 | ///////////////////////////////////////////////////////////////////////////// 103 | // 104 | // Generated from the TEXTINCLUDE 3 resource. 105 | // 106 | 107 | 108 | ///////////////////////////////////////////////////////////////////////////// 109 | #endif // not APSTUDIO_INVOKED 110 | 111 | -------------------------------------------------------------------------------- /src/Clock/version64.rc: -------------------------------------------------------------------------------- 1 | #ifndef _WIN64 2 | # define _WIN64 3 | #endif 4 | #include "version.rc" 5 | -------------------------------------------------------------------------------- /src/DLL/DLL.def: -------------------------------------------------------------------------------- 1 | SECTIONS 2 | .shared SHARED READ WRITE 3 | -------------------------------------------------------------------------------- /src/DLL/clock_color.c: -------------------------------------------------------------------------------- 1 | #include "tcdll.h" 2 | #include "clock_internal.h" 3 | 4 | static unsigned m_themecolor = 0x00000000; 5 | static unsigned m_themecolor_dark; 6 | static unsigned m_themecolor_alpha; 7 | 8 | void Clock_On_DWMCOLORIZATIONCOLORCHANGED(unsigned argb, BOOL blend) { /// there's a bug with "high" or "low" color intensity... 9 | union{ 10 | unsigned ref; 11 | RGBQUAD quad; 12 | } col; 13 | BYTE whitepart; 14 | unsigned tmp; 15 | // currently, DwmGetColorizationColor() returns wrong values in some cases, 16 | // but we can't use WM_DWMCOLORIZATIONCOLORCHANGED on startup... 17 | // so always rely on the bugged DwmGetColorizationColor() 18 | /* slightly wrong color but always "works". DwmGetColorizationColor fails for some colors 19 | HKEY hkey; 20 | if(RegOpenKey(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\DWM", &hkey) == 0){ 21 | DWORD regtype,size=sizeof(sub); 22 | if(RegQueryValueEx(hkey,"ColorizationColor",0,®type,(LPBYTE)&sub,&size)==ERROR_SUCCESS && regtype==REG_DWORD) 23 | Clock_On_DWMCOLORIZATIONCOLORCHANGED(sub, 1); 24 | RegCloseKey(hkey); 25 | }// */ 26 | typedef HRESULT (WINAPI *DwmGetColorizationColorPtr)(DWORD* pcrColorization, BOOL* pfOpaqueBlend); 27 | HMODULE hdwm = LoadLibraryA("dwmapi"); 28 | if(hdwm) { 29 | DwmGetColorizationColorPtr pDwmGetColorizationColor; /**< \sa DwmGetColorizationColor() */ 30 | pDwmGetColorizationColor = (DwmGetColorizationColorPtr)GetProcAddress(hdwm, "DwmGetColorizationColor"); 31 | pDwmGetColorizationColor((DWORD*)&argb, &blend); 32 | FreeLibrary(hdwm); 33 | } else { 34 | argb = 0x77010101; // fallback for >16)&0xFF); 37 | if(!col.quad.rgbReserved && col.ref) // fix for high intensity colors and DwmGetColorizationColor() 38 | col.quad.rgbReserved = 0xFF; 39 | // if(!blend) DBGMSG("!blend"); // so far, not seen on Win8 but 7 40 | 41 | tmp = col.quad.rgbReserved; 42 | col.quad.rgbReserved = 0xFF - col.quad.rgbReserved; 43 | m_themecolor_alpha = col.ref; 44 | 45 | col.quad.rgbReserved = 0x00; 46 | m_themecolor_dark = col.ref; 47 | col.quad.rgbReserved = (BYTE)tmp; 48 | 49 | whitepart = (255-col.quad.rgbReserved); 50 | tmp = (col.quad.rgbBlue*col.quad.rgbReserved/0xFF) + whitepart; 51 | col.quad.rgbBlue = (BYTE)tmp; 52 | tmp = (col.quad.rgbGreen*col.quad.rgbReserved/0xFF) + whitepart; 53 | col.quad.rgbGreen = (BYTE)tmp; 54 | tmp = (col.quad.rgbRed*col.quad.rgbReserved/0xFF) + whitepart; 55 | col.quad.rgbRed = (BYTE)tmp; 56 | col.quad.rgbReserved = 0x00; 57 | m_themecolor = col.ref; 58 | } 59 | unsigned Clock_GetColor(unsigned color, int flags) 60 | { 61 | // useraw = 1 == want some raw values, mainly "default" 62 | // useraw = 2 == always want raw values (that is, everytime a TCOLOR_* isn't save to be right) 63 | unsigned sub; 64 | int state = CLS_NORMAL; 65 | if((color&TCOLOR_MASK)!=TCOLOR_MAGIC) 66 | return color; 67 | if(flags & TCOLORFLAG_HOVER) 68 | state = CLS_HOT; 69 | // if(flags & TCOLORFLAG_PRESSED) 70 | // state = CLS_PRESSED; 71 | sub = color^TCOLOR_MAGIC; 72 | if(sub < TCOLOR_BEGIN_) 73 | return GetSysColor(sub); 74 | switch(sub){ 75 | case TCOLOR_DEFAULT: 76 | if(flags & (TCOLORFLAG_RAW1|TCOLORFLAG_RAW2)) 77 | return color; 78 | if(IsXPThemeActive() && gs_hwndClock) 79 | return GetXPClockColor(gs_hwndClock, state); 80 | else 81 | return GetSysColor(COLOR_WINDOWTEXT); 82 | case TCOLOR_TRANSPARENT: 83 | if(flags & (TCOLORFLAG_RAW1|TCOLORFLAG_RAW2)) 84 | return color; 85 | return 0xFF000000; 86 | case TCOLOR_THEME: 87 | if(!m_themecolor) 88 | Clock_On_DWMCOLORIZATIONCOLORCHANGED(0, 1); 89 | return m_themecolor; 90 | case TCOLOR_THEME_DARK: 91 | if(!m_themecolor) 92 | Clock_On_DWMCOLORIZATIONCOLORCHANGED(0, 1); 93 | return m_themecolor_dark; 94 | case TCOLOR_THEME_ALPHA: 95 | if(!m_themecolor) 96 | Clock_On_DWMCOLORIZATIONCOLORCHANGED(0, 1); 97 | return m_themecolor_alpha; 98 | case TCOLOR_THEME_BG: 99 | if(flags & TCOLORFLAG_RAW2) 100 | return color; 101 | if(IsXPThemeActive() && gs_hwndClock) 102 | return GetXPClockColorBG(gs_hwndClock, state); 103 | else 104 | return GetSysColor(COLOR_3DFACE); 105 | } 106 | return color; 107 | } 108 | -------------------------------------------------------------------------------- /src/DLL/clock_internal.h: -------------------------------------------------------------------------------- 1 | #ifndef CLOCK_INTERNAL_H_ 2 | #define CLOCK_INTERNAL_H_ 3 | #include 4 | 5 | extern REGSAM ms_reg_fullaccess; /**< full registry access. set to \c KEY_ALL_ACCESS | \c KEY_WOW64_64KEY */ 6 | extern REGSAM ms_reg_read; /**< read-only registry access. set to \c KEY_READ | \c KEY_WOW64_64KEY */ 7 | extern wchar_t ms_inifile[MAX_PATH]; /**< path to ini if set */ 8 | 9 | typedef ULONGLONG (WINAPI* GetTickCount64_t)(); 10 | 11 | extern unsigned short gs_tos; /**< \sa TClockAPI::OS */ 12 | 13 | /** \sa TClockAPI::Inject() */ 14 | int Clock_Inject(HWND hwndMain); 15 | /** \sa TClockAPI::InjectFinalize() */ 16 | void Clock_InjectFinalize(); 17 | /** \sa TClockAPI::Exit() */ 18 | void Clock_Exit(); 19 | 20 | /** \sa TClockAPI::GetClock() */ 21 | HWND Clock_GetClock(int uncached); 22 | /** \sa TClockAPI::GetCalendar() */ 23 | HWND Clock_GetCalendar(); 24 | /** \sa TClockAPI::Message() */ 25 | int Clock_Message(HWND parent, const wchar_t* msg, const wchar_t* title, UINT uType, UINT uBeep); 26 | /** \sa TClockAPI::PositionWindow() */ 27 | void Clock_PositionWindow(HWND hwnd, int padding); 28 | /** \sa TClockAPI::GetColor() */ 29 | unsigned Clock_GetColor(unsigned agbr,int useraw); 30 | /** \sa TClockAPI::On_DWMCOLORIZATIONCOLORCHANGED() */ 31 | void Clock_On_DWMCOLORIZATIONCOLORCHANGED(unsigned argb, BOOL blend); 32 | 33 | /** \sa TClockAPI::GetInt() */ 34 | int Clock_GetInt(const wchar_t* section, const wchar_t* entry, int defval); 35 | /** \sa TClockAPI::GetInt64() */ 36 | int64_t Clock_GetInt64(const wchar_t* section, const wchar_t* entry, int64_t defval); 37 | /** \sa TClockAPI::GetIntEx() */ 38 | int Clock_GetIntEx(const wchar_t* section, const wchar_t* entry, int defval); 39 | /** \sa TClockAPI::GetSystemInt() */ 40 | int Clock_GetSystemInt(HKEY rootkey, const wchar_t* section, const wchar_t* entry, int defval); 41 | /** \sa TClockAPI::GetStr() */ 42 | int Clock_GetStr(const wchar_t* section, const wchar_t* entry, wchar_t* val, int len, const wchar_t* defval); 43 | /** \sa TClockAPI::GetStrEx() */ 44 | int Clock_GetStrEx(const wchar_t* section, const wchar_t* entry, wchar_t* val, int len, const wchar_t* defval); 45 | /** \sa TClockAPI::GetSystemStr() */ 46 | int Clock_GetSystemStr(HKEY rootkey, const wchar_t* section, const wchar_t* entry, wchar_t* val, int len, const wchar_t* defval); 47 | /** \sa TClockAPI::SetInt() */ 48 | int Clock_SetInt(const wchar_t* section, const wchar_t* entry, int val); 49 | /** \sa TClockAPI::SetInt64() */ 50 | int Clock_SetInt64(const wchar_t* section, const wchar_t* entry, int64_t val); 51 | /** \sa TClockAPI::SetSystemInt() */ 52 | int Clock_SetSystemInt(HKEY rootkey, const wchar_t* section, const wchar_t* entry, int val); 53 | /** \sa TClockAPI::SetStr() */ 54 | int Clock_SetStr(const wchar_t* section, const wchar_t* entry, const wchar_t* val); 55 | /** \sa TClockAPI::SetSystemStr() */ 56 | int Clock_SetSystemStr(HKEY rootkey, const wchar_t* section, const wchar_t* entry, const wchar_t* val); 57 | /** \sa TClockAPI::DelValue() */ 58 | int Clock_DelValue(const wchar_t* section, const wchar_t* entry); 59 | /** \sa TClockAPI::DelSystemValue() */ 60 | int Clock_DelSystemValue(HKEY rootkey, const wchar_t* section, const wchar_t* entry); 61 | /** \sa TClockAPI::DelKey() */ 62 | int Clock_DelKey(const wchar_t* section); 63 | 64 | /** \sa TClockAPI::PathExists() */ 65 | int Clock_PathExists(const wchar_t* path); 66 | /** \sa TClockAPI::GetFileAndOption() */ 67 | int Clock_GetFileAndOption(const wchar_t* command, wchar_t* app, wchar_t* params); 68 | /** \sa TClockAPI::ShellExecute() */ 69 | int Clock_ShellExecute(const wchar_t* method, const wchar_t* app, const wchar_t* params, HWND parent, int show, HANDLE* hProcess); 70 | /** \sa TClockAPI::Exec() */ 71 | int Clock_Exec(const wchar_t* app, const wchar_t* params, HWND parent); 72 | /** \sa TClockAPI::ExecElevated() */ 73 | int Clock_ExecElevated(const wchar_t* app, const wchar_t* params, HWND parent); 74 | /** \sa TClockAPI::ExecFile() */ 75 | int Clock_ExecFile(const wchar_t* command, HWND parent); 76 | 77 | // format stuff 78 | /** \sa TClockAPI::GetFormat() */ 79 | wchar_t Clock_GetFormat(const wchar_t** offset, int* minimum, int* padding); 80 | /** \sa TClockAPI::WriteFormatNum() */ 81 | int Clock_WriteFormatNum(wchar_t* buffer, int number, int minimum, int padding); 82 | 83 | 84 | // translation API 85 | 86 | /** \sa TClockAPI::T() */ 87 | const wchar_t* Clock_T(int hash); 88 | /** \sa TClockAPI::Translate() */ 89 | const wchar_t* Clock_Translate(const wchar_t* str); 90 | /** \sa TClockAPI::TranslateWindow() */ 91 | const wchar_t* Clock_TranslateWindow(HWND hwnd); 92 | 93 | #endif // CLOCK_INTERNAL_H_ 94 | -------------------------------------------------------------------------------- /src/DLL/font.c: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------- 2 | // font.c : create a font of the clock -> KAZUBON 1999 3 | //--------------------------------------------------*/ 4 | // Modified by Stoic Joker: Wednesday, 03/24/2010 @ 10:13:25pm 5 | #include "tcdll.h" 6 | 7 | struct { 8 | int cp; 9 | BYTE charset; 10 | } codepage_charset[] = { 11 | { 932, SHIFTJIS_CHARSET }, 12 | { 936, GB2312_CHARSET }, 13 | { 949, HANGEUL_CHARSET }, 14 | { 950, CHINESEBIG5_CHARSET }, 15 | { 1250, EASTEUROPE_CHARSET }, 16 | { 1251, RUSSIAN_CHARSET }, 17 | { 1252, ANSI_CHARSET }, 18 | { 1253, GREEK_CHARSET }, 19 | { 1254, TURKISH_CHARSET }, 20 | { 1257, BALTIC_CHARSET }, 21 | { 0, 0} 22 | }; 23 | 24 | //================================================================================================ 25 | //----------------------+++--> CallBack Function for EnumFontFamiliesEx, to Find a Designated Font: 26 | int CALLBACK EnumFontFamExProc(const LOGFONT* lpelfe, const TEXTMETRIC* lpntme, DWORD FontType, LPARAM lParam) 27 | { 28 | const wchar_t* fontname = (wchar_t*)lParam; 29 | (void)lpntme; (void)FontType; 30 | if(wcscmp(fontname, lpelfe->lfFaceName) == 0) return FALSE; 31 | return TRUE; 32 | } 33 | //==================================================================================================================== 34 | //----------------------------------------------------------------------------------+++--> Create a Font For the Clock: 35 | HFONT CreateMyFont(const wchar_t* fontname, int fontsize, LONG weight, LONG italic, int angle, BYTE quality) //--+++--> 36 | { 37 | LOGFONT lf; POINT pt; HDC hdc; int langid; 38 | int cp, i; BYTE charset; 39 | 40 | memset(&lf, 0, sizeof(LOGFONT)); 41 | langid = api.GetInt(L"Format", L"Locale", GetUserDefaultLangID()); 42 | 43 | GetLocaleInfo(langid, LOCALE_IDEFAULTANSICODEPAGE|LOCALE_RETURN_NUMBER, (wchar_t*)&cp, sizeof(cp)); 44 | if(!IsValidCodePage(cp)) cp = CP_ACP; 45 | 46 | charset = 0; 47 | for(i = 0; codepage_charset[i].cp; i++) { 48 | if(cp == codepage_charset[i].cp) { 49 | charset = codepage_charset[i].charset; break; 50 | } 51 | } 52 | 53 | hdc = GetDC(NULL); 54 | 55 | // find a font named "fontname" 56 | if(!charset) charset = (BYTE)GetTextCharset(hdc); 57 | lf.lfCharSet = charset; 58 | if(EnumFontFamiliesEx(hdc, &lf, EnumFontFamExProc, (LPARAM)fontname, 0)) { 59 | lf.lfCharSet = OEM_CHARSET; 60 | if(EnumFontFamiliesEx(hdc, &lf, EnumFontFamExProc, (LPARAM)fontname, 0)) { 61 | lf.lfCharSet = ANSI_CHARSET; 62 | EnumFontFamiliesEx(hdc, &lf, EnumFontFamExProc, (LPARAM)fontname, 0); 63 | } 64 | } 65 | 66 | pt.x = 0; 67 | pt.y = MulDiv(fontsize, GetDeviceCaps(hdc, LOGPIXELSY), 72); 68 | DPtoLP(hdc, &pt, 1); 69 | lf.lfHeight = -pt.y; 70 | 71 | ReleaseDC(NULL, hdc); 72 | 73 | lf.lfWidth = lf.lfEscapement = lf.lfOrientation = 0; 74 | lf.lfWeight = weight; 75 | lf.lfItalic = (BYTE)italic; 76 | lf.lfUnderline = 0; 77 | lf.lfStrikeOut = 0; 78 | lf.lfEscapement=lf.lfOrientation = angle; 79 | lf.lfOutPrecision = OUT_DEFAULT_PRECIS; 80 | lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; 81 | 82 | lf.lfQuality = quality; 83 | 84 | lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE; 85 | wcsncpy_s(lf.lfFaceName, _countof(lf.lfFaceName), fontname, _TRUNCATE); 86 | 87 | return CreateFontIndirect(&lf); 88 | } 89 | /*--+++--> ClearType: <--+++--<<<<< NEED TO TRY THIS!!!!!!!!!!!! 90 | ClearType support depends on your system supporting it. 91 | Please check with your vendor if your device supports ClearType. 92 | 93 | Creating a font with the ClearType property is as simple as 94 | specifying 5 as the lfQuality member of the LOGFONT structure. 95 | */ 96 | // == ALL Currently Available Font Quality Options == 97 | // lf.lfQuality = CLEARTYPE_NATURAL_QUALITY; // = 6 98 | // lf.lfQuality = CLEARTYPE_QUALITY; // = 5 99 | // lf.lfQuality = ANTIALIASED_QUALITY; // = 4 100 | // lf.lfQuality = NONANTIALIASED_QUALITY; // = 3 101 | // lf.lfQuality = PROOF_QUALITY; // = 2 102 | // lf.lfQuality = DRAFT_QUALITY; // = 1 103 | // lf.lfQuality = DEFAULT_QUALITY; // = 0 104 | /* 105 | Okay... So for "Historical Acuracy" (so i don't forget) 106 | I'm going to include the Whole (font.lfQuality) Story... 107 | 108 | The original Kazubon builds used: lf.lfQuality = DEFAULT_QUALITY; 109 | But weren't really crisp on Vista with themes/transparency/etc. 110 | 111 | So, I switched to: lf.lfQuality = CLEARTYPE_NATURAL_QUALITY; 112 | Whiched proved to be fine unless using (Win7) Aero with a light 113 | colored clock font and wallpaper (which made it fuzzy as hell). 114 | 115 | Now after a bit of futzing around, I discovered that apparently: 116 | lf.lfQuality = ANTIALIASED_QUALITY; (= 4) Was best for Win7 117 | lf.lfQuality = CLEARTYPE_QUALITY; (= 5) Was best for WinXP 118 | lf.lfQuality = DEFAULT_QUALITY; (= 0) Was best for Win2000 119 | 120 | Which is why I decided (was forced) to make Font Quality Adjustable. 121 | */ 122 | -------------------------------------------------------------------------------- /src/DLL/main.c: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------- 2 | // main.c : API, hook procedure -> KAZUBON 1997-2001 3 | //-------------------------------------------------------*/ 4 | // Modified by Stoic Joker: Tuesday, March 2 2010 - 10:42:42 5 | #include "tcdll.h" 6 | 7 | HANDLE g_exit_lock = NULL; 8 | void InitClock(HWND hwnd); 9 | 10 | //======================================================================================== 11 | //-----------------------------+++--> Entry Point of This (SystemTray Clock ShellHook) DLL: 12 | BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) //---+++--> 13 | { 14 | (void)lpvReserved; 15 | api.hInstance = hinstDLL; 16 | switch(fdwReason) { 17 | case DLL_PROCESS_ATTACH: 18 | // DebugLog(0, "DLL_PROCESS_ATTACH"); // API not loaded yet, thus bypasses "NoLog" setting (portable mode) 19 | #if !defined(_MSC_VER) || defined(_DLL) // if not static MSVC build 20 | DisableThreadLibraryCalls(hinstDLL); 21 | #endif 22 | break; 23 | case DLL_PROCESS_DETACH: 24 | DebugLog(0, "DLL_PROCESS_DETACH"); 25 | DebugLogFree(); 26 | if(g_exit_lock) { 27 | // "notify" Clock.exe about our exit 28 | ReleaseSemaphore(g_exit_lock, 1, NULL); 29 | CloseHandle(g_exit_lock); 30 | } 31 | break; 32 | default: break; 33 | } 34 | return TRUE; 35 | } 36 | //======================================================================================== 37 | //---------------------------------------------+++--> SystemTray Clock ShellHook Procedure: 38 | LRESULT CALLBACK Hook_CallWndProc(int nCode, WPARAM wParam, LPARAM lParam) //-----+++--> 39 | {/// @todo : rewrite hooking code (use wrapper exe to hook it) 40 | CWPSTRUCT* pcwps = (CWPSTRUCT*)lParam; 41 | if(nCode >= 0) { // if this message is sent to the clock 42 | char classname[80]; 43 | if(!gs_taskbar && GetClassNameA(pcwps->hwnd, classname, 80) && !strcmp(classname, "TrayClockWClass")) { 44 | InitClock(pcwps->hwnd); // initialize (tclock.c) 45 | PostMessage(gs_hwndTClockMain,MAINM_CLOCKINIT,0,(LPARAM)pcwps->hwnd); 46 | } 47 | } 48 | return CallNextHookEx(NULL, nCode, wParam, lParam); 49 | } 50 | -------------------------------------------------------------------------------- /src/DLL/tcdll.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------- 2 | TCDLL.H - KAZUBON 1997-2001 // Modified by Stoic Joker: Thursday, 03/25/2010 @ 6:00:55pm 3 | ---------------------------------------------*/ 4 | #pragma once 5 | #ifndef INC_TCDLL_H 6 | #define INC_TCDLL_H 7 | #include "../common/globals.h" // globals 8 | 9 | #include // Required by most everything in TClock.c 10 | #include // Required by time functions in Format.c 11 | #include // Required by use of floor() in Format.c 12 | 13 | #include "../common/resource.h" 14 | #include "../common/newapi.h" // UxTheme stuff 15 | #include "../common/utl.h" // utility functions 16 | #include "../common/clock.h" // common clock api 17 | #include "../common/win2k_compat.h" 18 | 19 | extern HWND gs_hwndTClockMain; /**< \brief our main window for hotkeys, menus and sounds \b [shared] */ 20 | extern HWND gs_hwndClock; /**< \brief primary clock hwnd \b [shared] \remark initialized on injection start \sa gs_taskbar, gs_tray */ 21 | extern HWND gs_tray; /**< \brief primary clock's tray \b [shared] \remark initialized once fully injected ( prefer \c gs_taskbar ) \sa gs_hwndClock, gs_taskbar */ 22 | extern HWND gs_taskbar; /**< \brief primary clock's taskbar \b [shared] \remark initialized once fully injected \sa gs_hwndClock, gs_tray */ 23 | extern HWND gs_hwndCalendar; /**< \brief calendar state \b [shared] \sa TClockAPI::GetCalendar() */ 24 | 25 | extern const wchar_t* kConfigName; /**< ini file name (also used for mutexes) */ 26 | 27 | #define TZNAME_MAX 256//10 28 | 29 | #define WIN_CLOCK_TIMER_ID 0 ///< actually invalid since TOS_WIN10_1 30 | 31 | #define GROUP_TCLOCK_TIMER_BEGIN TCLOCK_TIMER_ID ///< first timer id of our possible timers 32 | #define TCLOCK_TIMER_ID 13 ///< non-conflicting timer ID 33 | #define TCLOCK_TIMER_ID_CLICK 14 ///< Win10-Anniversary-calendar-click-emulation-mouse-up-timer 34 | #define TCLOCK_TIMER_ID_TOOLTIP 15 ///< tool-tip delay used for keyboard navigation 35 | #define GROUP_TCLOCK_TIMER_END TCLOCK_TIMER_ID_TOOLTIP ///< last timer id of our possible timers 36 | 37 | // tclock.c 38 | void DrawClock(HDC hdc); 39 | void GetDisplayTime(SYSTEMTIME* pt, int* beat100); 40 | void FillClockBG(); 41 | void FillClockBGHover(); 42 | 43 | // font.c 44 | HFONT CreateMyFont(const wchar_t* fontname, int fontsize, LONG weight, LONG italic, int angle, BYTE guality); 45 | 46 | //#pragma once 47 | //extern char szTZone[]; //---+++--> TimeZone String Buffer, Also Used (as External) in Format.c 48 | 49 | // FORMAT.C 50 | void InitFormat(const wchar_t* section, SYSTEMTIME* lt); 51 | #define FORMAT_MAX_SIZE 1024 52 | unsigned MakeFormat(wchar_t buf[FORMAT_MAX_SIZE], const wchar_t* fmt, SYSTEMTIME* pt, int beat100); 53 | #define FORMAT_SECOND 0x0001 54 | #define FORMAT_SYSINFO 0x0002 55 | #define FORMAT_BEAT1 0x0004 56 | #define FORMAT_BEAT2 0x0008 57 | #define FORMAT_BATTERY 0x0010 58 | #define FORMAT_MEMORY 0x0020 59 | #define FORMAT_MOTHERBRD 0x0040 60 | #define FORMAT_PERMON 0x0080 61 | #define FORMAT_NET 0x0100 62 | DWORD FindFormat(const wchar_t* fmt); 63 | 64 | #endif // INC_TCDLL_H 65 | -------------------------------------------------------------------------------- /src/DLL/version.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "../common/resource.h" 4 | #include "../common/version.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #define APSTUDIO_HIDDEN_SYMBOLS 12 | #include "windows.h" 13 | #undef APSTUDIO_HIDDEN_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | #undef APSTUDIO_READONLY_SYMBOLS 17 | 18 | ///////////////////////////////////////////////////////////////////////////// 19 | // English (U.S.) resources 20 | 21 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 22 | #ifdef _WIN32 23 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 24 | #pragma code_page(1252) 25 | #endif // _WIN32 26 | 27 | ///////////////////////////////////////////////////////////////////////////// 28 | // 29 | // Version 30 | // 31 | 32 | VS_VERSION_INFO VERSIONINFO 33 | FILEVERSION VER_RC_REVISION 34 | PRODUCTVERSION VER_RC_REVISION 35 | FILEFLAGSMASK 0x3fL 36 | #ifdef _DEBUG 37 | FILEFLAGS VS_FF_DEBUG 38 | #else 39 | FILEFLAGS 0x0L 40 | #endif 41 | FILEOS 0x40004L 42 | FILETYPE 0x2L 43 | FILESUBTYPE 0x0L 44 | BEGIN 45 | BLOCK "StringFileInfo" 46 | BEGIN 47 | BLOCK "000004b0" 48 | BEGIN 49 | VALUE "Comments", "T-Clock tray-""Hook""" 50 | VALUE "CompanyName", "-" 51 | VALUE "FileDescription", "T-Clock Redux DLL" 52 | VALUE "FileVersion", VER_SHORT " #" STR(VER_REVISION) 53 | VALUE "InternalName", "Clock.dll" 54 | VALUE "OriginalFilename", "Clock.dll" 55 | VALUE "ProductName", "T-Clock Redux" 56 | VALUE "ProductVersion", VER_SHORT "#" STR(VER_REVISION) 57 | END 58 | END 59 | BLOCK "VarFileInfo" 60 | BEGIN 61 | VALUE "Translation", 0x0, 1200 62 | END 63 | END 64 | 65 | // 66 | // Icon resources 67 | // 68 | IDI_MAIN ICON "../Clock/Clock.ico" 69 | 70 | // 71 | // Manifest resources 72 | // 73 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL 74 | 2 RT_MANIFEST "../common/manifest.xml" 75 | 76 | 77 | #ifdef APSTUDIO_INVOKED 78 | ///////////////////////////////////////////////////////////////////////////// 79 | // 80 | // TEXTINCLUDE 81 | // 82 | 83 | 1 TEXTINCLUDE 84 | BEGIN 85 | "resource.h\0" 86 | END 87 | 88 | 2 TEXTINCLUDE 89 | BEGIN 90 | "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" 91 | "#include ""windows.h""\r\n" 92 | "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" 93 | "\0" 94 | END 95 | 96 | 3 TEXTINCLUDE 97 | BEGIN 98 | "\r\n" 99 | "\0" 100 | END 101 | 102 | #endif // APSTUDIO_INVOKED 103 | 104 | #endif // English (U.S.) resources 105 | ///////////////////////////////////////////////////////////////////////////// 106 | 107 | 108 | 109 | #ifndef APSTUDIO_INVOKED 110 | ///////////////////////////////////////////////////////////////////////////// 111 | // 112 | // Generated from the TEXTINCLUDE 3 resource. 113 | // 114 | 115 | 116 | ///////////////////////////////////////////////////////////////////////////// 117 | #endif // not APSTUDIO_INVOKED 118 | 119 | -------------------------------------------------------------------------------- /src/DLL/version64.rc: -------------------------------------------------------------------------------- 1 | #ifndef _WIN64 2 | # define _WIN64 3 | #endif 4 | #include "version.rc" 5 | -------------------------------------------------------------------------------- /src/To-Do List.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/src/To-Do List.txt -------------------------------------------------------------------------------- /src/common/.coverity_model.c: -------------------------------------------------------------------------------- 1 | /* Coverity Scan model 2 | * 3 | * This is a modeling file for Coverity Scan. Modeling helps to avoid false 4 | * positives. 5 | * 6 | * - A model file can't import any header files. 7 | * - Therefore only some built-in primitives like int, char and void are 8 | * available but not wchar_t, NULL etc. 9 | * - Modeling doesn't need full structs and typedefs. Rudimentary structs 10 | * and similar types are sufficient. 11 | * - An uninitialized local pointer is not an error. It signifies that the 12 | * variable could be either NULL or have some data. 13 | * 14 | * Coverity Scan doesn't pick up modifications automatically. The model file 15 | * must be uploaded by an admin in the analysis settings of 16 | * http://scan.coverity.com/projects/3794 17 | */ 18 | /* for a modeling reference, see 19 | * http://scan.coverity.com/tune 20 | * http://scan.coverity.com/models 21 | */ 22 | 23 | /* WE'RE EMPTY FOR NOW */ 24 | -------------------------------------------------------------------------------- /src/common/AutoVersion.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/src/common/AutoVersion.exe -------------------------------------------------------------------------------- /src/common/HaveSetTimePerms.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int HaveSetTimePermissions() 4 | { 5 | int ret = 0; 6 | HANDLE hToken; 7 | TOKEN_PRIVILEGES privs = {0}; 8 | TOKEN_PRIVILEGES privs_old; 9 | DWORD privs_old_len; 10 | 11 | privs.PrivilegeCount = 1; 12 | privs.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; 13 | if(!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY, &hToken)) 14 | return 0; 15 | if(LookupPrivilegeValue(NULL, SE_SYSTEMTIME_NAME, &privs.Privileges[0].Luid)){ 16 | if(AdjustTokenPrivileges(hToken, 0, &privs, sizeof(privs_old), &privs_old, &privs_old_len) 17 | && GetLastError() == ERROR_SUCCESS){ 18 | AdjustTokenPrivileges(hToken, 0, &privs_old, 0, NULL, NULL); 19 | ret = 1; 20 | } 21 | } 22 | CloseHandle(hToken); 23 | return ret; 24 | } 25 | -------------------------------------------------------------------------------- /src/common/calendar.inc: -------------------------------------------------------------------------------- 1 | typedef struct{ 2 | const wchar_t* reg; 3 | char mcsc; 4 | } CalendarColor; 5 | 6 | const CalendarColor g_calendar_color[GROUP_CALENDAR_COLOR_NUM] = { 7 | {L"COuterBG", MCSC_BACKGROUND}, 8 | {L"CFore", MCSC_TEXT}, 9 | {L"CBack", MCSC_MONTHBK}, 10 | {L"CTitle", MCSC_TITLETEXT}, 11 | {L"CTitleBG", MCSC_TITLEBK}, 12 | {L"CTrail", MCSC_TRAILINGTEXT}, 13 | }; 14 | -------------------------------------------------------------------------------- /src/common/clock.c: -------------------------------------------------------------------------------- 1 | #include "clock.h" 2 | 3 | int LoadClockAPI(const wchar_t* dll_path, TClockAPI* _api) { 4 | typedef int (*SetupClockAPI_t)(int version, TClockAPI* api); 5 | SetupClockAPI_t SetupClockAPI; 6 | HMODULE dll = LoadLibrary(dll_path); // leak / auto-free on process exit 7 | SetupClockAPI = (SetupClockAPI_t)GetProcAddress(dll, "SetupClockAPI"); 8 | if(!SetupClockAPI) 9 | return 1; 10 | return SetupClockAPI(CLOCK_API, _api); 11 | } 12 | -------------------------------------------------------------------------------- /src/common/control_extensions.h: -------------------------------------------------------------------------------- 1 | #ifndef CONTROL_EXTENSIONS_H_ 2 | #define CONTROL_EXTENSIONS_H_ 3 | #include 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | /* libs: user32, gdi32, comdlg32, msimg32 */ 8 | 9 | 10 | extern const wchar_t kAscendingWin10[] /**< ⏶ */, kDescendingWin10[] /**< ⏷ */; 11 | extern const wchar_t kAscendingVista[] /**< ˄ */, kDescendingVista[] /**< ˅ */; 12 | extern const wchar_t kAscending2k[] /**< ٨ */, kDescending2k[] /**< ٧ */; 13 | extern const wchar_t* suffixAscending; ///< defaults to \c kAscendingWin10 \sa kAscendingWin10, kAscendingVista, kAscending2k 14 | extern const wchar_t* suffixDescending; ///< defaults to \c kDescendingWin10 \sa kDescendingWin10, kDescendingVista, kDescending2k 15 | 16 | /* 17 | GENERIC 18 | */ 19 | /** 20 | * \brief processes \c WM_ACTIVATE messages to set \c HWND_TOPMOST on activate and \c HWND_NOTOPMOST on deactivate 21 | * \param hwnd receiving window 22 | * \param wParam WM_ACTIVATE's wParam 23 | * \param lParam WM_ACTIVATE's lParam 24 | * \sa SetWindowPos(), HWND_TOPMOST, HWND_NOTOPMOST, WM_ACTIVATE, WA_ACTIVE, WA_CLICKACTIVE, WA_INACTIVE */ 25 | void WM_ActivateTopmost(HWND hwnd, WPARAM wParam, LPARAM lParam); 26 | /** 27 | * \brief add a string if not already present and select it 28 | * \param box 29 | * \param str string to add 30 | * \param select if true, also select newly added string 31 | * \param def_select item to be selected if \p str is empty or \c -1 to ignore 32 | * \sa ComboBox_AddString() */ 33 | void ComboBox_AddStringOnce(HWND box, const wchar_t* str, int select, int def_select); 34 | 35 | enum SORT { 36 | SORT_INSENSITIVE = 0x04000000, ///< case insensitive compare 37 | SORT_CUSTOMPARAM = 0x08000000, ///< custom sort by item data 38 | SORT_ASC = 0x10000000, ///< sort ascending ⏶ 39 | SORT_DEC = 0x20000000, ///< sort descending ⏷ 40 | SORT_REMEMBER = 0x40000000, ///< remember last applied sort by setting \c GetWindowLongPtr(hwnd,GWLP_USERDATA) \sa SORT_NEXT 41 | SORT_NEXT = 0x80000000 | SORT_REMEMBER, ///< continue sort by toggling or redoing previous; implies \c SORT_REMEMBER \sa SORT_REMEMBER 42 | }; 43 | typedef int (CALLBACK* sort_func_t)(HWND list, int column, int flags, intptr_t item1, intptr_t item2, intptr_t user); 44 | 45 | int CALLBACK SortString_LV(HWND list, int column, int flags, intptr_t item1, intptr_t item2, intptr_t unused); ///< string sort (simple strcmp) 46 | /** 47 | * \brief a smart replacement to \c ListView_SortItemsEx with enhanced sorting and listview capabilities 48 | * \param list control handle 49 | * \param column the column to sort 50 | * \param func sort callback in form of \c sort_func_t, eg. \c SortString_LV 51 | * \param user custom data passed to \p func \e [optional] 52 | * \param flags any combination of \c SORT eg. SORT_ASC | SORT_INSENSITIVE | SORT_NEXT 53 | * \remark if \p flags includes \c SORT_NEXT but neither \c SORT_ASC nor \c SORT_DEC , it'll just redo the current sort instead of toggling 54 | * \sa SORT, SortString_LV, sort_func_t */ 55 | void ListView_SortItemsExEx(HWND list, int column, sort_func_t func, intptr_t user, int flags); 56 | 57 | /* 58 | LINK CONTROLS 59 | */ 60 | #define LCF_SIMPLE 0x00 /**< use link target as is */ 61 | #define LCF_NOTIFY 0x80 /**< notify after execution \sa LCF_NOTIFYONLY */ 62 | #define LCF_NOTIFYONLY 0xff /**< only notify parent; no execution \sa LCF_NOTIFY */ 63 | #define LCF_HTTP 0x01 /**< execute link as \c http:// by appending it \sa LCF_HTTPS, LCF_MAIL */ 64 | #define LCF_HTTPS 0x02 /**< execute link as \c https:// by appending it \sa LCF_HTTP, LCF_MAIL */ 65 | #define LCF_MAIL 0x04 /**< execute link as a \c mailto: by appending it \sa LCF_HTTP, LCF_HTTPS */ 66 | #define LCF_PARAMS 0x10 /**< link target is a command line */ 67 | 68 | #define SS_LINK (SS_NOTIFY | SS_NOPREFIX | WS_TABSTOP) /**< styles for proper link handling */ 69 | 70 | /** 71 | * \brief "converts" a static text control into a link like control 72 | * \param link_control static text control to become a link (with \c SS_LINK style(s) set) 73 | * \param flags "any" combination of \c LCF_* 74 | * \param target link target; can be \c NULL if \p link_control's text is to be used 75 | * \remark \p target is used directly without a copy. You must guarantee its existence for the lifetime of our link control 76 | * \see LCF_SIMPLE, LCF_NOTIFY, LCF_NOTIFYONLY, LCF_HTTP, LCF_HTTPS, LCF_MAIL, LCF_PARAMS */ 77 | void LinkControl_Setup(HWND link_control, unsigned char flags, const wchar_t* target); 78 | /** 79 | * \brief call on \c WM_CTLCOLORSTATIC messages from our link control 80 | * \param hwnd parent of our link control; that is the window that received \c WM_CTLCOLORSTATIC 81 | * \param wParam,lParam 82 | * \return returncode for \c WM_CTLCOLORSTATIC ( \c handle to a background brush ) */ 83 | LRESULT LinkControl_OnCtlColorStatic(HWND hwnd, WPARAM wParam, LPARAM lParam); 84 | 85 | /* 86 | COLOR BOXES 87 | */ 88 | typedef struct { 89 | HWND hwnd; 90 | COLORREF color; 91 | } ColorBox; /**< ColorBox definition to pass to ColorBox_Setup() \sa ColorBox_Setup() */ 92 | 93 | /** 94 | * \brief initializes a ComboBox to a ColorBox. 95 | * \param boxes[] ColorBox array 96 | * \param num number of ColorBoxes in \a boxes 97 | * \remark * The ComoboBox must be created with \c WS_VSCROLL|CBS_DROPDOWNLIST|CBS_OWNERDRAWFIXED styles 98 | * \remark * Recommended width \c 70-76, height \c 180 99 | * \remark * The choose color button must be right next to the ComboBox (next Z order) 100 | * \remark * make sure you've setup \c ColorBox_OnMeasureItem(), \c ColorBox_OnDrawItem() calls 101 | * \sa ColorBox_OnMeasureItem(), ColorBox_OnDrawItem() */ 102 | void ColorBox_Setup(ColorBox boxes[], size_t num); 103 | /** 104 | * \brief sets the currently selected color 105 | * \param box 106 | * \param new_color 107 | * \return the internal index of the newly set color 108 | * \sa ColorBox_GetColor(), ColorBox_GetColorRaw() */ 109 | int ColorBox_SetColor(HWND box, COLORREF new_color); 110 | /** 111 | * \brief gets the currently selected color in raw format 112 | * \param hwnd box to get color from 113 | * \return currently selected color in raw format, that is in \c TCOLOR_* format (or raw COLORREF) 114 | * \sa ColorBox_GetColor(), TClockAPI::GetColor(), TCOLOR, TCOLOR_DEFAULT */ 115 | #define ColorBox_GetColorRaw(hwnd) ((COLORREF)ComboBox_GetItemData(hwnd,ComboBox_GetCurSel(hwnd))) 116 | /** 117 | * \brief gets the currently selected color 118 | * \param hwnd box to get color from 119 | * \return currently selected and parsed color, ready for display 120 | * \sa ColorBox_GetColorRaw(), TClockAPI::GetColor(), TCOLOR, TCOLOR_DEFAULT */ 121 | #define ColorBox_GetColor(hwnd) api.GetColor(ColorBox_GetColorRaw(hwnd), 0) 122 | 123 | /** 124 | * \brief call on \c WM_MEASUREITEM messages from our ColorBox (ComboBox) 125 | * \param wParam,lParam 126 | * \return returncode for \c WM_MEASUREITEM ( \c 1 if message got processed) */ 127 | LRESULT ColorBox_OnMeasureItem(WPARAM wParam, LPARAM lParam); 128 | /** 129 | * \brief call on \c WM_DRAWITEM messages from our ColorBox (ComboBox) 130 | * \param wParam,lParam 131 | * \return returncode for \c WM_DRAWITEM ( \c 1 if message got processed) */ 132 | LRESULT ColorBox_OnDrawItem(WPARAM wParam, LPARAM lParam); 133 | /** 134 | * \brief call for \c WM_COMMAND messages from a color choose button 135 | * \param button HWND of a choose color button from a ColorBox 136 | * \return returns 1 if a color was selected */ 137 | int ColorBox_ChooseColor(HWND button); 138 | 139 | #ifdef __cplusplus 140 | } 141 | #endif 142 | #endif // CONTROL_EXTENSIONS_H_ 143 | -------------------------------------------------------------------------------- /src/common/getopt_tools.h: -------------------------------------------------------------------------------- 1 | #ifndef GETOPT_TOOLS_H_ 2 | #define GETOPT_TOOLS_H_ 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #if !defined( _MSC_VER) && !defined(GETOPT_OVERWRITE) 8 | # include 9 | #else // _MSC_VER 10 | # include 11 | # define no_argument no_argument_msvc 12 | # define required_argument required_argument_msvc 13 | # define optional_argument optional_argument_msvc 14 | # define option option_msvc 15 | # define optind optind_msvc 16 | # define optopt optopt_msvc 17 | # define opterr opterr_msvc 18 | # define optarg optarg_msvc 19 | # define getopt_long getopt_long_msvc 20 | struct option_msvc{ 21 | const char* name; 22 | int has_arg; 23 | int* flag; 24 | int val; 25 | }; 26 | extern int optind_msvc; /* index of first non-option in argv */ 27 | extern int optopt_msvc; /* single option character, as parsed */ 28 | extern int opterr_msvc; /* flag to enable built-in diagnostics... */ 29 | /* (user may set to zero, to suppress) */ 30 | extern char* optarg_msvc; /* pointer to argument of current option */ 31 | enum HAS_ARG{ 32 | no_argument_msvc = 0, /* option never takes an argument */ 33 | required_argument_msvc, /* option always requires an argument */ 34 | optional_argument_msvc /* option may take an argument */ 35 | }; 36 | // basic implementation, doesn't support GNU extensions in `optstring` (+-) or POSIXLY_CORRECT 37 | // http://linux.die.net/man/3/getopt_long 38 | int getopt_long_msvc(int argc, char*const argv[], const char* optstring, const struct option* longopts, int* longindex); 39 | #endif // _MSC_VER 40 | 41 | #define DH_ARGV 0 ///< use \c argv0 as is \sa DisplayHelp() 42 | #define DH_ARGV_SHORT (const char*)1 ///< use the file name of argv0 without path \sa DisplayHelp() 43 | /** \sa help::opt, help::params, help::descr */ 44 | struct help { 45 | int opt; ///< option identifier (eg. short option or long option value 46 | const char* params; ///< \b optional parameter text to display 47 | const char* descr; ///< \b required description to display 48 | }; 49 | /** \brief prints command line help to \c stdout 50 | * \param argv0 program path ( likely just \c argv[0] ) 51 | * \param short_options same as \c options for \c getopt(_long) 52 | * \param long_options same as \c longopts for \c getopt_long 53 | * \param help_info help information structure. Contains descriptions of valid arguments in \p short_options and \p long_options 54 | * \param max_line max. chars per line (split by word boundary. Recommended: 80) 55 | * \return the maximum option / indentation length for use by \c PrintIndentedLine() or zero on failure 56 | * \remark \p help_info [0] configures the behavior of \c DisplayHelp() 57 | * \remark \c help_info[0].opt is currently unused and should be zero. 58 | * \remark \c help_info[0].params configures the behavior of \p argv0 or replaces it entirely. Set to any \c DH_ARGV* constant 59 | * \remark \c help_info[0].descr is the usage description after the program name. Eg. [OPTION]... [-T] SOURCE DEST 60 | * \remark Note: \p argv0 can be \c NULL when \c help_info[0].params points to a valid string 61 | * \sa help, DH_ARGV, DH_ARGV_SHORT, PrintIndentedLine(), getopt(), getopt_long() */ 62 | int DisplayHelp(const char* argv0, const char* short_options, const struct option* long_options, const struct help* help_info, int max_line); 63 | /** \brief prints a line to \c stdout indented by \p indent with maximum \p max_line characters per line 64 | * \param str string to output 65 | * \param max_line max. chars per line (split by word boundary. Recommended: 80) 66 | * \param indented already indented by this number of characters 67 | * \param indent requested indentation level 68 | * \return input string pointing to the next character for output 69 | * \remark This function must be called repeatedly with the last returned string until it points to a null char */ 70 | const char* PrintIndentedLine(const char* str, int max_line, int indented, int indent); 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | #endif // GETOPT_TOOLS_H_ 76 | -------------------------------------------------------------------------------- /src/common/icons/about.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Michael Buckley 6 | pastel.svg.large@codefisher.org 7 | Pastel SVG Icons 8 | 1.2 9 | An Icon set based on famfamfam. 10 | http://codefisher.org/pastel-svg/ 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/common/icons/arrow-refresh-small.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/src/common/icons/arrow-refresh-small.ico -------------------------------------------------------------------------------- /src/common/icons/arrow-refresh.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/src/common/icons/arrow-refresh.ico -------------------------------------------------------------------------------- /src/common/icons/cog.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/src/common/icons/cog.ico -------------------------------------------------------------------------------- /src/common/icons/license.txt: -------------------------------------------------------------------------------- 1 | The Pastel SVG icon set Created by Michael Buckley is licensed under the: 2 | 3 | Creative Commons Attribution NonCommercial Share Alike 4.0 4 | http://creativecommons.org/licenses/by-nc-sa/4.0/ 5 | -------------------------------------------------------------------------------- /src/common/icons/stoic.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/src/common/icons/stoic.ico -------------------------------------------------------------------------------- /src/common/icons/white-tiger.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/src/common/icons/white-tiger.ico -------------------------------------------------------------------------------- /src/common/icons/xmas_stoic.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/src/common/icons/xmas_stoic.ico -------------------------------------------------------------------------------- /src/common/manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | true 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/common/messagebox_custom.h: -------------------------------------------------------------------------------- 1 | #ifndef MESSAGEBOXCUSTOM_H_ 2 | #define MESSAGEBOXCUSTOM_H_ 3 | #include 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /** \brief send by \c MessageBoxCustom() to request MessageBoxCustomData structure. 9 | * \c wParam and \c lParam are unused 10 | * \sa MessageBoxCustom(), MessageBoxCustomData */ 11 | #define WMBC_INITDIALOG (WM_USER + 0x450) 12 | /** send by \c MessageBoxCustom() before returning to inform about check states 13 | * \c wParam is a set of bits to indicate the check box states 14 | * \c wParam&1 = check1, \c wParam&2 = check2, \c wParam&4 = check3 ... 15 | * \sa MessageBoxCustom() */ 16 | #define WMBC_CHECKS (WM_USER + 0x451) 17 | 18 | /** use raw button styles */ 19 | #define BS_MBC_RAW_STYLE 0x00080000 20 | 21 | /** auto disable checkbox based on previous checkbox */ 22 | #define BST_MBC_AUTODISABLE 0x00010000 23 | /** use raw checkbox styles */ 24 | #define BST_MBC_RAW_STYLE 0x00100000 25 | 26 | #define ID_MBC1 1000 27 | #define ID_MBC2 1001 28 | #define ID_MBC3 1002 29 | #define ID_MBC4 1003 30 | 31 | #define MBC_MAX_CHECKBOXES 2 32 | #define MBC_CHECK1 1004 33 | #define MBC_CHECK2 1005 34 | #define MBC_CHECK_END (MBC_CHECK1 + MBC_MAX_CHECKBOXES) 35 | typedef struct MessageBoxCustomData MessageBoxCustomData; 36 | 37 | /** 38 | * \brief displays a customizable MessageBox which sends callbacks to its parent 39 | * \param parent required parent window that receives \c WMBC_INITDIALOG and \c WMBC_CHECKS callbacks 40 | * \param message 41 | * \param title 42 | * \param style message box style flags such as \c MB_ICONINFORMATION|MB_DEFBUTTON3 43 | * \return \c -1/0 on failure, on success one of \c ID_MBC1 to \c ID_MBC4 or \c close_id 44 | * \remark sends the callback message \c WMBC_INITDIALOG on creation to request \c MessageBoxCustomData structure 45 | * \remark set \c MessageBoxCustomData.close_id to desired value when user closes dialog (defaults to \c IDCANCEL) 46 | * \remark set \c MessageBoxCustomData.icon_title* to custom window icon \e (optional) 47 | * \remark set \c MessageBoxCustomData.icon_text to custom text icon \e (optional) 48 | * \sa MessageBoxCustomData, MB_ICONEXCLAMATION, MB_ICONWARNING, MB_ICONINFORMATION, MB_ICONASTERISK, MB_ICONQUESTION, MB_ICONSTOP, MB_ICONERROR, MB_ICONHAND, MB_DEFBUTTON1, MB_APPLMODAL, MB_SYSTEMMODAL, MB_TASKMODAL, MB_TOPMOST */ 49 | int MessageBoxCustom(HWND parent, const wchar_t* message, const wchar_t* title, unsigned style /* = MB_DEFBUTTON1 */); 50 | /** 51 | * \brief works like \c MessageBoxCustom() but doesn't require a parent window 52 | * \param[in,out] settings settings to use; receives updated checkbox states on return 53 | * \param[in] message 54 | * \param[in] title 55 | * \param[in] style message box style flags such as \c MB_ICONINFORMATION|MB_DEFBUTTON3 56 | * \return \c -1/0 on failure, on success one of \c ID_MBC1 to \c ID_MBC4 or \c close_id 57 | * \sa MessageBoxCustom() */ 58 | int MessageBoxCustom_Direct(MessageBoxCustomData* settings, const wchar_t* message, const wchar_t* title, unsigned style /* = MB_DEFBUTTON1 */); 59 | 60 | typedef struct MBC_Button { 61 | const wchar_t* text; 62 | HICON icon; /**< additional icon for the button */ 63 | int style; /**< button styles to add/overwrite \sa BS_MBC_RAW_STYLE, BS_*, WS_* */ 64 | } MBC_Button; 65 | 66 | typedef struct MBC_Check { 67 | const wchar_t* text; 68 | RECT pos; /**< checkbox offset and size in dialog units (left: left padding, top: vertical padding, right: width, bottom: height */ 69 | int state; /**< checked states \sa BST_CHECKED, BST_UNCHECKED, BST_MBC_AUTODISABLE, BST_MBC_RAW_STYLE */ 70 | int style; /**< checkbox styles to add/overwrite \sa BST_MBC_RAW_STYLE, BST_*, WS_* */ 71 | } MBC_Check; 72 | 73 | struct MessageBoxCustomData { 74 | HICON icon_title_big; /**< custom title icon or NULL for parent's */ 75 | HICON icon_title_small; 76 | HICON icon_text; /**< custom message icon or NULL for default */ 77 | MBC_Button button[4]; /**< \sa MBC_Button */ 78 | MBC_Check check[MBC_MAX_CHECKBOXES]; /**< \sa MBC_Check */ 79 | int close_id; /**< default close/ESC control ID */ 80 | }; 81 | 82 | #ifdef __cplusplus 83 | } 84 | #endif 85 | #endif // MESSAGEBOXCUSTOM_H_ 86 | -------------------------------------------------------------------------------- /src/common/utl.h: -------------------------------------------------------------------------------- 1 | #ifndef TCLOCK_UTL_H 2 | #define TCLOCK_UTL_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | /** 7 | * \brief checks if current process is in admin group 8 | * \return boolean */ 9 | int IsRunAsAdmin(); 10 | /** 11 | * \brief checks if current user is in admin group 12 | * \return boolean */ 13 | int IsUserInAdminGroup(); 14 | /** 15 | * \brief get parent process ID from \c pid 16 | * \param pid 17 | * \return parent process ID or 0 on failure 18 | * \sa GetCurrentProcessId() */ 19 | unsigned GetParentProcess(unsigned pid); 20 | // clock related 21 | /** 22 | * \brief refreshes taskbar and clock */ 23 | void RefreshUs(); 24 | // unsorted 25 | /** 26 | * \brief converts a hex string to integer 27 | * \param p hex string to convert 28 | * \return parsed integer */ 29 | int atox(const char* p); 30 | /** 31 | * \brief converts a hex string to integer 32 | * \param p hex string to convert 33 | * \return parsed integer */ 34 | int wtox(const wchar_t* p); 35 | /** 36 | * \brief converts \p hour from 24h format to 12h 37 | * \param hour 24h format 38 | * \return 12h format */ 39 | int _24hTo12h(int hour); 40 | /** 41 | * \brief converts \p hour from 12h format to 24h 42 | * \param hour 12h format 43 | * \param pm use when \p hour is (after)noon 44 | * \return 24h format */ 45 | int _12hTo24h(int hour, int pm); 46 | /** 47 | * \brief forces hwnd to the foreground, 48 | * even when the current process isn't the foreground process. 49 | * (hooks into the current foreground process to complete) 50 | * \param hwnd target window 51 | * \sa SetForegroundWindow(), SetActiveWindow() */ 52 | void ForceForegroundWindow(HWND hwnd); 53 | /** 54 | * \brief deletes the end of a path from \a path, eg. "C:/out.exe" becomes "C:/" 55 | * \param[in,out] path path to delete from 56 | * \sa add_title(), get_title() */ 57 | void del_title(wchar_t* path); 58 | /** 59 | * \brief adds a title to a path, eg. "out.exe" to "C:" results "C:/out.exe" 60 | * \param[in,out] path to manipulate 61 | * \param[in] title to add (can be relative or absolute) 62 | * \sa get_title(), del_title() */ 63 | void add_title(wchar_t* path, const wchar_t* title); 64 | /** 65 | * \brief get the title from path, eg. "out.exe" from "C:/out.exe" 66 | * \param[out] dst receives the title 67 | * \param[in] path to get title from 68 | * \sa add_title(), del_title() */ 69 | void get_title(wchar_t* dst, const wchar_t* path); 70 | /** 71 | * \brief case-insensitively compares if ext matches the file extension of fname 72 | * \param fname file to test for \a ext 73 | * \param ext extension to find 74 | * \return 0 if both extensions match, otherwise the difference */ 75 | int ext_cmp(const wchar_t* fname, const wchar_t* ext); 76 | /** 77 | * \brief adds a C string to a double-zero terminated string list. That is ABC,0,EFG,0,0 78 | * \param[in,out] list string list to add \a str to 79 | * \param[in] str C string to add */ 80 | void str0cat(wchar_t* list, const wchar_t* str); 81 | /** 82 | * \brief returns a string with \a id from our string table 83 | * \param id of string to return 84 | * \return \c NULL on failure */ 85 | wchar_t* MyString(UINT id); 86 | //void Pause(HWND hWnd, LPCTSTR pszArgs); 87 | // HaveSetTimePerms.c 88 | /** 89 | * \brief checks for \c SetSystemTime() permissions (\c SE_SYSTEMTIME_NAME) 90 | * \return boolean */ 91 | int HaveSetTimePermissions(); 92 | /** 93 | * \brief creates a dialog only if it isn't already there (\c CreateDialogParam) 94 | * \param[in,out] hwnd "previous" dialog \c HWND to be checked; Set to intermediate state during creation and final \c HWND on return 95 | * \param[in] hInstance 96 | * \param[in] lpTemplateName 97 | * \param[in] hWndParent 98 | * \param[in] lpDialogFunc 99 | * \param[in] dwInitParam 100 | * \return created or previous \p hwnd 101 | * \sa CreateDialogParam() */ 102 | HWND CreateDialogParamOnce(HWND* hwnd, HINSTANCE hInstance, const wchar_t* lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam); 103 | /** 104 | * \brief creates an 32bit ARGB bitmap 105 | * \param hdc target DC of the newly created bitmap 106 | * \param width new bitmap's width 107 | * \param height new bitmap's height 108 | * \return created bitmap or \c NULL on error 109 | * \sa CreateDIBSection() */ 110 | HBITMAP CreateBitmapWithAlpha(HDC hdc, int width, int height); 111 | /** 112 | * \brief convert \c HICON to 32bit ARGB \c HBITMAP for use by context menus and other controls 113 | * \param icon 114 | * \param size icon dimensions or \c 0 for "32x32" \c SM_C*ICON, \c -1 for "16x16" \c SM_C*SMICON, \c -2 for \c SM_C*MENUCHECK 115 | * \return bitmap or \c NULL on error 116 | * \sa GetSystemMetrics(), SM_CXICON, SM_CYICON, SM_CXSMICON, SM_CYSMICON */ 117 | HBITMAP GetBitmapFromIcon(HICON icon, int size); 118 | /** 119 | * \brief logs debug stuff to T-Clock.log on the user's Desktop with \c fprintf() 120 | * \param indent \c 0 for a simple log entry, other values will increase or decrease the log indentation. (useful for recursive functions) 121 | * \param format string with \c fprintf() format specifiers (can be an empty string for log creation) 122 | * \param ... any number of data to format 123 | * \remark - symbol only exported for debug builds or if \c LOGGING has been defined 124 | * \sa DebugLogFree() */ 125 | void DebugLog(int indent, const char* format, ...); 126 | /** 127 | * \brief cleanup function to \c DebugLog() that closes file pointers \sa DebugLog() */ 128 | void DebugLogFree(); 129 | 130 | #include "utl_logging.h" 131 | #ifndef LOGGING 132 | # define DebugLog(indent,format,...) /**< nop; RELEASE (LOGGING not defined) */ 133 | # define DebugLogFree() /**< nop; RELEASE (LOGGING not defined) */ 134 | #endif // LOGGING 135 | #ifdef __cplusplus 136 | } 137 | #endif 138 | #endif // TCLOCK_UTL_H 139 | -------------------------------------------------------------------------------- /src/common/utl_logging.h: -------------------------------------------------------------------------------- 1 | //#define LOGGING 2 | -------------------------------------------------------------------------------- /src/common/version.h: -------------------------------------------------------------------------------- 1 | #ifndef AUTOVERSION_H 2 | #define AUTOVERSION_H 3 | /* Note: to use integer defines as strings, use STR(), eg. STR(VER_REVISION) */ 4 | /**** Version ****/ 5 | # define VER_MAJOR 2 6 | # define VER_MINOR 4 7 | # define VER_BUILD 4 8 | /** status values: 0=Alpha(α), 1=Beta(β), 2=RC(гc), 3=Release(г), 4=Maintenance(гm) */ 9 | # define VER_STATUS 2 10 | # define VER_STATUS_FULL "RC" 11 | # define VER_STATUS_SHORT "rc" 12 | # define VER_STATUS_GREEK "\u0433c" 13 | # define VER_REVISION 492 14 | # define VER_FULL "2.4.4 RC" 15 | # define VER_SHORT "2.4rc4" 16 | # define VER_SHORT_DOTS "2.4.4" 17 | # define VER_SHORT_GREEK "2.4\u0433c4" 18 | # define VER_RC_REVISION 2, 4, 4, 492 19 | # define VER_RC_STATUS 2, 4, 4, 2 20 | /**** Subversion Information ****/ 21 | # define VER_REVISION_URL "git@github.com:White-Tiger/T-Clock.git" 22 | # define VER_REVISION_DATE "2018-01-28 19:22:27 +0000 (Sun, Jan 28 2018)" 23 | # define VER_REVISION_HASH "e89dfdb" 24 | # define VER_REVISION_TAG "v2.4.4#492-rc" 25 | /**** Date/Time ****/ 26 | # define VER_TIMESTAMP 1517167741 27 | # define VER_TIME_SEC 1 28 | # define VER_TIME_MIN 29 29 | # define VER_TIME_HOUR 19 30 | # define VER_TIME_DAY 28 31 | # define VER_TIME_MONTH 1 32 | # define VER_TIME_YEAR 2018 33 | # define VER_TIME_WDAY 0 34 | # define VER_TIME_YDAY 27 35 | # define VER_TIME_WDAY_SHORT "Sun" 36 | # define VER_TIME_WDAY_FULL "Sunday" 37 | # define VER_TIME_MONTH_SHORT "Jan" 38 | # define VER_TIME_MONTH_FULL "January" 39 | # define VER_TIME "19:29:01" 40 | # define VER_DATE "2018-01-28" 41 | # define VER_DATE_LONG "Sun, Jan 28, 2018 19:29:01 UTC" 42 | # define VER_DATE_SHORT "2018-01-28 19:29:01 UTC" 43 | # define VER_DATE_ISO "2018-01-28T19:29:01Z" 44 | /**** Helper 'functions' ****/ 45 | # define VER_IsReleaseOrHigher() ( VER_STATUS >= 3 ) 46 | # define VER_IsAlpha() ( VER_STATUS == 0 ) 47 | # define VER_IsBeta() ( VER_STATUS == 1 ) 48 | # define VER_IsRC() ( VER_STATUS == 2 ) 49 | # define VER_IsRelease() ( VER_STATUS == 3 ) 50 | # define VER_IsMaintenance() ( VER_STATUS == 4 ) 51 | #ifndef STR 52 | # define STR_(x) #x 53 | # define STR(x) STR_(x) 54 | #endif 55 | #ifndef L 56 | # define L_(x) L##x 57 | # define L(x) L_(x) 58 | #endif 59 | #endif 60 | -------------------------------------------------------------------------------- /src/common/win2k_compat.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN2K_COMPAT_H_ 2 | #define WIN2K_COMPAT_H_ 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | #ifdef WIN2K_COMPAT 7 | 8 | #include 9 | #include 10 | errno_t win2k_strncpy_s(char* strDest, size_t numberOfElements, const char* strSource, size_t count); 11 | errno_t win2k_wcsncpy_s(wchar_t* strDest, size_t numberOfElements, const wchar_t* strSource, size_t count); 12 | #define strncpy_s win2k_strncpy_s 13 | #define wcsncpy_s win2k_wcsncpy_s 14 | char* win2k_strtok_s(char* strToken, const char* strDelimit, char** context); 15 | wchar_t* win2k_wcstok_s(wchar_t* strToken, const wchar_t* strDelimit, wchar_t** context); 16 | #define strtok_s win2k_strtok_s 17 | #define wcstok_s win2k_wcstok_s 18 | 19 | #include 20 | #include 21 | BOOL win2k_SetWindowSubclass(HWND hwnd, SUBCLASSPROC pfnSubclass, UINT_PTR uIdSubclass, DWORD_PTR dwRefData); 22 | BOOL win2k_GetWindowSubclass(HWND hwnd, SUBCLASSPROC pfnSubclass, UINT_PTR uIdSubclass, DWORD_PTR* pdwRefData); 23 | BOOL win2k_RemoveWindowSubclass(HWND hwnd, SUBCLASSPROC pfnSubclass, UINT_PTR uIdSubclass); 24 | typedef LRESULT (WINAPI *DefSubclassProc_ptr)(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 25 | extern DefSubclassProc_ptr win2k_DefSubclassProc; 26 | #define SetWindowSubclass win2k_SetWindowSubclass 27 | #define GetWindowSubclass win2k_GetWindowSubclass 28 | #define RemoveWindowSubclass win2k_RemoveWindowSubclass 29 | #define DefSubclassProc win2k_DefSubclassProc 30 | 31 | #include 32 | DWORD win2k_WTSGetActiveConsoleSessionId(void); 33 | BOOL win2k_WTSRegisterSessionNotification(HWND hWnd, DWORD dwFlags); 34 | BOOL win2k_WTSUnRegisterSessionNotification(HWND hWnd); 35 | #define WTSGetActiveConsoleSessionId win2k_WTSGetActiveConsoleSessionId 36 | #define WTSRegisterSessionNotification win2k_WTSRegisterSessionNotification 37 | #define WTSUnRegisterSessionNotification win2k_WTSUnRegisterSessionNotification 38 | 39 | void OpportunisticConsole(); 40 | 41 | #else 42 | # define OpportunisticConsole() {FreeConsole();AttachConsole(ATTACH_PARENT_PROCESS);} 43 | #endif // WIN2K_COMPAT 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | #endif // WIN2K_COMPAT_H_ 48 | -------------------------------------------------------------------------------- /src/compile.bat: -------------------------------------------------------------------------------- 1 | goto=kkk 2 | #!/bin/bash 3 | # start of bash 4 | pushd "`dirname "${BASH_SOURCE[0]}"`/~ide" 5 | export TRAVIS_COMMIT_MSG="${TRAVIS_COMMIT_MSG:-$(git log --format=%B --no-merges -n1)}" 6 | 7 | AUVER_IF_NOT=${TRAVIS_TAG:-${APPVEYOR_REPO_TAG_NAME}} 8 | if [ -z "$AUVER_IF_NOT" ];then export AUVER_SET="STATUS=0"; fi 9 | if [[ $TRAVIS_COMMIT_MSG =~ \[(log(ging)?)\] ]];then 10 | LOGGING=1 11 | fi 12 | if [ "$LOGGING" = 1 ];then 13 | echo "#define LOGGING" > ../common/utl_logging.h 14 | fi 15 | 16 | ./makex "$@" 17 | ret=$? 18 | popd 19 | return $ret 2>/dev/null;exit $ret 20 | 21 | 22 | :=kkk 23 | @echo off 24 | rem # start of batch 25 | pushd %~dp0~ide 26 | if not defined signtool set "signtool="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\signtool.exe"" 27 | if not defined vcvarsall set "vcvarsall="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"" 28 | if not defined SetEnv set "SetEnv="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd"" 29 | 30 | set "AUVER_IF_NOT=%TRAVIS_TAG%%APPVEYOR_REPO_TAG_NAME%" 31 | if not defined AUVER_IF_NOT set "AUVER_SET=STATUS=0" 32 | 33 | rem if not defined APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED ( 34 | git log --format^=%%B --no-merges -n1 >.tmp_msg 35 | (findstr /C:"[logging]" .tmp_msg || findstr /C:"[log]" .tmp_msg) >nul 36 | if %errorlevel% equ 0 ( 37 | set LOGGING=1 38 | ) 39 | del .tmp_msg 40 | rem ) 41 | if "%LOGGING%"=="1" ( 42 | echo #define LOGGING > ../common/utl_logging.h 43 | ) 44 | if defined APPVEYOR ( 45 | if not defined MSBUILD_LOGGER set "MSBUILD_LOGGER=/logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"" 46 | ) 47 | if "%1"=="clean" ( 48 | shift 49 | set "target=/t:Clean" 50 | ) 51 | rem %vcvarsall% x86 52 | call %SetEnv% /release /x86 53 | msbuild "msvc-vs.sln" /p:Platform=x86 /p:Configuration=Release /verbosity:minimal %MSBUILD_LOGGER% %target% "%1" "%2" "%3" "%4" "%5" "%6" "%7" "%8" "%9" 54 | if %errorlevel% neq 0 exit /B %errorlevel% 55 | rem %vcvarsall% amd64 56 | call %SetEnv% /release /x64 57 | msbuild "msvc-vs.sln" /p:Platform=x64 /p:Configuration=Release /verbosity:minimal %MSBUILD_LOGGER% %target% "%1" "%2" "%3" "%4" "%5" "%6" "%7" "%8" "%9" 58 | if %errorlevel% neq 0 exit /B %errorlevel% 59 | popd 60 | exit /B %errorlevel% 61 | -------------------------------------------------------------------------------- /src/options/main.c: -------------------------------------------------------------------------------- 1 | #include "../common/globals.h" 2 | //#include "../common/newapi.h" 3 | #include "../common/getopt_tools.h" 4 | #include "../common/version.h" 5 | #include 6 | #include 7 | //#include // _open_osfhandle 8 | //#include // _O_TEXT 9 | 10 | #include "update.h" 11 | 12 | //other 13 | HINSTANCE g_instance; 14 | TClockAPI api; 15 | 16 | 17 | int main(int argc, char* argv[]) { 18 | static const char* short_options = "hu::"; 19 | static struct option long_options[] = { 20 | // basic 21 | {"help", no_argument, 0, 'h'}, 22 | {"version", no_argument, 0, '1'}, 23 | {"update", optional_argument, 0, 'u'}, 24 | {0} 25 | }; 26 | const struct help help_info[] = { 27 | {0,DH_ARGV_SHORT,"[option] ..."}, 28 | {'h',0,""}, 29 | {'1',0,""}, 30 | {'u',"check|notify|silent","check for updates\nreturns IDYES(6), IDNO(7) or IDCANCEL(2)"}, 31 | {0} 32 | }; 33 | INITCOMMONCONTROLSEX icex = {sizeof(icex), ICC_STANDARD_CLASSES|ICC_WIN95_CLASSES}; 34 | 35 | OpportunisticConsole(); 36 | // https://support.microsoft.com/en-us/kb/105305 37 | /* if it were a GUI app, we could do something like this: 38 | if(stdout->_file < 0) { 39 | HANDLE hstdout = GetStdHandle(STD_OUTPUT_HANDLE); 40 | if(hstdout && hstdout != INVALID_HANDLE_VALUE) { 41 | int hCrt = _open_osfhandle((intptr_t)hstdout, _O_TEXT); 42 | FILE* hf = _fdopen(hCrt, "w"); 43 | setvbuf(hf, NULL, _IONBF, 0); 44 | *stdout = *hf; 45 | } 46 | } 47 | if(stderr->_file < 0) { 48 | HANDLE hstderr = GetStdHandle(STD_ERROR_HANDLE); 49 | if(hstderr && hstderr != INVALID_HANDLE_VALUE) { 50 | int hCrt = _open_osfhandle((intptr_t)hstderr, _O_TEXT); 51 | FILE* hf = _fdopen(hCrt, "w"); 52 | setvbuf(hf, NULL, _IONBF, 0); 53 | *stderr = *hf; 54 | } 55 | }// */ 56 | 57 | g_instance = GetModuleHandle(NULL); 58 | InitCommonControlsEx(&icex); 59 | if(LoadClockAPI(L"T-Clock" ARCH_SUFFIX, &api)) { 60 | puts("failed to load T-Clock.dll"); 61 | return 2; 62 | } 63 | 64 | for(;;) { 65 | int opt; 66 | int option_index = 0; 67 | opt = getopt_long(argc, argv, short_options, long_options, &option_index); 68 | if (opt == -1) 69 | break; 70 | switch(opt){ 71 | case 0: case 1: 72 | break; 73 | case '?': /*case ':':*/ 74 | break; 75 | case 'h': 76 | DisplayHelp(argv[0], short_options, long_options, help_info, 80); 77 | /* fall through */ 78 | case '1': 79 | puts("T-Clock Options " VER_REVISION_TAG); 80 | return 1; 81 | case 'u':{ 82 | int updates = IDCANCEL; 83 | if(!optarg || !strcasecmp(optarg,"check")) { 84 | updates = UpdateCheck(UPDATE_SHOW); 85 | } else if(!strcasecmp(optarg,"notify")) { 86 | updates = UpdateCheck(UPDATE_NOTIFY); 87 | } else if(!strcasecmp(optarg,"silent")) { 88 | updates = UpdateCheck(UPDATE_SILENT); 89 | } 90 | if(updates == IDYES) 91 | puts("updates found"); 92 | else if(updates == IDNO) 93 | puts("no updates"); 94 | else 95 | puts("update error"); 96 | return updates;} 97 | default: 98 | ; 99 | } 100 | } 101 | if(optind < argc || argc == 1) { 102 | DisplayHelp(argv[0], short_options, long_options, help_info, 80); 103 | return 1; 104 | } 105 | return 0; 106 | } 107 | -------------------------------------------------------------------------------- /src/options/resource.h: -------------------------------------------------------------------------------- 1 | 2 | #define IDI_MAIN 106 3 | #define IDI_UPDATE 107 4 | #define IDI_UPDATE_S 108 5 | 6 | #define IDD_UPDATECHECK 1000 7 | #define IDC_STATUS 1001 8 | #define IDC_PROGRESS 1002 9 | -------------------------------------------------------------------------------- /src/options/resource.rc: -------------------------------------------------------------------------------- 1 | // Generated by ResEdit 1.6.6 2 | // Copyright (C) 2006-2015 3 | // http://www.resedit.net 4 | 5 | #include 6 | #include 7 | #include 8 | #include "../common/version.h" 9 | #include "resource.h" 10 | #ifndef IDC_STATIC 11 | # define IDC_STATIC (-1) 12 | #endif 13 | 14 | 15 | 16 | 17 | // 18 | // Dialog resources 19 | // 20 | IDD_UPDATECHECK DIALOGEX 0, 0, 230, 26 21 | STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU 22 | CAPTION "T-Clock update check" 23 | FONT 8, "Ms Shell Dlg", 400, 0, 1 24 | { 25 | LTEXT "Status:", IDC_STATIC, 4, 2, 23, 9, SS_LEFT, WS_EX_LEFT 26 | LTEXT "", IDC_STATUS, 31, 2, 198, 9, SS_LEFT, WS_EX_LEFT 27 | PUSHBUTTON "Cancel", IDCANCEL, 180, 12, 50, 14, 0, WS_EX_LEFT 28 | CONTROL "", IDC_PROGRESS, PROGRESS_CLASS, 0, 0, 12, 180, 14, WS_EX_LEFT 29 | } 30 | 31 | 32 | 33 | // 34 | // Icon resources 35 | // 36 | IDI_MAIN ICON "../common/icons/cog.ico" 37 | IDI_UPDATE ICON "../common/icons/arrow-refresh.ico" 38 | IDI_UPDATE_S ICON "../common/icons/arrow-refresh-small.ico" 39 | 40 | 41 | 42 | // 43 | // Version Information resources 44 | // 45 | VS_VERSION_INFO VERSIONINFO 46 | FILEVERSION VER_RC_REVISION 47 | PRODUCTVERSION VER_RC_REVISION 48 | FILEOS VOS_NT_WINDOWS32 49 | FILETYPE VFT_APP 50 | FILESUBTYPE VFT2_UNKNOWN 51 | FILEFLAGSMASK VS_FF_DEBUG | VS_FF_PRERELEASE | VS_FF_PATCHED | VS_FF_PRIVATEBUILD | VS_FF_INFOINFERRED | VS_FF_SPECIALBUILD 52 | #ifdef _DEBUG 53 | FILEFLAGS VS_FF_DEBUG 54 | #else 55 | FILEFLAGS 0 56 | #endif 57 | { 58 | BLOCK "StringFileInfo" 59 | { 60 | BLOCK "000004b0" 61 | { 62 | VALUE "Comments", "" 63 | VALUE "CompanyName", "-" 64 | VALUE "FileDescription", "T-Clock Options" 65 | VALUE "FileVersion", VER_SHORT " #" STR(VER_REVISION) 66 | VALUE "InternalName", "Options.exe" 67 | VALUE "OriginalFilename", "Options.exe" 68 | VALUE "ProductName", "T-Clock Redux" 69 | VALUE "ProductVersion", VER_SHORT " #" STR(VER_REVISION) 70 | } 71 | } 72 | BLOCK "VarFileInfo" 73 | { 74 | VALUE "Translation", 0x0, 1200 75 | } 76 | } 77 | 78 | 79 | 80 | // 81 | // Manifest resources 82 | // 83 | 1 RT_MANIFEST "../common/manifest.xml" 84 | -------------------------------------------------------------------------------- /src/options/update.h: -------------------------------------------------------------------------------- 1 | #ifndef TCLOCK_UPDATE_H_ 2 | #define TCLOCK_UPDATE_H_ 3 | 4 | #define UPDATE_SHOW 0 5 | #define UPDATE_NOTIFY 1 6 | #define UPDATE_SILENT 2 7 | 8 | /** \brief checks for T-Clock updates 9 | * \param type requested type, either: 0 = show/manual, 1 = notify, 2 = silent 10 | * \return IDCANCEL on error, IDYES if updates were found, IDNO if there are no updates 11 | * \sa UPDATE_SHOW, UPDATE_NOTIFY, UPDATE_SILENT */ 12 | int UpdateCheck(int type); 13 | 14 | #endif // TCLOCK_UPDATE_H_ 15 | -------------------------------------------------------------------------------- /src/sign-n-zip.bat: -------------------------------------------------------------------------------- 1 | goto=kkk 2 | #!/bin/bash 3 | # start of bash 4 | pushd "`dirname "${BASH_SOURCE[0]}"`" 5 | xclude="-xr!*.ini -xr!*.log -xr!*.rpt -x!*.zip -xr!*.pdb -xr!*.exp -xr!*.lib -xr!*.def -xr!*.a -xr!*.manifest" 6 | tag=${TRAVIS_TAG:-${APPVEYOR_REPO_TAG_NAME}} 7 | # require tag 8 | #[ -z "$tag" ] && (return 0 2>/dev/null;exit 0) 9 | echo " $tag" 10 | if [ "$signpwd" ];then 11 | # get cert and signtool for linux 12 | (pushd .. && echo "wget 'osslsigncode'" 13 | wget -q "$signurl" -O .cert.zip && 7z x -yp$signpwd .cert.zip>/dev/null && chmod +x osslsigncode-src/configure 14 | e=$?;[ $e != 0 ]&&(return $e 2>/dev/null;exit $e) 15 | echo "make 'osslsigncode'" && cd osslsigncode-src && ./configure -q && make V=0 && mv osslsigncode ../ && popd) 16 | e=$?;[ $e != 0 ]&&(return $e 2>/dev/null;exit $e) 17 | # sign 18 | pushd ../Release; echo "sign" 19 | for f in *.exe *.dll */*.exe */*.dll;do 20 | [ -f "$f" ] || continue 21 | echo -n "$f: " 22 | ../osslsigncode sign -pkcs12 ../.cert.pfx -t http://timestamp.verisign.com/scripts/timstamp.dll "$f" "$f.tmp" 23 | e=$?;[ $e != 0 ]&&(return $e 2>/dev/null;exit $e) 24 | mv "$f.tmp" "$f" 25 | done 26 | popd 27 | fi 28 | # compress 29 | cd ../Release; echo "compress" 30 | rm -f *.zip *.7z 31 | 7z a $xclude T-Clock.zip . 32 | ret=$? 33 | [ "$tag" ] && 7z a $xclude T-Clock.7z . 34 | if [ "$GDRIVE_REFRESH_TOKEN" ];then 35 | wget -qO gdrive "https://drive.google.com/uc?id=1L1iWOR_yCvgR7L_FrcIYqcPLjwXwlAxX&export=download" && chmod +x gdrive 36 | ./gdrive update --refresh-token $GDRIVE_REFRESH_TOKEN "1m18Jb-eZya6to3NsXUlZeC2ITjXdM7IU" T-Clock.zip 37 | fi 38 | popd 39 | return $ret 2>/dev/null;exit $ret 40 | 41 | 42 | :=kkk 43 | @echo off 44 | rem # start of batch 45 | pushd %~dp0 46 | if not defined signtool set signtool=signtool 47 | set "xclude=-xr!*.ini -xr!*.log -xr!*.rpt -x!*.zip -xr!*.pdb -xr!*.exp -xr!*.lib -xr!*.def -xr!*.a -xr!*.manifest -xr!_*" 48 | if defined TRAVIS_TAG set tag=%TRAVIS_TAG% 49 | if defined APPVEYOR_REPO_TAG_NAME set tag=%APPVEYOR_REPO_TAG_NAME% 50 | rem # require tag 51 | rem if not defined tag exit /B 0 52 | echo. %tag% 53 | if defined signpwd ( 54 | rem # get cert 55 | pushd .. && echo wget '.cert.zip' 56 | powershell wget "%signurl%" -OutFile .cert.zip >nul 2>nul && 7z x -y -p%signpwd% .cert.zip >nul 57 | if %errorlevel% neq 0 exit /B %errorlevel% 58 | if not exist .cert.pfx exit /B 666 59 | popd 60 | rem # sign 61 | pushd ..\Release & echo sign 62 | %signtool% sign /v /f ..\.cert.pfx /t http://timestamp.verisign.com/scripts/timstamp.dll *.exe misc\*.exe misc\*.dll 63 | if %errorlevel% neq 0 exit /B %errorlevel% 64 | rem %signtool% verify Clock.exe 65 | rem if %errorlevel% neq 0 exit /B %errorlevel% 66 | popd 67 | ) 68 | rem # compress 69 | cd ..\Release & echo compress 70 | del *.zip *.7z 2>nul 71 | 7z a %xclude% T-Clock_vc2010.zip . 72 | set ret=%errorlevel% 73 | rem 7z a %xclude% T-Clock_vc2010.7z . 74 | if defined CI ( 75 | rem powershell Push-AppveyorArtifact T-Clock_vc2010.7z 76 | powershell Push-AppveyorArtifact T-Clock_vc2010.zip 77 | if %errorlevel% neq 0 exit /B %errorlevel% 78 | ) 79 | popd 80 | exit /B %ret% 81 | -------------------------------------------------------------------------------- /src/version: -------------------------------------------------------------------------------- 1 | 57|492 2 | 2.1.0|2.4.4 3 | |(first release) 4 | |release candidate 5 | + added "Restart Explorer" option to T-Clock's extended context menu (hold down Shift or Ctrl) 6 | + added /restart-explorer and /exit-explorer commandline arguments 7 | + added Lock and Sleep/Hibernate to "Exit Windows" 8 | ! fixed 'Wi' (ISO week number) and 'wi' (numeric day of week) formats 9 | ! fixed known Clock positioning issues (regressions from initial Windows 10 support) 10 | ! fixed Windows 10 CU's "Ink Workspace" button on multi-monitor setups -------------------------------------------------------------------------------- /src/~ide/.colorgccrc: -------------------------------------------------------------------------------- 1 | srcColor: bold cyan 2 | identColor: green 3 | 4 | introFileNameColor: reset 5 | introMessageColor: blue 6 | 7 | warningFileNameColor: reset 8 | warningLineColor: blue 9 | warningColumnColor: blue 10 | warningMessageColor: yellow 11 | 12 | errorFileNameColor: reset 13 | errorLineColor: blue 14 | errorColumnColor: blue 15 | errorMessageColor: bold red 16 | 17 | noteFileNameColor: reset 18 | noteLineColor: blue 19 | noteColumnColor: blue 20 | noteMessageColor: green 21 | -------------------------------------------------------------------------------- /src/~ide/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all clean release debug autoversion dll clock options calendar 2 | 3 | TARGET = 4 | MAKE = make 5 | TYPE = linux 6 | 7 | ifeq ($(OS)$(PWD),Windows_NT) 8 | MAKE = mingw32-make 9 | TYPE = gcc 10 | endif 11 | 12 | all: autoversion dll clock options calendar 13 | 14 | clean: TARGET = clean 15 | clean: all 16 | 17 | release: TARGET = release 18 | release: all 19 | 20 | debug: TARGET = debug 21 | debug: all 22 | 23 | autoversion: 24 | $(MAKE) -f $(TYPE)-autoversion.make $(TARGET) 25 | 26 | dll: autoversion 27 | $(MAKE) -f $(TYPE)-dll.make $(TARGET) 28 | 29 | clock: dll 30 | $(MAKE) -f $(TYPE)-clock.make $(TARGET) 31 | 32 | options: dll 33 | $(MAKE) -f $(TYPE)-options.make $(TARGET) 34 | 35 | calendar: dll 36 | $(MAKE) -f $(TYPE)-calendar.make $(TARGET) 37 | -------------------------------------------------------------------------------- /src/~ide/cbp2make.bat: -------------------------------------------------------------------------------- 1 | goto=kkk 2 | #!/bin/bash 3 | # start of bash 4 | cbp2make --wrap-objects --keep-outdir --local -in gcc.workspace -out ___tmp -unix -windows 5 | for file in `ls gcc-*.cbp.mak.unix | grep -oP "(?<=gcc-).*?(?=\.cbp\.)"`;do 6 | mv gcc-$file.cbp.mak.unix linux-$file.make 7 | mv gcc-$file.cbp.mak.windows gcc-$file.make 8 | done 9 | rm ___tmp.unix 10 | rm ___tmp.windows 11 | exit $? 12 | 13 | 14 | :=kkk 15 | @echo off 16 | rem start of batch 17 | pushd %~dp0 18 | cbp2make.exe --wrap-objects --keep-outdir --local -in gcc.workspace -out ___tmp -unix -windows 19 | for %%f in (*.cbp.mak.unix) do ( 20 | call :process linux %%f %%~nf 21 | call :process gcc %%~nf.windows %%~nf 22 | ) 23 | del ___tmp.unix 24 | del ___tmp.windows 25 | popd & echo anykey to exit & cmd /C "pause>nul" 26 | exit /B %errorlevel% 27 | :process 28 | call :process2 %1 %2 %~n3 29 | exit /B 0 30 | :process2 31 | set prefix=%1- 32 | set makefile=%2 33 | set name=%~n3 34 | set name=%name:~4% 35 | echo %prefix%%name%.make 36 | move %makefile% %prefix%%name%.make 37 | exit /B 0 38 | -------------------------------------------------------------------------------- /src/~ide/gcc-autoversion.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 51 | 52 | -------------------------------------------------------------------------------- /src/~ide/gcc-autoversion.make: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------# 2 | # This makefile was generated by 'cbp2make' tool rev.147 # 3 | #------------------------------------------------------------------------------# 4 | 5 | 6 | WORKDIR = %cd% 7 | 8 | CC = gcc.exe 9 | CXX = g++.exe 10 | AR = ar.exe 11 | LD = g++.exe 12 | WINDRES = windres.exe 13 | 14 | INC = 15 | CFLAGS = -fno-ident -Wall -fvisibility=hidden -ffunction-sections -fmerge-all-constants -fno-asynchronous-unwind-tables -fno-exceptions -fwhole-program 16 | RESINC = 17 | LIBDIR = 18 | LIB = 19 | LDFLAGS = -static -Wl,--gc-sections 20 | 21 | INC_RELEASE = $(INC) 22 | CFLAGS_RELEASE = $(CFLAGS) -Os -DNDEBUG 23 | RESINC_RELEASE = $(RESINC) 24 | RCFLAGS_RELEASE = $(RCFLAGS) 25 | LIBDIR_RELEASE = $(LIBDIR) 26 | LIB_RELEASE = $(LIB) 27 | LDFLAGS_RELEASE = $(LDFLAGS) -s 28 | OBJDIR_RELEASE = ..\\.obj\\gcc 29 | DEP_RELEASE = 30 | OUT_RELEASE = ..\\common\\AutoVersion.exe 31 | 32 | OBJ_RELEASE = $(OBJDIR_RELEASE)\\__\\common\\autoversion.o 33 | 34 | all: release 35 | 36 | clean: clean_release 37 | 38 | before_release: 39 | cmd /c if not exist ..\\common md ..\\common 40 | cmd /c if not exist $(OBJDIR_RELEASE)\\__\\common md $(OBJDIR_RELEASE)\\__\\common 41 | 42 | after_release: 43 | 44 | release: before_release out_release after_release 45 | 46 | out_release: before_release $(OBJ_RELEASE) $(DEP_RELEASE) 47 | $(LD) $(LIBDIR_RELEASE) -o $(OUT_RELEASE) $(OBJ_RELEASE) $(LDFLAGS_RELEASE) $(LIB_RELEASE) 48 | 49 | $(OBJDIR_RELEASE)\\__\\common\\autoversion.o: ..\\common\\autoversion.cpp 50 | $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ..\\common\\autoversion.cpp -o $(OBJDIR_RELEASE)\\__\\common\\autoversion.o 51 | 52 | clean_release: 53 | cmd /c del /f $(OBJ_RELEASE) $(OUT_RELEASE) 54 | cmd /c rd $(OBJDIR_RELEASE)\\__\\common 55 | 56 | .PHONY: before_release after_release clean_release 57 | 58 | -------------------------------------------------------------------------------- /src/~ide/gcc-calendar.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 118 | 119 | -------------------------------------------------------------------------------- /src/~ide/gcc-calendar.make: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------# 2 | # This makefile was generated by 'cbp2make' tool rev.147 # 3 | #------------------------------------------------------------------------------# 4 | 5 | 6 | WORKDIR = %cd% 7 | 8 | CC = $(CCACHE) i686-w64-mingw32-gcc 9 | CXX = $(CCACHE) i686-w64-mingw32-g++ 10 | AR = ar 11 | LD = i686-w64-mingw32-g++ 12 | WINDRES = windres 13 | 14 | INC = 15 | CFLAGS = -D_UNICODE -DUNICODE -fno-ident -Wall -Werror=declaration-after-statement -fvisibility=hidden -ffunction-sections -fmerge-all-constants -fno-asynchronous-unwind-tables -fno-exceptions -D_POSIX=1 -D_POSIX_C_SOURCE=200112L -D__STDC_FORMAT_MACROS -D__USE_MINGW_ANSI_STDIO=0 -D__MINGW_USE_VC2005_COMPAT -DWINVER=0x0501 -DPSAPI_VERSION=1 -DWIN2K_COMPAT 16 | RESINC = 17 | LIBDIR = 18 | LIB = -ladvapi32 -lshell32 -luser32 -lgdi32 -lpsapi -lcomdlg32 -lcomctl32 -lmsimg32 19 | LDFLAGS = -static -Wl,--gc-sections -mwindows 20 | 21 | INC_RELEASE = $(INC) 22 | CFLAGS_RELEASE = $(CFLAGS) -O3 -m32 -DNDEBUG 23 | RESINC_RELEASE = $(RESINC) 24 | RCFLAGS_RELEASE = $(RCFLAGS) 25 | LIBDIR_RELEASE = $(LIBDIR) 26 | LIB_RELEASE = $(LIB) 27 | LDFLAGS_RELEASE = $(LDFLAGS) -s -m32 28 | OBJDIR_RELEASE = ..\\.obj\\gcc 29 | DEP_RELEASE = 30 | OUT_RELEASE = ..\\..\\Release\\misc\\XPCalendar.exe 31 | 32 | INC_DEBUG = $(INC) 33 | CFLAGS_DEBUG = $(CFLAGS) -m32 -Og -g -fno-omit-frame-pointer -D_DEBUG 34 | RESINC_DEBUG = $(RESINC) 35 | RCFLAGS_DEBUG = $(RCFLAGS) 36 | LIBDIR_DEBUG = $(LIBDIR) 37 | LIB_DEBUG = $(LIB) 38 | LDFLAGS_DEBUG = $(LDFLAGS) -m32 39 | OBJDIR_DEBUG = ..\\.obj\\gcc\\dbg 40 | DEP_DEBUG = 41 | OUT_DEBUG = ..\\..\\Debug\\misc\\XPCalendar.exe 42 | 43 | OBJ_RELEASE = $(OBJDIR_RELEASE)\\__\\common\\win2k_compat.o \ 44 | $(OBJDIR_RELEASE)\\__\\common\\utl.o \ 45 | $(OBJDIR_RELEASE)\\__\\common\\newapi.o \ 46 | $(OBJDIR_RELEASE)\\__\\common\\control_extensions.o \ 47 | $(OBJDIR_RELEASE)\\__\\common\\clock.o \ 48 | $(OBJDIR_RELEASE)\\__\\Calendar\\resource.o \ 49 | $(OBJDIR_RELEASE)\\__\\Calendar\\DeskCalendar.o 50 | 51 | OBJ_DEBUG = $(OBJDIR_DEBUG)\\__\\common\\win2k_compat.o \ 52 | $(OBJDIR_DEBUG)\\__\\common\\utl.o \ 53 | $(OBJDIR_DEBUG)\\__\\common\\newapi.o \ 54 | $(OBJDIR_DEBUG)\\__\\common\\control_extensions.o \ 55 | $(OBJDIR_DEBUG)\\__\\common\\clock.o \ 56 | $(OBJDIR_DEBUG)\\__\\Calendar\\resource.o \ 57 | $(OBJDIR_DEBUG)\\__\\Calendar\\DeskCalendar.o 58 | 59 | all: before_build build_release build_debug after_build 60 | 61 | clean: clean_release clean_debug 62 | 63 | before_build: 64 | ../common/AutoVersion --git . ../common/version.h 65 | 66 | after_build: 67 | 68 | before_release: 69 | cmd /c if not exist ..\\..\\Release\\misc md ..\\..\\Release\\misc 70 | cmd /c if not exist $(OBJDIR_RELEASE)\\__\\common md $(OBJDIR_RELEASE)\\__\\common 71 | cmd /c if not exist $(OBJDIR_RELEASE)\\__\\Calendar md $(OBJDIR_RELEASE)\\__\\Calendar 72 | 73 | after_release: 74 | 75 | build_release: before_release out_release after_release 76 | 77 | release: before_build build_release after_build 78 | 79 | out_release: before_release $(OBJ_RELEASE) $(DEP_RELEASE) 80 | $(LD) $(LIBDIR_RELEASE) -o $(OUT_RELEASE) $(OBJ_RELEASE) $(LDFLAGS_RELEASE) -mwindows $(LIB_RELEASE) 81 | 82 | $(OBJDIR_RELEASE)\\__\\common\\win2k_compat.o: ..\\common\\win2k_compat.c 83 | $(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ..\\common\\win2k_compat.c -o $(OBJDIR_RELEASE)\\__\\common\\win2k_compat.o 84 | 85 | $(OBJDIR_RELEASE)\\__\\common\\utl.o: ..\\common\\utl.c 86 | $(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ..\\common\\utl.c -o $(OBJDIR_RELEASE)\\__\\common\\utl.o 87 | 88 | $(OBJDIR_RELEASE)\\__\\common\\newapi.o: ..\\common\\newapi.c 89 | $(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ..\\common\\newapi.c -o $(OBJDIR_RELEASE)\\__\\common\\newapi.o 90 | 91 | $(OBJDIR_RELEASE)\\__\\common\\control_extensions.o: ..\\common\\control_extensions.c 92 | $(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ..\\common\\control_extensions.c -o $(OBJDIR_RELEASE)\\__\\common\\control_extensions.o 93 | 94 | $(OBJDIR_RELEASE)\\__\\common\\clock.o: ..\\common\\clock.c 95 | $(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ..\\common\\clock.c -o $(OBJDIR_RELEASE)\\__\\common\\clock.o 96 | 97 | $(OBJDIR_RELEASE)\\__\\Calendar\\resource.o: ..\\Calendar\\resource.rc 98 | $(WINDRES) -i ..\\Calendar\\resource.rc -J rc -o $(OBJDIR_RELEASE)\\__\\Calendar\\resource.o -O coff $(INC_RELEASE) 99 | 100 | $(OBJDIR_RELEASE)\\__\\Calendar\\DeskCalendar.o: ..\\Calendar\\DeskCalendar.c 101 | $(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ..\\Calendar\\DeskCalendar.c -o $(OBJDIR_RELEASE)\\__\\Calendar\\DeskCalendar.o 102 | 103 | clean_release: 104 | cmd /c del /f $(OBJ_RELEASE) $(OUT_RELEASE) 105 | cmd /c rd $(OBJDIR_RELEASE)\\__\\common 106 | cmd /c rd $(OBJDIR_RELEASE)\\__\\Calendar 107 | 108 | before_debug: 109 | cmd /c if not exist ..\\..\\Debug\\misc md ..\\..\\Debug\\misc 110 | cmd /c if not exist $(OBJDIR_DEBUG)\\__\\common md $(OBJDIR_DEBUG)\\__\\common 111 | cmd /c if not exist $(OBJDIR_DEBUG)\\__\\Calendar md $(OBJDIR_DEBUG)\\__\\Calendar 112 | 113 | after_debug: 114 | objcopy --only-keep-debug ../../Debug/misc/XPCalendar.exe ../../Debug/misc/XPCalendar.dbg 115 | objcopy --strip-debug --strip-unneeded --add-gnu-debuglink=../../Debug/misc/XPCalendar.dbg ../../Debug/misc/XPCalendar.exe 116 | 117 | build_debug: before_debug out_debug after_debug 118 | 119 | debug: before_build build_debug after_build 120 | 121 | out_debug: before_debug $(OBJ_DEBUG) $(DEP_DEBUG) 122 | $(LD) $(LIBDIR_DEBUG) -o $(OUT_DEBUG) $(OBJ_DEBUG) $(LDFLAGS_DEBUG) -mwindows $(LIB_DEBUG) 123 | 124 | $(OBJDIR_DEBUG)\\__\\common\\win2k_compat.o: ..\\common\\win2k_compat.c 125 | $(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ..\\common\\win2k_compat.c -o $(OBJDIR_DEBUG)\\__\\common\\win2k_compat.o 126 | 127 | $(OBJDIR_DEBUG)\\__\\common\\utl.o: ..\\common\\utl.c 128 | $(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ..\\common\\utl.c -o $(OBJDIR_DEBUG)\\__\\common\\utl.o 129 | 130 | $(OBJDIR_DEBUG)\\__\\common\\newapi.o: ..\\common\\newapi.c 131 | $(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ..\\common\\newapi.c -o $(OBJDIR_DEBUG)\\__\\common\\newapi.o 132 | 133 | $(OBJDIR_DEBUG)\\__\\common\\control_extensions.o: ..\\common\\control_extensions.c 134 | $(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ..\\common\\control_extensions.c -o $(OBJDIR_DEBUG)\\__\\common\\control_extensions.o 135 | 136 | $(OBJDIR_DEBUG)\\__\\common\\clock.o: ..\\common\\clock.c 137 | $(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ..\\common\\clock.c -o $(OBJDIR_DEBUG)\\__\\common\\clock.o 138 | 139 | $(OBJDIR_DEBUG)\\__\\Calendar\\resource.o: ..\\Calendar\\resource.rc 140 | $(WINDRES) -i ..\\Calendar\\resource.rc -J rc -o $(OBJDIR_DEBUG)\\__\\Calendar\\resource.o -O coff $(INC_DEBUG) 141 | 142 | $(OBJDIR_DEBUG)\\__\\Calendar\\DeskCalendar.o: ..\\Calendar\\DeskCalendar.c 143 | $(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ..\\Calendar\\DeskCalendar.c -o $(OBJDIR_DEBUG)\\__\\Calendar\\DeskCalendar.o 144 | 145 | clean_debug: 146 | cmd /c del /f $(OBJ_DEBUG) $(OUT_DEBUG) 147 | cmd /c rd $(OBJDIR_DEBUG)\\__\\common 148 | cmd /c rd $(OBJDIR_DEBUG)\\__\\Calendar 149 | 150 | .PHONY: before_build after_build before_release after_release clean_release before_debug after_debug clean_debug 151 | 152 | -------------------------------------------------------------------------------- /src/~ide/gcc-dll.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 168 | 169 | -------------------------------------------------------------------------------- /src/~ide/gcc-options.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 119 | 120 | -------------------------------------------------------------------------------- /src/~ide/gcc.workspace: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/~ide/lib32/libwinhttp.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/src/~ide/lib32/libwinhttp.a -------------------------------------------------------------------------------- /src/~ide/lib64/libwinhttp.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/src/~ide/lib64/libwinhttp.a -------------------------------------------------------------------------------- /src/~ide/linux-autoversion.make: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------# 2 | # This makefile was generated by 'cbp2make' tool rev.147 # 3 | #------------------------------------------------------------------------------# 4 | 5 | 6 | WORKDIR = `pwd` 7 | 8 | CC = gcc 9 | CXX = g++ 10 | AR = ar 11 | LD = g++ 12 | WINDRES = windres 13 | 14 | INC = 15 | CFLAGS = -fno-ident -Wall -fvisibility=hidden -ffunction-sections -fmerge-all-constants -fno-asynchronous-unwind-tables -fno-exceptions -fwhole-program 16 | RESINC = 17 | LIBDIR = 18 | LIB = 19 | LDFLAGS = -static -Wl,--gc-sections 20 | 21 | INC_RELEASE = $(INC) 22 | CFLAGS_RELEASE = $(CFLAGS) -Os -DNDEBUG 23 | RESINC_RELEASE = $(RESINC) 24 | RCFLAGS_RELEASE = $(RCFLAGS) 25 | LIBDIR_RELEASE = $(LIBDIR) 26 | LIB_RELEASE = $(LIB) 27 | LDFLAGS_RELEASE = $(LDFLAGS) -s 28 | OBJDIR_RELEASE = ../.obj/gcc 29 | DEP_RELEASE = 30 | OUT_RELEASE = ../common/AutoVersion 31 | 32 | OBJ_RELEASE = $(OBJDIR_RELEASE)/__/common/autoversion.o 33 | 34 | all: release 35 | 36 | clean: clean_release 37 | 38 | before_release: 39 | test -d ../common || mkdir -p ../common 40 | test -d $(OBJDIR_RELEASE)/__/common || mkdir -p $(OBJDIR_RELEASE)/__/common 41 | 42 | after_release: 43 | 44 | release: before_release out_release after_release 45 | 46 | out_release: before_release $(OBJ_RELEASE) $(DEP_RELEASE) 47 | $(LD) $(LIBDIR_RELEASE) -o $(OUT_RELEASE) $(OBJ_RELEASE) $(LDFLAGS_RELEASE) $(LIB_RELEASE) 48 | 49 | $(OBJDIR_RELEASE)/__/common/autoversion.o: ../common/autoversion.cpp 50 | $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../common/autoversion.cpp -o $(OBJDIR_RELEASE)/__/common/autoversion.o 51 | 52 | clean_release: 53 | rm -f $(OBJ_RELEASE) $(OUT_RELEASE) 54 | rm -rf $(OBJDIR_RELEASE)/__/common 55 | 56 | .PHONY: before_release after_release clean_release 57 | 58 | -------------------------------------------------------------------------------- /src/~ide/linux-calendar.make: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------# 2 | # This makefile was generated by 'cbp2make' tool rev.147 # 3 | #------------------------------------------------------------------------------# 4 | 5 | 6 | WORKDIR = `pwd` 7 | 8 | CC = $(CCACHE) i686-w64-mingw32-gcc 9 | CXX = $(CCACHE) i686-w64-mingw32-g++ 10 | AR = i686-w64-mingw32-ar 11 | LD = i686-w64-mingw32-g++ 12 | WINDRES = i686-w64-mingw32-windres 13 | 14 | INC = 15 | CFLAGS = -D_UNICODE -DUNICODE -fno-ident -Wall -Werror=declaration-after-statement -fvisibility=hidden -ffunction-sections -fmerge-all-constants -fno-asynchronous-unwind-tables -fno-exceptions -D_POSIX=1 -D_POSIX_C_SOURCE=200112L -D__STDC_FORMAT_MACROS -D__USE_MINGW_ANSI_STDIO=0 -D__MINGW_USE_VC2005_COMPAT -DWINVER=0x0501 -DPSAPI_VERSION=1 -DWIN2K_COMPAT 16 | RESINC = 17 | LIBDIR = 18 | LIB = -ladvapi32 -lshell32 -luser32 -lgdi32 -lpsapi -lcomdlg32 -lcomctl32 -lmsimg32 19 | LDFLAGS = -static -Wl,--gc-sections -mwindows 20 | 21 | INC_RELEASE = $(INC) 22 | CFLAGS_RELEASE = $(CFLAGS) -O3 -m32 -DNDEBUG 23 | RESINC_RELEASE = $(RESINC) 24 | RCFLAGS_RELEASE = $(RCFLAGS) 25 | LIBDIR_RELEASE = $(LIBDIR) 26 | LIB_RELEASE = $(LIB) 27 | LDFLAGS_RELEASE = $(LDFLAGS) -s -m32 28 | OBJDIR_RELEASE = ../.obj/gcc 29 | DEP_RELEASE = 30 | OUT_RELEASE = ../../Release/misc/XPCalendar.exe 31 | 32 | INC_DEBUG = $(INC) 33 | CFLAGS_DEBUG = $(CFLAGS) -m32 -g -fno-omit-frame-pointer -D_DEBUG 34 | RESINC_DEBUG = $(RESINC) 35 | RCFLAGS_DEBUG = $(RCFLAGS) 36 | LIBDIR_DEBUG = $(LIBDIR) 37 | LIB_DEBUG = $(LIB) 38 | LDFLAGS_DEBUG = $(LDFLAGS) -m32 39 | OBJDIR_DEBUG = ../.obj/gcc/dbg 40 | DEP_DEBUG = 41 | OUT_DEBUG = ../../Debug/misc/XPCalendar.exe 42 | 43 | OBJ_RELEASE = $(OBJDIR_RELEASE)/__/common/win2k_compat.o \ 44 | $(OBJDIR_RELEASE)/__/common/utl.o \ 45 | $(OBJDIR_RELEASE)/__/common/newapi.o \ 46 | $(OBJDIR_RELEASE)/__/common/control_extensions.o \ 47 | $(OBJDIR_RELEASE)/__/common/clock.o \ 48 | $(OBJDIR_RELEASE)/__/Calendar/resource.o \ 49 | $(OBJDIR_RELEASE)/__/Calendar/DeskCalendar.o 50 | 51 | OBJ_DEBUG = $(OBJDIR_DEBUG)/__/common/win2k_compat.o \ 52 | $(OBJDIR_DEBUG)/__/common/utl.o \ 53 | $(OBJDIR_DEBUG)/__/common/newapi.o \ 54 | $(OBJDIR_DEBUG)/__/common/control_extensions.o \ 55 | $(OBJDIR_DEBUG)/__/common/clock.o \ 56 | $(OBJDIR_DEBUG)/__/Calendar/resource.o \ 57 | $(OBJDIR_DEBUG)/__/Calendar/DeskCalendar.o 58 | 59 | all: before_build build_release build_debug after_build 60 | 61 | clean: clean_release clean_debug 62 | 63 | before_build: 64 | ../common/AutoVersion --git . ../common/version.h 65 | 66 | after_build: 67 | 68 | before_release: 69 | test -d ../../Release/misc || mkdir -p ../../Release/misc 70 | test -d $(OBJDIR_RELEASE)/__/common || mkdir -p $(OBJDIR_RELEASE)/__/common 71 | test -d $(OBJDIR_RELEASE)/__/Calendar || mkdir -p $(OBJDIR_RELEASE)/__/Calendar 72 | 73 | after_release: 74 | 75 | build_release: before_release out_release after_release 76 | 77 | release: before_build build_release after_build 78 | 79 | out_release: before_release $(OBJ_RELEASE) $(DEP_RELEASE) 80 | $(LD) $(LIBDIR_RELEASE) -o $(OUT_RELEASE) $(OBJ_RELEASE) $(LDFLAGS_RELEASE) $(LIB_RELEASE) 81 | 82 | $(OBJDIR_RELEASE)/__/common/win2k_compat.o: ../common/win2k_compat.c 83 | $(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../common/win2k_compat.c -o $(OBJDIR_RELEASE)/__/common/win2k_compat.o 84 | 85 | $(OBJDIR_RELEASE)/__/common/utl.o: ../common/utl.c 86 | $(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../common/utl.c -o $(OBJDIR_RELEASE)/__/common/utl.o 87 | 88 | $(OBJDIR_RELEASE)/__/common/newapi.o: ../common/newapi.c 89 | $(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../common/newapi.c -o $(OBJDIR_RELEASE)/__/common/newapi.o 90 | 91 | $(OBJDIR_RELEASE)/__/common/control_extensions.o: ../common/control_extensions.c 92 | $(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../common/control_extensions.c -o $(OBJDIR_RELEASE)/__/common/control_extensions.o 93 | 94 | $(OBJDIR_RELEASE)/__/common/clock.o: ../common/clock.c 95 | $(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../common/clock.c -o $(OBJDIR_RELEASE)/__/common/clock.o 96 | 97 | $(OBJDIR_RELEASE)/__/Calendar/resource.o: ../Calendar/resource.rc 98 | $(WINDRES) -i ../Calendar/resource.rc -J rc -o $(OBJDIR_RELEASE)/__/Calendar/resource.o -O coff $(INC_RELEASE) 99 | 100 | $(OBJDIR_RELEASE)/__/Calendar/DeskCalendar.o: ../Calendar/DeskCalendar.c 101 | $(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Calendar/DeskCalendar.c -o $(OBJDIR_RELEASE)/__/Calendar/DeskCalendar.o 102 | 103 | clean_release: 104 | rm -f $(OBJ_RELEASE) $(OUT_RELEASE) 105 | rm -rf $(OBJDIR_RELEASE)/__/common 106 | rm -rf $(OBJDIR_RELEASE)/__/Calendar 107 | 108 | before_debug: 109 | test -d ../../Debug/misc || mkdir -p ../../Debug/misc 110 | test -d $(OBJDIR_DEBUG)/__/common || mkdir -p $(OBJDIR_DEBUG)/__/common 111 | test -d $(OBJDIR_DEBUG)/__/Calendar || mkdir -p $(OBJDIR_DEBUG)/__/Calendar 112 | 113 | after_debug: 114 | objcopy --only-keep-debug ../../Debug/misc/XPCalendar.exe ../../Debug/misc/XPCalendar.dbg 115 | objcopy --strip-debug --strip-unneeded --add-gnu-debuglink=../../Debug/misc/XPCalendar.dbg ../../Debug/misc/XPCalendar.exe 116 | 117 | build_debug: before_debug out_debug after_debug 118 | 119 | debug: before_build build_debug after_build 120 | 121 | out_debug: before_debug $(OBJ_DEBUG) $(DEP_DEBUG) 122 | $(LD) $(LIBDIR_DEBUG) -o $(OUT_DEBUG) $(OBJ_DEBUG) $(LDFLAGS_DEBUG) $(LIB_DEBUG) 123 | 124 | $(OBJDIR_DEBUG)/__/common/win2k_compat.o: ../common/win2k_compat.c 125 | $(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../common/win2k_compat.c -o $(OBJDIR_DEBUG)/__/common/win2k_compat.o 126 | 127 | $(OBJDIR_DEBUG)/__/common/utl.o: ../common/utl.c 128 | $(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../common/utl.c -o $(OBJDIR_DEBUG)/__/common/utl.o 129 | 130 | $(OBJDIR_DEBUG)/__/common/newapi.o: ../common/newapi.c 131 | $(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../common/newapi.c -o $(OBJDIR_DEBUG)/__/common/newapi.o 132 | 133 | $(OBJDIR_DEBUG)/__/common/control_extensions.o: ../common/control_extensions.c 134 | $(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../common/control_extensions.c -o $(OBJDIR_DEBUG)/__/common/control_extensions.o 135 | 136 | $(OBJDIR_DEBUG)/__/common/clock.o: ../common/clock.c 137 | $(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../common/clock.c -o $(OBJDIR_DEBUG)/__/common/clock.o 138 | 139 | $(OBJDIR_DEBUG)/__/Calendar/resource.o: ../Calendar/resource.rc 140 | $(WINDRES) -i ../Calendar/resource.rc -J rc -o $(OBJDIR_DEBUG)/__/Calendar/resource.o -O coff $(INC_DEBUG) 141 | 142 | $(OBJDIR_DEBUG)/__/Calendar/DeskCalendar.o: ../Calendar/DeskCalendar.c 143 | $(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Calendar/DeskCalendar.c -o $(OBJDIR_DEBUG)/__/Calendar/DeskCalendar.o 144 | 145 | clean_debug: 146 | rm -f $(OBJ_DEBUG) $(OUT_DEBUG) 147 | rm -rf $(OBJDIR_DEBUG)/__/common 148 | rm -rf $(OBJDIR_DEBUG)/__/Calendar 149 | 150 | .PHONY: before_build after_build before_release after_release clean_release before_debug after_debug clean_debug 151 | 152 | -------------------------------------------------------------------------------- /src/~ide/makex: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o pipefail 3 | make "$@" 2>&1 | ./tool/colorgcc | tee build.log 4 | ret=$?; 5 | if [[ "$1" != "clean" ]];then 6 | echo 7 | ./tool/warn_summary -s0 -wpass build.log 8 | ./tool/warn_summary -s0 build.log 9 | fi 10 | return $ret 2>/dev/null || exit $ret; 11 | -------------------------------------------------------------------------------- /src/~ide/msbuild-sdk7.1-x86.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL ENABLEDELAYEDEXPANSION 3 | set sdkenv="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86 4 | rem call %sdkenv% /debug 5 | call %sdkenv% /release 6 | set xmsbuild=msbuild /p:TargetFrameworkMoniker=".NETFramework,Version=v3.5" /p:Platform=x86 7 | rem set xmsbuild=msbuild /p:Platform=x86 8 | echo __________________________________________ 9 | echo %%xmsbuild%% "msvc-vs.sln" /t:Clean /p:Configuration=Release 10 | echo %%xmsbuild%% "msvc-vs.sln" /t:Clean /p:Configuration=Debug 11 | echo. 12 | echo %%xmsbuild%% /m "msvc-vs.sln" /p:Configuration=Release 13 | echo. 14 | echo %%xmsbuild%% /m "msvc-vs.sln" /p:Configuration=Debug 15 | echo. 16 | echo __________________________________________ 17 | cmd /K 18 | -------------------------------------------------------------------------------- /src/~ide/msbuild-sdk7.1-x86_64.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL ENABLEDELAYEDEXPANSION 3 | set sdkenv="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 4 | rem call %sdkenv% /debug 5 | call %sdkenv% /release 6 | set xmsbuild=msbuild /p:TargetFrameworkMoniker=".NETFramework,Version=v3.5" /p:Platform=x64 7 | rem set xmsbuild=msbuild /p:Platform=x64 8 | echo __________________________________________ 9 | echo %%xmsbuild%% "msvc-vs.sln" /t:Clean /p:Configuration=Release 10 | echo %%xmsbuild%% "msvc-vs.sln" /t:Clean /p:Configuration=Debug 11 | echo. 12 | echo %%xmsbuild%% /m "msvc-vs.sln" /p:Configuration=Release 13 | echo. 14 | echo %%xmsbuild%% /m "msvc-vs.sln" /p:Configuration=Debug 15 | echo. 16 | echo __________________________________________ 17 | cmd /K 18 | -------------------------------------------------------------------------------- /src/~ide/msvc-cb-autoversion.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 47 | 48 | -------------------------------------------------------------------------------- /src/~ide/msvc-cb-calendar.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 98 | 99 | -------------------------------------------------------------------------------- /src/~ide/msvc-cb-clock.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 217 | 218 | -------------------------------------------------------------------------------- /src/~ide/msvc-cb-dll.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 151 | 152 | -------------------------------------------------------------------------------- /src/~ide/msvc-cb-options.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 105 | 106 | -------------------------------------------------------------------------------- /src/~ide/msvc-cb.workspace: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/~ide/msvc-common.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(PlatformToolset) 5 | 6 | 7 | 8 | 10.0 9 | v100 10 | 11 | 12 | $(ProjectName) 13 | Win32Proj 14 | 18 | $(DefaultPlatformToolset) 19 | ..\.obj\msvc\ 20 | ..\.obj64\msvc\ 21 | $(IntDir)dbg\ 22 | $(IntDir)$(ProjectName)\ 23 | false 24 | 25 | 26 | 27 | 28 | WINVER=0x0501;PSAPI_VERSION=1;_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) 29 | 4204;4428;%(DisableSpecificWarnings) 30 | 31 | 32 | Level4 33 | %(AdditionalOptions) 34 | false 35 | 36 | 37 | %(AdditionalDependencies) 38 | true 39 | Windows 40 | true 41 | 42 | 43 | ..\common\AutoVersion --git . ../common/version.h 44 | 45 | 46 | 47 | 48 | Disabled 49 | false 50 | _DEBUG;%(PreprocessorDefinitions) 51 | true 52 | MultiThreadedDebug 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | Full 62 | true 63 | true 64 | true 65 | NDEBUG;%(PreprocessorDefinitions) 66 | false 67 | MultiThreadedDLL 68 | 69 | 70 | true 71 | true 72 | UseLinkTimeCodeGeneration 73 | /PDBALTPATH:%_PDB% %(AdditionalOptions) 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /src/~ide/msvc-vs-autoversion.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {d0b32449-51ee-4dff-9dc8-248adc6bb405} 15 | common 16 | AutoVersion 17 | ..\common\ 18 | 19 | 20 | Application 21 | false 22 | NotSet 23 | false 24 | false 25 | false 26 | 27 | 28 | 29 | 30 | 31 | 32 | 4706; 33 | 34 | 35 | Console 36 | 37 | false 38 | 39 | 40 | 41 | 42 | MultiThreaded 43 | MinSpace 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/~ide/msvc-vs-calendar.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {1f5284e0-13ef-11e3-8ffd-0800200c9a66} 15 | Calendar 16 | XPCalendar 17 | ..\..\$(Configuration)\misc\ 18 | 19 | 20 | 21 | {6e055518-fdc0-4b59-beb8-60a3874c8f76} 22 | false 23 | 24 | 25 | 26 | Application 27 | false 28 | Unicode 29 | false 30 | false 31 | false 32 | 33 | 34 | 35 | 36 | 37 | 38 | _UNICODE;UNICODE;%(PreprocessorDefinitions) 39 | 40 | 41 | advapi32.lib;shell32.lib;user32.lib;gdi32.lib;psapi.lib;comctl32.lib;comdlg32.lib;msimg32.lib; 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/~ide/msvc-vs-clock.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Debug 10 | x64 11 | 12 | 13 | Release 14 | Win32 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {27EF0E4F-0E60-461B-9BA6-06AA1FF3E066} 23 | Clock 24 | Clock 25 | Clock64 26 | ..\..\$(Configuration)\ 27 | 28 | 29 | 30 | {6e055518-fdc0-4b59-beb8-60a3874c8f76} 31 | false 32 | 33 | 34 | 35 | Application 36 | false 37 | Unicode 38 | false 39 | false 40 | false 41 | 42 | 43 | 44 | 45 | 46 | 47 | _UNICODE;UNICODE;%(PreprocessorDefinitions) 48 | 49 | 50 | advapi32.lib;shell32.lib;user32.lib;ole32.lib;gdi32.lib;psapi.lib;comctl32.lib;comdlg32.lib;shlwapi.lib;version.lib;winmm.lib;ws2_32.lib;mpr.lib;uuid.lib;msimg32.lib;dsound.lib;wtsapi32.lib 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /src/~ide/msvc-vs-dll.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Debug 10 | x64 11 | 12 | 13 | Release 14 | Win32 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {6E055518-FDC0-4B59-BEB8-60A3874C8F76} 23 | DLL 24 | T-Clock 25 | T-Clock64 26 | ..\..\$(Configuration)\misc\ 27 | 28 | 29 | 30 | {d0b32449-51ee-4dff-9dc8-248adc6bb405} 31 | false 32 | 33 | 34 | 35 | DynamicLibrary 36 | false 37 | Unicode 38 | false 39 | false 40 | false 41 | 42 | 43 | 44 | 45 | 46 | 47 | _UNICODE;UNICODE;%(PreprocessorDefinitions) 48 | 49 | 50 | advapi32.lib;shell32.lib;user32.lib;ole32.lib;gdi32.lib;psapi.lib;comctl32.lib 51 | ..\DLL\DLL.def 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /src/~ide/msvc-vs-options.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {d8e4853e-40ac-411f-a120-1e6853061222} 15 | options 16 | Options 17 | ..\..\$(Configuration)\misc\ 18 | 19 | 20 | 21 | {6e055518-fdc0-4b59-beb8-60a3874c8f76} 22 | false 23 | 24 | 25 | 26 | Application 27 | false 28 | Unicode 29 | false 30 | false 31 | false 32 | 33 | 34 | 35 | 36 | 37 | 38 | _UNICODE;UNICODE;%(PreprocessorDefinitions) 39 | 40 | 41 | Console 42 | advapi32.lib;shell32.lib;user32.lib;gdi32.lib;psapi.lib;comctl32.lib;winhttp.lib; 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/~ide/msvc-vs.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AutoVersion", "msvc-vs-autoversion.vcxproj", "{D0B32449-51EE-4DFF-9DC8-248ADC6BB405}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Clock", "msvc-vs-clock.vcxproj", "{27EF0E4F-0E60-461B-9BA6-06AA1FF3E066}" 9 | ProjectSection(ProjectDependencies) = postProject 10 | {6E055518-FDC0-4B59-BEB8-60A3874C8F76} = {6E055518-FDC0-4B59-BEB8-60A3874C8F76} 11 | EndProjectSection 12 | EndProject 13 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DLL", "msvc-vs-dll.vcxproj", "{6E055518-FDC0-4B59-BEB8-60A3874C8F76}" 14 | ProjectSection(ProjectDependencies) = postProject 15 | {D0B32449-51EE-4DFF-9DC8-248ADC6BB405} = {D0B32449-51EE-4DFF-9DC8-248ADC6BB405} 16 | EndProjectSection 17 | EndProject 18 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Calendar", "msvc-vs-calendar.vcxproj", "{1F5284E0-13EF-11E3-8FFD-0800200C9A66}" 19 | ProjectSection(ProjectDependencies) = postProject 20 | {6E055518-FDC0-4B59-BEB8-60A3874C8F76} = {6E055518-FDC0-4B59-BEB8-60A3874C8F76} 21 | EndProjectSection 22 | EndProject 23 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Options", "msvc-vs-options.vcxproj", "{D8E4853E-40AC-411F-A120-1E6853061222}" 24 | ProjectSection(ProjectDependencies) = postProject 25 | {6E055518-FDC0-4B59-BEB8-60A3874C8F76} = {6E055518-FDC0-4B59-BEB8-60A3874C8F76} 26 | EndProjectSection 27 | EndProject 28 | Global 29 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 30 | Debug|x64 = Debug|x64 31 | Debug|x86 = Debug|x86 32 | Release|x64 = Release|x64 33 | Release|x86 = Release|x86 34 | EndGlobalSection 35 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 36 | {D0B32449-51EE-4DFF-9DC8-248ADC6BB405}.Debug|x64.ActiveCfg = Debug|Win32 37 | {D0B32449-51EE-4DFF-9DC8-248ADC6BB405}.Debug|x86.ActiveCfg = Debug|Win32 38 | {D0B32449-51EE-4DFF-9DC8-248ADC6BB405}.Debug|x86.Build.0 = Debug|Win32 39 | {D0B32449-51EE-4DFF-9DC8-248ADC6BB405}.Release|x64.ActiveCfg = Release|Win32 40 | {D0B32449-51EE-4DFF-9DC8-248ADC6BB405}.Release|x86.ActiveCfg = Release|Win32 41 | {D0B32449-51EE-4DFF-9DC8-248ADC6BB405}.Release|x86.Build.0 = Release|Win32 42 | {27EF0E4F-0E60-461B-9BA6-06AA1FF3E066}.Debug|x64.ActiveCfg = Debug|x64 43 | {27EF0E4F-0E60-461B-9BA6-06AA1FF3E066}.Debug|x64.Build.0 = Debug|x64 44 | {27EF0E4F-0E60-461B-9BA6-06AA1FF3E066}.Debug|x86.ActiveCfg = Debug|Win32 45 | {27EF0E4F-0E60-461B-9BA6-06AA1FF3E066}.Debug|x86.Build.0 = Debug|Win32 46 | {27EF0E4F-0E60-461B-9BA6-06AA1FF3E066}.Release|x64.ActiveCfg = Release|x64 47 | {27EF0E4F-0E60-461B-9BA6-06AA1FF3E066}.Release|x64.Build.0 = Release|x64 48 | {27EF0E4F-0E60-461B-9BA6-06AA1FF3E066}.Release|x86.ActiveCfg = Release|Win32 49 | {27EF0E4F-0E60-461B-9BA6-06AA1FF3E066}.Release|x86.Build.0 = Release|Win32 50 | {6E055518-FDC0-4B59-BEB8-60A3874C8F76}.Debug|x64.ActiveCfg = Debug|x64 51 | {6E055518-FDC0-4B59-BEB8-60A3874C8F76}.Debug|x64.Build.0 = Debug|x64 52 | {6E055518-FDC0-4B59-BEB8-60A3874C8F76}.Debug|x86.ActiveCfg = Debug|Win32 53 | {6E055518-FDC0-4B59-BEB8-60A3874C8F76}.Debug|x86.Build.0 = Debug|Win32 54 | {6E055518-FDC0-4B59-BEB8-60A3874C8F76}.Release|x64.ActiveCfg = Release|x64 55 | {6E055518-FDC0-4B59-BEB8-60A3874C8F76}.Release|x64.Build.0 = Release|x64 56 | {6E055518-FDC0-4B59-BEB8-60A3874C8F76}.Release|x86.ActiveCfg = Release|Win32 57 | {6E055518-FDC0-4B59-BEB8-60A3874C8F76}.Release|x86.Build.0 = Release|Win32 58 | {1F5284E0-13EF-11E3-8FFD-0800200C9A66}.Debug|x64.ActiveCfg = Debug|Win32 59 | {1F5284E0-13EF-11E3-8FFD-0800200C9A66}.Debug|x86.ActiveCfg = Debug|Win32 60 | {1F5284E0-13EF-11E3-8FFD-0800200C9A66}.Debug|x86.Build.0 = Debug|Win32 61 | {1F5284E0-13EF-11E3-8FFD-0800200C9A66}.Release|x64.ActiveCfg = Release|Win32 62 | {1F5284E0-13EF-11E3-8FFD-0800200C9A66}.Release|x86.ActiveCfg = Release|Win32 63 | {1F5284E0-13EF-11E3-8FFD-0800200C9A66}.Release|x86.Build.0 = Release|Win32 64 | {D8E4853E-40AC-411F-A120-1E6853061222}.Debug|x64.ActiveCfg = Debug|Win32 65 | {D8E4853E-40AC-411F-A120-1E6853061222}.Debug|x86.ActiveCfg = Debug|Win32 66 | {D8E4853E-40AC-411F-A120-1E6853061222}.Debug|x86.Build.0 = Debug|Win32 67 | {D8E4853E-40AC-411F-A120-1E6853061222}.Release|x64.ActiveCfg = Release|Win32 68 | {D8E4853E-40AC-411F-A120-1E6853061222}.Release|x86.ActiveCfg = Release|Win32 69 | {D8E4853E-40AC-411F-A120-1E6853061222}.Release|x86.Build.0 = Release|Win32 70 | EndGlobalSection 71 | GlobalSection(SolutionProperties) = preSolution 72 | HideSolutionNode = FALSE 73 | EndGlobalSection 74 | EndGlobal 75 | -------------------------------------------------------------------------------- /src/~ide/tool/colorgcc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/White-Tiger/T-Clock/2eb7e2aaf48af0b20bedaff5d5d629216011b382/src/~ide/tool/colorgcc -------------------------------------------------------------------------------- /src/~ide/tool/warn_summary: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # This script parses the output of a gcc bootstrap when using warning 4 | # flags and determines various statistics. 5 | # 6 | # usage: warn_summary [-llf] [-s stage] [-nosub|-ch|-cp|-f|-fortran|-java|-ada|-intl|-fixinc] 7 | # [-pass|-wpass] [file(s)] 8 | # 9 | # -llf 10 | # Filter out long lines from the bootstrap output before any other 11 | # action. This is useful for systems with broken awks/greps which choke 12 | # on long lines. It is not done by default as it sometimes slows things 13 | # down. 14 | # 15 | # -s number 16 | # Take warnings from stage "Number". Stage 0 means show warnings from 17 | # before and after the gcc bootstrap directory. E.g. libraries, etc. 18 | # This presupposes using "gcc -W*" for the stage1 compiler. 19 | # 20 | # -nosub 21 | # Only show warnings from the gcc top level directory. 22 | # -ch|-cp|-f|-fortran|-java|-ada|-intl|-fixinc 23 | # Only show warnings from the specified gcc subdirectory. 24 | # These override each other so only the last one passed takes effect. 25 | # 26 | # -pass 27 | # Pass through the bootstrap output after filtering stage and subdir 28 | # (useful for manual inspection.) This is all lines, not just warnings. 29 | # -wpass 30 | # Pass through only warnings from the bootstrap output after filtering 31 | # stage and subdir. 32 | # 33 | # By Kaveh Ghazi (ghazi@caip.rutgers.edu) 12/13/97. 34 | 35 | 36 | # Some awks choke on long lines, sed seems to do a better job. 37 | # Truncate lines > 255 characters. RE '.\{255,\}' doesn't seem to work. :-( 38 | # Only do this if -llf was specified, because it can really slow things down. 39 | longLineFilter() 40 | { 41 | if test -z "$llf" ; then 42 | cat 43 | else 44 | sed 's/^\(...............................................................................................................................................................................................................................................................\).*/\1/' 45 | fi 46 | } 47 | 48 | # This function does one of three things. It either passes through 49 | # all warning data, or passes through gcc toplevel warnings, or passes 50 | # through a particular subdirectory set of warnings. 51 | subdirectoryFilter() 52 | { 53 | longLineFilter | ( 54 | if test -z "$filter" ; then 55 | # Pass through all lines. 56 | cat 57 | else 58 | if test "$filter" = nosub ; then 59 | # Omit all subdirectories. 60 | egrep -v '/gcc/(ch|cp|f|fortran|java|ada|intl|fixinc)/' 61 | else 62 | # Pass through only subdir $filter. 63 | grep "/gcc/$filter/" 64 | fi 65 | fi ) 66 | } 67 | 68 | # This function displays all lines from stageN of the bootstrap. If 69 | # stage==0, then show lines prior to stage1 and lines from after the last 70 | # stage. I.e. utilities, libraries, etc. 71 | stageNfilter() 72 | { 73 | if test "$stageN" -lt 1 ; then 74 | # stage "0" means check everything *but* gcc. 75 | $AWK "BEGIN{t=1} ; /^Bootstrapping the compiler/{t=0} ; /^Building runtime libraries/{t=1} ; {if(t==1)print}" 76 | else 77 | if test "$stageN" -eq 1 ; then 78 | $AWK "/^Bootstrapping the compiler|^Building the C and C\+\+ compiler/{t=1} ; /stage$stageN/{t=0} ; {if(t==1)print}" 79 | else 80 | stageNminus1=`expr $stageN - 1` 81 | $AWK "/stage${stageNminus1}\//{t=1} ; /stage$stageN/{t=0} ; {if(t==1)print}" 82 | fi 83 | fi 84 | } 85 | 86 | # This function displays lines containing warnings. 87 | warningFilter() 88 | { 89 | grep ' warning: ' 90 | } 91 | 92 | # This function replaces `xxx' with `???', where xxx is usually some 93 | # variable or function name. This allows similar warnings to be 94 | # counted together when summarizing. However it avoids replacing 95 | # certain C keywords which are known appear in various messages. 96 | 97 | keywordFilter() { 98 | sed 's/.*warning: //; 99 | s/`\(int\)'"'"'/"\1"/g; 100 | s/`\(long\)'"'"'/"\1"/g; 101 | s/`\(char\)'"'"'/"\1"/g; 102 | s/`\(inline\)'"'"'/"\1"/g; 103 | s/`\(else\)'"'"'/"\1"/g; 104 | s/`\(return\)'"'"'/"\1"/g; 105 | s/`\(static\)'"'"'/"\1"/g; 106 | s/`\(extern\)'"'"'/"\1"/g; 107 | s/`\(const\)'"'"'/"\1"/g; 108 | s/`\(noreturn\)'"'"'/"\1"/g; 109 | s/`\(longjmp\)'"'"' or `\(vfork\)'"'"'/"\1" or "\2"/g; 110 | s/'"[\`'][^']*'/"'"???"/g; 111 | s/.*format, .* arg (arg [0-9][0-9]*)/??? format, ??? arg (arg ???)/; 112 | s/\([( ]\)arg [0-9][0-9]*\([) ]\)/\1arg ???\2/; 113 | s/"\([^"]*\)"/`\1'"'"'/g' 114 | } 115 | 116 | # This function strips out relative pathnames for source files printed 117 | # by the warningFilter function. This is done so that as the snapshot 118 | # directory name changes every week, the output of this program can be 119 | # compared to previous runs without spurious diffs caused by source 120 | # directory name changes. 121 | 122 | srcdirFilter() 123 | { 124 | sed ' 125 | s%^[^ ]*/\(gcc/\)%\1%; 126 | s%^[^ ]*/\(include/\)%\1%; 127 | s%^[^ ]*/\(texinfo/\)%\1%; 128 | s%^[^ ]*/\(fastjar/\)%\1%; 129 | s%^[^ ]*/\(zlib/\)%\1%; 130 | s%^[^ ]*/\(fixincludes/\)%\1%; 131 | s%^[^ ]*/\(sim/\)%\1%; 132 | s%^[^ ]*/\(newlib/\)%\1%; 133 | s%^[^ ]*/\(mpfr/\)%\1%; 134 | s%^[^ ]*/\(lib[a-z23+-]*/\)%\1%;' 135 | } 136 | 137 | # Start the main section. 138 | 139 | usage="usage: `basename $0` [-llf] [-s stage] [-nosub|-ch|-cp|-f|-fortran|-java|-ada|-intl|-fixinc] [-pass|-wpass] [file(s)]" 140 | stageN=3 141 | tmpfile=/tmp/tmp-warn.$$ 142 | 143 | # Remove $tmpfile on exit and various signals. 144 | trap "rm -f $tmpfile" 0 145 | trap "rm -f $tmpfile ; exit 1" 1 2 3 5 9 13 15 146 | 147 | # Find a good awk. 148 | if test -z "$AWK" ; then 149 | for AWK in gawk nawk awk ; do 150 | if type $AWK 2>&1 | grep 'not found' > /dev/null 2>&1 ; then 151 | : 152 | else 153 | break 154 | fi 155 | done 156 | fi 157 | 158 | # Parse command line arguments. 159 | while test -n "$1" ; do 160 | case "$1" in 161 | -llf) llf=1 ; shift ;; 162 | -s) if test -z "$2"; then echo $usage 1>&2; exit 1; fi 163 | stageN="$2"; shift 2 ;; 164 | -s*) stageN="`expr $1 : '-s\(.*\)'`" ; shift ;; 165 | -nosub|-ch|-cp|-f|-fortran|-java|-ada|-intl|-fixinc) filter="`expr $1 : '-\(.*\)'`" ; shift ;; 166 | -pass) pass=1 ; shift ;; 167 | -wpass) pass=w ; shift ;; 168 | -*) echo $usage 1>&2 ; exit 1 ;; 169 | *) break ;; 170 | esac 171 | done 172 | 173 | # Check for a valid value of $stageN. 174 | case "$stageN" in 175 | [0-9]) ;; 176 | *) echo "Stage <$stageN> must be in the range [0..9]." 1>&2 ; exit 1 ;; 177 | esac 178 | 179 | for file in "$@" ; do 180 | 181 | stageNfilter < $file | subdirectoryFilter > $tmpfile 182 | 183 | # (Just) show me the warnings. 184 | if test "$pass" != '' ; then 185 | if test "$pass" = w ; then 186 | warningFilter < $tmpfile 187 | else 188 | cat $tmpfile 189 | fi 190 | continue 191 | fi 192 | 193 | if test -z "$filter" ; then 194 | echo "Counting all warnings," 195 | else 196 | if test "$filter" = nosub ; then 197 | echo "Counting non-subdirectory warnings," 198 | else 199 | echo "Counting warnings in the gcc/$filter subdirectory," 200 | fi 201 | fi 202 | count=`warningFilter < $tmpfile | wc -l` 203 | echo there are $count warnings in stage$stageN of this bootstrap. 204 | 205 | echo 206 | echo Number of warnings per file: 207 | warningFilter < $tmpfile | srcdirFilter | $AWK -F: '{print$1}' | sort | \ 208 | uniq -c | sort -nr 209 | 210 | echo 211 | echo Number of warning types: 212 | warningFilter < $tmpfile | keywordFilter | sort | uniq -c | sort -nr 213 | 214 | done 215 | --------------------------------------------------------------------------------