TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Edwin Groothuis
from: Peter Fitzsimmons
date: 1995-04-02 21:38:40
subject: wait/busy pointer???

EG> It works, but only for parts of me! I have an area with two listboxes,
 EG> two entryfield and two buttons. These parts have the normal
 EG> arrow-pointer, the other parts (without any resources) have the

After playing with this for some time (I was having trouble too),  I
eventually ended up with the code,  below,  in my main window proc (not in
the dialogs!),  which works for the whole program (and
windows/dialogs it creates);  all that needs to be done is for some code to
set my "busy" flag.  I am not sure if all this code is
necessary,but it works so i didn't touch it.

 MainWinProc()
 {
    static HPOINTER hp;

        [...]

        case WM_MOUSEMOVE:
            if(args->busy){
                if(!hp)
                    hp = WinQuerySysPointer(HWND_DESKTOP, SPTR_WAIT, FALSE);
                if(WinQueryPointer(HWND_DESKTOP) != hp){
                    WinSetPointer(HWND_DESKTOP, hp);
                    return (MRESULT)TRUE;
                }
                else
                    return WinDefWindowProc(hwnd, msg, mp1, mp2);
            }
            break;
        case WM_CONTROLPOINTER:
            if(args && args->busy){
                if(!hp)
                    hp = WinQuerySysPointer(HWND_DESKTOP, SPTR_WAIT, FALSE);
                return (MRESULT)hp;
            }
            else
                return WinDefWindowProc(hwnd, msg, mp1, mp2);

nb: "args" is my window/thread instance data,  kinda like global vars.

--- Maximus/2 2.02p1
* Origin: Sol 3/Toronto (905)858-8488 (1:259/414)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 259/414 400 99 250/702 3615/50 396/1 270/101 105/103 42 712/515
@PATH: 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.