Implementing short macros for windows®

This is a discussion on Implementing short macros for windows® within the Windows Programming forums, part of the Platform Specific Boards category; Sorry, I didn't express myself good enough, in my last post I didn't mean "an already active program" but an ...

  1. #16
    Registered User
    Join Date
    Jan 2009
    Location
    Australia
    Posts
    375
    Sorry, I didn't express myself good enough, in my last post I didn't mean "an already active program" but an autorun program. Hence after a reboot the program would run with my proxy dll instead. Restarting it has the same effect, yes.
    I still don't know how you could minimise all windows by proxying a DLL of one program.

    What you are trying to achieve can be done with DLL Injection, but it seems like you are trying to crack a walnut with a sledgehammer.

    If I were to do this (I never would, but let's go hypothetical) I would simply enumerate all windows, check which ones are maximised and then send windows messages to minimise those. This method may have some side effects, but I have very much the same outlook to you when it is messing with my computer (I take responsibility, and it's not a big deal if something screws up).

  2. #17
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Hawkin View Post
    Second I only want this code for myself, on XP. Not for any other people, so I don't care at all if it works on other OS or not.
    Plainy: I am not all that willing to put code like you're asking for in a public forum... *especially* when it has lots of uses for malware purposes and *extra especially* when the person asking is telling me he routinely uses techniques used to distribute and activate trojans.

    I'm sorry it's actually nothing personal about you... it's where we are.

    CommonTater: I totally forgot or didn't even knew about windows hotkeys for shortcuts. I tried your method using a shortcut to the original "Show Desktop.scf"-file (which contains the same code you posted) and tried several hotkeys (ctrl+alt+d, ctrl+alt+s, ctrl+alt+e, ctrl+alt+f12, ctrl+alt+f11) and had problems with all of them. with ctrl+alt+d and ctrl+alt+f11 the explorer was freezing completely for 5-15 seconds, then randomly either proccing the "show desktop"-effect or not. Unfortunately the cance of activating was 2-5%. I also applied a hotkey to a shortcut to a folder, there was the same: If applied to several hotkeys such as ctrl+alt+d, there was complete explorer freeze (all interface such as taskbar, open folders) for 5-15 seconds and then randomly appearing the folder i hotkey'd. Chance here: 50%.
    Well, it works on all 5 of my computers... My "main" system running Windows 7, two HTPC machines running XP, a netbook running XP and a server running 7. After you complained I tried it on my own systems... virtually instantaneous response even on a single core Atom machine....

    Now I know why I don't know about this window function, it simply sucks. But thanks for trying to understand the topic, what I wanted is to hear experiences/solutions from other people, not criticize or discuss my solutions (except my questions), because those I can do on my own and just wanted to list them to avoid somebody posting the same ideas.
    Once again... look where we are. This forum has a published policy about code that can be used for malicious purposes... DLL Injection, DLL Proxy, etc. clearly fall into that category.

    And I only said code and dll injection have flaws, not proxy dlls. There is no "unknown behaviour", proxy dlls work perfectly. I haven't had a single crash or bug in a year of using.
    Given your results with that simple scf file... that may be up for debate.

  3. #18
    Registered User
    Join Date
    Aug 2006
    Posts
    68
    Quote Originally Posted by DeadPlanet View Post
    If I were to do this (I never would, but let's go hypothetical) I would simply enumerate all windows, check which ones are maximised and then send windows messages to minimise those. This method may have some side effects, but I have very much the same outlook to you when it is messing with my computer (I take responsibility, and it's not a big deal if something screws up).
    Hmm, we talk not in the same direction I guess. The point here is not how to code the minimizing of active windows, but how to execute it. Your idea is exactly my approach, but how would you run the code? I hope not with an executable, because that's exactly what I not want.

    The .scf idea was a good one, I mean it's still a good one, except the windows hotkey bug. If the file works better than windows key+d, I can use it instead of writing my own code, just I still need to set a global hotkey for it with programming as I can't use that XP feature.


    CommonTater: I still have no idea what you mean. I am not asking for any code, I am asking for ideas how to implement it besides the ones I mentioned. So a qualified answer could be: "try hotpatching", because I didn't mention it in the first post.
    About "malware" we could debate for weeks, I tell you You are allowed to buy a car, it can be used for malicious actions like steamrolling people. Bad use of cars. It can be used to transport people. Good use of cars. Using your words we should prohibit all cars because one might be used for bad purposes. Lol. With proxy dlling (I think that's what we are mainly talking about) can be done so many things. I use them mainly for debugging and logging function calls to understand programs better and analyze the results.

    One practical use for example is that I implemented a way to use a proxy connection for all internet based programs (those using winsock) that don't support using an internet proxy on their own. No need for any extra programs made by other people, I can use such feature with minimal computer resources and knowing there is no spyware, advertisment or bad programming, simply because it's my own.

    But I didn't know about your policy, I also thought now that I am in the wrong forum for this because the most common ways to do this are done using asm skills, not programming skills (except using a proxy dll, but which seems to be forbidden here). I will create a petition to disallow members of this forum to tell newbies about the "system()" winapi command. It can be used for malicious purposes like turning off other people's computers!!! omg!

    No seriously, I find all this concealment of advanced programming very amusing. I didn't find it amusing back then years ago when I hadn't had these skills but now I can laugh over your "overcautiousness" like it's top secret FBI stuff

    I think this topic can be closed now or forgotten, I am already working on it: Since I only experience the windows key+d glitch (that the desktop is not responsive) with a single full screen application, I use a dll of itself to only activate my global hotkey override when this application is running. I do this by proxying dinput.dll, which this application uses for mouse input (and keyboard input IIRC). I am halfway done, but thanks guys for the interesting conversation once again.
    Last edited by Hawkin; 01-20-2011 at 04:27 AM.

  4. #19
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Hawkin View Post
    But I didn't know about your policy,
    Final comment here... It's not My policy... it's one I have chosen to accept in order to participate in this forum which has been way helpful to me.

    As for the advanced programming topic... if you care to take a peek at my website you will find an application that uses DLL injection to accomplish a whole-network improvement in multimedia facility. Fully remote controlled HTPCs with the remote sitting on your screen... not your couch.

    So, no I am not personally adverse to these techniques, although I will confess a certain reluctance about posting them on public forums.

    Thanks for an interresting debate.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Accessing Structures Inside Structures
    By Mellowz in forum C Programming
    Replies: 1
    Last Post: 01-13-2008, 02:55 AM
  2. Help calling function is asm
    By brietje698 in forum C++ Programming
    Replies: 24
    Last Post: 12-06-2007, 03:48 PM
  3. Say what? - Weird error.
    By Blackroot in forum C++ Programming
    Replies: 6
    Last Post: 08-15-2006, 11:54 PM
  4. Color Variety
    By Unregistered in forum C++ Programming
    Replies: 7
    Last Post: 10-23-2002, 09:17 AM
  5. My Allegro Program will not run...
    By Vicious in forum Game Programming
    Replies: 17
    Last Post: 06-14-2002, 12:49 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21