Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
MantisMountainMobile authored Apr 8, 2022
1 parent 6b2966d commit fa1bad4
Show file tree
Hide file tree
Showing 16 changed files with 955 additions and 117 deletions.
202 changes: 145 additions & 57 deletions source/tc2ch/dll/for_win11.c

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion source/tc2ch/dll/format.c
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ void MakeFormat(char* s, char* s_info, SYSTEMTIME* pt, int beat100, char* fmt)
}
}
else { //Only applicable for UK in 2022 and future.
disptime = CalcTimeDifference_Win10(pt, td_hour, td_min, td_neg);
disptime = CalcTimeDifference_Europe_Win10(pt, td_hour, td_min, td_neg);
}

sp += 8;
Expand Down
1 change: 1 addition & 0 deletions source/tc2ch/dll/tcdll.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ void DesktopDirectDraw_Win11(void);
void SwitchToTClockBarWin11(void);
void ReturnToOriginalTaskBar(void);
LRESULT CALLBACK WndProcTClockBar_Win11(HWND tempHwnd, UINT message, WPARAM wParam, LPARAM lParam);
void LogCursorPos(void);



Expand Down
8 changes: 4 additions & 4 deletions source/tc2ch/dll/tcdll.rc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 5,0,1,1
PRODUCTVERSION 5,0,1,1
FILEVERSION 5,1,5,1
PRODUCTVERSION 5,1,5,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -45,11 +45,11 @@ BEGIN
BEGIN
VALUE "Comments", "TClock DLL for Windows10 and Windows11"
VALUE "FileDescription", "DLL for TClock-Win10"
VALUE "FileVersion", "5.0.1.1"
VALUE "FileVersion", "5.1.5.1"
VALUE "InternalName", "TCDLL"
VALUE "OriginalFilename", "tcdll-win10.dll"
VALUE "ProductName", "TClock-Win10"
VALUE "ProductVersion", "5.0.1.1"
VALUE "ProductVersion", "5.1.5.1"
END
END
BLOCK "VarFileInfo"
Expand Down
57 changes: 33 additions & 24 deletions source/tc2ch/dll/tclock.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ int widthMainClockContent, heightMainClockContent;
int widthMainClockFrame, heightMainClockFrame;

BOOL bEnableSubClks = FALSE;
//BOOL bEnhanceSubClkOnDarkTray = FALSE;
//int indexSubClkToUpdate = 255;



