Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

Andreas Masur

@Andreas Masur
About
Posts
3
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Problem with multi threading
    A Andreas Masur

    Well...depending on the operating system 'Sleep()' will sleep between 10 (Single CPU Windows NT) milliseconds and 50 milliseconds (Windows 98). I do not know of the top of my head whether Windows 2000 or XP have better resolution... Ciao, Andreas "Software is like sex, it's better when it's free." - Linus Torvalds

    C / C++ / MFC help question

  • Moving Cursor position in Edit box !
    A Andreas Masur

    void CEdit::SetSel(DWORD dwSelection, BOOL bNoScroll = FALSE);
    void CEdit::SetSel(int nStartChar, int nEndChar, BOOL bNoScroll = FALSE);

    To set the cursor at the end of the text within the control...

    // With associated member variable to the edit control and to the content
    UpdateData();
    m_EditControl.SetSel(m_EditContent.GetLength(), m_EditContent.GetLength());

    // With associated member variable to the content
    UpdateData();
    ((CEdit *) GetDlgItem(IDC_EDIT))->SetSel(m_EditContent.GetLength(), m_EditContent.GetLength());

    If you want to use the first function you have to set the starting position in the low-order word and and the ending position in the high-order word...thus

    // With associated member variable to the edit control and to the content
    UpdateData();

    // Set position
    DWORD dwSelection = m_EditContent.GetLength();
    dwSelection |= m_EditContent.GetLength() << 16;

    m_EditControl.SetSel(dwSelection);

    // With associated member variable to the content
    UpdateData();

    // Set position
    DWORD dwSelection = m_EditContent.GetLength();
    dwSelection |= m_EditContent.GetLength() << 16;

    ((CEdit *) GetDlgItem(IDC_EDIT))->SetSel(dwSelection);

    Ciao, Andreas "Software is like sex, it's better when it's free." - Linus Torvalds

    C / C++ / MFC game-dev question html database com

  • Pop Dialog before start
    A Andreas Masur

    Do the following: CYourApp::InitInstance() { . . . // Call your first dialog FirstDialog::DoModal(); // Call your main dialog MainDialog::DoModal(); . . . } CFirstDialog::OnInitInstance() { // Do initialization stuff // Set timer SetTimer(1, 10000, NULL); return TRUE; } CFirstDialog::OnTimer(UINT nIDEvent) { if(nIDEvent == 1) { KillTimer(1); EndDialog(IDOK); } } This should display your splash screen for ten seconds before it loads the main dialog.

    C / C++ / MFC c++ tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups