Using WinExec: A Guide and Code Example for Clear Understanding

  • Thread starter Pattielli
  • Start date
In summary, the conversation is about the correct usage of a function for accessing older 16-bit programs. The speaker advises not to use it unless absolutely necessary and recommends getting acquainted with MSDN for Windows programming. They also mention that CreateProcess should be used instead of Winexec for turning off the "activeness" of processes. The conversation ends with the speaker thanking faust9 for teaching them new things.
  • #1
Pattielli
296
0
Can you tell me how to use it correctly ?
can you please give me a piece of code to clearify what you mean ?

Thank you very much.
 
Computer science news on Phys.org
  • #2
Don't use it unless you absolutely positevly have to. It's function for accessing older 16-bit programs.

Here, if you're going to fiddle with windows programming then you should get acquanted with MSDN http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/winexec.asp
 
Last edited by a moderator:
  • #3
Oh, thank you very much, tat means i should use CreateProcess instead of Winexec, ?
I am trying to turn off the "activeness" of some processes that are running by using Winexec, I am still new to this, really. I honestly didn't know about its drawbacks when compared to CreateProcess...I learn new things from you, faust9.
Again, Thank you very much...
 

Q: What is WinExec?

WinExec is a function in the Windows operating system that allows the execution of a command or program from within another program.

Q: What is the purpose of "Using WinExec: A Guide and Code Example for Clear Understanding"?

The purpose of this guide is to provide a clear understanding of how to use the WinExec function in programming, along with a code example for reference.

Q: How do I use WinExec in my program?

To use WinExec, you must first include the #include header in your program. Then, you can call the WinExec function with the command or program you want to execute as the parameter.

Q: What is the syntax for using WinExec?

The syntax for WinExec is WinExec(command, show), where "command" is the command or program to be executed and "show" is a flag indicating how the program's window should be displayed.

Q: What are the different show options for WinExec?

There are four possible values for the "show" parameter in WinExec: SW_HIDE to hide the program's window, SW_SHOWNORMAL to show the window in its default state, SW_SHOWMINIMIZED to minimize the window, and SW_SHOWMAXIMIZED to maximize the window.

Similar threads

  • Computing and Technology
Replies
3
Views
2K
  • Computing and Technology
Replies
2
Views
253
Replies
16
Views
2K
  • Computing and Technology
Replies
9
Views
1K
  • Computing and Technology
Replies
10
Views
1K
  • Programming and Computer Science
Replies
14
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
15
Views
1K
  • Programming and Computer Science
Replies
14
Views
1K
  • Programming and Computer Science
Replies
20
Views
496
  • Programming and Computer Science
Replies
4
Views
1K
Back
Top