|
I suggest not to try that kinda application. I have seen that kinda application (e.g. FolderLocker and etc) on the net.. There are always some ways to hack.. and not so difficult to hack too.. Last two years, one of my friend is using that kinda of software (I think it called FolderLocker or something) to protect his file.. What this software does is that convert the folderid of his folder in registry (so, someone click on his folder then it will take you to recyclebin or network place or etc).. And it hide his folder as hidden system files.. that's all.. so, you can probably find how to unhide his folder and change it back to normal folder.. it's too easy.. I didn't see any software that does more advantages than those two steps..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
Hello Shaz,
First, think of possible ways to do the task, e.g if i be doing it, i will be having a console program, running at the system-startup, with no interface, i.e. hiding the window itself. Naming it very similar to some very known process. So nobody may come to know it is something unusual running in the task manager. In that i would be checking if the user tries to access the folder. Whenever it does, i.e. catch the event, and pop-up the window for asking password. Putting in all the functionality to it. And for managing it, i.e. adding folders/files to secure, i would be having another application.
Just the thought!
Regards,
Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
I am generating dynamic tables from the C#.Net CodeBehind page and I need to set the alignment for that table.
How can i achieve?
Regards,
Jai Shankar
|
|
|
|
|
Hi,
u can set as per below code.
Table tbl = new Table();
tbl.HorizontalAlign = HorizontalAlign.Center;
Thanks,
Sun Rays
|
|
|
|
|
I am creating dynamic tables from the C#.Net CodeBehind page and I need to set the alignment for that table.
How can i achieve?
Regards,
Jai Shankar
|
|
|
|
|
|
Hi,
I am creating a windows application that has a custom treeview/listview windows explorer.
How can I select the corresponding TreeNode of a selected ListView directory?
|
|
|
|
|
This is easy, the property SelectedNode (TreeView) can not only be read but also be written...
treeView1.SelectedNode = treeView1.Nodes[213];
//treeView1.Focus();
|
|
|
|
|
Hi,
I can follow that....but treeView1.Nodes[213] does not belong to the Selected ListView Item.
how can I find the Node that belongs to this ListView Item?
(ProjectTreeView.SelectedNode.FullPath + "\\" + ProjectListView.SelectedItems[0].Text);
|
|
|
|
|
I am creating dynamic tables from the C#.Net CodeBehind page and I need to set the alignment for that table.
How can i achieve?
Regards,
Jai Shankar
|
|
|
|
|
|
Hello *,
I would like to ask on the showing windows.
I am creating toolbar were will be two buttons which will shown gvim and notepad.
C# code is following:
[DllImport("User32")]
private static extern int ShowWindow(int hwnd, int nCmdShow);
private void btnGvim_Click(object sender, EventArgs e)
{
Process[] newProcesses = Process.GetProcesses();
foreach (Process newProcess in newProcesses)
{
if (newProcess.ProcessName.Equals("gvim"))
{
int number1 = (int)newProcess.MainWindowHandle;
ShowWindow(number1, SW_TEST);
}
}
}
private void btnNotepad_Click(object sender, EventArgs e)
{
Process[] newProcesses = Process.GetProcesses();
foreach (Process newProcess in newProcesses)
{
if (newProcess.ProcessName.Equals("notepad"))
{
int number1 = (int)newProcess.MainWindowHandle;
ShowWindow(number1, SW_TEST);
}
}
}
What should be inserted in value SW_TEST?
I would like to simulate behavior of ALT+TAB.
Thanks for your hints.
regards
Petr
|
|
|
|
|
|
Hello,
Here are the three main constants for this Method (you will also find them in the excellent link from Giorgi Dalakishvili, Thanks for that!)
private const int SW_SHOWNORMAL = 1;
private const int SW_SHOWMINIMIZED = 2;
private const int SW_SHOWMAXIMIZED = 3;
Apart from that,
You should use the GetProcessByName method of the Process class instead of iterating over all processes,
and do a
if(newProcess.MainWindowHandle!=IntPtr.Zero)
before pathing the Handle to the method!
And also dispose the returned processes!
Hope it helps!
All the best,
Martin
|
|
|
|
|
What do you mean with the sentence
<br />
And also dispose the returned processes!<br />
What shall I do?
|
|
|
|
|
Hello,
foreach (Process newProcess in newProcesses)<br />
{<br />
newProcess.Dispose();
}
All the best,
Martin
|
|
|
|
|
I rewrote action on the button to this:
Notepad button has the same functionality.
<br />
private void btnGvim_Click(object sender, EventArgs e)<br />
{<br />
Process[] p = Process.GetProcessesByName("gvim");<br />
int number1 = (int)p[0].MainWindowHandle;<br />
if (p[0].MainWindowHandle != IntPtr.Zero)<br />
{<br />
ShowWindow(number1, SW_SHOWNORMAL);<br />
}<br />
p = Process.GetProcessesByName("notepad");<br />
number1 = (int)p[0].MainWindowHandle;<br />
if (p[0].MainWindowHandle != IntPtr.Zero)<br />
{<br />
ShowWindow(number1, SW_SHOWMINIMIZED);<br />
}<br />
}<br />
Unfortunatelly it is not the same or similar behavior as ALT+TAB.
Do you know where I have been made mistake?
regards
Petr
|
|
|
|
|
Hello,
I would do something like this:
private void btnGvim_Click(object sender, EventArgs e)
{
Process[] allProcesses= Process.GetProcessesByName("gvim");
if(allProcesses.Length>0)
{
if (allProcesses[0].MainWindowHandle != IntPtr.Zero)
{
ShowWindow(allProcesses[0].MainWindowHandle, SW_SHOWNORMAL);
}
}
DisposeProcesses(allProcesses);
allProcesses= Process.GetProcessesByName("notepad");
if(allProcesses.Length>0)
{
if (allProcesses[0].MainWindowHandle != IntPtr.Zero)
{
ShowWindow(allProcesses[0].MainWindowHandle, SW_SHOWMINIMIZED);
}
}
DisposeProcesses(allProcesses);
}
public static void DisposeProcesses(Process[] processes)
{
if(processes!=null)
{
if(processes.Length>0)
{
foreach(Process p in processes)
{
p.Dispose();
}
}
}
}
If you later want to get the actual status of a process, look at the "IsIconic" method.
[System.Runtime.InteropServices.DllImport("user32.dll")]
[return: System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.Bool)]
private static extern bool IsIconic(IntPtr hWnd);
All the best,
Martin
|
|
|
|
|
|
Hello Giorgi,
thanks for the additional information!
All the best,
Martin
|
|
|
|
|
You are welcome
|
|
|
|
|
public delegate int AddDelegate(int a, int b);
Private int AddMe(int a, int b);
AddDelegate add = new Add(AddMe);
Now I can call the AddMe() method by just doing
add(1, 2);
shouldn't i simply call the
AddMe(1,2);
what's the need to use the delegate.
i thnk it is merely a incease in line of code.
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
I guess that's because you didn't bother to read the explanation you got the other times you asked this, nor did you bother to google it. Like many constructs, you can write useless delegate code, and there are times when you can't get by without delegates.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
?????
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|