|
Thanks for your reply
But i don't want to set Cursor, i want to get it.
i.e. Whenever the Cursor changes from one type to another then my application should come to know that now cursor is changed and with which type.
Is this possible?
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
I think the handle to system cursor return from LoadCursor(IDC_WAIT/...) return the unique same value everytime for the same cursor.
u can compare the handle to the handle returned from GetCursor.
and also i think u can compare that at WM_SETCURSOR notification.
but why u need to know the state of app from the cursor, normally u will be setting the cursor for ur application, then u are able to know the current cursor without quering from the cursor.
|
|
|
|
|
No this is not the case.
I am developing application for screen sharing.
In that i want to pass the type of mouse cursor just like (HAND, HELP, WAIT,...)
I can also get the HCURSOR handle and by comparing it with inbuilt type i am getting cursor, but problem is with application that uses custom cursors like flash uses.
So is there any other alternative then this one?
CURSORINFO cInfo;<br />
cInfo.cbSize = sizeof(cInfo);<br />
if(cInfo.hCursor == LoadCursor(NULL, IDC_HAND))<br />
{<br />
}
This works fine when cursor is of system type
Now it will broken when i use it with flash because flash uses custom cursor so cInfo.hCursor will give some long values.
Now i think you should understand my problem.
If is there a way to know the type of cursor just like this is a cursor of type hand
Thanks for your kind reply
please help me on this.
Thanks
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
I would like to know why u need the type of cursor,
if u want to use the same cursor on different process, use the handle, it is shareable among process [^], to use on different machine u can pass the image of cursor (for once).
if u want to identify the type of cursor and there by determine the state of application, it is upto the application, for instance i can use WAIT cursor to indicate the purpose HAND.
|
|
|
|
|
Is there any Event fire when mouse cursor change?
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
|
what about adding the exe as resource.
|
|
|
|
|
ya excatly, do u know any thread in codeguru????
|
|
|
|
|
u can search for it,
but actually it is very easy,
1. add the exe as custom resource
2. load the resource LoadResource()
3. Get the buffer pointer to the resource using LockResource().
4. Then save the data to a file.
if u refer the api u will get the example code.
|
|
|
|
|
|
swarup wrote: got it, i think i was being a bit lazy. sorry for that....
so developer forums making programmers lazy.
modified on Thursday, February 21, 2008 2:45 AM
|
|
|
|
|
swarup wrote: any thread in codeguru
Try looking at the top of the web page. You see the logo of an alien? What do the words next to it say? In big letters?
If you want to know about threads on codeguru, then you might be better *asking* on codeguru.
I'm pretty sure there are articles all about embedding and extracting abritrary resources in executables here on codeproject but apparently you are not interested in them...
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
thanks, i looked for it, did nt get, thts why the request, if u cant do by urself thn only u ask for help,ppl dont simply ask for help.........
|
|
|
|
|
I have no problem with people asking for help - what you're trying to do is not easy. I helped someone with a very similar problem last week, so please look back a few days for my name in a chain conversation.
It just amused me that you were posting on codeproject asking about threads on a different website!
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
Hi Experts,
I am filling a file content with Zero and renamed it and Delete it.
but when I rename the file and try to delete it, file file's lost contents are come back.
If I do not Rename the file everything is fine.
Its like
1.Fill content with Zero
2. szString=RenameFile(szString)
3. DeleteFile(szString);
But I put a Sleep(2000) in between 2 and 3 It works well but get slow.
Is there any workaround?
Thank You.
|
|
|
|
|
pther wrote: Fill content with Zero
You have to close the file handle first!
pther wrote: 2. szString=RenameFile(szString)
3. DeleteFile(szString);
CopyFile("Src.txt", "Dest.txt", FALSE);
DeleteFile("Src.txt");
Or
rename("Src.txt", "Dest.txt");
Maxwell Chen
|
|
|
|
|
Same I used in RenNameFile();
rename(szSourceFilePath,szNewFilePath);
|
|
|
|
|
pther wrote: Same I used in RenNameFile();
rename(szSourceFilePath,szNewFilePath);
The file might be locked.
Maxwell Chen
|
|
|
|
|
CopyFile() create another copy of that file. I do not want to create any other copy of this file.
Actuelly we want to delete the actual file not Copied file.
|
|
|
|
|
pther wrote: CopyFile() create another copy of that file. I do not want to create any other copy of this file.
It was one of the approaches to do the renaming task. Or you may try:
MoveFile("oldname", "newname");
Maxwell Chen
|
|
|
|
|
Hello,
Can you please help me understand CreateProcess() function.
I am new to this concept.
Syntax of CreateProcess() is: -
BOOL CreateProcess(
PCTSTR pszApplicationName,
PTSTR pszCommandLine,
PSECURITY_ATTRIBUTES psaProcess,
PSECURITY_ATTRIBUTES psaThread,
BOOL bInheritHandles,
DWORD fdwCreate,
PVOID pvEnvironment,
PCTSTR pszCurDir,
PSTARTUPINFO psiStartInfo,
PPROCESS_INFORMATION ppiProcInfo);
My Code snippet is: -
STARTUPINFO si = { sizeof(si) };
PROCESS_INFORMATION pi;
TCHAR szPath[] = TEXT("C:\\Documents and Settings\\abhishekc\\Desktop\\code.txt");
bool bIsProcessCreated = CreateProcess(TEXT("c:\\windows\\SYSTEM32\\notepad.exe"),szPath,NULL, NULL,FALSE, 0,
NULL, NULL, &si, &pi);
Output: -
A new Notepad file opens and dialog pop-up "The System cannot find the specified path".
====================================================================================
All the path provided are true.
CreateProcess() returns true.
I am confused among two parameters of CreateProcess() viz: PCTSTR pszApplicationName,
PTSTR pszCommandLine.
Thanks in advance.
|
|
|
|
|
Do it this way:
BOOL b = CreateProcess(
NULL,
_T("notepad.exe C:\\Documents and Settings\\abhishekc\\Desktop\\code.txt"),
NULL,
...
);
Maxwell Chen
|
|
|
|
|
|
and as a side note: whenever there is white space in the parameters to CreateProcess, make it as single parameter by adding quote to the string.
otherwise there is chance to interpret as multiple parameters
TCHAR szPath[] = TEXT("C:\\Documents and Settings\\abhishekc\\Desktop\\code.txt");
can be changed to the following, to be in safer side.
TCHAR szPath[] = TEXT("\"C:\\Documents and Settings\\abhishekc\\Desktop\\code.txt\"");
ps: i am sure this is not the problem.
|
|
|
|
|
can i embed vlc player to my application. its a dialog based application. there is activex control available for it.
|
|
|
|