1. What are the differences between Win32 and MFC?
2. How do I run the window in full screen mode?
3. How do I read/write in the Windows registry?
4. How do I run an .exe file?
5. What is #define WIN32_LEAN_AND_MEAN for?
6. Is it possible to make MS-DOS run shorcuts?
Q: What are the differences between Win32 and MFC?
A: MFC means “Microsoft Foundation Classes”. It is written in Win32. Win32 is a set of functions for Windows operating systems.
In fact, it’s not that easy, to be explained in two sentences, but if you want to know details and such, just visit our tutorials section, and browse the appropriate tutorials.
Don’t forget to include windows.h
RegOpenKeyEx(HKEY_LOCAL_MACHINE, szRegRoot, 0, KEY_READ, &root);
RegQueryValueEx(root, "blabla", NULL, &dwType, (BYTE *)szData, &dwBufSize);
Write value to registry:
RegSetValueEx(root, "blabla", 0, REG_SZ, (const BYTE*)&szData, dwBufSize);
And don’t forget to include the windows.h header file.
Also, have in mind that when you invoke a file from some location, you should type \\ instead of \. For example:
Another way is:
spawnl(P_WAIT, "myprog.exe", "myprog.exe", NULL); //include process.h
There are two more API functions that can run a program:
WinExec it is not recommended because it is out of date.
CreateProcess it is more complex function to use, although it provides more flexibility.
Q: What is #define WIN32_LEAN_AND_MEAN for?
A: It is often mistaken that WIN32_LEAN_AND_MEAN excludes all MFC stuff. In fact, it has nothing to do with the MFC stuff.
It works with the Win32 API which is what MFC wraps. MFC is a higher level method of working with the Win32 API; the Win32 API knows nothing of MFC.
WIN32_LEAN_AND_MEAN excludes windows headers that are normally not used (such as shellapi.h).
by Invader X
You can use the ShellExecute function to start the program.