Hi my friends !! :) Ok, because of your big Help, (yeah, all of you) the F-Macros program is working now. Here you have it with the Source included. If u need any Source Code that uses HotKey controls, send keyboard strokes to any program, loading and focusing any window (Multithreading), clearing IE Cache Instantly, and more, you can read the source that you made, yes, you made it because all the stuff here was found in this board.

If you don't know what I'm talking about, just read the features above.

F-Macros v.0.2

F-Macros is a program to create System Macros just pressing a HotKey. It's very usefull if you are a programmer who spents to much time in front of your PC. Why ? Because just pressing a selected HotKey you can Load or Focus a program, Type Text, etc. The good thing about it is that it doesn't Hook your keyboard at all, I mean, it doesn't use any global or keyboard hooks, any external dlls and it's really small.

These are the Actions that you can do with this version:

Load a Program.
Focus a Program.
Load and Focus a Program.
If Program Loaded, Focus on it, if not, Load it and Focus.
Type any Text.
Clear Internet Explorer Cache & Cookies.

If you like the program, if you have any suggestion or any feature that you think it will be useful, or if you find bugs, please let me know.

Thanks a lot.

-MagicMac. :)
Posted on 2001-10-06 14:45:31 by magicmac
That's a pretty cool program! *kenny places it in the startup folder*
Posted on 2001-10-06 19:59:07 by Kenny
Thanks Kenny !! :) I'll be updating it from time to time, so if you have any suggestions found bugs or anything, please let me know ...

Thanx Again.

Posted on 2001-10-06 22:39:02 by magicmac
not "busting your balls here" i like this. had a little trouble using the f12 as the hot key but ctl-shft-e pops up QEdit real nice.

Posted on 2001-10-06 22:52:33 by rafe
Thank you rafe :tongue: Ok, in order to work properly, Hotkeys should be always with modifier keys. I mean, don't just use F12 or F10, instead, use CTRL F10 or SHIFT F11.
You can also use multiple ones like:

CTRL SHIFT E ---> Runs your Editor.
CTRL ALT Z ----> Clear Browser Cache & Cookies...

Thanks a lot. :)

PS: Modifier Keys == CONTROL / ALT / SHIFT / WINDOWS
Posted on 2001-10-06 22:58:19 by magicmac
Oh man this is a bag of bugs, i'd rather re-code it in DELPHI.
Better than that, i'll do it as an ISAPI filter...
Congrats fellow MAC !
Show them what you got !!


Posted on 2001-10-07 03:27:06 by latigo
Heheh :) Hi my friend !! :) I hope you will come to dinner next Wednesday ... Will you ?
Ok, thanx for your nice words, and after finishing this project, remember that we both have another one ... :)


-MagicMac. :)
Posted on 2001-10-07 21:43:04 by magicmac
I'll be there next Wednesday for sure.
And regarding our project...i know how this will end: It'll never start.

Un abrazo.

Posted on 2001-10-07 22:07:43 by latigo
bugs: Can't find any...

suggestions: Well, I've always wanted a GOOD macro system that had the ability to move the mouse, simulate the keyboard, and also launch programs.

The reason for this is so I can record a macro of my going every other line in an include file and deleting #define and then whatever... You get the idea anyways...
Posted on 2001-10-08 00:04:12 by Kenny
Larigals: Hey My Friend !! :) I know we will start the project. Yeah, maybe you're right and we never start that project beacause you'll leave the country in a few months, but maybe we start it maybe not ... Who knows ? BTW: I know we will start it (Maybe not a Shell, but you know...)

Girls ? Hehe :)

Kenny: Ok, maybe you can explain me a little bit better because I don't cleary understand what you are suggesting. Will you be so kind ?

Thanks a lot.

-MagicMac. :)
Posted on 2001-10-08 08:23:54 by magicmac
kenny, perhaps you should just get a better editor? ;). Take a look
at editplus. Macro support isn't available until you register it, though.
Posted on 2001-10-08 09:36:20 by f0dder
I'm a user of EditPlus also, so, do u think a what Kenny means is exactly what EditPlus does ?


Posted on 2001-10-08 09:46:23 by magicmac
Looks good, but I have one suggestion. It'd be nice if you could have a "scratch" macro set up to record and play over. For example, you press Control+Shift+R (or whatever), then whatever other keys you press are recorded until you press Control+Shift+R again. Then you could press Control+Shift+P (or whatever) to play it back. Being able to record macros on the fly like that would be very nice. Not to bust your balls. But it'd be helpful to save the time of going into the macro window and setting up a new one and deleting the old one every time.

(Yeah, I stole this feature from MS's Visual C++ 6.0 IDE. It got me hooked.)
Posted on 2001-10-08 17:32:06 by Irving W.
Irving: I like the way you say "Not to bust your balls" :) It's funny ... Ok, about your suggestion, yes it's a really really good idea. You're right and I'll do it but first, I'll learn how to hook in a clean way without using Windows Hooks or external DLLs.
Actually what you are asking for is not a hard task to do, the problem is that I don't want to use the classic Windows Hooks because ... you know ... I don't like to waste memory in each and every process that is loaded, but I'll do it "the good way", it's a really good idea.
Thanx a lot and I'll sure place that future ...
BTW: if you already used Windows Hooks without using the classic approach and you have source code, please let me know.

