![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 | |
|
Hobbyist Programmer
Join Date: Aug 2004
Location: The Netherlands
Posts: 111
Rep Power: 5
![]() |
well, first of all, i did mean parameters in the WinExec() function..
second, i've altered my code to set asid memory (at least that's what i think i've done )#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int bufsize=256;
char *buffer=malloc(bufsize);
while(1)
{
printf("\nCommand:>");
WinExec(buffer,SW_SHOW);
scanf("%s",buffer);
}
return 0;
}third, Ooble, i don't really understand what you mean by Quote:
thanks for the help , i really appreciate it!
__________________
http://www.white-scorpion.nl |
|
|
|
|
|
|
#12 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
So WinExec("control userpasswords") doesn't work?
|
|
|
|
|
|
#13 | ||
|
Hobbyist Programmer
Join Date: Aug 2004
Location: The Netherlands
Posts: 111
Rep Power: 5
![]() |
not with the above code.. perhaps it does work with your code added, but like i said, i don't really understand what you mean..
this is what you see: Quote:
Quote:
)
__________________
http://www.white-scorpion.nl |
||
|
|
|
|
|
#14 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Lemme try and simplify that. If there are quotes round the path, execute it as normal. If there aren't, first check to see if the entire string is a file. If it isn't, add quotes around the first argument (up to the first space), then execute it.
|
|
|
|
|
|
#15 |
|
Programming Guru
![]() ![]() ![]() |
First off, the reason you are getting this:
Command:> Command:> Is because you are executing a blank buffer. You call WinExec with buffer before buffer is defined. ... printf("\nCommand:>"); WinExec(buffer,SW_SHOW); scanf("%s",buffer); ... Try this: printf("\nCommand:>"); scanf("%s",buffer); WinExec(buffer,SW_SHOW); To pass parameters to your menu... enclose the whole string in double qoutes ("myCommand myParam1 myParam2").
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#16 |
|
Programming Guru
![]() ![]() ![]() |
Make that one change... then type at your prompt type this...
Command:>"control userpasswords" That will work for you, it brings up the userpasswords option of my control panel.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#17 | |
|
Hobbyist Programmer
Join Date: Aug 2004
Location: The Netherlands
Posts: 111
Rep Power: 5
![]() |
Quote:
![]() thanks for it, but as for the "control userpasswords", it doesn't work, not even after changing the scanf location to before the winexec location (like you said), i still only get the control panel.... did you use the above code to get the userpanel of control panels? >>Ooble, it sounds easy, but i have NO IDEA how to code that , perhaps i need to read more manuals on strings, arrays etc....
__________________
http://www.white-scorpion.nl |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|