Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^5: Win32 wperl open Console when system

by afoken (Chancellor)
on Jan 21, 2020 at 14:58 UTC ( [id://11111684]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Win32 wperl open Console when system
in thread Win32 wperl open Console when system

The "normal" way to open any file on Windows is to invoke ShellExecute() with hwnd set to 0, lpOperation set to NULL or to "open", lpFile set to the file to be opened, lpParameters and lpDirectory set to NULL, and nShowCmd set to SW_SHOWNORMAL.

In other words:

/* In C/C++: */ ShellExecute(0, NULL, file, NULL, NULL, SW_SHOWNORMAL); // request def +ault action ShellExecute(0, "open", file, NULL, NULL, SW_SHOWNORMAL); // request o +pen ShellExecute(0, "print", file, NULL, NULL, SW_SHOWNORMAL); // request +printing

This should be equal to a double click on the respective file.

I'm to lazy to search for a module exporting ShellExecute(), Win32::API should be able to import that function from shell32.dll.

Update: Win32::FileOp exports ShellExecute(). Win32::GUI also has a ShellExecute() method, burried somewhere.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11111684]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-04-24 12:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found