Ignore:
Timestamp:
Aug 29, 2009, 7:55:19 AM (15 years ago)
Author:
イグトランス (egtra)
Message:

Windows 7タスクバーへの対応を実装。
(#245)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/abdev/SubOperation.cpp

    r705 r772  
    153153}
    154154void SlideString(char *buffer, int slide){
    155     char *temp;
    156     temp=(char *)malloc(lstrlen(buffer)+1);
    157     lstrcpy(temp,buffer);
    158     lstrcpy(buffer+slide,temp);
    159     free(temp);
     155    SlideBuffer(buffer, strlen(buffer) + 1, slide);
    160156}
    161157void SlideBuffer(char *buffer,int length,int slide){
    162     void *temp;
    163     temp=malloc(length+1);
    164     memcpy(temp,buffer,length);
    165     memcpy(buffer+slide,temp,length);
    166     free(temp);
     158    memmove(buffer+slide, buffer, length);
    167159}
    168160BOOL IsVariableTopChar(char c){
     
    745737    extern FWINLAYER pSetLayeredWindowAttributes;
    746738    extern HINSTANCE hUser32Lib;
    747     hUser32Lib=GetModuleHandle("user32.dll");
     739    hUser32Lib=GetModuleHandle(TEXT("user32.dll"));
    748740    pSetLayeredWindowAttributes=reinterpret_cast<FWINLAYER>(GetProcAddress(hUser32Lib,"SetLayeredWindowAttributes"));
    749741
     
    754746    // フォントを定義
    755747    /////////////////////
     748
     749    NONCLIENTMETRICS NCMetrics = {0};
     750    NCMetrics.cbSize = sizeof( NONCLIENTMETRICS );
     751    SystemParametersInfo( SPI_GETNONCLIENTMETRICS, NCMetrics.cbSize, &NCMetrics, 0 );
    756752
    757753    //パラメータ ヒント フォント
     
    764760
    765761    //ステータスバー フォント
    766     LOGFONT LogFont;
    767762    extern HFONT hStatusFont;
    768     LogFont.lfHeight=-12;
    769     LogFont.lfWidth=0;
    770     LogFont.lfEscapement=0;
    771     LogFont.lfOrientation=0;
    772     LogFont.lfWeight=FW_REGULAR;
    773     LogFont.lfItalic=NULL;
    774     LogFont.lfUnderline=NULL;
    775     LogFont.lfStrikeOut=NULL;
    776     LogFont.lfCharSet=SHIFTJIS_CHARSET;
    777     LogFont.lfOutPrecision=OUT_STRING_PRECIS;
    778     LogFont.lfClipPrecision=CLIP_STROKE_PRECIS;
    779     LogFont.lfQuality=DRAFT_QUALITY;
    780     LogFont.lfPitchAndFamily=VARIABLE_PITCH;
    781     sprintf(LogFont.lfFaceName,"MS Pゴシック");
    782     hStatusFont=CreateFontIndirect(&LogFont);
     763    hStatusFont=CreateFontIndirect(&NCMetrics.lfStatusFont);
    783764
    784765    //ハイパーリンク フォント
    785766    extern HFONT hHyperLinkFont;
     767    LOGFONT LogFont;
    786768    LogFont.lfHeight=-12;
    787769    LogFont.lfWidth=0;
     
    797779    LogFont.lfQuality=DRAFT_QUALITY;
    798780    LogFont.lfPitchAndFamily=VARIABLE_PITCH;
    799     sprintf(LogFont.lfFaceName,"MS Pゴシック");
     781    _tcscpy(LogFont.lfFaceName,TEXT("MS Pゴシック"));
    800782    hHyperLinkFont=CreateFontIndirect(&LogFont);
    801783
     
    815797    LogFont.lfQuality=DRAFT_QUALITY;
    816798    LogFont.lfPitchAndFamily=VARIABLE_PITCH;
    817     sprintf(LogFont.lfFaceName,"MS ゴシック");
     799    _tcscpy(LogFont.lfFaceName,TEXT("MS ゴシック"));
    818800    hRulerFont=CreateFontIndirect(&LogFont);
    819801
     
    833815    LogFont.lfQuality=DRAFT_QUALITY;
    834816    LogFont.lfPitchAndFamily=VARIABLE_PITCH;
    835     sprintf(LogFont.lfFaceName,"Courier New");
     817    _tcscpy(LogFont.lfFaceName,TEXT("Courier New"));
    836818    hFont_LineNumber=CreateFontIndirect(&LogFont);
    837819
    838820    //メニューフォント
    839     NONCLIENTMETRICS NCMetrics;
    840     int sizeof_NONCLIENTMETRICS = sizeof( NONCLIENTMETRICS );
    841 #if WINVER >= 0x0600
    842     sizeof_NONCLIENTMETRICS -= sizeof(int);
    843 #endif
    844     NCMetrics.cbSize = sizeof_NONCLIENTMETRICS;
    845     SystemParametersInfo( SPI_GETNONCLIENTMETRICS, sizeof_NONCLIENTMETRICS, &NCMetrics, 0 );
    846821    hMenuFont=CreateFontIndirect(&NCMetrics.lfMenuFont);
    847822
     
    11951170        WS_VISIBLE|WS_CHILD|WS_CLIPSIBLINGS|SBARS_SIZEGRIP|CCS_BOTTOM,
    11961171        NULL,hwnd,NULL);
    1197     SendMessage(hStatusBar,WM_SETFONT,(long)hStatusFont,0);
     1172    SetWindowFont(hStatusBar,hStatusFont,FALSE);
    11981173
    11991174    //プロジェクト ビュー
Note: See TracChangeset for help on using the changeset viewer.