|
Does anyone know how to access custom file properties... the properties you see in the "custom" tab in Windows XP when you right click and show file properties?
Just need something to get me pointed in the right direction.
Thank you in advance.
Jerry Holmes
jholmes@verdigre.com
|
|
|
|
|
|
Hello!
I am trying to do some P/Invoke and the native library returns a structure. How must I declare this in C#?
Assume this (only as example):
I defined a structure
[StructLayout(LayoutKind.Sequential)]
public struct ColorWithUUID
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] uuid;
public UInt32 argb;
}
and the native function looks like:
COLORWITHUUID* GetColorWithUUID(DWORD dwIndex);
So the native function creates a COLORWITHUUID object and returns the pointer to it. How would the DllImport in C# for this function look like? How can I convert the pointer to the ColorWithUUID structure?
Many thanks in advance and best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
[DllImport("whatever.dll")]
IntPtr GetColorWithUUID(uint index);
IntPtr structPtr = GetColorWithUUID(index);
ColorWithUUID c = (ColorWithUUID)Marshal.PtrToStructure(structPtr, typeof(ColorWithUUID));
<pre>
-- modified at 14:32 Wednesday 4th January, 2006
|
|
|
|
|
Works like a dream, thank you very much!
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Hello coders,
I am using VS.NET, Application type is SmartDevice. In this form I placed the webBrowser control. I added one context menu with 3 MenuItems.
ContextMenu Implementation code is properly is taken, one more problem with webbrowser is not having
.ContextMenu Property. So I am taken
this.ConctextMenu = this.mycontextmenu1
my Problem is when running this application browser default contextMenu is displaying instead of my context menu.
any ideas??
regards
GV Ramana
-- modified at 13:25 Wednesday 4th January, 2006
|
|
|
|
|
Are you handling the HTMLDocumentEvents2_oncontextmenuEventHandler event?
If so, I believe you need to set eobj.returnValue to false and show your own custom menu.
"Patriotism is the first refuge of a patriot."
|
|
|
|
|
I am not yet get, My application type is SmartDevice Application in VS 2005.
HTMLDocumentEvents2_oncontextmenuEventHandler event is ?????
regards
GV Ramana
|
|
|
|
|
The webBrowser control has an api with includes a document class which allows you to connect to various event handlers. I have not used it in a SmartDevice application, so I don't know what the limitations might be.
This [^] should give you an idea of how it is organized.
"Patriotism is the first refuge of a patriot."
|
|
|
|
|
Hi
I am using server.transfer("webform2.aspx") to open page webform2.aspx and displaying some information on this page.
Is their any way I can open this new page in a seperate browser window ? I dont want to use javascript.
Thanks
|
|
|
|
|
You can't control from the server side where the page is being opened. That is already decided when the request is sent to the server.
There are two ways that you can use to control where the page will be opened, by using target or javascript.
---
b { font-weight: normal; }
|
|
|
|
|
I think I will go ahead with javascript
|
|
|
|
|
Need your help guys, I've been trying to make a program like ProcessGuard and Sanctuary. This product prevents execution of any program that does not appear on the list of software that is allowed to run on a particular machine. I have made some research about it and I found out that you have to go to kernel-mode and hook its API on process creation(CreateProcess). But I failed to utilize the use of kernel32.dll or ntdll.dll. Is there someone here where that could me give some tips where to start, provide the basics of Windows API process hooking in C# or even better provide a working C# source code. Thanks in advance...
bryandel3@yahoo.com
http://www.bryandel.net/
-- modified at 5:48 Thursday 5th January, 2006
|
|
|
|
|
|
I have already read it anyway thanks. Pls I need a guide in C#
|
|
|
|
|
C# is not appropriate for this. It is designed for making user mode applications only.
I have taken a vow of poverty. If you want to really piss me off, send me money.
|
|
|
|
|
But is it possible?
About the money, I'm sorry but I can't send any. I'm still a student.
And I might make this program as my thesis. But still thanks for the offer.
|
|
|
|
|
I dont think it is possible but I could be wrong. If you use c# then you have a dependancy on the Dot Net runtime. I dont beleive that it is currently possible to use this with in kernal mode. I suggest you have a look around the "sys internals" web site
I have taken a vow of poverty. If you want to really piss me off, send me money.
|
|
|
|
|
Hello bryan,
first include in your class the System.Runtime.InteropServices
using System.Runtime.InteropServices;
Then is simple:
[DllImport ("user32.dll")]
public static extern long DestroyWindow (long hWnd);
Now use this site http://custom.programming-in.net/ to find out the dll of your function and then import it!!
If i din't got your question, and i'm completely off, oups sorry, give some more details
Happy new year to all!!
GanDad
|
|
|
|
|
Thank you very much for the link. I really appreciate it.
Details:
"ProcessGuard stops applications from executing without the users consent, stops malicious worms and trojans from being executed silently in the background."
Based on this C++ article "Hooking NtCreateSection() is a much more reasonable thing to do - if we intercept a call to NtCreateSection() with the request of mapping the executable file as an image (SEC_IMAGE attribute), combined with the request of page protection that allows execution, we can be sure that the process is about to be launched. At this point we are able to take a decision, and, in case if we don't want the process to be created, make NtCreateSection() return STATUS_ACCESS_DENIED. Therefore, in order to gain full control over process creation on the target machine, all we have to do is to hook NtCreateSection() on a system-wide basis.'"
NtCreateSection() is from ntdll.dll. I'm trying to import it but I don't know how to use it. I hope you can help me more. Again thanks for the link
|
|
|
|
|
Bryan,
Sorry my knowlege is limited on winAPI but i found just now a site for the proper way of the function parameters, so here it is :
http://undocumented.ntinternals.net/
Under UserMode -->NTDLL-->NTObjects-->Section.
Good luck dude
GanDad
|
|
|
|
|
Thanks for this another great site. This help alot. As my token of appreciation I'll add you to my Acknowledgement Page. This is the only way I can express my gratitude I hope you appreciate it.
|
|
|
|
|
Dear Bryan,
I feel honnored by your post, but what goes around comes around, that is the beuty of software community, lets all share our knowlege.
thank again for your post, Happy coding mate
GanDad
|
|
|
|
|
Hello.
I'd like to know if it is possible to convert from a string with a color name to Color object so that I could write a name of a color and change a datagrid row color to the new one given by the written name.
Thank you.
|
|
|
|
|
static method Color.FromName(string) takes the name of a color and returns the corresponding Color object.
|
|
|
|