Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. ShellExecute

ShellExecute

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    Usman Tasleem Akshaf
    wrote on last edited by
    #1

    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.

    J 2 Replies Last reply
    0
    • U Usman Tasleem Akshaf

      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.

      J Offline
      J Offline
      Jose Lamas Rios
      wrote on last edited by
      #2

      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/[^]

      1 Reply Last reply
      0
      • U Usman Tasleem Akshaf

        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.

        J Offline
        J Offline
        Jose Lamas Rios
        wrote on last edited by
        #3

        Try using SW_SHOWNORMAL as the last parameter: ShellExecute(NULL,"open","c:\\myfile.zip",NULL,NULL,SW_SHOWNORMAL); -- jlr http://jlamas.blogspot.com/[^]

        U 1 Reply Last reply
        0
        • J Jose Lamas Rios

          Try using SW_SHOWNORMAL as the last parameter: ShellExecute(NULL,"open","c:\\myfile.zip",NULL,NULL,SW_SHOWNORMAL); -- jlr http://jlamas.blogspot.com/[^]

          U Offline
          U Offline
          Usman Tasleem Akshaf
          wrote on last edited by
          #4

          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.

          K 1 Reply Last reply
          0
          • U Usman Tasleem Akshaf

            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.

            K Offline
            K Offline
            khan
            wrote on last edited by
            #5

            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.

            J 1 Reply Last reply
            0
            • K khan

              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.

              J Offline
              J Offline
              Jose Lamas Rios
              wrote on last edited by
              #6

              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/[^]

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups