Changeset 239
- Timestamp:
- Jan 10, 2003, 12:03:22 AM (23 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/helpers/dialog.h
r232 r239 429 429 id, CTL_COMMON_FONT, { cx, cy }, COMMON_SPACING } 430 430 431 // CONTROLDEF_ENTRYFIELD_PASSWD added V1.0.1 (2003-01-05) [umoeller] 432 #define CONTROLDEF_ENTRYFIELD_PASSWD(pcsz, id, cx, cy) { WC_ENTRYFIELD, pcsz, \ 433 WS_VISIBLE | WS_TABSTOP | ES_MARGIN | ES_AUTOSCROLL | ES_UNREADABLE, \ 434 id, CTL_COMMON_FONT, { cx, cy }, COMMON_SPACING } 435 431 436 #define CONTROLDEF_ENTRYFIELD_RO(pcsz, id, cx, cy) { WC_ENTRYFIELD, pcsz, \ 432 437 WS_VISIBLE | WS_TABSTOP | ES_MARGIN | ES_READONLY | ES_AUTOSCROLL, \ -
trunk/include/helpers/winh.h
r235 r239 224 224 #endif 225 225 226 BOOL XWPENTRY winhQueryMenuItem(HWND hwndMenu,227 USHORT usItemID,228 BOOL fSearchSubmenus,229 PMENUITEM pmi);230 231 HWND XWPENTRY winhQuerySubmenu(HWND hMenu, SHORT sID);232 233 226 /* 234 227 * winhCreateEmptyMenu: … … 245 238 WinCreateWindow(HWND_DESKTOP, WC_MENU, "", 0, 0, 0, 0, 0, \ 246 239 HWND_DESKTOP, HWND_TOP, 0, 0, 0) 240 241 BOOL XWPENTRY winhQueryMenuItem(HWND hwndMenu, 242 USHORT usItemID, 243 BOOL fSearchSubmenus, 244 PMENUITEM pmi); 245 246 HWND XWPENTRY winhQuerySubmenu(HWND hMenu, SHORT sID); 247 247 248 248 SHORT XWPENTRY winhInsertMenuItem(HWND hwndMenu, … … 753 753 PCSZ XWPENTRY winhQueryDefaultFont(VOID); 754 754 755 PSZ XWPENTRY winhQueryMenuSysFont(VOID); 756 755 757 BOOL XWPENTRY winhSetWindowFont(HWND hwnd, const char *pcszFont); 756 758 typedef BOOL XWPENTRY WINHSETWINDOWFONT(HWND hwnd, const char *pcszFont); … … 879 881 HPOINTER XWPENTRY winhSetWaitPointer(VOID); 880 882 883 PSZ XWPENTRY winhQueryWindowText2(HWND hwnd, 884 PULONG pulExtra); 885 881 886 PSZ XWPENTRY winhQueryWindowText(HWND hwnd); 882 887 … … 885 890 ...); 886 891 892 PSZ XWPENTRY winhQueryDlgItemText2(HWND hwnd, 893 USHORT usItemID, 894 PULONG pulExtra); 895 887 896 /* 888 897 *@@ winhQueryDlgItemText: 889 898 * like winhQueryWindowText, but for the dialog item 890 899 * in hwnd which has the ID usItemID. 891 */ 892 893 #define winhQueryDlgItemText(hwnd, usItemID) winhQueryWindowText(WinWindowFromID(hwnd, usItemID)) 900 * 901 *@@changed V1.0.1 (2003-01-05) [umoeller]: now using winhQueryDlgItemText2 902 */ 903 904 #define winhQueryDlgItemText(hwnd, usItemID) winhQueryDlgItemText2(hwnd, usItemID, NULL) 905 906 BOOL XWPENTRY winhAppendWindowEllipseText(HWND hwnd); 907 908 BOOL XWPENTRY winhAppendDlgItemEllipseText(HWND hwnd, 909 USHORT usItemID); 894 910 895 911 BOOL XWPENTRY winhReplaceWindowText(HWND hwnd, -
trunk/src/helpers/winh.c
r238 r239 2969 2969 2970 2970 /* 2971 *@@ winhQueryMenuSysFont: 2972 * returns the system menu font in a new buffer 2973 * to be free()'d by caller. 2974 * 2975 *@@added V1.0.1 (2003-01-05) [umoeller] 2976 */ 2977 2978 PSZ winhQueryMenuSysFont(VOID) 2979 { 2980 PSZ pszStdMenuFont; 2981 if (!(pszStdMenuFont = prfhQueryProfileData(HINI_USER, 2982 PMINIAPP_SYSTEMFONTS, // "PM_SystemFonts", 2983 PMINIKEY_MENUSFONT, // "Menus", 2984 NULL))) 2985 pszStdMenuFont = prfhQueryProfileData(HINI_USER, 2986 PMINIAPP_SYSTEMFONTS, // "PM_SystemFonts", 2987 PMINIKEY_DEFAULTFONT, // "DefaultFont", 2988 NULL); 2989 2990 return pszStdMenuFont; 2991 } 2992 2993 /* 2971 2994 *@@ winhSetWindowFont: 2972 2995 * this sets a window's font by invoking … … 3825 3848 3826 3849 /* 3850 *@@ winhQueryWindowText2: 3851 * this returns the window text of the specified 3852 * HWND in a newly allocated buffer. 3853 * 3854 * If pulExtra is specified, *pulExtra bytes will 3855 * be allocated in addition to the window text 3856 * length. Useful if you plan to append something 3857 * to the string. On output, *pulExtra receives 3858 * the string length excluding the extra bytes 3859 * and the terminating null byte. 3860 * 3861 * Returns NULL on error. Use free() 3862 * to free the return value. 3863 * 3864 *@@added V1.0.1 (2003-01-05) [umoeller] 3865 */ 3866 3867 PSZ winhQueryWindowText2(HWND hwnd, // in: window whose text to query 3868 PULONG pulExtra) // in: extra bytes to allocate or NULL, 3869 // out: size of allocated buffer (including null byte) 3870 { 3871 PSZ pszText = NULL; 3872 ULONG cbText; 3873 if (cbText = WinQueryWindowTextLength(hwnd)) 3874 { 3875 ULONG cbExtra = 1; // additional null character 3876 if (pulExtra) 3877 cbExtra += *pulExtra; 3878 3879 if (pszText = (PSZ)malloc(cbText + cbExtra)) 3880 { 3881 WinQueryWindowText(hwnd, 3882 cbText + 1, 3883 pszText); 3884 if (pulExtra) 3885 *pulExtra = cbText; 3886 } 3887 } 3888 3889 return pszText; 3890 } 3891 3892 /* 3827 3893 *@@ winhQueryWindowText: 3828 3894 * this returns the window text of the specified … … 3831 3897 * Returns NULL on error. Use free() 3832 3898 * to free the return value. 3899 * 3900 *@@changed V1.0.1 (2003-01-05) [umoeller]: now using winhQueryWindowText2 3833 3901 */ 3834 3902 3835 3903 PSZ winhQueryWindowText(HWND hwnd) 3836 3904 { 3837 PSZ pszText = NULL; 3838 ULONG cbText; 3839 if (cbText = WinQueryWindowTextLength(hwnd)) 3840 { 3841 if (pszText = (PSZ)malloc(cbText + 1)) // additional null character 3842 WinQueryWindowText(hwnd, 3843 cbText + 1, 3844 pszText); 3845 } 3846 3847 return pszText; 3905 return winhQueryWindowText2(hwnd, NULL); // V1.0.1 (2003-01-05) [umoeller] 3906 } 3907 3908 /* 3909 *@@ winhQueryDlgItemText2: 3910 * shortcut around winhQueryWindowText2 to allow for 3911 * specifying a dialog item ID instead. 3912 * 3913 *@@added V1.0.1 (2003-01-05) [umoeller] 3914 */ 3915 3916 PSZ winhQueryDlgItemText2(HWND hwnd, 3917 USHORT usItemID, 3918 PULONG pulExtra) 3919 { 3920 return winhQueryWindowText2(WinWindowFromID(hwnd, usItemID), 3921 pulExtra); 3848 3922 } 3849 3923 … … 3872 3946 return WinSetWindowText(hwnd, 3873 3947 szBuf); 3948 } 3949 3950 /* 3951 *@@ winhAppendWindowEllipseText: 3952 * appends three dots ("...") to the title 3953 * of the given window. 3954 * 3955 *@@added V1.0.1 (2003-01-05) [umoeller] 3956 */ 3957 3958 BOOL winhAppendWindowEllipseText(HWND hwnd) 3959 { 3960 ULONG cbExtra = 3; 3961 PSZ psz; 3962 BOOL brc = FALSE; 3963 if (psz = winhQueryWindowText2(hwnd, &cbExtra)) 3964 { 3965 memcpy(psz + cbExtra, "...", 4); 3966 brc = WinSetWindowText(hwnd, psz); 3967 free(psz); 3968 } 3969 3970 return brc; 3971 } 3972 3973 /* 3974 *@@ winhAppendDlgItemEllipseText: 3975 * 3976 *@@added V1.0.1 (2003-01-05) [umoeller] 3977 */ 3978 3979 BOOL winhAppendDlgItemEllipseText(HWND hwnd, 3980 USHORT usItemID) 3981 { 3982 return winhAppendWindowEllipseText(WinWindowFromID(hwnd, usItemID)); 3874 3983 } 3875 3984
Note:
See TracChangeset
for help on using the changeset viewer.