ShellExecute
-
I have made a simple dialog based application in which there is just one button.ON that button click i have written the following code. ShellExecute(NULL,"open","c:/myfile.zip",NULL,NULL,0); The problem is when i click the button first time , the dialog window loses the focus and that zip file doesn't open but when i press that button again it perfectly opens that file.Can anyone explain what is the problem. Thanks in advance. Be FaithFull To Your Work.
-
I have made a simple dialog based application in which there is just one button.ON that button click i have written the following code. ShellExecute(NULL,"open","c:/myfile.zip",NULL,NULL,0); The problem is when i click the button first time , the dialog window loses the focus and that zip file doesn't open but when i press that button again it perfectly opens that file.Can anyone explain what is the problem. Thanks in advance. Be FaithFull To Your Work.
Usman Tasleem Akshaf wrote: i have written the following code. ShellExecute(NULL,"open","c:/myfile.zip",NULL,NULL,0); You mean
ShellExecute(NULL,"open","**c:\\myfile.zip**",NULL,NULL,0)
, right? -- jlr http://jlamas.blogspot.com/[^] -
I have made a simple dialog based application in which there is just one button.ON that button click i have written the following code. ShellExecute(NULL,"open","c:/myfile.zip",NULL,NULL,0); The problem is when i click the button first time , the dialog window loses the focus and that zip file doesn't open but when i press that button again it perfectly opens that file.Can anyone explain what is the problem. Thanks in advance. Be FaithFull To Your Work.
Try using SW_SHOWNORMAL as the last parameter: ShellExecute(NULL,"open","c:\\myfile.zip",NULL,NULL,SW_SHOWNORMAL); -- jlr http://jlamas.blogspot.com/[^]
-
Try using SW_SHOWNORMAL as the last parameter: ShellExecute(NULL,"open","c:\\myfile.zip",NULL,NULL,SW_SHOWNORMAL); -- jlr http://jlamas.blogspot.com/[^]
Now it works perfect.But what i want is that when i click the button , that file get unzipped.What code should i include to do that. Thanks in advance. Be FaithFull To Your Work.
-
Now it works perfect.But what i want is that when i click the button , that file get unzipped.What code should i include to do that. Thanks in advance. Be FaithFull To Your Work.
-
I think you are not using pkunzip from the Dos world, so... Check your unzip software e.g, WinZip or WinRar etc for its command-line version to unzip the files. Look in the unzip software's help. this is this.
Either that or use the zip lib (google for it) to unzip the files yourself without launching a separate application. -- jlr http://jlamas.blogspot.com/[^]