侮秘燃竃MFC及2井(PDF鯉塀)-及161何蛍
梓囚徒貧圭鮗 ○ 賜 ★ 辛酔堀貧和鍬匈梓囚徒貧議 Enter 囚辛指欺云慕朕村匈梓囚徒貧圭鮗 ● 辛指欺云匈競何
!!!!隆堋響頼紗秘慕禰厮宴和肝写偬堋響
#0120 // read from the tips file
#0121 BOOL bStop = FALSE察
#0122 while ┌bStop
#0123
#0124 if _fgettslpsz察MAX_BUFLEN察m_pStream == NULL
#0125
#0126 // We have either reached EOF or enocuntered some problem
#0127 // In both cases reset the pointer to the beginning of the file
#0128 // This behavior is same as VC Tips file
#0129 if fseekm_pStream察0察SEEK_SET = 0
#0130 AfxMessageBoxCG_IDP_FILE_CORRUPT察
#0131
#0132 else
#0133
#0134 if *lpsz = ' ' && *lpsz = 't' &&
#0135 *lpsz = 'n' && *lpsz = ''
#0136
#0137 // There should be no space at the beginning of the tip
#0138 // This behavior is same as VC Tips file
#0139 // ment lines are ignored and they start with a semicolon
816
´´´´´´´´´´´´´´´´´´´´´´Page 879´´´´´´´´´´´´´´´´´´´´´´´
16 ponents & ActiveX Controls
及 嫗 嫋議主芋 聞喘
#0140 bStop = TRUE察
#0141
#0142
#0143
#0144 strNext。ReleaseBuffer┌察
#0145
#0146
#0147 HBRUSH CTipDlg今OnCtlColorCDC* pDC察CWnd* pWnd察UINT nCtlColor
#0148
#0149 if pWnd´〃GetDlgCtrlID┌ == IDC_TIPSTRING
#0150 return HBRUSHGetStockObjectWHITE_BRUSH察
#0151
#0152 return CDialog今OnCtlColorpDC察pWnd察nCtlColor察
#0153
#0154
#0155 void CTipDlg今OnOK┌
#0156
#0157 CDialog今OnOK┌察
#0158
#0159 // Update the startup information stored in the INI file
#0160 CWinApp* pApp = AfxGetApp┌察
#0161 pApp´〃WriteProfileIntszSection察szIntStartup察。m_bStartup察
#0162
#0163
#0164 BOOL CTipDlg今OnInitDialog┌
#0165
#0166 CDialog今OnInitDialog┌察
#0167
#0168 // If Tips file does not exist then disable NextTip
#0169 if m_pStream == NULL
#0170 GetDlgItemIDC_NEXTTIP´〃EnableWindowFALSE察
#0171
#0172 return TRUE察 // return TRUE unless you set the focus to a control
#0173
#0174
#0175 void CTipDlg今OnPaint┌
#0176
#0177 CPaintDC dcthis察// device context for painting
#0178
#0179 // Get paint area for the big static control
#0180 CWnd* pStatic = GetDlgItemIDC_BULB察
#0181 CRect rect察
#0182 pStatic´〃GetWindowRect&rect察
#0183 ScreenToClient&rect察
#0184
#0185 // Paint the background white。
817
´´´´´´´´´´´´´´´´´´´´´´Page 880´´´´´´´´´´´´´´´´´´´´´´´
及鐙 侮秘 MFC 殻塀O
#0186 CBrush brush察
#0187 brush。CreateStockObjectWHITE_BRUSH察
#0188 dc。FillRectrect察&brush察
#0189
#0190 // Load bitmap and get dimensions of the bitmap
#0191 CBitmap bmp察
#0192 bmp。LoadBitmapIDB_LIGHTBULB察
#0193 BITMAP bmpInfo察
#0194 bmp。GetBitmap&bmpInfo察
#0195
#0196 // Draw bitmap in top corner and validate only top portion of window
#0197 CDC dcTmp察
#0198 dcTmp。CreatepatibleDC&dc察
#0199 dcTmp。SelectObject&bmp察
#0200 rect。bottom = bmpInfo。bmHeight rect。top察
#0201 dc。BitBltrect。left察rect。top察rect。Width┌察rect。Height┌察
#0202 &dcTmp察0察0察SRCCOPY察
#0203
#0204 // Draw out ;Did you know。。。; message next to the bitmap
#0205 CString strMessage察
#0206 strMessage。LoadStringCG_IDS_DIDYOUKNOW察
#0207 rect。left = bmpInfo。bmWidth察
#0208 dc。DrawTextstrMessage察rect察DT_VCENTER DT_SINGLELINE察
#0209
#0210 // Do not call CDialog今OnPaint┌ for painting messages
#0211
俐個Test 殻會坪否
參和頁斤噐貧峰仟奐猟周議蛍裂嚥俐個。不壼厘奚蛍裂狛峪勣俐個匯和Splash Screen
鮫中奐紗匯倖TIPS。TXT 猟忖猟周壅延晒匯和About 斤三完祥撹阻。
TEST。RC
勣委徭失彈姥議夕頭恂葎仝貪勦鮫中々嗤曾倖珊麻圭宴議恬隈。凪匯頁岷俊園俐Splash
Screen 怏周揮公厘断議Splsh16。bmp 議坪否凪屈頁俐個RC 亀嶄議IDB_SPLASH 侭
斤哘議猟周兆各。厘僉夲朔宀。侭參厘俐個RC 亀嶄議匯佩此
IDB_SPLASH BITMAP DISCARDABLE ;Dissect。bmp;
818
´´´´´´´´´´´´´´´´´´´´´´Page 881´´´´´´´´´´´´´´´´´´´´´´´
16 ponents & ActiveX Controls
及 嫗 嫋議主芋 聞喘
Dissect。bmp 夕亀坪否泌和此
作
拭
棔
广 /
防
D
巷
望
竃
井
2nd Edition
侮秘竃MFC
緩翌厘匆俐個RC 猟周嶄議匯乂忖憲堪聞万断格嶽侘庁此
IDD_TIP DIALOG DISCARDABLE 0察0察231察164
STYLE DS_MODALFRAME WS_POPUP WS_CAPTION WS_SYSMENU
CAPTION ;書晩弌蜘E;
FONT 8察 MS Sans Serif;
BEGIN
CONTROL ;;察1察Static;SS_BLACKFRAME1211207123
LTEXT ;Some String;IDC_TIPSTRING286317760
CONTROL ;殻塀r@幣弌蜘E;IDC_STARTUP察Button;察
BS_AUTOCHECKBOX WS_GROUP WS_TABSTOP131468510
PUSHBUTTON ;弌蜘E;IDC_NEXTTIP1091435014WS_GROUP
DEFPUSHBUTTON ;P蕋А┌IDOK1681435014WS_GROUP
CONTROL ;;IDC_BULB察Static;SS_BITMAP2017190111
END
STRINGTABLE DISCARDABLE
BEGIN
。。。
// CG_IDS_DIDYOUKNOW ;Did You Know。。。;
CG_IDS_DIDYOUKNOW ;作拭榜恬定燕。。。;
END
819
´´´´´´´´´´´´´´´´´´´´´´Page 882´´´´´´´´´´´´´´´´´´´´´´´
及鐙 侮秘 MFC 殻塀O
奐紗匯倖TIPS。TXT
宸載酒汽聞喘販採匯嶽猟忖園辞垢醤恆儉念中傍狛議TIPS。TXT 猟周鯉塀恂竃低
議耽晩弌蜘穣。
俐個RC 猟周嶄議About 斤三完鮫中
厘奐紗阻膨倖static 陣崙怏周凪嶄曾倖恂葎壌炎聞喘音駅壓窄凪ID 。総曾倖彈姥公
Test 殻會壓‐About /斤三完竃嵎栄莇狼由佚連聞喘 ID 蛍艶譜協葎
IDC_PHYSICAL_MEM 才IDC_DISK_SPACE 塘栽System Info for About Dlg 怏周議秀
咏。
TEST。CPP
壓CAboutDlg今OnInitDialog 嶄旋喘SetDlgItemText 譜協不壼厘断葎斤三完鮫中仟奐議
曾倖static 陣崙怏周議猟忖坪否ponent Gallery 厮将葎厘断恂竃宸粁殻會旗鷹峪頁
壙扮委万炎芝葎傍苧猟忖。厘峪勣委炎芝憲催// 肇茅軸辛此
BOOL CAboutDlg今OnInitDialog┌
。。。
SetDlgItemTextIDC_PHYSICAL_MEM察strFreeMemory察
。。。
SetDlgItemTextIDC_DISK_SPACE察strFreeDiskSpace察
return TRUE察 // CG此 This was added by System Info ponent。
820
´´´´´´´´´´´´´´´´´´´´´´Page 883´´´´´´´´´´´´´´´´´´´´´´´
16 ponents & ActiveX Controls
及 嫗 嫋議主芋 聞喘
Test 俐個潤惚
匯俳勝泌繁吭。嶬變卉排仭棒輜覽Splash Screen 鮫中泌念侭峰匆嗤阻Tips of the
Day 斤三完此
參式匯倖坪根狼由佚連議About 斤三完此
821
´´´´´´´´´´´´´´´´´´´´´´Page 884´´´´´´´´´´´´´´´´´´´´´´´
及鐙 侮秘 MFC 殻塀O
聞喘ActiveX Controls
Microsoft 議Visual Basic 徭1991 定容竃參栖厮将撹葎Windows 哘喘罷周蝕窟桟廠
嶄議扨扨宀。万議撹孔自寄何芸勣拷孔噐凪蝕慧來嵎宰侭戻工議VBXs 瓜範葎頁匯嶽
自煮議斤鶺赦魍茂鯢莠銅楾后VBX 頁匯嶽強蓑選潤痕方垂DLL 窃貌Windows 議
匡崙侏陣崙怏周custom control 。
VBX 音癖喘噐32 了桟廠。噐頁Microsoft 壅容竃総匯号鯉OCX 。音胎頁VBX 賜
OCX 賜封崛Borland 議VCL脅戻工Properties´Method´Event PME俊笥。Visual Basic
岻噐VBX 參式Borland C Builder 才Delphi 岻噐VCL脅戻工