| QIZI94 (14) | |
|
Hi, guys. I am looking for something to run programs on Windows startup. I know a manually way, but I am looking for some simple function in windows.h, because not all users have OS in C: drive. Can someone help me ? | |
|
|
|
| guestgulkan (2830) | |
|
This thread maybe of some use; http://social.msdn.microsoft.com/Forums/zh/vcgeneral/thread/01f476a0-7280-40bf-a796-e59ed67af9c1 | |
|
|
|
| andywestken (1950) | |
|
Also see: INFO: Run, RunOnce, RunServices, RunServicesOnce and Startup http://support.microsoft.com/kb/179365 Run and RunOnce Registry Keys http://msdn.microsoft.com/en-us/library/aa376977%28v=vs.85%29.aspx | |
|
Last edited on
|
|
| QIZI94 (14) | |||
Thanks it was usefull, but only way i find to write to registers is:
But I never find in which header file can be. Is there some other option to write to registers ?(c++) | |||
|
|
|||
| modoran (1095) | |
|
For registry functions you only need to include windows.h and link against advapi32 library. http://msdn.microsoft.com/en-us/library/windows/desktop/ms724875(v=vs.85).aspx | |
|
|
|
| QIZI94 (14) | |
|
Thanks, Last thing. when i put value(REG_ZS) to registry: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run I must set current location of the .exe, this brings me to the question: How to determine location of currently running program (.exe) ? | |
|
Last edited on
|
|
| Volatile Pulse (1328) | |
int main(int argc, char* argv[]) {argv[0] is a string that contains the current directory and file name. | |
|
|
|
| EssGeEich (681) | |
| Also GetModuleFileName does the job of getting your exes name. | |
|
Last edited on
|
|
| QIZI94 (14) | |
| Thanks a lot for answers now all work perfect again thanks :-) | |
|
Last edited on
|
|