GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 24-Oct-2005, 03:43
holbrook holbrook is offline
New Member
 
Join Date: May 2004
Posts: 9
holbrook is on a distinguished road

Overriding web browser cursor in an MFC App


Hello,
I have a simple MFC dialog based application with a microsoft web browser activeX control in it. I want the ability to specify a mouse cursor image, instead of the web browser using whatever cursor the underlying html tells it to.

So far I have only been successful in setting the cursor of the Dialog window itself using
CPP / C++ / C Code:
SetClassLongPtr(this->.m_hWnd, //'this' is a CDialog
    GCL_HCURSOR,
   (LONG)LoadCursor(AfxGetInstanceHandle(), 
MAKEINTRESOURCE(IDC_CURSOR1))); //IDC_CURSOR1 is a predefined cursor resource

So I thought the next logical step would be to try the same thing but pass the web browser handle instead.

CPP / C++ / C Code:
SetClassLongPtr(m_webBrowser.m_hWnd, //'m_webBrowser' is the variable for the web browser activeX
    GCL_HCURSOR,
   (LONG)LoadCursor(AfxGetInstanceHandle(), 
MAKEINTRESOURCE(IDC_CURSOR1))); //IDC_CURSOR1 is a predefined cursor resource

Unfortunately, this does nothing

My next idea was to add a CStatic control (like a static text control, or an image control), add it over the top of the entire web browser, change the cursor property of the CStatic control, and make the static control transparent so the web browser underneath can be seen (I didn't mind if this blocked user input as a side effect, because that is also a desired outcome).

But I failed as soon as I tried to change the cursor property of the CStatic control
Code:
m_staticText.SetCursor( LoadCursor(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDC_CURSOR1)));

Sorry for the long-winded post guys, but I wanted to explain the problem as best as I could. If I havn't explained myself properly somewhere, let me know. Thanks in advance!
Last edited by LuciWiz : 24-Oct-2005 at 04:46. Reason: Please insert your C++ code between [c++] & [/c++] tags
 
 

Recent GIDBlog2nd Week of IA Training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The google browser or OS hangmansjoke Search Engine Optimization Forum 7 09-Dec-2004 21:21
Why should you switch to the firebird browser? jrobbio Computer Software Forum - Linux 5 22-Nov-2003 15:08
How secure is YOUR browser? Garth Farley Computer Software Forum - Windows 16 31-Jul-2003 15:27
Using browser extensions to enhance web design jrobbio Web Design Forum 0 27-Jul-2003 17:38
Tell me if this works with YOUR browser? JdS Learning Journal by J de Silva 7 07-Apr-2003 18:38

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 23:49.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.