I want my program to run on start up through editing the registry, how would i do that? Certain API's? or a specific way through c++ to do it? Or is that even the right method? Basically i would prefer to not use the startup folder in XP.

Recommended Answers

All 9 Replies

You call this a C++ question?

Well ya... i asked how you would do something like this because I don't know how and I'm writing code in c++ right now... and your kind've being a dick, even in my other thread you insulted me.

Well ya... i asked how you would do something like this because I don't know how and I'm writing code in c++ right now... and your kind've being a dick, even in my other thread you insulted me.

I didn't insult you in the thread, but if you're going to cry like a babby about insults that you've imagined, I think you deserve one now.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

what do u think?...

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

what do u think?...

ya, i got that much, but what would i do with that?

RegCreateKey...RegSetValue...RegCloseKey...etc.

Thats what i was looking for lol. ill just look that up on msdn.

thanks

Sorry for double post, but im having trouble getting it to compile.

string vOut;
RegCreateKeyEx("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run", "clutch", 0, NULL, 0x00000000L, 0xF003F, NULL, &vOut, NULL);

I was going off of MSDN and was slightly confused the entire time, so im wondering how do i fix this up? Thanks

LONG WINAPI RegCreateKeyEx(
   HKEY hKey,
   LPCTSTR lpSubKey,
   DWORD Reserved,
   LPTSTR lpClass,
   DWORD dwOptions,
   REGSAM samDesired,
   LPSECURITY_ATTRIBUTES lpSecurityAttributes,
   PHKEY phkResult,
   LPDWORD lpdwDisposition
);

string vOut; //....that's wrong

HKEY vOut;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.