[Ttssh2-commit] [7604] hookが設定されているコモンダイアログをTera Termの中央に表示する

scmno****@osdn***** scmno****@osdn*****
2019年 4月 23日 (火) 00:22:47 JST


Revision: 7604
          https://osdn.net/projects/ttssh2/scm/svn/commits/7604
Author:   zmatsuo
Date:     2019-04-23 00:22:46 +0900 (Tue, 23 Apr 2019)
Log Message:
-----------
hookが設定されているコモンダイアログをTera Termの中央に表示する

Modified Paths:
--------------
    trunk/teraterm/ttpfile/ttfile.c

-------------- next part --------------
Modified: trunk/teraterm/ttpfile/ttfile.c
===================================================================
--- trunk/teraterm/ttpfile/ttfile.c	2019-04-22 13:58:39 UTC (rev 7603)
+++ trunk/teraterm/ttpfile/ttfile.c	2019-04-22 15:22:46 UTC (rev 7604)
@@ -238,6 +238,14 @@
 	}
 }
 
+/* \x83_\x83C\x83A\x83\x8D\x83O\x82𒆉\x9B\x82Ɉړ\xAE\x82\xB7\x82\xE9 */
+static void CenterCommonDialog(HWND hDlg)
+{
+	/* hDlg\x82̐e\x82\xAA\x83_\x83C\x83A\x83\x8D\x83O\x82̃E\x83B\x83\x93\x83h\x83E\x83n\x83\x93\x83h\x83\x8B */
+	HWND hWndDlgRoot = GetParent(hDlg);
+	CenterWindow(hWndDlgRoot, GetParent(hWndDlgRoot));
+}
+
 /* Hook function for file name dialog box */
 static BOOL CALLBACK LogFnHook(HWND Dialog, UINT Message, WPARAM wParam, LPARAM lParam)
 {
@@ -374,6 +382,8 @@
 			DisableDlgItem(Dialog, IDC_TIMESTAMPTYPE, IDC_TIMESTAMPTYPE);
 		}
 
+		CenterCommonDialog(Dialog);
+
 		return TRUE;
 
 	case WM_COMMAND: // for old style dialog
@@ -611,6 +621,9 @@
 		SetDlgItemText(Dialog, IDC_FOPTBIN, uimsg);
 
 		SetRB(Dialog,*pw & 1,IDC_FOPTBIN,IDC_FOPTBIN);
+
+		CenterCommonDialog(Dialog);
+
 		return TRUE;
 	case WM_COMMAND: // for old style dialog
 		switch (LOWORD(wParam)) {
@@ -1026,6 +1039,7 @@
 			ShowDlgItem(Dialog,IDC_XOPTBIN,IDC_XOPTBIN);
 			SetRB(Dialog,LOWORD(*pl),IDC_XOPTBIN,IDC_XOPTBIN);
 		}
+		CenterCommonDialog(Dialog);
 		return TRUE;
 	case WM_COMMAND: // for old style dialog
 		switch (LOWORD(wParam)) {


Ttssh2-commit メーリングリストの案内