Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
R

rakesh_nits

@rakesh_nits
About
Posts
40
Topics
19
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • host Name\domain name change without rebooting
    R rakesh_nits

    Hi All, Is it possible to change the host name or domain name of the system without rebooting it.Thanks in Advnace. Rakesh

    System Admin

  • self starting windows service
    R rakesh_nits

    Hi robert, yes, i checked and it was starting perfectly.after being installed with installutil.any idea what is causing the problem.thanks in Advance. Rakesh

    C# data-structures debugging question

  • self starting windows service
    R rakesh_nits

    hi all, i had created a windows service and added a projectinstaller .then in the afterinstall event i am trying to start it using serviceController it installs succesfully but it is not started and i get the following exception :System.InvalidOperationException: Cannot start service Service1 on computer '.'. ---> System.ComponentModel.Win32Exception: The service cannot be started, either because it is disabled or because it has no enabled devices associated with it --- End of inner exception stack trace --- at System.ServiceProcess.ServiceController.Start(String[] args) at System.ServiceProcess.ServiceController.Start() at TestWindowsService.ProjectInstaller.serviceInstaller1_AfterUninstall(Object sender, InstallEventArgs e) and now if unsinstall it starts it seems afterinstall event is called in both after install and after uninstall.how can i make this service self starting i hadn't added any extra code(except in the afterinstallevent) in the windows service. ServiceController sc = new ServiceController("Service1"); sc.Start(); sc.Close(); i am using the windows service template. thanks in advance. Rakesh

    C# data-structures debugging question

  • about empty directory
    R rakesh_nits

    Hi All, a very simple question , what will be the fastest way to know that whether a directory is empty or not.ofcourse i can use directory or directoryinfo class and can use getfilesystementries or getfilesysteminfos function and thus check whether it is having any children or not.but i am not intrested in the all the children.what i want to know whether it is having any child or not?any suggestions are most welcome.is there any api, which can be used?Thanks in advance. Rakesh

    C# question json

  • ToolBar In Windows Explorer
    R rakesh_nits

    Hi All, I am trying to add toolbar in windows explorer.I am adding two different drop down buttons in the toolbar.In one of these buttons the user should be able to select only one option from the dropdownmenu.in the other the user should be able to select more then one options in the drop down menu.using band object library I am able to display the toolbar , but how to get multiple selection for the second case.also is it possible to display the tick against each selected and black dot against the selected meum item(like the standard buttons in windows toolbar).Any suggestions?Thanks in Advance. Rakesh

    C# tutorial question

  • DLLs - Creating
    R rakesh_nits

    In the project property either use class library or use the class library template while opening a new project.

    C# csharp help question

  • passing a struct
    R rakesh_nits

    try using namespace1(in the second file) in datatype use DrawGraph.data

    C# tutorial

  • passing a struct
    R rakesh_nits

    use the struct name which you have defined not the struct keyword.

    C# tutorial

  • Debug
    R rakesh_nits

    Hi All, Whenever I debug any of my program using F11 it always goes to disassembly window ,which i don't want.can anybody please tell me how to disable this.Thanks in Advance. Rakesh

    C# debugging tutorial

  • Synchronization
    R rakesh_nits

    Hi All, I am having a function which can be called from different independent threads simultaneously.Inside this i am having a hashtable.what each thread will do that it will check whether the hashtable contains a particular key if not then it will make an entry in the hashtable with that key or if it exists it will simply use the value corresponding to that particular key.what i want that the access to the function should be on first come first serve basis.so if a thread is already waiting on the function the current thread after completing processing should leave it (should enter in succession only if there is not any waiting thread), and no thread should be kept waiting for infinite.so entry into the function should be related to time of waiting in short i want the impementation to be a queue like.is using lock(object) will be suffice for the task or i have to use something else. and also if you can tell me how this lock statement functions.whether it will cause the other statement to wait or simply not allow the other threads to access it and throw some error.Thanks in Advance. Rakesh

    C# data-structures help

  • Closing Window
    R rakesh_nits

    Hi Joe, Thanks a lot.Finally i am able to do it using EndTask.Actually previously i was sending the third parameter fForce to true which kills the explorer instead of the task.But sending it as false closes the window.Thanks for all your help. Rakesh

    C# question

  • Closing Window
    R rakesh_nits

    Hi Joe, thanks for the link.I have got the handle using enumWindows.but even after that i am not able to close it. i tried SendMessage , CloseWindow(according to documentation it only minimizes the window),DestroyWindow,EndTask and some more but even after all this i am not able to close the window.although i can kill the process (windows explorer in this case) by using TerminateProcess, but I just want to close the window.the windowhandle i valid as i am able to get the text of all windows using GetWindowText but while trying to close the window I am getting different errors.Again thanks for the marvellous link. Rakesh

    C# question

  • Closing Window
    R rakesh_nits

    Hi Joe, May be i replied too early.even in this case if i make the current thread sleep for some time again i get the same error that the process has been exited.actually what i want basically to open a window and close it after some time but the process.kill works only if i give it just after process.start or when the sleep time is so that the window does not show at all.Thanks in Advance. Rakesh

    C# question

  • Closing Window
    R rakesh_nits

    Hi Joe, Yes I am able to see the window.and also i am able to get the process handle.but not able to close the window either using process.kill or sendmessage.when i set createnowindow to false ,I am able to use pocess.kill successfully.now it's working.Thanks a lot. Rakesh

    C# question

  • Closing Window
    R rakesh_nits

    Hi Joe, My mistake that I hadn't specified the process name "explorer.exe" in the process.now I am able to get the handle but process.kill gives the error that the process is already exited.and closeHandle does not do anything.using getlasterror i am getting the following error. ERROR_MOD_NOT_FOUND 126 The specified module could not be found. here is the code static int WM_CLOSE = 0x0010; string path = @"C:\Documents and Settings\rakesh\Desktop\A" pr.StartInfo.CreateNoWindow = true; pr.StartInfo.Verb = "Open"; pr.StartInfo.FileName = "explorer.exe"; pr.StartInfo.Arguments = path; pr.Start(); //pr.Kill();//gives the error the process has already exited iptr = pr.Handle; SendMessage(iptr,(uint)WM_CLOSE,0,0); int errorCode = Marshal.GetLastWin32Error(); Console.WriteLine("errorCode::"+errorCode.ToString());//gives errorcode 126 ************************************** Any help will be greatly appreciated.Thanks in Advance. Rakesh

    C# question

  • Closing Window
    R rakesh_nits

    Hi Joe, Thanks for your reply.both Process.kill and SendMessage are throwing the same error. System.InvalidOperationException: No process is associated with this object. I tried with both UseShellExecute equal to true and false.In sendMessage case the error is coming while I am trying to use the Handle property.So the error is not coming in calling the sendMessage method but in getting the handle.Any Suggestions.I also tries using the startverb both as "Open" and "kill" but the result was same.Thanks in Advance. Rakesh

    C# question

  • Closing Window
    R rakesh_nits

    Hi Joe, Thanks for your reply.I have opened the directory using Process Class of .Net framework.And it is being opened in explorer.Any suggestions how i can achieve this.Thanks in Advance. Rakesh

    C# question

  • Closing Window
    R rakesh_nits

    Hi All, I want to close a directory which is being opened.what i have is only the path of the directory.How can i emulate clicking the close button on this window programmatically.Thanks in Advance. Rakesh

    C# question

  • Finding the changed subkey under a particular registrykey
    R rakesh_nits

    Hi All, I want to watch a particular registry key and whenever any sub key under this key changes i am trying to get the name of that subkey.for getting when a particular key is changed I can use RegNotifyChangeKeyValue but this only tells me that the key has been changed it didn't tell which subkey has been changed under the key which i am watching.One way will be i can compare the registry tree befor and after the changes which will be a very clumsy and tedious solution.Any suggestions how to do this?Any help will be greatly appreciated.Thanks in Advance. Rakesh

    C# windows-admin data-structures help tutorial question

  • Folder View
    R rakesh_nits

    Hi Dave, Thanks for your reply.Actually using the IShellFolder and IShellFolder2 interface was the first thing which i had tried.but i didn't have any success with them then i tried to get it through registry.Basically i want to know the sort order for a particular folder view if there is any.Hopefully by using IShellView or IShellFolder2 i can get some useful information.This is the code which i had tried. IntPtr newPidl = IntPtr.Zero ; IShellFolder ishFolder = null; IntPtr ppvOut = IntPtr.Zero; string path = @"C:\Documents and Settings\Administrator\Desktop\A"; if(Interop.SHGetDesktopFolder(ref ishFolder)==0) { // we have it: int cParsed = 0; int afItem = 0; ishFolder.ParseDisplayName( IntPtr.Zero, IntPtr.Zero, path, out cParsed, out newPidl, out afItem); IntPtr handle = IntPtr.Zero; WIN32_FIND_DATA data = new WIN32_FIND_DATA(); handle = Class2.FindFirstFile(path,out data); //here i am getting the error ishFolder.CreateViewObject(handle,ref IID_IShellFolder2,out ppvOut); ****************************************************** but i was not able to get any folder even IShellFolder interface itself from the CreateViewObject function.This is The error i got:: System.InvalidCastException: No such interface supported at TestApplication.IShellFolder.CreateViewObject(IntPtr hwndOwner, Guid& riid, IntPtr& ppvOut) How can i get IshellFolder2 or IShellView interface for any folder.what i am doing wrong here? Also thanks for the .ini link but i don't think it is going to solve my problem.Any ideas will be greatly appreciated.Thanks in Advance. Rakesh

    C#
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups