Changing cursor (sizing problem)

Hi, I've created a cursor, and MSVC6 allows me to make it 16x16 pixels
(what I want). Then I set the cursor at runtime:

HCURSOR lhCursor=AfxGetApp()->LoadCursor(IDC_NEWCURSOR);
SetCursor(lhCursor);

However, when running, it's size is 32x32. How to I get it to be the
16x16 I wanted?

0
Hamish.Dean (174)
6/18/2006 7:29:13 PM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
497 Views

Similar Articles

[PageSpeed] 39

>Hi, I've created a cursor, and MSVC6 allows me to make it 16x16 pixels
>(what I want). Then I set the cursor at runtime:
>
>HCURSOR lhCursor=AfxGetApp()->LoadCursor(IDC_NEWCURSOR);
>SetCursor(lhCursor);
>
>However, when running, it's size is 32x32. How to I get it to be the
>16x16 I wanted?

Try using LoadImage rather than LoadCursor - the latter will only load
images as the standard (32x32) size.

Dave
0
davidl7375 (2060)
6/18/2006 8:59:43 PM
> >Hi, I've created a cursor, and MSVC6 allows me to make it 16x16 pixels
> >(what I want). Then I set the cursor at runtime:
> >
> >HCURSOR lhCursor=AfxGetApp()->LoadCursor(IDC_NEWCURSOR);
> >SetCursor(lhCursor);
> >
> >However, when running, it's size is 32x32. How to I get it to be the
> >16x16 I wanted?
>
> Try using LoadImage rather than LoadCursor - the latter will only load
> images as the standard (32x32) size.

Thanks David,

HCURSOR lhCursor=(HCURSOR)LoadImage(0, "IDC_NEWCURSOR", IMAGE_CURSOR,
16, 16, LR_DEFAULTCOLOR);
SetCursor(lhCursor);

lhCursor is always NULL?

0
Hamish.Dean (174)
6/19/2006 4:21:49 AM
>Thanks David,
>
>HCURSOR lhCursor=(HCURSOR)LoadImage(0, "IDC_NEWCURSOR", IMAGE_CURSOR,
>16, 16, LR_DEFAULTCOLOR);
>SetCursor(lhCursor);
>
>lhCursor is always NULL?

Should your code be MAKEINTRESOURCE( IDC_NEWCURSOR ) rather than
"IDC_NEWCURSOR" ?

Dave
0
davidl7375 (2060)
6/19/2006 8:48:12 AM
David Lowndes wrote:
> >Thanks David,
> >
> >HCURSOR lhCursor=(HCURSOR)LoadImage(0, "IDC_NEWCURSOR", IMAGE_CURSOR,
> >16, 16, LR_DEFAULTCOLOR);
> >SetCursor(lhCursor);
> >
> >lhCursor is always NULL?
>
> Should your code be MAKEINTRESOURCE( IDC_NEWCURSOR ) rather than
> "IDC_NEWCURSOR" ?

Hmmm, either way, it's still not working.
BTW, should the first parameter be NULL or 0 (or does it make no
difference)?

0
Hamish.Dean (174)
6/19/2006 9:45:51 AM
>> >HCURSOR lhCursor=(HCURSOR)LoadImage(0, "IDC_NEWCURSOR", IMAGE_CURSOR,
>> >16, 16, LR_DEFAULTCOLOR);
>> >SetCursor(lhCursor);
>> >
>> >lhCursor is always NULL?
>>
>> Should your code be MAKEINTRESOURCE( IDC_NEWCURSOR ) rather than
>> "IDC_NEWCURSOR" ?
>
>Hmmm, either way, it's still not working.
>BTW, should the first parameter be NULL or 0 (or does it make no
>difference)?

It should be the instance handle of the module containing your image -
try using AfxGetInstanceHandle. NULL (or 0) should only be used for
the stock (OEM) images built into Windows.

Dave
0
davidl7375 (2060)
6/19/2006 9:57:52 AM
> It should be the instance handle of the module containing your image -
> try using AfxGetInstanceHandle. NULL (or 0) should only be used for
> the stock (OEM) images built into Windows.

Solved! Thanks a bunch