/*------------------------------------------------
Expand Down Expand Up @@ -536,7 +535,6 @@ HWND hwndWin11Notify = NULL;

//通知ウィンドウ用
//利用設定・フラグ
BOOL bUseWin11Notify = TRUE; //ユーザ設定
BOOL bEnabledWin11Notify = TRUE; //利用するかどうか(通知ウィンドウ自体は常に作る)
//通知ウィンドウ描画用
HDC hdcYesWin11Notify = NULL;
Expand Down Expand Up @@ -626,7 +624,6 @@ BOOL bUseDateColor = FALSE;
BOOL bUseDowColor = FALSE;
BOOL bUseTimeColor = FALSE;

BOOL bShowWin11NotifyNumber = TRUE;



Expand All @@ -648,6 +645,8 @@ extern int pdhTemperature;

BOOL b_WININICHANGED = FALSE;

extern BOOL b_ShowingTClockBarWin11;
BOOL b_ShowingTClockBarWin11_backup = FALSE;

void GetMainClock(void)
{
Expand Down Expand Up @@ -739,7 +738,7 @@ void InitClock()
ReadData();



b_WININICHANGED = TRUE; //Win11Type2では通知アイコン更新のおまじない。



Expand Down Expand Up @@ -774,7 +773,8 @@ void InitClock()
CalcMainClockSize();
if (Win11Type == 2)
{
SetMainClockOnTasktray_Win11();
SetMainClockOnTasktray_Win11(); //タスクバーの移動
PostMessage(hwndClockMain, CLOCKM_MOVEWIN11CONTENTBRIDGE, 1, 0); //ContentBridgeウィンドウのカットとTClockMain, TClockWin11Notifyの配置
//COLORREF taskbarColor;
//HDC tempDC = NULL;
//tempDC = GetDC(hwndTaskBarMain);
Expand Down Expand Up @@ -853,7 +853,7 @@ void InitClock()
DragAcceptFiles(hwndClockMain, b);


b_WININICHANGED = TRUE; //Win11で通知アイコン更新。おまじない。


//タスクバーの更新
RedrawMainTaskbar(); //即時反映のために必要。必要があればWindowsのリサイズ処理を通してMainClockの再配置やサイズ更新、hdcClock再作成が実行される。
Expand Down Expand Up @@ -1519,9 +1519,6 @@ void ReadData()
bEnableSubClks = GetMyRegLong(NULL, "EnableOnSubDisplay", TRUE);
SetMyRegLong(NULL, "EnableOnSubDisplay", bEnableSubClks);

//bEnhanceSubClkOnDarkTray = GetMyRegLong(NULL, "EnhanceSubClkOnDarkTray", FALSE);
//SetMyRegLong(NULL, "EnhanceSubClkOnDarkTray", bEnhanceSubClkOnDarkTray);

offsetClockMS = (int)(short)GetMyRegLong(NULL, "OffsetClockMS", 0);
SetMyRegLong(NULL, "OffsetClockMS", (int)(short)offsetClockMS);

Expand Down Expand Up @@ -2121,9 +2118,7 @@ void ReadData()
adjustWin11DetectNotify = (int)(short)GetMyRegLong("Win11", "AdjustDetectNotify", 0);
SetMyRegLong("Win11", "AdjustDetectNotify", adjustWin11DetectNotify);

bUseWin11Notify = GetMyRegLong("Win11", "UseTClockNotify", 1);
SetMyRegLong("Win11", "UseTClockNotify", bUseWin11Notify);
if (bUseWin11Notify && bWin11Main && hwndWin11Notify) {
if (bWin11Main && hwndWin11Notify) {
bEnabledWin11Notify = TRUE;
}
else
Expand All @@ -2132,15 +2127,12 @@ void ReadData()
}

bAdjustTrayWin11SmallTaskbar = (BOOL)GetMyRegLong("Win11", "AdjustWin11IconPosition", 1);
if (Win11Type == 2) {
bAdjustTrayWin11SmallTaskbar = FALSE;
}
SetMyRegLong("Win11", "AdjustWin11IconPosition", bAdjustTrayWin11SmallTaskbar);


bShowWin11NotifyNumber = (BOOL)GetMyRegLong("Win11", "ShowWin11NotifyNumber", 1);
SetMyRegLong("Win11", "ShowWin11NotifyNumber", bShowWin11NotifyNumber);




b_EnableChime = GetMyRegLong("Chime", "EnableChime", 0);
SetMyRegLong("Chime", "EnableChime", b_EnableChime);

Expand Down Expand Up @@ -2479,7 +2471,14 @@ void OnTimer_Win10(void)


if (Win11Type == 2) {
CheckPixel_Win10(posXMainClock + 1, originalPosYTaskbar + 10);
if (b_ShowingTClockBarWin11_backup) {
if (b_DebugLog)writeDebugLog_Win10("[tclock.c][OnTimer_Win10] ReturnToOriginalTaskBar missed. So call it from OnTimer_Win10.", 999);
MoveWin11ContentBridge(2);
b_ShowingTClockBarWin11_backup = 0;
}
else {
b_ShowingTClockBarWin11_backup = b_ShowingTClockBarWin11;
}
}


Expand Down Expand Up @@ -5164,11 +5163,21 @@ void CalcMainClockSize(void)
}
else {
widthMainClockFrame = widthMainClockContent;

//Win11Type2でWin11の時計より小さくならないようにする。-->表示はOKだがタスクトレイオーバーフローのクリックが別のトレイアイコンに届くのを避けるため必要
if (Win11Type == 2) {
int widthMinimum = defaultWin11ClockWidth + defaultWin11NotificationWidth; // +10; //10ドット分は、クリックでメニューが開けるように。
if (bEnabledWin11Notify) {
widthMinimum -= widthWin11Notify;
}

if (widthMainClockFrame < widthMinimum)
{
widthMainClockFrame = widthMinimum;
}
}

heightMainClockFrame = tempRect.bottom - tempRect.top;
//if (bAdjustTrayWin11SmallTaskbar && (Win11Type == 2))
//{
// heightMainClockFrame = 2 * originalHeightTaskbar / 3;
//}
}

SetMyRegLong("Status_DoNotEdit", "ClockWidth", widthMainClockFrame);
Expand Down
5 changes: 4 additions & 1 deletion source/tc2ch/dll/utl.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,9 @@ void CleanSettingFile(void)
DelMyReg_DLL("Tooltip", "TipEnableDoubleBuffering");
DelMyReg_DLL("Tooltip", "TipDispInterval");


DelMyReg_DLL("Win11", "UseTClockNotify");
DelMyReg_DLL("Win11", "ShowWin11NotifyNumber");

DelMyReg_DLL(NULL, "EnhanceSubClkOnDarkTray");
}

12 changes: 8 additions & 4 deletions source/tc2ch/exe/exemain.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ static MOUSE_FUNC_INFO mouse_func_list[] = {
{ MOUSEFUNC_NONE, IDS_NONE},
{ MOUSEFUNC_VISTACALENDAR, IDS_VISTACALENDAR },
{ MOUSEFUNC_ALARM_CLOCK, IDS_ALARM_CLOCK2 },
{ MOUSEFUNC_PUSHBACK, IDS_PUSHBACK },
{ MOUSEFUNC_SHOWAVAILABLENETWORKS, IDS_SHOWAVAILABLENETWORKS },
{ MOUSEFUNC_TASKMGR, IDS_TASKMGR }, //Added by TTTT
{ MOUSEFUNC_CMD, IDS_CMD }, //Added by TTTT
Expand Down Expand Up @@ -440,8 +441,10 @@ static UINT WINAPI TclockExeMain(void)

g_hwndMain = hwnd; //メイン隠しウィンドウのハンドルをグローバル変数のg_hwndMainにコピー

CreateTClockTrayIcon(GetMyRegLong(NULL, "ShowTrayIcon", FALSE));
SetMyRegLong(NULL, "ShowTrayIcon", b_ShowTrayIcon);
//CreateTClockTrayIcon(GetMyRegLong(NULL, "ShowTrayIcon", FALSE));
//SetMyRegLong(NULL, "ShowTrayIcon", b_ShowTrayIcon);

CreateTClockTrayIcon(GetMyRegLong(NULL, "ShowTrayIcon", TRUE));

SetIdlePriority(); //デフォルトではIDLE_PRIORITY_CLASSとする added by TTTT

Expand Down Expand Up @@ -665,8 +668,9 @@ void CheckCommandLine(HWND hwnd)
if (b_DebugLog) WriteDebug_New2("[exemain.c][WndProc] WM_DESTROY received");
return 0;
case WM_ENDSESSION: //セッション終了時のTClock終了はこちらから
if (b_DebugLog) WriteDebug_New2("[exemain.c][WndProc] WM_ENDSESSION received");
if(wParam) TerminateTClock(hwnd);
if (b_DebugLog) WriteDebug_New2("[exemain.c][WndProc] WM_ENDSESSION received. TClock is terminated from now.");
//if(wParam) TerminateTClock(hwnd);
PostMessage(g_hwndMain, WM_CLOSE, 0, 0);
break;
case WM_QUERYENDSESSION: //セッション終了時の事前確認のようなもの。修了処理はWM_ENDSESSIONに実装する。
if (b_DebugLog) WriteDebug_New2("[exemain.c][WndProc] WM_QUERYENDSESSION received");
Expand Down
9 changes: 9 additions & 0 deletions source/tc2ch/exe/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,14 @@ void OnTClockCommand(HWND hwnd, WORD wID, WORD wCode)
return;
}

case IDC_PUSHBACK:
{
extern int PusuBackIndex;
PusuBackIndex = 0;
EnumWindows(PusuBackOBWindow, NULL);
return;
}

case IDC_DATETIME_Win10:
{
HWND hwndTray;
Expand Down Expand Up @@ -519,6 +527,7 @@ void InitializeMenuItems(void)
ModifyMenu(hPopupMenu, IDC_TASKMAN, MF_BYCOMMAND, IDC_TASKMAN, MyString(IDS_TASKMGR));
ModifyMenu(hPopupMenu, IDC_CMD, MF_BYCOMMAND, IDC_CMD,MyString(IDS_CMD));
ModifyMenu(hPopupMenu, IDC_ALARM_CLOCK, MF_BYCOMMAND, IDC_ALARM_CLOCK, MyString(IDS_ALARM_CLOCK));
ModifyMenu(hPopupMenu, IDC_PUSHBACK, MF_BYCOMMAND, IDC_PUSHBACK, MyString(IDS_PUSHBACK));
ModifyMenu(hPopupMenu, IDC_VISTACALENDAR, MF_BYCOMMAND, IDC_VISTACALENDAR, MyString(IDS_VISTACALENDAR));
ModifyMenu(hPopupMenu, IDC_SHOWAVAILABLENETWORKS, MF_BYCOMMAND, IDC_SHOWAVAILABLENETWORKS, MyString(IDS_SHOWAVAILABLENETWORKS));
ModifyMenu(hPopupMenu, IDC_CONTROLPNL, MF_BYCOMMAND, IDC_CONTROLPNL, MyString(IDS_CONTROLPNL));
Expand Down
8 changes: 8 additions & 0 deletions source/tc2ch/exe/mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,14 @@ void ExecuteMouseFunction(HWND hwnd, LONG fnc, int btn, int clk)
ShellExecute(NULL, "open", "ms-clock:", NULL, NULL, SW_SHOWNORMAL);
break;
}

case MOUSEFUNC_PUSHBACK:
{
extern int PusuBackIndex;
PusuBackIndex = 0;
EnumWindows(PusuBackOBWindow, NULL);
break;
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions source/tc2ch/exe/page_etc.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ static void OnInit(HWND hDlg)

CheckDlgButton(hDlg, IDC_USE_SUBCLKS, GetMyRegLong(NULL, "EnableOnSubDisplay", TRUE));

CheckDlgButton(hDlg, IDC_ETC_SHOWTRAYICON, GetMyRegLong(NULL, "ShowTrayIcon", FALSE));


//CheckDlgButton(hDlg, IDC_ETC_SHOWTRAYICON, GetMyRegLong(NULL, "ShowTrayIcon", TRUE));
CheckDlgButton(hDlg, IDC_ETC_SHOWTRAYICON, TRUE);
EnableDlgItem(hDlg, IDC_ETC_SHOWTRAYICON, FALSE);

tempInt = (int)SendMessage(g_hwndClock, WM_COMMAND, (WPARAM)CLOCKM_REQUEST_TEMPCOUNTERINFO, selectedThermalZone);
tempNumThermalZone = tempInt / 200;
Expand Down
32 changes: 22 additions & 10 deletions source/tc2ch/exe/page_win11.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extern char g_mydir[];

BOOL b_exe_Win11Main = FALSE;
//BOOL b_exe_UseSubClks = TRUE;
BOOL b_exe_UseWin11Notify = TRUE;
//BOOL b_exe_UseWin11Notify = TRUE;
int exe_AdjustTrayCutPosition = 0;
int exe_AdjustWin11ClockWidth = 0;
int exe_AdjutDetectNotify = 0;
Expand Down Expand Up @@ -114,10 +114,16 @@ static void OnInit(HWND hDlg)

if (b_exe_Win11Main)
{
b_exe_UseWin11Notify = (BOOL)GetMyRegLong("Win11", "UseTClockNotify", 1);
CheckDlgButton(hDlg, IDC_ETC_USE_WIN11NOTIFY, b_exe_UseWin11Notify);
//b_exe_UseWin11Notify = (BOOL)GetMyRegLong("Win11", "UseTClockNotify", 1);

CheckDlgButton(hDlg, IDC_ETC_SHOW_WIN11NOTIFY_NUMBER, (BOOL)GetMyRegLong("Win11", "ShowWin11NotifyNumber", 1));
//CheckDlgButton(hDlg, IDC_ETC_USE_WIN11NOTIFY, b_exe_UseWin11Notify);
//CheckDlgButton(hDlg, IDC_ETC_SHOW_WIN11NOTIFY_NUMBER, (BOOL)GetMyRegLong("Win11", "ShowWin11NotifyNumber", 1));

//Ver 5.1.2で廃止(表示は残してある)
CheckDlgButton(hDlg, IDC_ETC_USE_WIN11NOTIFY, TRUE);
EnableDlgItem(hDlg, IDC_ETC_USE_WIN11NOTIFY, FALSE);
CheckDlgButton(hDlg, IDC_ETC_SHOW_WIN11NOTIFY_NUMBER, TRUE);
EnableDlgItem(hDlg, IDC_ETC_SHOW_WIN11NOTIFY_NUMBER, FALSE);


int IconSize = GetMyRegLong("Status_DoNotEdit", "Win11IconSize", 99);
Expand All @@ -139,13 +145,19 @@ static void OnInit(HWND hDlg)
EnableDlgItem(hDlg, IDC_SPG_ETC_NOTIFY_DETECTPOS, FALSE);
EnableDlgItem(hDlg, IDC_ETC_NOTIFY_DETECTPOS, FALSE);

b_exe_AdjustTrayWin11SmallTaskbar = (BOOL)GetMyRegLong("Win11", "AdjustWin11IconPosition", 1);
CheckDlgButton(hDlg, IDC_ETC_ADJUST_WIN11_SMALLTASKBAR, (BOOL)GetMyRegLong("Win11", "AdjustWin11IconPosition", 1));
if (GetMyRegLong("Status_DoNotEdit", "WindowsType", 1) == 2) {
CheckDlgButton(hDlg, IDC_ETC_ADJUST_WIN11_SMALLTASKBAR, FALSE);
EnableDlgItem(hDlg, IDC_ETC_ADJUST_WIN11_SMALLTASKBAR, FALSE);
}
else {
b_exe_AdjustTrayWin11SmallTaskbar = (BOOL)GetMyRegLong("Win11", "AdjustWin11IconPosition", 1);
CheckDlgButton(hDlg, IDC_ETC_ADJUST_WIN11_SMALLTASKBAR, (BOOL)GetMyRegLong("Win11", "AdjustWin11IconPosition", 1));
}

}
else {
EnableDlgItem(hDlg, IDC_ETC_USE_WIN11NOTIFY, FALSE);
EnableDlgItem(hDlg, IDC_ETC_SHOW_WIN11NOTIFY_NUMBER, FALSE);
//EnableDlgItem(hDlg, IDC_ETC_USE_WIN11NOTIFY, FALSE);
//EnableDlgItem(hDlg, IDC_ETC_SHOW_WIN11NOTIFY_NUMBER, FALSE);
EnableDlgItem(hDlg, IDC_SPG_ETC_CUTPOSITION, FALSE);
EnableDlgItem(hDlg, IDC_ETC_CUTPOSITION, FALSE);
EnableDlgItem(hDlg, IDC_SPG_ETC_CUT_LIMIT, FALSE);
Expand All @@ -171,8 +183,8 @@ void OnApply(HWND hDlg)
//b_AutoRestart = IsDlgButtonChecked(hDlg, IDC_ETC_AUTORESTART);
//SetMyRegLong(NULL, "AutoRestart", b_AutoRestart);

SetMyRegLong("Win11", "UseTClockNotify", IsDlgButtonChecked(hDlg, IDC_ETC_USE_WIN11NOTIFY));
SetMyRegLong("Win11", "ShowWin11NotifyNumber", IsDlgButtonChecked(hDlg, IDC_ETC_SHOW_WIN11NOTIFY_NUMBER));
//SetMyRegLong("Win11", "UseTClockNotify", IsDlgButtonChecked(hDlg, IDC_ETC_USE_WIN11NOTIFY));
//SetMyRegLong("Win11", "ShowWin11NotifyNumber", IsDlgButtonChecked(hDlg, IDC_ETC_SHOW_WIN11NOTIFY_NUMBER));


SetMyRegLong("Win11", "AdjustCutTray", (int)(short)SendDlgItemMessage(hDlg, IDC_SPG_ETC_CUTPOSITION, UDM_GETPOS, 0, 0));
Expand Down
10 changes: 6 additions & 4 deletions source/tc2ch/exe/tclock.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ int r_stricmp(const char* d, const char* s);
#define MOUSEFUNC_CMD 208 //added by TTTT

#define MOUSEFUNC_ALARM_CLOCK 209 //added by TTTT
#define MOUSEFUNC_PUSHBACK 210 //Introduced from TClock Light in 2022



#define MAX_AUTORESTART 2
Expand Down Expand Up @@ -259,12 +261,12 @@ BOOL SetMyRegLong(char* subkey, char* entry, DWORD val);
BOOL DelMyReg(char* subkey, char* entry);
BOOL DelMyRegKey(char* subkey);
int DelRegAll(void);

HWND FindVistaCalenderWindow(void); //originally in calendar.c


void AdjustConboBoxDropDown(HWND hComboBox, int nDropDownCount);

BOOL GetScreenRect(HWND hwnd, RECT *prc);
BOOL CALLBACK PusuBackOBWindow(HWND hwnd, LPARAM lParam);
int CheckWindowStatus_TClockExe(HWND hwnd);
BOOL IsTClockWindow(HWND hwnd);


// tcdll.dll‚ÌAPI
Expand Down
8 changes: 4 additions & 4 deletions source/tc2ch/exe/tclock.rc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 5,0,1,1
PRODUCTVERSION 5,0,1,1
FILEVERSION 5,1,5,1
PRODUCTVERSION 5,1,5,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -32,11 +32,11 @@ BEGIN
BEGIN
VALUE "Comments", "TClock Main for Windows10 and Windows11"
VALUE "FileDescription", "TClock-Win10"
VALUE "FileVersion", "5.0.1.1"
VALUE "FileVersion", "5.1.5.1"
VALUE "InternalName", "TClock"
VALUE "OriginalFilename", "TClock-Win10.exe"
VALUE "ProductName", "TClock-Win10"
VALUE "ProductVersion", "5.0.1.1"
VALUE "ProductVersion", "5.1.5.1"
END
END
BLOCK "VarFileInfo"
Expand Down
Loading

0 comments on commit fa1bad4

Please sign in to comment.