コード例 #1
0
/*---------------------------------------------------------------------------
                                FindWndProc
---------------------------------------------------------------------------*/
MRESULT EXPENTRY FindWndProc( HWND wnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
{
 MRESULT  MRes;
 HWND     entryfield;

   switch (msg) {
     case WM_INITDLG:
           PositionDialog( wnd );
           entryfield = WinWindowFromID( wnd, ID_FINDENTRY );
           WinSendMsg( entryfield, EM_SETTEXTLIMIT,
                       MPFROMSHORT( sizeof FindDat.text - 1 ), 0 );
           WinSetDlgItemText( wnd, ID_FINDENTRY, FindDat.text );
           WinSendMsg( entryfield, EM_SETSEL,
                       MPFROM2SHORT( 0, sizeof FindDat.text ), 0 );
           MRes = MRFROMSHORT( FALSE );
           break;
     case WM_CHAR:
        if (SHORT2FROMMP( mp2 ) == VK_NEWLINE) {
           WinQueryDlgItemText( wnd,
                                ID_FINDENTRY,
                                sizeof FindDat.text - 1,
                                FindDat.text );
           FindDat.sense = WinQueryButtonCheckstate( wnd, ID_FINDCHECK );
           WinDismissDlg( wnd, 0 );
        }
     default:
        MRes = WinDefDlgProc( wnd, msg, mp1, mp2 );
        break;
   }

  return MRes;
}
コード例 #2
0
/*---------------------------------------------------------------------------
                                AboutWndProc
---------------------------------------------------------------------------*/
MRESULT EXPENTRY AboutWndProc( HWND wnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
{
 WNDATTR *wndattr;
 MRESULT  MRes;
 HWND     frame, client;
 char     number[10];

   switch (msg) {
     case WM_INITDLG:
           PositionDialog( wnd );

           frame = WinQueryWindow( wnd, QW_OWNER );
           client = WinWindowFromID( frame, FID_CLIENT );
           wndattr = (WNDATTR*)WinQueryWindowPtr( client, QWL_USER );

           ltoa( LPListLines( wndattr->list ), number, 10 );
           WinSetDlgItemText( wnd, ID_LINES, number );
           ltoa( LPListMarkedLines( wndattr->list ), number, 10 );
           WinSetDlgItemText( wnd, ID_MARKED, number );
           ltoa( LPListMaxLines( wndattr->list ), number, 10 );
           WinSetDlgItemText( wnd, ID_MAXLINES, number );
           ltoa( LPListMaxLen( wndattr->list ), number, 10 );
           WinSetDlgItemText( wnd, ID_MAXLENGTH, number );

           break;
     default:
        MRes = WinDefDlgProc( wnd, msg, mp1, mp2 );
        break;
   }

  return MRes;
}
コード例 #3
0
ファイル: utils.cpp プロジェクト: plerup/LaunchBar
UINT_PTR CALLBACK PositionDlgHook(HWND hDlg,
                      UINT message,
                      UINT wParam,
                      LONG lParam)
{
   if (message == WM_NOTIFY && ((LPOFNOTIFY)lParam)->hdr.code == CDN_INITDONE)
      PositionDialog(GetParent(hDlg));
   return 0;
}
void CSAchievementsAndStatsInterface::DisplayPanel()
{
    // Position & show dialog
    PositionDialog(m_pAchievementAndStatsSummary);
    m_pAchievementAndStatsSummary->Activate();

	//Make sure the top of the page appears on the screen (for video modes such as 1280x720).
	int x, y;
	m_pAchievementAndStatsSummary->GetPos( x, y );
	if ( y <  0 )
	{
		m_pAchievementAndStatsSummary->SetPos( x, 0 );
	}
}