0
Hamish.Dean (174)
6/19/2006 10:13:02 AM
Reply:

Similar Artilces:

Mystery price changes-anybody experienced????
When I have been updating items in Manager, sometimes the price from the previous item automatically populates and changes on the next item. Has anybody experienced this? Very frustrating. Any suggestions? Apply the latest hotfix for RMS. This will resolve the issue. Mihir Diviasoft, Inc www.diviasoft.com "knightsbridge" <knightsbridge@discussions.microsoft.com> wrote in message news:9BF21959-BD09-4005-B635-409A2EBD4570@microsoft.com... > When I have been updating items in Manager, sometimes the price from the > previous item automatically populates and changes o...

duplex printing question, change record order to line up with other side?
i have a report that i need to make the opposite side match up with the correct record. it is setup to print 4 records, 2 across then 2 below. like 4 post cards on a landscape page. records for each customer need to match up with the mailing address on the reverse side. so the records are switched if i were to make the report right now. basicly records start 1 and 2 on the top of the landscaped page then 3 and 4 under. so on the reverse side records need to be 2 and 1 then 4 and 3 under. i havent made the opposite side for mailing address yet. i need some info on how i need to do this....

Problem: "Debug Assertion Failed"?
After adding some code to a project and some controls to a dialog in the project, when I run the program I get the following error dialog: Debug Assertion Failed! Program: {path to my program executable and executable name} File: afxwin2.inl Line: 590 followed by an application error dialog. I am not using asserts in my code and when I remove conrols from the dialog, the line number changes. Any idea what might be causing this or where to look for a cause? Is there a limit to the number of controls on a dialog? (There are about 150 on this one. It is a data readout dialog for a piece ...

receving email size limit
Hi, I have email send/receiving size limit setup for 5mb in exchange 2003 srv - globe setting/message delivery, but I'd like to permit certain users to receive emails > 5mb size, how can I set this up? I tried in user's exchange general setting/delivery restriction, it seems not working... do I have to restart anything after making changes? thanks al -- 007 You must override the global setting in the individual user account. ...

Change date format on report
My date displays as mddyy in the table but on the report I'd like it to display as mm/dd/yyyy, how would I code that to have that field always display in mm/dd/yyyy format. I'm thinking this is very simple but I just can't get it to work for me. Thank so much for your help. On May 2, 1:50 pm, SITCFanTN <SITCFa...@discussions.microsoft.com> wrote: > My date displays as mddyy in the table but on the report I'd like it to > display as mm/dd/yyyy, how would I code that to have that field always > display in mm/dd/yyyy format. I'm thinking this is very simple...

Why does spell check change to English(US) on replies/forwards?
My default language is set to English(UK) spell checker reverts to English (US) when replying or forwarding messages. How can I change this so it is always English(UK)?Cheers,Tom ...

Exchange 2007
I've been running the Exchange 2007 evaluation. On one of my configurations my messages weren't getting through so I tried to look at the mailbox size and the users connected. And I can't find how to do this in the graphical admin interface. I've asked some of my collegues and they don't know how to do it either. Am I missing something here? One of the first things I do on when arriving on a customer site is to check out the list of mailboxes and who is connected and I can't figure out how to do it on Exchange 2007. powershell get-mailboxstatistics will get y...

Still having Outlook performance problems
I need some help to speed up my Outlook 2002 SP 2 program. When I navigate around within Outlook, there seems to be a 5 second delay for everything. My account was over 700megs but I cleaned it up to under 60 megs thinking that would help and nothing changed. "Enable Instant Messaging in Microsoft Outlook" is not selected. Help, Donny ? >-----Original Message----- >I need some help to speed up my Outlook 2002 SP 2 >program. When I navigate around within Outlook, there >seems to be a 5 second delay for everything. My account >was over 700megs but I cleaned it...

Combo Box changes after Microsoft Upgrade.
I have WindowsXP and Access2003. I have a Combo Box on a form used for finding a particular record. After downloading and installing the Office2003 upgrade (Office 2003 Service Pack 3 (SP3)), one of the columns (a text) Combo Box is blank. This remains blank even if I create a new Combo Box. Also, going back to a application backup I made in January2007, this column has become blank too. The Office 2003 Service Pack 3 (SP3) is the only event which has occurred. Please help, Frank And, you've hit the nail on the head. It is SP3 which is causing this issue. From what I u...

Sumproduct
I am using Sumproduct with three variables (Person, Product and Month). I am using data validation lists for the end user to select the person, product and month. I would like to be able to add a "Total" to the person list so that when the end user chooses "Total" and a product and month that the Sumproduct would only use the two other criteria (Product and Month) and be able to see the totals of those criteria for all Persons. I know I could nest IF THEN statements with the Sumproduct, but is there a better way??? Appreciate the help! No, an IF/THEN m...

Refreshing tab problem
Hi to all, I do not know if anyone can help me on this one. I have a form that contains a tab control with 15 tabs on it, tab 1 contains approx 120 fields, half of them are calulated fields that are being updated on the current event of the form thru a private sub. On the tab control, I have 6 page with 1 subfrm on it, 2 pages with 4, 1 page with either 6,7 or 9 subfrm, very few subs are failry complex but most of them contains less than 25 controls on them. Loading the main form that have the tab control takes less than 1 sec. The pages are program to be loaded on a per demand...

Strange Problem in Inventory
I post this message every couple of months in hope that someone new will see it or someone else has ran into the issue. Tech support has not been able to find a solution for it yet. When we receive items and receive more than the Purchase order was for the item's on order quantity changes to a negative amount that equals the over received amount. In our industry it is common practice to allow over or under 10% variance in quantities shipped so this is a large problem for us weekly as it throws off the PO generator when it is ran. The only thing that fixes the issue is to run reconci...

Problem importing customization in virtual machine
Hi there I have a serious problem when it try to import a customization xml to a test environment of crm 3.0. The file has a normal size and is exportet from an nearly identical system whit very few and harmless difference. The upload of the file is no problem and alle the entities are displayed. When i to import all the customization or even a single entity the process starts and it seems to work fine. But it will never come to an end. Even if I way some 24 hour as I did the process will never be finished. When I look at the eventlog i have the following message appearing every 5-10 m...

Can't Use Outlook after changing Servers
Moved users from one server to another. Users map USER folder to U:\ drive, no chnage there. After move when trying to open Outlook it stops with an error that there is a security problem with the .pst file. There is none I can find. Tried deleting Outlook profile for user and installing a new one, came up with same pst file. tried adding a second pst file and get the same security violation, No other files have problems, WORD or Excel. ideas?? dave Admin ...

How to change the year?
I have a date column in my work sheet where I have enterred the year as 2005, but actually should be 2001. The cell format is date-month-year. My date range is B5:B55. How can I change the year on only for the dates in this range. Thanks. Victor Victor, The difference between a 2001 and a 2005 date is 1461. So do this: Put 1461 in a cell. Copy. Select B5:B55. Edit - Paste Special. Click "Values" and "Subtract." OK. -- Earl Kiosterud www.smokeylake.com "la90292" <la90292@myrealbox.com> wrote in message news:ebnzG62qFHA.3720@TK2MSFTNGP14.phx.gb...

Problem i am facing with ::DestroyWindow()
In this code sniplet only destroywindow fails all other calls such as SetWndowText ShowWindow are getting executed successfuly so what is the problem handle is same in all the calls so why only in destroywindow it is giving an error as Error::- Unhandled exception in a.exe(MFC42D.DLL)0xC0000005: Access Violation HWND m_mdiClient; for (HWND wnd = ::GetTopWindow(*pFrame); wnd; wnd = ::GetNextWindow(wnd, GW_HWNDNEXT)) { char wndClass[32]; ::GetClassName(wnd, wndClass, 32); if (strncmp(wndClass, "MDIClient", 32) == 0) break; } //**now got the client window handle m_...

Font problem #2
I'm using the free trial download of Publisher & at work I use Publisher 2003. Regardless of which one, the font is changing whenever I type a ' or press the spacebar. I'm using Helvetica, and Times New Roman is the default. The toolbar shows Helvetica, but these characters switch the font to TNR. I've searched the help menu which has been useless. Any suggestions would be great. Thanks! ...

XslTransform Problems with Whitespace
I'm using XslTransform to apply a transform to an XML document, however I get validation problems when parsing the resulting XML document due to invalid whitespace. I'm passing in an XPathNavigator for the input to the Transform method and specifying a Stream for the output. Here is an example of a transform and a document (it's the IconStyle sections that are causing problems): <?xml version="1.0" encoding="UTF-16"?> <!-- Copyright i2 Ltd 2002-2003. All rights reserved. --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform&qu...

i meet a problem that how can i free the object .
I am programming a OPC client to get data from OPC Server. i meet a problem that how can i free the object . Firstly i create connectionpoint, then i release connection. --------------------------------------------------------------- create program list: IConnectionPoint* pConnectionPoint; IUnknown* ppUnk = NULL ; hResult = pGRPCPC->FindConnectionPoint(IID_IOPCDataCallback,&pConnectionPoint); CDataCallbackSink* pDataCallbackSink=new CDataCallbackSink ; pDataCallbackSink->pDoc = m_pOPCDoc ; pDataCallbackSink->ExternalQueryInterface(&IID_IUnknown,(void**)&ppUnk); DW...

Problems with Mail Merge from Word 2000 to Outlook 2000 in Win98
Hi there- I've been successful at trouble shooting my employees many mail merge problems, but this one is stumping me: Windows 98 Outlook 2000 Word 2000 Mail merge from a Word doc, no errors in the merge data, but the messages never show up in the Outlook outbox. Possible issues: computer also has Outlook Express 6 on it and Eudora. But shouldn't matter, becase neither of those have mail merge capabilities from Word. Any thoughts? Many thanks Jesse It sure could matter. Outlook must be your default mail program. -- Russ Valentine [MVP-Outlook] <jesse.littlewood@gmail.com>...

change range for multiple charts
Hi I need to change the range for multiple charts, i.e. i have to go chart by chart and modify, either with the mouse or by typing, the new range, is there a quicker way to do this? "Yossi evenzur" wrote: > Hi > I need to change the range for multiple charts, i.e. i have to go chart by > chart and modify, either with the mouse or by typing, the new range, is there > a quicker way to do this? I've written a little Excel add-in that performs mass edits of series formulas: How to Edit Series Formulas http://peltiertech.com/WordPress/how-to-edit...

Cursor Movement with Arrow Keys
Why won't my cursor move with arrow keys after entering data in cell? I have to first use ENTER and then use arrow key. Are you perhaps in "Edit" mode? If you simply select a blank cell and type something will your arrow key move you out of the cell? Gord Dibben MS Excel MVP On Tue, 23 Mar 2010 15:50:01 -0700, Silver <Silver@discussions.microsoft.com> wrote: >Why won't my cursor move with arrow keys after entering data in cell? I have >to first use ENTER and then use arrow key. ...

Change PST?
I installed a new Outlook (XP) and have my old backup PST file on a disk. I want the default data location to be of my choosing. I assume I copy that data where I want it but how do I import it? "bobnewman backup.pst.pst". I am totally confused, both by the lack of documentation (that I can find) and the backup file name. I hope someone can help. Bob I found it! Thanks anyway. Bob "Bob Newman" <bobnewman@att.net> wrote in message news:vD%7d.2900$TY2.272@lakeread04... > I installed a new Outlook (XP) and have my old backup PST file on a disk. I > want t...

Upgrade From Money 2004 to 2005
I was running Money 2004 Deluxe with no problems and then converted to Money 2005. When I click on the Portfolio Manager icon, the screen that appears only has today's date, "Portfolio Manager", and "Quotes delayed at least 20 minutes" below the dark blue line that starts with "investing Home". Nothing else is on the page below the blue line...no investments, and no menu on the left. I could sure use some help on this one.... ...

How do I change the elements displayed in the message list
How do I change the elements displayed in the message list. For example, to list "To" or "From" edit the view - to change just one folder, click on the row of field names and choose custom. To make all folders the same see http://www.outlook-tips.net/howto/grouping.htm -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ Outlook Tips: http://www.outlook-tips...