|
GetCursor() will return the handle to the current cursor.
That should do, huh?
Why do you want the resource id?
Anyway, try using MAKEINTRESOURCE on the HCURSOR. I don't know if it will work. An HCURSOR is basically a HANDLE which is actually a void*. A void* is actually 32 bits.Thus an HCURSOR is a 32 bit number. MAKEINTRESOURCE takes a WORD as parameter and a WORD is only 16 bits. So initially I thought this would be a problem. But MAKEINTRESOURCE is defined as shown below :-
#define MAKEINTRESOURCE(i) (LPTSTR) ((DWORD) ((WORD) (i)))
As you can see the first cast is to a DWORD.
So I hope it will be okay.
But then, I might be wrong.
Regards
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
I wouldn't use MAKEINTRESOURCE, guys. Whilst a HCURSOR is a void *, that's not what MAKEINTRESOURCE is for. The resource management functions in Win32 take in an LPTSTR (a string). This string is the resource "name". The documentation for Win32 shows that this LPTSTR can be an actual pointer to a string name for the resource ("My New Resource"), OR, if the value of the LPTSTR only uses the lower 16 bits (ie it's a DWORD) the value represents the resource ID (IDR_MY_NEW_RESOURCE = 16000).
So, after all that the basic answer is, I don't think you can determine the resource ID from the current cursor (after all, it might be created from a resource located in a DLL, another EXE, or the system somewhere).
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
All Gurus:
How to convert ADO Recordset to .txt file by XML or others methods?
thanks in advance!
|
|
|
|
|
Iterate through the Recordset and keep writing into a flat file. You may write it as XML or as CSV.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Hi:
thanks Nish, How Can I convert xml or csv to flat file
|
|
|
|
|
By flat file I meant a file containing records having no structured inter-relationship. Means you can't query them using SQL-like syntax. You'd need to read the records sequentially or using an index.
The advantage with an XML file is that you can use XML parsers like Expat or MSXML parser.
The advantage with a csv file is the ability to convert it into excel. I think MS has ODBC drivers for CSV files.
Regards
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Thanks Nish,By your help, I have solved the problem.
|
|
|
|
|
Hi, I have a question
Ive seen programs where a user has a program open like MSN which has edit controls. Another program that isnt made by the same people as MSN is open and it can be used to fill in edit controls like the text field and send messages etc....
How would I do this?
Thanks
Ashman
|
|
|
|
|
I am not sure I understand you correctly. But if you want to send data across applications you can use WM_COPYDATA
Regards
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
In my project I've got a RichEdit box, with a mapped member variable t_Display. I've created a thread that waits for some input (in this case from a socket) and then tries to add this data to the RichEdit box. I am getting an assert error and I have no idea why. Could anyone help me? The code I'm using is thus:
char msg[MAXMSGLEN];
while (fConnected) {
sock.Recv(msg, MAXMSGLEN);
UpdateData(true);
t_Display.Format("%s%s\r\n", (LPCSTR)t_Display, msg);
UpdateData(false);
}
- X
'Reality is the only obstacle to happiness'
|
|
|
|
|
I assume the UpdateData() call is asserting. You can't pass or access CWnd objects between threads. You'll need to use API-level code to update the edit control from your secondary thread.
--Mike--
http://home.inreach.com/mdunn/
While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate.
your with and
Sonork - 100.10414 AcidHelm
|
|
|
|
|
How can i open a dialog for browsing a directory
( not a file) ???
|
|
|
|
|
Use SHBrowseForFolder() . This article goes into more details.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have a checkbox, and i want to change it's backgorund color. How do i do that?
|
|
|
|
|
This question appears so frequently that IMHO should be included in the FAQ.
Check Yuri Goltsam's article Colored/Blinking Controls and Dialogs with any Font for a particularly elegant solution.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi !
I'm developping a small SDI app with a CRicheditCtrlView.
a few questions :
1. How can I know that the embedded CRichEditCtrl is scrolling ?
I can handle clicks on scroll bars with VK_VSCROLL, handle page up /page down keys ....
Is there a way to detect scrolling without coding a method for each message ?
2. How can I calculate the number of text lines being deisplayed ?
Is there an equivalent for GetFirstVisibleLine() to find the last visible line ? If not, does someone know a method to achieve this ?
Thx
|
|
|
|
|
"1. I can handle clicks on scroll bars with VK_VSCROLL, handle page up /page down keys ....
Is there a way to detect scrolling without coding a method for each message ?"
Override OnHScroll and OnVScroll, these methods are called whenever horizontal or vertical scrolling happens.
"2. How can I calculate the number of text lines being deisplayed ?
Is there an equivalent for GetFirstVisibleLine() to find the last visible line ? If not, does someone know a method to achieve this ?"
I think you have to use GetFirstVisibleLine and then start adding line heights until you get to the window size and declare that your "last visisble line"
Hope this helps,
Bill
|
|
|
|
|
A while back I had been working on a mp3 player/organizer that used the XAudio engine for playback. I haven't touched it in a while and just recently I wanted to pick it back up, but the xaudio web site has been saying that they are down updating their site. I have been watching it for over a month and either they are very slow at updating or it may not be available for good. Does anyone know where I can download the XAudio SDK(I hope) or does anyone recommend a different solution.
Joshua
Sonork ID: 100.9944
ICQ: 519642
Hotmail: JoshuaJGuy@hotmail.com
|
|
|
|
|
If you look up skinnable app, all the code to play an mp3 via DirectSound is on this site.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Hey!
What API functions should I use to set basic local network settings for Win95 / Win98? I want to be able to set the network settings to either DHCP or a specific IP, mask and gateway - in a similar way to the way you set it in the Control Panel.
Thanks!
Oz
|
|
|
|
|
Hi, all. Below is a program i wrote for test. it contains a class named CBase.
#include <stdio.h>
class CBase{
public:
virtual void VFunction()
{
printf("Hello, VFunction.\n");
}
int _a;
};
int main()
{
CBase obj;
int** ppv;
ppv = (int**)&obj;
void (*pFunc)();
// Now i want pFunc to be assigned to the value of **ppv,
// but it can't be like pFunc = **ppv, right?
return 0;
}
so, what can i do for that? Thanks.
|
|
|
|
|
What are you trying to test? The code doesn't make any sense. Once you do ppv = (int**)&obj; , nothing involving ppv will work right because &obj is not of type int** . The cast forces the assignment to compile, but trying to dereference ppv will cause all sorts of havoc.
--Mike--
http://home.inreach.com/mdunn/
While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate.
your with and
Sonork - 100.10414 AcidHelm
|
|
|
|
|
since ppv=(int**)&obj;, ppv point to the begin of obj object, cos' the obj contains a virtual function, it contains a virtual ptr(__vptr), and i'm using vc6, the microsoft complier set the vptr at the begin of the object, so ppv is pointed to the vptr when finishing the assignment.
The memory just like below:
----------
| vptr |
----------
|int _a |
----------
CBase obj;
(each column is 4 bytes)
|
|
|
|
|
I still don't understand what you're trying to test.
--Mike--
http://home.inreach.com/mdunn/
While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate.
your with and
Sonork - 100.10414 AcidHelm
|
|
|
|
|
Michael Dunn wrote:
I still don't understand what you're trying to test.
You are not the only one Michael, you are not the only one.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|