Answer Questions
Michelle A. Shell Context menu (aka Win Explorer context menu) in my app?.. how?
Hi all.. I have for a time now tried to take advantage of some of the implementations the Shell32 api can offer regards to file management, mainly i have been successful. The one thing i have not been able to do is implement the explorer context menu in my applications. I want to be able to get the same context menu Windowns explorer shows, with all the addins that may include (eg. winrar-addin, sendto, openwith and so forth) in my application. I have found code for this in both C++ and som e VB like apps, but nothing in C#. I would be extreamly glad if someone who knows how to do this could post a small app where this is done or perhaps post a link to a site where this information can be found!! If its still unclear what i mean: ...Show All
xpyrofuryx Where are the messages going to?
hi everybody I've already successfully implemented a globally low level keyboard and mouse hook and it seems that this is all .net managed code could provide in global hooking. But after I got the message by the hook, where is this keyboard or mouse message going to the parameters and structures of hook event don't contain that information. any idea thanks in advance I'm writing program to redirect keys and hotkeys of a specific application. So after I get the keyboard messages I would like to know if the targeted application will receive them. If so, I can do something in the hook. All messages go to a window, whether posted or sent. You don't get a window handle because there's really nothing you can do with it. W ...Show All
flreStarter event questions
how can i start an event from other event or other function also how can i cancel the events or stoping it from operation i mean if i'm already creating a timer event and now i'm in a bottun click event , how can i start the timer event from my button event then cancel the timer event from other event or other function do u want raise an event inside an event hadler if so I dont think it is possible unless the event is defined in your code. If you know the method which raises the event(Invokes the corresponding delegate) and the method is public you make call the method and make event is raised along with the function execution. Ahmed, You can simplye add event handler to the event you want ...Show All
joginaidu How to automatically close the parent form when the child closes.
Hi, I have an application that uses 3 forms. Form1 contains 2 buttons - A and B. If you click Button A, then Form2 loads and Form1 is hidden. If you click Button B, then Form3 loads and Form1 is hidden. What I need to be able to do, is once Form2 has been completed by the user and then closes (by the user clicking the Finish button), for Form1 to close automatically, rather than unhiding the form and then the user having to click the button... I've searched quite a lot on how to do this, but can't find an answer. Either I'm searching for the wrong thing, or .... Could anyone provide any hints on how to do this Thanks. Hi, see if the following code will help you (put all of the code in your Form1's co ...Show All
lavorando Playsound loop not working
I need to play a .wav file over and over again. I am using the following code. [DllImport("winmm.dll")] private static extern bool PlaySound( string lpszName, int hModule, int dwFlags ); public int SND_ASYNC = 0x0001; public int SND_LOOP = 0x0008; PlaySound( wavfile, 0, (SND_ASYNC | SND_LOOP)); But it plays only once and stop. Any idea what's wrong Thanks in advance. This works in VB so it should go: Add - public int SND_NODEFAULT = 0x0002; SND_LOOP || SND_ASYNC || SND_NODEFAULT why dont you use the .NET 2.0 SoundPlayer class in the System.Media namespace It has a method called PlayLooping ...Show All
tattoo ContectSwitchDeadlock error
I tried running my app today and it came up with a strange error message : No symbols are loaded for any callstack frame. The source code cannot be displayed." When I click OK on the message box I get the following : ContectSwitchDeadlock was detected. The CLR has been unable to transition from COM context 0x1b1c78 to COM context 0x1b1de8 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid ...Show All
akram badr static method - Is there any workaround?
I think most know we cannot declare a static anything in an interface. However, let's say I have this: public sealed class MyClass { private MyClass(string someText) { m_someModifiedText = someText; } private readonly static m_someModifiedText; public static MyClass Create( string someText ) { string modifiedText= ModifyText(someText); return new MyClass(someText); } private string ModifyText(string someText) { string modifiedText = someText; //do something to modify text return modifiedText; } public static string UsefulText { return m_someModifiedText; } } Now, this "sample" is just to keep it simple, but PLEASE just consider the concept rather than what the ...Show All
3jg13 A question before I begin...
I have been given the task of redesigning the companys software solutions. Right now the software is running against a progress database on a server, with the software on the same machine. Then you log on to the software (kind of like thin client like) and then use it that way. Would it not be smarter to have 1 server run SQL Server and the install a Client program on each machine that need access to the server Or even different programs according to where and what you are doing I figured it would be a good idea to get this down before I start designing the software. Sune hi, actualy its a good book i didn't say anything about that but i'm lost even though. he explain every thing at the be ...Show All
JDPeckham How to know Is Serializable?
How can I know whether a type(e.g. BindingList<>) is Serializable, both in design time and run time Thanks The type can be serializable in two way Aautomatic by using [Serializable] or manually by implementing ISerializable Interface so to check for a type is it serializable or not there are two ways 1-using reflection (i think it will work for both types of serialization but i do not test it) BindingList <yourType> tee = new BindingList <yourType>(); Type tc = tee.GetType(); if (( tc.Attributes & TypeAttributes .Serializable) != 0 ) { MessageBox .Show( "Serializable" ); } else { MessageBox .Show( "Not Serializable" ); } ...Show All
Kardi Guide on Cross Threading
Anyone have a good guide on cross threading Essentially, I'm trying to access a Windows form control outside of the thread it was created in. Any help would be greatly appreciated. thanks, can you please briefly explain the theroy behind this invokerequired I would really appreciate it. in what way I guess you would do the same thing if you want your main thread (UI) to call/create/show another form rather than from the other (non UI) thread. the code posted/link posted applies generally for anything you do cross threading, however the only thing that changes is just the parameters really and thats it. So instead of taking in a bool value, you can have an int value, ...Show All
grnr_r Build Error MSB3021
Hello Not sure if this is the right forum but... I have been working on a project for a while now and have been able to build both debug and release compiles. Suddenly, I cannot build any thing! I get the following error: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(2313,9) : error MSB3021: Unable to copy file "obj\Debug\MyProj1.dll" to "bin\Debug\MyProj1.dll". Could not find file 'obj\Debug\MyProj1.dll'. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(2313,9) : error MSB3021: Unable to copy file "obj\Debug\MyProj2.exe" to "bin\Debug\MyProj2.exe". Could not find file 'obj\Debug\MyProj2.exe'. C:\WINDOWS\Microsoft.NET\Framework\v2.0.507 ...Show All
Mark Beiley Understanding best use of config files for Web Applications
Hi, Web Applications use the web.config file however they do not seem to allow me to add extra parameters that I need. (Note: The extra parameters do not always relate to the normal items stored in this config file) For example, I would like to add something similar to the following: <myUniqueConfigSettings> <add name="MyUniqueSettings" myUniqueSettingString="blah; blah;"> </myUniqueConfigSettings> Is this possible Or do I have to create my own separate config file for such items and read from that Thanks in advance Andrew The web.config file works just like a normal application configuration file. In order to a ...Show All
raaj_001 windows service running on particular time and debug.write() where it prints ?
Dear All, I have windows service done with C# and able to be install using the installutil.exe. My problem now is that I want to set it like to run on particular time of day for instance 10.00 am daily How can I set this I have tried to use timer but it sets an interval only Another thing is that I have debug.write() in my windows service where can i check the output of the debug.write Where is the file Thanks. Well this is question about windows service lyfecycle :) OnStart is called when service is started from service controller and inside it you should initialize your variables and prepare serivice to be ready (to do ... see bellow ) OnStop - clear all resources OnPause - mark s ...Show All
ManjuVijay Console.Write + Windows Application
Hello I want to do simple logging. I have a Windows Application project with forms. When I add this to my form: Console.Write("some text") nothing happens. I would like to see the text printed in a console or VS 2005. Cheers You can dynamically create and destroy a console window using PInvoke to call the Windows API: [DllImport("kernel32.dll",SetLastError= true )] [ return : MarshalAs( UnmanagedType.Bool )] static extern bool AllocConsole(); [DllImport("kernel32.dll",SetLastError= true )] [ ...Show All
blender DataTable.Select (string) problem
I am trying to use DataTable.Select (string) to filter out rows on two columns: the first column is type string, the second: DateTime. This is how the string looks: string sql = "symbol = #" + ( string )arrL1[ii] + "# AND dateTime = #" + Convert.ToString (dated) + "#"; symbol is a column name of System.String Type and dateTime is a column name with DateTime Type; dated is a variable type DateTime with a specific date and time. I verified its value. It is a valid, non null value. I get this error: The string was not recognized as a valid DateTime Type There is an unknown word starting at index 0. In other words the first character is unacceptable. I tried to remove '#', then I replaced '#' with ...Show All
