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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. OnSetCursor - works in 1 dlg but in other doesn't!

OnSetCursor - works in 1 dlg but in other doesn't!

Scheduled Pinned Locked Moved C / C++ / MFC
comhelpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    YaronNir
    wrote on last edited by
    #1

    Hi all, i have 2 dialogs, dlg1 & dlg2 in both of them i use the same code:

    BOOL CDlg1::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
    {
    if (!m_bCondition)
    {
    ::SetCursor(::LoadCursor(NULL, IDC_WAIT));
    return TRUE;

    return CDialog::OnSetCursor(pWnd,nHitTest,message);
    

    }

    BOOL CDlg2::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
    {
    if (!m_bCondition)
    {
    ::SetCursor(::LoadCursor(NULL, IDC_WAIT));
    return TRUE;

    return CDialog::OnSetCursor(pWnd,nHitTest,message);
    

    }

    problem is that i see the hourglass when mouse is over dlg1, but i don't see the hourglass when mouse is over dlg2???? what am i missing? should i implement an other message? thanks in advanced Yaron

    Interface basics click here : http://www.codeproject.com/com/COMBasics.asp don't forget to vote :)

    P H 2 Replies Last reply
    0
    • Y YaronNir

      Hi all, i have 2 dialogs, dlg1 & dlg2 in both of them i use the same code:

      BOOL CDlg1::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
      {
      if (!m_bCondition)
      {
      ::SetCursor(::LoadCursor(NULL, IDC_WAIT));
      return TRUE;

      return CDialog::OnSetCursor(pWnd,nHitTest,message);
      

      }

      BOOL CDlg2::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
      {
      if (!m_bCondition)
      {
      ::SetCursor(::LoadCursor(NULL, IDC_WAIT));
      return TRUE;

      return CDialog::OnSetCursor(pWnd,nHitTest,message);
      

      }

      problem is that i see the hourglass when mouse is over dlg1, but i don't see the hourglass when mouse is over dlg2???? what am i missing? should i implement an other message? thanks in advanced Yaron

      Interface basics click here : http://www.codeproject.com/com/COMBasics.asp don't forget to vote :)

      P Offline
      P Offline
      prasad_som
      wrote on last edited by
      #2

      Use CWaitCursor object in OnMouseMove function of both dialog.

      Prasad Notifier using ATL | Operator new[],delete[][^]

      Y 1 Reply Last reply
      0
      • Y YaronNir

        Hi all, i have 2 dialogs, dlg1 & dlg2 in both of them i use the same code:

        BOOL CDlg1::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
        {
        if (!m_bCondition)
        {
        ::SetCursor(::LoadCursor(NULL, IDC_WAIT));
        return TRUE;

        return CDialog::OnSetCursor(pWnd,nHitTest,message);
        

        }

        BOOL CDlg2::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
        {
        if (!m_bCondition)
        {
        ::SetCursor(::LoadCursor(NULL, IDC_WAIT));
        return TRUE;

        return CDialog::OnSetCursor(pWnd,nHitTest,message);
        

        }

        problem is that i see the hourglass when mouse is over dlg1, but i don't see the hourglass when mouse is over dlg2???? what am i missing? should i implement an other message? thanks in advanced Yaron

        Interface basics click here : http://www.codeproject.com/com/COMBasics.asp don't forget to vote :)

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        You say it doesnt call OnSetCursor on CDlg2,right?


        WhiteSky


        Y 1 Reply Last reply
        0
        • H Hamid Taebi

          You say it doesnt call OnSetCursor on CDlg2,right?


          WhiteSky


          Y Offline
          Y Offline
          YaronNir
          wrote on last edited by
          #4

          the method OnSetCursor is being called on both dialogs, but the problem is that i can see the hourglass on dialog1 when mouse is over it, but i see only an arrow (not hourglass) on dialog2 when mouse is over it.... ? Yaron

          Interface basics click here : http://www.codeproject.com/com/COMBasics.asp don't forget to vote :)

          1 Reply Last reply
          0
          • P prasad_som

            Use CWaitCursor object in OnMouseMove function of both dialog.

            Prasad Notifier using ATL | Operator new[],delete[][^]

            Y Offline
            Y Offline
            YaronNir
            wrote on last edited by
            #5

            well, i just took you advise and altered it abit: i used OnMouseMove, and set the cursor myself according to the condition and it worked :) thanks Yaron

            Interface basics click here : http://www.codeproject.com/com/COMBasics.asp don't forget to vote :)

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

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