windows-shell

Typecast exception from ShellBrowserWindow object to ShellFolderView object

牧云@^-^@ 提交于 2019-12-13 21:21:34
问题 Looking for help trying to figure out why this typecast is not working on my machine. This code was provided as an answer to another question I had and it's not working for me. It works for the answer poster on their machine, but I'm get a an exception on the line trying to typecast from ShellBrowserWindow to ShellFolderView . I am using Visual Studio Express 2013 , running on Windows 7 Pro X64 Sp1 . The target framework for the project is .Net Framework 4 . I've added references to Microsoft

Python file to open a text file and run other python files in the text file

坚强是说给别人听的谎言 提交于 2019-12-13 07:23:42
问题 I have a text file inside which I have paths to a few python files and the arguments that I would specify when I run them in a command prompt. I am looking for a python script that opens up the text file and runs the python programs specified in the text file along with the provided arguments. The text file will look something like `C:\hello.py world C:\square.py 5` 回答1: I don't think this post deserves down voting. But from now on I would suggest to OP to look for a solution yourself, and

don't know how to use IShellWindows::Item correctly

点点圈 提交于 2019-12-13 07:00:47
问题 I'm using VC6 on XP system. The following is my code. It runs perfectly on my computer, but on other computers it seems that pisw->Item(v, &pidisp) doesn't equals to S_OK. Now I'm trying to figure out what's wrong here IShellWindows *pisw; if (SUCCEEDED(CoCreateInstance(CLSID_ShellWindows, NULL, CLSCTX_ALL, IID_IShellWindows, (void**)&pisw))) { VARIANT v; V_VT(&v) = VT_I4; IDispatch *pidisp; found = FALSE; for (V_I4(&v) = 0; !found && pisw->Item(v, &pidisp) == S_OK; V_I4(&v)++) {

How to replicate ShellExecuteEx failure with ERROR_NO_ASSOCIATION error?

放肆的年华 提交于 2019-12-13 02:58:04
问题 My application displays a report to its end-users by composing it into an .htm file that is placed into a user's temp folder (that is derived by calling GetTempPath API). It is then shown to the user with the code as such: //strCmd == file:///C:/Users/UserName/AppData/Local/Temp/My_Report.htm SHELLEXECUTEINFO sei = {0}; sei.cbSize = sizeof(sei); sei.fMask = SEE_MASK_FLAG_NO_UI; sei.nShow = SW_SHOW; sei.lpVerb = L"open"; sei.lpFile = strCmd.GetBuffer(); sei.hwnd = hParentWnd; BOOL bInitialized

Using subprocess.run to run a process on Windows

三世轮回 提交于 2019-12-12 20:03:10
问题 I wish to run the following very lengthy shell command via Python: C:/Users/Alex/Desktop/tableexporter/WGTableExporter.exe "E:/Steam (Games Installed Directly to Hard Drive)/steamapps/common/Wargame Red Dragon/Data/WARGAME/PC/430000626/NDF_Win.dat" pc\ndf\patchable\gfx\everything.ndfbin TAmmunition When I run this as-is from the Windows shell, it works as expected. However, when I attempt to do the same via Python's subprocess.run , it doesn't like it. Here is my input: import subprocess comm

Trying to determine printer status always returns 0 for offline & online printers

时光怂恿深爱的人放手 提交于 2019-12-12 09:41:43
问题 My goal is to determine the current status of a printer. I found the following code. Here's a slightly modified version to fix memory leaks & bugs: #include <Winspool.h> int GetPrinterStatus( char* szPrnName ) { HANDLE hHandle = 0; // Handle of the printer DWORD dwStatus = 0; // Printer status we should receive DWORD dwSize = 0; // Size of memory we should // allocate for PRINTER_INFO_2 PRINTER_INFO_2* pPrnInfo2 = 0; // Structure specifies detailed // printer information DEVMODE DevMode = {0}

Difference between ExtractIcon and ExtractAssociatedIcon? Need to extract icon of specific size

扶醉桌前 提交于 2019-12-12 07:23:34
问题 Say, if I want to extract an icon out of a stock Windows executable. I can get that icon ID by opening it in Visual Studio: Then I'll be interested in a 48x48 size icon: So my assumption was to do: HICON hIcons[4]; ::ExtractIconEx(L"mstsc.exe", -13011, hIcons, NULL, 4); hIconLogo = hIcons[3]; but when I run it, the method returns only 3 icons: and only one of them is a 32x32 version of what I need. I then found ExtractAssociatedIconEx API that I called as such: WORD wIcnId = -13011; WORD

IShellBrowser::BrowseObject isn't called

我是研究僧i 提交于 2019-12-12 05:35:40
问题 I'm trying to implement explorer-like frame in my application. This must work under WinXP too. I've implemented IShellBrowser in my window-class + i've implemented IUnknown interface. My class atributs: IShellViewPtr m_shView; HWND m_wndHolder; CListViewCtrl view; Here is the code of WM_CREATE handler m_hWndClient = view.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE); // view isn't null after it CMessageLoop* pLoop = _Module

How might I obtain an IShellFolder from the active IShellView?

六眼飞鱼酱① 提交于 2019-12-12 04:28:35
问题 I'm trying to enhance a CFileDialog, and we're using the older version of it (the non-vista one that doesn't use IFileDialog). The older one does allow me to obtain an IShellBrowser, as well as (from that) the active IShellView. What I cannot seem to come up with is a way to get "What IShellFolder does that IShellView refer to?" Equally useful would be "What is the current folder that IShellBrowser has made active?" 回答1: I think I may have solved it in a round about fashion: I'm using CDM

Issues trying to display a configuration window for my screensaver (from a GUI app running with high mandatory integrity level)

老子叫甜甜 提交于 2019-12-12 03:34:34
问题 I have an old project that comes with its own screensaver. The GUI application for the project has an option to "Configure screensaver" that should bring up my screensaver configuration window (that you would normally get from a Control Panel -> Display -> Personalization -> Screensaver -> Settings.) To display the configuration window, one needs to call the screensaver process with the /c parameter as described here. The screensaver itself is placed into the system directory, i.e. "C: