Possibility of this application? (basic level coding skill and information)
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12

Thread: Possibility of this application? (basic level coding skill and information)

  1. #1
    Join Date
    Dec 2012
    Posts
    6

    Possibility of this application? (basic level coding skill and information)

    First of all I apologize if this is in the wrong section. Not sure. If it is I will delete and restart in the corrected section.

    So I am trying to figure out if a desktop application is possible or not. The last I used C++ for coding was back in school 2 almost 3 years ago (Now I work 9-5 at a paper shuffling desk job >.<) . I only have basic programming idea and pretty much from pointers etc onwards i am knowledge-less.

    I am thinking if it is possible to some how keep track on the running tasks or processes? And if the application can create a thread for them. So when the application is running say for example there are 5 running tasks then the app should create 5 instances or threads for them. If one closes then go down to 4 and if a new one opens go back to 5. If a previously closed thread is restarted then open the same instance for that task or process again? Basically for every running task on the machine have a thread/instance created and running which is retrievable if the application is restarted (maybe even after a complete machine reboot).

    Of course i am not asking for the code here. Just a general idea for coding direction on how to maybe go about making something like this efficiently. I looked in Process Walking section at MSDN. Processtool32 api etc. Or maybe a way to create a thread/instance using the mouse click. So if a mouse clicks on a window that will be a running task (something from linux i guess as the Top running process) and an instance for that is created in the application.

    So what do you think would be a good way to go about creating this or making it function? If of course I figure my ability to create this is beyond my scope of learning and execution then I might as well give up. :P

    Let me know and thanks in advance for your ideas guys!

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,090

    Re: Possibility of this application? (basic level coding skill and information)

    Maybe it's just me, but I have no idea what you're asking.

  3. #3
    Join Date
    Dec 2012
    Posts
    6

    Re: Possibility of this application? (basic level coding skill and information)

    Haha sorry about that. Let me try to re-explain and hopefully I am able to clear the picture up (excuse my lack of coding lingo or mixing up of it).

    So my program will basically track a list of running processes. And mostly user processes or applications like IE, outlook, chrome, anything that is an exe that the user runs on the desktop. The program lists these processes and creates instances for them. Those instances can then be anything that I can work with to input/output data. They will not directly work for the processes running but just be instances created under the name of the process. Kinda like a tabbed browsing experience: I open youtube the browser opens a tab for it. What ever I do in the tab remains there and i can run multiple tabs Once I close the tab and reopen it the data that I inputed there remains stored in the memory for that particular tab.

    Does that help? I hope so or i can maybe upload some pictures if this doesnt. LEt me know and thanks for your attention.

  4. #4
    Join Date
    Feb 2011
    Location
    United States
    Posts
    1,006

    Re: Possibility of this application? (basic level coding skill and information)

    Pretty much sounds like you want to hibernate a process (instead of a whole computer). To some extent this has been done, see this project (link) and these discussions (here, here and here). Alternatively, you might be able to virtualize these with a tool like VirtualBox, which will allow you to suspend to disk (but I'm not sure about your exact application).

    Hope that helps some.
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  5. #5
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: Possibility of this application? (basic level coding skill and information)

    Hi grapeseed87..

    Please do not repost the same thing over and over, even if it does not appear on the forum immediately.. Because your a new member, certain trigger words in your post put's it into the Moderation Que.. and only once the post is approved by a moderator will it be visible to the public...

    I've deleted the other 6 copies of your post.....

    Thanks....
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  6. #6
    Join Date
    Dec 2012
    Posts
    6

    Re: Possibility of this application? (basic level coding skill and information)

    lol oops Mod! Sorry about that! I genuinely thought the issue is on my side... will remember that from henceforth.

  7. #7
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,090

    Re: Possibility of this application? (basic level coding skill and information)

    Quote Originally Posted by grapeseed87 View Post
    The program lists these processes and creates instances for them.
    I have no idea what that means.

  8. #8
    Join Date
    Dec 2012
    Posts
    6

    Re: Possibility of this application? (basic level coding skill and information)

    Sorry for the constant confusion guys. I am trying my best to get the jargon right. So please excuse.

    Yes I do want to hibernate the process if possible and when it wakes up again I want it to be able to retrieve saved data. Maybe something like write the input data (any type) to a file and then when it wakes again to retrieve it from the same file.

    For GC:
    What I am trying to convey is that when the app lists the running tasks it saves the names as objects and creates separate mini-sub-windows for these objects in which we are able to manipulate data such creating a file, editing it, recalling the same data once the process is closed and started again etc. So for example if I am working in a web browser the app will create a mini interface window for that web browser where i can manipulate text/numerical data. I will similarly switch between several windows of file explorers, calculator, etc for which the app creates separate windows. If I close a particular program the app saves the data in the window for that particular program and retrieves it for me to work on it again once i reopen the related program.

    Is this explanation better? I am trying to create a powerpoint based visual also

  9. #9
    Join Date
    Apr 1999
    Posts
    27,427

    Re: Possibility of this application? (basic level coding skill and information)

    Here is the title of your thread:
    Re: Possibility of this application? (basic level coding skill and information)
    Now, given that title and how confusing your explanation sounds, the only thing to expect is that it takes expert knowledge of the OS.

    You say "lists these processes..." -- do you know how to get a list of the running processes? Do you even have anything similar to "Task Manager" or sysinternal's "Process Explorer" coded or even know where to start coding an application like that?

    You have to start small first, otherwise you're attempting to run a marathon before learning how to walk, or trying to play Chopin and not have learned where middle 'C' is.

    Regards,

    Paul McKenzie

  10. #10
    Join Date
    Dec 2012
    Posts
    6

    Re: Possibility of this application? (basic level coding skill and information)

    Hello Paul,
    I appreciate that. By "Basic level of coding skill and information" i meant regarding to me as i have highlighted in the my first post. I am sorry if that was misled you to believe this was a basic skill app.

    Yes I do know how to obtain a list of the running processes. Using Process Walking. One can take a snapshot and view the running processes with the help of ProcessEntry32. These are the processes (both idle and active) in the system address space. What I am trying to find out a possibility is of the following: If the desktop application I hope to make can create separate files for each of these processes? An editable file which could be a .txt/.doc/.ppt/.xl where I can store user inputed data in them. save them and retrieve them with that data intact once that process is run again and the app detects it using the ProcessEntry. The files in themselves will not be directly interacting with the Processes but merely be a user comment tool for the unique process they were created for. Is this possible? And if yes how do we go about doing that?

    I also had an alternative in my mind by using the MouseClick Event to generate a list of running windows by clicking on them and having my app list those names instead of using a Task Manager like system.

  11. #11
    Join Date
    Dec 2012
    Posts
    6

    Re: Possibility of this application? (basic level coding skill and information)

    Actually nevermind. This got solved on another forum with a simple solution which I had completely forgotten about.

    I generate a list of running processes. My app uses the names in the list as Strings. Using the the strings the app generates files with the namespace and fstream. The app attempts to read from the file, if it cant it catches the exeception and creates one for a process if it didnt already exist. If it does exist it brings up the file with the data stored in it. I can then edit the data and the app saves teh file back in the original directory where it was created to be retrieved once the app runs again. All I have to do is generate the list, add '.* (where * is .doc/ .txt/ .xl/ etc.)' and save the file!

    Simple! Now would it be possible to create a process list instead with Mouse CLick events? Like the app tracks the mouse click event on a window and adds the name to the list? If this is possible can someone let me know? if not then I will go ahead and attempt to delete this thread with the mods permission.

    Thank you all for your attention.

  12. #12
    Join Date
    Apr 1999
    Posts
    27,427

    Re: Possibility of this application? (basic level coding skill and information)

    Quote Originally Posted by grapeseed87 View Post
    Now would it be possible to create a process list instead with Mouse CLick events? Like the app tracks the mouse click event on a window and adds the name to the list?
    Instead of concentrating on this niche usage of adding to a list, do you know how to add a name to a list, regardless of where that name comes from? Once you figure that out, then you expand on that. In other words, you build a system from working components. You don't haphazardly attempt to build a system from the top-down, with everything thrown into the mix at once.

    If you can't add a name to a list box, then start from there. Figure out:

    1) What library are you using to create your list box? MFC? Straight Windows API? Some other GUI toolkit?

    2) Once you decide on that, then you write code that adds strings to this list box or whatever control generically. It doesn't matter if it's a mouse-click, or the names are hard-coded, or if it comes from a command-line, etc. Just the generic "add string to list box" function.

    3) Once you figure that out, then you learn how to listen for mouse events. Once you know that, then you see if you can send a "add string to list box" when you click the mouse. The string can be "abc123" for all you care. As long as that string shows up in the list box, you now know how to accomplish this.

    4) Now you see if you can get something from a window (maybe the title), by clicking the mouse on the window. This has nothing to do with list boxes. What you're trying to do is to see if you can get the window title by clicking on a window. The title could be stored in a string somewhere -- then you inspect the string to ensure you have the title. You now have the mouse recognizing a window and some sort of window information. Then you call the "add this string to the list box" function to add this name.

    5) Totally separate from everything else -- see what functions that when given an HWND, you can drill down into getting the process information. This has absolutely nothing to do with mouseclicks or list boxes, just seeing if when you get an HWND, whether process info is available. Look for function(s) that given an HWND, you get further info. Write a function or set of functions to do this, regardless of whether that HWND or CWnd comes from a mouseclick or not.

    I could go on and on, but hopefully you get the idea.

    Regards,

    Paul McKenzie

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center