Is there a way to make native win32 call?
-
Any win32 call, I mean.
-
Any win32 call, I mean.
Yes - check out the DLLImport attribute from System.Marshal (Don't know the C# syntax I'm afraid but theres a VB example in my "Monitoring the printer in VB.Net" article) '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd
-
Yes - check out the DLLImport attribute from System.Marshal (Don't know the C# syntax I'm afraid but theres a VB example in my "Monitoring the printer in VB.Net" article) '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd
if you want to check out all the win32 API for reference then check the following site, ;) http://www.codeproject.com/system/hooksys.asp http://leb.net/wine/WinDoc/funcIndex-local.html :laugh:
-
if you want to check out all the win32 API for reference then check the following site, ;) http://www.codeproject.com/system/hooksys.asp http://leb.net/wine/WinDoc/funcIndex-local.html :laugh:
Michel, here's an example for you. You can group the import specs as shown here, or interspersed through your code... class Win32 { [DllImport("kernel32.dll")] public static extern bool Beep(int freq, int duration); [DllImport("kernel32.dll")] public static extern void SleepEx(int imeinms, int alert); [DllImport("kernel32.dll")] public static extern int WinExec(string pgmname, int hideorshow); [DllImport("kernel32.dll")] public static extern void ExitProcess(uint exitCode); [DllImport("winmm.dll")] public static extern bool PlaySound(string pszSound, int hmod, uint fdwSound); [DllImport("kernel32.dll")] public static extern uint GetCurrentProcess(); [DllImport("kernel32.dll")] public static extern bool TerminateProcess(uint hndl, uint exitcode); } call the functions from your code (say the Beep function) as: Win32.Beep(freq,duration); Hope this helps. Spolia Opima
-
Michel, here's an example for you. You can group the import specs as shown here, or interspersed through your code... class Win32 { [DllImport("kernel32.dll")] public static extern bool Beep(int freq, int duration); [DllImport("kernel32.dll")] public static extern void SleepEx(int imeinms, int alert); [DllImport("kernel32.dll")] public static extern int WinExec(string pgmname, int hideorshow); [DllImport("kernel32.dll")] public static extern void ExitProcess(uint exitCode); [DllImport("winmm.dll")] public static extern bool PlaySound(string pszSound, int hmod, uint fdwSound); [DllImport("kernel32.dll")] public static extern uint GetCurrentProcess(); [DllImport("kernel32.dll")] public static extern bool TerminateProcess(uint hndl, uint exitcode); } call the functions from your code (say the Beep function) as: Win32.Beep(freq,duration); Hope this helps. Spolia Opima
Tx exactly what I was looking for.