shellexecute

WOW64 woes (.lnk shortcuts)

泪湿孤枕 提交于 2020-01-13 13:11:29
问题 I'm using Windows 7 (x64) and Delphi 2010. I'm writing a component that will emulate the start menu. However, I've run into the following problems: If I attempt to open a shortcut (.lnk file) with ShellExecute , this will fail whenever %ProgramFiles% is part of the target path of the shortcut (it will then look at the C:\Program Files (x86) folder instead of C:\Program Files ); ShGetFileInfo fails to extract the correct index of the icon in the system image list if %ProgramFiles% is part of

Lua os.execute return value

ぐ巨炮叔叔 提交于 2020-01-11 17:09:34
问题 Is it possible to read the following from the local variable in Lua? local t = os.execute("echo 'test'") print(t) I just want to achieve this: whatever is executed via the ox.execute and will return any value, I would like to use it in Lua - for example echo 'test' will output test in the bash command line - is that possible to get the returned value ( test in this case) to the Lua local variable? 回答1: You can use io.popen() instead. This returns a file handle you can use to read the output

Lua os.execute return value

核能气质少年 提交于 2020-01-11 17:09:09
问题 Is it possible to read the following from the local variable in Lua? local t = os.execute("echo 'test'") print(t) I just want to achieve this: whatever is executed via the ox.execute and will return any value, I would like to use it in Lua - for example echo 'test' will output test in the bash command line - is that possible to get the returned value ( test in this case) to the Lua local variable? 回答1: You can use io.popen() instead. This returns a file handle you can use to read the output

Delphi ShellExecute not working in Windows 7

六眼飞鱼酱① 提交于 2020-01-04 05:17:39
问题 I just KNOW this is something simple, but I've tried all of the suggestions I could find on this forum, and I still can't get the following ShellExecute statements, which worked perfectly well for four years on XP, to work in Windows 7. Any suggestions gratefully received! ShellExecute(Handle, 'open', PChar('command.com'), PChar('/c ftp -s:c:\checkout\WebFTPParams.txt 91.208.99.4'), Nil, SW_SHOW); ShellExecute(Handle, 'open', PChar('command.com'), PChar('/c ftp -s:c:\checkout\WWFTPParams.txt

Strange file-permissions if apps run as administrator

大兔子大兔子 提交于 2020-01-04 05:17:28
问题 My program must be run as administrator and creates some files. If I run it manually by right-click on the icon and selecting "run as administrator" -- everything okay -- all users have access to created files. But if program launched from the another program by ShellExecuteEx with "runas" verb -- created files have no access entry for BUILTIN\Users group. Only administrator users can read those files. 回答1: Why not setup the linker flag (VC2008 and higher): Linker -> Manifest -> UAC Execution

Strange file-permissions if apps run as administrator

♀尐吖头ヾ 提交于 2020-01-04 05:17:12
问题 My program must be run as administrator and creates some files. If I run it manually by right-click on the icon and selecting "run as administrator" -- everything okay -- all users have access to created files. But if program launched from the another program by ShellExecuteEx with "runas" verb -- created files have no access entry for BUILTIN\Users group. Only administrator users can read those files. 回答1: Why not setup the linker flag (VC2008 and higher): Linker -> Manifest -> UAC Execution

Delphi ShellExecute not working in Windows 7

牧云@^-^@ 提交于 2020-01-04 05:17:06
问题 I just KNOW this is something simple, but I've tried all of the suggestions I could find on this forum, and I still can't get the following ShellExecute statements, which worked perfectly well for four years on XP, to work in Windows 7. Any suggestions gratefully received! ShellExecute(Handle, 'open', PChar('command.com'), PChar('/c ftp -s:c:\checkout\WebFTPParams.txt 91.208.99.4'), Nil, SW_SHOW); ShellExecute(Handle, 'open', PChar('command.com'), PChar('/c ftp -s:c:\checkout\WWFTPParams.txt

Open URL with ShellExecute - SW_SHOWMAXIMIZED dont active window in C++

两盒软妹~` 提交于 2020-01-02 08:18:15
问题 I used this function to open new tab in Chrome and active it: ShellExecuteA(0,0,"chrome.exe","http://google.com --incognito",0,SW_SHOWMAXIMIZED); but Chrome only open new tab but it doesnt active window. (I call this function from global keyboard-hook of an application with no user interface, if user press specified key). How I can fix it? 回答1: Looks like a bug in chrome.exe. I could repro with your ShellExecute call from a simple console app, if a regular (non-incognito) chrome.exe session

How to launch a URL when an email arrives

天大地大妈咪最大 提交于 2020-01-01 15:31:29
问题 I would like to launch a URL when an email arrives in Outlook. I setup a rule and have it trigger a script function. It looks like I want to call ShellExecute to launch the URL in a browser, but when I hit this line: ShellExecute(0&, "open", URL, vbNullString, vbNullString, _ vbNormalFocus) The method is not defined. Any ideas? 回答1: ShellExecute is a function in a windows dll. You need to add a declaration for it like this in a VBA module: Public Declare Function ShellExecute Lib "shell32.dll

How to launch a URL when an email arrives

好久不见. 提交于 2020-01-01 15:31:28
问题 I would like to launch a URL when an email arrives in Outlook. I setup a rule and have it trigger a script function. It looks like I want to call ShellExecute to launch the URL in a browser, but when I hit this line: ShellExecute(0&, "open", URL, vbNullString, vbNullString, _ vbNormalFocus) The method is not defined. Any ideas? 回答1: ShellExecute is a function in a windows dll. You need to add a declaration for it like this in a VBA module: Public Declare Function ShellExecute Lib "shell32.dll