-MagicMac. :)
Posted on 2001-10-08 17:43:33 by magicmac
I mean a macro system that records key clicks AND mouse clicks as well as the ability to launch programs.

There is one thing I DID experience using your program though: when I make a macro for say ctrl-c, and then I clear that macro, I still can't copy using ctrl-c anymore. Seems kinda weird because it also doesn't launch the program either :) Might have just been a specific instance. I can try it again if you can't reproduce the problem though.
Posted on 2001-10-08 20:22:34 by Kenny
Kenny: Ok, now I understand perfectly what you're talking about. Yeah, it's a great idea. Maybe hard to do... but I'll give it a try for the 0.7 version. About that bug, thanks a lot for the advice, yes, I could reproduce it exactly as you said and I can tell you by now, that you can fix it quitting the other program and restarting it again. For Example, I use Keyboard Macros in EditPlus, but when F-Macros is loaded it overwrites them, even if I delete the Macro or exit F-Macros, the old key won't be restored, again, you need to restart that program not F-Macros.
That bug is because I'm not saving the old values (in RAM) of the previous HotKeys, so I'll fix it... :)
Thanks a lot !!! :alright:

Thanks again, for taking you time to tell me about that bug.

-MagicMac. :tongue:
Posted on 2001-10-08 23:36:52 by magicmac
Oh, another cool option to have would be an option to start the program minimized, or in the taskbar.. You know what I mean? That way when I start windows, I don't always have to minimize it, and then I can always open it if I need it again.

Another cool thing would be the ability to make a hotkey to turn on and off the macros.

If you're feeling REALLY ambitious, it would be REALLY COOL if you could make it a .cpl so I could make it a part of my control pannel so it won't take up space on the taskbar.

Posted on 2001-10-08 23:45:32 by Kenny
Thanks! :) I can't wait. It'd be really nice to have something like that for whatever program I'm in (not just VC++).
I tried to do something like this myself awhile ago, in fact. I'll tell you all I know. Just keep in mind this was only my personal experience trying to do this:

GetKeyState is useless for this kind of thing. You have to call it once for every key, and it doesn't even return the actual (physical) key's state. It depends on the message queue for your thread.

GetKeyboardState looks promising, but it's still useless. It returns the same information as GetKeyState, but for the whole keyboard at once instead of one key at a time.

GetAsyncKeyState might be useful (since it returns the physical status of the key), but you have to call it once for every key. There's no GetAsyncKeyboardState function. You could write your own by calling GetAsyncKeyState for every key you're interested in, but I didn't even try it just because it sounded so slow. If you do anyway, it might be useful to know that the high-order bit is 1 if the key is down, or 0 if it's up.

Maybe you could use GetAsyncKeyState repeatedly to check for the keys you want to start/stop recording, and attach/detach hooks then? Like if it's Control+Shift+R, you only call GetAsyncKeyState three times (once for VK_R, once for VK_CONTROL, and once for VK_SHIFT) and if they're all down, you start/stop recording (attach/detach hooks). So you're only hooked when you need to be. (If you want to, you can call it once more with VK_ALT just to make sure it's not pressed if you don't want it to be)

Hope that helps. I'm not sure if this will work, since I gave up before I thought of it. I am sure there are other ways to do this, maybe involving DirectInput or something. But I try to stay as far away from DirectX as I possibly can, so I couldn't recommend anything about that.
Posted on 2001-10-09 12:39:06 by Irving W.
Kenny: Sure I will, I'm also tired of minimizing it every time I boot up the System !! :) About the Enable/Disable Macros, I promise I'll include it also. Ok, about the .CPL I'll have to study a little bit on how exactly this is done, but sounds good !! :)
Now, btw, if you don't like the taskbar, you can hide it completely by selecting the option "Hide F-Macros" ... Yeah, I know, there's no way -yet- to make it appear, but don't be affraid, next version will not have the "Don't Bust My Balls" MessageBox, instead, everything that's not working now, will be working.
I have to stop coding it this week because of my job (DHTML Programming ... Puajj !! :) Kidding, I like it...) But next week most of what you said will be included in F-Macros.
Thank for giving me so many ideas !!! :)

Irving W: Hey !! What a large explanation !! Thanx !! Sure that will save me time !! ... Ok, yes, I'll make the record keyboard Macro but not on the next update coz I have no idea yet on how to do it. Sure I'll hook the keyboard only when recording, but anyway, I hate the classic Windows Hooking Approach so I'll study this a little bit more to do it without the classic approach. I hate DLLs attached to all processes and anyway, I hate the idea of my computer doing a lot of jobs each time the user (or me) presses a key. I know Window$ does it anyway but ... more code ? No no no... Windows is very bulky in itself to add more code to each process.
So, I'll take note of what you told me to avoid the waste of time on things that you already know that won't work...

Thanks a lot for both of you guys !! :)

-MagicMac. :)
Posted on 2001-10-09 20:50:25 by magicmac