Public Group

# Win 7 Cursors(C++)

This topic is 2888 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

What is the standard way for loading Windows 7 cursors in a program?

I'm looking for a way to load the standard listview header resize cursor <-|->

Example code greatly appreciated.

##### Share on other sites
You can use LoadCursor to easily get some standard cursors. LoadCursor(NULL, IDC_SIZEWE) should get you a cursor for right-left resizing.

##### Share on other sites

You can use LoadCursor to easily get some standard cursors.

Yeah, that doesn't seem to offer what I want.

LoadCursor(NULL, IDC_SIZEWE) should get you a cursor for right-left resizing.

No, what I want is the cursor you get when you adjust a header control in windows 7. It's like right-left resizing but with a line down the center.

Start -> Computer -> Drive (Cursor you get when go between Name/Date Modified/Type/Size in details view)

##### Share on other sites
Do you mean like LoadIcon(hDC, IDC_SIZEALL) ?

Or like LoadIcon(hDC, IDC_CROSS) ?

##### Share on other sites

Do you mean like LoadIcon(hDC, IDC_SIZEALL) ?

Or like LoadIcon(hDC, IDC_CROSS) ?

No, neither.

Here it is in Office, but Windows 7 uses it too.
cursor

##### Share on other sites
I looked for that one a while back - I don't think it is actually exposed by the API so unless you can find out where office is loading it from, I don't think it's usable.

##### Share on other sites

I looked for that one a while back - I don't think it is actually exposed by the API so unless you can find out where office is loading it from, I don't think it's usable.

It's weird that Microsoft wouldn't provide a way to further tie code to their OS...

...The world just doesn't make sense anymore.

##### Share on other sites

[quote name='Aardvajk' timestamp='1294740049' post='4757179']
I looked for that one a while back - I don't think it is actually exposed by the API so unless you can find out where office is loading it from, I don't think it's usable.

It's weird that Microsoft wouldn't provide a way to further tie code to their OS...
[/quote]

Actually, if it's not a regular cursor, then it's probably a resource that was included into the program, and then loaded the resource as the cursor.You would go about doing this by the #define preprocessor directive in the resource.h file like this:

 #define IDC_FAVCURSOR 3001 

, and then initialized in the main.rc file like this:

 IDC_FAVCURSOR /* or whatever you defined it as */ CURSOR "Res\\favcursor.cur" /* the filename */ 

After you do that, you can load it into the LoadCursor function like any other windows cursor.

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633662
• Total Posts
3013228
×