|
one more thought in the morning: once i used an application called Active Desktop Calendar. and it was displaying its calendar/todo/etc also on the locked screen.
soo that means, if this application is able to access the Winlogon desktop, why should i not be able?
regards
|
|
|
|
|
Does this[^] help?
Regards,
Sandip.
|
|
|
|
|
still i didn't had time to try anything new, but i let you know.
regards
|
|
|
|
|
I'm trying to get into SDK but I can't seem to find any tutorials for beginners, display a basic window, processing Windows Messages and such.
On MSDN there are sites with supposedly SDK and Windows UI samples, but they don't have any content.
I'd appreciate if you could link me to some beginner's SDK tutorials.
Also I'm not sure if I already have it or not, I installed Visual C++ Express 2008, does that already include SDK or do I need to install it separately?
Thanks.
|
|
|
|
|
Are you talking about Windows SDK, formerly known as Platform SDK? If yes then you have to install it separately and it comes with good documentation which can be integrated with MSDN.
-Saurabh
|
|
|
|
|
Warning : The code is not very good but it's a beginning...
Win32 SDK Tuto -> http://www.relisoft.com/Win32/winnie.html
A++
...
|
|
|
|
|
|
Thanks.
I'll give it a try.
I just need a few basics so I guess I can make do with that tutorial and the documentation.
|
|
|
|
|
Hi,
My application create a directory using CreateDirectory(). Then I want to lock this directory so that it can't be accessed by any other process. For that I call CreateFile() (Openning that directory and getting its handle) and doing so lock the directory and it is now not accessible to any other process. Then I create some file in this directory. The problem is that when I try to get the status of a file in that directory, I get the error code that file does not exist. When I try to rename a file in that directory, I get the error code that file is being used by some other process. but I can delete file without any problem. I could not understand that if the directory is locked by same process why calls to Windows APIs to get the status or renaming the <file in="" that="" directory=""> are failing. On the other side file could be deleted. Plz have a look at my code and if you can tell something that calls to those APIs don't fail, let me know plz. Or if this problem can't be resolved, can you give me any other idea by which I can lock the directory so that only current process is able to Create/Read/Write/Delete/GettingFileStatus files in that directory. The code is as below:
/* ----------------- Code is here -----------------*/
CreateDirectory("C:\\MyDir", NULL);
// Calling below function lock the folder and other processes can't access "C:\\MyDir"
HANDLE handleDirectory = CreateFile("C:\\MyDir",
GENERIC_ALL,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS, NULL);
// File is created successfully by calling below function
HANDLE handleFile = CreateFile("C:\\MyDir\\MyFile",
GENERIC_ALL,
FILE_SHARE_READ,
NULL,
OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
NULL
);
CloseHandle(handleFile); // Closing file handle
// Getting file status
STATINFO statinfo;
int result;
result = stat("C:\\MyDir\\MyFile", &statinfo); //This call fails
// error code can be seen in c-runtime library's global variable "errno".
// Renaming also fails
result = rename("C:\\MyDir\\MyFile", "C:\\MyDir\\YourFile");
// error code can be seen in C-RunTime Library's global variable "errno".
// File deletion succeeds
result = remove("C:\\MyDir\\MyFile");
// error code can be seen in c-runtime library's global variable "errno".
/* ----------------- End of the code -----------------*/
Please tell me something that after locking the folder:
1 Directory is accessible to current process only.
2 Current process can get the status of a file in that directory.
3 Current process can Create/Read/write/Rename/delete a file in that directory
4 Or any other way of doing the same
Thanks in advance
Best Regards
Aseem Sharma
modified on Wednesday, November 5, 2008 10:18 PM
|
|
|
|
|
|
Hi Thanks for replying. I have edited my message. Kindly re-look code segment. Its not only stat() but rename() is also failing. I am wondering that folder is locked by same process. Then why we can't rename or get status of file in that folder. I tried to use GetFileAttributesEx(), it works but rename is not. Please help me in this regard. Thanks in advance.
|
|
|
|
|
Aseem Sharma wrote: I tried to use GetFileAttributesEx(), it works but rename is not. Please help me in this regard.
If using GetFileAttributeEx worked then please pay attention to what you are doing. GetFileAttributeEx is a Windows SDK function NOT a C library function as stat() is. Think about what you are doing and realize that you likely want to attempt to use the Windows SDK function for renaming files rather than the C library function.
led mike
|
|
|
|
|
I did try to use the below code segment to rename, but even this fails too.
SHFILEOPSTRUCT objSHFILEOPSTRUCT;
memset(&objSHFILEOPSTRUCT, 0, sizeof(objSHFILEOPSTRUCT));
objSHFILEOPSTRUCT.wFunc = FO_RENAME;
objSHFILEOPSTRUCT.pFrom = "C:\\MyDir\\MyFile";
objSHFILEOPSTRUCT.pTo = "C:\\MyDir\\YourFile";
objSHFILEOPSTRUCT.fFlags = FOF_NOCONFIRMATION|FOF_SILENT;
int eeeeee = SHFileOperation(&objSHFILEOPSTRUCT);
I think, if we get handle of a folder, it put some restrictions on content inside it. I could not move/copy files inside that folder.
|
|
|
|
|
can anyone helps me?.....
the problem like this:
a function in a MFC regular DLL USING SHARED LINKE:
void CDataBak::OnBrownse()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
char szFilter[] = "Bitmap(*.BMP)|*.BMP||";
CFileDialog dlg(TRUE,NULL,NULL,OFN_HIDEREADONLY,szFilter);
dlg.DoModal();
}
but the FileDialog does not display ..and causes the main application which links the dll exception.
Base on the MSDN ,I have called the AFX_MANAGE_STATE(AfxGetStaticModuleState()) at the beginning
of the function ...but it does not work ....
can anyone helps me ?......
I am waiting online......................
|
|
|
|
|
What is "a MFC EXT DLL"?
What's the exception? On what line of code does it occur?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
sorry...it is a regular DLL using shared MFC DLL...
when I call the function DoModal() ,the dialog does not display,and the exception happens!
and the main application which links the DLL will break down immediately.
that is...
|
|
|
|
|
Without seeing the code that's throwing the exception, it's really hard to guess
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
the problem is that the application itself has not any exception code returns to me too..when I call the DoModal() funtion,the application will look like a dead loop,you can not do anything at all...that's the problem
but thanks Mark Salsbery anyway.you are a good man..
can I make friend with you?
here is my e-mail:wuguangjian@gmail.com
I am eager for your reply.
Never Change My Goal!
|
|
|
|
|
Hi,
How to initialise a 3D array through a function?
Regards,
KDevloper
|
|
|
|
|
int a [2][2][2] = { { {0,0}, {0,0} }, { {0,0}, {0,0} } );
or...
int a [9][7][5];
initialise (a,9,7,5);
...
void initialise (int ***a, int n1, int n2, int n3)
{
int i,j,k;
for (i = 0; i < n1; i++)
{
for (j = 0; j < n2; j++)
{
for (k = 0; k < n2; k++)
{
a [n1][n2][n3] = 97;
}
}
}
}
Tada!
Note I initialise to 97. You hopefuly know more about what you want to do than I do, and can do things better. If not, go back to bed - you'll achieve more.
Iain.
|
|
|
|
|
|
Nah...
Iain Clarke wrote: for (k = 0; k < n2; k++)
should be
for (k = 0; k < n3; k++)
Iain Clarke wrote: a [n1][n2][n3] = 97;
should be
a [i][j][k] = 97;
Did you disable the error checking feature of your mental compiler?
Please don't blame me, remeber: "this is going on my arrogant..."
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi CPallini,
I have not disabled my mental compiler, i understood, thats a typo error.So i corrected it from my side, without mentioning it..
Thanks & Regards,
KDevloper
|
|
|
|
|
Beacause you're a fair, kind man. On the other hand, I've arrogant assumptions...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hah.. 
|
|
|
|