All pastes #1516359 Raw Edit

##programming

public text v1 · immutable
#1516359 ·published 2009-08-03 05:24 UTC
rendered paste body
[n=knoppix@dpc6682076157.direcpc.com] entered the room.
(12:36:56 AM) slayer6: Dose anyone know how to incorperate code into c++ so that when you press a certain button it opens up a .exe file?
(12:36:57 AM) Zuu: ... or maybe you should say a lot more
(12:38:28 AM) Vicfred left the room (quit: "Leaving").
(12:38:57 AM) slayer6: Hello 40 people and no answers.
(12:39:25 AM) otay: slayer6, I'm not sure about pressing the button part..
(12:40:04 AM) otay: slayer6 but in c++ you can use system() as one way to run an application from your application
(12:40:30 AM) wahnfrieden: otay, zuu?
(12:40:51 AM) wahnfrieden: slayer6, that depends on what UI library youre using
(12:41:02 AM) wahnfrieden: buttons dont have anything to do with c++
(12:41:05 AM) wahnfrieden: that's an API thing
(12:41:39 AM) ***Zuu giggles more
(12:43:18 AM) wahnfrieden: i thought you had me on ignore, twat
(12:44:19 AM) Deevz [i=Deevz@dsl-35-95-185.b2b2c.ca] entered the room.
(12:44:21 AM) slayer6: Hello? is anyone there?
(12:44:24 AM) dixon: Zuu: You should really try not to threaten people.
(12:44:35 AM) otay: didn't I answer?
(12:44:46 AM) otay: Maybe I'm in limbo
(12:44:55 AM) slayer6: Mabey if i text in red?
(12:45:01 AM) otay: haha
(12:45:07 AM) slayer6: or green?
(12:45:13 AM) slayer6: black
(12:45:19 AM) slayer6: orange
(12:45:23 AM) otay: slayer6, I suggested C++ "system()"
(12:45:28 AM) slayer6: gray
(12:45:36 AM) slayer6: blue
(12:45:39 AM) otay: slayer6 do you want to use C++?
(12:45:39 AM) slayer6: holy fuck
(12:46:36 AM) slayer6: all i know is c++.
(12:46:53 AM) otay: Ok
(12:47:05 AM) otay: I think you want system() then
(12:47:13 AM) dixon: slayer6: Please try to cram as much in one line as possible.
(12:48:09 AM) slayer6: Do you know how you open sticky keys you hit shift 5 times and that opens a box that will ask you would you like to activate sticky keys.
(12:48:30 AM) Brando753 left the room (quit: Read error: 60 (Operation timed out)).
(12:48:35 AM) otay: Oh, in Windows?
(12:48:49 AM) otay: Yeah, that happened to me on a Windows box
(12:48:54 AM) slayer6: I was wondering if I could take something like that and use it to open my program. Yes in windows/vista.
(12:49:13 AM) slayer6: service pack 1.
(12:49:37 AM) otay: I bet there are a ton of things to help you bind macros to keys
(12:49:45 AM) otay: I don't think you even need to code anything
(12:49:54 AM) wahnfrieden: ya
(12:50:16 AM) slayer6: What? How would that work?
(12:50:38 AM) slayer6: macros?
(12:50:51 AM) dixon: Hotkeys.
(12:51:05 AM) otay: Macros, yeah. Maybe hotkeys or shortcuts
(12:51:14 AM) slayer6: OK? Like programable buttons?
(12:51:24 AM) wahnfrieden: lol
(12:51:33 AM) otay: Yeah. You can probably just download.com all kinds of stuff like that
(12:53:14 AM) otay: Windows might even have something built in for that. I can't recall
(12:53:33 AM) wahnfrieden: otay, doesnt help his end user
(12:53:34 AM) slayer6: Is there know way to incorperate it into a c++ program? I'm building an AI for my computer that opens on start-up and i can run programs from that program it's coming along good I just need this one thin.
(12:53:40 AM) wahnfrieden: he wants it integrated in his software
(12:53:41 AM) otay: I always just yell at the computer
(12:54:01 AM) otay: Oh.
(12:54:25 AM) otay: Find system() in your API manual
(12:54:30 AM) otay: it should look like
(12:54:49 AM) otay: int system(const char *command);
(12:55:12 AM) slayer6: I have all of my electronical stuff on a server like lights dad's pool garage door etc...
(12:55:12 AM) otay: On my computer it is found in: #include <stdlib.h>
(12:55:27 AM) dixon: lol.
(12:55:57 AM) otay: I don't know if you would trigger it any differently though. I think you press a button either way.
(12:56:03 AM) slayer6: #include <system> and how would i call the fuction system(void) { do whatever} ?
(12:56:15 AM) slayer6: maybe?
(12:57:03 AM) dixon: Go learn C++.
(12:57:17 AM) otay: so yeah; I suppose if you have an event like.. dunno "F5" triggers a command..
(12:57:17 AM) Security_Dude left the room.
(12:57:24 AM) otay: let me rephrase that
(12:57:59 AM) Security_Dude [n=knoppix@dpc6682076157.direcpc.com] entered the room.
(12:58:02 AM) slayer6: man I know C++. thats not my problem I just need to know what library and how to call it how to assign it to "F5".
(12:58:33 AM) slayer6: Go learn C++ ha.
(12:58:36 AM) otay: suppose your program is running and you are in an if { "F5 got pressed" } then you can do system("go.exe"); goto hurray;
(12:58:45 AM) dixon: slayer6: No, you don't.
(12:58:46 AM) Security_Dude left the room.
(12:58:49 AM) otay: notice I put goto in there to be funny
(12:59:08 AM) Security_Dude [n=knoppix@dpc6682076157.direcpc.com] entered the room.
(12:59:24 AM) dixon: Otherwise you'd be entirely capable of looking at this page and figuring out what to do: http://www.cplusplus.com/reference/clibrary/cstdlib/system/
(12:59:34 AM) slayer6: Ok well why aren't you giving me suggestions? huh?
(12:59:47 AM) dixon: Instead you try to re-implement the system method, which clearly shows a lack of understanding.
(12:59:51 AM) Zuu left the room (quit: Read error: 104 (Connection reset by peer)).
(12:59:58 AM) otay: Yeah. I had a very similar question when I started learning C++ too.
(01:00:39 AM) otay: In reality system() is depricated afaik
(01:01:05 AM) Zuu [i=zuu@0x55529f1b.adsl.cybercity.dk] entered the room.
(01:01:05 AM) ##programming: mode (+v Zuu ) by ChanServ
(01:01:06 AM) otay: But it's just fine for most people (subject to debate)
(01:01:06 AM) dixon: slayer6: http://www.codeproject.com/KB/system/nishhotkeys01.aspx
(01:01:08 AM) wahnfrieden: how you launch a program is OS-dependent
(01:01:14 AM) wahnfrieden: and not part of POSIX C++ afaik
(01:01:18 AM) slayer6: Ok when nothing is running I could press "F5" and It will start my .exe?
(01:01:25 AM) Security_Dude left the room.
(01:01:28 AM) dixon: slayer6: See my link.
(01:01:34 AM) otay: slayer6 that's the easier way, yeah
(01:01:40 AM) wahnfrieden: how you hook into F5 is a windows api issue
(01:01:52 AM) Deevz left the room (quit: Read error: 110 (Connection timed out)).
(01:01:53 AM) wahnfrieden: and probably not simple
(01:02:12 AM) slayer6: Ok I'll try dixon's way.
(01:02:32 AM) wahnfrieden: slayer6, that doesnt include the f5 hook
(01:02:33 AM) sg left the room (quit: ).
(01:02:35 AM) Zuu: What a convenient point in time my server decided to crash
(01:02:37 AM) wahnfrieden: just the app launch
(01:02:47 AM) wahnfrieden: zuu cool bro
(01:03:37 AM) otay: If I wanted to do it in C++, I think I would getline for the ascii code the key produced
(01:04:06 AM) otay: unless it was nonblocking then it's a whole nother deal
(01:04:30 AM) slayer6: Ok so to implement the "F5" state ment I won't put the code in the AI but somewere like were the sticky keys program is located right.
(01:05:04 AM) sanjid left the room (quit: Remote closed the connection).
(01:05:10 AM) wahnfrieden: getline lol
(01:05:17 AM) wahnfrieden: otay he wants it so he can be in any application
(01:05:19 AM) wahnfrieden: and pres f5
(01:05:29 AM) slayer6: yes
(01:05:34 AM) otay: oh
(01:05:38 AM) wahnfrieden: slayer6, thats not simple
(01:05:38 AM) slayer6: any were any time
(01:05:42 AM) otay: oh
(01:05:53 AM) otay: Then it needs to be running as a different process
(01:05:55 AM) wahnfrieden: and it's a windows api thing
(01:05:59 AM) wahnfrieden: otay no
(01:06:12 AM) wahnfrieden: it's some kind of windows api call
(01:06:44 AM) slayer6: were would i find that api folder
(01:06:55 AM) otay: So like if he's playing a game, he can press a hotkey and have it do something?
(01:07:47 AM) otay: Or embed the functionality in a program
(01:07:48 AM) otay: ?
(01:08:10 AM) wahnfrieden: folder lol
(01:08:19 AM) otay: A folder?
(01:08:32 AM) wahnfrieden: otay, a system wide key override
(01:08:40 AM) wahnfrieden: i dont know how windows implements it
(01:08:46 AM) wahnfrieden: maybe a publish/subscribe model
(01:09:06 AM) ashumz: functional php: http://github.com/alandipert/phunctional/tree/master
(01:09:16 AM) wahnfrieden: lmao
(01:09:28 AM) wahnfrieden: php doesnt have lambdas though
(01:09:30 AM) otay: Well; I'm fairly dense but my best advice is to get the guestion down right.
(01:10:05 AM) otay: Then, I suppose the world is your oyster
(01:10:13 AM) joeyadams left the room (quit: "good night").
(01:10:15 AM) wahnfrieden: slayer6, just download autohotkey
(01:10:50 AM) wahnfrieden: hahaha wooow
(01:10:55 AM) wahnfrieden: that uses eval for lambdas
(01:10:56 AM) wahnfrieden: hilarious
(01:11:04 AM) otay: I use Windows 3.1.
(01:11:10 AM) otay: jk k
(01:11:30 AM) otay: Outlawed OS.com
(01:11:53 AM) slayer6: yea.
(01:11:58 AM) otay: yeah download that
(01:13:17 AM) otay: My mom always, said, "Don't bake the cookies unless you're boobies are on tight".
(01:13:38 AM) otay: I have no idea, to this day, what the hell she was smoking.
(01:13:56 AM) wahnfrieden: old women have loose tits
(01:14:02 AM) otay: she was from the '60's
(01:14:04 AM) wahnfrieden: only bake while youre young
(01:14:06 AM) otay: LOL!
(01:14:08 AM) otay: hahaa
(01:14:12 AM) meoblast001 left the room (quit: "Leaving").
(01:14:15 AM) wahnfrieden: or have plastic surgery
(01:14:16 AM) otay: that's hilarious
(01:14:17 AM) Zuu: ashumz, hi again, look at PM
(01:14:27 AM) otay: I think you're on to something there.
(01:14:37 AM) wahnfrieden: it was your mom dropping hints
(01:14:40 AM) wahnfrieden: she wanetd a boob job
(01:15:04 AM) otay: man, it's hard to tell with old hippies :)
(01:15:34 AM) slayer6: ha ok well thanks for you help.
(01:15:58 AM) slayer6 left the room (quit: "Caution: Keep out of reach of children.").
(01:16:00 AM) otay: yeah, some help eh? Trying going to ##asm. Those guys are real jerks !
(01:16:06 AM) otay: lol
(01:16:19 AM) otay: ok. I'm teasing
(01:16:24 AM) otay left the room (quit: Remote closed the connection).