windows

In my WPF project installer, how do I bundle the .NET3.5 installer?

I developed some WPF projects, but I met a very serious issue. As you know, the .Net 3.5 installation is a pain (huge and relying on internet access). This is a problem on when we ship my product. Is there a way to bundle the redistribution part only? ...

GCC / C how to hide console window?

**C newbie alert** How do I compile a C app so that it runs without showing a console window on Windows? I'm using Windows XP and GCC 3.4.5 (mingw-vista special r3). I've googled this exhaustively and I've come up with the following which, according to what I've read, sounds like it's supposed to do the trick, but doesn't on my system:...

sending the message Ctrl+Alt+Del from my application

I want to write a small utility in MFC which sends the Ctrl+Alt+Del message to OS. Can any one help me how do I achieve this ? I tried ::PostMessage(HWND_BROADCAST, WM_HOTKEY, 0, MAKELONG( MOD_CONTROL | MOD_ALT, VK_DELETE)); But this is not working. Thanks. I want to Send Ctl+Alt+Del not to invoke TaskMgr.exe. Also, it is for my local...

GCC on Windows: Set "Description" field of C executable?

**C Newbie Alert** How does one set the "Description" property of an executable? By this I mean the value displayed when you right-click an executable in Windows Explorer and it shows "Description:" with what seems to be just the name of the executable without the file extension. I'm running GCC 3.4.5 (mingw-vista special r3) on Window...

custom time zone

Is thee some way of implementing a custom time zone in windows? We have some PCs in Creston, British Columbia, Canada (Time zone exception) which stays the same time all year. So essentially, Creston does not observe a time zone. Can I implement this behavior in windowsÉ ...

How to implement 'open file location' behaviour programmatically (c++ builder)

In Windows Media Player you can right click on a music file and click 'open file location' and it opens an explorer window with the file selected. I want to be able to do this in applications. So given a filename (as an ansi string) I want to be able to go to the file in a new explorer window. ...

How to register a custom keyboard shortcut for a windows application

I want to create a windows utility application, which can be called anytime from within any other application using a keyboard shortcut, e.g.: • WIN + T • CTRL+ T • ALT + T • CTRL+ ALT + T • CTRL+ SHIFT + T What key combinations can I use and how to setup those in the windows registry? (If the shortcut is used by an other applica...

Why do I get E_NOINTERFACE when creating an object that supports that interface?

Note: Using CoGetClassObject, to create multiple objects through a class object for which there is a CLSID in the system registry Single threaded apartment For instance: hresult = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); IClassFactory *pIClassFactory; hresult = CoGetClassObject (clsid, CLSCTX_LOCAL_SERVER, NULL, IID_IClassF...

Server side symbolic link resolution possible?

Title is hopefully pretty self explanatory but I've written up an example anyway: I have a folder C:\SharedFolder\ReallyBigFolderThatWontFitAnyMore I need to move folder to other server but can't touch the clients, so I move the folder to another server and create create a symbolic link. C:\SharedFolder\> mklink /d ReallyBigFolderT...

Retrieve a complete processes list using C#

I am trying to write a C# program to retrieve a complete process list. However I find that an application open a window but I don't see it in the process tab of WinXP task manager, I see it in task tab. In addition, I also cannot get its information using my C# code. static void showProcesses() { Process[] procs = Process.GetProces...

How to find what objects a given CLSID supports

Question: Based on a CLSID, how can I find out what objects (or interfaces) it supports for IClassFactory::CreateInstance Note: Currently using CLSIDFromProgID to obtain CLSID ...

How to run multiple SVN services

Having read Setting up Subversion on Windows I am trying to figure out how to run multiple SVN services on one machine. When I create more then one service using sc create svnP1 ... binpath= "svnserve.exe --service -r c:\svn\repositories\project1" sc create svnP2 ... binpath= "svnserve.exe --service -r c:\svn\repositories\project2" ...

Creating/Opening Events in C++ and checking if they are fired

I have two threads that use an event for synchronization. In each thread they use the same call: ::CreateEvent( NULL,TRUE,FALSE,tcEventName ) The producer thread is the one that makes the call first, while the consumer thread makes the call last, so it's technically opening, not creating the event... I assume. But, when SetEvent is c...

using OpenFileDialog for directory, not FolderBrowserDialog

I want to have a Folder browser in my application, but I don't want to use the FolderBrowserDialog. (For several reasons, such as it's painful to use) I want to use the standard OpenFileDialog, but modified for the directories. As an example, µTorrent has a nice implementation of it (Preferences/Directories/Put new downloads in:). ...

Delete First Line

I need a cmd script that deletes the first line in my text file. the scenario is the following: I take a txt file from FTP everyday, the problem is that it comes with blank line at the top then the headers of the file.. Since I'm importing that file automatically into an access table, that blank line is causing me problems.. So I urgent...

Detect whether current Windows version is 32 bit or 64 bit

Believe it or not my installer is so old that it doesn't have an option to detect the 64 bit version of Windows. Is there a Win DLL call or (even better) an environment variable that would give that info for XP and Vista? One possible solution I see that Wikipedia states that the 64 bit version of XP and Vista have a unique Env Variab...

change boost thread priority

Im trying to change the thread priority in boost but im having no luck. Im getting a bad handle error (type 6) from the GetLastError function. I though native_handle() returned the handle for the thread? Any one know how to do this? void baseThread::applyPriority(uint8 priority) { #ifdef WIN32 if (!m_pThread) return; BOO...

Multibyte character constants and bitmap file header type constants

I have some existing code that I've used to write out an image to a bitmap file. One of the lines of code looks like this: bfh.bfType='MB'; I think I probably copied that from somewhere. One of the other devs says to me "that doesn't look right, isn't it supposed to be 'BM'?" Anyway it does seem to work ok, but on code review it gets ...

What's the best way to fork/thread in PHP on Win?

I have a php script that checks for updates on many (thousands) of sites. On occasion (more frequently as the number of sites increases), I get an execution timeout on the update of one of these sites, and the whole script goes down the drain. The best idea I could come up with is to fork each update, so if it dies, the overall update j...

Using MCI to play avi stream from memory

Hi, I am trying to play a compressed AVI file using MCI in C#. So far I was able to play it by opening the file. The way I opened the file is this: String opencommand = "open \"" + file + "\" type mpegvideo alias someMovie shareable"; int error; error = Avi.mciSendString(opencommand, null, 0, IntPtr.Zero); Where "file" is th...