ShellExecute()
-
I'm sorry for the generalization, but I need help using the ShellExecute() function (to launch a .hlp file). ShellExecute( ?, "open", "Helpfile.hlp", NULL, ?, //dir SW_SHOW ); I put a '?' where I don't know what I should put :) The first is the window handle thingy, I really don't want the opened file attached to anything, how do i do this? The second ? is the directory... I have no idea what to set this too. If it's the programs current dir, how do i find that? Thanks
-
I'm sorry for the generalization, but I need help using the ShellExecute() function (to launch a .hlp file). ShellExecute( ?, "open", "Helpfile.hlp", NULL, ?, //dir SW_SHOW ); I put a '?' where I don't know what I should put :) The first is the window handle thingy, I really don't want the opened file attached to anything, how do i do this? The second ? is the directory... I have no idea what to set this too. If it's the programs current dir, how do i find that? Thanks
briefcase wrote: The first is the window handle thingy, I really don't want the opened file attached to anything, how do i do this? Simply put NULL there! It works just fine! briefcase wrote: The second ? is the directory... I have no idea what to set this too. If it's the programs current dir, how do i find that? Simply put NULL there too! Those aren't necessary when you do such a thing that you do! :) Rickard Andersson@Suza Computing C# and C++ programmer from SWEDEN! UIN: 50302279 E-Mail: nikado@pc.nu Speciality: I love C#, ASP.NET and C++!
-
I'm sorry for the generalization, but I need help using the ShellExecute() function (to launch a .hlp file). ShellExecute( ?, "open", "Helpfile.hlp", NULL, ?, //dir SW_SHOW ); I put a '?' where I don't know what I should put :) The first is the window handle thingy, I really don't want the opened file attached to anything, how do i do this? The second ? is the directory... I have no idea what to set this too. If it's the programs current dir, how do i find that? Thanks
-
briefcase wrote: The first is the window handle thingy, I really don't want the opened file attached to anything, how do i do this? Simply put NULL there! It works just fine! briefcase wrote: The second ? is the directory... I have no idea what to set this too. If it's the programs current dir, how do i find that? Simply put NULL there too! Those aren't necessary when you do such a thing that you do! :) Rickard Andersson@Suza Computing C# and C++ programmer from SWEDEN! UIN: 50302279 E-Mail: nikado@pc.nu Speciality: I love C#, ASP.NET and C++!
-
hmm... alright, what am i doing wrong? ShellExecute( NULL, "open", "myhelp.hlp", NULL, NULL, //dir SW_SHOW ); myhelp.hlp exists in the same dir as the calling program.
-
I'm sorry for the generalization, but I need help using the ShellExecute() function (to launch a .hlp file). ShellExecute( ?, "open", "Helpfile.hlp", NULL, ?, //dir SW_SHOW ); I put a '?' where I don't know what I should put :) The first is the window handle thingy, I really don't want the opened file attached to anything, how do i do this? The second ? is the directory... I have no idea what to set this too. If it's the programs current dir, how do i find that? Thanks
HWND(0) for the first argument - then any windows are parented by the desktop NULL is usually fine for the directory parameter - it's the 'default directory' (i.e. if you were at the command prompt, it's what would be listed if you did 'dir .'), which is usually not needed if you've specified an absolute path (i.e. drive:\path...\filename.extension or \\server\path...\filename.extension for the file parameter). To get the current directory (if you need to), use the
GetCurrentDirectory
Win32 function. Stuart Dootson 'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'