What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [?] WM_MOUSEMOVE doesn't work

[?] WM_MOUSEMOVE doesn't work
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [?] WM_MOUSEMOVE doesn't work
This example is from here: http://www.codeguru.com/forum/showthread.php?t=290195
c++ code:
//////////// Globals ////////////
// HWND hWndBtn1 = NULL;
// HWND hWndBtn2 = NULL;
// WNDPROC wpOrigButtonProc = NULL;
// HBITMAP hBmpNormal = NULL;
// HBITMAP hBmpHiLight = NULL;
// BOOL bMouseInWindow = FALSE;

// IDC_DLGBTN1 is a button resource
// IDC_DLGBTN2 is a button resource
// IDB_BMP_NORMAL is a bitmap resource
// IDB_BMP_HILIGHT is a bitmap resource

// in WM_INITDIALOG of main dialog procedure
hWndBtn1 = GetDlgItem(hWnd, IDC_DLGBTN1);
hWndBtn2 = GetDlgItem(hWnd, IDC_DLGBTN2);
     // load bitmaps
hBmpNormal  = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BMP_NORMAL));
hBmpHiLight = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BMP_HILIGHT));
     // set initial button images       
SendMessage(hWndBtn1, BM_SETIMAGE,
          (WPARAM)IMAGE_BITMAP, (LPARAM)hBmpNormal );
SendMessage(hWndBtn2, BM_SETIMAGE,
          (WPARAM)IMAGE_BITMAP, (LPARAM)hBmpNormal);
     // subclass buttons           
wpOrigButtonProc = (WNDPROC) SetWindowLong(hWndBtn1,
          GWLP_WNDPROC, (LONG) NewButtonProc);
/* same original btn proc */ SetWindowLong(hWndBtn2,
          GWLP_WNDPROC, (LONG) NewButtonProc);

// in WM_CLOSE of main dialog procedure
SetWindowLong(hWndBtn1, GWLP_WNDPROC, (LONG)wpOrigButtonProc);
SetWindowLong(hWndBtn2, GWLP_WNDPROC, (LONG)wpOrigButtonProc);

// NewButtonProc window procedure
LRESULT CALLBACK NewButtonProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
     switch(uMsg)
     {
          case WM_MOUSEMOVE:
          {           
               if (!bMouseInWindow)
               {
                    bMouseInWindow = true;
                    SendMessage(hWnd, BM_SETIMAGE,
                         (WPARAM)IMAGE_BITMAP, (LPARAM)hBmpHiLight );
                    TRACKMOUSEEVENT tme;
                    tme.cbSize = sizeof(tme);
                    tme.dwFlags = TME_LEAVE;
                    tme.hwndTrack = hWnd;
                    TrackMouseEvent(&tme);
               }
          }
          break;
          case WM_MOUSELEAVE:
          {
               bMouseInWindow = false;
               SendMessage(hWnd, BM_SETIMAGE,
                    (WPARAM)IMAGE_BITMAP, (LPARAM)hBmpNormal);
          }
          break;
          default:
               return CallWindowProc(wpOrigButtonProc, hWnd,
                    uMsg, wParam, lParam);
     }
     return true;
}
04-20-2010 04:41 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[?] WM_MOUSEMOVE doesn't work - by SmokingCookie on 04-18-2010 at 07:24 AM
RE: [?] WM_MOUSEMOVE doesn't work - by matty on 04-18-2010 at 03:01 PM
RE: RE: [?] WM_MOUSEMOVE doesn't work - by SmokingCookie on 04-18-2010 at 05:50 PM
RE: [?] WM_MOUSEMOVE doesn't work - by CookieRevised on 04-19-2010 at 01:08 AM
RE: RE: [?] WM_MOUSEMOVE doesn't work - by SmokingCookie on 04-19-2010 at 07:12 PM
RE: [?] WM_MOUSEMOVE doesn't work - by CookieRevised on 04-20-2010 at 02:05 AM
RE: [?] WM_MOUSEMOVE doesn't work - by SmokingCookie on 04-20-2010 at 02:10 PM
RE: [?] WM_MOUSEMOVE doesn't work - by matty on 04-20-2010 at 02:52 PM
RE: [?] WM_MOUSEMOVE doesn't work - by SmokingCookie on 04-20-2010 at 04:08 PM
RE: [?] WM_MOUSEMOVE doesn't work - by matty on 04-20-2010 at 04:25 PM
RE: [?] WM_MOUSEMOVE doesn't work - by SmokingCookie on 04-20-2010 at 04:32 PM
RE: [?] WM_MOUSEMOVE doesn't work - by matty on 04-20-2010 at 04:41 PM
RE: [?] WM_MOUSEMOVE doesn't work - by SmokingCookie on 04-20-2010 at 04:43 PM
RE: [?] WM_MOUSEMOVE doesn't work - by matty on 04-20-2010 at 04:46 PM
RE: [?] WM_MOUSEMOVE doesn't work - by SmokingCookie on 04-20-2010 at 04:50 PM
RE: [?] WM_MOUSEMOVE doesn't work - by matty on 04-20-2010 at 05:19 PM
RE: [?] WM_MOUSEMOVE doesn't work - by SmokingCookie on 04-20-2010 at 05:23 PM
RE: [?] WM_MOUSEMOVE doesn't work - by matty on 04-20-2010 at 05:24 PM
RE: [?] WM_MOUSEMOVE doesn't work - by SmokingCookie on 04-20-2010 at 05:25 PM
RE: [?] WM_MOUSEMOVE doesn't work - by matty on 04-20-2010 at 05:28 PM
RE: [?] WM_MOUSEMOVE doesn't work - by matty on 04-20-2010 at 09:26 PM
RE: [?] WM_MOUSEMOVE doesn't work - by SmokingCookie on 04-21-2010 at 02:58 PM
RE: [?] WM_MOUSEMOVE doesn't work - by matty on 04-21-2010 at 04:35 PM
RE: [?] WM_MOUSEMOVE doesn't work - by matty on 04-21-2010 at 05:40 PM
RE: [?] WM_MOUSEMOVE doesn't work - by SmokingCookie on 04-21-2010 at 07:38 PM
RE: [?] WM_MOUSEMOVE doesn't work - by matty on 04-22-2010 at 12:27 AM
RE: [?] WM_MOUSEMOVE doesn't work - by CookieRevised on 04-22-2010 at 04:14 AM
RE: [?] WM_MOUSEMOVE doesn't work - by matty on 04-22-2010 at 01:02 PM
RE: [?] WM_MOUSEMOVE doesn't work - by SmokingCookie on 04-23-2010 at 11:40 AM
RE: [?] WM_MOUSEMOVE doesn't work - by matty on 04-23-2010 at 11:42 AM
RE: [?] WM_MOUSEMOVE doesn't work - by SmokingCookie on 04-24-2010 at 09:16 AM
RE: [?] WM_MOUSEMOVE doesn't work - by CookieRevised on 04-24-2010 at 01:31 PM
RE: [?] WM_MOUSEMOVE doesn't work - by SmokingCookie on 05-01-2010 at 10:40 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On