windows-7

How to set the paper size using the WinSpool API?

我是研究僧i 提交于 2019-12-10 17:50:57
问题 I can't use the XPS API since the program has to be able to print on Windows XP. I'm trying to set the paper size from Letter to A4 using WinSpool. This is my test code: var H : THandle; I : TBytes; Info : PPrinterInfo2; NeededSize : DWORD; DevMode : PDeviceMode; PD : TPrinterDefaults; begin PD.pDatatype := nil; PD.pDevMode := nil; PD.DesiredAccess := PRINTER_ACCESS_ADMINISTER; if not OpenPrinter('Brother HL-5350DN series Printer', H, @PD) then begin raise Exception.Create('OpenPrinter error:

SVN+SSH checkout over VPN using tortoise SVN, Smartsvn failing

主宰稳场 提交于 2019-12-10 17:48:36
问题 System & connection details I am using a 64-bit system running Windows 7. I have Open VPN and Tortoise SVN 64-bit installed. The repository is in a remote system, and we connect using VPN. What I have done so far I have followed the necessary steps to initiate the VPN connection - Added some project specific config files inside the config folder of the Open VPN installation path. Took these files from working setup of team members. Initiated Open VPN connection using a user. ran Putty's

MS Word opens documents hosted on WebDav share read-only on Windows Vista and 7 but only if no other webdav connections are open

南笙酒味 提交于 2019-12-10 17:45:19
问题 We have a WebDav server with some Word documents on it. (We are using PHP's HTTP_WebDAV_Server but get the same issue on tests with Apache mod_dav - both use digest authentication, basic auth doesn't work on Vista or later) We have a web page that opens the word documents using javascript like: Doc = new ActiveXObject("Sharepoint.OpenDocuments.3"); Doc.EditDocument(url, 'Word.Document'); which causes word to connect to the webdav server and open the document, bypassing IE and most of windows

Need to get Start Menu Paths in Java

蓝咒 提交于 2019-12-10 17:41:36
问题 Using java, I would like some code that could get me the paths for: 1) Start Menu for Current User 2) Start Menu for All User I need the answer for both WinXP and Win7. So hopefully there is a general answer that can get me both. 回答1: You have no other choice but to write a DLL and call native Windows API: SHGetFolderPath (NULL, CSIDL_PROGRAMS, NULL, SHGFP_TYPE_CURRENT, &szPathBuffer) SHGetFolderPath(NULL, CSIDL_COMMON_PROGRAMS, NULL, SHGFP_TYPE_CURRENT, &szPathBuffer) If you really need the

How does one detect when the wallpaper has changed (Windows XP or greater)?

一曲冷凌霜 提交于 2019-12-10 17:33:53
问题 I have figured out how to change the desktop wallpaper (there are dozens of examples on the Internet.) One thing that still eludes me: how do I detect when the wallpaper has changed? (Say via the Display control panel or another program changing it.) 回答1: Add a message handler for WM_SETTINGCHANGE, SystemEvents.UserPreferenceChanged in .NET. Check if the wallpaper is still the same. 回答2: Here is an example in C# to retrieve the wallpaper. All you would need to add is some additional code to

shcore.dll on Windows 7 — does it exist?

二次信任 提交于 2019-12-10 16:45:39
问题 I am trying to use this function, but I don't have shcore.dll and I can't figure out where to get it. Is shcore.dll just a Windows 10 DLL? [DllImport("Shcore.dll")] internal static extern IntPtr GetDpiForMonitor( [In] IntPtr hmonitor, [In] MonitorDpiType dpiType, [Out] out uint dpiX, [Out] out uint dpiY); 回答1: It is not available on Windows 7. Windows 8.1 or newer is required based on Microsoft's documentation. 来源: https://stackoverflow.com/questions/37058349/shcore-dll-on-windows-7-does-it

“pin to desktop” in Win 7, XP compatible

泄露秘密 提交于 2019-12-10 16:37:22
问题 How could I achieve "pin to desktop" effect (i.e immune against "Show Desktop" command) in Win 7, using FindWindow + SetParent approach, or any other approach that would work in XP as well ? I know I could create a gadget, but I'd like to have backwards compatibility with XP, where I have this code doing it fine: IntPtr hWnd = FindWindow(null, "Untitled - Notepad"); IntPtr hDesktop = FindWindow("ProgMan", "Program Manager"); SetParent(hWnd, hDesktop); 回答1: in my WPF app, I was able to solve

QApplication::setWindowIcon works on Windows XP, but does not work on Windows 7

喜你入骨 提交于 2019-12-10 16:00:55
问题 In a simple Qt application starting like this: int main(int argc, char* argv[]) { QApplication app(argc, argv); app.setWindowIcon(QIcon(":/qapp/appicon.ico")); ... we set the icon in the second line (this line and icon file in resources is the only difference between my test program and application generated by Qt wizard). This application works perfect on Windows XP, but on Windows 7 we can't see our icon in top-left corner of the window (system shows default icon instead of my appicon.ico).

command to wake up the windows system after sleep command

我与影子孤独终老i 提交于 2019-12-10 15:54:35
问题 This question was migrated from Super User because it can be answered on Stack Overflow. Migrated 4 years ago . From C# program I want to call windows command prompt and make the system to sleep and after few seconds I should wake the system. I am successful in making the system sleep but I can't wake it up after few seconds. The command that I tried for making it sleep and wake up is "powrprof.dll,SetSuspendState 0,1,0 && timeout 10 && echo "Hello World" ". The link http://www.groovypost.com

How can a java application running on windows 7 choose which network adapter to use

走远了吗. 提交于 2019-12-10 15:28:47
问题 Hi I am writing an application for a device -- tablet -- running windows 7. The application is being written in java. The application needs to be aware of which networking adapter is available (WIFI, 3G, etc ...) Is there a java library similar to the one developed for android -- android.net, android.net.wifi, etc ... -- In brief, How can a java application running on windows 7 choose which network adapter to use ? Thank you! 回答1: You can see which Network Interfaces are available using java